From bd9c81d5175ba9f44ff91ebc940784f3ca6b0413 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 27 May 2026 16:46:30 +0000 Subject: [PATCH] Regenerate client from commit 622be32 of spec repo --- .generator/schemas/v2/openapi.yaml | 101 ++++++++++++ .../ListCostTagMetadataMonths.rb | 8 + features/scenarios_model_mapping.rb | 3 + features/v2/cloud_cost_management.feature | 16 ++ features/v2/undo.json | 6 + lib/datadog_api_client/configuration.rb | 1 + lib/datadog_api_client/inflector.rb | 3 + .../v2/api/cloud_cost_management_api.rb | 73 +++++++++ .../v2/models/cost_tag_metadata_month.rb | 144 ++++++++++++++++++ .../v2/models/cost_tag_metadata_month_type.rb | 26 ++++ .../cost_tag_metadata_months_response.rb | 125 +++++++++++++++ 11 files changed, 506 insertions(+) create mode 100644 examples/v2/cloud-cost-management/ListCostTagMetadataMonths.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag_metadata_month.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag_metadata_month_type.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag_metadata_months_response.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index c1ed29256660..795f35ac355f 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -19897,6 +19897,45 @@ components: x-enum-varnames: - "TRUE" - "FALSE" + CostTagMetadataMonth: + description: A month that has Cloud Cost Management tag metadata available for a given provider. + properties: + id: + description: The month, in `YYYY-MM` format. + example: "2026-04" + type: string + type: + $ref: "#/components/schemas/CostTagMetadataMonthType" + required: + - id + - type + type: object + CostTagMetadataMonthType: + default: cost_tag_metadata_month + description: Type of the Cloud Cost Management tag metadata month resource. + enum: + - cost_tag_metadata_month + example: cost_tag_metadata_month + type: string + x-enum-varnames: + - COST_TAG_METADATA_MONTH + CostTagMetadataMonthsResponse: + description: List of months that have Cloud Cost Management tag metadata for the requested provider, ordered most-recent first and capped at 36 months. + example: + data: + - id: "2026-04" + type: cost_tag_metadata_month + - id: "2026-03" + type: cost_tag_metadata_month + properties: + data: + description: List of months that have tag metadata available. + items: + $ref: "#/components/schemas/CostTagMetadataMonth" + type: array + required: + - data + type: object CostTagType: default: cost_tag description: Type of the Cloud Cost Management tag resource. @@ -111135,6 +111174,68 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/tag_metadata/months: + get: + description: |- + List months that have Cloud Cost Management tag metadata for a given provider, + ordered most-recent first. The response is capped at 36 months. + operationId: ListCostTagMetadataMonths + parameters: + - description: |- + Provider to scope the query to. Use the value of the `providername` tag in CCM + (for example, `aws`, `azure`, `gcp`, `Oracle`, `Confluent Cloud`, `Snowflake`). + For costs uploaded through the Custom Costs API, use `custom`. + Values are case-sensitive. + example: aws + in: query + name: filter[provider] + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: "2026-04" + type: cost_tag_metadata_month + - id: "2026-03" + type: cost_tag_metadata_month + schema: + $ref: "#/components/schemas/CostTagMetadataMonthsResponse" + 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 metadata months + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/cost/tag_metadata/orchestrators: get: description: List container orchestrators (for example, `kubernetes`, `ecs`) detected in Cloud Cost Management data for the requested period. diff --git a/examples/v2/cloud-cost-management/ListCostTagMetadataMonths.rb b/examples/v2/cloud-cost-management/ListCostTagMetadataMonths.rb new file mode 100644 index 000000000000..7f388f29bcaa --- /dev/null +++ b/examples/v2/cloud-cost-management/ListCostTagMetadataMonths.rb @@ -0,0 +1,8 @@ +# List Cloud Cost Management tag metadata months returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_cost_tag_metadata_months".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.list_cost_tag_metadata_months("filter[provider]") diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 0f058611cc2b..7ed0eaac9136 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2643,6 +2643,9 @@ "filter_month" => "String", "filter_provider" => "String", }, + "v2.ListCostTagMetadataMonths" => { + "filter_provider" => "String", + }, "v2.ListCostTagMetadataOrchestrators" => { "filter_month" => "String", "filter_provider" => "String", diff --git a/features/v2/cloud_cost_management.feature b/features/v2/cloud_cost_management.feature index 17779e4599e4..b41928f4cb9d 100644 --- a/features/v2/cloud_cost_management.feature +++ b/features/v2/cloud_cost_management.feature @@ -606,6 +606,22 @@ 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 metadata months returns "Bad Request" response + Given operation "ListCostTagMetadataMonths" enabled + And new "ListCostTagMetadataMonths" request + And request contains "filter[provider]" 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: List Cloud Cost Management tag metadata months returns "OK" response + Given operation "ListCostTagMetadataMonths" enabled + And new "ListCostTagMetadataMonths" request + And request contains "filter[provider]" parameter from "REPLACE.ME" + 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 sources returns "Bad Request" response Given operation "ListCostTagKeySources" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index d86d61c22888..09d6acff288b 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1898,6 +1898,12 @@ "type": "safe" } }, + "ListCostTagMetadataMonths": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "ListCostTagMetadataOrchestrators": { "tag": "Cloud Cost Management", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index ed737191502f..112134511ef0 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -387,6 +387,7 @@ def initialize "v2.list_cost_tag_key_sources": false, "v2.list_cost_tag_metadata": false, "v2.list_cost_tag_metadata_metrics": false, + "v2.list_cost_tag_metadata_months": false, "v2.list_cost_tag_metadata_orchestrators": false, "v2.search_cost_recommendations": false, "v2.create_dashboard_secure_embed": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 8d7b3c4198cd..8dfcde4a6339 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2234,6 +2234,9 @@ def overrides "v2.cost_tag_keys_response" => "CostTagKeysResponse", "v2.cost_tag_key_type" => "CostTagKeyType", "v2.cost_tag_metadata_daily_filter" => "CostTagMetadataDailyFilter", + "v2.cost_tag_metadata_month" => "CostTagMetadataMonth", + "v2.cost_tag_metadata_months_response" => "CostTagMetadataMonthsResponse", + "v2.cost_tag_metadata_month_type" => "CostTagMetadataMonthType", "v2.cost_tags_response" => "CostTagsResponse", "v2.cost_tag_type" => "CostTagType", "v2.coverage_summary_attributes" => "CoverageSummaryAttributes", 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 a2e6e2ae335f..5b81f8a65ee6 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 @@ -3039,6 +3039,79 @@ def list_cost_tag_metadata_metrics_with_http_info(filter_month, opts = {}) return data, status_code, headers end + # List Cloud Cost Management tag metadata months. + # + # @see #list_cost_tag_metadata_months_with_http_info + def list_cost_tag_metadata_months(filter_provider, opts = {}) + data, _status_code, _headers = list_cost_tag_metadata_months_with_http_info(filter_provider, opts) + data + end + + # List Cloud Cost Management tag metadata months. + # + # List months that have Cloud Cost Management tag metadata for a given provider, + # ordered most-recent first. The response is capped at 36 months. + # + # @param filter_provider [String] Provider to scope the query to. Use the value of the `providername` tag in CCM (for example, `aws`, `azure`, `gcp`, `Oracle`, `Confluent Cloud`, `Snowflake`). For costs uploaded through the Custom Costs API, use `custom`. Values are case-sensitive. + # @param opts [Hash] the optional parameters + # @return [Array<(CostTagMetadataMonthsResponse, Integer, Hash)>] CostTagMetadataMonthsResponse data, response status code and response headers + def list_cost_tag_metadata_months_with_http_info(filter_provider, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_cost_tag_metadata_months".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_cost_tag_metadata_months") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_cost_tag_metadata_months")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.list_cost_tag_metadata_months ...' + end + # verify the required parameter 'filter_provider' is set + if @api_client.config.client_side_validation && filter_provider.nil? + fail ArgumentError, "Missing the required parameter 'filter_provider' when calling CloudCostManagementAPI.list_cost_tag_metadata_months" + end + # resource path + local_var_path = '/api/v2/cost/tag_metadata/months' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[provider]'] = filter_provider + + # 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] || 'CostTagMetadataMonthsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_cost_tag_metadata_months, + :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_cost_tag_metadata_months\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List Cloud Cost Management orchestrators. # # @see #list_cost_tag_metadata_orchestrators_with_http_info diff --git a/lib/datadog_api_client/v2/models/cost_tag_metadata_month.rb b/lib/datadog_api_client/v2/models/cost_tag_metadata_month.rb new file mode 100644 index 000000000000..17087b4346cc --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_metadata_month.rb @@ -0,0 +1,144 @@ +=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 month that has Cloud Cost Management tag metadata available for a given provider. + class CostTagMetadataMonth + include BaseGenericModel + + # The month, in `YYYY-MM` format. + attr_reader :id + + # Type of the Cloud Cost Management tag metadata month resource. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'CostTagMetadataMonthType' + } + 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::CostTagMetadataMonth` 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?(:'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 && + 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 + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/cost_tag_metadata_month_type.rb b/lib/datadog_api_client/v2/models/cost_tag_metadata_month_type.rb new file mode 100644 index 000000000000..f8779112e560 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_metadata_month_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 metadata month resource. + class CostTagMetadataMonthType + include BaseEnumModel + + COST_TAG_METADATA_MONTH = "cost_tag_metadata_month".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/cost_tag_metadata_months_response.rb b/lib/datadog_api_client/v2/models/cost_tag_metadata_months_response.rb new file mode 100644 index 000000000000..9e3b46d205a9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_metadata_months_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 + # List of months that have Cloud Cost Management tag metadata for the requested provider, ordered most-recent first and capped at 36 months. + class CostTagMetadataMonthsResponse + include BaseGenericModel + + # List of months that have tag metadata available. + 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::CostTagMetadataMonthsResponse` 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