From 66f05d158bb4340e14137e3cdcc5602ce2a4de71 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 2 Nov 2026 18:20:02 +0000 Subject: [PATCH] Regenerate client from commit 741d2b9 of spec repo --- .generator/schemas/v2/openapi.yaml | 19 +++++++ .../UploadCustomCostsFile_3323862424.py | 27 +++++++++ .../v2/api/cloud_cost_management_api.py | 12 ++++ .../v2/model/custom_costs_file_metadata.py | 8 +++ ...custom_costs_file_metadata_with_content.py | 8 +++ .../test-runner-data/manifest.json | 7 +++ ...ovider-file-returns-accepted-response.json | 57 +++++++++++++++++++ .../v2/cloud-cost-management.json | 45 +++++++++++++++ .../v2/features/cloud_cost_management.feature | 9 +++ 9 files changed, 192 insertions(+) create mode 100644 examples/v2/cloud-cost-management/UploadCustomCostsFile_3323862424.py create mode 100644 tests/generated-test/test-runner-data/v2/cloud-cost-management/upload-custom-costs-file-marked-as-an-ai-provider-file-returns-accepted-response.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 24d89e059e..f7368511bc 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.py b/examples/v2/cloud-cost-management/UploadCustomCostsFile_3323862424.py new file mode 100644 index 0000000000..595cf7b377 --- /dev/null +++ b/examples/v2/cloud-cost-management/UploadCustomCostsFile_3323862424.py @@ -0,0 +1,27 @@ +""" +Upload Custom Costs file marked as an AI provider file returns "Accepted" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi +from datadog_api_client.v2.model.custom_costs_file_line_item import CustomCostsFileLineItem + +body = [ + CustomCostsFileLineItem( + provider_name="my_ai_provider", + charge_period_start="2026-10-01", + charge_period_end="2026-10-31", + charge_description="my_description", + billed_cost=250.0, + billing_currency="USD", + ), +] + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +with ApiClient(configuration) as api_client: + api_instance = CloudCostManagementApi(api_client) + response = api_instance.upload_custom_costs_file(ai_provider=True, body=body) + + print(response) diff --git a/src/datadog_api_client/v2/api/cloud_cost_management_api.py b/src/datadog_api_client/v2/api/cloud_cost_management_api.py index efedb060bd..3bbdbb436a 100644 --- a/src/datadog_api_client/v2/api/cloud_cost_management_api.py +++ b/src/datadog_api_client/v2/api/cloud_cost_management_api.py @@ -2051,6 +2051,11 @@ def __init__(self, api_client=None): "version": "v2", }, params_map={ + "ai_provider": { + "openapi_types": (bool,), + "attribute": "ai_provider", + "location": "query", + }, "body": { "required": True, "openapi_types": ([CustomCostsFileLineItem],), @@ -3847,15 +3852,22 @@ def update_unit_cost( def upload_custom_costs_file( self, body: List[CustomCostsFileLineItem], + *, + ai_provider: Union[bool, UnsetType] = unset, ) -> CustomCostsFileUploadResponse: """Upload Custom Costs file. Upload a Custom Costs file. :type body: [CustomCostsFileLineItem] + :param ai_provider: Whether the uploaded file contains the costs of an AI provider. + :type ai_provider: bool, optional :rtype: CustomCostsFileUploadResponse """ kwargs: Dict[str, Any] = {} + if ai_provider is not unset: + kwargs["ai_provider"] = ai_provider + kwargs["body"] = body return self._upload_custom_costs_file_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/model/custom_costs_file_metadata.py b/src/datadog_api_client/v2/model/custom_costs_file_metadata.py index 67bca32cdf..1b1c9de2c2 100644 --- a/src/datadog_api_client/v2/model/custom_costs_file_metadata.py +++ b/src/datadog_api_client/v2/model/custom_costs_file_metadata.py @@ -25,6 +25,7 @@ def openapi_types(_): from datadog_api_client.v2.model.custom_costs_user import CustomCostsUser return { + "ai_provider": (bool,), "billed_cost": (float,), "billing_currency": (str,), "charge_period": (CustomCostsFileUsageChargePeriod,), @@ -36,6 +37,7 @@ def openapi_types(_): } attribute_map = { + "ai_provider": "ai_provider", "billed_cost": "billed_cost", "billing_currency": "billing_currency", "charge_period": "charge_period", @@ -48,6 +50,7 @@ def openapi_types(_): def __init__( self_, + ai_provider: Union[bool, UnsetType] = unset, billed_cost: Union[float, UnsetType] = unset, billing_currency: Union[str, UnsetType] = unset, charge_period: Union[CustomCostsFileUsageChargePeriod, UnsetType] = unset, @@ -61,6 +64,9 @@ def __init__( """ Schema of a Custom Costs metadata. + :param ai_provider: Whether the Custom Costs file contains the costs of an AI provider. + :type ai_provider: bool, optional + :param billed_cost: Total cost in the cost file. :type billed_cost: float, optional @@ -85,6 +91,8 @@ def __init__( :param uploaded_by: Metadata of the user that has uploaded the Custom Costs file. :type uploaded_by: CustomCostsUser, optional """ + if ai_provider is not unset: + kwargs["ai_provider"] = ai_provider if billed_cost is not unset: kwargs["billed_cost"] = billed_cost if billing_currency is not unset: diff --git a/src/datadog_api_client/v2/model/custom_costs_file_metadata_with_content.py b/src/datadog_api_client/v2/model/custom_costs_file_metadata_with_content.py index 7e7c5311ec..2531df2847 100644 --- a/src/datadog_api_client/v2/model/custom_costs_file_metadata_with_content.py +++ b/src/datadog_api_client/v2/model/custom_costs_file_metadata_with_content.py @@ -27,6 +27,7 @@ def openapi_types(_): from datadog_api_client.v2.model.custom_costs_user import CustomCostsUser return { + "ai_provider": (bool,), "billed_cost": (float,), "billing_currency": (str,), "charge_period": (CustomCostsFileUsageChargePeriod,), @@ -39,6 +40,7 @@ def openapi_types(_): } attribute_map = { + "ai_provider": "ai_provider", "billed_cost": "billed_cost", "billing_currency": "billing_currency", "charge_period": "charge_period", @@ -52,6 +54,7 @@ def openapi_types(_): def __init__( self_, + ai_provider: Union[bool, UnsetType] = unset, billed_cost: Union[float, UnsetType] = unset, billing_currency: Union[str, UnsetType] = unset, charge_period: Union[CustomCostsFileUsageChargePeriod, UnsetType] = unset, @@ -66,6 +69,9 @@ def __init__( """ Schema of a cost file's metadata. + :param ai_provider: Whether the Custom Costs file contains the costs of an AI provider. + :type ai_provider: bool, optional + :param billed_cost: Total cost in the cost file. :type billed_cost: float, optional @@ -93,6 +99,8 @@ def __init__( :param uploaded_by: Metadata of the user that has uploaded the Custom Costs file. :type uploaded_by: CustomCostsUser, optional """ + if ai_provider is not unset: + kwargs["ai_provider"] = ai_provider if billed_cost is not unset: kwargs["billed_cost"] = billed_cost if billing_currency is not unset: diff --git a/tests/generated-test/test-runner-data/manifest.json b/tests/generated-test/test-runner-data/manifest.json index 5b9ff71df7..3f5d5a1ed7 100644 --- a/tests/generated-test/test-runner-data/manifest.json +++ b/tests/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": "../../v2/features/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": "../../v2/features/cloud_cost_management.feature", diff --git a/tests/generated-test/test-runner-data/v2/cloud-cost-management/upload-custom-costs-file-marked-as-an-ai-provider-file-returns-accepted-response.json b/tests/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 0000000000..f8fc9fb3b7 --- /dev/null +++ b/tests/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/tests/generated-test/test-server-data/v2/cloud-cost-management.json b/tests/generated-test/test-server-data/v2/cloud-cost-management.json index de073b6055..51ace32633 100644 --- a/tests/generated-test/test-server-data/v2/cloud-cost-management.json +++ b/tests/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/tests/v2/features/cloud_cost_management.feature b/tests/v2/features/cloud_cost_management.feature index ec0defe48d..5e633c80e3 100644 --- a/tests/v2/features/cloud_cost_management.feature +++ b/tests/v2/features/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