From b19447653915418e14366f8972f448dbc490c5e2 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 19 Sep 2025 09:50:35 +0000 Subject: [PATCH] Regenerate client from commit 3584508 of spec repo --- .generator/schemas/v2/openapi.yaml | 72 ++++- .../v2/dora-metrics/DeleteDORADeployment.java | 22 ++ .../v2/dora-metrics/DeleteDORAFailure.java | 22 ++ .../api/client/v2/api/DoraMetricsApi.java | 269 ++++++++++++++++++ .../api/client/v2/api/dora_metrics.feature | 35 ++- .../com/datadog/api/client/v2/api/undo.json | 12 + 6 files changed, 428 insertions(+), 4 deletions(-) create mode 100644 examples/v2/dora-metrics/DeleteDORADeployment.java create mode 100644 examples/v2/dora-metrics/DeleteDORAFailure.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5f50db2f7a5..d3d603bec26 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -56843,6 +56843,40 @@ paths: tags: - DORA Metrics x-codegen-request-body-name: body + /api/v2/dora/deployment/{deployment_id}: + delete: + description: Use this API endpoint to delete a deployment event. + operationId: DeleteDORADeployment + parameters: + - description: The ID of the deployment event to delete. + in: path + name: deployment_id + required: true + schema: + type: string + responses: + '202': + description: Accepted + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + - appKeyAuth: [] + summary: Delete a deployment event + tags: + - DORA Metrics + x-permission: + operator: OR + permissions: + - dora_metrics_write /api/v2/dora/deployments: post: description: Use this API endpoint to get a list of deployment events. @@ -56966,6 +57000,40 @@ paths: tags: - DORA Metrics x-codegen-request-body-name: body + /api/v2/dora/failure/{failure_id}: + delete: + description: Use this API endpoint to delete a failure event. + operationId: DeleteDORAFailure + parameters: + - description: The ID of the failure event to delete. + in: path + name: failure_id + required: true + schema: + type: string + responses: + '202': + description: Accepted + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + - appKeyAuth: [] + summary: Delete a failure event + tags: + - DORA Metrics + x-permission: + operator: OR + permissions: + - dora_metrics_write /api/v2/dora/failures: post: description: Use this API endpoint to get a list of failure events. @@ -75655,8 +75723,8 @@ tags: See the [Container Monitoring page](https://docs.datadoghq.com/containers/) for more information. name: Containers -- description: 'Search or send events for DORA Metrics to measure and improve your - software delivery performance. See the [DORA Metrics page](https://docs.datadoghq.com/dora_metrics/) +- description: 'Search, send, or delete events for DORA Metrics to measure and improve + your software delivery performance. See the [DORA Metrics page](https://docs.datadoghq.com/dora_metrics/) for more information. diff --git a/examples/v2/dora-metrics/DeleteDORADeployment.java b/examples/v2/dora-metrics/DeleteDORADeployment.java new file mode 100644 index 00000000000..c64f0c07d1a --- /dev/null +++ b/examples/v2/dora-metrics/DeleteDORADeployment.java @@ -0,0 +1,22 @@ +// Delete a deployment event returns "Accepted" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.DoraMetricsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + DoraMetricsApi apiInstance = new DoraMetricsApi(defaultClient); + + try { + apiInstance.deleteDORADeployment("NO_VALUE"); + } catch (ApiException e) { + System.err.println("Exception when calling DoraMetricsApi#deleteDORADeployment"); + 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/dora-metrics/DeleteDORAFailure.java b/examples/v2/dora-metrics/DeleteDORAFailure.java new file mode 100644 index 00000000000..29954540b22 --- /dev/null +++ b/examples/v2/dora-metrics/DeleteDORAFailure.java @@ -0,0 +1,22 @@ +// Delete a failure event returns "Accepted" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.DoraMetricsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + DoraMetricsApi apiInstance = new DoraMetricsApi(defaultClient); + + try { + apiInstance.deleteDORAFailure("NO_VALUE"); + } catch (ApiException e) { + System.err.println("Exception when calling DoraMetricsApi#deleteDORAFailure"); + 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/v2/api/DoraMetricsApi.java b/src/main/java/com/datadog/api/client/v2/api/DoraMetricsApi.java index 166d9970568..0323ab6fa8d 100644 --- a/src/main/java/com/datadog/api/client/v2/api/DoraMetricsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/DoraMetricsApi.java @@ -466,6 +466,275 @@ public CompletableFuture> createDORAIncidentWit new GenericType() {}); } + /** + * Delete a deployment event. + * + *

See {@link #deleteDORADeploymentWithHttpInfo}. + * + * @param deploymentId The ID of the deployment event to delete. (required) + * @throws ApiException if fails to make API call + */ + public void deleteDORADeployment(String deploymentId) throws ApiException { + deleteDORADeploymentWithHttpInfo(deploymentId); + } + + /** + * Delete a deployment event. + * + *

See {@link #deleteDORADeploymentWithHttpInfoAsync}. + * + * @param deploymentId The ID of the deployment event to delete. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteDORADeploymentAsync(String deploymentId) { + return deleteDORADeploymentWithHttpInfoAsync(deploymentId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Use this API endpoint to delete a deployment event. + * + * @param deploymentId The ID of the deployment event to delete. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
202 Accepted -
400 Bad Request -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse deleteDORADeploymentWithHttpInfo(String deploymentId) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'deploymentId' is set + if (deploymentId == null) { + throw new ApiException( + 400, "Missing the required parameter 'deploymentId' when calling deleteDORADeployment"); + } + // create path and map variables + String localVarPath = + "/api/v2/dora/deployment/{deployment_id}" + .replaceAll( + "\\{" + "deployment_id" + "\\}", apiClient.escapeString(deploymentId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.DoraMetricsApi.deleteDORADeployment", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete a deployment event. + * + *

See {@link #deleteDORADeploymentWithHttpInfo}. + * + * @param deploymentId The ID of the deployment event to delete. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteDORADeploymentWithHttpInfoAsync( + String deploymentId) { + Object localVarPostBody = null; + + // verify the required parameter 'deploymentId' is set + if (deploymentId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'deploymentId' when calling deleteDORADeployment")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/dora/deployment/{deployment_id}" + .replaceAll( + "\\{" + "deployment_id" + "\\}", apiClient.escapeString(deploymentId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.DoraMetricsApi.deleteDORADeployment", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete a failure event. + * + *

See {@link #deleteDORAFailureWithHttpInfo}. + * + * @param failureId The ID of the failure event to delete. (required) + * @throws ApiException if fails to make API call + */ + public void deleteDORAFailure(String failureId) throws ApiException { + deleteDORAFailureWithHttpInfo(failureId); + } + + /** + * Delete a failure event. + * + *

See {@link #deleteDORAFailureWithHttpInfoAsync}. + * + * @param failureId The ID of the failure event to delete. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteDORAFailureAsync(String failureId) { + return deleteDORAFailureWithHttpInfoAsync(failureId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Use this API endpoint to delete a failure event. + * + * @param failureId The ID of the failure event to delete. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
202 Accepted -
400 Bad Request -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse deleteDORAFailureWithHttpInfo(String failureId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'failureId' is set + if (failureId == null) { + throw new ApiException( + 400, "Missing the required parameter 'failureId' when calling deleteDORAFailure"); + } + // create path and map variables + String localVarPath = + "/api/v2/dora/failure/{failure_id}" + .replaceAll("\\{" + "failure_id" + "\\}", apiClient.escapeString(failureId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.DoraMetricsApi.deleteDORAFailure", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete a failure event. + * + *

See {@link #deleteDORAFailureWithHttpInfo}. + * + * @param failureId The ID of the failure event to delete. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteDORAFailureWithHttpInfoAsync(String failureId) { + Object localVarPostBody = null; + + // verify the required parameter 'failureId' is set + if (failureId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'failureId' when calling deleteDORAFailure")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/dora/failure/{failure_id}" + .replaceAll("\\{" + "failure_id" + "\\}", apiClient.escapeString(failureId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.DoraMetricsApi.deleteDORAFailure", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + /** * Get a deployment event. * diff --git a/src/test/resources/com/datadog/api/client/v2/api/dora_metrics.feature b/src/test/resources/com/datadog/api/client/v2/api/dora_metrics.feature index acc8230e361..e34092056ca 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/dora_metrics.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/dora_metrics.feature @@ -1,7 +1,7 @@ @endpoint(dora-metrics) @endpoint(dora-metrics-v2) Feature: DORA Metrics - Search or send events for DORA Metrics to measure and improve your - software delivery performance. See the [DORA Metrics + Search, send, or delete events for DORA Metrics to measure and improve + your software delivery performance. See the [DORA Metrics page](https://docs.datadoghq.com/dora_metrics/) for more information. **Note**: DORA Metrics are not available in the US1-FED site. @@ -9,6 +9,37 @@ Feature: DORA Metrics Given a valid "apiKeyAuth" key in the system And an instance of "DORAMetrics" API + @skip @team:DataDog/ci-app-backend + Scenario: Delete a deployment event returns "Accepted" response + Given new "DeleteDORADeployment" request + And a valid "appKeyAuth" key in the system + And request contains "deployment_id" parameter with value "NO_VALUE" + When the request is sent + Then the response status is 202 Accepted + + @skip @team:DataDog/ci-app-backend + Scenario: Delete a deployment event returns "Bad Request" response + Given new "DeleteDORADeployment" request + And request contains "deployment_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/ci-app-backend + Scenario: Delete a failure event returns "Accepted" response + Given new "DeleteDORAFailure" request + And a valid "appKeyAuth" key in the system + And request contains "failure_id" parameter with value "NO_VALUE" + When the request is sent + Then the response status is 202 Accepted + + @skip @team:DataDog/ci-app-backend + Scenario: Delete a failure event returns "Bad Request" response + Given new "DeleteDORAFailure" request + And a valid "appKeyAuth" key in the system + And request contains "failure_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + @generated @skip @team:DataDog/ci-app-backend Scenario: Get a deployment event returns "Bad Request" response Given new "GetDORADeployment" request 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 7f8336d494c..d864e99bb62 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 @@ -1064,6 +1064,12 @@ "type": "idempotent" } }, + "DeleteDORADeployment": { + "tag": "DORA Metrics", + "undo": { + "type": "idempotent" + } + }, "ListDORADeployments": { "tag": "DORA Metrics", "undo": { @@ -1082,6 +1088,12 @@ "type": "idempotent" } }, + "DeleteDORAFailure": { + "tag": "DORA Metrics", + "undo": { + "type": "idempotent" + } + }, "ListDORAFailures": { "tag": "DORA Metrics", "undo": {