Class: Google::Apis::ApihubV1::GoogleCloudApihubV1Attribute

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/apihub_v1/classes.rb,
lib/google/apis/apihub_v1/representations.rb,
lib/google/apis/apihub_v1/representations.rb

Overview

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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudApihubV1Attribute

Returns a new instance of GoogleCloudApihubV1Attribute.



987
988
989
# File 'lib/google/apis/apihub_v1/classes.rb', line 987

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#allowed_valuesArray<Google::Apis::ApihubV1::GoogleCloudApihubV1AllowedValue>

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. Corresponds to the JSON property allowedValues



926
927
928
# File 'lib/google/apis/apihub_v1/classes.rb', line 926

def allowed_values
  @allowed_values
end

#cardinalityFixnum

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. Corresponds to the JSON property cardinality

Returns:

  • (Fixnum)


935
936
937
# File 'lib/google/apis/apihub_v1/classes.rb', line 935

def cardinality
  @cardinality
end

#create_timeString

Output only. The time at which the attribute was created. Corresponds to the JSON property createTime

Returns:

  • (String)


940
941
942
# File 'lib/google/apis/apihub_v1/classes.rb', line 940

def create_time
  @create_time
end

#data_typeString

Required. The type of the data of the attribute. Corresponds to the JSON property dataType

Returns:

  • (String)


945
946
947
# File 'lib/google/apis/apihub_v1/classes.rb', line 945

def data_type
  @data_type
end

#definition_typeString

Output only. The definition type of the attribute. Corresponds to the JSON property definitionType

Returns:

  • (String)


950
951
952
# File 'lib/google/apis/apihub_v1/classes.rb', line 950

def definition_type
  @definition_type
end

#descriptionString

Optional. The description of the attribute. Corresponds to the JSON property description

Returns:

  • (String)


955
956
957
# File 'lib/google/apis/apihub_v1/classes.rb', line 955

def description
  @description
end

#display_nameString

Required. The display name of the attribute. Corresponds to the JSON property displayName

Returns:

  • (String)


960
961
962
# File 'lib/google/apis/apihub_v1/classes.rb', line 960

def display_name
  @display_name
end

#mandatoryBoolean Also known as: mandatory?

Output only. When mandatory is true, the attribute is mandatory for the resource specified in the scope. Only System defined attributes can be mandatory. Corresponds to the JSON property mandatory

Returns:

  • (Boolean)


967
968
969
# File 'lib/google/apis/apihub_v1/classes.rb', line 967

def mandatory
  @mandatory
end

#nameString

Identifier. The name of the attribute in the API Hub. Format: projects/ project/locations/location/attributes/attribute` Corresponds to the JSON propertyname`

Returns:

  • (String)


974
975
976
# File 'lib/google/apis/apihub_v1/classes.rb', line 974

def name
  @name
end

#scopeString

Required. The scope of the attribute. It represents the resource in the API Hub to which the attribute can be linked. Corresponds to the JSON property scope

Returns:

  • (String)


980
981
982
# File 'lib/google/apis/apihub_v1/classes.rb', line 980

def scope
  @scope
end

#update_timeString

Output only. The time at which the attribute was last updated. Corresponds to the JSON property updateTime

Returns:

  • (String)


985
986
987
# File 'lib/google/apis/apihub_v1/classes.rb', line 985

def update_time
  @update_time
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
# File 'lib/google/apis/apihub_v1/classes.rb', line 992

def update!(**args)
  @allowed_values = args[:allowed_values] if args.key?(:allowed_values)
  @cardinality = args[:cardinality] if args.key?(:cardinality)
  @create_time = args[:create_time] if args.key?(:create_time)
  @data_type = args[:data_type] if args.key?(:data_type)
  @definition_type = args[:definition_type] if args.key?(:definition_type)
  @description = args[:description] if args.key?(:description)
  @display_name = args[:display_name] if args.key?(:display_name)
  @mandatory = args[:mandatory] if args.key?(:mandatory)
  @name = args[:name] if args.key?(:name)
  @scope = args[:scope] if args.key?(:scope)
  @update_time = args[:update_time] if args.key?(:update_time)
end