Skip to content

Commit

Permalink
update historical_cost and projected_cost for partner program (#1708)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <[email protected]>
Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Jul 23, 2024
1 parent 2ef5617 commit 3f2d351
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
24 changes: 24 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
8 changes: 8 additions & 0 deletions features/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -3189,6 +3193,10 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
"type": "string",
"format": "",
},
"includeConnectedAccounts": {
"type": "boolean",
"format": "",
},
"operationResponseType": "ProjectedCostResponse",
},
"v2.DeleteDashboardListItems": {
Expand Down
26 changes: 26 additions & 0 deletions packages/datadog-api-client-v2/apis/UsageMeteringApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory {
startMonth: Date,
view?: string,
endMonth?: Date,
includeConnectedAccounts?: boolean,
_options?: Configuration
): Promise<RequestContext> {
const _config = _options || this.configuration;
Expand Down Expand Up @@ -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, [
Expand Down Expand Up @@ -457,6 +464,7 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory {

public async getProjectedCost(
view?: string,
includeConnectedAccounts?: boolean,
_options?: Configuration
): Promise<RequestContext> {
const _config = _options || this.configuration;
Expand All @@ -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, [
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -1603,6 +1627,7 @@ export class UsageMeteringApi {
param.startMonth,
param.view,
param.endMonth,
param.includeConnectedAccounts,
options
);
return requestContextPromise.then((requestContext) => {
Expand Down Expand Up @@ -1701,6 +1726,7 @@ export class UsageMeteringApi {
): Promise<ProjectedCostResponse> {
const requestContextPromise = this.requestFactory.getProjectedCost(
param.view,
param.includeConnectedAccounts,
options
);
return requestContextPromise.then((requestContext) => {
Expand Down
16 changes: 16 additions & 0 deletions packages/datadog-api-client-v2/models/ProjectedCostAttributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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<ChargebackBreakdown>",
Expand Down

0 comments on commit 3f2d351

Please sign in to comment.