diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 24d89e059e32..f7368511bc9a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -29597,6 +29597,10 @@ components: CustomCostsFileMetadata: description: Schema of a Custom Costs metadata. properties: + ai_provider: + description: Whether the Custom Costs file contains the costs of an AI provider. + example: false + type: boolean billed_cost: description: Total cost in the cost file. example: 100.50 @@ -29646,6 +29650,10 @@ components: CustomCostsFileMetadataWithContent: description: Schema of a cost file's metadata. properties: + ai_provider: + description: Whether the Custom Costs file contains the costs of an AI provider. + example: false + type: boolean billed_cost: description: Total cost in the cost file. example: 100.50 @@ -162449,6 +162457,7 @@ paths: value: data: - attributes: + ai_provider: false billed_cost: 100.5 billing_currency: USD charge_period: @@ -162496,6 +162505,14 @@ paths: put: description: Upload a Custom Costs file. operationId: UploadCustomCostsFile + parameters: + - description: Whether the uploaded file contains the costs of an AI provider. + in: query + name: ai_provider + required: false + schema: + default: false + type: boolean requestBody: content: application/json: @@ -162519,6 +162536,7 @@ paths: value: data: attributes: + ai_provider: false billed_cost: 100.5 billing_currency: USD charge_period: @@ -162607,6 +162625,7 @@ paths: value: data: attributes: + ai_provider: false billed_cost: 100.5 billing_currency: USD charge_period: diff --git a/examples/v2/cloud-cost-management/UploadCustomCostsFile_3323862424.rb b/examples/v2/cloud-cost-management/UploadCustomCostsFile_3323862424.rb new file mode 100644 index 000000000000..5233cf8237cc --- /dev/null +++ b/examples/v2/cloud-cost-management/UploadCustomCostsFile_3323862424.rb @@ -0,0 +1,22 @@ +# Upload Custom Costs file marked as an AI provider file returns "Accepted" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.access_token = ENV["DD_BEARER_TOKEN"] +end +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new + +body = [ + DatadogAPIClient::V2::CustomCostsFileLineItem.new({ + provider_name: "my_ai_provider", + charge_period_start: "2026-10-01", + charge_period_end: "2026-10-31", + charge_description: "my_description", + billed_cost: 250, + billing_currency: "USD", + }), +] +opts = { + ai_provider: true, +} +p api_instance.upload_custom_costs_file(body, opts) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 0f243bc1241e..12dca0150ef9 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -3051,6 +3051,7 @@ "sort" => "String", }, "v2.UploadCustomCostsFile" => { + "ai_provider" => "Boolean", "body" => "Array", }, "v2.DeleteCustomCostsFile" => { diff --git a/features/v2/cloud_cost_management.feature b/features/v2/cloud_cost_management.feature index ec0defe48d7b..5e633c80e3af 100644 --- a/features/v2/cloud_cost_management.feature +++ b/features/v2/cloud_cost_management.feature @@ -1186,6 +1186,15 @@ Feature: Cloud Cost Management Then the response status is 202 Accepted And the response "data.attributes.name" is equal to "data.json" + @team:ddoghq/cloud-cost-management + Scenario: Upload Custom Costs file marked as an AI provider file returns "Accepted" response + Given new "UploadCustomCostsFile" request + And request contains "ai_provider" parameter with value true + And body with value [{"ProviderName": "my_ai_provider", "ChargePeriodStart": "2026-10-01", "ChargePeriodEnd": "2026-10-31", "ChargeDescription": "my_description", "BilledCost": 250, "BillingCurrency": "USD"}] + When the request is sent + Then the response status is 202 Accepted + And the response "data.attributes.ai_provider" is equal to true + @generated @skip @team:ddoghq/cloud-cost-management Scenario: Upload Custom Costs file returns "Accepted" response Given new "UploadCustomCostsFile" request diff --git a/generated-test/test-runner-data/manifest.json b/generated-test/test-runner-data/manifest.json index 6bc9e44461d2..9be9bfc18b08 100644 --- a/generated-test/test-runner-data/manifest.json +++ b/generated-test/test-runner-data/manifest.json @@ -4431,6 +4431,13 @@ "scenario": "Upload Custom Costs File returns \"Accepted\" response", "version": "v2" }, + { + "feature": "Cloud Cost Management", + "feature_file": "../../features/v2/cloud_cost_management.feature", + "file": "v2/cloud-cost-management/upload-custom-costs-file-marked-as-an-ai-provider-file-returns-accepted-response.json", + "scenario": "Upload Custom Costs file marked as an AI provider file returns \"Accepted\" response", + "version": "v2" + }, { "feature": "Cloud Cost Management", "feature_file": "../../features/v2/cloud_cost_management.feature", diff --git a/generated-test/test-runner-data/v2/cloud-cost-management/upload-custom-costs-file-marked-as-an-ai-provider-file-returns-accepted-response.json b/generated-test/test-runner-data/v2/cloud-cost-management/upload-custom-costs-file-marked-as-an-ai-provider-file-returns-accepted-response.json new file mode 100644 index 000000000000..f8fc9fb3b79a --- /dev/null +++ b/generated-test/test-runner-data/v2/cloud-cost-management/upload-custom-costs-file-marked-as-an-ai-provider-file-returns-accepted-response.json @@ -0,0 +1,57 @@ +{ + "api": "CloudCostManagement", + "expected_status": 202, + "feature": "Cloud Cost Management", + "id": "v2/Cloud Cost Management/Upload Custom Costs file marked as an AI provider file returns \"Accepted\" response", + "operation_id": "UploadCustomCostsFile", + "request": { + "body": { + "schema": { + "format": null, + "items": { + "format": null, + "ref": "CustomCostsFileLineItem", + "type": "object" + }, + "ref": "CustomCostsFileUploadRequest", + "type": "array" + }, + "source": "inline", + "value": [ + { + "BilledCost": 250, + "BillingCurrency": "USD", + "ChargeDescription": "my_description", + "ChargePeriodEnd": "2026-10-31", + "ChargePeriodStart": "2026-10-01", + "ProviderName": "my_ai_provider" + } + ] + }, + "content_type": "application/json", + "method": "PUT", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "query", + "name": "ai_provider", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "boolean" + }, + "source": { + "type": "literal", + "value": true + }, + "style": null + } + ], + "path": "/api/v2/cost/custom_costs" + }, + "scenario": "Upload Custom Costs file marked as an AI provider file returns \"Accepted\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/generated-test/test-server-data/v2/cloud-cost-management.json b/generated-test/test-server-data/v2/cloud-cost-management.json index de073b6055bc..51ace3263325 100644 --- a/generated-test/test-server-data/v2/cloud-cost-management.json +++ b/generated-test/test-server-data/v2/cloud-cost-management.json @@ -2240,6 +2240,51 @@ "scenario": "Upload Custom Costs File returns \"Accepted\" response", "version": "v2" }, + { + "feature": "Cloud Cost Management", + "frozen_at": "2026-11-02T15:43:51.566Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": [ + { + "BilledCost": 250, + "BillingCurrency": "USD", + "ChargeDescription": "my_description", + "ChargePeriodEnd": "2026-10-31", + "ChargePeriodStart": "2026-10-01", + "ProviderName": "my_ai_provider" + } + ] + }, + "content_type": "application/json", + "method": "PUT", + "path": "/api/v2/cost/custom_costs", + "query": [ + [ + "ai_provider", + "true" + ] + ] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"495fb2db-ee1e-4656-8914-6db06370bf74\",\"type\":\"cost_metadata\",\"attributes\":{\"ai_provider\":true,\"billed_cost\":250,\"billing_currency\":\"USD\",\"charge_period\":{\"start\":1790812800000,\"end\":1793404800000},\"name\":\"data.json\",\"provider_names\":[\"my_ai_provider\"],\"status\":\"UPLOADING\",\"uploaded_at\":1793634232151,\"uploaded_by\":{\"name\":\"C\u00e9dric Van Rompay\",\"icon\":\"https://secure.gravatar.com/avatar/fb5991514ab909a799dd362ad990f4f8?d=retro\\u0026s=48\",\"email\":\"cedric.vanrompay@datadoghq.com\"}}},\"meta\":{\"version\":\"1.0\"}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Accepted", + "status": 202 + } + } + ], + "scenario": "Upload Custom Costs file marked as an AI provider file returns \"Accepted\" response", + "version": "v2" + }, { "feature": "Cloud Cost Management", "frozen_at": "2025-08-13T18:09:22.298Z", 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 86bc9541ae24..e77aa0b97ddb 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 @@ -5098,6 +5098,7 @@ def upload_custom_costs_file(body, opts = {}) # # @param body [Array] # @param opts [Hash] the optional parameters + # @option opts [Boolean] :ai_provider Whether the uploaded file contains the costs of an AI provider. # @return [Array<(CustomCostsFileUploadResponse, Integer, Hash)>] CustomCostsFileUploadResponse data, response status code and response headers def upload_custom_costs_file_with_http_info(body, opts = {}) @@ -5113,6 +5114,7 @@ def upload_custom_costs_file_with_http_info(body, opts = {}) # query parameters query_params = opts[:query_params] || {} + query_params[:'ai_provider'] = opts[:'ai_provider'] if !opts[:'ai_provider'].nil? # header parameters header_params = opts[:header_params] || {} diff --git a/lib/datadog_api_client/v2/models/custom_costs_file_metadata.rb b/lib/datadog_api_client/v2/models/custom_costs_file_metadata.rb index ce5666f3e17c..e993d7f5b0ed 100644 --- a/lib/datadog_api_client/v2/models/custom_costs_file_metadata.rb +++ b/lib/datadog_api_client/v2/models/custom_costs_file_metadata.rb @@ -21,6 +21,9 @@ module DatadogAPIClient::V2 class CustomCostsFileMetadata include BaseGenericModel + # Whether the Custom Costs file contains the costs of an AI provider. + attr_accessor :ai_provider + # Total cost in the cost file. attr_accessor :billed_cost @@ -51,6 +54,7 @@ class CustomCostsFileMetadata # @!visibility private def self.attribute_map { + :'ai_provider' => :'ai_provider', :'billed_cost' => :'billed_cost', :'billing_currency' => :'billing_currency', :'charge_period' => :'charge_period', @@ -66,6 +70,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { + :'ai_provider' => :'Boolean', :'billed_cost' => :'Float', :'billing_currency' => :'String', :'charge_period' => :'CustomCostsFileUsageChargePeriod', @@ -95,6 +100,10 @@ def initialize(attributes = {}) end } + if attributes.key?(:'ai_provider') + self.ai_provider = attributes[:'ai_provider'] + end + if attributes.key?(:'billed_cost') self.billed_cost = attributes[:'billed_cost'] end @@ -156,6 +165,7 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && + ai_provider == o.ai_provider && billed_cost == o.billed_cost && billing_currency == o.billing_currency && charge_period == o.charge_period && @@ -171,7 +181,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [billed_cost, billing_currency, charge_period, name, provider_names, status, uploaded_at, uploaded_by, additional_properties].hash + [ai_provider, billed_cost, billing_currency, charge_period, name, provider_names, status, uploaded_at, uploaded_by, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/custom_costs_file_metadata_with_content.rb b/lib/datadog_api_client/v2/models/custom_costs_file_metadata_with_content.rb index ade8afebfe58..bfa344893d96 100644 --- a/lib/datadog_api_client/v2/models/custom_costs_file_metadata_with_content.rb +++ b/lib/datadog_api_client/v2/models/custom_costs_file_metadata_with_content.rb @@ -21,6 +21,9 @@ module DatadogAPIClient::V2 class CustomCostsFileMetadataWithContent include BaseGenericModel + # Whether the Custom Costs file contains the costs of an AI provider. + attr_accessor :ai_provider + # Total cost in the cost file. attr_accessor :billed_cost @@ -54,6 +57,7 @@ class CustomCostsFileMetadataWithContent # @!visibility private def self.attribute_map { + :'ai_provider' => :'ai_provider', :'billed_cost' => :'billed_cost', :'billing_currency' => :'billing_currency', :'charge_period' => :'charge_period', @@ -70,6 +74,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { + :'ai_provider' => :'Boolean', :'billed_cost' => :'Float', :'billing_currency' => :'String', :'charge_period' => :'CustomCostsFileUsageChargePeriod', @@ -100,6 +105,10 @@ def initialize(attributes = {}) end } + if attributes.key?(:'ai_provider') + self.ai_provider = attributes[:'ai_provider'] + end + if attributes.key?(:'billed_cost') self.billed_cost = attributes[:'billed_cost'] end @@ -167,6 +176,7 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && + ai_provider == o.ai_provider && billed_cost == o.billed_cost && billing_currency == o.billing_currency && charge_period == o.charge_period && @@ -183,7 +193,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [billed_cost, billing_currency, charge_period, content, name, provider_names, status, uploaded_at, uploaded_by, additional_properties].hash + [ai_provider, billed_cost, billing_currency, charge_period, content, name, provider_names, status, uploaded_at, uploaded_by, additional_properties].hash end end end