Skip to content

Commit e7c2215

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit ac59ff6 of spec repo
1 parent 4d864a9 commit e7c2215

20 files changed

Lines changed: 993 additions & 106 deletions

.generator/schemas/v1/openapi.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -791,11 +791,6 @@ components:
791791
items:
792792
$ref: "#/components/schemas/ResourceProviderConfig"
793793
type: array
794-
secretless_auth_enabled:
795-
description: |-
796-
(Preview) When enabled, Datadog authenticates with this app registration using federated workload identity credentials instead of a client secret.
797-
example: true
798-
type: boolean
799794
tenant_name:
800795
description: Your Azure Active Directory ID.
801796
example: "testc44-1234-5678-9101-cc00736ftest"

.generator/schemas/v2/openapi.yaml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81822,6 +81822,61 @@ components:
8182281822
description: The title of the event.
8182381823
example: "The event title"
8182481824
type: string
81825+
ValidateV2Attributes:
81826+
description: Attributes of the API key validation response.
81827+
properties:
81828+
api_key_id:
81829+
description: The UUID of the API key.
81830+
example: "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6"
81831+
type: string
81832+
api_key_scopes:
81833+
description: List of scope names associated with the API key.
81834+
example:
81835+
- "remote_config_read"
81836+
items:
81837+
type: string
81838+
type: array
81839+
valid:
81840+
description: Whether the API key is valid.
81841+
example: true
81842+
type: boolean
81843+
required:
81844+
- valid
81845+
- api_key_scopes
81846+
- api_key_id
81847+
type: object
81848+
ValidateV2Data:
81849+
description: Data object containing the API key validation result.
81850+
properties:
81851+
attributes:
81852+
$ref: "#/components/schemas/ValidateV2Attributes"
81853+
id:
81854+
description: The UUID of the organization associated with the API key.
81855+
example: "550e8400-e29b-41d4-a716-446655440000"
81856+
type: string
81857+
type:
81858+
$ref: "#/components/schemas/ValidateV2Type"
81859+
required:
81860+
- id
81861+
- type
81862+
- attributes
81863+
type: object
81864+
ValidateV2Response:
81865+
description: Response for the API key validation endpoint.
81866+
properties:
81867+
data:
81868+
$ref: "#/components/schemas/ValidateV2Data"
81869+
required:
81870+
- data
81871+
type: object
81872+
ValidateV2Type:
81873+
description: Resource type for the API key validation response.
81874+
enum:
81875+
- validate_v2
81876+
example: validate_v2
81877+
type: string
81878+
x-enum-varnames:
81879+
- ValidateV2
8182581880
ValidationError:
8182681881
description: Represents a single validation error, including a human-readable title and metadata.
8182781882
properties:
@@ -134478,6 +134533,47 @@ paths:
134478134533
operator: OR
134479134534
permissions:
134480134535
- teams_read
134536+
/api/v2/validate:
134537+
get:
134538+
description: Check if the API key is valid. Returns the organization UUID, API key ID, and associated scopes.
134539+
operationId: ValidateV2
134540+
responses:
134541+
"200":
134542+
content:
134543+
application/json:
134544+
examples:
134545+
default:
134546+
value:
134547+
data:
134548+
attributes:
134549+
api_key_id: "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6"
134550+
api_key_scopes:
134551+
- "remote_config_read"
134552+
valid: true
134553+
id: "550e8400-e29b-41d4-a716-446655440000"
134554+
type: "validate_v2"
134555+
schema:
134556+
$ref: "#/components/schemas/ValidateV2Response"
134557+
description: OK
134558+
"403":
134559+
content:
134560+
application/json:
134561+
schema:
134562+
$ref: "#/components/schemas/JSONAPIErrorResponse"
134563+
description: Forbidden
134564+
"429":
134565+
$ref: "#/components/responses/TooManyRequestsResponse"
134566+
security:
134567+
- apiKeyAuth: []
134568+
summary: Validate API key
134569+
tags:
134570+
- Key Management
134571+
"x-permission":
134572+
operator: OPEN
134573+
permissions: []
134574+
x-unstable: |-
134575+
**Note**: This endpoint is in preview and is subject to change.
134576+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
134481134577
/api/v2/widgets/{experience_type}:
134482134578
get:
134483134579
description: Search and list widgets for a given experience type. Supports filtering by widget type, creator, title, and tags, as well as sorting and pagination.

examples/v1/azure-integration/UpdateAzureHostFilters.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public static void main(String[] args) {
3333
new ResourceProviderConfig()
3434
.metricsEnabled(true)
3535
.namespace("Microsoft.Compute")))
36-
.secretlessAuthEnabled(true)
3736
.tenantName("testc44-1234-5678-9101-cc00736ftest")
3837
.usageMetricsEnabled(true);
3938

