Google Cloud Api Hub V1 Client - Class Attribute (0.4.1)
Stay organized with collections
Save and categorize content based on your preferences.
Reference documentation and code samples for the Google Cloud Api Hub V1 Client class 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.
Generated from protobuf message google.cloud.apihub.v1.Attribute
Namespace
Google \ Cloud \ ApiHub \ V1Methods
__construct
Constructor.
| Parameters | |
|---|---|
| Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ name |
string
Identifier. The name of the attribute in the API Hub. Format: |
↳ display_name |
string
Required. The display name of the attribute. |
↳ description |
string
Optional. The description of the attribute. |
↳ definition_type |
int
Output only. The definition type of the attribute. |
↳ scope |
int
Required. The scope of the attribute. It represents the resource in the API Hub to which the attribute can be linked. |
↳ data_type |
int
Required. The type of the data of the attribute. |
↳ allowed_values |
array<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 |
int
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. |
↳ mandatory |
bool
Output only. When mandatory is true, the attribute is mandatory for the resource specified in the scope. Only System defined attributes can be mandatory. |
↳ create_time |
Google\Protobuf\Timestamp
Output only. The time at which the attribute was created. |
↳ update_time |
Google\Protobuf\Timestamp
Output only. The time at which the attribute was last updated. |
getName
Identifier. The name of the attribute in the API Hub.
Format:
projects/{project}/locations/{location}/attributes/{attribute}
| Returns | |
|---|---|
| Type | Description |
string |
|
setName
Identifier. The name of the attribute in the API Hub.
Format:
projects/{project}/locations/{location}/attributes/{attribute}
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getDisplayName
Required. The display name of the attribute.
| Returns | |
|---|---|
| Type | Description |
string |
|
setDisplayName
Required. The display name of the attribute.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getDescription
Optional. The description of the attribute.
| Returns | |
|---|---|
| Type | Description |
string |
|
setDescription
Optional. The description of the attribute.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getDefinitionType
Output only. The definition type of the attribute.
| Returns | |
|---|---|
| Type | Description |
int |
Enum of type DefinitionType. |
setDefinitionType
Output only. The definition type of the attribute.
| Parameter | |
|---|---|
| Name | Description |
var |
int
Enum of type DefinitionType. |
| Returns | |
|---|---|
| Type | Description |
$this |
|
getScope
Required. The scope of the attribute. It represents the resource in the API Hub to which the attribute can be linked.
| Returns | |
|---|---|
| Type | Description |
int |
Enum of type Scope. |
setScope
Required. The scope of the attribute. It represents the resource in the API Hub to which the attribute can be linked.
| Parameter | |
|---|---|
| Name | Description |
var |
int
Enum of type Scope. |
| Returns | |
|---|---|
| Type | Description |
$this |
|
getDataType
Required. The type of the data of the attribute.
| Returns | |
|---|---|
| Type | Description |
int |
Enum of type DataType. |
setDataType
Required. The type of the data of the attribute.
| Parameter | |
|---|---|
| Name | Description |
var |
int
Enum of type DataType. |
| Returns | |
|---|---|
| Type | Description |
$this |
|
getAllowedValues
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 | |
|---|---|
| Type | Description |
Google\Protobuf\Internal\RepeatedField |
|
setAllowedValues
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.
| Parameter | |
|---|---|
| Name | Description |
var |
array<Attribute\AllowedValue>
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getCardinality
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 | |
|---|---|
| Type | Description |
int |
|
setCardinality
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.
| Parameter | |
|---|---|
| Name | Description |
var |
int
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getMandatory
Output only. When mandatory is true, the attribute is mandatory for the resource specified in the scope. Only System defined attributes can be mandatory.
| Returns | |
|---|---|
| Type | Description |
bool |
|
setMandatory
Output only. When mandatory is true, the attribute is mandatory for the resource specified in the scope. Only System defined attributes can be mandatory.
| Parameter | |
|---|---|
| Name | Description |
var |
bool
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getCreateTime
Output only. The time at which the attribute was created.
| Returns | |
|---|---|
| Type | Description |
Google\Protobuf\Timestamp|null |
|
hasCreateTime
clearCreateTime
setCreateTime
Output only. The time at which the attribute was created.
| Parameter | |
|---|---|
| Name | Description |
var |
Google\Protobuf\Timestamp
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getUpdateTime
Output only. The time at which the attribute was last updated.
| Returns | |
|---|---|
| Type | Description |
Google\Protobuf\Timestamp|null |
|
hasUpdateTime
clearUpdateTime
setUpdateTime
Output only. The time at which the attribute was last updated.
| Parameter | |
|---|---|
| Name | Description |
var |
Google\Protobuf\Timestamp
|
| Returns | |
|---|---|
| Type | Description |
$this |
|