Skip to content

Commit 58e7d30

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
and
ci.datadog-api-spec
authored
Mark Cost Attribution end_month parameter as not required (#1834)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent d518b28 commit 58e7d30

File tree

4 files changed

+14
-19
lines changed

4 files changed

+14
-19
lines changed

.apigentools-info

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-10-10 19:46:03.896755",
8-
"spec_repo_commit": "049920eb"
7+
"regenerated": "2024-10-16 20:07:12.083214",
8+
"spec_repo_commit": "86072741"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-10-10 19:46:04.041839",
13-
"spec_repo_commit": "049920eb"
12+
"regenerated": "2024-10-16 20:07:12.101717",
13+
"spec_repo_commit": "86072741"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28730,7 +28730,7 @@ paths:
2873028730
for cost ending this month.'
2873128731
in: query
2873228732
name: end_month
28733-
required: true
28733+
required: false
2873428734
schema:
2873528735
format: date-time
2873628736
type: string

features/v2/usage_metering.feature

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ Feature: Usage Metering
1919
Given operation "GetMonthlyCostAttribution" enabled
2020
And new "GetMonthlyCostAttribution" request
2121
And request contains "start_month" parameter with value "{{ timeISO('now - 5d') }}"
22-
And request contains "end_month" parameter with value "{{ timeISO('now - 3d') }}"
2322
And request contains "fields" parameter with value "not_a_product"
23+
And request contains "end_month" parameter with value "{{ timeISO('now - 3d') }}"
2424
When the request is sent
2525
Then the response status is 400 Bad Request
2626

@@ -29,8 +29,8 @@ Feature: Usage Metering
2929
Given operation "GetMonthlyCostAttribution" enabled
3030
And new "GetMonthlyCostAttribution" request
3131
And request contains "start_month" parameter with value "{{ timeISO('now - 5d') }}"
32-
And request contains "end_month" parameter with value "{{ timeISO('now - 3d') }}"
3332
And request contains "fields" parameter with value "infra_host_total_cost"
33+
And request contains "end_month" parameter with value "{{ timeISO('now - 3d') }}"
3434
When the request is sent
3535
Then the response status is 200 OK
3636

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

+7-12
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,8 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory {
356356

357357
public async getMonthlyCostAttribution(
358358
startMonth: Date,
359-
endMonth: Date,
360359
fields: string,
360+
endMonth?: Date,
361361
sortDirection?: SortDirection,
362362
sortName?: string,
363363
tagBreakdownKeys?: string,
@@ -379,11 +379,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory {
379379
throw new RequiredError("startMonth", "getMonthlyCostAttribution");
380380
}
381381

382-
// verify required parameter 'endMonth' is not null or undefined
383-
if (endMonth === null || endMonth === undefined) {
384-
throw new RequiredError("endMonth", "getMonthlyCostAttribution");
385-
}
386-
387382
// verify required parameter 'fields' is not null or undefined
388383
if (fields === null || fields === undefined) {
389384
throw new RequiredError("fields", "getMonthlyCostAttribution");
@@ -1420,11 +1415,6 @@ export interface UsageMeteringApiGetMonthlyCostAttributionRequest {
14201415
* @type Date
14211416
*/
14221417
startMonth: Date;
1423-
/**
1424-
* Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for cost ending this month.
1425-
* @type Date
1426-
*/
1427-
endMonth: Date;
14281418
/**
14291419
* Comma-separated list specifying cost types (e.g., `<billing_dimension>_on_demand_cost`, `<billing_dimension>_committed_cost`, `<billing_dimension>_total_cost`) and the
14301420
* proportions (`<billing_dimension>_percentage_in_org`, `<billing_dimension>_percentage_in_account`). Use `*` to retrieve all fields.
@@ -1434,6 +1424,11 @@ export interface UsageMeteringApiGetMonthlyCostAttributionRequest {
14341424
* @type string
14351425
*/
14361426
fields: string;
1427+
/**
1428+
* Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for cost ending this month.
1429+
* @type Date
1430+
*/
1431+
endMonth?: Date;
14371432
/**
14381433
* The direction to sort by: `[desc, asc]`.
14391434
* @type SortDirection
@@ -1694,8 +1689,8 @@ export class UsageMeteringApi {
16941689
): Promise<MonthlyCostAttributionResponse> {
16951690
const requestContextPromise = this.requestFactory.getMonthlyCostAttribution(
16961691
param.startMonth,
1697-
param.endMonth,
16981692
param.fields,
1693+
param.endMonth,
16991694
param.sortDirection,
17001695
param.sortName,
17011696
param.tagBreakdownKeys,

0 commit comments

Comments
 (0)