Skip to content

Commit

Permalink
Add missing attributes envelope in ListAPIs response (#1856)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Jun 18, 2024
1 parent 22f1cb0 commit 36b1c23
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 18 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-06-14 20:53:07.528997",
"spec_repo_commit": "2d7b3f3a"
"regenerated": "2024-06-17 09:21:26.060353",
"spec_repo_commit": "743cf92b"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-06-14 20:53:07.546966",
"spec_repo_commit": "2d7b3f3a"
"regenerated": "2024-06-17 09:21:26.078594",
"spec_repo_commit": "743cf92b"
}
}
}
6 changes: 6 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10568,8 +10568,14 @@ components:
ListAPIsResponseData:
description: Data envelope for `ListAPIsResponse`.
properties:
attributes:
$ref: '#/components/schemas/ListAPIsResponseDataAttributes'
id:
$ref: '#/components/schemas/ApiID'
type: object
ListAPIsResponseDataAttributes:
description: Attributes for `ListAPIsResponseData`.
properties:
name:
description: API name.
example: Payments API
Expand Down
1 change: 1 addition & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1491,6 +1491,7 @@ def overrides
"v2.jsonapi_error_response" => "JSONAPIErrorResponse",
"v2.list_ap_is_response" => "ListAPIsResponse",
"v2.list_ap_is_response_data" => "ListAPIsResponseData",
"v2.list_ap_is_response_data_attributes" => "ListAPIsResponseDataAttributes",
"v2.list_ap_is_response_meta" => "ListAPIsResponseMeta",
"v2.list_ap_is_response_meta_pagination" => "ListAPIsResponseMetaPagination",
"v2.list_application_keys_response" => "ListApplicationKeysResponse",
Expand Down
28 changes: 14 additions & 14 deletions lib/datadog_api_client/v2/models/list_ap_is_response_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,27 @@ module DatadogAPIClient::V2
class ListAPIsResponseData
include BaseGenericModel

# Attributes for `ListAPIsResponseData`.
attr_accessor :attributes

# API identifier.
attr_accessor :id

# API name.
attr_accessor :name

# Attribute mapping from ruby-style variable name to JSON key.
# @!visibility private
def self.attribute_map
{
:'id' => :'id',
:'name' => :'name'
:'attributes' => :'attributes',
:'id' => :'id'
}
end

# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'id' => :'UUID',
:'name' => :'String'
:'attributes' => :'ListAPIsResponseDataAttributes',
:'id' => :'UUID'
}
end

Expand All @@ -61,12 +61,12 @@ def initialize(attributes = {})
h[k.to_sym] = v
}

if attributes.key?(:'id')
self.id = attributes[:'id']
if attributes.key?(:'attributes')
self.attributes = attributes[:'attributes']
end

if attributes.key?(:'name')
self.name = attributes[:'name']
if attributes.key?(:'id')
self.id = attributes[:'id']
end
end

Expand All @@ -76,15 +76,15 @@ def initialize(attributes = {})
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
id == o.id &&
name == o.name
attributes == o.attributes &&
id == o.id
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[id, name].hash
[attributes, id].hash
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
=begin
#Datadog API V2 Collection
#Collection of all Datadog Public endpoints.
The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
This product includes software developed at Datadog (https://www.datadoghq.com/).
Copyright 2020-Present Datadog, Inc.
=end

require 'date'
require 'time'

module DatadogAPIClient::V2
# Attributes for `ListAPIsResponseData`.
class ListAPIsResponseDataAttributes
include BaseGenericModel

# API name.
attr_accessor :name

# Attribute mapping from ruby-style variable name to JSON key.
# @!visibility private
def self.attribute_map
{
:'name' => :'name'
}
end

# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'name' => :'String'
}
end

# Initializes the object
# @param attributes [Hash] Model attributes in the form of hash
# @!visibility private
def initialize(attributes = {})
if (!attributes.is_a?(Hash))
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ListAPIsResponseDataAttributes` initialize method"
end

# check to see if the attribute exists and convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::ListAPIsResponseDataAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
end
h[k.to_sym] = v
}

if attributes.key?(:'name')
self.name = attributes[:'name']
end
end

# Checks equality by comparing each attribute.
# @param o [Object] Object to be compared
# @!visibility private
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
name == o.name
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[name].hash
end
end
end

0 comments on commit 36b1c23

Please sign in to comment.