Skip to content

Commit 1227b58

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add cost_aggregation parameter to GetEstimatedCostByOrg (#3764)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 187171f commit 1227b58

File tree

6 files changed

+48
-0
lines changed

6 files changed

+48
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13902,6 +13902,13 @@ components:
1390213902
data:
1390313903
$ref: "#/components/schemas/ConvertJobResultsToSignalsData"
1390413904
type: object
13905+
CostAggregationType:
13906+
description: "Controls how costs are aggregated when using `start_date`. The `cumulative` option returns month-to-date running totals."
13907+
enum:
13908+
- cumulative
13909+
type: string
13910+
x-enum-varnames:
13911+
- CUMULATIVE
1390513912
CostAttributionAggregates:
1390613913
description: An array of available aggregates.
1390713914
items:
@@ -108698,6 +108705,12 @@ paths:
108698108705
schema:
108699108706
format: date-time
108700108707
type: string
108708+
- description: "Controls how costs are aggregated when using `start_date`. The `cumulative` option returns month-to-date running totals."
108709+
in: query
108710+
name: cost_aggregation
108711+
required: false
108712+
schema:
108713+
$ref: "#/components/schemas/CostAggregationType"
108701108714
- 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`."
108702108715
in: query
108703108716
name: include_connected_accounts

features/support/scenarios_model_mapping.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5549,6 +5549,10 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
55495549
"type": "Date",
55505550
"format": "date-time",
55515551
},
5552+
"costAggregation": {
5553+
"type": "CostAggregationType",
5554+
"format": "",
5555+
},
55525556
"includeConnectedAccounts": {
55535557
"type": "boolean",
55545558
"format": "",

packages/datadog-api-client-v2/apis/UsageMeteringApi.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { ApiException } from "../../datadog-api-client-common/exception";
1919
import { ActiveBillingDimensionsResponse } from "../models/ActiveBillingDimensionsResponse";
2020
import { APIErrorResponse } from "../models/APIErrorResponse";
2121
import { BillingDimensionsMappingResponse } from "../models/BillingDimensionsMappingResponse";
22+
import { CostAggregationType } from "../models/CostAggregationType";
2223
import { CostByOrgResponse } from "../models/CostByOrgResponse";
2324
import { HourlyUsageResponse } from "../models/HourlyUsageResponse";
2425
import { MonthlyCostAttributionResponse } from "../models/MonthlyCostAttributionResponse";
@@ -161,6 +162,7 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory {
161162
endMonth?: Date,
162163
startDate?: Date,
163164
endDate?: Date,
165+
costAggregation?: CostAggregationType,
164166
includeConnectedAccounts?: boolean,
165167
_options?: Configuration
166168
): Promise<RequestContext> {
@@ -215,6 +217,13 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory {
215217
""
216218
);
217219
}
220+
if (costAggregation !== undefined) {
221+
requestContext.setQueryParam(
222+
"cost_aggregation",
223+
ObjectSerializer.serialize(costAggregation, "CostAggregationType", ""),
224+
""
225+
);
226+
}
218227
if (includeConnectedAccounts !== undefined) {
219228
requestContext.setQueryParam(
220229
"include_connected_accounts",
@@ -1555,6 +1564,11 @@ export interface UsageMeteringApiGetEstimatedCostByOrgRequest {
15551564
* @type Date
15561565
*/
15571566
endDate?: Date;
1567+
/**
1568+
* Controls how costs are aggregated when using `start_date`. The `cumulative` option returns month-to-date running totals.
1569+
* @type CostAggregationType
1570+
*/
1571+
costAggregation?: CostAggregationType;
15581572
/**
15591573
* Boolean to specify whether to include accounts connected to the current account as partner customers in the Datadog partner network program. Defaults to `false`.
15601574
* @type boolean
@@ -1858,6 +1872,7 @@ export class UsageMeteringApi {
18581872
param.endMonth,
18591873
param.startDate,
18601874
param.endDate,
1875+
param.costAggregation,
18611876
param.includeConnectedAccounts,
18621877
options
18631878
);

packages/datadog-api-client-v2/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,6 +2056,7 @@ export { ConvertJobResultsToSignalsAttributes } from "./models/ConvertJobResults
20562056
export { ConvertJobResultsToSignalsData } from "./models/ConvertJobResultsToSignalsData";
20572057
export { ConvertJobResultsToSignalsDataType } from "./models/ConvertJobResultsToSignalsDataType";
20582058
export { ConvertJobResultsToSignalsRequest } from "./models/ConvertJobResultsToSignalsRequest";
2059+
export { CostAggregationType } from "./models/CostAggregationType";
20592060
export { CostAttributionAggregatesBody } from "./models/CostAttributionAggregatesBody";
20602061
export { CostAttributionType } from "./models/CostAttributionType";
20612062
export { CostByOrg } from "./models/CostByOrg";
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2020-Present Datadog, Inc.
5+
*/
6+
7+
import { UnparsedObject } from "../../datadog-api-client-common/util";
8+
9+
/**
10+
* Controls how costs are aggregated when using `start_date`. The `cumulative` option returns month-to-date running totals.
11+
*/
12+
13+
export type CostAggregationType = typeof CUMULATIVE | UnparsedObject;
14+
export const CUMULATIVE = "cumulative";

packages/datadog-api-client-v2/models/ObjectSerializer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3897,6 +3897,7 @@ const enumsMap: { [key: string]: any[] } = {
38973897
ConvertJobResultsToSignalsDataType: [
38983898
"historicalDetectionsJobResultSignalConversion",
38993899
],
3900+
CostAggregationType: ["cumulative"],
39003901
CostAttributionType: ["cost_by_tag"],
39013902
CostByOrgType: ["cost_by_org"],
39023903
CoverageSummaryType: ["ci_app_coverage_summary"],

0 commit comments

Comments
 (0)