Skip to content

Commit f1db7da

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 8292e96 of spec repo (#3884)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 5452711 commit f1db7da

31 files changed

Lines changed: 1206 additions & 3723 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 177 additions & 531 deletions
Large diffs are not rendered by default.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// List Cloud Cost Management tag metadata months returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.CloudCostManagementApi;
6+
import com.datadog.api.client.v2.model.CostTagMetadataMonthsResponse;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
defaultClient.setUnstableOperationEnabled("v2.listCostTagMetadataMonths", true);
12+
CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient);
13+
14+
try {
15+
CostTagMetadataMonthsResponse result = apiInstance.listCostTagMetadataMonths("aws");
16+
System.out.println(result);
17+
} catch (ApiException e) {
18+
System.err.println("Exception when calling CloudCostManagementApi#listCostTagMetadataMonths");
19+
System.err.println("Status code: " + e.getCode());
20+
System.err.println("Reason: " + e.getResponseBody());
21+
System.err.println("Response headers: " + e.getResponseHeaders());
22+
e.printStackTrace();
23+
}
24+
}
25+
}

examples/v2/oauth2-client-public/DeleteScopesRestriction.java

Lines changed: 0 additions & 24 deletions
This file was deleted.

examples/v2/oauth2-client-public/GetScopesRestriction.java

Lines changed: 0 additions & 27 deletions
This file was deleted.

examples/v2/oauth2-client-public/RegisterOAuthClient.java

Lines changed: 0 additions & 47 deletions
This file was deleted.

examples/v2/oauth2-client-public/UpsertScopesRestriction.java

Lines changed: 0 additions & 44 deletions
This file was deleted.

