From 76252216c4fd67b49e40ad36ca7433bcf9fa8a89 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 13 May 2026 19:20:46 +0000 Subject: [PATCH] Regenerate client from commit 3d6d3ae of spec repo --- .generator/schemas/v2/openapi.yaml | 418 ++++++++++++++++++ .../v2/cloud-cost-management/GetCostTagKey.rb | 5 + .../cloud-cost-management/ListCostTagKeys.rb | 5 + .../v2/cloud-cost-management/ListCostTags.rb | 5 + features/scenarios_model_mapping.rb | 16 + features/v2/cloud_cost_management.feature | 45 ++ features/v2/undo.json | 18 + lib/datadog_api_client/inflector.rb | 10 + .../v2/api/cloud_cost_management_api.rb | 211 +++++++++ lib/datadog_api_client/v2/models/cost_tag.rb | 165 +++++++ .../v2/models/cost_tag_attributes.rb | 146 ++++++ .../v2/models/cost_tag_key.rb | 165 +++++++ .../v2/models/cost_tag_key_attributes.rb | 156 +++++++ .../v2/models/cost_tag_key_details.rb | 146 ++++++ .../v2/models/cost_tag_key_response.rb | 123 ++++++ .../v2/models/cost_tag_key_type.rb | 26 ++ .../v2/models/cost_tag_keys_response.rb | 125 ++++++ .../v2/models/cost_tag_type.rb | 26 ++ .../v2/models/cost_tags_response.rb | 125 ++++++ 19 files changed, 1936 insertions(+) create mode 100644 examples/v2/cloud-cost-management/GetCostTagKey.rb create mode 100644 examples/v2/cloud-cost-management/ListCostTagKeys.rb create mode 100644 examples/v2/cloud-cost-management/ListCostTags.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag_key.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag_key_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag_key_details.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag_key_response.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag_key_type.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag_keys_response.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag_type.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tags_response.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index db3332717dac..faa94f948b80 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1468,6 +1468,13 @@ components: required: true schema: type: string + TagKey: + description: The Cloud Cost Management tag key. Tag keys can contain forward slashes (for example, `kubernetes/instance`). + in: path + name: tag_key + required: true + schema: + type: string ToTimestamp: description: The ending timestamp for the SLO status query in epoch seconds. in: query @@ -15805,6 +15812,41 @@ components: type: string x-enum-varnames: - COST_BY_ORG + CostTag: + description: A Cloud Cost Management tag. + properties: + attributes: + $ref: "#/components/schemas/CostTagAttributes" + id: + description: The tag identifier, equal to its `key:value` representation. + example: providername:aws + type: string + type: + $ref: "#/components/schemas/CostTagType" + required: + - attributes + - id + - type + type: object + CostTagAttributes: + description: Attributes of a Cloud Cost Management tag. + properties: + sources: + description: List of sources that define this tag. + example: + - focus + items: + description: A tag source. + type: string + type: array + value: + description: The tag value in `key:value` format. + example: providername:aws + type: string + required: + - sources + - value + type: object CostTagDescription: description: A Cloud Cost Management tag key description, either cross-cloud or scoped to a single cloud provider. properties: @@ -15897,6 +15939,153 @@ components: required: - data type: object + CostTagKey: + description: A Cloud Cost Management tag key. + properties: + attributes: + $ref: "#/components/schemas/CostTagKeyAttributes" + id: + description: The tag key identifier. + example: providername + type: string + type: + $ref: "#/components/schemas/CostTagKeyType" + required: + - attributes + - id + - type + type: object + CostTagKeyAttributes: + description: Attributes of a Cloud Cost Management tag key. + properties: + details: + $ref: "#/components/schemas/CostTagKeyDetails" + sources: + description: List of sources that define this tag key. + example: + - focus + items: + description: A tag key source. + type: string + type: array + value: + description: The tag key name. + example: providername + type: string + required: + - sources + - value + type: object + CostTagKeyDetails: + description: Additional details for a Cloud Cost Management tag key, including its description and example tag values. + properties: + description: + description: Description of the tag key. + example: The cloud provider name reported for the cost line item. + type: string + tag_values: + description: Example tag values observed for this tag key. + example: + - aws + - gcp + - azure + items: + description: A tag value observed for this tag key. + type: string + type: array + required: + - description + - tag_values + type: object + CostTagKeyResponse: + description: A single Cloud Cost Management tag key. + example: + data: + attributes: + details: + description: The cloud provider name reported for the cost line item. + tag_values: + - aws + - gcp + - azure + sources: + - focus + value: providername + id: providername + type: cost_tag_key + properties: + data: + $ref: "#/components/schemas/CostTagKey" + required: + - data + type: object + CostTagKeyType: + default: cost_tag_key + description: Type of the Cloud Cost Management tag key resource. + enum: + - cost_tag_key + example: cost_tag_key + type: string + x-enum-varnames: + - COST_TAG_KEY + CostTagKeysResponse: + description: A list of Cloud Cost Management tag keys. + example: + data: + - attributes: + sources: + - focus + value: providername + id: providername + type: cost_tag_key + - attributes: + sources: [] + value: service + id: service + type: cost_tag_key + properties: + data: + description: The list of Cloud Cost Management tag keys. + items: + $ref: "#/components/schemas/CostTagKey" + type: array + required: + - data + type: object + CostTagType: + default: cost_tag + description: Type of the Cloud Cost Management tag resource. + enum: + - cost_tag + example: cost_tag + type: string + x-enum-varnames: + - COST_TAG + CostTagsResponse: + description: A list of Cloud Cost Management tags. + example: + data: + - attributes: + sources: + - focus + value: providername:aws + id: providername:aws + type: cost_tag + - attributes: + sources: + - focus + value: providername:gcp + id: providername:gcp + type: cost_tag + properties: + data: + description: The list of Cloud Cost Management tags. + items: + $ref: "#/components/schemas/CostTag" + type: array + required: + - data + type: object CoverageSummaryAttributes: description: Attributes object for code coverage summary response. properties: @@ -97646,6 +97835,235 @@ paths: operator: OR permissions: - cloud_cost_management_read + /api/v2/cost/tag_keys: + get: + description: List Cloud Cost Management tag keys. + operationId: ListCostTagKeys + parameters: + - description: The Cloud Cost Management metric to scope the tag keys to. When omitted, returns tag keys across all metrics. + in: query + name: filter[metric] + schema: + type: string + - description: |- + Filter to return only tag keys that appear with the given `key:value` tag values. For example, `filter[tags]=providername:aws` returns tag keys found on the same cost data, such as `is_aws_ec2_compute` and `aws_instance_type`. + in: query + name: filter[tags] + schema: + items: + type: string + type: array + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + sources: + - focus + value: providername + id: providername + type: cost_tag_key + - attributes: + sources: [] + value: service + id: service + type: cost_tag_key + schema: + $ref: "#/components/schemas/CostTagKeysResponse" + 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 Cloud Cost Management tag keys + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + /api/v2/cost/tag_keys/{tag_key}: + get: + description: Get details for a specific Cloud Cost Management tag key, including example tag values and description. + operationId: GetCostTagKey + parameters: + - $ref: "#/components/parameters/TagKey" + - description: The Cloud Cost Management metric to scope the tag key details to. When omitted, returns details across all metrics. + in: query + name: filter[metric] + schema: + type: string + - description: |- + Controls the size of the internal tag value search scope. This does **not** restrict the number of example tag values returned in the response. Defaults to 50, maximum 10000. + in: query + name: page[size] + schema: + default: 50 + format: int32 + maximum: 10000 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + details: + description: The cloud provider name reported for the cost line item. + tag_values: + - aws + - gcp + - azure + sources: + - focus + value: providername + id: providername + type: cost_tag_key + schema: + $ref: "#/components/schemas/CostTagKeyResponse" + 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 + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get a Cloud Cost Management tag key + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + /api/v2/cost/tags: + get: + description: List Cloud Cost Management tags for a given metric. + operationId: ListCostTags + parameters: + - description: The Cloud Cost Management metric to scope the tags to. When omitted, returns tags across all metrics. + in: query + name: filter[metric] + schema: + type: string + - description: A substring used to filter the returned tags by name. + in: query + name: filter[match] + schema: + type: string + - description: |- + Filter to return only tags that appear with the given `key:value` tag values. For example, `filter[tags]=providername:aws` returns tags found on the same cost data, such as `aws_instance_type:t3.micro` and `aws_instance_type:m5.large`. + in: query + name: filter[tags] + schema: + items: + type: string + type: array + - description: Restrict the returned tags to those whose key matches one of the given tag keys. + in: query + name: filter[tag_keys] + schema: + items: + type: string + type: array + - description: |- + Controls the size of the internal tag search scope. This does **not** restrict the number of tags returned in the response. Defaults to 50, maximum 10000. + in: query + name: page[size] + schema: + default: 50 + format: int32 + maximum: 10000 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + sources: + - focus + value: providername:aws + id: providername:aws + type: cost_tag + - attributes: + sources: + - focus + value: providername:gcp + id: providername:gcp + type: cost_tag + schema: + $ref: "#/components/schemas/CostTagsResponse" + 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 Cloud Cost Management tags + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read /api/v2/cost_by_tag/active_billing_dimensions: get: description: |- diff --git a/examples/v2/cloud-cost-management/GetCostTagKey.rb b/examples/v2/cloud-cost-management/GetCostTagKey.rb new file mode 100644 index 000000000000..bf2551882b4b --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCostTagKey.rb @@ -0,0 +1,5 @@ +# Get a Cloud Cost Management tag key returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.get_cost_tag_key("tag_key") diff --git a/examples/v2/cloud-cost-management/ListCostTagKeys.rb b/examples/v2/cloud-cost-management/ListCostTagKeys.rb new file mode 100644 index 000000000000..932e35eb64ca --- /dev/null +++ b/examples/v2/cloud-cost-management/ListCostTagKeys.rb @@ -0,0 +1,5 @@ +# List Cloud Cost Management tag keys returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.list_cost_tag_keys() diff --git a/examples/v2/cloud-cost-management/ListCostTags.rb b/examples/v2/cloud-cost-management/ListCostTags.rb new file mode 100644 index 000000000000..8e476a8ab5b5 --- /dev/null +++ b/examples/v2/cloud-cost-management/ListCostTags.rb @@ -0,0 +1,5 @@ +# List Cloud Cost Management tags returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.list_cost_tags() diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 4f6619e89ece..55709e0a558b 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2204,6 +2204,22 @@ "v2.ListCostTagDescriptions" => { "filter_cloud" => "String", }, + "v2.ListCostTagKeys" => { + "filter_metric" => "String", + "filter_tags" => "Array", + }, + "v2.GetCostTagKey" => { + "tag_key" => "String", + "filter_metric" => "String", + "page_size" => "Integer", + }, + "v2.ListCostTags" => { + "filter_metric" => "String", + "filter_match" => "String", + "filter_tags" => "Array", + "filter_tag_keys" => "Array", + "page_size" => "Integer", + }, "v2.CreateTagPipelinesRuleset" => { "body" => "CreateRulesetRequest", }, diff --git a/features/v2/cloud_cost_management.feature b/features/v2/cloud_cost_management.feature index 9bab51741ef3..d06acba8d826 100644 --- a/features/v2/cloud_cost_management.feature +++ b/features/v2/cloud_cost_management.feature @@ -250,6 +250,27 @@ Feature: Cloud Cost Management And the response "data.type" is equal to "gcp_uc_config" And the response "data.attributes.account_id" is equal to "123456_ABCDEF_123ABC" + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get a Cloud Cost Management tag key returns "Bad Request" response + Given new "GetCostTagKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get a Cloud Cost Management tag key returns "Not Found" response + Given new "GetCostTagKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get a Cloud Cost Management tag key returns "OK" response + Given new "GetCostTagKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @team:DataDog/cloud-cost-management Scenario: Get a budget returns "Not Found" response Given new "GetBudget" request @@ -349,6 +370,30 @@ 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 Cloud Cost Management tag keys returns "Bad Request" response + Given new "ListCostTagKeys" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List Cloud Cost Management tag keys returns "OK" response + Given new "ListCostTagKeys" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List Cloud Cost Management tags returns "Bad Request" response + Given new "ListCostTags" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List Cloud Cost Management tags returns "OK" response + Given new "ListCostTags" request + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/cloud-cost-management Scenario: List Custom Costs Files returns "OK" response Given new "ListCustomCostsFiles" request diff --git a/features/v2/undo.json b/features/v2/undo.json index b9805518e9df..dc1a8b2fbbde 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1488,6 +1488,24 @@ "type": "safe" } }, + "ListCostTagKeys": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCostTagKey": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "ListCostTags": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "GetActiveBillingDimensions": { "tag": "Usage Metering", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index a15a42597c0e..9f5558e0d1ac 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1996,11 +1996,21 @@ def overrides "v2.cost_by_org_attributes" => "CostByOrgAttributes", "v2.cost_by_org_response" => "CostByOrgResponse", "v2.cost_by_org_type" => "CostByOrgType", + "v2.cost_tag" => "CostTag", + "v2.cost_tag_attributes" => "CostTagAttributes", "v2.cost_tag_description" => "CostTagDescription", "v2.cost_tag_description_attributes" => "CostTagDescriptionAttributes", "v2.cost_tag_description_source" => "CostTagDescriptionSource", "v2.cost_tag_descriptions_response" => "CostTagDescriptionsResponse", "v2.cost_tag_description_type" => "CostTagDescriptionType", + "v2.cost_tag_key" => "CostTagKey", + "v2.cost_tag_key_attributes" => "CostTagKeyAttributes", + "v2.cost_tag_key_details" => "CostTagKeyDetails", + "v2.cost_tag_key_response" => "CostTagKeyResponse", + "v2.cost_tag_keys_response" => "CostTagKeysResponse", + "v2.cost_tag_key_type" => "CostTagKeyType", + "v2.cost_tags_response" => "CostTagsResponse", + "v2.cost_tag_type" => "CostTagType", "v2.coverage_summary_attributes" => "CoverageSummaryAttributes", "v2.coverage_summary_codeowner_stats" => "CoverageSummaryCodeownerStats", "v2.coverage_summary_data" => "CoverageSummaryData", 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 8d28019cff2e..2a8f0b28274e 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 @@ -1156,6 +1156,78 @@ def get_cost_gcp_usage_cost_config_with_http_info(cloud_account_id, opts = {}) return data, status_code, headers end + # Get a Cloud Cost Management tag key. + # + # @see #get_cost_tag_key_with_http_info + def get_cost_tag_key(tag_key, opts = {}) + data, _status_code, _headers = get_cost_tag_key_with_http_info(tag_key, opts) + data + end + + # Get a Cloud Cost Management tag key. + # + # Get details for a specific Cloud Cost Management tag key, including example tag values and description. + # + # @param tag_key [String] The Cloud Cost Management tag key. Tag keys can contain forward slashes (for example, `kubernetes/instance`). + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_metric The Cloud Cost Management metric to scope the tag key details to. When omitted, returns details across all metrics. + # @option opts [Integer] :page_size Controls the size of the internal tag value search scope. This does **not** restrict the number of example tag values returned in the response. Defaults to 50, maximum 10000. + # @return [Array<(CostTagKeyResponse, Integer, Hash)>] CostTagKeyResponse data, response status code and response headers + def get_cost_tag_key_with_http_info(tag_key, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.get_cost_tag_key ...' + end + # verify the required parameter 'tag_key' is set + if @api_client.config.client_side_validation && tag_key.nil? + fail ArgumentError, "Missing the required parameter 'tag_key' when calling CloudCostManagementAPI.get_cost_tag_key" + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 10000 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CloudCostManagementAPI.get_cost_tag_key, must be smaller than or equal to 10000.' + end + # resource path + local_var_path = '/api/v2/cost/tag_keys/{tag_key}'.sub('{tag_key}', CGI.escape(tag_key.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[metric]'] = opts[:'filter_metric'] if !opts[:'filter_metric'].nil? + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + + # 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] || 'CostTagKeyResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_cost_tag_key, + :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#get_cost_tag_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get custom allocation rule. # # @see #get_custom_allocation_rule_with_http_info @@ -1802,6 +1874,145 @@ def list_cost_tag_descriptions_with_http_info(opts = {}) return data, status_code, headers end + # List Cloud Cost Management tag keys. + # + # @see #list_cost_tag_keys_with_http_info + def list_cost_tag_keys(opts = {}) + data, _status_code, _headers = list_cost_tag_keys_with_http_info(opts) + data + end + + # List Cloud Cost Management tag keys. + # + # List Cloud Cost Management tag keys. + # + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_metric The Cloud Cost Management metric to scope the tag keys to. When omitted, returns tag keys across all metrics. + # @option opts [Array] :filter_tags Filter to return only tag keys that appear with the given `key:value` tag values. For example, `filter[tags]=providername:aws` returns tag keys found on the same cost data, such as `is_aws_ec2_compute` and `aws_instance_type`. + # @return [Array<(CostTagKeysResponse, Integer, Hash)>] CostTagKeysResponse data, response status code and response headers + def list_cost_tag_keys_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.list_cost_tag_keys ...' + end + # resource path + local_var_path = '/api/v2/cost/tag_keys' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[metric]'] = opts[:'filter_metric'] if !opts[:'filter_metric'].nil? + query_params[:'filter[tags]'] = @api_client.build_collection_param(opts[:'filter_tags'], :multi) if !opts[:'filter_tags'].nil? + + # 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] || 'CostTagKeysResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_cost_tag_keys, + :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" + ) + new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER + + 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_cost_tag_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List Cloud Cost Management tags. + # + # @see #list_cost_tags_with_http_info + def list_cost_tags(opts = {}) + data, _status_code, _headers = list_cost_tags_with_http_info(opts) + data + end + + # List Cloud Cost Management tags. + # + # List Cloud Cost Management tags for a given metric. + # + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_metric The Cloud Cost Management metric to scope the tags to. When omitted, returns tags across all metrics. + # @option opts [String] :filter_match A substring used to filter the returned tags by name. + # @option opts [Array] :filter_tags Filter to return only tags that appear with the given `key:value` tag values. For example, `filter[tags]=providername:aws` returns tags found on the same cost data, such as `aws_instance_type:t3.micro` and `aws_instance_type:m5.large`. + # @option opts [Array] :filter_tag_keys Restrict the returned tags to those whose key matches one of the given tag keys. + # @option opts [Integer] :page_size Controls the size of the internal tag search scope. This does **not** restrict the number of tags returned in the response. Defaults to 50, maximum 10000. + # @return [Array<(CostTagsResponse, Integer, Hash)>] CostTagsResponse data, response status code and response headers + def list_cost_tags_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.list_cost_tags ...' + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 10000 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CloudCostManagementAPI.list_cost_tags, must be smaller than or equal to 10000.' + end + # resource path + local_var_path = '/api/v2/cost/tags' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[metric]'] = opts[:'filter_metric'] if !opts[:'filter_metric'].nil? + query_params[:'filter[match]'] = opts[:'filter_match'] if !opts[:'filter_match'].nil? + query_params[:'filter[tags]'] = @api_client.build_collection_param(opts[:'filter_tags'], :multi) if !opts[:'filter_tags'].nil? + query_params[:'filter[tag_keys]'] = @api_client.build_collection_param(opts[:'filter_tag_keys'], :multi) if !opts[:'filter_tag_keys'].nil? + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + + # 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] || 'CostTagsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_cost_tags, + :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" + ) + new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER + + 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_cost_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List custom allocation rules. # # @see #list_custom_allocation_rules_with_http_info diff --git a/lib/datadog_api_client/v2/models/cost_tag.rb b/lib/datadog_api_client/v2/models/cost_tag.rb new file mode 100644 index 000000000000..73161f537c05 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag.rb @@ -0,0 +1,165 @@ +=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 + # A Cloud Cost Management tag. + class CostTag + include BaseGenericModel + + # Attributes of a Cloud Cost Management tag. + attr_reader :attributes + + # The tag identifier, equal to its `key:value` representation. + attr_reader :id + + # Type of the Cloud Cost Management tag resource. + 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' => :'CostTagAttributes', + :'id' => :'String', + :'type' => :'CostTagType' + } + 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::CostTag` 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 @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + 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, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/cost_tag_attributes.rb b/lib/datadog_api_client/v2/models/cost_tag_attributes.rb new file mode 100644 index 000000000000..8767d6920856 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_attributes.rb @@ -0,0 +1,146 @@ +=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 of a Cloud Cost Management tag. + class CostTagAttributes + include BaseGenericModel + + # List of sources that define this tag. + attr_reader :sources + + # The tag value in `key:value` format. + attr_reader :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'sources' => :'sources', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'sources' => :'Array', + :'value' => :'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::CostTagAttributes` 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?(:'sources') + if (value = attributes[:'sources']).is_a?(Array) + self.sources = value + end + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + 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 @sources.nil? + return false if @value.nil? + true + end + + # Custom attribute writer method with validation + # @param sources [Object] Object to be assigned + # @!visibility private + def sources=(sources) + if sources.nil? + fail ArgumentError, 'invalid value for "sources", sources cannot be nil.' + end + @sources = sources + end + + # Custom attribute writer method with validation + # @param value [Object] Object to be assigned + # @!visibility private + def value=(value) + if value.nil? + fail ArgumentError, 'invalid value for "value", value cannot be nil.' + end + @value = value + 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 && + sources == o.sources && + value == o.value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [sources, value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/cost_tag_key.rb b/lib/datadog_api_client/v2/models/cost_tag_key.rb new file mode 100644 index 000000000000..255aa24b72e9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_key.rb @@ -0,0 +1,165 @@ +=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 + # A Cloud Cost Management tag key. + class CostTagKey + include BaseGenericModel + + # Attributes of a Cloud Cost Management tag key. + attr_reader :attributes + + # The tag key identifier. + attr_reader :id + + # Type of the Cloud Cost Management tag key resource. + 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' => :'CostTagKeyAttributes', + :'id' => :'String', + :'type' => :'CostTagKeyType' + } + 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::CostTagKey` 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 @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + 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, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/cost_tag_key_attributes.rb b/lib/datadog_api_client/v2/models/cost_tag_key_attributes.rb new file mode 100644 index 000000000000..789e7be45e62 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_key_attributes.rb @@ -0,0 +1,156 @@ +=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 of a Cloud Cost Management tag key. + class CostTagKeyAttributes + include BaseGenericModel + + # Additional details for a Cloud Cost Management tag key, including its description and example tag values. + attr_accessor :details + + # List of sources that define this tag key. + attr_reader :sources + + # The tag key name. + attr_reader :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'details' => :'details', + :'sources' => :'sources', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'details' => :'CostTagKeyDetails', + :'sources' => :'Array', + :'value' => :'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::CostTagKeyAttributes` 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?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'sources') + if (value = attributes[:'sources']).is_a?(Array) + self.sources = value + end + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + 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 @sources.nil? + return false if @value.nil? + true + end + + # Custom attribute writer method with validation + # @param sources [Object] Object to be assigned + # @!visibility private + def sources=(sources) + if sources.nil? + fail ArgumentError, 'invalid value for "sources", sources cannot be nil.' + end + @sources = sources + end + + # Custom attribute writer method with validation + # @param value [Object] Object to be assigned + # @!visibility private + def value=(value) + if value.nil? + fail ArgumentError, 'invalid value for "value", value cannot be nil.' + end + @value = value + 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 && + details == o.details && + sources == o.sources && + value == o.value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [details, sources, value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/cost_tag_key_details.rb b/lib/datadog_api_client/v2/models/cost_tag_key_details.rb new file mode 100644 index 000000000000..2af7b499866d --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_key_details.rb @@ -0,0 +1,146 @@ +=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 + # Additional details for a Cloud Cost Management tag key, including its description and example tag values. + class CostTagKeyDetails + include BaseGenericModel + + # Description of the tag key. + attr_reader :description + + # Example tag values observed for this tag key. + attr_reader :tag_values + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'tag_values' => :'tag_values' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'tag_values' => :'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::CostTagKeyDetails` 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?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'tag_values') + if (value = attributes[:'tag_values']).is_a?(Array) + self.tag_values = value + end + 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 @description.nil? + return false if @tag_values.nil? + true + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param tag_values [Object] Object to be assigned + # @!visibility private + def tag_values=(tag_values) + if tag_values.nil? + fail ArgumentError, 'invalid value for "tag_values", tag_values cannot be nil.' + end + @tag_values = tag_values + 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 && + description == o.description && + tag_values == o.tag_values && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, tag_values, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/cost_tag_key_response.rb b/lib/datadog_api_client/v2/models/cost_tag_key_response.rb new file mode 100644 index 000000000000..bb2c573c0de2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_key_response.rb @@ -0,0 +1,123 @@ +=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 + # A single Cloud Cost Management tag key. + class CostTagKeyResponse + include BaseGenericModel + + # A Cloud Cost Management tag key. + attr_reader :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' => :'CostTagKey' + } + 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::CostTagKeyResponse` 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') + self.data = attributes[:'data'] + 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 @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + 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, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/cost_tag_key_type.rb b/lib/datadog_api_client/v2/models/cost_tag_key_type.rb new file mode 100644 index 000000000000..469c9cc76132 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_key_type.rb @@ -0,0 +1,26 @@ +=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 the Cloud Cost Management tag key resource. + class CostTagKeyType + include BaseEnumModel + + COST_TAG_KEY = "cost_tag_key".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/cost_tag_keys_response.rb b/lib/datadog_api_client/v2/models/cost_tag_keys_response.rb new file mode 100644 index 000000000000..a3d73d7a0b31 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_keys_response.rb @@ -0,0 +1,125 @@ +=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 + # A list of Cloud Cost Management tag keys. + class CostTagKeysResponse + include BaseGenericModel + + # The list of Cloud Cost Management tag keys. + attr_reader :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::CostTagKeysResponse` 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 + + # 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 @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + 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, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/cost_tag_type.rb b/lib/datadog_api_client/v2/models/cost_tag_type.rb new file mode 100644 index 000000000000..9aae770573be --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_type.rb @@ -0,0 +1,26 @@ +=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 the Cloud Cost Management tag resource. + class CostTagType + include BaseEnumModel + + COST_TAG = "cost_tag".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/cost_tags_response.rb b/lib/datadog_api_client/v2/models/cost_tags_response.rb new file mode 100644 index 000000000000..9c89ab354ef3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tags_response.rb @@ -0,0 +1,125 @@ +=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 + # A list of Cloud Cost Management tags. + class CostTagsResponse + include BaseGenericModel + + # The list of Cloud Cost Management tags. + attr_reader :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::CostTagsResponse` 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 + + # 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 @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + 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, additional_properties].hash + end + end +end