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.



1530
1531
1532
# File 'lib/google/apis/apihub_v1/classes.rb', line 1530

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`



1492
1493
1494
# File 'lib/google/apis/apihub_v1/classes.rb', line 1492

def attributes
  @attributes
end

#create_timeString

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

Returns:

  • (String)


1497
1498
1499
# File 'lib/google/apis/apihub_v1/classes.rb', line 1497

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)


1503
1504
1505
# File 'lib/google/apis/apihub_v1/classes.rb', line 1503

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



1511
1512
1513
# File 'lib/google/apis/apihub_v1/classes.rb', line 1511

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)


1518
1519
1520
# File 'lib/google/apis/apihub_v1/classes.rb', line 1518

def spec
  @spec
end

#typeString

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

Returns:

  • (String)


1523
1524
1525
# File 'lib/google/apis/apihub_v1/classes.rb', line 1523

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)


1528
1529
1530
# File 'lib/google/apis/apihub_v1/classes.rb', line 1528

def update_time
  @update_time
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1535
1536
1537
1538
1539
1540
1541
1542
1543
# File 'lib/google/apis/apihub_v1/classes.rb', line 1535

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