diff --git a/.apigentools-info b/.apigentools-info index 6089d2a8629..896d8f6cbb6 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-04 17:40:39.560452", - "spec_repo_commit": "38b3c05a" + "regenerated": "2025-06-05 08:11:21.660332", + "spec_repo_commit": "0e7259ca" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-04 17:40:39.576433", - "spec_repo_commit": "38b3c05a" + "regenerated": "2025-06-05 08:11:21.677480", + "spec_repo_commit": "0e7259ca" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index c4ba008b54d..3a48cb6b964 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -11189,40 +11189,23 @@ components: description: The type of the event. type: string type: object - DORAFetchResponse: - description: Response for the DORA fetch endpoints. - properties: - data: - $ref: '#/components/schemas/DORAEvent' - type: object - DORAGitInfo: - description: Git info for DORA Metrics events. - properties: - commit_sha: - $ref: '#/components/schemas/GitCommitSHA' - repository_url: - $ref: '#/components/schemas/GitRepositoryURL' - required: - - repository_url - - commit_sha - type: object - DORAIncidentRequest: - description: Request to create a DORA incident event. + DORAFailureRequest: + description: Request to create a DORA failure event. properties: data: - $ref: '#/components/schemas/DORAIncidentRequestData' + $ref: '#/components/schemas/DORAFailureRequestData' required: - data type: object - DORAIncidentRequestAttributes: - description: Attributes to create a DORA incident event. + DORAFailureRequestAttributes: + description: Attributes to create a DORA failure event. properties: env: - description: Environment name that was impacted by the incident. + description: Environment name that was impacted by the failure. example: staging type: string finished_at: - description: Unix timestamp when the incident finished. It must be in nanoseconds, + description: Unix timestamp when the failure finished. It must be in nanoseconds, milliseconds, or seconds, and it should not be older than 1 hour. example: 1693491984000000000 format: int64 @@ -11230,15 +11213,15 @@ components: git: $ref: '#/components/schemas/DORAGitInfo' id: - description: Incident ID. Must have at least 16 characters. Required to - update a previously sent incident. + description: Failure ID. Must have at least 16 characters. Required to update + a previously sent failure. type: string name: - description: Incident name. + description: Failure name. example: Webserver is down failing all requests. type: string services: - description: Service names impacted by the incident. If possible, use names + description: Service names impacted by the failure. If possible, use names registered in the Service Catalog. Required when the team field is not provided. example: @@ -11247,11 +11230,11 @@ components: type: string type: array severity: - description: Incident severity. + description: Failure severity. example: High type: string started_at: - description: Unix timestamp when the incident started. It must be in nanoseconds, + description: Unix timestamp when the failure started. It must be in nanoseconds, milliseconds, or seconds. example: 1693491974000000000 format: int64 @@ -11269,43 +11252,60 @@ components: required: - started_at type: object - DORAIncidentRequestData: + DORAFailureRequestData: description: The JSON:API data. properties: attributes: - $ref: '#/components/schemas/DORAIncidentRequestAttributes' + $ref: '#/components/schemas/DORAFailureRequestAttributes' required: - attributes type: object - DORAIncidentResponse: - description: Response after receiving a DORA incident event. + DORAFailureResponse: + description: Response after receiving a DORA failure event. properties: data: - $ref: '#/components/schemas/DORAIncidentResponseData' + $ref: '#/components/schemas/DORAFailureResponseData' required: - data type: object - DORAIncidentResponseData: - description: Response after receiving a DORA incident event. + DORAFailureResponseData: + description: Response after receiving a DORA failure event. properties: id: - description: The ID of the received DORA incident event. + description: The ID of the received DORA failure event. example: 4242fcdd31586083 type: string type: - $ref: '#/components/schemas/DORAIncidentType' + $ref: '#/components/schemas/DORAFailureType' required: - id type: object - DORAIncidentType: - default: dora_incident - description: JSON:API type for DORA incident events. + DORAFailureType: + default: dora_failure + description: JSON:API type for DORA failure events. enum: - - dora_incident - example: dora_incident + - dora_failure + example: dora_failure type: string x-enum-varnames: - - DORA_INCIDENT + - DORA_FAILURE + DORAFetchResponse: + description: Response for the DORA fetch endpoints. + properties: + data: + $ref: '#/components/schemas/DORAEvent' + type: object + DORAGitInfo: + description: Git info for DORA Metrics events. + properties: + commit_sha: + $ref: '#/components/schemas/GitCommitSHA' + repository_url: + $ref: '#/components/schemas/GitRepositoryURL' + required: + - repository_url + - commit_sha + type: object DORAListDeploymentsRequest: description: Request to get a list of deployments. properties: @@ -46094,9 +46094,6 @@ paths: tags: - DORA Metrics x-codegen-request-body-name: body - x-unstable: '**Note**: This endpoint is in public beta. - - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/dora/deployments: post: description: Use this API endpoint to get a list of deployment events. @@ -46174,6 +46171,52 @@ paths: operator: OR permissions: - dora_metrics_read + /api/v2/dora/failure: + post: + description: 'Use this API endpoint to provide failure data for DORA metrics. + + + This is necessary for: + + - Change Failure Rate + + - Time to Restore' + operationId: CreateDORAFailure + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DORAFailureRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DORAFailureResponse' + description: OK + '202': + content: + application/json: + schema: + $ref: '#/components/schemas/DORAFailureResponse' + description: OK - but delayed due to incident + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + summary: Send a failure event for DORA Metrics + tags: + - DORA Metrics + x-codegen-request-body-name: body /api/v2/dora/failures: post: description: Use this API endpoint to get a list of failure events. @@ -46253,7 +46296,12 @@ paths: - dora_metrics_read /api/v2/dora/incident: post: - description: 'Use this API endpoint to provide failure data for DORA metrics. + deprecated: true + description: '**Note**: This endpoint is deprecated. Please use `/api/v2/dora/failure` + instead. + + + Use this API endpoint to provide failure data for DORA metrics. This is necessary for: @@ -46266,20 +46314,20 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DORAIncidentRequest' + $ref: '#/components/schemas/DORAFailureRequest' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/DORAIncidentResponse' + $ref: '#/components/schemas/DORAFailureResponse' description: OK '202': content: application/json: schema: - $ref: '#/components/schemas/DORAIncidentResponse' + $ref: '#/components/schemas/DORAFailureResponse' description: OK - but delayed due to incident '400': content: @@ -46297,9 +46345,6 @@ paths: tags: - DORA Metrics x-codegen-request-body-name: body - x-unstable: '**Note**: This endpoint is in public beta. - - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/downtime: get: description: Get all scheduled downtimes. diff --git a/examples/v2/dora-metrics/CreateDORADeployment.java b/examples/v2/dora-metrics/CreateDORADeployment.java index 37185895e58..93007007e67 100644 --- a/examples/v2/dora-metrics/CreateDORADeployment.java +++ b/examples/v2/dora-metrics/CreateDORADeployment.java @@ -12,7 +12,6 @@ public class Example { public static void main(String[] args) { ApiClient defaultClient = ApiClient.getDefaultApiClient(); - defaultClient.setUnstableOperationEnabled("v2.createDORADeployment", true); DoraMetricsApi apiInstance = new DoraMetricsApi(defaultClient); DORADeploymentRequest body = diff --git a/examples/v2/dora-metrics/CreateDORAFailure.java b/examples/v2/dora-metrics/CreateDORAFailure.java new file mode 100644 index 00000000000..102a9222d28 --- /dev/null +++ b/examples/v2/dora-metrics/CreateDORAFailure.java @@ -0,0 +1,49 @@ +// Send a failure event for DORA Metrics returns "OK - but delayed due to incident" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.DoraMetricsApi; +import com.datadog.api.client.v2.model.DORAFailureRequest; +import com.datadog.api.client.v2.model.DORAFailureRequestAttributes; +import com.datadog.api.client.v2.model.DORAFailureRequestData; +import com.datadog.api.client.v2.model.DORAFailureResponse; +import com.datadog.api.client.v2.model.DORAGitInfo; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + DoraMetricsApi apiInstance = new DoraMetricsApi(defaultClient); + + DORAFailureRequest body = + new DORAFailureRequest() + .data( + new DORAFailureRequestData() + .attributes( + new DORAFailureRequestAttributes() + .env("staging") + .finishedAt(1693491984000000000L) + .git( + new DORAGitInfo() + .commitSha("66adc9350f2cc9b250b69abddab733dd55e1a588") + .repositoryUrl( + "https://github.com/organization/example-repository")) + .name("Webserver is down failing all requests.") + .services(Collections.singletonList("shopist")) + .severity("High") + .startedAt(1693491974000000000L) + .team("backend") + .version("v1.12.07"))); + + try { + DORAFailureResponse result = apiInstance.createDORAFailure(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DoraMetricsApi#createDORAFailure"); + 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/CreateDORAIncident.java b/examples/v2/dora-metrics/CreateDORAIncident.java index f337ac0b0ad..294f77a25b8 100644 --- a/examples/v2/dora-metrics/CreateDORAIncident.java +++ b/examples/v2/dora-metrics/CreateDORAIncident.java @@ -3,40 +3,40 @@ import com.datadog.api.client.ApiClient; import com.datadog.api.client.ApiException; import com.datadog.api.client.v2.api.DoraMetricsApi; +import com.datadog.api.client.v2.model.DORAFailureRequest; +import com.datadog.api.client.v2.model.DORAFailureRequestAttributes; +import com.datadog.api.client.v2.model.DORAFailureRequestData; +import com.datadog.api.client.v2.model.DORAFailureResponse; import com.datadog.api.client.v2.model.DORAGitInfo; -import com.datadog.api.client.v2.model.DORAIncidentRequest; -import com.datadog.api.client.v2.model.DORAIncidentRequestAttributes; -import com.datadog.api.client.v2.model.DORAIncidentRequestData; -import com.datadog.api.client.v2.model.DORAIncidentResponse; import java.util.Collections; public class Example { public static void main(String[] args) { ApiClient defaultClient = ApiClient.getDefaultApiClient(); - defaultClient.setUnstableOperationEnabled("v2.createDORAIncident", true); DoraMetricsApi apiInstance = new DoraMetricsApi(defaultClient); - DORAIncidentRequest body = - new DORAIncidentRequest() + DORAFailureRequest body = + new DORAFailureRequest() .data( - new DORAIncidentRequestData() + new DORAFailureRequestData() .attributes( - new DORAIncidentRequestAttributes() - .finishedAt(1707842944600000000L) + new DORAFailureRequestAttributes() + .env("staging") + .finishedAt(1693491984000000000L) .git( new DORAGitInfo() .commitSha("66adc9350f2cc9b250b69abddab733dd55e1a588") .repositoryUrl( "https://github.com/organization/example-repository")) - .name("Webserver is down failing all requests") + .name("Webserver is down failing all requests.") .services(Collections.singletonList("shopist")) .severity("High") - .startedAt(1707842944500000000L) + .startedAt(1693491974000000000L) .team("backend") .version("v1.12.07"))); try { - DORAIncidentResponse result = apiInstance.createDORAIncident(body); + DORAFailureResponse result = apiInstance.createDORAIncident(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling DoraMetricsApi#createDORAIncident"); diff --git a/examples/v2/dora-metrics/CreateDORAIncident_1768887482.java b/examples/v2/dora-metrics/CreateDORAIncident_1768887482.java new file mode 100644 index 00000000000..17419e1e474 --- /dev/null +++ b/examples/v2/dora-metrics/CreateDORAIncident_1768887482.java @@ -0,0 +1,48 @@ +// Send a failure event for DORA Metrics returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.DoraMetricsApi; +import com.datadog.api.client.v2.model.DORAFailureRequest; +import com.datadog.api.client.v2.model.DORAFailureRequestAttributes; +import com.datadog.api.client.v2.model.DORAFailureRequestData; +import com.datadog.api.client.v2.model.DORAFailureResponse; +import com.datadog.api.client.v2.model.DORAGitInfo; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + DoraMetricsApi apiInstance = new DoraMetricsApi(defaultClient); + + DORAFailureRequest body = + new DORAFailureRequest() + .data( + new DORAFailureRequestData() + .attributes( + new DORAFailureRequestAttributes() + .finishedAt(1707842944600000000L) + .git( + new DORAGitInfo() + .commitSha("66adc9350f2cc9b250b69abddab733dd55e1a588") + .repositoryUrl( + "https://github.com/organization/example-repository")) + .name("Webserver is down failing all requests") + .services(Collections.singletonList("shopist")) + .severity("High") + .startedAt(1707842944500000000L) + .team("backend") + .version("v1.12.07"))); + + try { + DORAFailureResponse result = apiInstance.createDORAIncident(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DoraMetricsApi#createDORAIncident"); + 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 f2344f23607..ce436d5eeb7 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -632,8 +632,6 @@ public class ApiClient { put("v2.cancelDataDeletionRequest", false); put("v2.createDataDeletionRequest", false); put("v2.getDataDeletionRequests", false); - put("v2.createDORADeployment", false); - put("v2.createDORAIncident", false); put("v2.createIncident", false); put("v2.createIncidentIntegration", false); put("v2.createIncidentTodo", false); 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 24056ee4dcd..af627aee30a 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 @@ -6,9 +6,9 @@ import com.datadog.api.client.Pair; import com.datadog.api.client.v2.model.DORADeploymentRequest; import com.datadog.api.client.v2.model.DORADeploymentResponse; +import com.datadog.api.client.v2.model.DORAFailureRequest; +import com.datadog.api.client.v2.model.DORAFailureResponse; import com.datadog.api.client.v2.model.DORAFetchResponse; -import com.datadog.api.client.v2.model.DORAIncidentRequest; -import com.datadog.api.client.v2.model.DORAIncidentResponse; import com.datadog.api.client.v2.model.DORAListDeploymentsRequest; import com.datadog.api.client.v2.model.DORAListFailuresRequest; import com.datadog.api.client.v2.model.DORAListResponse; @@ -102,13 +102,6 @@ public CompletableFuture createDORADeploymentAsync( */ public ApiResponse createDORADeploymentWithHttpInfo( DORADeploymentRequest body) throws ApiException { - // Check if unstable operation is enabled - String operationId = "createDORADeployment"; - 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 = body; // verify the required parameter 'body' is set @@ -151,16 +144,6 @@ public ApiResponse createDORADeploymentWithHttpInfo( */ public CompletableFuture> createDORADeploymentWithHttpInfoAsync(DORADeploymentRequest body) { - // Check if unstable operation is enabled - String operationId = "createDORADeployment"; - 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 = body; // verify the required parameter 'body' is set @@ -203,16 +186,152 @@ public ApiResponse createDORADeploymentWithHttpInfo( new GenericType() {}); } + /** + * Send a failure event for DORA Metrics. + * + *

