From a378b3f46f1b9c73beb9aaea610e7e85f5a92f70 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 31 Oct 2024 16:42:05 +0000 Subject: [PATCH] Regenerate client from commit 63c441b2 of spec repo --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 90 ---------- ...ed-AWS-accounts-returns-OK-response.frozen | 1 - ...lated-AWS-accounts-returns-OK-response.yml | 33 ---- .../ListAWSRelatedAccounts.rb | 5 - features/scenarios_model_mapping.rb | 3 - features/v2/cloud_cost_management.feature | 15 -- features/v2/undo.json | 6 - lib/datadog_api_client/inflector.rb | 4 - .../v2/api/cloud_cost_management_api.rb | 69 -------- .../v2/models/aws_related_account.rb | 154 ------------------ .../models/aws_related_account_attributes.rb | 115 ------------- .../v2/models/aws_related_account_type.rb | 26 --- .../models/aws_related_accounts_response.rb | 107 ------------ 14 files changed, 4 insertions(+), 632 deletions(-) delete mode 100644 cassettes/features/v2/cloud_cost_management/List-related-AWS-accounts-returns-OK-response.frozen delete mode 100644 cassettes/features/v2/cloud_cost_management/List-related-AWS-accounts-returns-OK-response.yml delete mode 100644 examples/v2/cloud-cost-management/ListAWSRelatedAccounts.rb delete mode 100644 lib/datadog_api_client/v2/models/aws_related_account.rb delete mode 100644 lib/datadog_api_client/v2/models/aws_related_account_attributes.rb delete mode 100644 lib/datadog_api_client/v2/models/aws_related_account_type.rb delete mode 100644 lib/datadog_api_client/v2/models/aws_related_accounts_response.rb diff --git a/.apigentools-info b/.apigentools-info index 9960e6d621a5..089f4a49d2e3 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-31 16:03:55.097621", - "spec_repo_commit": "a11da7b5" + "regenerated": "2024-10-31 16:41:41.024770", + "spec_repo_commit": "63c441b2" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-31 16:03:55.116103", - "spec_repo_commit": "a11da7b5" + "regenerated": "2024-10-31 16:41:41.042740", + "spec_repo_commit": "63c441b2" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 61de273a3d92..7b467d1950e7 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -976,49 +976,6 @@ components: type: string x-enum-varnames: - API_KEYS - AWSRelatedAccount: - description: AWS related account. - properties: - attributes: - $ref: '#/components/schemas/AWSRelatedAccountAttributes' - id: - description: The AWS account ID. - example: '123456789123' - type: string - type: - $ref: '#/components/schemas/AWSRelatedAccountType' - required: - - id - - type - type: object - AWSRelatedAccountAttributes: - description: Attributes for an AWS related account. - properties: - has_datadog_integration: - description: Whether or not the AWS account has a Datadog integration. - type: boolean - name: - description: The name of the AWS account. - type: string - type: object - AWSRelatedAccountType: - default: aws_account - description: Type of AWS related account. - enum: - - aws_account - example: aws_account - type: string - x-enum-varnames: - - AWS_ACCOUNT - AWSRelatedAccountsResponse: - description: List of AWS related accounts. - properties: - data: - description: An AWS related account. - items: - $ref: '#/components/schemas/AWSRelatedAccount' - type: array - type: object ActiveBillingDimensionsAttributes: description: List of active billing dimensions. properties: @@ -28974,53 +28931,6 @@ paths: operator: OR permissions: - cloud_cost_management_write - /api/v2/cost/aws_related_accounts: - get: - deprecated: true - description: List the AWS accounts in an organization by calling 'organizations:ListAccounts' - from the specified management account. - operationId: ListAWSRelatedAccounts - parameters: - - description: The ID of the management account to filter by. - example: '123456789123' - in: query - name: filter[management_account_id] - required: true - schema: - type: string - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AWSRelatedAccountsResponse' - description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Forbidden - '429': - $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - cloud_cost_management_read - summary: List related AWS accounts - tags: - - Cloud Cost Management - x-permission: - operator: OR - permissions: - - cloud_cost_management_read /api/v2/cost/azure_uc_config: get: description: List the Azure configs. diff --git a/cassettes/features/v2/cloud_cost_management/List-related-AWS-accounts-returns-OK-response.frozen b/cassettes/features/v2/cloud_cost_management/List-related-AWS-accounts-returns-OK-response.frozen deleted file mode 100644 index fc911e03b7aa..000000000000 --- a/cassettes/features/v2/cloud_cost_management/List-related-AWS-accounts-returns-OK-response.frozen +++ /dev/null @@ -1 +0,0 @@ -2023-12-12T14:56:29.893Z \ No newline at end of file diff --git a/cassettes/features/v2/cloud_cost_management/List-related-AWS-accounts-returns-OK-response.yml b/cassettes/features/v2/cloud_cost_management/List-related-AWS-accounts-returns-OK-response.yml deleted file mode 100644 index 8949b2fcfcf3..000000000000 --- a/cassettes/features/v2/cloud_cost_management/List-related-AWS-accounts-returns-OK-response.yml +++ /dev/null @@ -1,33 +0,0 @@ -http_interactions: -- recorded_at: Tue, 12 Dec 2023 14:56:29 GMT - request: - body: null - headers: - Accept: - - application/json - method: GET - uri: https://api.datadoghq.com/api/v2/cost/aws_related_accounts?filter%5Bmanagement_account_id%5D=123456789123 - response: - body: - encoding: UTF-8 - string: '{"data": [{"type": "aws_account", "id": "000000000000", "attributes": - {"name": "test_name", "has_datadog_integration": false}}, {"type": "aws_account", - "id": "000000000000", "attributes": {"name": "test_name", "has_datadog_integration": - true}}, {"type": "aws_account", "id": "000000000000", "attributes": {"name": - "test_name", "has_datadog_integration": false}}, {"type": "aws_account", "id": - "000000000000", "attributes": {"name": "test_name", "has_datadog_integration": - false}}, {"type": "aws_account", "id": "000000000000", "attributes": {"name": - "test_name", "has_datadog_integration": true}}, {"type": "aws_account", "id": - "000000000000", "attributes": {"name": "test_name", "has_datadog_integration": - false}}, {"type": "aws_account", "id": "000000000000", "attributes": {"name": - "test_name", "has_datadog_integration": false}}, {"type": "aws_account", "id": - "000000000000", "attributes": {"name": "test_name", "has_datadog_integration": - true}}, {"type": "aws_account", "id": "000000000000", "attributes": {"name": - "test_name", "has_datadog_integration": false}}]}' - headers: - Content-Type: - - application/json - status: - code: 200 - message: OK -recorded_with: VCR 6.0.0 diff --git a/examples/v2/cloud-cost-management/ListAWSRelatedAccounts.rb b/examples/v2/cloud-cost-management/ListAWSRelatedAccounts.rb deleted file mode 100644 index 46dc62165d2f..000000000000 --- a/examples/v2/cloud-cost-management/ListAWSRelatedAccounts.rb +++ /dev/null @@ -1,5 +0,0 @@ -# List related AWS accounts returns "OK" response - -require "datadog_api_client" -api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new -p api_instance.list_aws_related_accounts("123456789123") diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 979f787c50eb..b096dd2e20ef 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1093,9 +1093,6 @@ "cloud_account_id" => "String", "body" => "AwsCURConfigPatchRequest", }, - "v2.ListAWSRelatedAccounts" => { - "filter_management_account_id" => "String", - }, "v2.CreateCostAzureUCConfigs" => { "body" => "AzureUCConfigPostRequest", }, diff --git a/features/v2/cloud_cost_management.feature b/features/v2/cloud_cost_management.feature index 7794b249d33f..2b87e8fe98df 100644 --- a/features/v2/cloud_cost_management.feature +++ b/features/v2/cloud_cost_management.feature @@ -148,21 +148,6 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 200 OK - @generated @skip @team:Datadog/cloud-cost-management - Scenario: List related AWS accounts returns "Bad Request" response - Given new "ListAWSRelatedAccounts" request - And request contains "filter[management_account_id]" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 400 Bad Request - - @replay-only @team:Datadog/cloud-cost-management - Scenario: List related AWS accounts returns "OK" response - Given new "ListAWSRelatedAccounts" request - And request contains "filter[management_account_id]" parameter with value "123456789123" - When the request is sent - Then the response status is 200 OK - And the response "data[0].attributes.name" is equal to "test_name" - @replay-only @team:Datadog/cloud-cost-management Scenario: Update Cloud Cost Management AWS CUR config returns "OK" response Given new "UpdateCostAWSCURConfig" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 0e2af9556a50..81c6a29e22c4 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -414,12 +414,6 @@ "type": "idempotent" } }, - "ListAWSRelatedAccounts": { - "tag": "Cloud Cost Management", - "undo": { - "type": "safe" - } - }, "ListCostAzureUCConfigs": { "tag": "Cloud Cost Management", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 4e84f56f3af1..d4a932395378 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -988,10 +988,6 @@ def overrides "v2.aws_cur_config_response" => "AwsCURConfigResponse", "v2.aws_cur_configs_response" => "AwsCURConfigsResponse", "v2.aws_cur_config_type" => "AwsCURConfigType", - "v2.aws_related_account" => "AWSRelatedAccount", - "v2.aws_related_account_attributes" => "AWSRelatedAccountAttributes", - "v2.aws_related_accounts_response" => "AWSRelatedAccountsResponse", - "v2.aws_related_account_type" => "AWSRelatedAccountType", "v2.azure_uc_config" => "AzureUCConfig", "v2.azure_uc_config_pair" => "AzureUCConfigPair", "v2.azure_uc_config_pair_attributes" => "AzureUCConfigPairAttributes", diff --git a/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb b/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb index e79fb48c2e77..17d3d7dc53c3 100644 --- a/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb +++ b/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb @@ -477,75 +477,6 @@ def get_custom_costs_file_with_http_info(file_id, opts = {}) return data, status_code, headers end - # List related AWS accounts. - # - # @see #list_aws_related_accounts_with_http_info - def list_aws_related_accounts(filter_management_account_id, opts = {}) - data, _status_code, _headers = list_aws_related_accounts_with_http_info(filter_management_account_id, opts) - data - end - - # List related AWS accounts. - # - # List the AWS accounts in an organization by calling 'organizations:ListAccounts' from the specified management account. - # - # @deprecated This API is deprecated. - # - # @param filter_management_account_id [String] The ID of the management account to filter by. - # @param opts [Hash] the optional parameters - # @return [Array<(AWSRelatedAccountsResponse, Integer, Hash)>] AWSRelatedAccountsResponse data, response status code and response headers - def list_aws_related_accounts_with_http_info(filter_management_account_id, opts = {}) - warn "[DEPRECATION] `ListAWSRelatedAccounts` is deprecated." - - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.list_aws_related_accounts ...' - end - # verify the required parameter 'filter_management_account_id' is set - if @api_client.config.client_side_validation && filter_management_account_id.nil? - fail ArgumentError, "Missing the required parameter 'filter_management_account_id' when calling CloudCostManagementAPI.list_aws_related_accounts" - end - # resource path - local_var_path = '/api/v2/cost/aws_related_accounts' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'filter[management_account_id]'] = filter_management_account_id - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'AWSRelatedAccountsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] - - new_options = opts.merge( - :operation => :list_aws_related_accounts, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type, - :api_version => "V2" - ) - - data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: CloudCostManagementAPI#list_aws_related_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # List Cloud Cost Management AWS CUR configs. # # @see #list_cost_awscur_configs_with_http_info diff --git a/lib/datadog_api_client/v2/models/aws_related_account.rb b/lib/datadog_api_client/v2/models/aws_related_account.rb deleted file mode 100644 index a2ce67413ef5..000000000000 --- a/lib/datadog_api_client/v2/models/aws_related_account.rb +++ /dev/null @@ -1,154 +0,0 @@ -=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 - # AWS related account. - class AWSRelatedAccount - include BaseGenericModel - - # Attributes for an AWS related account. - attr_accessor :attributes - - # The AWS account ID. - attr_reader :id - - # Type of AWS related account. - attr_reader :type - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'attributes' => :'attributes', - :'id' => :'id', - :'type' => :'type' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'attributes' => :'AWSRelatedAccountAttributes', - :'id' => :'String', - :'type' => :'AWSRelatedAccountType' - } - 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::AWSRelatedAccount` initialize method" - end - - self.additional_properties = {} - # 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)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'attributes') - self.attributes = attributes[:'attributes'] - end - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - # @!visibility private - def valid? - return false if @id.nil? - return false if @type.nil? - true - end - - # Custom attribute writer method with validation - # @param id [Object] Object to be assigned - # @!visibility private - def id=(id) - if id.nil? - fail ArgumentError, 'invalid value for "id", id cannot be nil.' - end - @id = id - end - - # Custom attribute writer method with validation - # @param type [Object] Object to be assigned - # @!visibility private - def type=(type) - if type.nil? - fail ArgumentError, 'invalid value for "type", type cannot be nil.' - end - @type = type - end - - # Returns the object in the form of hash, with additionalProperties support. - # @return [Hash] Returns the object in the form of hash - # @!visibility private - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - self.additional_properties.each_pair do |attr, value| - hash[attr] = value - end - hash - 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 && - attributes == o.attributes && - id == o.id && - type == o.type - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [attributes, id, type].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/aws_related_account_attributes.rb b/lib/datadog_api_client/v2/models/aws_related_account_attributes.rb deleted file mode 100644 index f6f1bb28db55..000000000000 --- a/lib/datadog_api_client/v2/models/aws_related_account_attributes.rb +++ /dev/null @@ -1,115 +0,0 @@ -=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 an AWS related account. - class AWSRelatedAccountAttributes - include BaseGenericModel - - # Whether or not the AWS account has a Datadog integration. - attr_accessor :has_datadog_integration - - # The name of the AWS account. - attr_accessor :name - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'has_datadog_integration' => :'has_datadog_integration', - :'name' => :'name' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'has_datadog_integration' => :'Boolean', - :'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::AWSRelatedAccountAttributes` initialize method" - end - - self.additional_properties = {} - # 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)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'has_datadog_integration') - self.has_datadog_integration = attributes[:'has_datadog_integration'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Returns the object in the form of hash, with additionalProperties support. - # @return [Hash] Returns the object in the form of hash - # @!visibility private - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - self.additional_properties.each_pair do |attr, value| - hash[attr] = value - end - hash - 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 && - has_datadog_integration == o.has_datadog_integration && - name == o.name - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [has_datadog_integration, name].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/aws_related_account_type.rb b/lib/datadog_api_client/v2/models/aws_related_account_type.rb deleted file mode 100644 index 0edad7820c89..000000000000 --- a/lib/datadog_api_client/v2/models/aws_related_account_type.rb +++ /dev/null @@ -1,26 +0,0 @@ -=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 - # Type of AWS related account. - class AWSRelatedAccountType - include BaseEnumModel - - AWS_ACCOUNT = "aws_account".freeze - end -end diff --git a/lib/datadog_api_client/v2/models/aws_related_accounts_response.rb b/lib/datadog_api_client/v2/models/aws_related_accounts_response.rb deleted file mode 100644 index 46da2ce3d52a..000000000000 --- a/lib/datadog_api_client/v2/models/aws_related_accounts_response.rb +++ /dev/null @@ -1,107 +0,0 @@ -=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 - # List of AWS related accounts. - class AWSRelatedAccountsResponse - include BaseGenericModel - - # An AWS related account. - attr_accessor :data - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'data' => :'data' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'data' => :'Array' - } - 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::AWSRelatedAccountsResponse` initialize method" - end - - self.additional_properties = {} - # 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)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'data') - if (value = attributes[:'data']).is_a?(Array) - self.data = value - end - end - end - - # Returns the object in the form of hash, with additionalProperties support. - # @return [Hash] Returns the object in the form of hash - # @!visibility private - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - self.additional_properties.each_pair do |attr, value| - hash[attr] = value - end - hash - 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 && - data == o.data - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [data].hash - end - end -end