From 44838928b017502e938853ea00922fec9dcefb53 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 12 May 2026 21:01:05 +0000 Subject: [PATCH] Regenerate client from commit 551b996 of spec repo --- .generator/schemas/v1/openapi.yaml | 2 + .generator/schemas/v2/openapi.yaml | 154 ----------- examples/v2/key-management/Validate.java | 25 -- .../v2/key-management/ValidateAPIKey.java | 24 -- .../com/datadog/api/client/ApiClient.java | 1 - .../FormulaAndFunctionEventsDataSource.java | 5 +- .../api/client/v2/api/KeyManagementApi.java | 241 ------------------ .../v2/model/ValidateAPIKeyResponse.java | 149 ----------- .../client/v2/model/ValidateAPIKeyStatus.java | 57 ----- .../client/v2/model/ValidateV2Attributes.java | 209 --------------- .../api/client/v2/model/ValidateV2Data.java | 209 --------------- .../client/v2/model/ValidateV2Response.java | 145 ----------- .../api/client/v2/model/ValidateV2Type.java | 54 ---- .../api/client/v2/api/key_management.feature | 153 ++++------- .../com/datadog/api/client/v2/api/undo.json | 12 - 15 files changed, 53 insertions(+), 1387 deletions(-) delete mode 100644 examples/v2/key-management/Validate.java delete mode 100644 examples/v2/key-management/ValidateAPIKey.java delete mode 100644 src/main/java/com/datadog/api/client/v2/model/ValidateAPIKeyResponse.java delete mode 100644 src/main/java/com/datadog/api/client/v2/model/ValidateAPIKeyStatus.java delete mode 100644 src/main/java/com/datadog/api/client/v2/model/ValidateV2Attributes.java delete mode 100644 src/main/java/com/datadog/api/client/v2/model/ValidateV2Data.java delete mode 100644 src/main/java/com/datadog/api/client/v2/model/ValidateV2Response.java delete mode 100644 src/main/java/com/datadog/api/client/v2/model/ValidateV2Type.java diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 4707c147e8b..81db0724c58 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -3256,6 +3256,7 @@ components: - incident_analytics - product_analytics - on_call_events + - errors example: "logs" type: string x-enum-varnames: @@ -3272,6 +3273,7 @@ components: - INCIDENT_ANALYTICS - PRODUCT_ANALYTICS - ON_CALL_EVENTS + - ERRORS FormulaAndFunctionMetricAggregation: description: The aggregation methods available for metrics queries. enum: diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5808b5f7964..5b0100ae0ea 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -82733,77 +82733,6 @@ components: description: The title of the event. example: "The event title" type: string - ValidateAPIKeyResponse: - description: Response object for the API and application key validation status check. - properties: - status: - $ref: "#/components/schemas/ValidateAPIKeyStatus" - required: - - status - type: object - ValidateAPIKeyStatus: - description: Status of the validation. Always `ok` when both the API key and the application key are valid. - enum: - - ok - example: ok - type: string - x-enum-varnames: - - OK - ValidateV2Attributes: - description: Attributes of the API key validation response. - properties: - api_key_id: - description: The UUID of the API key. - example: "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6" - type: string - api_key_scopes: - description: List of scope names associated with the API key. - example: - - "remote_config_read" - items: - type: string - type: array - valid: - description: Whether the API key is valid. - example: true - type: boolean - required: - - valid - - api_key_scopes - - api_key_id - type: object - ValidateV2Data: - description: Data object containing the API key validation result. - properties: - attributes: - $ref: "#/components/schemas/ValidateV2Attributes" - id: - description: The UUID of the organization associated with the API key. - example: "550e8400-e29b-41d4-a716-446655440000" - type: string - type: - $ref: "#/components/schemas/ValidateV2Type" - required: - - id - - type - - attributes - type: object - ValidateV2Response: - description: Response for the API key validation endpoint. - properties: - data: - $ref: "#/components/schemas/ValidateV2Data" - required: - - data - type: object - ValidateV2Type: - description: Resource type for the API key validation response. - enum: - - validate_v2 - example: validate_v2 - type: string - x-enum-varnames: - - ValidateV2 ValidationError: description: Represents a single validation error, including a human-readable title and metadata. properties: @@ -145701,89 +145630,6 @@ paths: operator: OR permissions: - teams_read - /api/v2/validate: - get: - description: Check if the API key is valid. Returns the organization UUID, API key ID, and associated scopes. - operationId: Validate - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - attributes: - api_key_id: "a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6" - api_key_scopes: - - "remote_config_read" - valid: true - id: "550e8400-e29b-41d4-a716-446655440000" - type: "validate_v2" - schema: - $ref: "#/components/schemas/ValidateV2Response" - description: OK - "403": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Forbidden - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - summary: Validate API key - tags: - - Key Management - "x-permission": - operator: OPEN - permissions: [] - x-unstable: |- - **Note**: This endpoint is in preview and is subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). - /api/v2/validate_keys: - get: - description: |- - Check that the API key and application key used for the request are both valid. - Returns `{"status": "ok"}` on success, `401` or `403` otherwise. Useful as a - lightweight authentication probe before issuing other API calls that require - full credentials. - operationId: ValidateAPIKey - responses: - "200": - content: - application/json: - examples: - default: - value: - status: ok - schema: - $ref: "#/components/schemas/ValidateAPIKeyResponse" - description: OK - "401": - content: - application/json: - schema: - $ref: "#/components/schemas/APIErrorResponse" - description: Unauthorized - "403": - content: - application/json: - schema: - $ref: "#/components/schemas/APIErrorResponse" - description: Forbidden - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - summary: Validate API and application keys - tags: - - Key Management - "x-permission": - operator: OPEN - permissions: [] /api/v2/web-integrations/{integration_name}/accounts: get: description: List accounts for a given web integration. diff --git a/examples/v2/key-management/Validate.java b/examples/v2/key-management/Validate.java deleted file mode 100644 index c3b7015f074..00000000000 --- a/examples/v2/key-management/Validate.java +++ /dev/null @@ -1,25 +0,0 @@ -// Validate API key returns "OK" response - -import com.datadog.api.client.ApiClient; -import com.datadog.api.client.ApiException; -import com.datadog.api.client.v2.api.KeyManagementApi; -import com.datadog.api.client.v2.model.ValidateV2Response; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = ApiClient.getDefaultApiClient(); - defaultClient.setUnstableOperationEnabled("v2.validate", true); - KeyManagementApi apiInstance = new KeyManagementApi(defaultClient); - - try { - ValidateV2Response result = apiInstance.validate(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling KeyManagementApi#validate"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} diff --git a/examples/v2/key-management/ValidateAPIKey.java b/examples/v2/key-management/ValidateAPIKey.java deleted file mode 100644 index 5b24d648442..00000000000 --- a/examples/v2/key-management/ValidateAPIKey.java +++ /dev/null @@ -1,24 +0,0 @@ -// Validate API and application keys returns "OK" response - -import com.datadog.api.client.ApiClient; -import com.datadog.api.client.ApiException; -import com.datadog.api.client.v2.api.KeyManagementApi; -import com.datadog.api.client.v2.model.ValidateAPIKeyResponse; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = ApiClient.getDefaultApiClient(); - KeyManagementApi apiInstance = new KeyManagementApi(defaultClient); - - try { - ValidateAPIKeyResponse result = apiInstance.validateAPIKey(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling KeyManagementApi#validateAPIKey"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 33d58871928..cfc74305c31 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -803,7 +803,6 @@ public class ApiClient { put("v2.updateLLMObsExperiment", false); put("v2.updateLLMObsProject", false); put("v2.anonymizeUsers", false); - put("v2.validate", false); put("v2.createOpenAPI", false); put("v2.deleteOpenAPI", false); put("v2.getOpenAPI", false); diff --git a/src/main/java/com/datadog/api/client/v1/model/FormulaAndFunctionEventsDataSource.java b/src/main/java/com/datadog/api/client/v1/model/FormulaAndFunctionEventsDataSource.java index 40abd745351..e4ccd08b49b 100644 --- a/src/main/java/com/datadog/api/client/v1/model/FormulaAndFunctionEventsDataSource.java +++ b/src/main/java/com/datadog/api/client/v1/model/FormulaAndFunctionEventsDataSource.java @@ -38,7 +38,8 @@ public class FormulaAndFunctionEventsDataSource extends ModelEnum { "ci_pipelines", "incident_analytics", "product_analytics", - "on_call_events")); + "on_call_events", + "errors")); public static final FormulaAndFunctionEventsDataSource LOGS = new FormulaAndFunctionEventsDataSource("logs"); @@ -66,6 +67,8 @@ public class FormulaAndFunctionEventsDataSource extends ModelEnum { new FormulaAndFunctionEventsDataSource("product_analytics"); public static final FormulaAndFunctionEventsDataSource ON_CALL_EVENTS = new FormulaAndFunctionEventsDataSource("on_call_events"); + public static final FormulaAndFunctionEventsDataSource ERRORS = + new FormulaAndFunctionEventsDataSource("errors"); FormulaAndFunctionEventsDataSource(String value) { super(value, allowedValues); diff --git a/src/main/java/com/datadog/api/client/v2/api/KeyManagementApi.java b/src/main/java/com/datadog/api/client/v2/api/KeyManagementApi.java index 7a76aa75497..56de4559fd1 100644 --- a/src/main/java/com/datadog/api/client/v2/api/KeyManagementApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/KeyManagementApi.java @@ -20,8 +20,6 @@ import com.datadog.api.client.v2.model.PersonalAccessTokenResponse; import com.datadog.api.client.v2.model.PersonalAccessTokenUpdateRequest; import com.datadog.api.client.v2.model.PersonalAccessTokensSort; -import com.datadog.api.client.v2.model.ValidateAPIKeyResponse; -import com.datadog.api.client.v2.model.ValidateV2Response; import jakarta.ws.rs.client.Invocation; import jakarta.ws.rs.core.GenericType; import java.util.ArrayList; @@ -3466,243 +3464,4 @@ public ApiResponse updatePersonalAccessTokenWithHtt false, new GenericType() {}); } - - /** - * Validate API key. - * - *