src/main/java/com/datadog/api/client/ApiClient.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -953,6 +953,7 @@ public class ApiClient {
953953
put("v2.listCostTagKeySources", false);
954954
put("v2.listCostTagMetadata", false);
955955
put("v2.listCostTagMetadataMetrics", false);
956+
put("v2.listCostTagMetadataMonths", false);
956957
put("v2.listCostTagMetadataOrchestrators", false);
957958
put("v2.searchCostRecommendations", false);
958959
put("v2.createDashboardSecureEmbed", false);
@@ -1086,10 +1087,6 @@ public class ApiClient {
10861087
put("v2.updateMonitorUserTemplate", false);
10871088
put("v2.validateExistingMonitorUserTemplate", false);
10881089
put("v2.validateMonitorUserTemplate", false);
1089-
put("v2.deleteScopesRestriction", false);
1090-
put("v2.getScopesRestriction", false);
1091-
put("v2.registerOAuthClient", false);
1092-
put("v2.upsertScopesRestriction", false);
10931090
put("v2.bulkUpdateOrgGroupMemberships", false);
10941091
put("v2.createOrgGroup", false);
10951092
put("v2.createOrgGroupPolicy", false);

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

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import com.datadog.api.client.v2.model.CostTagKeySourcesResponse;
4343
import com.datadog.api.client.v2.model.CostTagKeysResponse;
4444
import com.datadog.api.client.v2.model.CostTagMetadataDailyFilter;
45+
import com.datadog.api.client.v2.model.CostTagMetadataMonthsResponse;
4546
import com.datadog.api.client.v2.model.CostTagsResponse;
4647
import com.datadog.api.client.v2.model.CreateRulesetRequest;
4748
import com.datadog.api.client.v2.model.CustomCostsFileGetResponse;
@@ -7919,6 +7920,185 @@ public ApiResponse<CostMetricsResponse> listCostTagMetadataMetricsWithHttpInfo(
79197920
new GenericType<CostMetricsResponse>() {});
79207921
}
79217922

7923+
/**
7924+
* List Cloud Cost Management tag metadata months.
7925+
*
7926+
* <p>See {@link #listCostTagMetadataMonthsWithHttpInfo}.
7927+
*
7928+
* @param filterProvider Provider to scope the query to. Use the value of the <code>providername
7929+
* </code> tag in CCM (for example, <code>aws</code>, <code>azure</code>, <code>gcp</code>,
7930+
* <code>Oracle</code>, <code>Confluent Cloud</code>, <code>Snowflake</code>). For costs
7931+
* uploaded through the Custom Costs API, use <code>custom</code>. Values are case-sensitive.
7932+
* (required)
7933+
* @return CostTagMetadataMonthsResponse
7934+
* @throws ApiException if fails to make API call
7935+
*/
7936+
public CostTagMetadataMonthsResponse listCostTagMetadataMonths(String filterProvider)
7937+
throws ApiException {
7938+
return listCostTagMetadataMonthsWithHttpInfo(filterProvider).getData();
7939+
}
7940+
7941+
/**
7942+
* List Cloud Cost Management tag metadata months.
7943+
*
7944+
* <p>See {@link #listCostTagMetadataMonthsWithHttpInfoAsync}.
7945+
*
7946+
* @param filterProvider Provider to scope the query to. Use the value of the <code>providername
7947+
* </code> tag in CCM (for example, <code>aws</code>, <code>azure</code>, <code>gcp</code>,
7948+
* <code>Oracle</code>, <code>Confluent Cloud</code>, <code>Snowflake</code>). For costs
7949+
* uploaded through the Custom Costs API, use <code>custom</code>. Values are case-sensitive.
7950+
* (required)
7951+
* @return CompletableFuture&lt;CostTagMetadataMonthsResponse&gt;
7952+
*/
7953+
public CompletableFuture<CostTagMetadataMonthsResponse> listCostTagMetadataMonthsAsync(
7954+
String filterProvider) {
7955+
return listCostTagMetadataMonthsWithHttpInfoAsync(filterProvider)
7956+
.thenApply(
7957+
response -> {
7958+
return response.getData();
7959+
});
7960+
}
7961+
7962+
/**
7963+
* List months that have Cloud Cost Management tag metadata for a given provider, ordered
7964+
* most-recent first. The response is capped at 36 months.
7965+
*
7966+
* @param filterProvider Provider to scope the query to. Use the value of the <code>providername
7967+
* </code> tag in CCM (for example, <code>aws</code>, <code>azure</code>, <code>gcp</code>,
7968+
* <code>Oracle</code>, <code>Confluent Cloud</code>, <code>Snowflake</code>). For costs
7969+
* uploaded through the Custom Costs API, use <code>custom</code>. Values are case-sensitive.
7970+
* (required)
7971+
* @return ApiResponse&lt;CostTagMetadataMonthsResponse&gt;
7972+
* @throws ApiException if fails to make API call
7973+
* @http.response.details
7974+
* <table border="1">
7975+
* <caption>Response details</caption>
7976+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
7977+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
7978+
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
7979+
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
7980+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
7981+
* </table>
7982+
*/
7983+
public ApiResponse<CostTagMetadataMonthsResponse> listCostTagMetadataMonthsWithHttpInfo(
7984+
String filterProvider) throws ApiException {
7985+
// Check if unstable operation is enabled
7986+
String operationId = "listCostTagMetadataMonths";
7987+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
7988+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
7989+
} else {
7990+
throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
7991+
}
7992+
Object localVarPostBody = null;
7993+
7994+
// verify the required parameter 'filterProvider' is set
7995+
if (filterProvider == null) {
7996+
throw new ApiException(
7997+
400,
7998+
"Missing the required parameter 'filterProvider' when calling listCostTagMetadataMonths");
7999+
}
8000+
// create path and map variables
8001+
String localVarPath = "/api/v2/cost/tag_metadata/months";
8002+
8003+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
8004+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
8005+
8006+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[provider]", filterProvider));
8007+
8008+
Invocation.Builder builder =
8009+
apiClient.createBuilder(
8010+
"v2.CloudCostManagementApi.listCostTagMetadataMonths",
8011+
localVarPath,
8012+
localVarQueryParams,
8013+
localVarHeaderParams,
8014+
new HashMap<String, String>(),
8015+
new String[] {"application/json"},
8016+
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
8017+
return apiClient.invokeAPI(
8018+
"GET",
8019+
builder,
8020+
localVarHeaderParams,
8021+
new String[] {},
8022+
localVarPostBody,
8023+
new HashMap<String, Object>(),
8024+
false,
8025+
new GenericType<CostTagMetadataMonthsResponse>() {});
8026+
}
8027+
8028+
/**
8029+
* List Cloud Cost Management tag metadata months.
8030+
*
8031+
* <p>See {@link #listCostTagMetadataMonthsWithHttpInfo}.
8032+
*
8033+
* @param filterProvider Provider to scope the query to. Use the value of the <code>providername
8034+
* </code> tag in CCM (for example, <code>aws</code>, <code>azure</code>, <code>gcp</code>,
8035+
* <code>Oracle</code>, <code>Confluent Cloud</code>, <code>Snowflake</code>). For costs
8036+
* uploaded through the Custom Costs API, use <code>custom</code>. Values are case-sensitive.
8037+
* (required)
8038+
* @return CompletableFuture&lt;ApiResponse&lt;CostTagMetadataMonthsResponse&gt;&gt;
8039+
*/
8040+
public CompletableFuture<ApiResponse<CostTagMetadataMonthsResponse>>
8041+
listCostTagMetadataMonthsWithHttpInfoAsync(String filterProvider) {
8042+
// Check if unstable operation is enabled
8043+
String operationId = "listCostTagMetadataMonths";
8044+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
8045+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
8046+
} else {
8047+
CompletableFuture<ApiResponse<CostTagMetadataMonthsResponse>> result =
8048+
new CompletableFuture<>();
8049+
result.completeExceptionally(
8050+
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
8051+
return result;
8052+
}
8053+
Object localVarPostBody = null;
8054+
8055+
// verify the required parameter 'filterProvider' is set
8056+
if (filterProvider == null) {
8057+
CompletableFuture<ApiResponse<CostTagMetadataMonthsResponse>> result =
8058+
new CompletableFuture<>();
8059+
result.completeExceptionally(
8060+
new ApiException(
8061+
400,
8062+
"Missing the required parameter 'filterProvider' when calling"
8063+
+ " listCostTagMetadataMonths"));
8064+
return result;
8065+
}
8066+
// create path and map variables
8067+
String localVarPath = "/api/v2/cost/tag_metadata/months";
8068+
8069+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
8070+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
8071+
8072+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[provider]", filterProvider));
8073+
8074+
Invocation.Builder builder;
8075+
try {
8076+
builder =
8077+
apiClient.createBuilder(
8078+
"v2.CloudCostManagementApi.listCostTagMetadataMonths",
8079+
localVarPath,
8080+
localVarQueryParams,
8081+
localVarHeaderParams,
8082+
new HashMap<String, String>(),
8083+
new String[] {"application/json"},
8084+
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
8085+
} catch (ApiException ex) {
8086+
CompletableFuture<ApiResponse<CostTagMetadataMonthsResponse>> result =
8087+
new CompletableFuture<>();
8088+
result.completeExceptionally(ex);
8089+
return result;
8090+
}
8091+
return apiClient.invokeAPIAsync(
8092+
"GET",
8093+
builder,
8094+
localVarHeaderParams,
8095+
new String[] {},
8096+
localVarPostBody,
8097+
new HashMap<String, Object>(),
8098+
false,
8099+
new GenericType<CostTagMetadataMonthsResponse>() {});
8100+
}
8101+
79228102
/** Manage optional parameters to listCostTagMetadataOrchestrators. */
79238103
public static class ListCostTagMetadataOrchestratorsOptionalParameters {
79248104
private String filterProvider;

0 commit comments

Comments
 (0)