From 41278a7022b696360f85aef93b7e9537ca231789 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 27 May 2026 16:46:47 +0000 Subject: [PATCH] Regenerate client from commit 622be32 of spec repo --- .generator/schemas/v2/openapi.yaml | 101 +++++++++++ features/v2/cloud_cost_management.feature | 16 ++ features/v2/undo.json | 6 + .../src/support/scenarios_model_mapping.ts | 7 + .../src/v2/CloudCostManagementApi.ts | 157 ++++++++++++++++++ .../cloud_cost_management/src/v2/index.ts | 4 + .../src/v2/models/CostTagMetadataMonth.ts | 56 +++++++ .../src/v2/models/CostTagMetadataMonthType.ts | 9 + .../models/CostTagMetadataMonthsResponse.ts | 47 ++++++ .../src/v2/models/TypingInfo.ts | 5 + 10 files changed, 408 insertions(+) create mode 100644 services/cloud_cost_management/src/v2/models/CostTagMetadataMonth.ts create mode 100644 services/cloud_cost_management/src/v2/models/CostTagMetadataMonthType.ts create mode 100644 services/cloud_cost_management/src/v2/models/CostTagMetadataMonthsResponse.ts diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index c1ed29256660..795f35ac355f 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -19897,6 +19897,45 @@ components: x-enum-varnames: - "TRUE" - "FALSE" + CostTagMetadataMonth: + description: A month that has Cloud Cost Management tag metadata available for a given provider. + properties: + id: + description: The month, in `YYYY-MM` format. + example: "2026-04" + type: string + type: + $ref: "#/components/schemas/CostTagMetadataMonthType" + required: + - id + - type + type: object + CostTagMetadataMonthType: + default: cost_tag_metadata_month + description: Type of the Cloud Cost Management tag metadata month resource. + enum: + - cost_tag_metadata_month + example: cost_tag_metadata_month + type: string + x-enum-varnames: + - COST_TAG_METADATA_MONTH + CostTagMetadataMonthsResponse: + description: List of months that have Cloud Cost Management tag metadata for the requested provider, ordered most-recent first and capped at 36 months. + example: + data: + - id: "2026-04" + type: cost_tag_metadata_month + - id: "2026-03" + type: cost_tag_metadata_month + properties: + data: + description: List of months that have tag metadata available. + items: + $ref: "#/components/schemas/CostTagMetadataMonth" + type: array + required: + - data + type: object CostTagType: default: cost_tag description: Type of the Cloud Cost Management tag resource. @@ -111135,6 +111174,68 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/tag_metadata/months: + get: + description: |- + List months that have Cloud Cost Management tag metadata for a given provider, + ordered most-recent first. The response is capped at 36 months. + operationId: ListCostTagMetadataMonths + parameters: + - description: |- + Provider to scope the query to. Use the value of the `providername` tag in CCM + (for example, `aws`, `azure`, `gcp`, `Oracle`, `Confluent Cloud`, `Snowflake`). + For costs uploaded through the Custom Costs API, use `custom`. + Values are case-sensitive. + example: aws + in: query + name: filter[provider] + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: "2026-04" + type: cost_tag_metadata_month + - id: "2026-03" + type: cost_tag_metadata_month + schema: + $ref: "#/components/schemas/CostTagMetadataMonthsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: List Cloud Cost Management tag metadata months + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/cost/tag_metadata/orchestrators: get: description: List container orchestrators (for example, `kubernetes`, `ecs`) detected in Cloud Cost Management data for the requested period. diff --git a/features/v2/cloud_cost_management.feature b/features/v2/cloud_cost_management.feature index 17779e4599e4..b41928f4cb9d 100644 --- a/features/v2/cloud_cost_management.feature +++ b/features/v2/cloud_cost_management.feature @@ -606,6 +606,22 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List Cloud Cost Management tag metadata months returns "Bad Request" response + Given operation "ListCostTagMetadataMonths" enabled + And new "ListCostTagMetadataMonths" request + And request contains "filter[provider]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List Cloud Cost Management tag metadata months returns "OK" response + Given operation "ListCostTagMetadataMonths" enabled + And new "ListCostTagMetadataMonths" request + And request contains "filter[provider]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management Scenario: List Cloud Cost Management tag sources returns "Bad Request" response Given operation "ListCostTagKeySources" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index d86d61c22888..09d6acff288b 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1898,6 +1898,12 @@ "type": "safe" } }, + "ListCostTagMetadataMonths": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "ListCostTagMetadataOrchestrators": { "tag": "Cloud Cost Management", "undo": { diff --git a/private/bdd_runner/src/support/scenarios_model_mapping.ts b/private/bdd_runner/src/support/scenarios_model_mapping.ts index b67bd8a6d79d..cfe096fad74e 100644 --- a/private/bdd_runner/src/support/scenarios_model_mapping.ts +++ b/private/bdd_runner/src/support/scenarios_model_mapping.ts @@ -7515,6 +7515,13 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { }, operationResponseType: "CostMetricsResponse", }, + "CloudCostManagementApi.V2.ListCostTagMetadataMonths": { + filterProvider: { + type: "string", + format: "", + }, + operationResponseType: "CostTagMetadataMonthsResponse", + }, "CloudCostManagementApi.V2.ListCostTagMetadataOrchestrators": { filterMonth: { type: "string", diff --git a/services/cloud_cost_management/src/v2/CloudCostManagementApi.ts b/services/cloud_cost_management/src/v2/CloudCostManagementApi.ts index 4e025eb097a9..ac19f5c3ecd8 100644 --- a/services/cloud_cost_management/src/v2/CloudCostManagementApi.ts +++ b/services/cloud_cost_management/src/v2/CloudCostManagementApi.ts @@ -61,6 +61,7 @@ import { CostTagKeyResponse } from "./models/CostTagKeyResponse"; import { CostTagKeySourcesResponse } from "./models/CostTagKeySourcesResponse"; import { CostTagKeysResponse } from "./models/CostTagKeysResponse"; import { CostTagMetadataDailyFilter } from "./models/CostTagMetadataDailyFilter"; +import { CostTagMetadataMonthsResponse } from "./models/CostTagMetadataMonthsResponse"; import { CostTagsResponse } from "./models/CostTagsResponse"; import { CreateRulesetRequest } from "./models/CreateRulesetRequest"; import { CustomCostsFileGetResponse } from "./models/CustomCostsFileGetResponse"; @@ -2709,6 +2710,67 @@ export class CloudCostManagementApiRequestFactory extends BaseAPIRequestFactory return requestContext; } + public async listCostTagMetadataMonths( + filterProvider: string, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations[ + "CloudCostManagementApi.v2.listCostTagMetadataMonths" + ] + ) { + throw new Error( + "Unstable operation 'listCostTagMetadataMonths' is disabled. Enable it by setting `configuration.unstableOperations['CloudCostManagementApi.v2.listCostTagMetadataMonths'] = true`", + ); + } + + // verify required parameter 'filterProvider' is not null or undefined + if (filterProvider === null || filterProvider === undefined) { + throw new RequiredError("filterProvider", "listCostTagMetadataMonths"); + } + + // Path Params + const localVarPath = "/api/v2/cost/tag_metadata/months"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "CloudCostManagementApi.v2.listCostTagMetadataMonths", + CloudCostManagementApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.GET, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Query Params + if (filterProvider !== undefined) { + requestContext.setQueryParam( + "filter[provider]", + serialize(filterProvider, TypingInfo, "string", ""), + "", + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async listCostTagMetadataOrchestrators( filterMonth: string, filterProvider?: string, @@ -6253,6 +6315,66 @@ export class CloudCostManagementApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listCostTagMetadataMonths + * @throws ApiException if the response code was not in [200, 299] + */ + public async listCostTagMetadataMonths( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: CostTagMetadataMonthsResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "CostTagMetadataMonthsResponse", + ) as CostTagMetadataMonthsResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: CostTagMetadataMonthsResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "CostTagMetadataMonthsResponse", + "", + ) as CostTagMetadataMonthsResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -7944,6 +8066,17 @@ export interface CloudCostManagementApiListCostTagMetadataMetricsRequest { filterProvider?: string; } +export interface CloudCostManagementApiListCostTagMetadataMonthsRequest { + /** + * Provider to scope the query to. Use the value of the `providername` tag in CCM + * (for example, `aws`, `azure`, `gcp`, `Oracle`, `Confluent Cloud`, `Snowflake`). + * For costs uploaded through the Custom Costs API, use `custom`. + * Values are case-sensitive. + * @type string + */ + filterProvider: string; +} + export interface CloudCostManagementApiListCostTagMetadataOrchestratorsRequest { /** * The month to scope the query to, in `YYYY-MM` format. @@ -9116,6 +9249,30 @@ export class CloudCostManagementApi { }); } + /** + * List months that have Cloud Cost Management tag metadata for a given provider, + * ordered most-recent first. The response is capped at 36 months. + * @param param The request object + */ + public listCostTagMetadataMonths( + param: CloudCostManagementApiListCostTagMetadataMonthsRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.listCostTagMetadataMonths( + param.filterProvider, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listCostTagMetadataMonths( + responseContext, + ); + }); + }); + } + /** * List container orchestrators (for example, `kubernetes`, `ecs`) detected in Cloud Cost Management data for the requested period. * @param param The request object diff --git a/services/cloud_cost_management/src/v2/index.ts b/services/cloud_cost_management/src/v2/index.ts index 229670bafd48..06f5c1763147 100644 --- a/services/cloud_cost_management/src/v2/index.ts +++ b/services/cloud_cost_management/src/v2/index.ts @@ -35,6 +35,7 @@ export { CloudCostManagementApiListCostTagKeysRequest, CloudCostManagementApiListCostTagMetadataRequest, CloudCostManagementApiListCostTagMetadataMetricsRequest, + CloudCostManagementApiListCostTagMetadataMonthsRequest, CloudCostManagementApiListCostTagMetadataOrchestratorsRequest, CloudCostManagementApiListCostTagsRequest, CloudCostManagementApiListCustomCostsFilesRequest, @@ -200,6 +201,9 @@ export { CostTagKeySourceType } from "./models/CostTagKeySourceType"; export { CostTagKeysResponse } from "./models/CostTagKeysResponse"; export { CostTagKeyType } from "./models/CostTagKeyType"; export { CostTagMetadataDailyFilter } from "./models/CostTagMetadataDailyFilter"; +export { CostTagMetadataMonth } from "./models/CostTagMetadataMonth"; +export { CostTagMetadataMonthsResponse } from "./models/CostTagMetadataMonthsResponse"; +export { CostTagMetadataMonthType } from "./models/CostTagMetadataMonthType"; export { CostTagsResponse } from "./models/CostTagsResponse"; export { CostTagType } from "./models/CostTagType"; export { CreateRulesetRequest } from "./models/CreateRulesetRequest"; diff --git a/services/cloud_cost_management/src/v2/models/CostTagMetadataMonth.ts b/services/cloud_cost_management/src/v2/models/CostTagMetadataMonth.ts new file mode 100644 index 000000000000..e877cefb6f7f --- /dev/null +++ b/services/cloud_cost_management/src/v2/models/CostTagMetadataMonth.ts @@ -0,0 +1,56 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { CostTagMetadataMonthType } from "./CostTagMetadataMonthType"; + +/** + * A month that has Cloud Cost Management tag metadata available for a given provider. + */ +export class CostTagMetadataMonth { + /** + * The month, in `YYYY-MM` format. + */ + "id": string; + /** + * Type of the Cloud Cost Management tag metadata month resource. + */ + "type": CostTagMetadataMonthType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "CostTagMetadataMonthType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CostTagMetadataMonth.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cloud_cost_management/src/v2/models/CostTagMetadataMonthType.ts b/services/cloud_cost_management/src/v2/models/CostTagMetadataMonthType.ts new file mode 100644 index 000000000000..d058ed42e0ae --- /dev/null +++ b/services/cloud_cost_management/src/v2/models/CostTagMetadataMonthType.ts @@ -0,0 +1,9 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Type of the Cloud Cost Management tag metadata month resource. + */ +export type CostTagMetadataMonthType = + | typeof COST_TAG_METADATA_MONTH + | UnparsedObject; +export const COST_TAG_METADATA_MONTH = "cost_tag_metadata_month"; diff --git a/services/cloud_cost_management/src/v2/models/CostTagMetadataMonthsResponse.ts b/services/cloud_cost_management/src/v2/models/CostTagMetadataMonthsResponse.ts new file mode 100644 index 000000000000..5256b8895550 --- /dev/null +++ b/services/cloud_cost_management/src/v2/models/CostTagMetadataMonthsResponse.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { CostTagMetadataMonth } from "./CostTagMetadataMonth"; + +/** + * List of months that have Cloud Cost Management tag metadata for the requested provider, ordered most-recent first and capped at 36 months. + */ +export class CostTagMetadataMonthsResponse { + /** + * List of months that have tag metadata available. + */ + "data": Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CostTagMetadataMonthsResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cloud_cost_management/src/v2/models/TypingInfo.ts b/services/cloud_cost_management/src/v2/models/TypingInfo.ts index 31149e5280e9..cacd5314f043 100644 --- a/services/cloud_cost_management/src/v2/models/TypingInfo.ts +++ b/services/cloud_cost_management/src/v2/models/TypingInfo.ts @@ -119,6 +119,8 @@ import { CostTagKeySource } from "./CostTagKeySource"; import { CostTagKeySourceAttributes } from "./CostTagKeySourceAttributes"; import { CostTagKeySourcesResponse } from "./CostTagKeySourcesResponse"; import { CostTagKeysResponse } from "./CostTagKeysResponse"; +import { CostTagMetadataMonth } from "./CostTagMetadataMonth"; +import { CostTagMetadataMonthsResponse } from "./CostTagMetadataMonthsResponse"; import { CostTagsResponse } from "./CostTagsResponse"; import { CreateRulesetRequest } from "./CreateRulesetRequest"; import { CreateRulesetRequestData } from "./CreateRulesetRequestData"; @@ -234,6 +236,7 @@ export const TypingInfo: ModelTypingInfo = { CostTagKeySourceType: ["cost_tag_key_source"], CostTagKeyType: ["cost_tag_key"], CostTagMetadataDailyFilter: ["true", "false"], + CostTagMetadataMonthType: ["cost_tag_metadata_month"], CostTagType: ["cost_tag"], CreateRulesetRequestDataType: ["create_ruleset"], DataAttributesRulesItemsIfTagExists: ["append", "do_not_apply", "replace"], @@ -408,6 +411,8 @@ export const TypingInfo: ModelTypingInfo = { CostTagKeySourceAttributes: CostTagKeySourceAttributes, CostTagKeySourcesResponse: CostTagKeySourcesResponse, CostTagKeysResponse: CostTagKeysResponse, + CostTagMetadataMonth: CostTagMetadataMonth, + CostTagMetadataMonthsResponse: CostTagMetadataMonthsResponse, CostTagsResponse: CostTagsResponse, CreateRulesetRequest: CreateRulesetRequest, CreateRulesetRequestData: CreateRulesetRequestData,