Skip to content

Commit 020aec9

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Make sure required params are first (#2676)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 9055ce3 commit 020aec9

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

.generated-info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"spec_repo_commit": "4413e63",
3-
"generated": "2025-08-19 20:29:47.677"
2+
"spec_repo_commit": "d58cb84",
3+
"generated": "2025-08-22 18:46:19.412"
44
}

.generator/schemas/v2/openapi.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67451,14 +67451,6 @@ paths:
6745167451
This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).'
6745267452
operationId: GetHistoricalCostByOrg
6745367453
parameters:
67454-
- description: String to specify whether cost is broken down at a parent-org
67455-
level or at the sub-org level. Available views are `summary` and `sub-org`. Defaults
67456-
to `summary`.
67457-
in: query
67458-
name: view
67459-
required: false
67460-
schema:
67461-
type: string
6746267454
- description: 'Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]`
6746367455
for cost beginning this month.'
6746467456
in: query
@@ -67467,6 +67459,14 @@ paths:
6746767459
schema:
6746867460
format: date-time
6746967461
type: string
67462+
- description: String to specify whether cost is broken down at a parent-org
67463+
level or at the sub-org level. Available views are `summary` and `sub-org`. Defaults
67464+
to `summary`.
67465+
in: query
67466+
name: view
67467+
required: false
67468+
schema:
67469+
type: string
6747067470
- description: 'Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]`
6747167471
for cost ending this month.'
6747267472
in: query

examples/v2/usage-metering/GetHistoricalCostByOrg.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ const configuration = client.createConfiguration();
88
const apiInstance = new v2.UsageMeteringApi(configuration);
99

1010
const params: v2.UsageMeteringApiGetHistoricalCostByOrgRequest = {
11-
view: "sub-org",
1211
startMonth: new Date(new Date().getTime() + -2 * 86400 * 30 * 1000),
12+
view: "sub-org",
1313
};
1414

1515
apiInstance

features/support/scenarios_model_mapping.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4417,14 +4417,14 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
44174417
"operationResponseType": "CostByOrgResponse",
44184418
},
44194419
"v2.GetHistoricalCostByOrg": {
4420-
"view": {
4421-
"type": "string",
4422-
"format": "",
4423-
},
44244420
"startMonth": {
44254421
"type": "Date",
44264422
"format": "date-time",
44274423
},
4424+
"view": {
4425+
"type": "string",
4426+
"format": "",
4427+
},
44284428
"endMonth": {
44294429
"type": "Date",
44304430
"format": "date-time",

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,17 +260,17 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory {
260260
requestContext.setHttpConfig(_config.httpConfig);
261261

262262
// Query Params
263-
if (view !== undefined) {
263+
if (startMonth !== undefined) {
264264
requestContext.setQueryParam(
265-
"view",
266-
ObjectSerializer.serialize(view, "string", ""),
265+
"start_month",
266+
ObjectSerializer.serialize(startMonth, "Date", "date-time"),
267267
""
268268
);
269269
}
270-
if (startMonth !== undefined) {
270+
if (view !== undefined) {
271271
requestContext.setQueryParam(
272-
"start_month",
273-
ObjectSerializer.serialize(startMonth, "Date", "date-time"),
272+
"view",
273+
ObjectSerializer.serialize(view, "string", ""),
274274
""
275275
);
276276
}

0 commit comments

Comments
 (0)