Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
632 changes: 531 additions & 101 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

This file was deleted.

24 changes: 24 additions & 0 deletions examples/v2/oauth2-client-public/DeleteScopesRestriction.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Delete an OAuth2 client scopes restriction returns "No Content" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OAuth2ClientPublicApi;
import java.util.UUID;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.deleteScopesRestriction", true);
OAuth2ClientPublicApi apiInstance = new OAuth2ClientPublicApi(defaultClient);

try {
apiInstance.deleteScopesRestriction(UUID.fromString("fafa8e1c-36a5-11f0-a83d-da7ad0900001"));
} catch (ApiException e) {
System.err.println("Exception when calling OAuth2ClientPublicApi#deleteScopesRestriction");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
27 changes: 27 additions & 0 deletions examples/v2/oauth2-client-public/GetScopesRestriction.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Get an OAuth2 client scopes restriction returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OAuth2ClientPublicApi;
import com.datadog.api.client.v2.model.OAuthScopesRestrictionResponse;
import java.util.UUID;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.getScopesRestriction", true);
OAuth2ClientPublicApi apiInstance = new OAuth2ClientPublicApi(defaultClient);

try {
OAuthScopesRestrictionResponse result =
apiInstance.getScopesRestriction(UUID.fromString("fafa8e1c-36a5-11f0-a83d-da7ad0900001"));
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling OAuth2ClientPublicApi#getScopesRestriction");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
47 changes: 47 additions & 0 deletions examples/v2/oauth2-client-public/RegisterOAuthClient.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Register an OAuth2 client returns "Created" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OAuth2ClientPublicApi;
import com.datadog.api.client.v2.model.OAuthClientRegistrationGrantType;
import com.datadog.api.client.v2.model.OAuthClientRegistrationRequest;
import com.datadog.api.client.v2.model.OAuthClientRegistrationResponse;
import com.datadog.api.client.v2.model.OAuthClientRegistrationResponseType;
import java.util.Arrays;
import java.util.Collections;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.registerOAuthClient", true);
OAuth2ClientPublicApi apiInstance = new OAuth2ClientPublicApi(defaultClient);

OAuthClientRegistrationRequest body =
new OAuthClientRegistrationRequest()
.clientName("Example MCP Client")
.clientUri("https://example.com")
.grantTypes(
Arrays.asList(
OAuthClientRegistrationGrantType.AUTHORIZATION_CODE,
OAuthClientRegistrationGrantType.REFRESH_TOKEN))
.jwksUri("https://example.com/.well-known/jwks.json")
.logoUri("https://example.com/logo.png")
.policyUri("https://example.com/privacy")
.redirectUris(Collections.singletonList("https://example.com/oauth/callback"))
.responseTypes(Collections.singletonList(OAuthClientRegistrationResponseType.CODE))
.scope("openid profile")
.tokenEndpointAuthMethod("none")
.tosUri("https://example.com/tos");

try {
OAuthClientRegistrationResponse result = apiInstance.registerOAuthClient(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling OAuth2ClientPublicApi#registerOAuthClient");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
44 changes: 44 additions & 0 deletions examples/v2/oauth2-client-public/UpsertScopesRestriction.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Upsert an OAuth2 client scopes restriction returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OAuth2ClientPublicApi;
import com.datadog.api.client.v2.model.OAuthOidcScope;
import com.datadog.api.client.v2.model.OAuthScopesRestrictionResponse;
import com.datadog.api.client.v2.model.UpsertOAuthScopesRestrictionData;
import com.datadog.api.client.v2.model.UpsertOAuthScopesRestrictionDataAttributes;
import com.datadog.api.client.v2.model.UpsertOAuthScopesRestrictionRequest;
import com.datadog.api.client.v2.model.UpsertOAuthScopesRestrictionType;
import java.util.Arrays;
import java.util.UUID;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.upsertScopesRestriction", true);
OAuth2ClientPublicApi apiInstance = new OAuth2ClientPublicApi(defaultClient);

UpsertOAuthScopesRestrictionRequest body =
new UpsertOAuthScopesRestrictionRequest()
.data(
new UpsertOAuthScopesRestrictionData()
.attributes(
new UpsertOAuthScopesRestrictionDataAttributes()
.oidcScopes(Arrays.asList(OAuthOidcScope.OPENID, OAuthOidcScope.EMAIL))
.permissionScopes(Arrays.asList("dashboards_read", "metrics_read")))
.type(UpsertOAuthScopesRestrictionType.UPSERT_SCOPES_RESTRICTION));

try {
OAuthScopesRestrictionResponse result =
apiInstance.upsertScopesRestriction(
UUID.fromString("fafa8e1c-36a5-11f0-a83d-da7ad0900001"), body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling OAuth2ClientPublicApi#upsertScopesRestriction");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
5 changes: 4 additions & 1 deletion src/main/java/com/datadog/api/client/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,6 @@ public class ApiClient {
put("v2.listCostTagKeySources", false);
put("v2.listCostTagMetadata", false);
put("v2.listCostTagMetadataMetrics", false);
put("v2.listCostTagMetadataMonths", false);
put("v2.listCostTagMetadataOrchestrators", false);
put("v2.searchCostRecommendations", false);
put("v2.createDashboardSecureEmbed", false);
Expand Down Expand Up @@ -1087,6 +1086,10 @@ public class ApiClient {
put("v2.updateMonitorUserTemplate", false);
put("v2.validateExistingMonitorUserTemplate", false);
put("v2.validateMonitorUserTemplate", false);
put("v2.deleteScopesRestriction", false);
put("v2.getScopesRestriction", false);
put("v2.registerOAuthClient", false);
put("v2.upsertScopesRestriction", false);
put("v2.bulkUpdateOrgGroupMemberships", false);
put("v2.createOrgGroup", false);
put("v2.createOrgGroupPolicy", false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import com.datadog.api.client.v2.model.CostTagKeySourcesResponse;
import com.datadog.api.client.v2.model.CostTagKeysResponse;
import com.datadog.api.client.v2.model.CostTagMetadataDailyFilter;
import com.datadog.api.client.v2.model.CostTagMetadataMonthsResponse;
import com.datadog.api.client.v2.model.CostTagsResponse;
import com.datadog.api.client.v2.model.CreateRulesetRequest;
import com.datadog.api.client.v2.model.CustomCostsFileGetResponse;
Expand Down Expand Up @@ -7920,185 +7919,6 @@ public ApiResponse<CostMetricsResponse> listCostTagMetadataMetricsWithHttpInfo(
new GenericType<CostMetricsResponse>() {});
}

/**
* List Cloud Cost Management tag metadata months.
*
* <p>See {@link #listCostTagMetadataMonthsWithHttpInfo}.
*
* @param filterProvider Provider to scope the query to. Use the value of the <code>providername
* </code> tag in CCM (for example, <code>aws</code>, <code>azure</code>, <code>gcp</code>,
* <code>Oracle</code>, <code>Confluent Cloud</code>, <code>Snowflake</code>). For costs
* uploaded through the Custom Costs API, use <code>custom</code>. Values are case-sensitive.
* (required)
* @return CostTagMetadataMonthsResponse
* @throws ApiException if fails to make API call
*/
public CostTagMetadataMonthsResponse listCostTagMetadataMonths(String filterProvider)
throws ApiException {
return listCostTagMetadataMonthsWithHttpInfo(filterProvider).getData();
}

/**
* List Cloud Cost Management tag metadata months.
*
* <p>See {@link #listCostTagMetadataMonthsWithHttpInfoAsync}.
*
* @param filterProvider Provider to scope the query to. Use the value of the <code>providername
* </code> tag in CCM (for example, <code>aws</code>, <code>azure</code>, <code>gcp</code>,
* <code>Oracle</code>, <code>Confluent Cloud</code>, <code>Snowflake</code>). For costs
* uploaded through the Custom Costs API, use <code>custom</code>. Values are case-sensitive.
* (required)
* @return CompletableFuture&lt;CostTagMetadataMonthsResponse&gt;
*/
public CompletableFuture<CostTagMetadataMonthsResponse> listCostTagMetadataMonthsAsync(
String filterProvider) {
return listCostTagMetadataMonthsWithHttpInfoAsync(filterProvider)
.thenApply(
response -> {
return response.getData();
});
}

/**
* List months that have Cloud Cost Management tag metadata for a given provider, ordered
* most-recent first. The response is capped at 36 months.
*
* @param filterProvider Provider to scope the query to. Use the value of the <code>providername
* </code> tag in CCM (for example, <code>aws</code>, <code>azure</code>, <code>gcp</code>,
* <code>Oracle</code>, <code>Confluent Cloud</code>, <code>Snowflake</code>). For costs
* uploaded through the Custom Costs API, use <code>custom</code>. Values are case-sensitive.
* (required)
* @return ApiResponse&lt;CostTagMetadataMonthsResponse&gt;
* @throws ApiException if fails to make API call
* @http.response.details
* <table border="1">
* <caption>Response details</caption>
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
* </table>
*/
public ApiResponse<CostTagMetadataMonthsResponse> listCostTagMetadataMonthsWithHttpInfo(
String filterProvider) throws ApiException {
// Check if unstable operation is enabled
String operationId = "listCostTagMetadataMonths";
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
} else {
throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
}
Object localVarPostBody = null;

// verify the required parameter 'filterProvider' is set
if (filterProvider == null) {
throw new ApiException(
400,
"Missing the required parameter 'filterProvider' when calling listCostTagMetadataMonths");
}
// create path and map variables
String localVarPath = "/api/v2/cost/tag_metadata/months";

List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();

localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[provider]", filterProvider));

Invocation.Builder builder =
apiClient.createBuilder(
"v2.CloudCostManagementApi.listCostTagMetadataMonths",
localVarPath,
localVarQueryParams,
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
return apiClient.invokeAPI(
"GET",
builder,
localVarHeaderParams,
new String[] {},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<CostTagMetadataMonthsResponse>() {});
}

/**
* List Cloud Cost Management tag metadata months.
*
* <p>See {@link #listCostTagMetadataMonthsWithHttpInfo}.
*
* @param filterProvider Provider to scope the query to. Use the value of the <code>providername
* </code> tag in CCM (for example, <code>aws</code>, <code>azure</code>, <code>gcp</code>,
* <code>Oracle</code>, <code>Confluent Cloud</code>, <code>Snowflake</code>). For costs
* uploaded through the Custom Costs API, use <code>custom</code>. Values are case-sensitive.
* (required)
* @return CompletableFuture&lt;ApiResponse&lt;CostTagMetadataMonthsResponse&gt;&gt;
*/
public CompletableFuture<ApiResponse<CostTagMetadataMonthsResponse>>
listCostTagMetadataMonthsWithHttpInfoAsync(String filterProvider) {
// Check if unstable operation is enabled
String operationId = "listCostTagMetadataMonths";
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
} else {
CompletableFuture<ApiResponse<CostTagMetadataMonthsResponse>> result =
new CompletableFuture<>();
result.completeExceptionally(
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
return result;
}
Object localVarPostBody = null;

// verify the required parameter 'filterProvider' is set
if (filterProvider == null) {
CompletableFuture<ApiResponse<CostTagMetadataMonthsResponse>> result =
new CompletableFuture<>();
result.completeExceptionally(
new ApiException(
400,
"Missing the required parameter 'filterProvider' when calling"
+ " listCostTagMetadataMonths"));
return result;
}
// create path and map variables
String localVarPath = "/api/v2/cost/tag_metadata/months";

List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();

localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[provider]", filterProvider));

Invocation.Builder builder;
try {
builder =
apiClient.createBuilder(
"v2.CloudCostManagementApi.listCostTagMetadataMonths",
localVarPath,
localVarQueryParams,
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
} catch (ApiException ex) {
CompletableFuture<ApiResponse<CostTagMetadataMonthsResponse>> result =
new CompletableFuture<>();
result.completeExceptionally(ex);
return result;
}
return apiClient.invokeAPIAsync(
"GET",
builder,
localVarHeaderParams,
new String[] {},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<CostTagMetadataMonthsResponse>() {});
}

/** Manage optional parameters to listCostTagMetadataOrchestrators. */
public static class ListCostTagMetadataOrchestratorsOptionalParameters {
private String filterProvider;
Expand Down
Loading
Loading