From e247ca4369ca45dbe0222eef69a186529bd9212c Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 21 May 2026 16:37:59 +0000 Subject: [PATCH] Regenerate client from commit 25f4ac3 of spec repo --- .generator/schemas/v2/openapi.yaml | 198 ++++++++++++++++++ features/v2/cloud_cost_management.feature | 8 + features/v2/undo.json | 6 + .../src/support/scenarios_model_mapping.ts | 15 ++ .../src/v2/CloudCostManagementApi.ts | 179 ++++++++++++++++ .../cloud_cost_management/src/v2/index.ts | 10 + .../src/v2/models/CostRecommendationArray.ts | 56 +++++ .../src/v2/models/CostRecommendationData.ts | 64 ++++++ .../CostRecommendationDataAttributes.ts | 86 ++++++++ ...tionDataAttributesPotentialDailySavings.ts | 53 +++++ .../v2/models/CostRecommendationDataType.ts | 7 + .../v2/models/RecommendationsFilterRequest.ts | 70 +++++++ .../RecommendationsFilterRequestSortItems.ts | 52 +++++ .../src/v2/models/RecommendationsPageMeta.ts | 46 ++++ .../v2/models/RecommendationsPageMetaPage.ts | 69 ++++++ .../src/v2/models/TypingInfo.ts | 19 ++ 16 files changed, 938 insertions(+) create mode 100644 services/cloud_cost_management/src/v2/models/CostRecommendationArray.ts create mode 100644 services/cloud_cost_management/src/v2/models/CostRecommendationData.ts create mode 100644 services/cloud_cost_management/src/v2/models/CostRecommendationDataAttributes.ts create mode 100644 services/cloud_cost_management/src/v2/models/CostRecommendationDataAttributesPotentialDailySavings.ts create mode 100644 services/cloud_cost_management/src/v2/models/CostRecommendationDataType.ts create mode 100644 services/cloud_cost_management/src/v2/models/RecommendationsFilterRequest.ts create mode 100644 services/cloud_cost_management/src/v2/models/RecommendationsFilterRequestSortItems.ts create mode 100644 services/cloud_cost_management/src/v2/models/RecommendationsPageMeta.ts create mode 100644 services/cloud_cost_management/src/v2/models/RecommendationsPageMetaPage.ts diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index da1a2769faa4..245e17abb95a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -17831,6 +17831,76 @@ components: required: - data type: object + CostRecommendationArray: + description: A page of cost recommendations with pagination metadata. + properties: + data: + description: The list of cost recommendations on this page. + items: + $ref: "#/components/schemas/CostRecommendationData" + type: array + meta: + $ref: "#/components/schemas/RecommendationsPageMeta" + required: + - data + type: object + CostRecommendationData: + description: A single cost recommendation entry in JSON:API form. + properties: + attributes: + $ref: "#/components/schemas/CostRecommendationDataAttributes" + id: + description: Unique identifier for the recommendation. + type: string + type: + $ref: "#/components/schemas/CostRecommendationDataType" + required: + - type + type: object + CostRecommendationDataAttributes: + description: Attributes describing a single cost recommendation. + properties: + dd_resource_key: + description: Datadog resource key identifying the recommended resource. + type: string + potential_daily_savings: + $ref: "#/components/schemas/CostRecommendationDataAttributesPotentialDailySavings" + recommendation_type: + description: The kind of recommendation (for example, `terminate` or `rightsize`). + type: string + resource_id: + description: Cloud provider identifier of the resource. + type: string + resource_type: + description: Resource type (for example, `aws_ec2_instance`). + type: string + tags: + description: Tags attached to the recommended resource. + items: + description: A single resource tag. + type: string + type: array + type: object + CostRecommendationDataAttributesPotentialDailySavings: + description: Estimated daily savings if the recommendation is applied. + properties: + amount: + description: Numeric amount of the potential daily savings. + format: double + type: number + currency: + description: ISO 4217 currency code for the savings amount. + type: string + type: object + CostRecommendationDataType: + default: recommendation + description: Recommendation resource type. + enum: + - recommendation + example: recommendation + type: string + x-enum-varnames: + - RECOMMENDATION CostTag: description: A Cloud Cost Management tag. properties: @@ -63436,6 +63506,64 @@ components: type: string x-enum-varnames: - RECOMMENDATION + RecommendationsFilterRequest: + description: Request body for filtering cost recommendations. + example: + filter: "@resource_table:aws_ec2_instance" + sort: + - expression: potential_daily_savings.amount + order: DESC + properties: + filter: + description: Filter expression applied to the recommendations. + type: string + scope: + description: Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations or `*` for both. + type: string + sort: + description: Ordered list of sort clauses applied to the result set. + items: + $ref: "#/components/schemas/RecommendationsFilterRequestSortItems" + type: array + view: + description: Active view name (for example, `active`, `dismissed`, `open`, `in-progress`, or `completed`). + type: string + type: object + RecommendationsFilterRequestSortItems: + description: A single sort clause applied to the cost recommendations result set. + properties: + expression: + description: Field to sort by (for example, `potential_daily_savings.amount`). + type: string + order: + description: Sort direction, either `ASC` or `DESC`. + type: string + type: object + RecommendationsPageMeta: + description: Top-level JSON:API meta object for paginated cost recommendation responses. + properties: + page: + $ref: "#/components/schemas/RecommendationsPageMetaPage" + type: object + RecommendationsPageMetaPage: + description: Pagination metadata for a page of cost recommendations. + properties: + filter: + description: The filter expression that was applied to produce this page. + type: string + next_page_token: + description: Opaque token used to fetch the next page; absent on the last page. + type: string + page_size: + description: Number of items returned in this page (1–10000). + format: int32 + maximum: 10000 + minimum: 1 + type: integer + page_token: + description: Pagination token echoed back from the request. + type: string + type: object ReferenceTableCreateSourceType: description: The source type for creating reference table data. Only these source types can be created through this API. enum: @@ -105850,6 +105978,76 @@ paths: operator: OR permissions: - cloud_cost_management_read + /api/v2/cost/recommendations: + post: + description: List cost recommendations matching a filter, with pagination and sorting. + operationId: SearchCostRecommendations + parameters: + - description: Number of results per page (1–10000). + in: query + name: page[size] + schema: + type: string + - description: Pagination token from a previous response. + in: query + name: page[token] + schema: + type: string + requestBody: + content: + application/json: + examples: + default: + value: + filter: "@resource_table:aws_ec2_instance" + sort: + - expression: potential_daily_savings.amount + order: DESC + schema: + $ref: "#/components/schemas/RecommendationsFilterRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + dd_resource_key: "arn:aws:ec2:us-east-1:123456789012:instance/i-1234567890abcdef0" + potential_daily_savings: + amount: 1.23 + currency: USD + recommendation_type: terminate + resource_id: i-1234567890abcdef0 + resource_type: aws_ec2_instance + tags: + - "env:prod" + - "team:ccm" + id: encoded-event-id-1 + type: recommendation + meta: + page: + filter: "@resource_table:aws_ec2_instance" + next_page_token: "" + page_size: 100 + schema: + $ref: "#/components/schemas/CostRecommendationArray" + description: OK + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Search cost recommendations + tags: + - Cloud Cost Management + 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_descriptions: get: description: List Cloud Cost Management tag key descriptions for the organization. Use `filter[cloud]` to scope the result to a single cloud provider; when omitted, both cross-cloud defaults and cloud-specific descriptions are returned. diff --git a/features/v2/cloud_cost_management.feature b/features/v2/cloud_cost_management.feature index 578dbb420012..17779e4599e4 100644 --- a/features/v2/cloud_cost_management.feature +++ b/features/v2/cloud_cost_management.feature @@ -736,6 +736,14 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 204 Successfully reordered rulesets + @generated @skip @team:DataDog/ccm-optimize + Scenario: Search cost recommendations returns "OK" response + Given operation "SearchCostRecommendations" enabled + And new "SearchCostRecommendations" request + And body with value {"filter": "@resource_table:aws_ec2_instance", "sort": [{"expression": "potential_daily_savings.amount", "order": "DESC"}]} + When the request is sent + Then the response status is 200 OK + @team:DataDog/cloud-cost-management Scenario: Update Cloud Cost Management AWS CUR config returns "Not Found" response Given new "UpdateCostAWSCURConfig" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 02753f1a80a7..27b9c797dfd2 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1826,6 +1826,12 @@ "type": "safe" } }, + "SearchCostRecommendations": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "ListCostTagDescriptions": { "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 e5be093fdc5a..7401603e23ae 100644 --- a/private/bdd_runner/src/support/scenarios_model_mapping.ts +++ b/private/bdd_runner/src/support/scenarios_model_mapping.ts @@ -7028,6 +7028,21 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { "CloudCostManagementApi.V2.ListCostOCIConfigs": { operationResponseType: "OCIConfigsResponse", }, + "CloudCostManagementApi.V2.SearchCostRecommendations": { + pageSize: { + type: "string", + format: "", + }, + pageToken: { + type: "string", + format: "", + }, + body: { + type: "RecommendationsFilterRequest", + format: "", + }, + operationResponseType: "CostRecommendationArray", + }, "CloudCostManagementApi.V2.ListCostTagDescriptions": { filterCloud: { type: "string", diff --git a/services/cloud_cost_management/src/v2/CloudCostManagementApi.ts b/services/cloud_cost_management/src/v2/CloudCostManagementApi.ts index 2eb8d9e862dc..4e025eb097a9 100644 --- a/services/cloud_cost_management/src/v2/CloudCostManagementApi.ts +++ b/services/cloud_cost_management/src/v2/CloudCostManagementApi.ts @@ -54,6 +54,7 @@ import { CostAnomalyResponse } from "./models/CostAnomalyResponse"; import { CostCurrencyResponse } from "./models/CostCurrencyResponse"; import { CostMetricsResponse } from "./models/CostMetricsResponse"; import { CostOrchestratorsResponse } from "./models/CostOrchestratorsResponse"; +import { CostRecommendationArray } from "./models/CostRecommendationArray"; import { CostTagDescriptionsResponse } from "./models/CostTagDescriptionsResponse"; import { CostTagKeyMetadataResponse } from "./models/CostTagKeyMetadataResponse"; import { CostTagKeyResponse } from "./models/CostTagKeyResponse"; @@ -73,6 +74,7 @@ import { GCPUsageCostConfigResponse } from "./models/GCPUsageCostConfigResponse" import { GCPUsageCostConfigsResponse } from "./models/GCPUsageCostConfigsResponse"; import { JSONAPIErrorResponse } from "./models/JSONAPIErrorResponse"; import { OCIConfigsResponse } from "./models/OCIConfigsResponse"; +import { RecommendationsFilterRequest } from "./models/RecommendationsFilterRequest"; import { ReorderRuleResourceArray } from "./models/ReorderRuleResourceArray"; import { ReorderRulesetResourceArray } from "./models/ReorderRulesetResourceArray"; import { RulesetResp } from "./models/RulesetResp"; @@ -3189,6 +3191,85 @@ export class CloudCostManagementApiRequestFactory extends BaseAPIRequestFactory return requestContext; } + public async searchCostRecommendations( + body: RecommendationsFilterRequest, + pageSize?: string, + pageToken?: string, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations[ + "CloudCostManagementApi.v2.searchCostRecommendations" + ] + ) { + throw new Error( + "Unstable operation 'searchCostRecommendations' is disabled. Enable it by setting `configuration.unstableOperations['CloudCostManagementApi.v2.searchCostRecommendations'] = true`", + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "searchCostRecommendations"); + } + + // Path Params + const localVarPath = "/api/v2/cost/recommendations"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "CloudCostManagementApi.v2.searchCostRecommendations", + CloudCostManagementApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.POST, + 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 (pageSize !== undefined) { + requestContext.setQueryParam( + "page[size]", + serialize(pageSize, TypingInfo, "string", ""), + "", + ); + } + if (pageToken !== undefined) { + requestContext.setQueryParam( + "page[token]", + serialize(pageToken, TypingInfo, "string", ""), + "", + ); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "RecommendationsFilterRequest", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async updateCostAWSCURConfig( cloudAccountId: number, body: AwsCURConfigPatchRequest, @@ -6666,6 +6747,62 @@ 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 searchCostRecommendations + * @throws ApiException if the response code was not in [200, 299] + */ + public async searchCostRecommendations( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: CostRecommendationArray = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "CostRecommendationArray", + ) as CostRecommendationArray; + return body; + } + if (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: CostRecommendationArray = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "CostRecommendationArray", + "", + ) as CostRecommendationArray; + 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 @@ -7895,6 +8032,23 @@ export interface CloudCostManagementApiReorderTagPipelinesRulesetsRequest { body: ReorderRulesetResourceArray; } +export interface CloudCostManagementApiSearchCostRecommendationsRequest { + /** + * @type RecommendationsFilterRequest + */ + body: RecommendationsFilterRequest; + /** + * Number of results per page (1–10000). + * @type string + */ + pageSize?: string; + /** + * Pagination token from a previous response. + * @type string + */ + pageToken?: string; +} + export interface CloudCostManagementApiUpdateCostAWSCURConfigRequest { /** * Cloud Account id. @@ -9166,6 +9320,31 @@ export class CloudCostManagementApi { }); } + /** + * List cost recommendations matching a filter, with pagination and sorting. + * @param param The request object + */ + public searchCostRecommendations( + param: CloudCostManagementApiSearchCostRecommendationsRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.searchCostRecommendations( + param.body, + param.pageSize, + param.pageToken, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.searchCostRecommendations( + responseContext, + ); + }); + }); + } + /** * Update the status (active/archived) and/or account filtering configuration of an AWS CUR config. * @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 0c742f531ec2..229670bafd48 100644 --- a/services/cloud_cost_management/src/v2/index.ts +++ b/services/cloud_cost_management/src/v2/index.ts @@ -40,6 +40,7 @@ export { CloudCostManagementApiListCustomCostsFilesRequest, CloudCostManagementApiReorderCustomAllocationRulesRequest, CloudCostManagementApiReorderTagPipelinesRulesetsRequest, + CloudCostManagementApiSearchCostRecommendationsRequest, CloudCostManagementApiUpdateCostAWSCURConfigRequest, CloudCostManagementApiUpdateCostAzureUCConfigsRequest, CloudCostManagementApiUpdateCostGCPUsageCostConfigRequest, @@ -172,6 +173,11 @@ export { CostMetricType } from "./models/CostMetricType"; export { CostOrchestrator } from "./models/CostOrchestrator"; export { CostOrchestratorsResponse } from "./models/CostOrchestratorsResponse"; export { CostOrchestratorType } from "./models/CostOrchestratorType"; +export { CostRecommendationArray } from "./models/CostRecommendationArray"; +export { CostRecommendationData } from "./models/CostRecommendationData"; +export { CostRecommendationDataAttributes } from "./models/CostRecommendationDataAttributes"; +export { CostRecommendationDataAttributesPotentialDailySavings } from "./models/CostRecommendationDataAttributesPotentialDailySavings"; +export { CostRecommendationDataType } from "./models/CostRecommendationDataType"; export { CostTag } from "./models/CostTag"; export { CostTagAttributes } from "./models/CostTagAttributes"; export { CostTagDescription } from "./models/CostTagDescription"; @@ -244,6 +250,10 @@ export { OCIConfig } from "./models/OCIConfig"; export { OCIConfigAttributes } from "./models/OCIConfigAttributes"; export { OCIConfigsResponse } from "./models/OCIConfigsResponse"; export { OCIConfigType } from "./models/OCIConfigType"; +export { RecommendationsFilterRequest } from "./models/RecommendationsFilterRequest"; +export { RecommendationsFilterRequestSortItems } from "./models/RecommendationsFilterRequestSortItems"; +export { RecommendationsPageMeta } from "./models/RecommendationsPageMeta"; +export { RecommendationsPageMetaPage } from "./models/RecommendationsPageMetaPage"; export { ReorderRuleResourceArray } from "./models/ReorderRuleResourceArray"; export { ReorderRuleResourceData } from "./models/ReorderRuleResourceData"; export { ReorderRuleResourceDataType } from "./models/ReorderRuleResourceDataType"; diff --git a/services/cloud_cost_management/src/v2/models/CostRecommendationArray.ts b/services/cloud_cost_management/src/v2/models/CostRecommendationArray.ts new file mode 100644 index 000000000000..6f3a277af2ae --- /dev/null +++ b/services/cloud_cost_management/src/v2/models/CostRecommendationArray.ts @@ -0,0 +1,56 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { CostRecommendationData } from "./CostRecommendationData"; +import { RecommendationsPageMeta } from "./RecommendationsPageMeta"; + +/** + * A page of cost recommendations with pagination metadata. + */ +export class CostRecommendationArray { + /** + * The list of cost recommendations on this page. + */ + "data": Array; + /** + * Top-level JSON:API meta object for paginated cost recommendation responses. + */ + "meta"?: RecommendationsPageMeta; + /** + * 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, + }, + meta: { + baseName: "meta", + type: "RecommendationsPageMeta", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CostRecommendationArray.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cloud_cost_management/src/v2/models/CostRecommendationData.ts b/services/cloud_cost_management/src/v2/models/CostRecommendationData.ts new file mode 100644 index 000000000000..05e43e27f4e0 --- /dev/null +++ b/services/cloud_cost_management/src/v2/models/CostRecommendationData.ts @@ -0,0 +1,64 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { CostRecommendationDataAttributes } from "./CostRecommendationDataAttributes"; +import { CostRecommendationDataType } from "./CostRecommendationDataType"; + +/** + * A single cost recommendation entry in JSON:API form. + */ +export class CostRecommendationData { + /** + * Attributes describing a single cost recommendation. + */ + "attributes"?: CostRecommendationDataAttributes; + /** + * Unique identifier for the recommendation. + */ + "id"?: string; + /** + * Recommendation resource type. + */ + "type": CostRecommendationDataType; + /** + * 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 = { + attributes: { + baseName: "attributes", + type: "CostRecommendationDataAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "CostRecommendationDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CostRecommendationData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cloud_cost_management/src/v2/models/CostRecommendationDataAttributes.ts b/services/cloud_cost_management/src/v2/models/CostRecommendationDataAttributes.ts new file mode 100644 index 000000000000..7beba4d1ff3a --- /dev/null +++ b/services/cloud_cost_management/src/v2/models/CostRecommendationDataAttributes.ts @@ -0,0 +1,86 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { CostRecommendationDataAttributesPotentialDailySavings } from "./CostRecommendationDataAttributesPotentialDailySavings"; + +/** + * Attributes describing a single cost recommendation. + */ +export class CostRecommendationDataAttributes { + /** + * Datadog resource key identifying the recommended resource. + */ + "ddResourceKey"?: string; + /** + * Estimated daily savings if the recommendation is applied. + */ + "potentialDailySavings"?: CostRecommendationDataAttributesPotentialDailySavings; + /** + * The kind of recommendation (for example, `terminate` or `rightsize`). + */ + "recommendationType"?: string; + /** + * Cloud provider identifier of the resource. + */ + "resourceId"?: string; + /** + * Resource type (for example, `aws_ec2_instance`). + */ + "resourceType"?: string; + /** + * Tags attached to the recommended resource. + */ + "tags"?: 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 = { + ddResourceKey: { + baseName: "dd_resource_key", + type: "string", + }, + potentialDailySavings: { + baseName: "potential_daily_savings", + type: "CostRecommendationDataAttributesPotentialDailySavings", + }, + recommendationType: { + baseName: "recommendation_type", + type: "string", + }, + resourceId: { + baseName: "resource_id", + type: "string", + }, + resourceType: { + baseName: "resource_type", + type: "string", + }, + tags: { + baseName: "tags", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CostRecommendationDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cloud_cost_management/src/v2/models/CostRecommendationDataAttributesPotentialDailySavings.ts b/services/cloud_cost_management/src/v2/models/CostRecommendationDataAttributesPotentialDailySavings.ts new file mode 100644 index 000000000000..ca00c267eb7a --- /dev/null +++ b/services/cloud_cost_management/src/v2/models/CostRecommendationDataAttributesPotentialDailySavings.ts @@ -0,0 +1,53 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Estimated daily savings if the recommendation is applied. + */ +export class CostRecommendationDataAttributesPotentialDailySavings { + /** + * Numeric amount of the potential daily savings. + */ + "amount"?: number; + /** + * ISO 4217 currency code for the savings amount. + */ + "currency"?: string; + /** + * 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 = { + amount: { + baseName: "amount", + type: "number", + format: "double", + }, + currency: { + baseName: "currency", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CostRecommendationDataAttributesPotentialDailySavings.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cloud_cost_management/src/v2/models/CostRecommendationDataType.ts b/services/cloud_cost_management/src/v2/models/CostRecommendationDataType.ts new file mode 100644 index 000000000000..516006daeec4 --- /dev/null +++ b/services/cloud_cost_management/src/v2/models/CostRecommendationDataType.ts @@ -0,0 +1,7 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Recommendation resource type. + */ +export type CostRecommendationDataType = typeof RECOMMENDATION | UnparsedObject; +export const RECOMMENDATION = "recommendation"; diff --git a/services/cloud_cost_management/src/v2/models/RecommendationsFilterRequest.ts b/services/cloud_cost_management/src/v2/models/RecommendationsFilterRequest.ts new file mode 100644 index 000000000000..c4dd5f5ffcda --- /dev/null +++ b/services/cloud_cost_management/src/v2/models/RecommendationsFilterRequest.ts @@ -0,0 +1,70 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { RecommendationsFilterRequestSortItems } from "./RecommendationsFilterRequestSortItems"; + +/** + * Request body for filtering cost recommendations. + */ +export class RecommendationsFilterRequest { + /** + * Filter expression applied to the recommendations. + */ + "filter"?: string; + /** + * Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations or `*` for both. + */ + "scope"?: string; + /** + * Ordered list of sort clauses applied to the result set. + */ + "sort"?: Array; + /** + * Active view name (for example, `active`, `dismissed`, `open`, `in-progress`, or `completed`). + */ + "view"?: string; + /** + * 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 = { + filter: { + baseName: "filter", + type: "string", + }, + scope: { + baseName: "scope", + type: "string", + }, + sort: { + baseName: "sort", + type: "Array", + }, + view: { + baseName: "view", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RecommendationsFilterRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cloud_cost_management/src/v2/models/RecommendationsFilterRequestSortItems.ts b/services/cloud_cost_management/src/v2/models/RecommendationsFilterRequestSortItems.ts new file mode 100644 index 000000000000..ac1c120e07f8 --- /dev/null +++ b/services/cloud_cost_management/src/v2/models/RecommendationsFilterRequestSortItems.ts @@ -0,0 +1,52 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * A single sort clause applied to the cost recommendations result set. + */ +export class RecommendationsFilterRequestSortItems { + /** + * Field to sort by (for example, `potential_daily_savings.amount`). + */ + "expression"?: string; + /** + * Sort direction, either `ASC` or `DESC`. + */ + "order"?: string; + /** + * 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 = { + expression: { + baseName: "expression", + type: "string", + }, + order: { + baseName: "order", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RecommendationsFilterRequestSortItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cloud_cost_management/src/v2/models/RecommendationsPageMeta.ts b/services/cloud_cost_management/src/v2/models/RecommendationsPageMeta.ts new file mode 100644 index 000000000000..2711e2d0653c --- /dev/null +++ b/services/cloud_cost_management/src/v2/models/RecommendationsPageMeta.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { RecommendationsPageMetaPage } from "./RecommendationsPageMetaPage"; + +/** + * Top-level JSON:API meta object for paginated cost recommendation responses. + */ +export class RecommendationsPageMeta { + /** + * Pagination metadata for a page of cost recommendations. + */ + "page"?: RecommendationsPageMetaPage; + /** + * 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 = { + page: { + baseName: "page", + type: "RecommendationsPageMetaPage", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RecommendationsPageMeta.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/cloud_cost_management/src/v2/models/RecommendationsPageMetaPage.ts b/services/cloud_cost_management/src/v2/models/RecommendationsPageMetaPage.ts new file mode 100644 index 000000000000..7d3268deb4df --- /dev/null +++ b/services/cloud_cost_management/src/v2/models/RecommendationsPageMetaPage.ts @@ -0,0 +1,69 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Pagination metadata for a page of cost recommendations. + */ +export class RecommendationsPageMetaPage { + /** + * The filter expression that was applied to produce this page. + */ + "filter"?: string; + /** + * Opaque token used to fetch the next page; absent on the last page. + */ + "nextPageToken"?: string; + /** + * Number of items returned in this page (1–10000). + */ + "pageSize"?: number; + /** + * Pagination token echoed back from the request. + */ + "pageToken"?: string; + /** + * 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 = { + filter: { + baseName: "filter", + type: "string", + }, + nextPageToken: { + baseName: "next_page_token", + type: "string", + }, + pageSize: { + baseName: "page_size", + type: "number", + format: "int32", + }, + pageToken: { + baseName: "page_token", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RecommendationsPageMetaPage.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 31129f496e70..31149e5280e9 100644 --- a/services/cloud_cost_management/src/v2/models/TypingInfo.ts +++ b/services/cloud_cost_management/src/v2/models/TypingInfo.ts @@ -99,6 +99,10 @@ import { CostMetric } from "./CostMetric"; import { CostMetricsResponse } from "./CostMetricsResponse"; import { CostOrchestrator } from "./CostOrchestrator"; import { CostOrchestratorsResponse } from "./CostOrchestratorsResponse"; +import { CostRecommendationArray } from "./CostRecommendationArray"; +import { CostRecommendationData } from "./CostRecommendationData"; +import { CostRecommendationDataAttributes } from "./CostRecommendationDataAttributes"; +import { CostRecommendationDataAttributesPotentialDailySavings } from "./CostRecommendationDataAttributesPotentialDailySavings"; import { CostTag } from "./CostTag"; import { CostTagAttributes } from "./CostTagAttributes"; import { CostTagDescription } from "./CostTagDescription"; @@ -157,6 +161,10 @@ import { JSONAPIErrorResponse } from "./JSONAPIErrorResponse"; import { OCIConfig } from "./OCIConfig"; import { OCIConfigAttributes } from "./OCIConfigAttributes"; import { OCIConfigsResponse } from "./OCIConfigsResponse"; +import { RecommendationsFilterRequest } from "./RecommendationsFilterRequest"; +import { RecommendationsFilterRequestSortItems } from "./RecommendationsFilterRequestSortItems"; +import { RecommendationsPageMeta } from "./RecommendationsPageMeta"; +import { RecommendationsPageMetaPage } from "./RecommendationsPageMetaPage"; import { ReorderRuleResourceArray } from "./ReorderRuleResourceArray"; import { ReorderRuleResourceData } from "./ReorderRuleResourceData"; import { ReorderRulesetResourceArray } from "./ReorderRulesetResourceArray"; @@ -219,6 +227,7 @@ export const TypingInfo: ModelTypingInfo = { CostCurrencyType: ["cost_currency"], CostMetricType: ["cost_metric"], CostOrchestratorType: ["cost_orchestrator"], + CostRecommendationDataType: ["recommendation"], CostTagDescriptionSource: ["human", "ai_generated", "datadog"], CostTagDescriptionType: ["cost_tag_description"], CostTagKeyMetadataType: ["cost_tag_key_metadata"], @@ -378,6 +387,11 @@ export const TypingInfo: ModelTypingInfo = { CostMetricsResponse: CostMetricsResponse, CostOrchestrator: CostOrchestrator, CostOrchestratorsResponse: CostOrchestratorsResponse, + CostRecommendationArray: CostRecommendationArray, + CostRecommendationData: CostRecommendationData, + CostRecommendationDataAttributes: CostRecommendationDataAttributes, + CostRecommendationDataAttributesPotentialDailySavings: + CostRecommendationDataAttributesPotentialDailySavings, CostTag: CostTag, CostTagAttributes: CostTagAttributes, CostTagDescription: CostTagDescription, @@ -444,6 +458,11 @@ export const TypingInfo: ModelTypingInfo = { OCIConfig: OCIConfig, OCIConfigAttributes: OCIConfigAttributes, OCIConfigsResponse: OCIConfigsResponse, + RecommendationsFilterRequest: RecommendationsFilterRequest, + RecommendationsFilterRequestSortItems: + RecommendationsFilterRequestSortItems, + RecommendationsPageMeta: RecommendationsPageMeta, + RecommendationsPageMetaPage: RecommendationsPageMetaPage, ReorderRuleResourceArray: ReorderRuleResourceArray, ReorderRuleResourceData: ReorderRuleResourceData, ReorderRulesetResourceArray: ReorderRulesetResourceArray,