Skip to content

Commit ca330c2

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

File tree

6 files changed

+41
-0
lines changed

6 files changed

+41
-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

private/bdd_runner/src/support/scenarios_model_mapping.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5559,6 +5559,10 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = {
55595559
type: "Date",
55605560
format: "date-time",
55615561
},
5562+
costAggregation: {
5563+
type: "CostAggregationType",
5564+
format: "",
5565+
},
55625566
includeConnectedAccounts: {
55635567
type: "boolean",
55645568
format: "",

services/usage_metering/src/v2/UsageMeteringApi.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { TypingInfo } from "./models/TypingInfo";
2525
import { ActiveBillingDimensionsResponse } from "./models/ActiveBillingDimensionsResponse";
2626
import { APIErrorResponse } from "./models/APIErrorResponse";
2727
import { BillingDimensionsMappingResponse } from "./models/BillingDimensionsMappingResponse";
28+
import { CostAggregationType } from "./models/CostAggregationType";
2829
import { CostByOrgResponse } from "./models/CostByOrgResponse";
2930
import { HourlyUsageResponse } from "./models/HourlyUsageResponse";
3031
import { MonthlyCostAttributionResponse } from "./models/MonthlyCostAttributionResponse";
@@ -209,6 +210,7 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory {
209210
endMonth?: Date,
210211
startDate?: Date,
211212
endDate?: Date,
213+
costAggregation?: CostAggregationType,
212214
includeConnectedAccounts?: boolean,
213215
_options?: Configuration,
214216
): Promise<RequestContext> {
@@ -274,6 +276,13 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory {
274276
"",
275277
);
276278
}
279+
if (costAggregation !== undefined) {
280+
requestContext.setQueryParam(
281+
"cost_aggregation",
282+
serialize(costAggregation, TypingInfo, "CostAggregationType", ""),
283+
"",
284+
);
285+
}
277286
if (includeConnectedAccounts !== undefined) {
278287
requestContext.setQueryParam(
279288
"include_connected_accounts",
@@ -1664,6 +1673,11 @@ export interface UsageMeteringApiGetEstimatedCostByOrgRequest {
16641673
* @type Date
16651674
*/
16661675
endDate?: Date;
1676+
/**
1677+
* Controls how costs are aggregated when using `start_date`. The `cumulative` option returns month-to-date running totals.
1678+
* @type CostAggregationType
1679+
*/
1680+
costAggregation?: CostAggregationType;
16671681
/**
16681682
* Boolean to specify whether to include accounts connected to the current account as partner customers in the Datadog partner network program. Defaults to `false`.
16691683
* @type boolean
@@ -1969,6 +1983,7 @@ export class UsageMeteringApi {
19691983
param.endMonth,
19701984
param.startDate,
19711985
param.endDate,
1986+
param.costAggregation,
19721987
param.includeConnectedAccounts,
19731988
options,
19741989
);

services/usage_metering/src/v2/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export { BillingDimensionsMappingBodyItemAttributesEndpointsItems } from "./mode
2323
export { BillingDimensionsMappingBodyItemAttributesEndpointsItemsStatus } from "./models/BillingDimensionsMappingBodyItemAttributesEndpointsItemsStatus";
2424
export { BillingDimensionsMappingResponse } from "./models/BillingDimensionsMappingResponse";
2525
export { ChargebackBreakdown } from "./models/ChargebackBreakdown";
26+
export { CostAggregationType } from "./models/CostAggregationType";
2627
export { CostAttributionAggregatesBody } from "./models/CostAttributionAggregatesBody";
2728
export { CostAttributionType } from "./models/CostAttributionType";
2829
export { CostByOrg } from "./models/CostByOrg";
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { UnparsedObject } from "@datadog/datadog-api-client";
2+
3+
/**
4+
* Controls how costs are aggregated when using `start_date`. The `cumulative` option returns month-to-date running totals.
5+
*/
6+
export type CostAggregationType = typeof CUMULATIVE | UnparsedObject;
7+
export const CUMULATIVE = "cumulative";

services/usage_metering/src/v2/models/TypingInfo.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export const TypingInfo: ModelTypingInfo = {
4444
"OK",
4545
"NOT_FOUND",
4646
],
47+
CostAggregationType: ["cumulative"],
4748
CostAttributionType: ["cost_by_tag"],
4849
CostByOrgType: ["cost_by_org"],
4950
HourlyUsageType: [

0 commit comments

Comments
 (0)