1.2.0 (latest) 1.1.0 1.0.3 0.10.0 0.9.0 0.8.0 0.7.0 0.6.0 0.5.0 0.4.1 0.3.0 0.2.0 0.1.1 Reference documentation and code samples for the API hub V1 API class Google::Cloud::ApiHub::V1::Attribute.

An attribute in the API Hub.
An attribute is a name value pair which can be attached to different
resources in the API hub based on the scope of the attribute. Attributes can
either be pre-defined by the API Hub or created by users.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #allowed_values

    def allowed_values() -> ::Array<::Google::Cloud::ApiHub::V1::Attribute::AllowedValue>

**Returns**

- (::Array\<[::Google::Cloud::ApiHub::V1::Attribute::AllowedValue](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-Attribute-AllowedValue)\>) --- Optional. The list of allowed values when the attribute value is of type enum. This is required when the data_type of the attribute is ENUM. The maximum number of allowed values of an attribute will be 1000.

### #allowed_values=

    def allowed_values=(value) -> ::Array<::Google::Cloud::ApiHub::V1::Attribute::AllowedValue>

**Parameter**

- **value** (::Array\<[::Google::Cloud::ApiHub::V1::Attribute::AllowedValue](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-Attribute-AllowedValue)\>) --- Optional. The list of allowed values when the attribute value is of type enum. This is required when the data_type of the attribute is ENUM. The maximum number of allowed values of an attribute will be 1000.
**Returns**

- (::Array\<[::Google::Cloud::ApiHub::V1::Attribute::AllowedValue](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-Attribute-AllowedValue)\>) --- Optional. The list of allowed values when the attribute value is of type enum. This is required when the data_type of the attribute is ENUM. The maximum number of allowed values of an attribute will be 1000.

### #cardinality

    def cardinality() -> ::Integer

**Returns**

- (::Integer) --- Optional. The maximum number of values that the attribute can have when associated with an API Hub resource. Cardinality 1 would represent a single-valued attribute. It must not be less than 1 or greater than 20. If not specified, the cardinality would be set to 1 by default and represent a single-valued attribute.

### #cardinality=

    def cardinality=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- Optional. The maximum number of values that the attribute can have when associated with an API Hub resource. Cardinality 1 would represent a single-valued attribute. It must not be less than 1 or greater than 20. If not specified, the cardinality would be set to 1 by default and represent a single-valued attribute.
**Returns**

- (::Integer) --- Optional. The maximum number of values that the attribute can have when associated with an API Hub resource. Cardinality 1 would represent a single-valued attribute. It must not be less than 1 or greater than 20. If not specified, the cardinality would be set to 1 by default and represent a single-valued attribute.

### #create_time

    def create_time() -> ::Google::Protobuf::Timestamp

**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Protobuf-Timestamp)) --- Output only. The time at which the attribute was created.

### #data_type

    def data_type() -> ::Google::Cloud::ApiHub::V1::Attribute::DataType

**Returns**

- ([::Google::Cloud::ApiHub::V1::Attribute::DataType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-Attribute-DataType)) --- Required. The type of the data of the attribute.

### #data_type=

    def data_type=(value) -> ::Google::Cloud::ApiHub::V1::Attribute::DataType

**Parameter**

- **value** ([::Google::Cloud::ApiHub::V1::Attribute::DataType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-Attribute-DataType)) --- Required. The type of the data of the attribute.
**Returns**

- ([::Google::Cloud::ApiHub::V1::Attribute::DataType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-Attribute-DataType)) --- Required. The type of the data of the attribute.

### #definition_type

    def definition_type() -> ::Google::Cloud::ApiHub::V1::Attribute::DefinitionType

**Returns**

- ([::Google::Cloud::ApiHub::V1::Attribute::DefinitionType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-Attribute-DefinitionType)) --- Output only. The definition type of the attribute.

### #description

    def description() -> ::String

**Returns**

- (::String) --- Optional. The description of the attribute.

### #description=

    def description=(value) -> ::String

**Parameter**

- **value** (::String) --- Optional. The description of the attribute.
**Returns**

- (::String) --- Optional. The description of the attribute.

### #display_name

    def display_name() -> ::String

**Returns**

- (::String) --- Required. The display name of the attribute.

### #display_name=

    def display_name=(value) -> ::String

**Parameter**

- **value** (::String) --- Required. The display name of the attribute.
**Returns**

- (::String) --- Required. The display name of the attribute.

### #mandatory

    def mandatory() -> ::Boolean

**Returns**

- (::Boolean) --- Output only. When mandatory is true, the attribute is mandatory for the resource specified in the scope. Only System defined attributes can be mandatory.

### #name

    def name() -> ::String

**Returns**

- (::String) --- Identifier. The name of the attribute in the API Hub.

  Format:
  `projects/{project}/locations/{location}/attributes/{attribute}`

### #name=

    def name=(value) -> ::String

**Parameter**

- **value** (::String) --- Identifier. The name of the attribute in the API Hub.


  Format:
  `projects/{project}/locations/{location}/attributes/{attribute}`
**Returns**

- (::String) --- Identifier. The name of the attribute in the API Hub.

  Format:
  `projects/{project}/locations/{location}/attributes/{attribute}`

### #scope

    def scope() -> ::Google::Cloud::ApiHub::V1::Attribute::Scope

**Returns**

- ([::Google::Cloud::ApiHub::V1::Attribute::Scope](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-Attribute-Scope)) --- Required. The scope of the attribute. It represents the resource in the API Hub to which the attribute can be linked.

### #scope=

    def scope=(value) -> ::Google::Cloud::ApiHub::V1::Attribute::Scope

**Parameter**

- **value** ([::Google::Cloud::ApiHub::V1::Attribute::Scope](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-Attribute-Scope)) --- Required. The scope of the attribute. It represents the resource in the API Hub to which the attribute can be linked.
**Returns**

- ([::Google::Cloud::ApiHub::V1::Attribute::Scope](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Cloud-ApiHub-V1-Attribute-Scope)) --- Required. The scope of the attribute. It represents the resource in the API Hub to which the attribute can be linked.

### #update_time

    def update_time() -> ::Google::Protobuf::Timestamp

**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-api_hub-v1/latest/Google-Protobuf-Timestamp)) --- Output only. The time at which the attribute was last updated.