examples/v1/azure-integration/UpdateAzureIntegration.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public static void main(String[] args) {
2525
.newClientId("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d")
2626
.newTenantName("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d")
2727
.resourceCollectionEnabled(true)
28-
.secretlessAuthEnabled(true)
2928
.tenantName("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d");
3029

3130
try {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Validate API key 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.KeyManagementApi;
6+
import com.datadog.api.client.v2.model.ValidateV2Response;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
defaultClient.setUnstableOperationEnabled("v2.validateV2", true);
12+
KeyManagementApi apiInstance = new KeyManagementApi(defaultClient);
13+
14+
try {
15+
ValidateV2Response result = apiInstance.validateV2();
16+
System.out.println(result);
17+
} catch (ApiException e) {
18+
System.err.println("Exception when calling KeyManagementApi#validateV2");
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+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,7 @@ public class ApiClient {
803803
put("v2.updateLLMObsExperiment", false);
804804
put("v2.updateLLMObsProject", false);
805805
put("v2.anonymizeUsers", false);
806+
put("v2.validateV2", false);
806807
put("v2.createOpenAPI", false);
807808
put("v2.deleteOpenAPI", false);
808809
put("v2.getOpenAPI", false);

src/main/java/com/datadog/api/client/v1/model/AzureAccount.java

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
AzureAccount.JSON_PROPERTY_NEW_TENANT_NAME,
3636
AzureAccount.JSON_PROPERTY_RESOURCE_COLLECTION_ENABLED,
3737
AzureAccount.JSON_PROPERTY_RESOURCE_PROVIDER_CONFIGS,
38-
AzureAccount.JSON_PROPERTY_SECRETLESS_AUTH_ENABLED,
3938
AzureAccount.JSON_PROPERTY_TENANT_NAME,
4039
AzureAccount.JSON_PROPERTY_USAGE_METRICS_ENABLED
4140
})
@@ -89,9 +88,6 @@ public class AzureAccount {
8988
public static final String JSON_PROPERTY_RESOURCE_PROVIDER_CONFIGS = "resource_provider_configs";
9089
private List<ResourceProviderConfig> resourceProviderConfigs = null;
9190

92-
public static final String JSON_PROPERTY_SECRETLESS_AUTH_ENABLED = "secretless_auth_enabled";
93-
private Boolean secretlessAuthEnabled;
94-
9591
public static final String JSON_PROPERTY_TENANT_NAME = "tenant_name";
9692
private String tenantName;
9793

@@ -442,28 +438,6 @@ public void setResourceProviderConfigs(List<ResourceProviderConfig> resourceProv
442438
this.resourceProviderConfigs = resourceProviderConfigs;
443439
}
444440

445-
public AzureAccount secretlessAuthEnabled(Boolean secretlessAuthEnabled) {
446-
this.secretlessAuthEnabled = secretlessAuthEnabled;
447-
return this;
448-
}
449-
450-
/**
451-
* (Preview) When enabled, Datadog authenticates with this app registration using federated
452-
* workload identity credentials instead of a client secret.
453-
*
454-
* @return secretlessAuthEnabled
455-
*/
456-
@jakarta.annotation.Nullable
457-
@JsonProperty(JSON_PROPERTY_SECRETLESS_AUTH_ENABLED)
458-
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
459-
public Boolean getSecretlessAuthEnabled() {
460-
return secretlessAuthEnabled;
461-
}
462-
463-
public void setSecretlessAuthEnabled(Boolean secretlessAuthEnabled) {
464-
this.secretlessAuthEnabled = secretlessAuthEnabled;
465-
}
466-
467441
public AzureAccount tenantName(String tenantName) {
468442
this.tenantName = tenantName;
469443
return this;
@@ -577,7 +551,6 @@ public boolean equals(Object o) {
577551
&& Objects.equals(this.newTenantName, azureAccount.newTenantName)
578552
&& Objects.equals(this.resourceCollectionEnabled, azureAccount.resourceCollectionEnabled)
579553
&& Objects.equals(this.resourceProviderConfigs, azureAccount.resourceProviderConfigs)
580-
&& Objects.equals(this.secretlessAuthEnabled, azureAccount.secretlessAuthEnabled)
581554
&& Objects.equals(this.tenantName, azureAccount.tenantName)
582555
&& Objects.equals(this.usageMetricsEnabled, azureAccount.usageMetricsEnabled)
583556
&& Objects.equals(this.additionalProperties, azureAccount.additionalProperties);
@@ -601,7 +574,6 @@ public int hashCode() {
601574
newTenantName,
602575
resourceCollectionEnabled,
603576
resourceProviderConfigs,
604-
secretlessAuthEnabled,
605577
tenantName,
606578
usageMetricsEnabled,
607579
additionalProperties);
@@ -638,9 +610,6 @@ public String toString() {
638610
sb.append(" resourceProviderConfigs: ")
639611
.append(toIndentedString(resourceProviderConfigs))
640612
.append("\n");
641-
sb.append(" secretlessAuthEnabled: ")
642-
.append(toIndentedString(secretlessAuthEnabled))
643-
.append("\n");
644613
sb.append(" tenantName: ").append(toIndentedString(tenantName)).append("\n");
645614
sb.append(" usageMetricsEnabled: ")
646615
.append(toIndentedString(usageMetricsEnabled))

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

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.datadog.api.client.v2.model.PersonalAccessTokenResponse;
2121
import com.datadog.api.client.v2.model.PersonalAccessTokenUpdateRequest;
2222
import com.datadog.api.client.v2.model.PersonalAccessTokensSort;
23+
import com.datadog.api.client.v2.model.ValidateV2Response;
2324
import jakarta.ws.rs.client.Invocation;
2425
import jakarta.ws.rs.core.GenericType;
2526
import java.util.ArrayList;
@@ -3464,4 +3465,131 @@ public ApiResponse<PersonalAccessTokenResponse> updatePersonalAccessTokenWithHtt
34643465
false,
34653466
new GenericType<PersonalAccessTokenResponse>() {});
34663467
}
3468+
3469+
/**
3470+
* Validate API key.
3471+
*
3472+
* <p>See {@link #validateV2WithHttpInfo}.
3473+
*
3474+
* @return ValidateV2Response
3475+
* @throws ApiException if fails to make API call
3476+
*/
3477+
public ValidateV2Response validateV2() throws ApiException {
3478+
return validateV2WithHttpInfo().getData();
3479+
}
3480+
3481+
/**
3482+
* Validate API key.
3483+
*
3484+
* <p>See {@link #validateV2WithHttpInfoAsync}.
3485+
*
3486+
* @return CompletableFuture&lt;ValidateV2Response&gt;
3487+
*/
3488+
public CompletableFuture<ValidateV2Response> validateV2Async() {
3489+
return validateV2WithHttpInfoAsync()
3490+
.thenApply(
3491+
response -> {
3492+
return response.getData();
3493+
});
3494+
}
3495+
3496+
/**
3497+
* Check if the API key is valid. Returns the organization UUID, API key ID, and associated
3498+
* scopes.
3499+
*
3500+
* @return ApiResponse&lt;ValidateV2Response&gt;
3501+
* @throws ApiException if fails to make API call
3502+
* @http.response.details
3503+
* <table border="1">
3504+
* <caption>Response details</caption>
3505+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
3506+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
3507+
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
3508+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
3509+
* </table>
3510+
*/
3511+
public ApiResponse<ValidateV2Response> validateV2WithHttpInfo() throws ApiException {
3512+
// Check if unstable operation is enabled
3513+
String operationId = "validateV2";
3514+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
3515+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
3516+
} else {
3517+
throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
3518+
}
3519+
Object localVarPostBody = null;
3520+
// create path and map variables
3521+
String localVarPath = "/api/v2/validate";
3522+
3523+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
3524+
3525+
Invocation.Builder builder =
3526+
apiClient.createBuilder(
3527+
"v2.KeyManagementApi.validateV2",
3528+
localVarPath,
3529+
new ArrayList<Pair>(),
3530+
localVarHeaderParams,
3531+
new HashMap<String, String>(),
3532+
new String[] {"application/json"},
3533+
new String[] {"apiKeyAuth"});
3534+
return apiClient.invokeAPI(
3535+
"GET",
3536+
builder,
3537+
localVarHeaderParams,
3538+
new String[] {},
3539+
localVarPostBody,
3540+
new HashMap<String, Object>(),
3541+
false,
3542+
new GenericType<ValidateV2Response>() {});
3543+
}
3544+
3545+
/**
3546+
* Validate API key.
3547+
*
3548+
* <p>See {@link #validateV2WithHttpInfo}.
3549+
*
3550+
* @return CompletableFuture&lt;ApiResponse&lt;ValidateV2Response&gt;&gt;
3551+
*/
3552+
public CompletableFuture<ApiResponse<ValidateV2Response>> validateV2WithHttpInfoAsync() {
3553+
// Check if unstable operation is enabled
3554+
String operationId = "validateV2";
3555+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
3556+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
3557+
} else {
3558+
CompletableFuture<ApiResponse<ValidateV2Response>> result = new CompletableFuture<>();
3559+
result.completeExceptionally(
3560+
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
3561+
return result;
3562+
}
3563+
Object localVarPostBody = null;
3564+
// create path and map variables
3565+
String localVarPath = "/api/v2/validate";
3566+
3567+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
3568+
3569+
Invocation.Builder builder;
3570+
try {
3571+
builder =
3572+
apiClient.createBuilder(
3573+
"v2.KeyManagementApi.validateV2",
3574+
localVarPath,
3575+
new ArrayList<Pair>(),
3576+
localVarHeaderParams,
3577+
new HashMap<String, String>(),
3578+
new String[] {"application/json"},
3579+
new String[] {"apiKeyAuth"});
3580+
} catch (ApiException ex) {
3581+
CompletableFuture<ApiResponse<ValidateV2Response>> result = new CompletableFuture<>();
3582+
result.completeExceptionally(ex);
3583+
return result;
3584+
}
3585+
return apiClient.invokeAPIAsync(
3586+
"GET",
3587+
builder,
3588+
localVarHeaderParams,
3589+
new String[] {},
3590+
localVarPostBody,
3591+
new HashMap<String, Object>(),
3592+
false,
3593+
new GenericType<ValidateV2Response>() {});
3594+
}
34673595
}

0 commit comments

Comments
 (0)