Class: Google::Apis::ApihubV1::GoogleCloudApihubV1Definition

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

Represents a definition for example schema, request, response definitions contained in an API version. A definition is added/updated/deleted in an API version when a new spec is added or an existing spec is updated/deleted in a version. Currently, definition will be created only corresponding to OpenAPI spec as parsing is supported for OpenAPI spec. Also, within OpenAPI spec, only schema object is supported.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudApihubV1Definition

Returns a new instance of GoogleCloudApihubV1Definition.



1596
1597
1598
# File 'lib/google/apis/apihub_v1/classes.rb', line 1596

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

Instance Attribute Details

#attributesHash<String,Google::Apis::ApihubV1::GoogleCloudApihubV1AttributeValues>

Optional. The list of user defined attributes associated with the definition resource. The key is the attribute name. It will be of the format: projects/ project/locations/location/attributes/attribute`. The value is the attribute values associated with the resource. Corresponds to the JSON propertyattributes`



1558
1559
1560
# File 'lib/google/apis/apihub_v1/classes.rb', line 1558

def attributes
  @attributes
end

#create_timeString

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

Returns:

  • (String)


1563
1564
1565
# File 'lib/google/apis/apihub_v1/classes.rb', line 1563

def create_time
  @create_time
end

#nameString

Identifier. The name of the definition. Format: projects/project/locations/ location/apis/api/versions/version/definitions/definition` Corresponds to the JSON propertyname`

Returns:

  • (String)


1569
1570
1571
# File 'lib/google/apis/apihub_v1/classes.rb', line 1569

def name
  @name
end

#schemaGoogle::Apis::ApihubV1::GoogleCloudApihubV1Schema

The schema details derived from the spec. Currently, this entity is supported for OpenAPI spec only. For OpenAPI spec, this maps to the schema defined in the definitions section for OpenAPI 2.0 version and in components.schemas section for OpenAPI 3.0 and 3.1 version. Corresponds to the JSON property schema



1577
1578
1579
# File 'lib/google/apis/apihub_v1/classes.rb', line 1577

def schema
  @schema
end

#specString

Output only. The name of the spec from where the definition was parsed. Format is projects/project/locations/location/apis/api/versions/version/ specs/spec` Corresponds to the JSON propertyspec`

Returns:

  • (String)


1584
1585
1586
# File 'lib/google/apis/apihub_v1/classes.rb', line 1584

def spec
  @spec
end

#typeString

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

Returns:

  • (String)


1589
1590
1591
# File 'lib/google/apis/apihub_v1/classes.rb', line 1589

def type
  @type
end

#update_timeString

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

Returns:

  • (String)


1594
1595
1596
# File 'lib/google/apis/apihub_v1/classes.rb', line 1594

def update_time
  @update_time
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1601
1602
1603
1604
1605
1606
1607
1608
1609
# File 'lib/google/apis/apihub_v1/classes.rb', line 1601

def update!(**args)
  @attributes = args[:attributes] if args.key?(:attributes)
  @create_time = args[:create_time] if args.key?(:create_time)
  @name = args[:name] if args.key?(:name)
  @schema = args[:schema] if args.key?(:schema)
  @spec = args[:spec] if args.key?(:spec)
  @type = args[:type] if args.key?(:type)
  @update_time = args[:update_time] if args.key?(:update_time)
end