From 3f2d351393195acbc21bb175cacdb660cccf4e3e Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 18:43:57 +0000 Subject: [PATCH] update historical_cost and projected_cost for partner program (#1708) Co-authored-by: ci.datadog-api-spec Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> --- .apigentools-info | 8 +++--- .generator/schemas/v2/openapi.yaml | 24 +++++++++++++++++ features/support/scenarios_model_mapping.ts | 8 ++++++ .../apis/UsageMeteringApi.ts | 26 +++++++++++++++++++ .../models/ProjectedCostAttributes.ts | 16 ++++++++++++ 5 files changed, 78 insertions(+), 4 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index e6ff83b2505..de7a9aa1306 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-07-23 17:39:34.694923", - "spec_repo_commit": "ad82c0e5" + "regenerated": "2024-07-23 18:14:06.803860", + "spec_repo_commit": "9e027051" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-07-23 17:39:34.712937", - "spec_repo_commit": "ad82c0e5" + "regenerated": "2024-07-23 18:14:06.822753", + "spec_repo_commit": "9e027051" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 19a1e675d25..d921feb3775 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -15172,6 +15172,12 @@ components: ProjectedCostAttributes: description: Projected Cost attributes data. properties: + account_name: + description: The account name. + type: string + account_public_id: + description: The account public ID. + type: string charges: description: List of charges data reported for the requested month. items: @@ -36703,6 +36709,15 @@ paths: schema: format: date-time type: string + - description: 'Boolean to specify whether to include accounts connected to + the current account as partner customers in the Datadog partner network + program. Defaults to `false`. ' + in: query + name: include_connected_accounts + required: false + schema: + default: false + type: boolean responses: '200': content: @@ -37009,6 +37024,15 @@ paths: required: false schema: type: string + - description: 'Boolean to specify whether to include accounts connected to + the current account as partner customers in the Datadog partner network + program. Defaults to `false`. ' + in: query + name: include_connected_accounts + required: false + schema: + default: false + type: boolean responses: '200': content: diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index cc6d66aa793..9c672cbb847 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -3121,6 +3121,10 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { "type": "Date", "format": "date-time", }, + "includeConnectedAccounts": { + "type": "boolean", + "format": "", + }, "operationResponseType": "CostByOrgResponse", }, "v2.GetHourlyUsage": { @@ -3189,6 +3193,10 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { "type": "string", "format": "", }, + "includeConnectedAccounts": { + "type": "boolean", + "format": "", + }, "operationResponseType": "ProjectedCostResponse", }, "v2.DeleteDashboardListItems": { diff --git a/packages/datadog-api-client-v2/apis/UsageMeteringApi.ts b/packages/datadog-api-client-v2/apis/UsageMeteringApi.ts index b03f4551e39..73349305bb7 100644 --- a/packages/datadog-api-client-v2/apis/UsageMeteringApi.ts +++ b/packages/datadog-api-client-v2/apis/UsageMeteringApi.ts @@ -188,6 +188,7 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { startMonth: Date, view?: string, endMonth?: Date, + includeConnectedAccounts?: boolean, _options?: Configuration ): Promise { const _config = _options || this.configuration; @@ -229,6 +230,12 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { ObjectSerializer.serialize(endMonth, "Date", "date-time") ); } + if (includeConnectedAccounts !== undefined) { + requestContext.setQueryParam( + "include_connected_accounts", + ObjectSerializer.serialize(includeConnectedAccounts, "boolean", "") + ); + } // Apply auth methods applySecurityAuthentication(_config, requestContext, [ @@ -457,6 +464,7 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { public async getProjectedCost( view?: string, + includeConnectedAccounts?: boolean, _options?: Configuration ): Promise { const _config = _options || this.configuration; @@ -481,6 +489,12 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { ObjectSerializer.serialize(view, "string", "") ); } + if (includeConnectedAccounts !== undefined) { + requestContext.setQueryParam( + "include_connected_accounts", + ObjectSerializer.serialize(includeConnectedAccounts, "boolean", "") + ); + } // Apply auth methods applySecurityAuthentication(_config, requestContext, [ @@ -1335,6 +1349,11 @@ export interface UsageMeteringApiGetHistoricalCostByOrgRequest { * @type Date */ endMonth?: Date; + /** + * Boolean to specify whether to include accounts connected to the current account as partner customers in the Datadog partner network program. Defaults to `false`. + * @type boolean + */ + includeConnectedAccounts?: boolean; } export interface UsageMeteringApiGetHourlyUsageRequest { @@ -1448,6 +1467,11 @@ export interface UsageMeteringApiGetProjectedCostRequest { * @type string */ view?: string; + /** + * Boolean to specify whether to include accounts connected to the current account as partner customers in the Datadog partner network program. Defaults to `false`. + * @type boolean + */ + includeConnectedAccounts?: boolean; } export interface UsageMeteringApiGetUsageApplicationSecurityMonitoringRequest { @@ -1603,6 +1627,7 @@ export class UsageMeteringApi { param.startMonth, param.view, param.endMonth, + param.includeConnectedAccounts, options ); return requestContextPromise.then((requestContext) => { @@ -1701,6 +1726,7 @@ export class UsageMeteringApi { ): Promise { const requestContextPromise = this.requestFactory.getProjectedCost( param.view, + param.includeConnectedAccounts, options ); return requestContextPromise.then((requestContext) => { diff --git a/packages/datadog-api-client-v2/models/ProjectedCostAttributes.ts b/packages/datadog-api-client-v2/models/ProjectedCostAttributes.ts index c30871986a4..2b280b64d99 100644 --- a/packages/datadog-api-client-v2/models/ProjectedCostAttributes.ts +++ b/packages/datadog-api-client-v2/models/ProjectedCostAttributes.ts @@ -11,6 +11,14 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; * Projected Cost attributes data. */ export class ProjectedCostAttributes { + /** + * The account name. + */ + "accountName"?: string; + /** + * The account public ID. + */ + "accountPublicId"?: string; /** * List of charges data reported for the requested month. */ @@ -52,6 +60,14 @@ export class ProjectedCostAttributes { * @ignore */ static readonly attributeTypeMap: AttributeTypeMap = { + accountName: { + baseName: "account_name", + type: "string", + }, + accountPublicId: { + baseName: "account_public_id", + type: "string", + }, charges: { baseName: "charges", type: "Array",