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.



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

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



879
880
881
# File 'lib/google/apis/apihub_v1/classes.rb', line 879

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)


888
889
890
# File 'lib/google/apis/apihub_v1/classes.rb', line 888

def cardinality
  @cardinality
end

#create_timeString

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

Returns:

  • (String)


893
894
895
# File 'lib/google/apis/apihub_v1/classes.rb', line 893

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)


898
899
900
# File 'lib/google/apis/apihub_v1/classes.rb', line 898

def data_type
  @data_type
end

#definition_typeString

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

Returns:

  • (String)


903
904
905
# File 'lib/google/apis/apihub_v1/classes.rb', line 903

def definition_type
  @definition_type
end

#descriptionString

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

Returns:

  • (String)


908
909
910
# File 'lib/google/apis/apihub_v1/classes.rb', line 908

def description
  @description
end

#display_nameString

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

Returns:

  • (String)


913
914
915
# File 'lib/google/apis/apihub_v1/classes.rb', line 913

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)


920
921
922
# File 'lib/google/apis/apihub_v1/classes.rb', line 920

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)


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

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)


933
934
935
# File 'lib/google/apis/apihub_v1/classes.rb', line 933

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)


938
939
940
# File 'lib/google/apis/apihub_v1/classes.rb', line 938

def update_time
  @update_time
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



945
946
947
948
949
950
951
952
953
954
955
956
957
# File 'lib/google/apis/apihub_v1/classes.rb', line 945

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