diff --git a/.apigentools-info b/.apigentools-info index d37d485f720..d363e0ed056 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-05-23 19:26:08.077787", - "spec_repo_commit": "471c4a2a" + "regenerated": "2025-05-26 12:46:03.517132", + "spec_repo_commit": "a6954c1c" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-05-23 19:26:08.093640", - "spec_repo_commit": "471c4a2a" + "regenerated": "2025-05-26 12:46:03.532550", + "spec_repo_commit": "a6954c1c" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 86cc1adcb82..bab91710ce6 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -11083,6 +11083,25 @@ components: type: string x-enum-varnames: - DORA_DEPLOYMENT + DORAEvent: + description: A DORA event. + properties: + attributes: + description: The attributes of the event. + type: object + id: + description: The ID of the event. + type: string + type: + 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: @@ -11118,7 +11137,8 @@ components: git: $ref: '#/components/schemas/DORAGitInfo' id: - description: Incident ID. Required to update a previously sent incident. + description: Incident ID. Must have at least 16 characters. Required to + update a previously sent incident. type: string name: description: Incident name. @@ -11193,6 +11213,113 @@ components: type: string x-enum-varnames: - DORA_INCIDENT + DORAListDeploymentsRequest: + description: Request to get a list of deployments. + properties: + data: + $ref: '#/components/schemas/DORAListDeploymentsRequestData' + required: + - data + type: object + DORAListDeploymentsRequestAttributes: + description: Attributes to get a list of deployments. + properties: + from: + description: Minimum timestamp for requested events. + format: date-time + type: string + limit: + default: 10 + description: Maximum number of events in the response. + format: int32 + maximum: 1000 + type: integer + query: + description: Search query with event platform syntax. + type: string + sort: + description: Sort order (prefixed with `-` for descending). + type: string + to: + description: Maximum timestamp for requested events. + format: date-time + type: string + type: object + DORAListDeploymentsRequestData: + description: The JSON:API data. + properties: + attributes: + $ref: '#/components/schemas/DORAListDeploymentsRequestAttributes' + type: + $ref: '#/components/schemas/DORAListDeploymentsRequestDataType' + required: + - attributes + type: object + DORAListDeploymentsRequestDataType: + description: The definition of `DORAListDeploymentsRequestDataType` object. + enum: + - dora_deployments_list_request + type: string + x-enum-varnames: + - DORA_DEPLOYMENTS_LIST_REQUEST + DORAListFailuresRequest: + description: Request to get a list of failures. + properties: + data: + $ref: '#/components/schemas/DORAListFailuresRequestData' + required: + - data + type: object + DORAListFailuresRequestAttributes: + description: Attributes to get a list of failures. + properties: + from: + description: Minimum timestamp for requested events. + format: date-time + type: string + limit: + default: 10 + description: Maximum number of events in the response. + format: int32 + maximum: 1000 + type: integer + query: + description: Search query with event platform syntax. + type: string + sort: + description: Sort order (prefixed with `-` for descending). + type: string + to: + description: Maximum timestamp for requested events. + format: date-time + type: string + type: object + DORAListFailuresRequestData: + description: The JSON:API data. + properties: + attributes: + $ref: '#/components/schemas/DORAListFailuresRequestAttributes' + type: + $ref: '#/components/schemas/DORAListFailuresRequestDataType' + required: + - attributes + type: object + DORAListFailuresRequestDataType: + description: The definition of `DORAListFailuresRequestDataType` object. + enum: + - dora_failures_list_request + type: string + x-enum-varnames: + - DORA_FAILURES_LIST_REQUEST + DORAListResponse: + description: Response for the DORA list endpoints. + properties: + data: + description: The list of DORA events. + items: + $ref: '#/components/schemas/DORAEvent' + type: array + type: object DashboardListAddItemsRequest: description: Request containing a list of dashboards to add. properties: @@ -45654,10 +45781,163 @@ paths: 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. + operationId: ListDORADeployments + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DORAListDeploymentsRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DORAListResponse' + description: OK + '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: Get a list of deployment events + tags: + - DORA Metrics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - dora_metrics_read + /api/v2/dora/deployments/{deployment_id}: + get: + description: Use this API endpoint to get a deployment event. + operationId: GetDORADeployment + parameters: + - description: The ID of the deployment event. + in: path + name: deployment_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DORAFetchResponse' + description: OK + '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: Get a deployment event + tags: + - DORA Metrics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - dora_metrics_read + /api/v2/dora/failures: + post: + description: Use this API endpoint to get a list of failure events. + operationId: ListDORAFailures + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DORAListFailuresRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DORAListResponse' + description: OK + '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: Get a list of failure events + tags: + - DORA Metrics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - dora_metrics_read + /api/v2/dora/failures/{failure_id}: + get: + description: Use this API endpoint to get a failure event. + operationId: GetDORAFailure + parameters: + - description: The ID of the failure event. + in: path + name: failure_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DORAFetchResponse' + description: OK + '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: Get a failure event + tags: + - DORA Metrics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - dora_metrics_read /api/v2/dora/incident: post: - description: 'Use this API endpoint to provide data about incidents for DORA - metrics. + description: 'Use this API endpoint to provide failure data for DORA metrics. This is necessary for: @@ -62027,9 +62307,12 @@ tags: See the [Container Monitoring page](https://docs.datadoghq.com/containers/) for more information. name: Containers -- description: Send events for DORA Metrics to measure and improve software delivery. - See the [DORA Metrics page](https://docs.datadoghq.com/dora_metrics/) for more - information. +- 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/) + for more information. + + + **Note**: DORA Metrics are not available in the US1-FED site.' name: DORA Metrics - description: 'Interact with your dashboard lists through the API to diff --git a/examples/v2/dora-metrics/GetDORADeployment.java b/examples/v2/dora-metrics/GetDORADeployment.java new file mode 100644 index 00000000000..1d0a1813cb4 --- /dev/null +++ b/examples/v2/dora-metrics/GetDORADeployment.java @@ -0,0 +1,24 @@ +// Get a deployment event 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.DORAFetchResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + DoraMetricsApi apiInstance = new DoraMetricsApi(defaultClient); + + try { + DORAFetchResponse result = apiInstance.getDORADeployment("deployment_id"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DoraMetricsApi#getDORADeployment"); + 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/GetDORAFailure.java b/examples/v2/dora-metrics/GetDORAFailure.java new file mode 100644 index 00000000000..9a856540095 --- /dev/null +++ b/examples/v2/dora-metrics/GetDORAFailure.java @@ -0,0 +1,24 @@ +// Get a failure event 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.DORAFetchResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + DoraMetricsApi apiInstance = new DoraMetricsApi(defaultClient); + + try { + DORAFetchResponse result = apiInstance.getDORAFailure("failure_id"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DoraMetricsApi#getDORAFailure"); + 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/ListDORADeployments.java b/examples/v2/dora-metrics/ListDORADeployments.java new file mode 100644 index 00000000000..cfe6c4eb52c --- /dev/null +++ b/examples/v2/dora-metrics/ListDORADeployments.java @@ -0,0 +1,40 @@ +// Get a list of deployment events 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.DORAListDeploymentsRequest; +import com.datadog.api.client.v2.model.DORAListDeploymentsRequestAttributes; +import com.datadog.api.client.v2.model.DORAListDeploymentsRequestData; +import com.datadog.api.client.v2.model.DORAListDeploymentsRequestDataType; +import com.datadog.api.client.v2.model.DORAListResponse; +import java.time.OffsetDateTime; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + DoraMetricsApi apiInstance = new DoraMetricsApi(defaultClient); + + DORAListDeploymentsRequest body = + new DORAListDeploymentsRequest() + .data( + new DORAListDeploymentsRequestData() + .attributes( + new DORAListDeploymentsRequestAttributes() + .from(OffsetDateTime.parse("2025-03-23T00:00:00Z")) + .limit(1) + .to(OffsetDateTime.parse("2025-03-24T00:00:00Z"))) + .type(DORAListDeploymentsRequestDataType.DORA_DEPLOYMENTS_LIST_REQUEST)); + + try { + DORAListResponse result = apiInstance.listDORADeployments(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DoraMetricsApi#listDORADeployments"); + 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/ListDORAFailures.java b/examples/v2/dora-metrics/ListDORAFailures.java new file mode 100644 index 00000000000..dc0f181b69c --- /dev/null +++ b/examples/v2/dora-metrics/ListDORAFailures.java @@ -0,0 +1,40 @@ +// Get a list of failure events 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.DORAListFailuresRequest; +import com.datadog.api.client.v2.model.DORAListFailuresRequestAttributes; +import com.datadog.api.client.v2.model.DORAListFailuresRequestData; +import com.datadog.api.client.v2.model.DORAListFailuresRequestDataType; +import com.datadog.api.client.v2.model.DORAListResponse; +import java.time.OffsetDateTime; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + DoraMetricsApi apiInstance = new DoraMetricsApi(defaultClient); + + DORAListFailuresRequest body = + new DORAListFailuresRequest() + .data( + new DORAListFailuresRequestData() + .attributes( + new DORAListFailuresRequestAttributes() + .from(OffsetDateTime.parse("2025-03-23T00:00:00Z")) + .limit(1) + .to(OffsetDateTime.parse("2025-03-24T00:00:00Z"))) + .type(DORAListFailuresRequestDataType.DORA_FAILURES_LIST_REQUEST)); + + try { + DORAListResponse result = apiInstance.listDORAFailures(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DoraMetricsApi#listDORAFailures"); + 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 671ca7e1397..24056ee4dcd 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,8 +6,12 @@ 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.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; import jakarta.ws.rs.client.Invocation; import jakarta.ws.rs.core.GenericType; import java.util.ArrayList; @@ -229,7 +233,7 @@ public CompletableFuture createDORAIncidentAsync(DORAIncid } /** - * Use this API endpoint to provide data about incidents for DORA metrics. + * Use this API endpoint to provide failure data for DORA metrics. * *

This is necessary for: - Change Failure Rate - Time to Restore * @@ -349,4 +353,539 @@ public CompletableFuture> createDORAIncidentWi false, new GenericType() {}); } + + /** + * Get a deployment event. + * + *

See {@link #getDORADeploymentWithHttpInfo}. + * + * @param deploymentId The ID of the deployment event. (required) + * @return DORAFetchResponse + * @throws ApiException if fails to make API call + */ + public DORAFetchResponse getDORADeployment(String deploymentId) throws ApiException { + return getDORADeploymentWithHttpInfo(deploymentId).getData(); + } + + /** + * Get a deployment event. + * + *

See {@link #getDORADeploymentWithHttpInfoAsync}. + * + * @param deploymentId The ID of the deployment event. (required) + * @return CompletableFuture<DORAFetchResponse> + */ + public CompletableFuture getDORADeploymentAsync(String deploymentId) { + return getDORADeploymentWithHttpInfoAsync(deploymentId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Use this API endpoint to get a deployment event. + * + * @param deploymentId The ID of the deployment event. (required) + * @return ApiResponse<DORAFetchResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse getDORADeploymentWithHttpInfo(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 getDORADeployment"); + } + // create path and map variables + String localVarPath = + "/api/v2/dora/deployments/{deployment_id}" + .replaceAll( + "\\{" + "deployment_id" + "\\}", apiClient.escapeString(deploymentId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.DoraMetricsApi.getDORADeployment", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"appKeyAuth", "apiKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a deployment event. + * + *

See {@link #getDORADeploymentWithHttpInfo}. + * + * @param deploymentId The ID of the deployment event. (required) + * @return CompletableFuture<ApiResponse<DORAFetchResponse>> + */ + public CompletableFuture> getDORADeploymentWithHttpInfoAsync( + 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 getDORADeployment")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/dora/deployments/{deployment_id}" + .replaceAll( + "\\{" + "deployment_id" + "\\}", apiClient.escapeString(deploymentId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.DoraMetricsApi.getDORADeployment", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"appKeyAuth", "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() {}); + } + + /** + * Get a failure event. + * + *

See {@link #getDORAFailureWithHttpInfo}. + * + * @param failureId The ID of the failure event. (required) + * @return DORAFetchResponse + * @throws ApiException if fails to make API call + */ + public DORAFetchResponse getDORAFailure(String failureId) throws ApiException { + return getDORAFailureWithHttpInfo(failureId).getData(); + } + + /** + * Get a failure event. + * + *

See {@link #getDORAFailureWithHttpInfoAsync}. + * + * @param failureId The ID of the failure event. (required) + * @return CompletableFuture<DORAFetchResponse> + */ + public CompletableFuture getDORAFailureAsync(String failureId) { + return getDORAFailureWithHttpInfoAsync(failureId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Use this API endpoint to get a failure event. + * + * @param failureId The ID of the failure event. (required) + * @return ApiResponse<DORAFetchResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse getDORAFailureWithHttpInfo(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 getDORAFailure"); + } + // create path and map variables + String localVarPath = + "/api/v2/dora/failures/{failure_id}" + .replaceAll("\\{" + "failure_id" + "\\}", apiClient.escapeString(failureId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.DoraMetricsApi.getDORAFailure", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"appKeyAuth", "apiKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a failure event. + * + *

See {@link #getDORAFailureWithHttpInfo}. + * + * @param failureId The ID of the failure event. (required) + * @return CompletableFuture<ApiResponse<DORAFetchResponse>> + */ + public CompletableFuture> getDORAFailureWithHttpInfoAsync( + 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 getDORAFailure")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/dora/failures/{failure_id}" + .replaceAll("\\{" + "failure_id" + "\\}", apiClient.escapeString(failureId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.DoraMetricsApi.getDORAFailure", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"appKeyAuth", "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() {}); + } + + /** + * Get a list of deployment events. + * + *

See {@link #listDORADeploymentsWithHttpInfo}. + * + * @param body (required) + * @return DORAListResponse + * @throws ApiException if fails to make API call + */ + public DORAListResponse listDORADeployments(DORAListDeploymentsRequest body) throws ApiException { + return listDORADeploymentsWithHttpInfo(body).getData(); + } + + /** + * Get a list of deployment events. + * + *

See {@link #listDORADeploymentsWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<DORAListResponse> + */ + public CompletableFuture listDORADeploymentsAsync( + DORAListDeploymentsRequest body) { + return listDORADeploymentsWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Use this API endpoint to get a list of deployment events. + * + * @param body (required) + * @return ApiResponse<DORAListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse listDORADeploymentsWithHttpInfo( + DORAListDeploymentsRequest 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 listDORADeployments"); + } + // create path and map variables + String localVarPath = "/api/v2/dora/deployments"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.DoraMetricsApi.listDORADeployments", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a list of deployment events. + * + *

See {@link #listDORADeploymentsWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<DORAListResponse>> + */ + public CompletableFuture> listDORADeploymentsWithHttpInfoAsync( + DORAListDeploymentsRequest 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 listDORADeployments")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/dora/deployments"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.DoraMetricsApi.listDORADeployments", + 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( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a list of failure events. + * + *

See {@link #listDORAFailuresWithHttpInfo}. + * + * @param body (required) + * @return DORAListResponse + * @throws ApiException if fails to make API call + */ + public DORAListResponse listDORAFailures(DORAListFailuresRequest body) throws ApiException { + return listDORAFailuresWithHttpInfo(body).getData(); + } + + /** + * Get a list of failure events. + * + *

See {@link #listDORAFailuresWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<DORAListResponse> + */ + public CompletableFuture listDORAFailuresAsync(DORAListFailuresRequest body) { + return listDORAFailuresWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Use this API endpoint to get a list of failure events. + * + * @param body (required) + * @return ApiResponse<DORAListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse listDORAFailuresWithHttpInfo(DORAListFailuresRequest 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 listDORAFailures"); + } + // create path and map variables + String localVarPath = "/api/v2/dora/failures"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.DoraMetricsApi.listDORAFailures", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a list of failure events. + * + *

See {@link #listDORAFailuresWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<DORAListResponse>> + */ + public CompletableFuture> listDORAFailuresWithHttpInfoAsync( + DORAListFailuresRequest 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 listDORAFailures")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/dora/failures"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.DoraMetricsApi.listDORAFailures", + 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( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } } diff --git a/src/main/java/com/datadog/api/client/v2/model/DORAEvent.java b/src/main/java/com/datadog/api/client/v2/model/DORAEvent.java new file mode 100644 index 00000000000..16d0764e0f1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DORAEvent.java @@ -0,0 +1,191 @@ +/* + * 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.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; + +/** A DORA event. */ +@JsonPropertyOrder({ + DORAEvent.JSON_PROPERTY_ATTRIBUTES, + DORAEvent.JSON_PROPERTY_ID, + DORAEvent.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DORAEvent { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private Object attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public DORAEvent attributes(Object attributes) { + this.attributes = attributes; + return this; + } + + /** + * The attributes of the event. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAttributes() { + return attributes; + } + + public void setAttributes(Object attributes) { + this.attributes = attributes; + } + + public DORAEvent id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the event. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public DORAEvent type(String type) { + this.type = type; + return this; + } + + /** + * The type of the event. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String type) { + 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 DORAEvent + */ + @JsonAnySetter + public DORAEvent 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 DORAEvent object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DORAEvent doraEvent = (DORAEvent) o; + return Objects.equals(this.attributes, doraEvent.attributes) + && Objects.equals(this.id, doraEvent.id) + && Objects.equals(this.type, doraEvent.type) + && Objects.equals(this.additionalProperties, doraEvent.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DORAEvent {\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/DORAFetchResponse.java b/src/main/java/com/datadog/api/client/v2/model/DORAFetchResponse.java new file mode 100644 index 00000000000..b06321fae34 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DORAFetchResponse.java @@ -0,0 +1,136 @@ +/* + * 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.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 DORA fetch endpoints. */ +@JsonPropertyOrder({DORAFetchResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DORAFetchResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private DORAEvent data; + + public DORAFetchResponse data(DORAEvent data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A DORA event. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DORAEvent getData() { + return data; + } + + public void setData(DORAEvent 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 DORAFetchResponse + */ + @JsonAnySetter + public DORAFetchResponse 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 DORAFetchResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DORAFetchResponse doraFetchResponse = (DORAFetchResponse) o; + return Objects.equals(this.data, doraFetchResponse.data) + && Objects.equals(this.additionalProperties, doraFetchResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DORAFetchResponse {\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/DORAIncidentRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/DORAIncidentRequestAttributes.java index 4dd8a87e364..6a36c6de20f 100644 --- a/src/main/java/com/datadog/api/client/v2/model/DORAIncidentRequestAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/DORAIncidentRequestAttributes.java @@ -145,7 +145,7 @@ public DORAIncidentRequestAttributes id(String id) { } /** - * Incident ID. Required to update a previously sent incident. + * Incident ID. Must have at least 16 characters. Required to update a previously sent incident. * * @return id */ diff --git a/src/main/java/com/datadog/api/client/v2/model/DORAListDeploymentsRequest.java b/src/main/java/com/datadog/api/client/v2/model/DORAListDeploymentsRequest.java new file mode 100644 index 00000000000..986b908a753 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DORAListDeploymentsRequest.java @@ -0,0 +1,147 @@ +/* + * 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; + +/** Request to get a list of deployments. */ +@JsonPropertyOrder({DORAListDeploymentsRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DORAListDeploymentsRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private DORAListDeploymentsRequestData data; + + public DORAListDeploymentsRequest() {} + + @JsonCreator + public DORAListDeploymentsRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + DORAListDeploymentsRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public DORAListDeploymentsRequest data(DORAListDeploymentsRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The JSON:API data. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DORAListDeploymentsRequestData getData() { + return data; + } + + public void setData(DORAListDeploymentsRequestData 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 DORAListDeploymentsRequest + */ + @JsonAnySetter + public DORAListDeploymentsRequest 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 DORAListDeploymentsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DORAListDeploymentsRequest doraListDeploymentsRequest = (DORAListDeploymentsRequest) o; + return Objects.equals(this.data, doraListDeploymentsRequest.data) + && Objects.equals( + this.additionalProperties, doraListDeploymentsRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DORAListDeploymentsRequest {\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/DORAListDeploymentsRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/DORAListDeploymentsRequestAttributes.java new file mode 100644 index 00000000000..93c4576f846 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DORAListDeploymentsRequestAttributes.java @@ -0,0 +1,248 @@ +/* + * 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes to get a list of deployments. */ +@JsonPropertyOrder({ + DORAListDeploymentsRequestAttributes.JSON_PROPERTY_FROM, + DORAListDeploymentsRequestAttributes.JSON_PROPERTY_LIMIT, + DORAListDeploymentsRequestAttributes.JSON_PROPERTY_QUERY, + DORAListDeploymentsRequestAttributes.JSON_PROPERTY_SORT, + DORAListDeploymentsRequestAttributes.JSON_PROPERTY_TO +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DORAListDeploymentsRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FROM = "from"; + private OffsetDateTime from; + + public static final String JSON_PROPERTY_LIMIT = "limit"; + private Integer limit = 10; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public static final String JSON_PROPERTY_SORT = "sort"; + private String sort; + + public static final String JSON_PROPERTY_TO = "to"; + private OffsetDateTime to; + + public DORAListDeploymentsRequestAttributes from(OffsetDateTime from) { + this.from = from; + return this; + } + + /** + * Minimum timestamp for requested events. + * + * @return from + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getFrom() { + return from; + } + + public void setFrom(OffsetDateTime from) { + this.from = from; + } + + public DORAListDeploymentsRequestAttributes limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Maximum number of events in the response. maximum: 1000 + * + * @return limit + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public DORAListDeploymentsRequestAttributes query(String query) { + this.query = query; + return this; + } + + /** + * Search query with event platform syntax. + * + * @return query + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public DORAListDeploymentsRequestAttributes sort(String sort) { + this.sort = sort; + return this; + } + + /** + * Sort order (prefixed with - for descending). + * + * @return sort + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort; + } + + public DORAListDeploymentsRequestAttributes to(OffsetDateTime to) { + this.to = to; + return this; + } + + /** + * Maximum timestamp for requested events. + * + * @return to + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getTo() { + return to; + } + + public void setTo(OffsetDateTime to) { + this.to = to; + } + + /** + * 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 DORAListDeploymentsRequestAttributes + */ + @JsonAnySetter + public DORAListDeploymentsRequestAttributes 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 DORAListDeploymentsRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DORAListDeploymentsRequestAttributes doraListDeploymentsRequestAttributes = + (DORAListDeploymentsRequestAttributes) o; + return Objects.equals(this.from, doraListDeploymentsRequestAttributes.from) + && Objects.equals(this.limit, doraListDeploymentsRequestAttributes.limit) + && Objects.equals(this.query, doraListDeploymentsRequestAttributes.query) + && Objects.equals(this.sort, doraListDeploymentsRequestAttributes.sort) + && Objects.equals(this.to, doraListDeploymentsRequestAttributes.to) + && Objects.equals( + this.additionalProperties, doraListDeploymentsRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(from, limit, query, sort, to, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DORAListDeploymentsRequestAttributes {\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" sort: ").append(toIndentedString(sort)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).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/DORAListDeploymentsRequestData.java b/src/main/java/com/datadog/api/client/v2/model/DORAListDeploymentsRequestData.java new file mode 100644 index 00000000000..91c08451c33 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DORAListDeploymentsRequestData.java @@ -0,0 +1,182 @@ +/* + * 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; + +/** The JSON:API data. */ +@JsonPropertyOrder({ + DORAListDeploymentsRequestData.JSON_PROPERTY_ATTRIBUTES, + DORAListDeploymentsRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DORAListDeploymentsRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private DORAListDeploymentsRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DORAListDeploymentsRequestDataType type; + + public DORAListDeploymentsRequestData() {} + + @JsonCreator + public DORAListDeploymentsRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + DORAListDeploymentsRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + } + + public DORAListDeploymentsRequestData attributes( + DORAListDeploymentsRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes to get a list of deployments. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DORAListDeploymentsRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(DORAListDeploymentsRequestAttributes attributes) { + this.attributes = attributes; + } + + public DORAListDeploymentsRequestData type(DORAListDeploymentsRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The definition of DORAListDeploymentsRequestDataType object. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DORAListDeploymentsRequestDataType getType() { + return type; + } + + public void setType(DORAListDeploymentsRequestDataType 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 DORAListDeploymentsRequestData + */ + @JsonAnySetter + public DORAListDeploymentsRequestData 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 DORAListDeploymentsRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DORAListDeploymentsRequestData doraListDeploymentsRequestData = + (DORAListDeploymentsRequestData) o; + return Objects.equals(this.attributes, doraListDeploymentsRequestData.attributes) + && Objects.equals(this.type, doraListDeploymentsRequestData.type) + && Objects.equals( + this.additionalProperties, doraListDeploymentsRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DORAListDeploymentsRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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/DORAListDeploymentsRequestDataType.java b/src/main/java/com/datadog/api/client/v2/model/DORAListDeploymentsRequestDataType.java new file mode 100644 index 00000000000..959df11bc03 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DORAListDeploymentsRequestDataType.java @@ -0,0 +1,59 @@ +/* + * 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; + +/** The definition of DORAListDeploymentsRequestDataType object. */ +@JsonSerialize( + using = DORAListDeploymentsRequestDataType.DORAListDeploymentsRequestDataTypeSerializer.class) +public class DORAListDeploymentsRequestDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("dora_deployments_list_request")); + + public static final DORAListDeploymentsRequestDataType DORA_DEPLOYMENTS_LIST_REQUEST = + new DORAListDeploymentsRequestDataType("dora_deployments_list_request"); + + DORAListDeploymentsRequestDataType(String value) { + super(value, allowedValues); + } + + public static class DORAListDeploymentsRequestDataTypeSerializer + extends StdSerializer { + public DORAListDeploymentsRequestDataTypeSerializer( + Class t) { + super(t); + } + + public DORAListDeploymentsRequestDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + DORAListDeploymentsRequestDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static DORAListDeploymentsRequestDataType fromValue(String value) { + return new DORAListDeploymentsRequestDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DORAListFailuresRequest.java b/src/main/java/com/datadog/api/client/v2/model/DORAListFailuresRequest.java new file mode 100644 index 00000000000..4e6418762b8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DORAListFailuresRequest.java @@ -0,0 +1,145 @@ +/* + * 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; + +/** Request to get a list of failures. */ +@JsonPropertyOrder({DORAListFailuresRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DORAListFailuresRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private DORAListFailuresRequestData data; + + public DORAListFailuresRequest() {} + + @JsonCreator + public DORAListFailuresRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) DORAListFailuresRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public DORAListFailuresRequest data(DORAListFailuresRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The JSON:API data. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DORAListFailuresRequestData getData() { + return data; + } + + public void setData(DORAListFailuresRequestData 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 DORAListFailuresRequest + */ + @JsonAnySetter + public DORAListFailuresRequest 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 DORAListFailuresRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DORAListFailuresRequest doraListFailuresRequest = (DORAListFailuresRequest) o; + return Objects.equals(this.data, doraListFailuresRequest.data) + && Objects.equals(this.additionalProperties, doraListFailuresRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DORAListFailuresRequest {\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/DORAListFailuresRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/DORAListFailuresRequestAttributes.java new file mode 100644 index 00000000000..ce77bdb3c7b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DORAListFailuresRequestAttributes.java @@ -0,0 +1,248 @@ +/* + * 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes to get a list of failures. */ +@JsonPropertyOrder({ + DORAListFailuresRequestAttributes.JSON_PROPERTY_FROM, + DORAListFailuresRequestAttributes.JSON_PROPERTY_LIMIT, + DORAListFailuresRequestAttributes.JSON_PROPERTY_QUERY, + DORAListFailuresRequestAttributes.JSON_PROPERTY_SORT, + DORAListFailuresRequestAttributes.JSON_PROPERTY_TO +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DORAListFailuresRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FROM = "from"; + private OffsetDateTime from; + + public static final String JSON_PROPERTY_LIMIT = "limit"; + private Integer limit = 10; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public static final String JSON_PROPERTY_SORT = "sort"; + private String sort; + + public static final String JSON_PROPERTY_TO = "to"; + private OffsetDateTime to; + + public DORAListFailuresRequestAttributes from(OffsetDateTime from) { + this.from = from; + return this; + } + + /** + * Minimum timestamp for requested events. + * + * @return from + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getFrom() { + return from; + } + + public void setFrom(OffsetDateTime from) { + this.from = from; + } + + public DORAListFailuresRequestAttributes limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Maximum number of events in the response. maximum: 1000 + * + * @return limit + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public DORAListFailuresRequestAttributes query(String query) { + this.query = query; + return this; + } + + /** + * Search query with event platform syntax. + * + * @return query + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public DORAListFailuresRequestAttributes sort(String sort) { + this.sort = sort; + return this; + } + + /** + * Sort order (prefixed with - for descending). + * + * @return sort + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort; + } + + public DORAListFailuresRequestAttributes to(OffsetDateTime to) { + this.to = to; + return this; + } + + /** + * Maximum timestamp for requested events. + * + * @return to + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getTo() { + return to; + } + + public void setTo(OffsetDateTime to) { + this.to = to; + } + + /** + * 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 DORAListFailuresRequestAttributes + */ + @JsonAnySetter + public DORAListFailuresRequestAttributes 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 DORAListFailuresRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DORAListFailuresRequestAttributes doraListFailuresRequestAttributes = + (DORAListFailuresRequestAttributes) o; + return Objects.equals(this.from, doraListFailuresRequestAttributes.from) + && Objects.equals(this.limit, doraListFailuresRequestAttributes.limit) + && Objects.equals(this.query, doraListFailuresRequestAttributes.query) + && Objects.equals(this.sort, doraListFailuresRequestAttributes.sort) + && Objects.equals(this.to, doraListFailuresRequestAttributes.to) + && Objects.equals( + this.additionalProperties, doraListFailuresRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(from, limit, query, sort, to, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DORAListFailuresRequestAttributes {\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" sort: ").append(toIndentedString(sort)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).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/DORAListFailuresRequestData.java b/src/main/java/com/datadog/api/client/v2/model/DORAListFailuresRequestData.java new file mode 100644 index 00000000000..77fd5209e95 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DORAListFailuresRequestData.java @@ -0,0 +1,180 @@ +/* + * 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; + +/** The JSON:API data. */ +@JsonPropertyOrder({ + DORAListFailuresRequestData.JSON_PROPERTY_ATTRIBUTES, + DORAListFailuresRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DORAListFailuresRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private DORAListFailuresRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DORAListFailuresRequestDataType type; + + public DORAListFailuresRequestData() {} + + @JsonCreator + public DORAListFailuresRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + DORAListFailuresRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + } + + public DORAListFailuresRequestData attributes(DORAListFailuresRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes to get a list of failures. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DORAListFailuresRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(DORAListFailuresRequestAttributes attributes) { + this.attributes = attributes; + } + + public DORAListFailuresRequestData type(DORAListFailuresRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The definition of DORAListFailuresRequestDataType object. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DORAListFailuresRequestDataType getType() { + return type; + } + + public void setType(DORAListFailuresRequestDataType 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 DORAListFailuresRequestData + */ + @JsonAnySetter + public DORAListFailuresRequestData 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 DORAListFailuresRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DORAListFailuresRequestData doraListFailuresRequestData = (DORAListFailuresRequestData) o; + return Objects.equals(this.attributes, doraListFailuresRequestData.attributes) + && Objects.equals(this.type, doraListFailuresRequestData.type) + && Objects.equals( + this.additionalProperties, doraListFailuresRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DORAListFailuresRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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/DORAListFailuresRequestDataType.java b/src/main/java/com/datadog/api/client/v2/model/DORAListFailuresRequestDataType.java new file mode 100644 index 00000000000..91b40eb564b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DORAListFailuresRequestDataType.java @@ -0,0 +1,58 @@ +/* + * 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; + +/** The definition of DORAListFailuresRequestDataType object. */ +@JsonSerialize( + using = DORAListFailuresRequestDataType.DORAListFailuresRequestDataTypeSerializer.class) +public class DORAListFailuresRequestDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("dora_failures_list_request")); + + public static final DORAListFailuresRequestDataType DORA_FAILURES_LIST_REQUEST = + new DORAListFailuresRequestDataType("dora_failures_list_request"); + + DORAListFailuresRequestDataType(String value) { + super(value, allowedValues); + } + + public static class DORAListFailuresRequestDataTypeSerializer + extends StdSerializer { + public DORAListFailuresRequestDataTypeSerializer(Class t) { + super(t); + } + + public DORAListFailuresRequestDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + DORAListFailuresRequestDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static DORAListFailuresRequestDataType fromValue(String value) { + return new DORAListFailuresRequestDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DORAListResponse.java b/src/main/java/com/datadog/api/client/v2/model/DORAListResponse.java new file mode 100644 index 00000000000..3199fd3b3a9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DORAListResponse.java @@ -0,0 +1,149 @@ +/* + * 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.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; + +/** Response for the DORA list endpoints. */ +@JsonPropertyOrder({DORAListResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DORAListResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public DORAListResponse data(List data) { + this.data = data; + for (DORAEvent item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public DORAListResponse addDataItem(DORAEvent dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * The list of DORA events. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List 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 DORAListResponse + */ + @JsonAnySetter + public DORAListResponse 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 DORAListResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DORAListResponse doraListResponse = (DORAListResponse) o; + return Objects.equals(this.data, doraListResponse.data) + && Objects.equals(this.additionalProperties, doraListResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DORAListResponse {\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/test/resources/cassettes/features/v2/Get_a_list_of_deployment_events_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_list_of_deployment_events_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..1c4b73d0cd6 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_list_of_deployment_events_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-05-22T10:44:58.608Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_list_of_deployment_events_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Get_a_list_of_deployment_events_returns_Bad_Request_response.json new file mode 100644 index 00000000000..17b6a140d6b --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_list_of_deployment_events_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"limit\":10}}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/dora/deployments", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"got type \\\"\\\" expected one of \\\"dora_deployments_list_request\\\"\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "bc424fda-03db-aeb6-36fc-28f119c9e958" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_list_of_deployment_events_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_list_of_deployment_events_returns_OK_response.freeze new file mode 100644 index 00000000000..7923009d929 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_list_of_deployment_events_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-05-22T10:44:58.897Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_list_of_deployment_events_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_a_list_of_deployment_events_returns_OK_response.json new file mode 100644 index 00000000000..09055509e97 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_list_of_deployment_events_returns_OK_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"from\":\"2025-03-23T00:00:00Z\",\"limit\":1,\"to\":\"2025-03-24T00:00:00Z\"},\"type\":\"dora_deployments_list_request\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/dora/deployments", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c2b81df5-7288-016a-dc7b-43b10f30e046" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_list_of_failure_events_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_list_of_failure_events_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..56c19d6fd67 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_list_of_failure_events_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-05-22T10:44:59.446Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_list_of_failure_events_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Get_a_list_of_failure_events_returns_Bad_Request_response.json new file mode 100644 index 00000000000..5e7543b4ed1 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_list_of_failure_events_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"limit\":10}}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/dora/failures", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"got type \\\"\\\" expected one of \\\"dora_failures_list_request\\\"\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "3b3f5224-d1c6-7982-a74f-8193573c7f63" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_list_of_failure_events_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_list_of_failure_events_returns_OK_response.freeze new file mode 100644 index 00000000000..e60b1ad7889 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_list_of_failure_events_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-05-22T10:44:59.522Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_list_of_failure_events_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_a_list_of_failure_events_returns_OK_response.json new file mode 100644 index 00000000000..0865124a70c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_list_of_failure_events_returns_OK_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"from\":\"2025-03-23T00:00:00Z\",\"limit\":1,\"to\":\"2025-03-24T00:00:00Z\"},\"type\":\"dora_failures_list_request\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/dora/failures", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ff9b2962-0b42-02d8-8ae9-22d7bbb9ff5a" + } +] \ No newline at end of file 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 79560d2dd04..405ffc37445 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,13 +1,74 @@ @endpoint(dora-metrics) @endpoint(dora-metrics-v2) Feature: DORA Metrics - Send events for DORA Metrics to measure and improve software delivery. See - the [DORA Metrics page](https://docs.datadoghq.com/dora_metrics/) for more - information. + 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/) for more information. + **Note**: DORA Metrics are not available in the US1-FED site. Background: Given a valid "apiKeyAuth" key in the system And an instance of "DORAMetrics" API + @generated @skip @team:DataDog/ci-app-backend + Scenario: Get a deployment event returns "Bad Request" response + Given new "GetDORADeployment" request + And request contains "deployment_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 "OK" response + Given new "GetDORADeployment" request + And request contains "deployment_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Get a failure event returns "Bad Request" response + Given new "GetDORAFailure" request + 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 failure event returns "OK" response + Given new "GetDORAFailure" request + And request contains "failure_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @team:DataDog/ci-app-backend + Scenario: Get a list of deployment events returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And new "ListDORADeployments" request + And body with value {"data": {"attributes": {"limit": 10}}} + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/ci-app-backend + Scenario: Get a list of deployment events returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "ListDORADeployments" request + And body with value {"data": {"attributes": {"from": "2025-03-23T00:00:00Z", "limit": 1, "to": "2025-03-24T00:00:00Z"}, "type": "dora_deployments_list_request"}} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/ci-app-backend + Scenario: Get a list of failure events returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And new "ListDORAFailures" request + And body with value {"data": {"attributes": {"limit": 10}}} + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/ci-app-backend + Scenario: Get a list of failure events returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "ListDORAFailures" request + And body with value {"data": {"attributes": {"from": "2025-03-23T00:00:00Z", "limit": 1, "to": "2025-03-24T00:00:00Z"}, "type": "dora_failures_list_request"}} + When the request is sent + Then the response status is 200 OK + @skip @team:DataDog/ci-app-backend Scenario: Send a deployment event for DORA Metrics returns "Bad Request" response Given operation "CreateDORADeployment" enabled 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 f0e1c34ab16..69af02feb69 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 @@ -827,6 +827,30 @@ "type": "idempotent" } }, + "ListDORADeployments": { + "tag": "DORA Metrics", + "undo": { + "type": "safe" + } + }, + "GetDORADeployment": { + "tag": "DORA Metrics", + "undo": { + "type": "safe" + } + }, + "ListDORAFailures": { + "tag": "DORA Metrics", + "undo": { + "type": "safe" + } + }, + "GetDORAFailure": { + "tag": "DORA Metrics", + "undo": { + "type": "safe" + } + }, "CreateDORAIncident": { "tag": "DORA Metrics", "undo": {