See {@link #createDORAFailureWithHttpInfo}. + * + * @param body (required) + * @return DORAFailureResponse + * @throws ApiException if fails to make API call + */ + public DORAFailureResponse createDORAFailure(DORAFailureRequest body) throws ApiException { + return createDORAFailureWithHttpInfo(body).getData(); + } + + /** + * Send a failure event for DORA Metrics. + * + *

See {@link #createDORAFailureWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<DORAFailureResponse> + */ + public CompletableFuture createDORAFailureAsync(DORAFailureRequest body) { + return createDORAFailureWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Use this API endpoint to provide failure data for DORA metrics. + * + *

This is necessary for: - Change Failure Rate - Time to Restore + * + * @param body (required) + * @return ApiResponse<DORAFailureResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
202 OK - but delayed due to incident -
400 Bad Request -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse createDORAFailureWithHttpInfo(DORAFailureRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createDORAFailure"); + } + // create path and map variables + String localVarPath = "/api/v2/dora/failure"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.DoraMetricsApi.createDORAFailure", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Send a failure event for DORA Metrics. + * + *

See {@link #createDORAFailureWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<DORAFailureResponse>> + */ + public CompletableFuture> createDORAFailureWithHttpInfoAsync( + DORAFailureRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createDORAFailure")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/dora/failure"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.DoraMetricsApi.createDORAFailure", + 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( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Send an incident event for DORA Metrics. * *

See {@link #createDORAIncidentWithHttpInfo}. * * @param body (required) - * @return DORAIncidentResponse + * @return DORAFailureResponse * @throws ApiException if fails to make API call + * @deprecated */ - public DORAIncidentResponse createDORAIncident(DORAIncidentRequest body) throws ApiException { + @Deprecated + public DORAFailureResponse createDORAIncident(DORAFailureRequest body) throws ApiException { return createDORAIncidentWithHttpInfo(body).getData(); } @@ -222,9 +341,11 @@ public DORAIncidentResponse createDORAIncident(DORAIncidentRequest body) throws *

See {@link #createDORAIncidentWithHttpInfoAsync}. * * @param body (required) - * @return CompletableFuture<DORAIncidentResponse> + * @return CompletableFuture<DORAFailureResponse> + * @deprecated */ - public CompletableFuture createDORAIncidentAsync(DORAIncidentRequest body) { + @Deprecated + public CompletableFuture createDORAIncidentAsync(DORAFailureRequest body) { return createDORAIncidentWithHttpInfoAsync(body) .thenApply( response -> { @@ -233,12 +354,15 @@ public CompletableFuture createDORAIncidentAsync(DORAIncid } /** - * Use this API endpoint to provide failure data for DORA metrics. + * Note: This endpoint is deprecated. Please use /api/v2/dora/failure + * instead. + * + *

Use this API endpoint to provide failure data for DORA metrics. * *

This is necessary for: - Change Failure Rate - Time to Restore * * @param body (required) - * @return ApiResponse<DORAIncidentResponse> + * @return ApiResponse<DORAFailureResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -250,16 +374,12 @@ public CompletableFuture createDORAIncidentAsync(DORAIncid * * *
403 Not Authorized -
429 Too many requests -
+ * + * @deprecated */ - public ApiResponse createDORAIncidentWithHttpInfo(DORAIncidentRequest body) + @Deprecated + public ApiResponse createDORAIncidentWithHttpInfo(DORAFailureRequest body) throws ApiException { - // Check if unstable operation is enabled - String operationId = "createDORAIncident"; - 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 = body; // verify the required parameter 'body' is set @@ -289,7 +409,7 @@ public ApiResponse createDORAIncidentWithHttpInfo(DORAInci localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -298,25 +418,17 @@ public ApiResponse createDORAIncidentWithHttpInfo(DORAInci *

See {@link #createDORAIncidentWithHttpInfo}. * * @param body (required) - * @return CompletableFuture<ApiResponse<DORAIncidentResponse>> + * @return CompletableFuture<ApiResponse<DORAFailureResponse>> + * @deprecated */ - public CompletableFuture> createDORAIncidentWithHttpInfoAsync( - DORAIncidentRequest body) { - // Check if unstable operation is enabled - String operationId = "createDORAIncident"; - 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; - } + @Deprecated + public CompletableFuture> createDORAIncidentWithHttpInfoAsync( + DORAFailureRequest body) { Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, "Missing the required parameter 'body' when calling createDORAIncident")); @@ -339,7 +451,7 @@ public CompletableFuture> createDORAIncidentWi new String[] {"application/json"}, new String[] {"apiKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -351,7 +463,7 @@ public CompletableFuture> createDORAIncidentWi localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** diff --git a/src/main/java/com/datadog/api/client/v2/model/DORAIncidentRequest.java b/src/main/java/com/datadog/api/client/v2/model/DORAFailureRequest.java similarity index 79% rename from src/main/java/com/datadog/api/client/v2/model/DORAIncidentRequest.java rename to src/main/java/com/datadog/api/client/v2/model/DORAFailureRequest.java index 8b000ddd7d3..726031d7db2 100644 --- a/src/main/java/com/datadog/api/client/v2/model/DORAIncidentRequest.java +++ b/src/main/java/com/datadog/api/client/v2/model/DORAFailureRequest.java @@ -17,25 +17,25 @@ import java.util.Map; import java.util.Objects; -/** Request to create a DORA incident event. */ -@JsonPropertyOrder({DORAIncidentRequest.JSON_PROPERTY_DATA}) +/** Request to create a DORA failure event. */ +@JsonPropertyOrder({DORAFailureRequest.JSON_PROPERTY_DATA}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class DORAIncidentRequest { +public class DORAFailureRequest { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_DATA = "data"; - private DORAIncidentRequestData data; + private DORAFailureRequestData data; - public DORAIncidentRequest() {} + public DORAFailureRequest() {} @JsonCreator - public DORAIncidentRequest( - @JsonProperty(required = true, value = JSON_PROPERTY_DATA) DORAIncidentRequestData data) { + public DORAFailureRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) DORAFailureRequestData data) { this.data = data; this.unparsed |= data.unparsed; } - public DORAIncidentRequest data(DORAIncidentRequestData data) { + public DORAFailureRequest data(DORAFailureRequestData data) { this.data = data; this.unparsed |= data.unparsed; return this; @@ -48,11 +48,11 @@ public DORAIncidentRequest data(DORAIncidentRequestData data) { */ @JsonProperty(JSON_PROPERTY_DATA) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public DORAIncidentRequestData getData() { + public DORAFailureRequestData getData() { return data; } - public void setData(DORAIncidentRequestData data) { + public void setData(DORAFailureRequestData data) { this.data = data; } @@ -68,10 +68,10 @@ public void setData(DORAIncidentRequestData data) { * * @param key The arbitrary key to set * @param value The associated value - * @return DORAIncidentRequest + * @return DORAFailureRequest */ @JsonAnySetter - public DORAIncidentRequest putAdditionalProperty(String key, Object value) { + public DORAFailureRequest putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -102,7 +102,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** Return true if this DORAIncidentRequest object is equal to o. */ + /** Return true if this DORAFailureRequest object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -111,9 +111,9 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - DORAIncidentRequest doraIncidentRequest = (DORAIncidentRequest) o; - return Objects.equals(this.data, doraIncidentRequest.data) - && Objects.equals(this.additionalProperties, doraIncidentRequest.additionalProperties); + DORAFailureRequest doraFailureRequest = (DORAFailureRequest) o; + return Objects.equals(this.data, doraFailureRequest.data) + && Objects.equals(this.additionalProperties, doraFailureRequest.additionalProperties); } @Override @@ -124,7 +124,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class DORAIncidentRequest {\n"); + sb.append("class DORAFailureRequest {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/DORAIncidentRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/DORAFailureRequestAttributes.java similarity index 74% rename from src/main/java/com/datadog/api/client/v2/model/DORAIncidentRequestAttributes.java rename to src/main/java/com/datadog/api/client/v2/model/DORAFailureRequestAttributes.java index 6a36c6de20f..d055251664d 100644 --- a/src/main/java/com/datadog/api/client/v2/model/DORAIncidentRequestAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/DORAFailureRequestAttributes.java @@ -19,22 +19,22 @@ import java.util.Map; import java.util.Objects; -/** Attributes to create a DORA incident event. */ +/** Attributes to create a DORA failure event. */ @JsonPropertyOrder({ - DORAIncidentRequestAttributes.JSON_PROPERTY_ENV, - DORAIncidentRequestAttributes.JSON_PROPERTY_FINISHED_AT, - DORAIncidentRequestAttributes.JSON_PROPERTY_GIT, - DORAIncidentRequestAttributes.JSON_PROPERTY_ID, - DORAIncidentRequestAttributes.JSON_PROPERTY_NAME, - DORAIncidentRequestAttributes.JSON_PROPERTY_SERVICES, - DORAIncidentRequestAttributes.JSON_PROPERTY_SEVERITY, - DORAIncidentRequestAttributes.JSON_PROPERTY_STARTED_AT, - DORAIncidentRequestAttributes.JSON_PROPERTY_TEAM, - DORAIncidentRequestAttributes.JSON_PROPERTY_VERSION + DORAFailureRequestAttributes.JSON_PROPERTY_ENV, + DORAFailureRequestAttributes.JSON_PROPERTY_FINISHED_AT, + DORAFailureRequestAttributes.JSON_PROPERTY_GIT, + DORAFailureRequestAttributes.JSON_PROPERTY_ID, + DORAFailureRequestAttributes.JSON_PROPERTY_NAME, + DORAFailureRequestAttributes.JSON_PROPERTY_SERVICES, + DORAFailureRequestAttributes.JSON_PROPERTY_SEVERITY, + DORAFailureRequestAttributes.JSON_PROPERTY_STARTED_AT, + DORAFailureRequestAttributes.JSON_PROPERTY_TEAM, + DORAFailureRequestAttributes.JSON_PROPERTY_VERSION }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class DORAIncidentRequestAttributes { +public class DORAFailureRequestAttributes { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_ENV = "env"; private String env; @@ -66,21 +66,21 @@ public class DORAIncidentRequestAttributes { public static final String JSON_PROPERTY_VERSION = "version"; private String version; - public DORAIncidentRequestAttributes() {} + public DORAFailureRequestAttributes() {} @JsonCreator - public DORAIncidentRequestAttributes( + public DORAFailureRequestAttributes( @JsonProperty(required = true, value = JSON_PROPERTY_STARTED_AT) Long startedAt) { this.startedAt = startedAt; } - public DORAIncidentRequestAttributes env(String env) { + public DORAFailureRequestAttributes env(String env) { this.env = env; return this; } /** - * Environment name that was impacted by the incident. + * Environment name that was impacted by the failure. * * @return env */ @@ -95,13 +95,13 @@ public void setEnv(String env) { this.env = env; } - public DORAIncidentRequestAttributes finishedAt(Long finishedAt) { + public DORAFailureRequestAttributes finishedAt(Long finishedAt) { this.finishedAt = finishedAt; return this; } /** - * Unix timestamp when the incident finished. It must be in nanoseconds, milliseconds, or seconds, + * Unix timestamp when the failure finished. It must be in nanoseconds, milliseconds, or seconds, * and it should not be older than 1 hour. * * @return finishedAt @@ -117,7 +117,7 @@ public void setFinishedAt(Long finishedAt) { this.finishedAt = finishedAt; } - public DORAIncidentRequestAttributes git(DORAGitInfo git) { + public DORAFailureRequestAttributes git(DORAGitInfo git) { this.git = git; this.unparsed |= git.unparsed; return this; @@ -139,13 +139,13 @@ public void setGit(DORAGitInfo git) { this.git = git; } - public DORAIncidentRequestAttributes id(String id) { + public DORAFailureRequestAttributes id(String id) { this.id = id; return this; } /** - * Incident ID. Must have at least 16 characters. Required to update a previously sent incident. + * Failure ID. Must have at least 16 characters. Required to update a previously sent failure. * * @return id */ @@ -160,13 +160,13 @@ public void setId(String id) { this.id = id; } - public DORAIncidentRequestAttributes name(String name) { + public DORAFailureRequestAttributes name(String name) { this.name = name; return this; } /** - * Incident name. + * Failure name. * * @return name */ @@ -181,12 +181,12 @@ public void setName(String name) { this.name = name; } - public DORAIncidentRequestAttributes services(List services) { + public DORAFailureRequestAttributes services(List services) { this.services = services; return this; } - public DORAIncidentRequestAttributes addServicesItem(String servicesItem) { + public DORAFailureRequestAttributes addServicesItem(String servicesItem) { if (this.services == null) { this.services = new ArrayList<>(); } @@ -195,7 +195,7 @@ public DORAIncidentRequestAttributes addServicesItem(String servicesItem) { } /** - * Service names impacted by the incident. If possible, use names registered in the Service + * Service names impacted by the failure. If possible, use names registered in the Service * Catalog. Required when the team field is not provided. * * @return services @@ -211,13 +211,13 @@ public void setServices(List services) { this.services = services; } - public DORAIncidentRequestAttributes severity(String severity) { + public DORAFailureRequestAttributes severity(String severity) { this.severity = severity; return this; } /** - * Incident severity. + * Failure severity. * * @return severity */ @@ -232,13 +232,13 @@ public void setSeverity(String severity) { this.severity = severity; } - public DORAIncidentRequestAttributes startedAt(Long startedAt) { + public DORAFailureRequestAttributes startedAt(Long startedAt) { this.startedAt = startedAt; return this; } /** - * Unix timestamp when the incident started. It must be in nanoseconds, milliseconds, or seconds. + * Unix timestamp when the failure started. It must be in nanoseconds, milliseconds, or seconds. * * @return startedAt */ @@ -252,7 +252,7 @@ public void setStartedAt(Long startedAt) { this.startedAt = startedAt; } - public DORAIncidentRequestAttributes team(String team) { + public DORAFailureRequestAttributes team(String team) { this.team = team; return this; } @@ -274,7 +274,7 @@ public void setTeam(String team) { this.team = team; } - public DORAIncidentRequestAttributes version(String version) { + public DORAFailureRequestAttributes version(String version) { this.version = version; return this; } @@ -309,10 +309,10 @@ public void setVersion(String version) { * * @param key The arbitrary key to set * @param value The associated value - * @return DORAIncidentRequestAttributes + * @return DORAFailureRequestAttributes */ @JsonAnySetter - public DORAIncidentRequestAttributes putAdditionalProperty(String key, Object value) { + public DORAFailureRequestAttributes putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -343,7 +343,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** Return true if this DORAIncidentRequestAttributes object is equal to o. */ + /** Return true if this DORAFailureRequestAttributes object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -352,19 +352,19 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - DORAIncidentRequestAttributes doraIncidentRequestAttributes = (DORAIncidentRequestAttributes) o; - return Objects.equals(this.env, doraIncidentRequestAttributes.env) - && Objects.equals(this.finishedAt, doraIncidentRequestAttributes.finishedAt) - && Objects.equals(this.git, doraIncidentRequestAttributes.git) - && Objects.equals(this.id, doraIncidentRequestAttributes.id) - && Objects.equals(this.name, doraIncidentRequestAttributes.name) - && Objects.equals(this.services, doraIncidentRequestAttributes.services) - && Objects.equals(this.severity, doraIncidentRequestAttributes.severity) - && Objects.equals(this.startedAt, doraIncidentRequestAttributes.startedAt) - && Objects.equals(this.team, doraIncidentRequestAttributes.team) - && Objects.equals(this.version, doraIncidentRequestAttributes.version) + DORAFailureRequestAttributes doraFailureRequestAttributes = (DORAFailureRequestAttributes) o; + return Objects.equals(this.env, doraFailureRequestAttributes.env) + && Objects.equals(this.finishedAt, doraFailureRequestAttributes.finishedAt) + && Objects.equals(this.git, doraFailureRequestAttributes.git) + && Objects.equals(this.id, doraFailureRequestAttributes.id) + && Objects.equals(this.name, doraFailureRequestAttributes.name) + && Objects.equals(this.services, doraFailureRequestAttributes.services) + && Objects.equals(this.severity, doraFailureRequestAttributes.severity) + && Objects.equals(this.startedAt, doraFailureRequestAttributes.startedAt) + && Objects.equals(this.team, doraFailureRequestAttributes.team) + && Objects.equals(this.version, doraFailureRequestAttributes.version) && Objects.equals( - this.additionalProperties, doraIncidentRequestAttributes.additionalProperties); + this.additionalProperties, doraFailureRequestAttributes.additionalProperties); } @Override @@ -386,7 +386,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class DORAIncidentRequestAttributes {\n"); + sb.append("class DORAFailureRequestAttributes {\n"); sb.append(" env: ").append(toIndentedString(env)).append("\n"); sb.append(" finishedAt: ").append(toIndentedString(finishedAt)).append("\n"); sb.append(" git: ").append(toIndentedString(git)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/DORAIncidentRequestData.java b/src/main/java/com/datadog/api/client/v2/model/DORAFailureRequestData.java similarity index 77% rename from src/main/java/com/datadog/api/client/v2/model/DORAIncidentRequestData.java rename to src/main/java/com/datadog/api/client/v2/model/DORAFailureRequestData.java index 09aaf85a933..634db3e44ce 100644 --- a/src/main/java/com/datadog/api/client/v2/model/DORAIncidentRequestData.java +++ b/src/main/java/com/datadog/api/client/v2/model/DORAFailureRequestData.java @@ -18,42 +18,42 @@ import java.util.Objects; /** The JSON:API data. */ -@JsonPropertyOrder({DORAIncidentRequestData.JSON_PROPERTY_ATTRIBUTES}) +@JsonPropertyOrder({DORAFailureRequestData.JSON_PROPERTY_ATTRIBUTES}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class DORAIncidentRequestData { +public class DORAFailureRequestData { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; - private DORAIncidentRequestAttributes attributes; + private DORAFailureRequestAttributes attributes; - public DORAIncidentRequestData() {} + public DORAFailureRequestData() {} @JsonCreator - public DORAIncidentRequestData( + public DORAFailureRequestData( @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) - DORAIncidentRequestAttributes attributes) { + DORAFailureRequestAttributes attributes) { this.attributes = attributes; this.unparsed |= attributes.unparsed; } - public DORAIncidentRequestData attributes(DORAIncidentRequestAttributes attributes) { + public DORAFailureRequestData attributes(DORAFailureRequestAttributes attributes) { this.attributes = attributes; this.unparsed |= attributes.unparsed; return this; } /** - * Attributes to create a DORA incident event. + * Attributes to create a DORA failure event. * * @return attributes */ @JsonProperty(JSON_PROPERTY_ATTRIBUTES) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public DORAIncidentRequestAttributes getAttributes() { + public DORAFailureRequestAttributes getAttributes() { return attributes; } - public void setAttributes(DORAIncidentRequestAttributes attributes) { + public void setAttributes(DORAFailureRequestAttributes attributes) { this.attributes = attributes; } @@ -69,10 +69,10 @@ public void setAttributes(DORAIncidentRequestAttributes attributes) { * * @param key The arbitrary key to set * @param value The associated value - * @return DORAIncidentRequestData + * @return DORAFailureRequestData */ @JsonAnySetter - public DORAIncidentRequestData putAdditionalProperty(String key, Object value) { + public DORAFailureRequestData putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -103,7 +103,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** Return true if this DORAIncidentRequestData object is equal to o. */ + /** Return true if this DORAFailureRequestData object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -112,9 +112,9 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - DORAIncidentRequestData doraIncidentRequestData = (DORAIncidentRequestData) o; - return Objects.equals(this.attributes, doraIncidentRequestData.attributes) - && Objects.equals(this.additionalProperties, doraIncidentRequestData.additionalProperties); + DORAFailureRequestData doraFailureRequestData = (DORAFailureRequestData) o; + return Objects.equals(this.attributes, doraFailureRequestData.attributes) + && Objects.equals(this.additionalProperties, doraFailureRequestData.additionalProperties); } @Override @@ -125,7 +125,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class DORAIncidentRequestData {\n"); + sb.append("class DORAFailureRequestData {\n"); sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/DORAIncidentResponse.java b/src/main/java/com/datadog/api/client/v2/model/DORAFailureResponse.java similarity index 78% rename from src/main/java/com/datadog/api/client/v2/model/DORAIncidentResponse.java rename to src/main/java/com/datadog/api/client/v2/model/DORAFailureResponse.java index f0e6fefa0d9..8749d480609 100644 --- a/src/main/java/com/datadog/api/client/v2/model/DORAIncidentResponse.java +++ b/src/main/java/com/datadog/api/client/v2/model/DORAFailureResponse.java @@ -17,42 +17,42 @@ import java.util.Map; import java.util.Objects; -/** Response after receiving a DORA incident event. */ -@JsonPropertyOrder({DORAIncidentResponse.JSON_PROPERTY_DATA}) +/** Response after receiving a DORA failure event. */ +@JsonPropertyOrder({DORAFailureResponse.JSON_PROPERTY_DATA}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class DORAIncidentResponse { +public class DORAFailureResponse { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_DATA = "data"; - private DORAIncidentResponseData data; + private DORAFailureResponseData data; - public DORAIncidentResponse() {} + public DORAFailureResponse() {} @JsonCreator - public DORAIncidentResponse( - @JsonProperty(required = true, value = JSON_PROPERTY_DATA) DORAIncidentResponseData data) { + public DORAFailureResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) DORAFailureResponseData data) { this.data = data; this.unparsed |= data.unparsed; } - public DORAIncidentResponse data(DORAIncidentResponseData data) { + public DORAFailureResponse data(DORAFailureResponseData data) { this.data = data; this.unparsed |= data.unparsed; return this; } /** - * Response after receiving a DORA incident event. + * Response after receiving a DORA failure event. * * @return data */ @JsonProperty(JSON_PROPERTY_DATA) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public DORAIncidentResponseData getData() { + public DORAFailureResponseData getData() { return data; } - public void setData(DORAIncidentResponseData data) { + public void setData(DORAFailureResponseData data) { this.data = data; } @@ -68,10 +68,10 @@ public void setData(DORAIncidentResponseData data) { * * @param key The arbitrary key to set * @param value The associated value - * @return DORAIncidentResponse + * @return DORAFailureResponse */ @JsonAnySetter - public DORAIncidentResponse putAdditionalProperty(String key, Object value) { + public DORAFailureResponse putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -102,7 +102,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** Return true if this DORAIncidentResponse object is equal to o. */ + /** Return true if this DORAFailureResponse object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -111,9 +111,9 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - DORAIncidentResponse doraIncidentResponse = (DORAIncidentResponse) o; - return Objects.equals(this.data, doraIncidentResponse.data) - && Objects.equals(this.additionalProperties, doraIncidentResponse.additionalProperties); + DORAFailureResponse doraFailureResponse = (DORAFailureResponse) o; + return Objects.equals(this.data, doraFailureResponse.data) + && Objects.equals(this.additionalProperties, doraFailureResponse.additionalProperties); } @Override @@ -124,7 +124,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class DORAIncidentResponse {\n"); + sb.append("class DORAFailureResponse {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/DORAIncidentResponseData.java b/src/main/java/com/datadog/api/client/v2/model/DORAFailureResponseData.java similarity index 77% rename from src/main/java/com/datadog/api/client/v2/model/DORAIncidentResponseData.java rename to src/main/java/com/datadog/api/client/v2/model/DORAFailureResponseData.java index aaf45db1bbc..8f9e8eb1a13 100644 --- a/src/main/java/com/datadog/api/client/v2/model/DORAIncidentResponseData.java +++ b/src/main/java/com/datadog/api/client/v2/model/DORAFailureResponseData.java @@ -17,36 +17,36 @@ import java.util.Map; import java.util.Objects; -/** Response after receiving a DORA incident event. */ +/** Response after receiving a DORA failure event. */ @JsonPropertyOrder({ - DORAIncidentResponseData.JSON_PROPERTY_ID, - DORAIncidentResponseData.JSON_PROPERTY_TYPE + DORAFailureResponseData.JSON_PROPERTY_ID, + DORAFailureResponseData.JSON_PROPERTY_TYPE }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class DORAIncidentResponseData { +public class DORAFailureResponseData { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_ID = "id"; private String id; public static final String JSON_PROPERTY_TYPE = "type"; - private DORAIncidentType type = DORAIncidentType.DORA_INCIDENT; + private DORAFailureType type = DORAFailureType.DORA_FAILURE; - public DORAIncidentResponseData() {} + public DORAFailureResponseData() {} @JsonCreator - public DORAIncidentResponseData( + public DORAFailureResponseData( @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id) { this.id = id; } - public DORAIncidentResponseData id(String id) { + public DORAFailureResponseData id(String id) { this.id = id; return this; } /** - * The ID of the received DORA incident event. + * The ID of the received DORA failure event. * * @return id */ @@ -60,25 +60,25 @@ public void setId(String id) { this.id = id; } - public DORAIncidentResponseData type(DORAIncidentType type) { + public DORAFailureResponseData type(DORAFailureType type) { this.type = type; this.unparsed |= !type.isValid(); return this; } /** - * JSON:API type for DORA incident events. + * JSON:API type for DORA failure events. * * @return type */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public DORAIncidentType getType() { + public DORAFailureType getType() { return type; } - public void setType(DORAIncidentType type) { + public void setType(DORAFailureType type) { if (!type.isValid()) { this.unparsed = true; } @@ -97,10 +97,10 @@ public void setType(DORAIncidentType type) { * * @param key The arbitrary key to set * @param value The associated value - * @return DORAIncidentResponseData + * @return DORAFailureResponseData */ @JsonAnySetter - public DORAIncidentResponseData putAdditionalProperty(String key, Object value) { + public DORAFailureResponseData putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -131,7 +131,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** Return true if this DORAIncidentResponseData object is equal to o. */ + /** Return true if this DORAFailureResponseData object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -140,10 +140,10 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - DORAIncidentResponseData doraIncidentResponseData = (DORAIncidentResponseData) o; - return Objects.equals(this.id, doraIncidentResponseData.id) - && Objects.equals(this.type, doraIncidentResponseData.type) - && Objects.equals(this.additionalProperties, doraIncidentResponseData.additionalProperties); + DORAFailureResponseData doraFailureResponseData = (DORAFailureResponseData) o; + return Objects.equals(this.id, doraFailureResponseData.id) + && Objects.equals(this.type, doraFailureResponseData.type) + && Objects.equals(this.additionalProperties, doraFailureResponseData.additionalProperties); } @Override @@ -154,7 +154,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class DORAIncidentResponseData {\n"); + sb.append("class DORAFailureResponseData {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" additionalProperties: ") diff --git a/src/main/java/com/datadog/api/client/v2/model/DORAIncidentType.java b/src/main/java/com/datadog/api/client/v2/model/DORAFailureType.java similarity index 57% rename from src/main/java/com/datadog/api/client/v2/model/DORAIncidentType.java rename to src/main/java/com/datadog/api/client/v2/model/DORAFailureType.java index 7c90cfb0e4d..004b4da48d0 100644 --- a/src/main/java/com/datadog/api/client/v2/model/DORAIncidentType.java +++ b/src/main/java/com/datadog/api/client/v2/model/DORAFailureType.java @@ -18,37 +18,37 @@ import java.util.HashSet; import java.util.Set; -/** JSON:API type for DORA incident events. */ -@JsonSerialize(using = DORAIncidentType.DORAIncidentTypeSerializer.class) -public class DORAIncidentType extends ModelEnum { +/** JSON:API type for DORA failure events. */ +@JsonSerialize(using = DORAFailureType.DORAFailureTypeSerializer.class) +public class DORAFailureType extends ModelEnum { private static final Set allowedValues = - new HashSet(Arrays.asList("dora_incident")); + new HashSet(Arrays.asList("dora_failure")); - public static final DORAIncidentType DORA_INCIDENT = new DORAIncidentType("dora_incident"); + public static final DORAFailureType DORA_FAILURE = new DORAFailureType("dora_failure"); - DORAIncidentType(String value) { + DORAFailureType(String value) { super(value, allowedValues); } - public static class DORAIncidentTypeSerializer extends StdSerializer { - public DORAIncidentTypeSerializer(Class t) { + public static class DORAFailureTypeSerializer extends StdSerializer { + public DORAFailureTypeSerializer(Class t) { super(t); } - public DORAIncidentTypeSerializer() { + public DORAFailureTypeSerializer() { this(null); } @Override - public void serialize(DORAIncidentType value, JsonGenerator jgen, SerializerProvider provider) + public void serialize(DORAFailureType value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { jgen.writeObject(value.value); } } @JsonCreator - public static DORAIncidentType fromValue(String value) { - return new DORAIncidentType(value); + public static DORAFailureType fromValue(String value) { + return new DORAFailureType(value); } } diff --git a/src/test/resources/cassettes/features/v2/Send_an_incident_event_for_DORA_Metrics_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Send_a_failure_event_for_DORA_Metrics_returns_OK_response.freeze similarity index 100% rename from src/test/resources/cassettes/features/v2/Send_an_incident_event_for_DORA_Metrics_returns_OK_response.freeze rename to src/test/resources/cassettes/features/v2/Send_a_failure_event_for_DORA_Metrics_returns_OK_response.freeze diff --git a/src/test/resources/cassettes/features/v2/Send_an_incident_event_for_DORA_Metrics_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Send_a_failure_event_for_DORA_Metrics_returns_OK_response.json similarity index 96% rename from src/test/resources/cassettes/features/v2/Send_an_incident_event_for_DORA_Metrics_returns_OK_response.json rename to src/test/resources/cassettes/features/v2/Send_a_failure_event_for_DORA_Metrics_returns_OK_response.json index 9149c71acae..bd1a3fde5df 100644 --- a/src/test/resources/cassettes/features/v2/Send_an_incident_event_for_DORA_Metrics_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Send_a_failure_event_for_DORA_Metrics_returns_OK_response.json @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"2775a2d3-6c28-4934-ae60-0ef9ce3720ee\",\"type\":\"dora_incident\"}}", + "body": "{\"data\":{\"id\":\"2775a2d3-6c28-4934-ae60-0ef9ce3720ee\",\"type\":\"dora_failure\"}}", "headers": { "Content-Type": [ "application/vnd.api+json" 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 405ffc37445..2a8112dd62e 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 @@ -71,48 +71,63 @@ Feature: DORA Metrics @skip @team:DataDog/ci-app-backend Scenario: Send a deployment event for DORA Metrics returns "Bad Request" response - Given operation "CreateDORADeployment" enabled - And new "CreateDORADeployment" request + Given new "CreateDORADeployment" request And body with value {"data": {"attributes": {}}} When the request is sent Then the response status is 400 Bad Request - @skip @team:DataDog/ci-app-backend + @generated @skip @team:DataDog/ci-app-backend Scenario: Send a deployment event for DORA Metrics returns "OK - but delayed due to incident" response - Given operation "CreateDORADeployment" enabled - And new "CreateDORADeployment" request - And body with value {"data": {"attributes": {"finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "service": "shopist", "started_at": 1693491974000000000, "version": "v1.12.07"}}} + Given new "CreateDORADeployment" request + And body with value {"data": {"attributes": {"env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "service": "shopist", "started_at": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}} When the request is sent Then the response status is 202 OK - but delayed due to incident @replay-only @team:DataDog/ci-app-backend Scenario: Send a deployment event for DORA Metrics returns "OK" response - Given operation "CreateDORADeployment" enabled - And new "CreateDORADeployment" request + Given new "CreateDORADeployment" request And body with value {"data": {"attributes": {"finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "service": "shopist", "started_at": 1693491974000000000, "version": "v1.12.07"}}} When the request is sent Then the response status is 200 OK @skip @team:DataDog/ci-app-backend - Scenario: Send an incident event for DORA Metrics returns "Bad Request" response - Given operation "CreateDORAIncident" enabled - And new "CreateDORAIncident" request + Scenario: Send a failure event for DORA Metrics returns "Bad Request" response + Given new "CreateDORAIncident" request And body with value {"data": {"attributes": {}}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/ci-app-backend - Scenario: Send an incident event for DORA Metrics returns "OK - but delayed due to incident" response - Given operation "CreateDORAIncident" enabled - And new "CreateDORAIncident" request + Scenario: Send a failure event for DORA Metrics returns "OK - but delayed due to incident" response + Given new "CreateDORAFailure" request And body with value {"data": {"attributes": {"env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests.", "services": ["shopist"], "severity": "High", "started_at": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}} When the request is sent Then the response status is 202 OK - but delayed due to incident @replay-only @team:DataDog/ci-app-backend - Scenario: Send an incident event for DORA Metrics returns "OK" response - Given operation "CreateDORAIncident" enabled - And new "CreateDORAIncident" request + Scenario: Send a failure event for DORA Metrics returns "OK" response + Given new "CreateDORAIncident" request And body with value {"data": {"attributes": {"finished_at": 1707842944600000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests", "services": ["shopist"], "severity": "High", "started_at": 1707842944500000000, "team": "backend", "version": "v1.12.07"}}} When the request is sent Then the response status is 200 OK + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Send an incident event for DORA Metrics returns "Bad Request" response + Given new "CreateDORAIncident" request + And body with value {"data": {"attributes": {"env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests.", "services": ["shopist"], "severity": "High", "started_at": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Send an incident event for DORA Metrics returns "OK - but delayed due to incident" response + Given new "CreateDORAIncident" request + And body with value {"data": {"attributes": {"env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests.", "services": ["shopist"], "severity": "High", "started_at": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}} + When the request is sent + Then the response status is 202 OK - but delayed due to incident + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Send an incident event for DORA Metrics returns "OK" response + Given new "CreateDORAIncident" request + And body with value {"data": {"attributes": {"env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests.", "services": ["shopist"], "severity": "High", "started_at": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}} + 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 fabe7a4db8d..a7a5bb3ac1e 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 @@ -839,6 +839,12 @@ "type": "safe" } }, + "CreateDORAFailure": { + "tag": "DORA Metrics", + "undo": { + "type": "idempotent" + } + }, "ListDORAFailures": { "tag": "DORA Metrics", "undo": {