From b1cf9e07840bf608e10d7702c374e3bdb78ce08e Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 11 May 2026 21:56:04 +0000 Subject: [PATCH] Regenerate client from commit d8b2bce of spec repo --- .generator/schemas/v2/openapi.yaml | 146 +++++++++++ .../ListCostTagDescriptions.rb | 8 + features/scenarios_model_mapping.rb | 3 + features/v2/cloud_cost_management.feature | 7 + features/v2/undo.json | 6 + lib/datadog_api_client/configuration.rb | 1 + lib/datadog_api_client/inflector.rb | 5 + .../v2/api/cloud_cost_management_api.rb | 68 ++++++ .../v2/models/cost_tag_description.rb | 165 +++++++++++++ .../models/cost_tag_description_attributes.rb | 228 ++++++++++++++++++ .../v2/models/cost_tag_description_source.rb | 28 +++ .../v2/models/cost_tag_description_type.rb | 26 ++ .../models/cost_tag_descriptions_response.rb | 125 ++++++++++ 13 files changed, 816 insertions(+) create mode 100644 examples/v2/cloud-cost-management/ListCostTagDescriptions.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag_description.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag_description_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag_description_source.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag_description_type.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag_descriptions_response.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ff1cc1f1f12a..9b83df6b476c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -15600,6 +15600,98 @@ components: type: string x-enum-varnames: - COST_BY_ORG + CostTagDescription: + description: A Cloud Cost Management tag key description, either cross-cloud or scoped to a single cloud provider. + properties: + attributes: + $ref: "#/components/schemas/CostTagDescriptionAttributes" + id: + description: Stable identifier of the tag description. Equals the tag key when the description is the cross-cloud default; encodes both the cloud and the tag key when the description is cloud-specific. + example: account_id + type: string + type: + $ref: "#/components/schemas/CostTagDescriptionType" + required: + - attributes + - id + - type + type: object + CostTagDescriptionAttributes: + description: Human-readable description and metadata attached to a Cloud Cost Management tag key, optionally scoped to a single cloud provider. + properties: + cloud: + description: Cloud provider this description applies to (for example, `aws`). Empty when the description is the cross-cloud default for the tag key. + example: aws + type: string + created_at: + description: Timestamp when the description was created, in RFC 3339 format. + example: "2026-01-01T12:00:00Z" + type: string + description: + description: The human-readable description for the tag key. + example: AWS account that owns this cost. + type: string + source: + $ref: "#/components/schemas/CostTagDescriptionSource" + tag_key: + description: The tag key this description applies to. + example: account_id + type: string + updated_at: + description: Timestamp when the description was last updated, in RFC 3339 format. + example: "2026-01-01T12:00:00Z" + type: string + required: + - cloud + - created_at + - description + - source + - tag_key + - updated_at + type: object + CostTagDescriptionSource: + description: Origin of the description. `human` indicates the description was written by a user, `ai_generated` was produced by AI, and `datadog` is a default supplied by Datadog. + enum: + - human + - ai_generated + - datadog + example: human + type: string + x-enum-varnames: + - HUMAN + - AI_GENERATED + - DATADOG + CostTagDescriptionType: + default: tag_description + description: Type of the Cloud Cost Management tag description resource. + enum: + - tag_description + example: tag_description + type: string + x-enum-varnames: + - TAG_DESCRIPTION + CostTagDescriptionsResponse: + description: List of Cloud Cost Management tag key descriptions for the organization, optionally filtered to a single cloud provider. + example: + data: + - attributes: + cloud: aws + created_at: "2026-01-01T12:00:00Z" + description: AWS account that owns this cost. + source: human + tag_key: account_id + updated_at: "2026-01-01T12:00:00Z" + id: account_id + type: tag_description + properties: + data: + description: List of tag key descriptions. + items: + $ref: "#/components/schemas/CostTagDescription" + type: array + required: + - data + type: object CoverageSummaryAttributes: description: Attributes object for code coverage summary response. properties: @@ -96737,6 +96829,60 @@ paths: operator: OR permissions: - cloud_cost_management_read + /api/v2/cost/tag_descriptions: + get: + description: List Cloud Cost Management tag key descriptions for the organization. Use `filter[cloud]` to scope the result to a single cloud provider; when omitted, both cross-cloud defaults and cloud-specific descriptions are returned. + operationId: ListCostTagDescriptions + parameters: + - description: Filter descriptions to a specific cloud provider (for example, `aws`). Omit to return descriptions across all clouds. + in: query + name: filter[cloud] + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + cloud: aws + created_at: "2026-01-01T12:00:00Z" + description: AWS account that owns this cost. + source: human + tag_key: account_id + updated_at: "2026-01-01T12:00:00Z" + id: account_id + type: tag_description + schema: + $ref: "#/components/schemas/CostTagDescriptionsResponse" + description: OK + "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 descriptions + 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_by_tag/active_billing_dimensions: get: description: |- diff --git a/examples/v2/cloud-cost-management/ListCostTagDescriptions.rb b/examples/v2/cloud-cost-management/ListCostTagDescriptions.rb new file mode 100644 index 000000000000..353d383c96a2 --- /dev/null +++ b/examples/v2/cloud-cost-management/ListCostTagDescriptions.rb @@ -0,0 +1,8 @@ +# List Cloud Cost Management tag descriptions returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_cost_tag_descriptions".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.list_cost_tag_descriptions() diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 2845caa14151..ba2bdee56afe 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2182,6 +2182,9 @@ "cloud_account_id" => "Integer", "body" => "GCPUsageCostConfigPatchRequest", }, + "v2.ListCostTagDescriptions" => { + "filter_cloud" => "String", + }, "v2.CreateTagPipelinesRuleset" => { "body" => "CreateRulesetRequest", }, diff --git a/features/v2/cloud_cost_management.feature b/features/v2/cloud_cost_management.feature index 1e9f5de20c20..418f38d1d2b1 100644 --- a/features/v2/cloud_cost_management.feature +++ b/features/v2/cloud_cost_management.feature @@ -319,6 +319,13 @@ 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 descriptions returns "OK" response + Given operation "ListCostTagDescriptions" enabled + And new "ListCostTagDescriptions" 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 ba643b996fc0..ff3aa51748a5 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1470,6 +1470,12 @@ "type": "safe" } }, + "ListCostTagDescriptions": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "GetActiveBillingDimensions": { "tag": "Usage Metering", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 51e51306afaa..b65e6e18756c 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -292,6 +292,7 @@ def initialize "v2.search_security_monitoring_histsignals": false, "v2.get_code_coverage_branch_summary": false, "v2.get_code_coverage_commit_summary": false, + "v2.list_cost_tag_descriptions": false, "v2.create_dashboard_secure_embed": false, "v2.delete_dashboard_secure_embed": false, "v2.get_dashboard_secure_embed": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 392c822b590f..8864ce914837 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1988,6 +1988,11 @@ def overrides "v2.cost_by_org_attributes" => "CostByOrgAttributes", "v2.cost_by_org_response" => "CostByOrgResponse", "v2.cost_by_org_type" => "CostByOrgType", + "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.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 5079560bba90..7f94808c0443 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 @@ -1580,6 +1580,74 @@ def list_cost_oci_configs_with_http_info(opts = {}) return data, status_code, headers end + # List Cloud Cost Management tag descriptions. + # + # @see #list_cost_tag_descriptions_with_http_info + def list_cost_tag_descriptions(opts = {}) + data, _status_code, _headers = list_cost_tag_descriptions_with_http_info(opts) + data + end + + # List Cloud Cost Management tag descriptions. + # + # List Cloud Cost Management tag key descriptions for the organization. Use `filter[cloud]` to scope the result to a single cloud provider; when omitted, both cross-cloud defaults and cloud-specific descriptions are returned. + # + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_cloud Filter descriptions to a specific cloud provider (for example, `aws`). Omit to return descriptions across all clouds. + # @return [Array<(CostTagDescriptionsResponse, Integer, Hash)>] CostTagDescriptionsResponse data, response status code and response headers + def list_cost_tag_descriptions_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_cost_tag_descriptions".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_cost_tag_descriptions") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_cost_tag_descriptions")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.list_cost_tag_descriptions ...' + end + # resource path + local_var_path = '/api/v2/cost/tag_descriptions' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[cloud]'] = opts[:'filter_cloud'] if !opts[:'filter_cloud'].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] || 'CostTagDescriptionsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_cost_tag_descriptions, + :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_descriptions\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_description.rb b/lib/datadog_api_client/v2/models/cost_tag_description.rb new file mode 100644 index 000000000000..aa5fbb805d12 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_description.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 description, either cross-cloud or scoped to a single cloud provider. + class CostTagDescription + include BaseGenericModel + + # Human-readable description and metadata attached to a Cloud Cost Management tag key, optionally scoped to a single cloud provider. + attr_reader :attributes + + # Stable identifier of the tag description. Equals the tag key when the description is the cross-cloud default; encodes both the cloud and the tag key when the description is cloud-specific. + attr_reader :id + + # Type of the Cloud Cost Management tag description 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' => :'CostTagDescriptionAttributes', + :'id' => :'String', + :'type' => :'CostTagDescriptionType' + } + 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::CostTagDescription` 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_description_attributes.rb b/lib/datadog_api_client/v2/models/cost_tag_description_attributes.rb new file mode 100644 index 000000000000..88aae29956e1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_description_attributes.rb @@ -0,0 +1,228 @@ +=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 + # Human-readable description and metadata attached to a Cloud Cost Management tag key, optionally scoped to a single cloud provider. + class CostTagDescriptionAttributes + include BaseGenericModel + + # Cloud provider this description applies to (for example, `aws`). Empty when the description is the cross-cloud default for the tag key. + attr_reader :cloud + + # Timestamp when the description was created, in RFC 3339 format. + attr_reader :created_at + + # The human-readable description for the tag key. + attr_reader :description + + # Origin of the description. `human` indicates the description was written by a user, `ai_generated` was produced by AI, and `datadog` is a default supplied by Datadog. + attr_reader :source + + # The tag key this description applies to. + attr_reader :tag_key + + # Timestamp when the description was last updated, in RFC 3339 format. + attr_reader :updated_at + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'cloud' => :'cloud', + :'created_at' => :'created_at', + :'description' => :'description', + :'source' => :'source', + :'tag_key' => :'tag_key', + :'updated_at' => :'updated_at' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'cloud' => :'String', + :'created_at' => :'String', + :'description' => :'String', + :'source' => :'CostTagDescriptionSource', + :'tag_key' => :'String', + :'updated_at' => :'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::CostTagDescriptionAttributes` 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?(:'cloud') + self.cloud = attributes[:'cloud'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'source') + self.source = attributes[:'source'] + end + + if attributes.key?(:'tag_key') + self.tag_key = attributes[:'tag_key'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + 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 @cloud.nil? + return false if @created_at.nil? + return false if @description.nil? + return false if @source.nil? + return false if @tag_key.nil? + return false if @updated_at.nil? + true + end + + # Custom attribute writer method with validation + # @param cloud [Object] Object to be assigned + # @!visibility private + def cloud=(cloud) + if cloud.nil? + fail ArgumentError, 'invalid value for "cloud", cloud cannot be nil.' + end + @cloud = cloud + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + 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 source [Object] Object to be assigned + # @!visibility private + def source=(source) + if source.nil? + fail ArgumentError, 'invalid value for "source", source cannot be nil.' + end + @source = source + end + + # Custom attribute writer method with validation + # @param tag_key [Object] Object to be assigned + # @!visibility private + def tag_key=(tag_key) + if tag_key.nil? + fail ArgumentError, 'invalid value for "tag_key", tag_key cannot be nil.' + end + @tag_key = tag_key + end + + # Custom attribute writer method with validation + # @param updated_at [Object] Object to be assigned + # @!visibility private + def updated_at=(updated_at) + if updated_at.nil? + fail ArgumentError, 'invalid value for "updated_at", updated_at cannot be nil.' + end + @updated_at = updated_at + 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 && + cloud == o.cloud && + created_at == o.created_at && + description == o.description && + source == o.source && + tag_key == o.tag_key && + updated_at == o.updated_at && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [cloud, created_at, description, source, tag_key, updated_at, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/cost_tag_description_source.rb b/lib/datadog_api_client/v2/models/cost_tag_description_source.rb new file mode 100644 index 000000000000..e305b79aac9b --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_description_source.rb @@ -0,0 +1,28 @@ +=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 + # Origin of the description. `human` indicates the description was written by a user, `ai_generated` was produced by AI, and `datadog` is a default supplied by Datadog. + class CostTagDescriptionSource + include BaseEnumModel + + HUMAN = "human".freeze + AI_GENERATED = "ai_generated".freeze + DATADOG = "datadog".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/cost_tag_description_type.rb b/lib/datadog_api_client/v2/models/cost_tag_description_type.rb new file mode 100644 index 000000000000..05c1f809e1ed --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_description_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 description resource. + class CostTagDescriptionType + include BaseEnumModel + + TAG_DESCRIPTION = "tag_description".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/cost_tag_descriptions_response.rb b/lib/datadog_api_client/v2/models/cost_tag_descriptions_response.rb new file mode 100644 index 000000000000..f9c5cf91eb85 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_descriptions_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 Cloud Cost Management tag key descriptions for the organization, optionally filtered to a single cloud provider. + class CostTagDescriptionsResponse + include BaseGenericModel + + # List of tag key descriptions. + 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::CostTagDescriptionsResponse` 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