diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 3bd4dc4902..01713f0b6e 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -18173,6 +18173,25 @@ components: - tag_key - updated_at type: object + CostTagDescriptionResponse: + description: Single Cloud Cost Management tag key description returned by the get-by-key endpoint. + 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: cost_tag_description + properties: + data: + $ref: "#/components/schemas/CostTagDescription" + required: + - data + 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: @@ -18194,6 +18213,50 @@ components: type: string x-enum-varnames: - COST_TAG_DESCRIPTION + CostTagDescriptionUpsertRequest: + description: Request body for creating or updating a Cloud Cost Management tag key description. + example: + data: + attributes: + cloud: aws + description: AWS account that owns this cost. + id: account_id + type: cost_tag_description + properties: + data: + $ref: "#/components/schemas/CostTagDescriptionUpsertRequestData" + required: + - data + type: object + CostTagDescriptionUpsertRequestData: + description: Resource envelope carrying the tag key description being upserted. The `id` is informational; the authoritative tag key is taken from the URL path. + properties: + attributes: + $ref: "#/components/schemas/CostTagDescriptionUpsertRequestDataAttributes" + id: + description: Identifier of the tag key the description applies to. Matches the `tag_key` path parameter. + example: account_id + type: string + type: + $ref: "#/components/schemas/CostTagDescriptionType" + required: + - attributes + - type + type: object + CostTagDescriptionUpsertRequestDataAttributes: + description: Mutable attributes set when creating or updating a Cloud Cost Management tag key description. + properties: + cloud: + description: Cloud provider this description applies to (for example, `aws`). Omit to set the cross-cloud default for the tag key. + example: aws + type: string + description: + description: The human-readable description for the tag key. + example: AWS account that owns this cost. + type: string + required: + - description + type: object CostTagDescriptionsResponse: description: List of Cloud Cost Management tag key descriptions for the organization, optionally filtered to a single cloud provider. example: @@ -34119,6 +34182,55 @@ components: required: - type type: object + GenerateCostTagDescriptionResponse: + description: Response wrapping an AI-generated Cloud Cost Management tag key description. + example: + data: + attributes: + description: AWS account that owns this cost. + id: account_id + type: cost_generated_tag_description + properties: + data: + $ref: "#/components/schemas/GeneratedCostTagDescription" + required: + - data + type: object + GeneratedCostTagDescription: + description: AI-generated Cloud Cost Management tag key description returned by the generate endpoint. The result is returned to the client but is not persisted by this endpoint. + properties: + attributes: + $ref: "#/components/schemas/GeneratedCostTagDescriptionAttributes" + id: + description: The tag key the AI description was generated for. + example: account_id + type: string + type: + $ref: "#/components/schemas/GeneratedCostTagDescriptionType" + required: + - attributes + - id + - type + type: object + GeneratedCostTagDescriptionAttributes: + description: Attributes of an AI-generated Cloud Cost Management tag key description. + properties: + description: + description: The AI-generated description for the tag key. + example: AWS account that owns this cost. + type: string + required: + - description + type: object + GeneratedCostTagDescriptionType: + default: cost_generated_tag_description + description: Type of the AI-generated Cloud Cost Management tag description resource. + enum: + - cost_generated_tag_description + example: cost_generated_tag_description + type: string + x-enum-varnames: + - COST_GENERATED_TAG_DESCRIPTION GetActionConnectionResponse: description: The response for found connection properties: @@ -108672,6 +108784,226 @@ paths: operator: OR permissions: - cloud_cost_management_read + /api/v2/cost/tag_descriptions/{tag_key}: + delete: + description: Delete a Cloud Cost Management tag key description. When `cloud` is omitted, deletes every description for the tag key, falling back to Datadog's global default when available. When `cloud` is provided, deletes only the description scoped to that cloud provider. + operationId: DeleteCostTagDescriptionByKey + parameters: + - description: The tag key whose description is being deleted. + in: path + name: tag_key + required: true + schema: + type: string + - description: Cloud provider to scope the deletion to (for example, `aws`). Omit to delete every description for the tag key. + in: query + name: cloud + required: false + schema: + type: string + responses: + "204": + description: No Content + "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_write + summary: Delete a Cloud Cost Management tag description + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_write + get: + description: Get the Cloud Cost Management description for a single tag key. Use `filter[cloud]` to scope the lookup to a specific cloud provider; when omitted, the response resolves the description in fallback order (cloud-specific organization override, then cloudless organization default, then Datadog's global default). + operationId: GetCostTagDescriptionByKey + parameters: + - description: The tag key whose description is being fetched. + in: path + name: tag_key + required: true + schema: + type: string + - description: Cloud provider to scope the lookup to (for example, `aws`). Omit to use the resolved fallback. + 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: cost_tag_description + schema: + $ref: "#/components/schemas/CostTagDescriptionResponse" + 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 description + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + put: + description: Create or update a Cloud Cost Management tag key description. The new description and optional cloud scoping are supplied in the request body. Omit `cloud` to set a cross-cloud default for the tag key. + operationId: UpsertCostTagDescriptionByKey + parameters: + - description: The tag key whose description is being upserted. + in: path + name: tag_key + required: true + schema: + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + cloud: aws + description: AWS account that owns this cost. + id: account_id + type: cost_tag_description + schema: + $ref: "#/components/schemas/CostTagDescriptionUpsertRequest" + required: true + responses: + "204": + description: No Content + "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_write + summary: Upsert a Cloud Cost Management tag description + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_write + /api/v2/cost/tag_descriptions/{tag_key}/generate: + get: + description: Use AI to draft a Cloud Cost Management tag key description based on associated cost data. The generated description is returned in the response and is not persisted by this endpoint; follow up with `UpsertCostTagDescriptionByKey` to save it. + operationId: GenerateCostTagDescriptionByKey + parameters: + - description: The tag key to generate an AI description for. + in: path + name: tag_key + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + description: AWS account that owns this cost. + id: account_id + type: cost_generated_tag_description + schema: + $ref: "#/components/schemas/GenerateCostTagDescriptionResponse" + 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: Generate a Cloud Cost Management tag description + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read /api/v2/cost/tag_keys: get: description: List Cloud Cost Management tag keys. diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 8ebe6f4853..9067c25bf8 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -7249,6 +7249,13 @@ datadog\_api\_client.v2.model.cost\_tag\_description\_attributes module :members: :show-inheritance: +datadog\_api\_client.v2.model.cost\_tag\_description\_response module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.cost_tag_description_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.cost\_tag\_description\_source module ------------------------------------------------------------------- @@ -7263,6 +7270,27 @@ datadog\_api\_client.v2.model.cost\_tag\_description\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.cost\_tag\_description\_upsert\_request module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.cost_tag_description_upsert_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.cost\_tag\_description\_upsert\_request\_data module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.cost_tag_description_upsert_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.cost\_tag\_description\_upsert\_request\_data\_attributes module +---------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.cost_tag_description_upsert_request_data_attributes + :members: + :show-inheritance: + datadog\_api\_client.v2.model.cost\_tag\_descriptions\_response module ---------------------------------------------------------------------- @@ -14095,6 +14123,34 @@ datadog\_api\_client.v2.model.gemini\_integration\_update module :members: :show-inheritance: +datadog\_api\_client.v2.model.generate\_cost\_tag\_description\_response module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.generate_cost_tag_description_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.generated\_cost\_tag\_description module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.generated_cost_tag_description + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.generated\_cost\_tag\_description\_attributes module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.generated_cost_tag_description_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.generated\_cost\_tag\_description\_type module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.generated_cost_tag_description_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.get\_action\_connection\_response module ---------------------------------------------------------------------- diff --git a/examples/v2/cloud-cost-management/DeleteCostTagDescriptionByKey.py b/examples/v2/cloud-cost-management/DeleteCostTagDescriptionByKey.py new file mode 100644 index 0000000000..b77277960c --- /dev/null +++ b/examples/v2/cloud-cost-management/DeleteCostTagDescriptionByKey.py @@ -0,0 +1,13 @@ +""" +Delete a Cloud Cost Management tag description returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CloudCostManagementApi(api_client) + api_instance.delete_cost_tag_description_by_key( + tag_key="tag_key", + ) diff --git a/examples/v2/cloud-cost-management/GenerateCostTagDescriptionByKey.py b/examples/v2/cloud-cost-management/GenerateCostTagDescriptionByKey.py new file mode 100644 index 0000000000..53b0e6ab7a --- /dev/null +++ b/examples/v2/cloud-cost-management/GenerateCostTagDescriptionByKey.py @@ -0,0 +1,15 @@ +""" +Generate a Cloud Cost Management tag description returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CloudCostManagementApi(api_client) + response = api_instance.generate_cost_tag_description_by_key( + tag_key="tag_key", + ) + + print(response) diff --git a/examples/v2/cloud-cost-management/GetCostTagDescriptionByKey.py b/examples/v2/cloud-cost-management/GetCostTagDescriptionByKey.py new file mode 100644 index 0000000000..57eacf6829 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCostTagDescriptionByKey.py @@ -0,0 +1,15 @@ +""" +Get a Cloud Cost Management tag description returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CloudCostManagementApi(api_client) + response = api_instance.get_cost_tag_description_by_key( + tag_key="tag_key", + ) + + print(response) diff --git a/examples/v2/cloud-cost-management/UpsertCostTagDescriptionByKey.py b/examples/v2/cloud-cost-management/UpsertCostTagDescriptionByKey.py new file mode 100644 index 0000000000..0c3b19897d --- /dev/null +++ b/examples/v2/cloud-cost-management/UpsertCostTagDescriptionByKey.py @@ -0,0 +1,28 @@ +""" +Upsert a Cloud Cost Management tag description returns "No Content" response +""" + +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.cost_tag_description_type import CostTagDescriptionType +from datadog_api_client.v2.model.cost_tag_description_upsert_request import CostTagDescriptionUpsertRequest +from datadog_api_client.v2.model.cost_tag_description_upsert_request_data import CostTagDescriptionUpsertRequestData +from datadog_api_client.v2.model.cost_tag_description_upsert_request_data_attributes import ( + CostTagDescriptionUpsertRequestDataAttributes, +) + +body = CostTagDescriptionUpsertRequest( + data=CostTagDescriptionUpsertRequestData( + attributes=CostTagDescriptionUpsertRequestDataAttributes( + cloud="aws", + description="AWS account that owns this cost.", + ), + id="account_id", + type=CostTagDescriptionType.COST_TAG_DESCRIPTION, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CloudCostManagementApi(api_client) + api_instance.upsert_cost_tag_description_by_key(tag_key="tag_key", body=body) 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 654644f9dd..9df255c33a 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 @@ -59,6 +59,9 @@ from datadog_api_client.v2.model.cost_recommendation_array import CostRecommendationArray from datadog_api_client.v2.model.recommendations_filter_request import RecommendationsFilterRequest from datadog_api_client.v2.model.cost_tag_descriptions_response import CostTagDescriptionsResponse +from datadog_api_client.v2.model.cost_tag_description_response import CostTagDescriptionResponse +from datadog_api_client.v2.model.cost_tag_description_upsert_request import CostTagDescriptionUpsertRequest +from datadog_api_client.v2.model.generate_cost_tag_description_response import GenerateCostTagDescriptionResponse from datadog_api_client.v2.model.cost_tag_keys_response import CostTagKeysResponse from datadog_api_client.v2.model.cost_tag_key_response import CostTagKeyResponse from datadog_api_client.v2.model.cost_tag_key_metadata_response import CostTagKeyMetadataResponse @@ -280,6 +283,34 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._delete_cost_tag_description_by_key_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cost/tag_descriptions/{tag_key}", + "operation_id": "delete_cost_tag_description_by_key", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "tag_key": { + "required": True, + "openapi_types": (str,), + "attribute": "tag_key", + "location": "path", + }, + "cloud": { + "openapi_types": (str,), + "attribute": "cloud", + "location": "query", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + self._delete_custom_allocation_rule_endpoint = _Endpoint( settings={ "response_type": None, @@ -349,6 +380,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._generate_cost_tag_description_by_key_endpoint = _Endpoint( + settings={ + "response_type": (GenerateCostTagDescriptionResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cost/tag_descriptions/{tag_key}/generate", + "operation_id": "generate_cost_tag_description_by_key", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "tag_key": { + "required": True, + "openapi_types": (str,), + "attribute": "tag_key", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._get_budget_endpoint = _Endpoint( settings={ "response_type": (BudgetWithEntries,), @@ -847,6 +901,34 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_cost_tag_description_by_key_endpoint = _Endpoint( + settings={ + "response_type": (CostTagDescriptionResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cost/tag_descriptions/{tag_key}", + "operation_id": "get_cost_tag_description_by_key", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "tag_key": { + "required": True, + "openapi_types": (str,), + "attribute": "tag_key", + "location": "path", + }, + "filter_cloud": { + "openapi_types": (str,), + "attribute": "filter[cloud]", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._get_cost_tag_key_endpoint = _Endpoint( settings={ "response_type": (CostTagKeyResponse,), @@ -1710,6 +1792,32 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._upsert_cost_tag_description_by_key_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cost/tag_descriptions/{tag_key}", + "operation_id": "upsert_cost_tag_description_by_key", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "tag_key": { + "required": True, + "openapi_types": (str,), + "attribute": "tag_key", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (CostTagDescriptionUpsertRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._validate_budget_endpoint = _Endpoint( settings={ "response_type": (BudgetValidationResponse,), @@ -1928,6 +2036,30 @@ def delete_cost_gcp_usage_cost_config( return self._delete_cost_gcp_usage_cost_config_endpoint.call_with_http_info(**kwargs) + def delete_cost_tag_description_by_key( + self, + tag_key: str, + *, + cloud: Union[str, UnsetType] = unset, + ) -> None: + """Delete a Cloud Cost Management tag description. + + Delete a Cloud Cost Management tag key description. When ``cloud`` is omitted, deletes every description for the tag key, falling back to Datadog's global default when available. When ``cloud`` is provided, deletes only the description scoped to that cloud provider. + + :param tag_key: The tag key whose description is being deleted. + :type tag_key: str + :param cloud: Cloud provider to scope the deletion to (for example, ``aws`` ). Omit to delete every description for the tag key. + :type cloud: str, optional + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["tag_key"] = tag_key + + if cloud is not unset: + kwargs["cloud"] = cloud + + return self._delete_cost_tag_description_by_key_endpoint.call_with_http_info(**kwargs) + def delete_custom_allocation_rule( self, rule_id: int, @@ -1979,6 +2111,23 @@ def delete_tag_pipelines_ruleset( return self._delete_tag_pipelines_ruleset_endpoint.call_with_http_info(**kwargs) + def generate_cost_tag_description_by_key( + self, + tag_key: str, + ) -> GenerateCostTagDescriptionResponse: + """Generate a Cloud Cost Management tag description. + + Use AI to draft a Cloud Cost Management tag key description based on associated cost data. The generated description is returned in the response and is not persisted by this endpoint; follow up with ``UpsertCostTagDescriptionByKey`` to save it. + + :param tag_key: The tag key to generate an AI description for. + :type tag_key: str + :rtype: GenerateCostTagDescriptionResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["tag_key"] = tag_key + + return self._generate_cost_tag_description_by_key_endpoint.call_with_http_info(**kwargs) + def get_budget( self, budget_id: str, @@ -2394,6 +2543,30 @@ def get_cost_gcp_usage_cost_config( return self._get_cost_gcp_usage_cost_config_endpoint.call_with_http_info(**kwargs) + def get_cost_tag_description_by_key( + self, + tag_key: str, + *, + filter_cloud: Union[str, UnsetType] = unset, + ) -> CostTagDescriptionResponse: + """Get a Cloud Cost Management tag description. + + Get the Cloud Cost Management description for a single tag key. Use ``filter[cloud]`` to scope the lookup to a specific cloud provider; when omitted, the response resolves the description in fallback order (cloud-specific organization override, then cloudless organization default, then Datadog's global default). + + :param tag_key: The tag key whose description is being fetched. + :type tag_key: str + :param filter_cloud: Cloud provider to scope the lookup to (for example, ``aws`` ). Omit to use the resolved fallback. + :type filter_cloud: str, optional + :rtype: CostTagDescriptionResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["tag_key"] = tag_key + + if filter_cloud is not unset: + kwargs["filter_cloud"] = filter_cloud + + return self._get_cost_tag_description_by_key_endpoint.call_with_http_info(**kwargs) + def get_cost_tag_key( self, tag_key: str, @@ -3155,6 +3328,27 @@ def upsert_budget( return self._upsert_budget_endpoint.call_with_http_info(**kwargs) + def upsert_cost_tag_description_by_key( + self, + tag_key: str, + body: CostTagDescriptionUpsertRequest, + ) -> None: + """Upsert a Cloud Cost Management tag description. + + Create or update a Cloud Cost Management tag key description. The new description and optional cloud scoping are supplied in the request body. Omit ``cloud`` to set a cross-cloud default for the tag key. + + :param tag_key: The tag key whose description is being upserted. + :type tag_key: str + :type body: CostTagDescriptionUpsertRequest + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["tag_key"] = tag_key + + kwargs["body"] = body + + return self._upsert_cost_tag_description_by_key_endpoint.call_with_http_info(**kwargs) + def validate_budget( self, body: BudgetValidationRequest, diff --git a/src/datadog_api_client/v2/model/cost_tag_description_response.py b/src/datadog_api_client/v2/model/cost_tag_description_response.py new file mode 100644 index 0000000000..59cc9424ef --- /dev/null +++ b/src/datadog_api_client/v2/model/cost_tag_description_response.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.cost_tag_description import CostTagDescription + + +class CostTagDescriptionResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.cost_tag_description import CostTagDescription + + return { + "data": (CostTagDescription,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: CostTagDescription, **kwargs): + """ + Single Cloud Cost Management tag key description returned by the get-by-key endpoint. + + :param data: A Cloud Cost Management tag key description, either cross-cloud or scoped to a single cloud provider. + :type data: CostTagDescription + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/cost_tag_description_upsert_request.py b/src/datadog_api_client/v2/model/cost_tag_description_upsert_request.py new file mode 100644 index 0000000000..6c737374ca --- /dev/null +++ b/src/datadog_api_client/v2/model/cost_tag_description_upsert_request.py @@ -0,0 +1,42 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.cost_tag_description_upsert_request_data import CostTagDescriptionUpsertRequestData + + +class CostTagDescriptionUpsertRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.cost_tag_description_upsert_request_data import ( + CostTagDescriptionUpsertRequestData, + ) + + return { + "data": (CostTagDescriptionUpsertRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: CostTagDescriptionUpsertRequestData, **kwargs): + """ + Request body for creating or updating a Cloud Cost Management tag key description. + + :param data: Resource envelope carrying the tag key description being upserted. The ``id`` is informational; the authoritative tag key is taken from the URL path. + :type data: CostTagDescriptionUpsertRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/cost_tag_description_upsert_request_data.py b/src/datadog_api_client/v2/model/cost_tag_description_upsert_request_data.py new file mode 100644 index 0000000000..8235562357 --- /dev/null +++ b/src/datadog_api_client/v2/model/cost_tag_description_upsert_request_data.py @@ -0,0 +1,67 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.cost_tag_description_upsert_request_data_attributes import ( + CostTagDescriptionUpsertRequestDataAttributes, + ) + from datadog_api_client.v2.model.cost_tag_description_type import CostTagDescriptionType + + +class CostTagDescriptionUpsertRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.cost_tag_description_upsert_request_data_attributes import ( + CostTagDescriptionUpsertRequestDataAttributes, + ) + from datadog_api_client.v2.model.cost_tag_description_type import CostTagDescriptionType + + return { + "attributes": (CostTagDescriptionUpsertRequestDataAttributes,), + "id": (str,), + "type": (CostTagDescriptionType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: CostTagDescriptionUpsertRequestDataAttributes, + type: CostTagDescriptionType, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Resource envelope carrying the tag key description being upserted. The ``id`` is informational; the authoritative tag key is taken from the URL path. + + :param attributes: Mutable attributes set when creating or updating a Cloud Cost Management tag key description. + :type attributes: CostTagDescriptionUpsertRequestDataAttributes + + :param id: Identifier of the tag key the description applies to. Matches the ``tag_key`` path parameter. + :type id: str, optional + + :param type: Type of the Cloud Cost Management tag description resource. + :type type: CostTagDescriptionType + """ + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/cost_tag_description_upsert_request_data_attributes.py b/src/datadog_api_client/v2/model/cost_tag_description_upsert_request_data_attributes.py new file mode 100644 index 0000000000..37d6e9cee8 --- /dev/null +++ b/src/datadog_api_client/v2/model/cost_tag_description_upsert_request_data_attributes.py @@ -0,0 +1,43 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class CostTagDescriptionUpsertRequestDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "cloud": (str,), + "description": (str,), + } + + attribute_map = { + "cloud": "cloud", + "description": "description", + } + + def __init__(self_, description: str, cloud: Union[str, UnsetType] = unset, **kwargs): + """ + Mutable attributes set when creating or updating a Cloud Cost Management tag key description. + + :param cloud: Cloud provider this description applies to (for example, ``aws`` ). Omit to set the cross-cloud default for the tag key. + :type cloud: str, optional + + :param description: The human-readable description for the tag key. + :type description: str + """ + if cloud is not unset: + kwargs["cloud"] = cloud + super().__init__(kwargs) + + self_.description = description diff --git a/src/datadog_api_client/v2/model/generate_cost_tag_description_response.py b/src/datadog_api_client/v2/model/generate_cost_tag_description_response.py new file mode 100644 index 0000000000..3fc515cb79 --- /dev/null +++ b/src/datadog_api_client/v2/model/generate_cost_tag_description_response.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.generated_cost_tag_description import GeneratedCostTagDescription + + +class GenerateCostTagDescriptionResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.generated_cost_tag_description import GeneratedCostTagDescription + + return { + "data": (GeneratedCostTagDescription,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: GeneratedCostTagDescription, **kwargs): + """ + Response wrapping an AI-generated Cloud Cost Management tag key description. + + :param data: AI-generated Cloud Cost Management tag key description returned by the generate endpoint. The result is returned to the client but is not persisted by this endpoint. + :type data: GeneratedCostTagDescription + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/generated_cost_tag_description.py b/src/datadog_api_client/v2/model/generated_cost_tag_description.py new file mode 100644 index 0000000000..ac8195f3f2 --- /dev/null +++ b/src/datadog_api_client/v2/model/generated_cost_tag_description.py @@ -0,0 +1,64 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.generated_cost_tag_description_attributes import ( + GeneratedCostTagDescriptionAttributes, + ) + from datadog_api_client.v2.model.generated_cost_tag_description_type import GeneratedCostTagDescriptionType + + +class GeneratedCostTagDescription(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.generated_cost_tag_description_attributes import ( + GeneratedCostTagDescriptionAttributes, + ) + from datadog_api_client.v2.model.generated_cost_tag_description_type import GeneratedCostTagDescriptionType + + return { + "attributes": (GeneratedCostTagDescriptionAttributes,), + "id": (str,), + "type": (GeneratedCostTagDescriptionType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: GeneratedCostTagDescriptionAttributes, + id: str, + type: GeneratedCostTagDescriptionType, + **kwargs, + ): + """ + AI-generated Cloud Cost Management tag key description returned by the generate endpoint. The result is returned to the client but is not persisted by this endpoint. + + :param attributes: Attributes of an AI-generated Cloud Cost Management tag key description. + :type attributes: GeneratedCostTagDescriptionAttributes + + :param id: The tag key the AI description was generated for. + :type id: str + + :param type: Type of the AI-generated Cloud Cost Management tag description resource. + :type type: GeneratedCostTagDescriptionType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/generated_cost_tag_description_attributes.py b/src/datadog_api_client/v2/model/generated_cost_tag_description_attributes.py new file mode 100644 index 0000000000..f104e08f69 --- /dev/null +++ b/src/datadog_api_client/v2/model/generated_cost_tag_description_attributes.py @@ -0,0 +1,33 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class GeneratedCostTagDescriptionAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "description": (str,), + } + + attribute_map = { + "description": "description", + } + + def __init__(self_, description: str, **kwargs): + """ + Attributes of an AI-generated Cloud Cost Management tag key description. + + :param description: The AI-generated description for the tag key. + :type description: str + """ + super().__init__(kwargs) + + self_.description = description diff --git a/src/datadog_api_client/v2/model/generated_cost_tag_description_type.py b/src/datadog_api_client/v2/model/generated_cost_tag_description_type.py new file mode 100644 index 0000000000..775090aee7 --- /dev/null +++ b/src/datadog_api_client/v2/model/generated_cost_tag_description_type.py @@ -0,0 +1,37 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class GeneratedCostTagDescriptionType(ModelSimple): + """ + Type of the AI-generated Cloud Cost Management tag description resource. + + :param value: If omitted defaults to "cost_generated_tag_description". Must be one of ["cost_generated_tag_description"]. + :type value: str + """ + + allowed_values = { + "cost_generated_tag_description", + } + COST_GENERATED_TAG_DESCRIPTION: ClassVar["GeneratedCostTagDescriptionType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +GeneratedCostTagDescriptionType.COST_GENERATED_TAG_DESCRIPTION = GeneratedCostTagDescriptionType( + "cost_generated_tag_description" +) diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 304ac498cc..3ab56c7566 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -1327,8 +1327,14 @@ from datadog_api_client.v2.model.cost_tag_attributes import CostTagAttributes from datadog_api_client.v2.model.cost_tag_description import CostTagDescription from datadog_api_client.v2.model.cost_tag_description_attributes import CostTagDescriptionAttributes +from datadog_api_client.v2.model.cost_tag_description_response import CostTagDescriptionResponse from datadog_api_client.v2.model.cost_tag_description_source import CostTagDescriptionSource from datadog_api_client.v2.model.cost_tag_description_type import CostTagDescriptionType +from datadog_api_client.v2.model.cost_tag_description_upsert_request import CostTagDescriptionUpsertRequest +from datadog_api_client.v2.model.cost_tag_description_upsert_request_data import CostTagDescriptionUpsertRequestData +from datadog_api_client.v2.model.cost_tag_description_upsert_request_data_attributes import ( + CostTagDescriptionUpsertRequestDataAttributes, +) from datadog_api_client.v2.model.cost_tag_descriptions_response import CostTagDescriptionsResponse from datadog_api_client.v2.model.cost_tag_key import CostTagKey from datadog_api_client.v2.model.cost_tag_key_attributes import CostTagKeyAttributes @@ -2647,6 +2653,10 @@ from datadog_api_client.v2.model.gemini_integration import GeminiIntegration from datadog_api_client.v2.model.gemini_integration_type import GeminiIntegrationType from datadog_api_client.v2.model.gemini_integration_update import GeminiIntegrationUpdate +from datadog_api_client.v2.model.generate_cost_tag_description_response import GenerateCostTagDescriptionResponse +from datadog_api_client.v2.model.generated_cost_tag_description import GeneratedCostTagDescription +from datadog_api_client.v2.model.generated_cost_tag_description_attributes import GeneratedCostTagDescriptionAttributes +from datadog_api_client.v2.model.generated_cost_tag_description_type import GeneratedCostTagDescriptionType from datadog_api_client.v2.model.get_action_connection_response import GetActionConnectionResponse from datadog_api_client.v2.model.get_app_key_registration_response import GetAppKeyRegistrationResponse from datadog_api_client.v2.model.get_app_response import GetAppResponse @@ -9268,8 +9278,12 @@ "CostTagAttributes", "CostTagDescription", "CostTagDescriptionAttributes", + "CostTagDescriptionResponse", "CostTagDescriptionSource", "CostTagDescriptionType", + "CostTagDescriptionUpsertRequest", + "CostTagDescriptionUpsertRequestData", + "CostTagDescriptionUpsertRequestDataAttributes", "CostTagDescriptionsResponse", "CostTagKey", "CostTagKeyAttributes", @@ -10246,6 +10260,10 @@ "GeminiIntegration", "GeminiIntegrationType", "GeminiIntegrationUpdate", + "GenerateCostTagDescriptionResponse", + "GeneratedCostTagDescription", + "GeneratedCostTagDescriptionAttributes", + "GeneratedCostTagDescriptionType", "GetActionConnectionResponse", "GetAppKeyRegistrationResponse", "GetAppResponse", diff --git a/tests/v2/features/cloud_cost_management.feature b/tests/v2/features/cloud_cost_management.feature index 17779e4599..8a8beef7ce 100644 --- a/tests/v2/features/cloud_cost_management.feature +++ b/tests/v2/features/cloud_cost_management.feature @@ -190,6 +190,20 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Delete a Cloud Cost Management tag description returns "Bad Request" response + Given new "DeleteCostTagDescriptionByKey" 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: Delete a Cloud Cost Management tag description returns "No Content" response + Given new "DeleteCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + @team:DataDog/cloud-cost-management Scenario: Delete a budget returns "Bad Request" response Given new "DeleteBudget" request @@ -218,6 +232,20 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 204 No Content + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Generate a Cloud Cost Management tag description returns "Bad Request" response + Given new "GenerateCostTagDescriptionByKey" 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: Generate a Cloud Cost Management tag description returns "OK" response + Given new "GenerateCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/cloud-cost-management Scenario: Get Custom Costs File returns "OK" response Given new "GetCustomCostsFile" request @@ -250,6 +278,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 description returns "Bad Request" response + Given new "GetCostTagDescriptionByKey" 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 description returns "Not Found" response + Given new "GetCostTagDescriptionByKey" 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 description returns "OK" response + Given new "GetCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management Scenario: Get a Cloud Cost Management tag key returns "Bad Request" response Given new "GetCostTagKey" request @@ -857,6 +906,22 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 400 Bad Request + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Upsert a Cloud Cost Management tag description returns "Bad Request" response + Given new "UpsertCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"cloud": "aws", "description": "AWS account that owns this cost."}, "id": "account_id", "type": "cost_tag_description"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Upsert a Cloud Cost Management tag description returns "No Content" response + Given new "UpsertCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"cloud": "aws", "description": "AWS account that owns this cost."}, "id": "account_id", "type": "cost_tag_description"}} + When the request is sent + Then the response status is 204 No Content + @generated @skip @team:DataDog/cloud-cost-management Scenario: Validate CSV budget returns "OK" response Given new "ValidateCsvBudget" request diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index c22b147298..5ef29b4d9b 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -1868,6 +1868,30 @@ "type": "safe" } }, + "DeleteCostTagDescriptionByKey": { + "tag": "Cloud Cost Management", + "undo": { + "type": "idempotent" + } + }, + "GetCostTagDescriptionByKey": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "UpsertCostTagDescriptionByKey": { + "tag": "Cloud Cost Management", + "undo": { + "type": "idempotent" + } + }, + "GenerateCostTagDescriptionByKey": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "ListCostTagKeys": { "tag": "Cloud Cost Management", "undo": {