Skip to content

Commit 5452711

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

27 files changed

Lines changed: 3719 additions & 410 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 531 additions & 101 deletions
Large diffs are not rendered by default.

examples/v2/cloud-cost-management/ListCostTagMetadataMonths.java

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Delete an OAuth2 client scopes restriction returns "No Content" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.OAuth2ClientPublicApi;
6+
import java.util.UUID;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
defaultClient.setUnstableOperationEnabled("v2.deleteScopesRestriction", true);
12+
OAuth2ClientPublicApi apiInstance = new OAuth2ClientPublicApi(defaultClient);
13+
14+
try {
15+
apiInstance.deleteScopesRestriction(UUID.fromString("fafa8e1c-36a5-11f0-a83d-da7ad0900001"));
16+
} catch (ApiException e) {
17+
System.err.println("Exception when calling OAuth2ClientPublicApi#deleteScopesRestriction");
18+
System.err.println("Status code: " + e.getCode());
19+
System.err.println("Reason: " + e.getResponseBody());
20+
System.err.println("Response headers: " + e.getResponseHeaders());
21+
e.printStackTrace();
22+
}
23+
}
24+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Get an OAuth2 client scopes restriction 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.OAuth2ClientPublicApi;
6+
import com.datadog.api.client.v2.model.OAuthScopesRestrictionResponse;
7+
import java.util.UUID;
8+
9+
public class Example {
10+
public static void main(String[] args) {
11+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
12+
defaultClient.setUnstableOperationEnabled("v2.getScopesRestriction", true);
13+
OAuth2ClientPublicApi apiInstance = new OAuth2ClientPublicApi(defaultClient);
14+
15+
try {
16+
OAuthScopesRestrictionResponse result =
17+
apiInstance.getScopesRestriction(UUID.fromString("fafa8e1c-36a5-11f0-a83d-da7ad0900001"));
18+
System.out.println(result);
19+
} catch (ApiException e) {
20+
System.err.println("Exception when calling OAuth2ClientPublicApi#getScopesRestriction");
21+
System.err.println("Status code: " + e.getCode());
22+
System.err.println("Reason: " + e.getResponseBody());
23+
System.err.println("Response headers: " + e.getResponseHeaders());
24+
e.printStackTrace();
25+
}
26+
}
27+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Register an OAuth2 client returns "Created" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.OAuth2ClientPublicApi;
6+
import com.datadog.api.client.v2.model.OAuthClientRegistrationGrantType;
7+
import com.datadog.api.client.v2.model.OAuthClientRegistrationRequest;
8+
import com.datadog.api.client.v2.model.OAuthClientRegistrationResponse;
9+
import com.datadog.api.client.v2.model.OAuthClientRegistrationResponseType;
10+
import java.util.Arrays;
11+
import java.util.Collections;
12+
13+
public class Example {
14+
public static void main(String[] args) {
15+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
16+
defaultClient.setUnstableOperationEnabled("v2.registerOAuthClient", true);
17+
OAuth2ClientPublicApi apiInstance = new OAuth2ClientPublicApi(defaultClient);
18+
19+
OAuthClientRegistrationRequest body =
20+
new OAuthClientRegistrationRequest()
21+
.clientName("Example MCP Client")
22+
.clientUri("https://example.com")
23+
.grantTypes(
24+
Arrays.asList(
25+
OAuthClientRegistrationGrantType.AUTHORIZATION_CODE,
26+
OAuthClientRegistrationGrantType.REFRESH_TOKEN))
27+
.jwksUri("https://example.com/.well-known/jwks.json")
28+
.logoUri("https://example.com/logo.png")
29+
.policyUri("https://example.com/privacy")
30+
.redirectUris(Collections.singletonList("https://example.com/oauth/callback"))
31+
.responseTypes(Collections.singletonList(OAuthClientRegistrationResponseType.CODE))
32+
.scope("openid profile")
33+
.tokenEndpointAuthMethod("none")
34+
.tosUri("https://example.com/tos");
35+
36+
try {
37+
OAuthClientRegistrationResponse result = apiInstance.registerOAuthClient(body);
38+
System.out.println(result);
39+
} catch (ApiException e) {
40+
System.err.println("Exception when calling OAuth2ClientPublicApi#registerOAuthClient");
41+
System.err.println("Status code: " + e.getCode());
42+
System.err.println("Reason: " + e.getResponseBody());
43+
System.err.println("Response headers: " + e.getResponseHeaders());
44+
e.printStackTrace();
45+
}
46+
}
47+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Upsert an OAuth2 client scopes restriction 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.OAuth2ClientPublicApi;
6+
import com.datadog.api.client.v2.model.OAuthOidcScope;
7+
import com.datadog.api.client.v2.model.OAuthScopesRestrictionResponse;
8+
import com.datadog.api.client.v2.model.UpsertOAuthScopesRestrictionData;
9+
import com.datadog.api.client.v2.model.UpsertOAuthScopesRestrictionDataAttributes;
10+
import com.datadog.api.client.v2.model.UpsertOAuthScopesRestrictionRequest;
11+
import com.datadog.api.client.v2.model.UpsertOAuthScopesRestrictionType;
12+
import java.util.Arrays;
13+
import java.util.UUID;
14+
15+
public class Example {
16+
public static void main(String[] args) {
17+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
18+
defaultClient.setUnstableOperationEnabled("v2.upsertScopesRestriction", true);
19+
OAuth2ClientPublicApi apiInstance = new OAuth2ClientPublicApi(defaultClient);
20+
21+
UpsertOAuthScopesRestrictionRequest body =
22+
new UpsertOAuthScopesRestrictionRequest()
23+
.data(
24+
new UpsertOAuthScopesRestrictionData()
25+
.attributes(
26+
new UpsertOAuthScopesRestrictionDataAttributes()
27+
.oidcScopes(Arrays.asList(OAuthOidcScope.OPENID, OAuthOidcScope.EMAIL))
28+
.permissionScopes(Arrays.asList("dashboards_read", "metrics_read")))
29+
.type(UpsertOAuthScopesRestrictionType.UPSERT_SCOPES_RESTRICTION));
30+
31+
try {
32+
OAuthScopesRestrictionResponse result =
33+
apiInstance.upsertScopesRestriction(
34+
UUID.fromString("fafa8e1c-36a5-11f0-a83d-da7ad0900001"), body);
35+
System.out.println(result);
36+
} catch (ApiException e) {
37+
System.err.println("Exception when calling OAuth2ClientPublicApi#upsertScopesRestriction");
38+
System.err.println("Status code: " + e.getCode());
39+
System.err.println("Reason: " + e.getResponseBody());
40+
System.err.println("Response headers: " + e.getResponseHeaders());
41+
e.printStackTrace();
42+
}
43+
}
44+
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,6 @@ public class ApiClient {
953953
put("v2.listCostTagKeySources", false);
954954
put("v2.listCostTagMetadata", false);
955955
put("v2.listCostTagMetadataMetrics", false);
956-
put("v2.listCostTagMetadataMonths", false);
957956
put("v2.listCostTagMetadataOrchestrators", false);
958957
put("v2.searchCostRecommendations", false);
959958
put("v2.createDashboardSecureEmbed", false);
@@ -1087,6 +1086,10 @@ public class ApiClient {
10871086
put("v2.updateMonitorUserTemplate", false);
10881087
put("v2.validateExistingMonitorUserTemplate", false);
10891088
put("v2.validateMonitorUserTemplate", false);
1089+
put("v2.deleteScopesRestriction", false);
1090+
put("v2.getScopesRestriction", false);
1091+
put("v2.registerOAuthClient", false);
1092+
put("v2.upsertScopesRestriction", false);
10901093
put("v2.bulkUpdateOrgGroupMemberships", false);
10911094
put("v2.createOrgGroup", false);
10921095
put("v2.createOrgGroupPolicy", false);

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

Lines changed: 0 additions & 180 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
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;
4645
import com.datadog.api.client.v2.model.CostTagsResponse;
4746
import com.datadog.api.client.v2.model.CreateRulesetRequest;
4847
import com.datadog.api.client.v2.model.CustomCostsFileGetResponse;
@@ -7920,185 +7919,6 @@ public ApiResponse<CostMetricsResponse> listCostTagMetadataMetricsWithHttpInfo(
79207919
new GenericType<CostMetricsResponse>() {});
79217920
}
79227921

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-
81027922
/** Manage optional parameters to listCostTagMetadataOrchestrators. */
81037923
public static class ListCostTagMetadataOrchestratorsOptionalParameters {
81047924
private String filterProvider;

0 commit comments

Comments
 (0)