See {@link #validateWithHttpInfo}. - * - * @return ValidateV2Response - * @throws ApiException if fails to make API call - */ - public ValidateV2Response validate() throws ApiException { - return validateWithHttpInfo().getData(); - } - - /** - * Validate API key. - * - *

See {@link #validateWithHttpInfoAsync}. - * - * @return CompletableFuture<ValidateV2Response> - */ - public CompletableFuture validateAsync() { - return validateWithHttpInfoAsync() - .thenApply( - response -> { - return response.getData(); - }); - } - - /** - * Check if the API key is valid. Returns the organization UUID, API key ID, and associated - * scopes. - * - * @return ApiResponse<ValidateV2Response> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - * - *
Response details
Status Code Description Response Headers
200 OK -
403 Forbidden -
429 Too many requests -
- */ - public ApiResponse validateWithHttpInfo() throws ApiException { - // Check if unstable operation is enabled - String operationId = "validate"; - 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; - // create path and map variables - String localVarPath = "/api/v2/validate"; - - Map localVarHeaderParams = new HashMap(); - - Invocation.Builder builder = - apiClient.createBuilder( - "v2.KeyManagementApi.validate", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth"}); - return apiClient.invokeAPI( - "GET", - builder, - localVarHeaderParams, - new String[] {}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } - - /** - * Validate API key. - * - *

See {@link #validateWithHttpInfo}. - * - * @return CompletableFuture<ApiResponse<ValidateV2Response>> - */ - public CompletableFuture> validateWithHttpInfoAsync() { - // Check if unstable operation is enabled - String operationId = "validate"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } - Object localVarPostBody = null; - // create path and map variables - String localVarPath = "/api/v2/validate"; - - Map localVarHeaderParams = new HashMap(); - - Invocation.Builder builder; - try { - builder = - apiClient.createBuilder( - "v2.KeyManagementApi.validate", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth"}); - } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally(ex); - return result; - } - return apiClient.invokeAPIAsync( - "GET", - builder, - localVarHeaderParams, - new String[] {}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } - - /** - * Validate API and application keys. - * - *

See {@link #validateAPIKeyWithHttpInfo}. - * - * @return ValidateAPIKeyResponse - * @throws ApiException if fails to make API call - */ - public ValidateAPIKeyResponse validateAPIKey() throws ApiException { - return validateAPIKeyWithHttpInfo().getData(); - } - - /** - * Validate API and application keys. - * - *

See {@link #validateAPIKeyWithHttpInfoAsync}. - * - * @return CompletableFuture<ValidateAPIKeyResponse> - */ - public CompletableFuture validateAPIKeyAsync() { - return validateAPIKeyWithHttpInfoAsync() - .thenApply( - response -> { - return response.getData(); - }); - } - - /** - * Check that the API key and application key used for the request are both valid. Returns - * {"status": "ok"} on success, 401 or 403 otherwise. Useful as a - * lightweight authentication probe before issuing other API calls that require full credentials. - * - * @return ApiResponse<ValidateAPIKeyResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - * - * - *
Response details
Status Code Description Response Headers
200 OK -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
- */ - public ApiResponse validateAPIKeyWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - // create path and map variables - String localVarPath = "/api/v2/validate_keys"; - - Map localVarHeaderParams = new HashMap(); - - Invocation.Builder builder = - apiClient.createBuilder( - "v2.KeyManagementApi.validateAPIKey", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); - return apiClient.invokeAPI( - "GET", - builder, - localVarHeaderParams, - new String[] {}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } - - /** - * Validate API and application keys. - * - *

See {@link #validateAPIKeyWithHttpInfo}. - * - * @return CompletableFuture<ApiResponse<ValidateAPIKeyResponse>> - */ - public CompletableFuture> validateAPIKeyWithHttpInfoAsync() { - Object localVarPostBody = null; - // create path and map variables - String localVarPath = "/api/v2/validate_keys"; - - Map localVarHeaderParams = new HashMap(); - - Invocation.Builder builder; - try { - builder = - apiClient.createBuilder( - "v2.KeyManagementApi.validateAPIKey", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); - } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally(ex); - return result; - } - return apiClient.invokeAPIAsync( - "GET", - builder, - localVarHeaderParams, - new String[] {}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } } diff --git a/src/main/java/com/datadog/api/client/v2/model/ValidateAPIKeyResponse.java b/src/main/java/com/datadog/api/client/v2/model/ValidateAPIKeyResponse.java deleted file mode 100644 index bfcef3714ce..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/ValidateAPIKeyResponse.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2019-Present Datadog, Inc. - */ - -package com.datadog.api.client.v2.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** Response object for the API and application key validation status check. */ -@JsonPropertyOrder({ValidateAPIKeyResponse.JSON_PROPERTY_STATUS}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class ValidateAPIKeyResponse { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_STATUS = "status"; - private ValidateAPIKeyStatus status; - - public ValidateAPIKeyResponse() {} - - @JsonCreator - public ValidateAPIKeyResponse( - @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) ValidateAPIKeyStatus status) { - this.status = status; - this.unparsed |= !status.isValid(); - } - - public ValidateAPIKeyResponse status(ValidateAPIKeyStatus status) { - this.status = status; - this.unparsed |= !status.isValid(); - return this; - } - - /** - * Status of the validation. Always ok when both the API key and the application key - * are valid. - * - * @return status - */ - @JsonProperty(JSON_PROPERTY_STATUS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ValidateAPIKeyStatus getStatus() { - return status; - } - - public void setStatus(ValidateAPIKeyStatus status) { - if (!status.isValid()) { - this.unparsed = true; - } - this.status = status; - } - - /** - * A container for additional, undeclared properties. This is a holder for any undeclared - * properties as specified with the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. If the property - * does not already exist, create it otherwise replace it. - * - * @param key The arbitrary key to set - * @param value The associated value - * @return ValidateAPIKeyResponse - */ - @JsonAnySetter - public ValidateAPIKeyResponse putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return The additional properties - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key The arbitrary key to get - * @return The specific additional property for the given key - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - /** Return true if this ValidateAPIKeyResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ValidateAPIKeyResponse validateApiKeyResponse = (ValidateAPIKeyResponse) o; - return Objects.equals(this.status, validateApiKeyResponse.status) - && Objects.equals(this.additionalProperties, validateApiKeyResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(status, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ValidateAPIKeyResponse {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" additionalProperties: ") - .append(toIndentedString(additionalProperties)) - .append("\n"); - sb.append('}'); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/ValidateAPIKeyStatus.java b/src/main/java/com/datadog/api/client/v2/model/ValidateAPIKeyStatus.java deleted file mode 100644 index 40c5b84289e..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/ValidateAPIKeyStatus.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2019-Present Datadog, Inc. - */ - -package com.datadog.api.client.v2.model; - -import com.datadog.api.client.ModelEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -/** - * Status of the validation. Always ok when both the API key and the application key - * are valid. - */ -@JsonSerialize(using = ValidateAPIKeyStatus.ValidateAPIKeyStatusSerializer.class) -public class ValidateAPIKeyStatus extends ModelEnum { - - private static final Set allowedValues = new HashSet(Arrays.asList("ok")); - - public static final ValidateAPIKeyStatus OK = new ValidateAPIKeyStatus("ok"); - - ValidateAPIKeyStatus(String value) { - super(value, allowedValues); - } - - public static class ValidateAPIKeyStatusSerializer extends StdSerializer { - public ValidateAPIKeyStatusSerializer(Class t) { - super(t); - } - - public ValidateAPIKeyStatusSerializer() { - this(null); - } - - @Override - public void serialize( - ValidateAPIKeyStatus value, JsonGenerator jgen, SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static ValidateAPIKeyStatus fromValue(String value) { - return new ValidateAPIKeyStatus(value); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/ValidateV2Attributes.java b/src/main/java/com/datadog/api/client/v2/model/ValidateV2Attributes.java deleted file mode 100644 index eb33e1ddbfb..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/ValidateV2Attributes.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2019-Present Datadog, Inc. - */ - -package com.datadog.api.client.v2.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Attributes of the API key validation response. */ -@JsonPropertyOrder({ - ValidateV2Attributes.JSON_PROPERTY_API_KEY_ID, - ValidateV2Attributes.JSON_PROPERTY_API_KEY_SCOPES, - ValidateV2Attributes.JSON_PROPERTY_VALID -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class ValidateV2Attributes { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_API_KEY_ID = "api_key_id"; - private String apiKeyId; - - public static final String JSON_PROPERTY_API_KEY_SCOPES = "api_key_scopes"; - private List apiKeyScopes = new ArrayList<>(); - - public static final String JSON_PROPERTY_VALID = "valid"; - private Boolean valid; - - public ValidateV2Attributes() {} - - @JsonCreator - public ValidateV2Attributes( - @JsonProperty(required = true, value = JSON_PROPERTY_API_KEY_ID) String apiKeyId, - @JsonProperty(required = true, value = JSON_PROPERTY_API_KEY_SCOPES) - List apiKeyScopes, - @JsonProperty(required = true, value = JSON_PROPERTY_VALID) Boolean valid) { - this.apiKeyId = apiKeyId; - this.apiKeyScopes = apiKeyScopes; - this.valid = valid; - } - - public ValidateV2Attributes apiKeyId(String apiKeyId) { - this.apiKeyId = apiKeyId; - return this; - } - - /** - * The UUID of the API key. - * - * @return apiKeyId - */ - @JsonProperty(JSON_PROPERTY_API_KEY_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getApiKeyId() { - return apiKeyId; - } - - public void setApiKeyId(String apiKeyId) { - this.apiKeyId = apiKeyId; - } - - public ValidateV2Attributes apiKeyScopes(List apiKeyScopes) { - this.apiKeyScopes = apiKeyScopes; - return this; - } - - public ValidateV2Attributes addApiKeyScopesItem(String apiKeyScopesItem) { - this.apiKeyScopes.add(apiKeyScopesItem); - return this; - } - - /** - * List of scope names associated with the API key. - * - * @return apiKeyScopes - */ - @JsonProperty(JSON_PROPERTY_API_KEY_SCOPES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getApiKeyScopes() { - return apiKeyScopes; - } - - public void setApiKeyScopes(List apiKeyScopes) { - this.apiKeyScopes = apiKeyScopes; - } - - public ValidateV2Attributes valid(Boolean valid) { - this.valid = valid; - return this; - } - - /** - * Whether the API key is valid. - * - * @return valid - */ - @JsonProperty(JSON_PROPERTY_VALID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Boolean getValid() { - return valid; - } - - public void setValid(Boolean valid) { - this.valid = valid; - } - - /** - * A container for additional, undeclared properties. This is a holder for any undeclared - * properties as specified with the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. If the property - * does not already exist, create it otherwise replace it. - * - * @param key The arbitrary key to set - * @param value The associated value - * @return ValidateV2Attributes - */ - @JsonAnySetter - public ValidateV2Attributes putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return The additional properties - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key The arbitrary key to get - * @return The specific additional property for the given key - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - /** Return true if this ValidateV2Attributes object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ValidateV2Attributes validateV2Attributes = (ValidateV2Attributes) o; - return Objects.equals(this.apiKeyId, validateV2Attributes.apiKeyId) - && Objects.equals(this.apiKeyScopes, validateV2Attributes.apiKeyScopes) - && Objects.equals(this.valid, validateV2Attributes.valid) - && Objects.equals(this.additionalProperties, validateV2Attributes.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(apiKeyId, apiKeyScopes, valid, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ValidateV2Attributes {\n"); - sb.append(" apiKeyId: ").append(toIndentedString(apiKeyId)).append("\n"); - sb.append(" apiKeyScopes: ").append(toIndentedString(apiKeyScopes)).append("\n"); - sb.append(" valid: ").append(toIndentedString(valid)).append("\n"); - sb.append(" additionalProperties: ") - .append(toIndentedString(additionalProperties)) - .append("\n"); - sb.append('}'); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/ValidateV2Data.java b/src/main/java/com/datadog/api/client/v2/model/ValidateV2Data.java deleted file mode 100644 index 6b9606a740f..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/ValidateV2Data.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2019-Present Datadog, Inc. - */ - -package com.datadog.api.client.v2.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** Data object containing the API key validation result. */ -@JsonPropertyOrder({ - ValidateV2Data.JSON_PROPERTY_ATTRIBUTES, - ValidateV2Data.JSON_PROPERTY_ID, - ValidateV2Data.JSON_PROPERTY_TYPE -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class ValidateV2Data { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; - private ValidateV2Attributes attributes; - - public static final String JSON_PROPERTY_ID = "id"; - private String id; - - public static final String JSON_PROPERTY_TYPE = "type"; - private ValidateV2Type type; - - public ValidateV2Data() {} - - @JsonCreator - public ValidateV2Data( - @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) - ValidateV2Attributes attributes, - @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, - @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ValidateV2Type type) { - this.attributes = attributes; - this.unparsed |= attributes.unparsed; - this.id = id; - this.type = type; - this.unparsed |= !type.isValid(); - } - - public ValidateV2Data attributes(ValidateV2Attributes attributes) { - this.attributes = attributes; - this.unparsed |= attributes.unparsed; - return this; - } - - /** - * Attributes of the API key validation response. - * - * @return attributes - */ - @JsonProperty(JSON_PROPERTY_ATTRIBUTES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ValidateV2Attributes getAttributes() { - return attributes; - } - - public void setAttributes(ValidateV2Attributes attributes) { - this.attributes = attributes; - } - - public ValidateV2Data id(String id) { - this.id = id; - return this; - } - - /** - * The UUID of the organization associated with the API key. - * - * @return id - */ - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public ValidateV2Data type(ValidateV2Type type) { - this.type = type; - this.unparsed |= !type.isValid(); - return this; - } - - /** - * Resource type for the API key validation response. - * - * @return type - */ - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ValidateV2Type getType() { - return type; - } - - public void setType(ValidateV2Type type) { - if (!type.isValid()) { - this.unparsed = true; - } - this.type = type; - } - - /** - * A container for additional, undeclared properties. This is a holder for any undeclared - * properties as specified with the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. If the property - * does not already exist, create it otherwise replace it. - * - * @param key The arbitrary key to set - * @param value The associated value - * @return ValidateV2Data - */ - @JsonAnySetter - public ValidateV2Data putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return The additional properties - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key The arbitrary key to get - * @return The specific additional property for the given key - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - /** Return true if this ValidateV2Data object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ValidateV2Data validateV2Data = (ValidateV2Data) o; - return Objects.equals(this.attributes, validateV2Data.attributes) - && Objects.equals(this.id, validateV2Data.id) - && Objects.equals(this.type, validateV2Data.type) - && Objects.equals(this.additionalProperties, validateV2Data.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(attributes, id, type, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ValidateV2Data {\n"); - sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" additionalProperties: ") - .append(toIndentedString(additionalProperties)) - .append("\n"); - sb.append('}'); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/ValidateV2Response.java b/src/main/java/com/datadog/api/client/v2/model/ValidateV2Response.java deleted file mode 100644 index 924a0a2a67c..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/ValidateV2Response.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2019-Present Datadog, Inc. - */ - -package com.datadog.api.client.v2.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** Response for the API key validation endpoint. */ -@JsonPropertyOrder({ValidateV2Response.JSON_PROPERTY_DATA}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class ValidateV2Response { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_DATA = "data"; - private ValidateV2Data data; - - public ValidateV2Response() {} - - @JsonCreator - public ValidateV2Response( - @JsonProperty(required = true, value = JSON_PROPERTY_DATA) ValidateV2Data data) { - this.data = data; - this.unparsed |= data.unparsed; - } - - public ValidateV2Response data(ValidateV2Data data) { - this.data = data; - this.unparsed |= data.unparsed; - return this; - } - - /** - * Data object containing the API key validation result. - * - * @return data - */ - @JsonProperty(JSON_PROPERTY_DATA) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ValidateV2Data getData() { - return data; - } - - public void setData(ValidateV2Data data) { - this.data = data; - } - - /** - * A container for additional, undeclared properties. This is a holder for any undeclared - * properties as specified with the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. If the property - * does not already exist, create it otherwise replace it. - * - * @param key The arbitrary key to set - * @param value The associated value - * @return ValidateV2Response - */ - @JsonAnySetter - public ValidateV2Response putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return The additional properties - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key The arbitrary key to get - * @return The specific additional property for the given key - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - /** Return true if this ValidateV2Response object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ValidateV2Response validateV2Response = (ValidateV2Response) o; - return Objects.equals(this.data, validateV2Response.data) - && Objects.equals(this.additionalProperties, validateV2Response.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(data, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ValidateV2Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append(" additionalProperties: ") - .append(toIndentedString(additionalProperties)) - .append("\n"); - sb.append('}'); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/ValidateV2Type.java b/src/main/java/com/datadog/api/client/v2/model/ValidateV2Type.java deleted file mode 100644 index ed9cbde84e5..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/ValidateV2Type.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2019-Present Datadog, Inc. - */ - -package com.datadog.api.client.v2.model; - -import com.datadog.api.client.ModelEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -/** Resource type for the API key validation response. */ -@JsonSerialize(using = ValidateV2Type.ValidateV2TypeSerializer.class) -public class ValidateV2Type extends ModelEnum { - - private static final Set allowedValues = - new HashSet(Arrays.asList("validate_v2")); - - public static final ValidateV2Type ValidateV2 = new ValidateV2Type("validate_v2"); - - ValidateV2Type(String value) { - super(value, allowedValues); - } - - public static class ValidateV2TypeSerializer extends StdSerializer { - public ValidateV2TypeSerializer(Class t) { - super(t); - } - - public ValidateV2TypeSerializer() { - this(null); - } - - @Override - public void serialize(ValidateV2Type value, JsonGenerator jgen, SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static ValidateV2Type fromValue(String value) { - return new ValidateV2Type(value); - } -} diff --git a/src/test/resources/com/datadog/api/client/v2/api/key_management.feature b/src/test/resources/com/datadog/api/client/v2/api/key_management.feature index b27f150393b..365c53ed7c2 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/key_management.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/key_management.feature @@ -9,20 +9,19 @@ Feature: Key Management Background: Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system And an instance of "KeyManagement" API @generated @skip @team:DataDog/credentials-management Scenario: Create a personal access token returns "Bad Request" response - Given a valid "appKeyAuth" key in the system - And new "CreatePersonalAccessToken" request + Given new "CreatePersonalAccessToken" request And body with value {"data": {"attributes": {"expires_at": "2025-12-31T23:59:59+00:00", "name": "My Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "type": "personal_access_tokens"}} When the request is sent Then the response status is 400 Bad Request @team:DataDog/credentials-management Scenario: Create a personal access token returns "Created" response - Given a valid "appKeyAuth" key in the system - And new "CreatePersonalAccessToken" request + Given new "CreatePersonalAccessToken" request And body with value {"data": {"type": "personal_access_tokens", "attributes": {"name": "{{ unique }}", "scopes": ["dashboards_read"], "expires_at": "{{ timeISO('now+365d') }}"}}} When the request is sent Then the response status is 201 Created @@ -33,16 +32,14 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Create an API key returns "Bad Request" response - Given a valid "appKeyAuth" key in the system - And new "CreateAPIKey" request + Given new "CreateAPIKey" request And body with value {"data": {"attributes": {"name": "API Key for submitting metrics"}, "type": "api_keys"}} When the request is sent Then the response status is 400 Bad Request @team:DataDog/credentials-management Scenario: Create an API key returns "Created" response - Given a valid "appKeyAuth" key in the system - And new "CreateAPIKey" request + Given new "CreateAPIKey" request And body with value {"data": {"type": "api_keys", "attributes": {"name": "{{ unique }}"}}} When the request is sent Then the response status is 201 Created @@ -51,8 +48,7 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Create an Application key with scopes for current user returns "Created" response - Given a valid "appKeyAuth" key in the system - And new "CreateCurrentUserApplicationKey" request + Given new "CreateCurrentUserApplicationKey" request And body with value {"data": {"type": "application_keys", "attributes": {"name": "{{ unique }}", "scopes": ["dashboards_read", "dashboards_write", "dashboards_public_share"]}}} When the request is sent Then the response status is 201 Created @@ -61,16 +57,14 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Create an application key for current user returns "Bad Request" response - Given a valid "appKeyAuth" key in the system - And new "CreateCurrentUserApplicationKey" request + Given new "CreateCurrentUserApplicationKey" request And body with value {"data": {"attributes": {"name": "Application Key for managing dashboards", "scopes": ["dashboards_read", "dashboards_write", "dashboards_public_share"]}, "type": "application_keys"}} When the request is sent Then the response status is 400 Bad Request @team:DataDog/credentials-management Scenario: Create an application key for current user returns "Created" response - Given a valid "appKeyAuth" key in the system - And new "CreateCurrentUserApplicationKey" request + Given new "CreateCurrentUserApplicationKey" request And body with value {"data": {"type": "application_keys", "attributes": {"name": "{{ unique }}"}}} When the request is sent Then the response status is 201 Created @@ -79,8 +73,7 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Delete an API key returns "No Content" response - Given a valid "appKeyAuth" key in the system - And there is a valid "api_key" in the system + Given there is a valid "api_key" in the system And new "DeleteAPIKey" request And request contains "api_key_id" parameter from "api_key.data.id" When the request is sent @@ -88,16 +81,14 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Delete an API key returns "Not Found" response - Given a valid "appKeyAuth" key in the system - And new "DeleteAPIKey" request + Given new "DeleteAPIKey" request And request contains "api_key_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @team:DataDog/credentials-management Scenario: Delete an application key owned by current user returns "No Content" response - Given a valid "appKeyAuth" key in the system - And there is a valid "application_key" in the system + Given there is a valid "application_key" in the system And new "DeleteCurrentUserApplicationKey" request And request contains "app_key_id" parameter from "application_key.data.id" When the request is sent @@ -105,16 +96,14 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Delete an application key owned by current user returns "Not Found" response - Given a valid "appKeyAuth" key in the system - And new "DeleteCurrentUserApplicationKey" request + Given new "DeleteCurrentUserApplicationKey" request And request contains "app_key_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @team:DataDog/credentials-management Scenario: Delete an application key returns "No Content" response - Given a valid "appKeyAuth" key in the system - And there is a valid "application_key" in the system + Given there is a valid "application_key" in the system And new "DeleteApplicationKey" request And request contains "app_key_id" parameter from "application_key.data.id" When the request is sent @@ -122,16 +111,14 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Delete an application key returns "Not Found" response - Given a valid "appKeyAuth" key in the system - And new "DeleteApplicationKey" request + Given new "DeleteApplicationKey" request And request contains "app_key_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/credentials-management Scenario: Edit an API key returns "Bad Request" response - Given a valid "appKeyAuth" key in the system - And new "UpdateAPIKey" request + Given new "UpdateAPIKey" request And request contains "api_key_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "API Key for submitting metrics"}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "api_keys"}} When the request is sent @@ -139,8 +126,7 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Edit an API key returns "Not Found" response - Given a valid "appKeyAuth" key in the system - And new "UpdateAPIKey" request + Given new "UpdateAPIKey" request And request contains "api_key_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "API Key for submitting metrics"}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "api_keys"}} When the request is sent @@ -148,8 +134,7 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Edit an API key returns "OK" response - Given a valid "appKeyAuth" key in the system - And there is a valid "api_key" in the system + Given there is a valid "api_key" in the system And new "UpdateAPIKey" request And request contains "api_key_id" parameter from "api_key.data.id" And body with value {"data": {"type": "api_keys", "id": "{{ api_key.data.id }}", "attributes": {"name": "{{ unique }}"}}} @@ -161,8 +146,7 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Edit an application key owned by current user returns "Bad Request" response - Given a valid "appKeyAuth" key in the system - And new "UpdateCurrentUserApplicationKey" request + Given new "UpdateCurrentUserApplicationKey" request And request contains "app_key_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Application Key for managing dashboards", "scopes": ["dashboards_read", "dashboards_write", "dashboards_public_share"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "application_keys"}} When the request is sent @@ -170,8 +154,7 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Edit an application key owned by current user returns "Not Found" response - Given a valid "appKeyAuth" key in the system - And new "UpdateCurrentUserApplicationKey" request + Given new "UpdateCurrentUserApplicationKey" request And request contains "app_key_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Application Key for managing dashboards", "scopes": ["dashboards_read", "dashboards_write", "dashboards_public_share"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "application_keys"}} When the request is sent @@ -179,8 +162,7 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Edit an application key owned by current user returns "OK" response - Given a valid "appKeyAuth" key in the system - And there is a valid "application_key" in the system + Given there is a valid "application_key" in the system And new "UpdateCurrentUserApplicationKey" request And request contains "app_key_id" parameter from "application_key.data.id" And body with value {"data": {"id": "{{ application_key.data.id }}", "type": "application_keys", "attributes": {"name" : "{{ application_key.data.attributes.name }}-updated"}}} @@ -192,8 +174,7 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Edit an application key returns "Bad Request" response - Given a valid "appKeyAuth" key in the system - And new "UpdateApplicationKey" request + Given new "UpdateApplicationKey" request And request contains "app_key_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Application Key for managing dashboards", "scopes": ["dashboards_read", "dashboards_write", "dashboards_public_share"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "application_keys"}} When the request is sent @@ -201,8 +182,7 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Edit an application key returns "Not Found" response - Given a valid "appKeyAuth" key in the system - And new "UpdateApplicationKey" request + Given new "UpdateApplicationKey" request And request contains "app_key_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Application Key for managing dashboards", "scopes": ["dashboards_read", "dashboards_write", "dashboards_public_share"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "application_keys"}} When the request is sent @@ -210,8 +190,7 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Edit an application key returns "OK" response - Given a valid "appKeyAuth" key in the system - And there is a valid "application_key" in the system + Given there is a valid "application_key" in the system And new "UpdateApplicationKey" request And request contains "app_key_id" parameter from "application_key.data.id" And body with value {"data": {"id": "{{ application_key.data.id }}", "type": "application_keys", "attributes": {"name" : "{{ application_key.data.attributes.name }}-updated"}}} @@ -223,16 +202,14 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Get API key returns "Not Found" response - Given a valid "appKeyAuth" key in the system - And new "GetAPIKey" request + Given new "GetAPIKey" request And request contains "api_key_id" parameter with value "invalidId" When the request is sent Then the response status is 404 Not Found @team:DataDog/credentials-management Scenario: Get API key returns "OK" response - Given a valid "appKeyAuth" key in the system - And there is a valid "api_key" in the system + Given there is a valid "api_key" in the system And new "GetAPIKey" request And request contains "api_key_id" parameter from "api_key.data.id" When the request is sent @@ -243,16 +220,14 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Get a personal access token returns "Not Found" response - Given a valid "appKeyAuth" key in the system - And new "GetPersonalAccessToken" request + Given new "GetPersonalAccessToken" request And request contains "pat_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @team:DataDog/credentials-management Scenario: Get a personal access token returns "OK" response - Given a valid "appKeyAuth" key in the system - And there is a valid "personal_access_token" in the system + Given there is a valid "personal_access_token" in the system And new "GetPersonalAccessToken" request And request contains "pat_id" parameter from "personal_access_token.data.id" When the request is sent @@ -262,15 +237,13 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Get all API keys returns "Bad Request" response - Given a valid "appKeyAuth" key in the system - And new "ListAPIKeys" request + Given new "ListAPIKeys" request When the request is sent Then the response status is 400 Bad Request @team:DataDog/credentials-management Scenario: Get all API keys returns "OK" response - Given a valid "appKeyAuth" key in the system - And there is a valid "api_key" in the system + Given there is a valid "api_key" in the system And new "ListAPIKeys" request And request contains "filter" parameter from "api_key.data.attributes.name" When the request is sent @@ -280,22 +253,19 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Get all application keys owned by current user returns "Bad Request" response - Given a valid "appKeyAuth" key in the system - And new "ListCurrentUserApplicationKeys" request + Given new "ListCurrentUserApplicationKeys" request When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/credentials-management Scenario: Get all application keys owned by current user returns "Not Found" response - Given a valid "appKeyAuth" key in the system - And new "ListCurrentUserApplicationKeys" request + Given new "ListCurrentUserApplicationKeys" request When the request is sent Then the response status is 404 Not Found @team:DataDog/credentials-management Scenario: Get all application keys owned by current user returns "OK" response - Given a valid "appKeyAuth" key in the system - And new "ListCurrentUserApplicationKeys" request + Given new "ListCurrentUserApplicationKeys" request When the request is sent Then the response status is 200 OK And the response "data[0].type" is equal to "application_keys" @@ -303,22 +273,19 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Get all application keys returns "Bad Request" response - Given a valid "appKeyAuth" key in the system - And new "ListApplicationKeys" request + Given new "ListApplicationKeys" request When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/credentials-management Scenario: Get all application keys returns "Not Found" response - Given a valid "appKeyAuth" key in the system - And new "ListApplicationKeys" request + Given new "ListApplicationKeys" request When the request is sent Then the response status is 404 Not Found @team:DataDog/credentials-management Scenario: Get all application keys returns "OK" response - Given a valid "appKeyAuth" key in the system - And there is a valid "application_key" in the system + Given there is a valid "application_key" in the system And new "ListApplicationKeys" request When the request is sent Then the response status is 200 OK @@ -327,15 +294,13 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Get all personal access tokens returns "Bad Request" response - Given a valid "appKeyAuth" key in the system - And new "ListPersonalAccessTokens" request + Given new "ListPersonalAccessTokens" request When the request is sent Then the response status is 400 Bad Request @team:DataDog/credentials-management Scenario: Get all personal access tokens returns "OK" response - Given a valid "appKeyAuth" key in the system - And there is a valid "personal_access_token" in the system + Given there is a valid "personal_access_token" in the system And new "ListPersonalAccessTokens" request When the request is sent Then the response status is 200 OK @@ -343,24 +308,21 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Get an application key returns "Bad Request" response - Given a valid "appKeyAuth" key in the system - And new "GetApplicationKey" request + Given new "GetApplicationKey" request And request contains "app_key_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 400 Bad Request @team:DataDog/credentials-management Scenario: Get an application key returns "Not Found" response - Given a valid "appKeyAuth" key in the system - And new "GetApplicationKey" request + Given new "GetApplicationKey" request And request contains "app_key_id" parameter with value "invalidId" When the request is sent Then the response status is 404 Not Found @team:DataDog/credentials-management Scenario: Get an application key returns "OK" response - Given a valid "appKeyAuth" key in the system - And there is a valid "application_key" in the system + Given there is a valid "application_key" in the system And new "GetApplicationKey" request And request contains "app_key_id" parameter from "application_key.data.id" When the request is sent @@ -371,16 +333,14 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Get one application key owned by current user returns "Not Found" response - Given a valid "appKeyAuth" key in the system - And new "GetCurrentUserApplicationKey" request + Given new "GetCurrentUserApplicationKey" request And request contains "app_key_id" parameter with value "incorrectId" When the request is sent Then the response status is 404 Not Found @team:DataDog/credentials-management Scenario: Get one application key owned by current user returns "OK" response - Given a valid "appKeyAuth" key in the system - And there is a valid "application_key" in the system + Given there is a valid "application_key" in the system And new "GetCurrentUserApplicationKey" request And request contains "app_key_id" parameter from "application_key.data.id" When the request is sent @@ -393,8 +353,7 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Revoke a personal access token returns "No Content" response - Given a valid "appKeyAuth" key in the system - And there is a valid "personal_access_token" in the system + Given there is a valid "personal_access_token" in the system And new "RevokePersonalAccessToken" request And request contains "pat_id" parameter from "personal_access_token.data.id" When the request is sent @@ -402,16 +361,14 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Revoke a personal access token returns "Not Found" response - Given a valid "appKeyAuth" key in the system - And new "RevokePersonalAccessToken" request + Given new "RevokePersonalAccessToken" request And request contains "pat_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/credentials-management Scenario: Update a personal access token returns "Bad Request" response - Given a valid "appKeyAuth" key in the system - And new "UpdatePersonalAccessToken" request + Given new "UpdatePersonalAccessToken" request And request contains "pat_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Updated Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "personal_access_tokens"}} When the request is sent @@ -419,8 +376,7 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Update a personal access token returns "Not Found" response - Given a valid "appKeyAuth" key in the system - And new "UpdatePersonalAccessToken" request + Given new "UpdatePersonalAccessToken" request And request contains "pat_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Updated Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "personal_access_tokens"}} When the request is sent @@ -428,25 +384,10 @@ Feature: Key Management @team:DataDog/credentials-management Scenario: Update a personal access token returns "OK" response - Given a valid "appKeyAuth" key in the system - And there is a valid "personal_access_token" in the system + Given there is a valid "personal_access_token" in the system And new "UpdatePersonalAccessToken" request And request contains "pat_id" parameter from "personal_access_token.data.id" And body with value {"data": {"type": "personal_access_tokens", "id": "{{ personal_access_token.data.id }}", "attributes": {"name": "{{ unique }}-updated"}}} When the request is sent Then the response status is 200 OK And the response "data.attributes.name" is equal to "{{ unique }}-updated" - - @generated @skip @team:DataDog/identity-platform - Scenario: Validate API and application keys returns "OK" response - Given a valid "appKeyAuth" key in the system - And new "ValidateAPIKey" request - When the request is sent - Then the response status is 200 OK - - @generated @skip @team:DataDog/identity-platform - Scenario: Validate API key returns "OK" response - Given operation "Validate" enabled - And new "Validate" request - When the request is sent - Then the response status is 200 OK diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 1ca1c2309ae..3d8451720f7 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -7163,18 +7163,6 @@ "type": "safe" } }, - "Validate": { - "tag": "Key Management", - "undo": { - "type": "safe" - } - }, - "ValidateAPIKey": { - "tag": "Key Management", - "undo": { - "type": "safe" - } - }, "ListWebIntegrationAccounts": { "tag": "Web Integrations", "undo": {