From 36b1c237780cbff197ea3daf6ee23056aaf5cfd0 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 11:52:20 +0000 Subject: [PATCH] Add missing attributes envelope in ListAPIs response (#1856) Co-authored-by: ci.datadog-api-spec Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 6 ++ lib/datadog_api_client/inflector.rb | 1 + .../v2/models/list_ap_is_response_data.rb | 28 +++---- .../list_ap_is_response_data_attributes.rb | 80 +++++++++++++++++++ 5 files changed, 105 insertions(+), 18 deletions(-) create mode 100644 lib/datadog_api_client/v2/models/list_ap_is_response_data_attributes.rb diff --git a/.apigentools-info b/.apigentools-info index 095643d7c182..29dce07caceb 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -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" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b0fef5c9fe25..7d45c6982dea 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -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 diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 34957351f3a9..9c8926b1a723 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -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", diff --git a/lib/datadog_api_client/v2/models/list_ap_is_response_data.rb b/lib/datadog_api_client/v2/models/list_ap_is_response_data.rb index 4afe3a81448e..9c0af8174418 100644 --- a/lib/datadog_api_client/v2/models/list_ap_is_response_data.rb +++ b/lib/datadog_api_client/v2/models/list_ap_is_response_data.rb @@ -21,18 +21,18 @@ 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 @@ -40,8 +40,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'id' => :'UUID', - :'name' => :'String' + :'attributes' => :'ListAPIsResponseDataAttributes', + :'id' => :'UUID' } end @@ -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 @@ -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 diff --git a/lib/datadog_api_client/v2/models/list_ap_is_response_data_attributes.rb b/lib/datadog_api_client/v2/models/list_ap_is_response_data_attributes.rb new file mode 100644 index 000000000000..e65c6e5535d8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_ap_is_response_data_attributes.rb @@ -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