Skip to content

Commit 6e78860

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 86072741 of spec repo
1 parent 362c924 commit 6e78860

File tree

5 files changed

+34
-51
lines changed

5 files changed

+34
-51
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
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:45:58.829299",
8-
"spec_repo_commit": "049920eb"
7+
"regenerated": "2024-10-16 20:07:17.471714",
8+
"spec_repo_commit": "86072741"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-10-10 19:45:58.847651",
13-
"spec_repo_commit": "049920eb"
12+
"regenerated": "2024-10-16 20:07:17.490312",
13+
"spec_repo_commit": "86072741"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 1 addition & 1 deletion
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

examples/v2/usage-metering/GetMonthlyCostAttribution.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import com.datadog.api.client.ApiClient;
33
import com.datadog.api.client.ApiException;
44
import com.datadog.api.client.v2.api.UsageMeteringApi;
5+
import com.datadog.api.client.v2.api.UsageMeteringApi.GetMonthlyCostAttributionOptionalParameters;
56
import com.datadog.api.client.v2.model.MonthlyCostAttributionResponse;
67
import java.time.OffsetDateTime;
78

@@ -15,8 +16,9 @@ public static void main(String[] args) {
1516
MonthlyCostAttributionResponse result =
1617
apiInstance.getMonthlyCostAttribution(
1718
OffsetDateTime.now().plusDays(-5),
18-
OffsetDateTime.now().plusDays(-3),
19-
"infra_host_total_cost");
19+
"infra_host_total_cost",
20+
new GetMonthlyCostAttributionOptionalParameters()
21+
.endMonth(OffsetDateTime.now().plusDays(-3)));
2022
System.out.println(result);
2123
} catch (ApiException e) {
2224
System.err.println("Exception when calling UsageMeteringApi#getMonthlyCostAttribution");

src/main/java/com/datadog/api/client/v2/api/UsageMeteringApi.java

Lines changed: 23 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,12 +1390,25 @@ public CompletableFuture<ApiResponse<HourlyUsageResponse>> getHourlyUsageWithHtt
13901390

13911391
/** Manage optional parameters to getMonthlyCostAttribution. */
13921392
public static class GetMonthlyCostAttributionOptionalParameters {
1393+
private OffsetDateTime endMonth;
13931394
private SortDirection sortDirection;
13941395
private String sortName;
13951396
private String tagBreakdownKeys;
13961397
private String nextRecordId;
13971398
private Boolean includeDescendants;
13981399

1400+
/**
1401+
* Set endMonth.
1402+
*
1403+
* @param endMonth Datetime in ISO-8601 format, UTC, precise to month: <code>[YYYY-MM]</code>
1404+
* for cost ending this month. (optional)
1405+
* @return GetMonthlyCostAttributionOptionalParameters
1406+
*/
1407+
public GetMonthlyCostAttributionOptionalParameters endMonth(OffsetDateTime endMonth) {
1408+
this.endMonth = endMonth;
1409+
return this;
1410+
}
1411+
13991412
/**
14001413
* Set sortDirection.
14011414
*
@@ -1466,8 +1479,6 @@ public GetMonthlyCostAttributionOptionalParameters includeDescendants(
14661479
*
14671480
* @param startMonth Datetime in ISO-8601 format, UTC, precise to month: <code>[YYYY-MM]</code>
14681481
* for cost beginning in this month. (required)
1469-
* @param endMonth Datetime in ISO-8601 format, UTC, precise to month: <code>[YYYY-MM]</code> for
1470-
* cost ending this month. (required)
14711482
* @param fields Comma-separated list specifying cost types (e.g., <code>
14721483
* &lt;billing_dimension&gt;_on_demand_cost</code>, <code>
14731484
* &lt;billing_dimension&gt;_committed_cost</code>, <code>&lt;billing_dimension&gt;_total_cost
@@ -1483,9 +1494,9 @@ public GetMonthlyCostAttributionOptionalParameters includeDescendants(
14831494
* @throws ApiException if fails to make API call
14841495
*/
14851496
public MonthlyCostAttributionResponse getMonthlyCostAttribution(
1486-
OffsetDateTime startMonth, OffsetDateTime endMonth, String fields) throws ApiException {
1497+
OffsetDateTime startMonth, String fields) throws ApiException {
14871498
return getMonthlyCostAttributionWithHttpInfo(
1488-
startMonth, endMonth, fields, new GetMonthlyCostAttributionOptionalParameters())
1499+
startMonth, fields, new GetMonthlyCostAttributionOptionalParameters())
14891500
.getData();
14901501
}
14911502

@@ -1496,8 +1507,6 @@ startMonth, endMonth, fields, new GetMonthlyCostAttributionOptionalParameters())
14961507
*
14971508
* @param startMonth Datetime in ISO-8601 format, UTC, precise to month: <code>[YYYY-MM]</code>
14981509
* for cost beginning in this month. (required)
1499-
* @param endMonth Datetime in ISO-8601 format, UTC, precise to month: <code>[YYYY-MM]</code> for
1500-
* cost ending this month. (required)
15011510
* @param fields Comma-separated list specifying cost types (e.g., <code>
15021511
* &lt;billing_dimension&gt;_on_demand_cost</code>, <code>
15031512
* &lt;billing_dimension&gt;_committed_cost</code>, <code>&lt;billing_dimension&gt;_total_cost
@@ -1512,9 +1521,9 @@ startMonth, endMonth, fields, new GetMonthlyCostAttributionOptionalParameters())
15121521
* @return CompletableFuture&lt;MonthlyCostAttributionResponse&gt;
15131522
*/
15141523
public CompletableFuture<MonthlyCostAttributionResponse> getMonthlyCostAttributionAsync(
1515-
OffsetDateTime startMonth, OffsetDateTime endMonth, String fields) {
1524+
OffsetDateTime startMonth, String fields) {
15161525
return getMonthlyCostAttributionWithHttpInfoAsync(
1517-
startMonth, endMonth, fields, new GetMonthlyCostAttributionOptionalParameters())
1526+
startMonth, fields, new GetMonthlyCostAttributionOptionalParameters())
15181527
.thenApply(
15191528
response -> {
15201529
return response.getData();
@@ -1528,8 +1537,6 @@ startMonth, endMonth, fields, new GetMonthlyCostAttributionOptionalParameters())
15281537
*
15291538
* @param startMonth Datetime in ISO-8601 format, UTC, precise to month: <code>[YYYY-MM]</code>
15301539
* for cost beginning in this month. (required)
1531-
* @param endMonth Datetime in ISO-8601 format, UTC, precise to month: <code>[YYYY-MM]</code> for
1532-
* cost ending this month. (required)
15331540
* @param fields Comma-separated list specifying cost types (e.g., <code>
15341541
* &lt;billing_dimension&gt;_on_demand_cost</code>, <code>
15351542
* &lt;billing_dimension&gt;_committed_cost</code>, <code>&lt;billing_dimension&gt;_total_cost
@@ -1547,12 +1554,10 @@ startMonth, endMonth, fields, new GetMonthlyCostAttributionOptionalParameters())
15471554
*/
15481555
public MonthlyCostAttributionResponse getMonthlyCostAttribution(
15491556
OffsetDateTime startMonth,
1550-
OffsetDateTime endMonth,
15511557
String fields,
15521558
GetMonthlyCostAttributionOptionalParameters parameters)
15531559
throws ApiException {
1554-
return getMonthlyCostAttributionWithHttpInfo(startMonth, endMonth, fields, parameters)
1555-
.getData();
1560+
return getMonthlyCostAttributionWithHttpInfo(startMonth, fields, parameters).getData();
15561561
}
15571562

15581563
/**
@@ -1562,8 +1567,6 @@ public MonthlyCostAttributionResponse getMonthlyCostAttribution(
15621567
*
15631568
* @param startMonth Datetime in ISO-8601 format, UTC, precise to month: <code>[YYYY-MM]</code>
15641569
* for cost beginning in this month. (required)
1565-
* @param endMonth Datetime in ISO-8601 format, UTC, precise to month: <code>[YYYY-MM]</code> for
1566-
* cost ending this month. (required)
15671570
* @param fields Comma-separated list specifying cost types (e.g., <code>
15681571
* &lt;billing_dimension&gt;_on_demand_cost</code>, <code>
15691572
* &lt;billing_dimension&gt;_committed_cost</code>, <code>&lt;billing_dimension&gt;_total_cost
@@ -1580,10 +1583,9 @@ public MonthlyCostAttributionResponse getMonthlyCostAttribution(
15801583
*/
15811584
public CompletableFuture<MonthlyCostAttributionResponse> getMonthlyCostAttributionAsync(
15821585
OffsetDateTime startMonth,
1583-
OffsetDateTime endMonth,
15841586
String fields,
15851587
GetMonthlyCostAttributionOptionalParameters parameters) {
1586-
return getMonthlyCostAttributionWithHttpInfoAsync(startMonth, endMonth, fields, parameters)
1588+
return getMonthlyCostAttributionWithHttpInfoAsync(startMonth, fields, parameters)
15871589
.thenApply(
15881590
response -> {
15891591
return response.getData();
@@ -1610,8 +1612,6 @@ public CompletableFuture<MonthlyCostAttributionResponse> getMonthlyCostAttributi
16101612
*
16111613
* @param startMonth Datetime in ISO-8601 format, UTC, precise to month: <code>[YYYY-MM]</code>
16121614
* for cost beginning in this month. (required)
1613-
* @param endMonth Datetime in ISO-8601 format, UTC, precise to month: <code>[YYYY-MM]</code> for
1614-
* cost ending this month. (required)
16151615
* @param fields Comma-separated list specifying cost types (e.g., <code>
16161616
* &lt;billing_dimension&gt;_on_demand_cost</code>, <code>
16171617
* &lt;billing_dimension&gt;_committed_cost</code>, <code>&lt;billing_dimension&gt;_total_cost
@@ -1638,7 +1638,6 @@ public CompletableFuture<MonthlyCostAttributionResponse> getMonthlyCostAttributi
16381638
*/
16391639
public ApiResponse<MonthlyCostAttributionResponse> getMonthlyCostAttributionWithHttpInfo(
16401640
OffsetDateTime startMonth,
1641-
OffsetDateTime endMonth,
16421641
String fields,
16431642
GetMonthlyCostAttributionOptionalParameters parameters)
16441643
throws ApiException {
@@ -1658,17 +1657,12 @@ public ApiResponse<MonthlyCostAttributionResponse> getMonthlyCostAttributionWith
16581657
"Missing the required parameter 'startMonth' when calling getMonthlyCostAttribution");
16591658
}
16601659

1661-
// verify the required parameter 'endMonth' is set
1662-
if (endMonth == null) {
1663-
throw new ApiException(
1664-
400, "Missing the required parameter 'endMonth' when calling getMonthlyCostAttribution");
1665-
}
1666-
16671660
// verify the required parameter 'fields' is set
16681661
if (fields == null) {
16691662
throw new ApiException(
16701663
400, "Missing the required parameter 'fields' when calling getMonthlyCostAttribution");
16711664
}
1665+
OffsetDateTime endMonth = parameters.endMonth;
16721666
SortDirection sortDirection = parameters.sortDirection;
16731667
String sortName = parameters.sortName;
16741668
String tagBreakdownKeys = parameters.tagBreakdownKeys;
@@ -1681,8 +1675,8 @@ public ApiResponse<MonthlyCostAttributionResponse> getMonthlyCostAttributionWith
16811675
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
16821676

16831677
localVarQueryParams.addAll(apiClient.parameterToPairs("", "start_month", startMonth));
1684-
localVarQueryParams.addAll(apiClient.parameterToPairs("", "end_month", endMonth));
16851678
localVarQueryParams.addAll(apiClient.parameterToPairs("", "fields", fields));
1679+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "end_month", endMonth));
16861680
localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort_direction", sortDirection));
16871681
localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort_name", sortName));
16881682
localVarQueryParams.addAll(
@@ -1718,8 +1712,6 @@ public ApiResponse<MonthlyCostAttributionResponse> getMonthlyCostAttributionWith
17181712
*
17191713
* @param startMonth Datetime in ISO-8601 format, UTC, precise to month: <code>[YYYY-MM]</code>
17201714
* for cost beginning in this month. (required)
1721-
* @param endMonth Datetime in ISO-8601 format, UTC, precise to month: <code>[YYYY-MM]</code> for
1722-
* cost ending this month. (required)
17231715
* @param fields Comma-separated list specifying cost types (e.g., <code>
17241716
* &lt;billing_dimension&gt;_on_demand_cost</code>, <code>
17251717
* &lt;billing_dimension&gt;_committed_cost</code>, <code>&lt;billing_dimension&gt;_total_cost
@@ -1737,7 +1729,6 @@ public ApiResponse<MonthlyCostAttributionResponse> getMonthlyCostAttributionWith
17371729
public CompletableFuture<ApiResponse<MonthlyCostAttributionResponse>>
17381730
getMonthlyCostAttributionWithHttpInfoAsync(
17391731
OffsetDateTime startMonth,
1740-
OffsetDateTime endMonth,
17411732
String fields,
17421733
GetMonthlyCostAttributionOptionalParameters parameters) {
17431734
// Check if unstable operation is enabled
@@ -1765,17 +1756,6 @@ public ApiResponse<MonthlyCostAttributionResponse> getMonthlyCostAttributionWith
17651756
return result;
17661757
}
17671758

1768-
// verify the required parameter 'endMonth' is set
1769-
if (endMonth == null) {
1770-
CompletableFuture<ApiResponse<MonthlyCostAttributionResponse>> result =
1771-
new CompletableFuture<>();
1772-
result.completeExceptionally(
1773-
new ApiException(
1774-
400,
1775-
"Missing the required parameter 'endMonth' when calling getMonthlyCostAttribution"));
1776-
return result;
1777-
}
1778-
17791759
// verify the required parameter 'fields' is set
17801760
if (fields == null) {
17811761
CompletableFuture<ApiResponse<MonthlyCostAttributionResponse>> result =
@@ -1786,6 +1766,7 @@ public ApiResponse<MonthlyCostAttributionResponse> getMonthlyCostAttributionWith
17861766
"Missing the required parameter 'fields' when calling getMonthlyCostAttribution"));
17871767
return result;
17881768
}
1769+
OffsetDateTime endMonth = parameters.endMonth;
17891770
SortDirection sortDirection = parameters.sortDirection;
17901771
String sortName = parameters.sortName;
17911772
String tagBreakdownKeys = parameters.tagBreakdownKeys;
@@ -1798,8 +1779,8 @@ public ApiResponse<MonthlyCostAttributionResponse> getMonthlyCostAttributionWith
17981779
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
17991780

18001781
localVarQueryParams.addAll(apiClient.parameterToPairs("", "start_month", startMonth));
1801-
localVarQueryParams.addAll(apiClient.parameterToPairs("", "end_month", endMonth));
18021782
localVarQueryParams.addAll(apiClient.parameterToPairs("", "fields", fields));
1783+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "end_month", endMonth));
18031784
localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort_direction", sortDirection));
18041785
localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort_name", sortName));
18051786
localVarQueryParams.addAll(

src/test/resources/com/datadog/api/client/v2/api/usage_metering.feature

Lines changed: 2 additions & 2 deletions
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

0 commit comments

Comments
 (0)