diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index f3ca46bc048..d47fe5b190e 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -15878,6 +15878,78 @@ components: type: string nullable: true type: array + DORADeploymentFetchResponse: + description: Response for fetching a single deployment event. + properties: + data: + $ref: '#/components/schemas/DORADeploymentObject' + type: object + DORADeploymentObject: + description: A DORA deployment event. + example: + attributes: + custom_tags: + - language:java + - department:engineering + - region:us-east-1 + env: production + finished_at: 1693491984000000000 + git: + commit_sha: 66adc9350f2cc9b250b69abddab733dd55e1a588 + repository_url: https://github.com/organization/example-repository + service: shopist + started_at: 1693491974000000000 + team: backend + version: v1.12.07 + id: 4242fcdd31586083 + type: dora_deployment + properties: + attributes: + $ref: '#/components/schemas/DORADeploymentObjectAttributes' + id: + description: The ID of the deployment event. + type: string + type: + $ref: '#/components/schemas/DORADeploymentType' + type: object + DORADeploymentObjectAttributes: + description: The attributes of the deployment event. + properties: + custom_tags: + $ref: '#/components/schemas/DORACustomTags' + env: + description: Environment name to where the service was deployed. + example: production + type: string + finished_at: + description: Unix timestamp when the deployment finished. + example: 1693491984000000000 + format: int64 + type: integer + git: + $ref: '#/components/schemas/DORAGitInfo' + service: + description: Service name. + example: shopist + type: string + started_at: + description: Unix timestamp when the deployment started. + example: 1693491974000000000 + format: int64 + type: integer + team: + description: Name of the team owning the deployed service. + example: backend + type: string + version: + description: Version to correlate with APM Deployment Tracking. + example: v1.12.07 + type: string + required: + - service + - started_at + - finished_at + type: object DORADeploymentRequest: description: Request to create a DORA deployment event. properties: @@ -15968,18 +16040,53 @@ components: type: string x-enum-varnames: - DORA_DEPLOYMENT - DORAEvent: - description: A DORA event. + DORADeploymentsListResponse: + description: Response for the list deployments endpoint. + example: + data: + - attributes: + custom_tags: + - language:java + - department:engineering + - region:us-east-1 + env: production + finished_at: 1693491984000000000 + git: + commit_sha: 66adc9350f2cc9b250b69abddab733dd55e1a588 + repository_url: https://github.com/organization/example-repository + service: shopist + started_at: 1693491974000000000 + team: backend + version: v1.12.07 + id: 4242fcdd31586083 + type: dora_deployment + - attributes: + custom_tags: + - language:go + - department:platform + env: production + finished_at: 1693492084000000000 + git: + commit_sha: 77bdc9350f2cc9b250b69abddab733dd55e1a599 + repository_url: https://github.com/organization/api-service + service: api-service + started_at: 1693492074000000000 + team: backend + version: v2.1.0 + id: 4242fcdd31586084 + type: dora_deployment 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 + data: + description: The list of DORA deployment events. + items: + $ref: '#/components/schemas/DORADeploymentObject' + type: array + type: object + DORAFailureFetchResponse: + description: Response for fetching a single failure event. + properties: + data: + $ref: '#/components/schemas/DORAIncidentObject' type: object DORAFailureRequest: description: Request to create a DORA failure event. @@ -16083,11 +16190,45 @@ components: type: string x-enum-varnames: - DORA_FAILURE - DORAFetchResponse: - description: Response for the DORA fetch endpoints. + DORAFailuresListResponse: + description: Response for the list failures endpoint. + example: + data: + - attributes: + custom_tags: + - incident_type:database + - department:engineering + env: production + finished_at: 1693492274000000000 + name: Database outage + services: + - shopist + severity: SEV-1 + started_at: 1693492174000000000 + team: backend + id: 4242fcdd31586085 + type: dora_incident + - attributes: + custom_tags: + - incident_type:service_down + - department:platform + env: production + finished_at: 1693492474000000000 + name: API service outage + services: + - api-service + - payment-service + severity: SEV-2 + started_at: 1693492374000000000 + team: backend + id: 4242fcdd31586086 + type: dora_incident properties: data: - $ref: '#/components/schemas/DORAEvent' + description: The list of DORA incident events. + items: + $ref: '#/components/schemas/DORAIncidentObject' + type: array type: object DORAGitInfo: description: Git info for DORA Metrics events. @@ -16100,6 +16241,82 @@ components: - repository_url - commit_sha type: object + DORAIncidentObject: + description: A DORA incident event. + example: + attributes: + custom_tags: + - incident_type:database + - department:engineering + env: production + finished_at: 1693492274000000000 + git: + commit_sha: 66adc9350f2cc9b250b69abddab733dd55e1a588 + repository_url: https://github.com/organization/example-repository + name: Database outage + services: + - shopist + severity: SEV-1 + started_at: 1693492174000000000 + team: backend + id: 4242fcdd31586085 + type: dora_incident + properties: + attributes: + $ref: '#/components/schemas/DORAIncidentObjectAttributes' + id: + description: The ID of the incident event. + type: string + type: + $ref: '#/components/schemas/DORAFailureType' + type: object + DORAIncidentObjectAttributes: + description: The attributes of the incident event. + properties: + custom_tags: + $ref: '#/components/schemas/DORACustomTags' + env: + description: Environment name that was impacted by the incident. + example: production + type: string + finished_at: + description: Unix timestamp when the incident finished. + example: 1693491984000000000 + format: int64 + type: integer + git: + $ref: '#/components/schemas/DORAGitInfo' + name: + description: Incident name. + example: Database outage + type: string + services: + description: Service names impacted by the incident. + example: + - shopist + items: + type: string + type: array + severity: + description: Incident severity. + example: SEV-1 + type: string + started_at: + description: Unix timestamp when the incident started. + example: 1693491974000000000 + format: int64 + type: integer + team: + description: Name of the team owning the services impacted. + example: backend + type: string + version: + description: Version to correlate with APM Deployment Tracking. + example: v1.12.07 + type: string + required: + - started_at + type: object DORAListDeploymentsRequest: description: Request to get a list of deployments. example: @@ -16119,32 +16336,31 @@ components: type: object DORAListDeploymentsRequestAttributes: description: Attributes to get a list of deployments. - example: - from: '2025-01-01T00:00:00Z' - limit: 500 - query: service:(shopist OR api-service OR payment-service) env:(production - OR staging) team:(backend OR platform) - sort: -started_at - to: '2025-01-31T23:59:59Z' properties: from: description: Minimum timestamp for requested events. + example: '2025-01-01T00:00:00Z' format: date-time type: string limit: default: 10 description: Maximum number of events in the response. + example: 500 format: int32 maximum: 1000 type: integer query: description: Search query with event platform syntax. + example: service:(shopist OR api-service OR payment-service) env:(production + OR staging) team:(backend OR platform) type: string sort: description: Sort order (prefixed with `-` for descending). + example: -started_at type: string to: description: Maximum timestamp for requested events. + example: '2025-01-31T23:59:59Z' format: date-time type: string type: object @@ -16167,9 +16383,11 @@ components: - attributes type: object DORAListDeploymentsRequestDataType: + default: dora_deployments_list_request description: The definition of `DORAListDeploymentsRequestDataType` object. enum: - dora_deployments_list_request + example: dora_deployments_list_request type: string x-enum-varnames: - DORA_DEPLOYMENTS_LIST_REQUEST @@ -16192,32 +16410,31 @@ components: type: object DORAListFailuresRequestAttributes: description: Attributes to get a list of failures. - example: - from: '2025-01-01T00:00:00Z' - limit: 500 - query: severity:(SEV-1 OR SEV-2) env:(production OR staging) service:(shopist - OR api-service OR payment-service) team:(backend OR platform OR payments) - sort: -started_at - to: '2025-01-31T23:59:59Z' properties: from: description: Minimum timestamp for requested events. + example: '2025-01-01T00:00:00Z' format: date-time type: string limit: default: 10 description: Maximum number of events in the response. + example: 500 format: int32 maximum: 1000 type: integer query: description: Search query with event platform syntax. + example: severity:(SEV-1 OR SEV-2) env:(production OR staging) service:(shopist + OR api-service OR payment-service) team:(backend OR platform OR payments) type: string sort: description: Sort order (prefixed with `-` for descending). + example: -started_at type: string to: description: Maximum timestamp for requested events. + example: '2025-01-31T23:59:59Z' format: date-time type: string type: object @@ -16240,54 +16457,14 @@ components: - attributes type: object DORAListFailuresRequestDataType: + default: dora_failures_list_request description: The definition of `DORAListFailuresRequestDataType` object. enum: - dora_failures_list_request + example: dora_failures_list_request type: string x-enum-varnames: - DORA_FAILURES_LIST_REQUEST - DORAListResponse: - description: Response for the DORA list endpoints. - example: - data: - - attributes: - custom_tags: - - language:java - - department:engineering - - region:us-east-1 - env: production - finished_at: 1693491984000000000 - git: - commit_sha: 66adc9350f2cc9b250b69abddab733dd55e1a588 - repository_url: https://github.com/organization/example-repository - service: shopist - started_at: 1693491974000000000 - team: backend - version: v1.12.07 - id: 4242fcdd31586083 - type: dora_deployment - - attributes: - custom_tags: - - language:go - - department:platform - env: production - finished_at: 1693492084000000000 - git: - commit_sha: 77bdc9350f2cc9b250b69abddab733dd55e1a599 - repository_url: https://github.com/organization/api-service - service: api-service - started_at: 1693492074000000000 - team: backend - version: v2.1.0 - id: 4242fcdd31586084 - type: dora_deployment - 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: @@ -67683,7 +67860,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DORAListResponse' + $ref: '#/components/schemas/DORADeploymentsListResponse' description: OK '400': content: @@ -67721,26 +67898,8 @@ paths: '200': content: application/json: - example: - data: - attributes: - custom_tags: - - language:java - - department:engineering - - region:us-east-1 - env: staging - finished_at: 1693491984000000000 - git: - commit_sha: 66adc9350f2cc9b250b69abddab733dd55e1a588 - repository_url: https://github.com/organization/example-repository - service: shopist - started_at: 1693491974000000000 - team: backend - version: v1.12.07 - id: 4242fcdd31586083 - type: dora_deployment - schema: - $ref: '#/components/schemas/DORAFetchResponse' + schema: + $ref: '#/components/schemas/DORADeploymentFetchResponse' description: OK '400': content: @@ -67857,66 +68016,8 @@ paths: '200': content: application/json: - example: - data: - - attributes: - custom_tags: - - language:java - - department:engineering - - region:us-east-1 - env: production - finished_at: 1693491984000000000 - git: - commit_sha: 66adc9350f2cc9b250b69abddab733dd55e1a588 - repository_url: https://github.com/organization/example-repository - name: Web server is down; all requests are failing. - services: - - shopist - severity: SEV-1 - started_at: 1693491974000000000 - team: backend - id: 4242fcdd31586085 - type: dora_failure - - attributes: - custom_tags: - - language:go - - department:platform - env: production - finished_at: 1693492084000000000 - git: - commit_sha: 77bdc9350f2cc9b250b69abddab733dd55e1a599 - repository_url: https://github.com/organization/api-service - name: Database connection timeout - services: - - api-service - - payment-service - severity: SEV-1 - started_at: 1693492074000000000 - team: platform - version: v2.1.0 - id: 4242fcdd31586086 - type: dora_failure - - attributes: - custom_tags: - - language:python - - department:payments - - region:eu-west-1 - env: staging - finished_at: 1693492204000000000 - git: - commit_sha: 99edc9350f2cc9b250b69abddab733dd55e1a601 - repository_url: https://github.com/organization/payment-service - name: Payment gateway API rate limit exceeded - services: - - payment-service - severity: SEV-2 - started_at: 1693492174000000000 - team: payments - version: v1.8.3 - id: 4242fcdd31586087 - type: dora_failure - schema: - $ref: '#/components/schemas/DORAListResponse' + schema: + $ref: '#/components/schemas/DORAFailuresListResponse' description: OK '400': content: @@ -67954,28 +68055,8 @@ paths: '200': content: application/json: - example: - data: - attributes: - custom_tags: - - language:java - - department:engineering - - region:us-east-1 - env: staging - finished_at: 1693491984000000000 - git: - commit_sha: 66adc9350f2cc9b250b69abddab733dd55e1a588 - repository_url: https://github.com/organization/example-repository - name: Web server is down; all requests are failing. - services: - - shopist - severity: High - started_at: 1693491974000000000 - team: backend - id: 4242fcdd31586085 - type: dora_failure - schema: - $ref: '#/components/schemas/DORAFetchResponse' + schema: + $ref: '#/components/schemas/DORAFailureFetchResponse' description: OK '400': content: diff --git a/examples/v2/dora-metrics/GetDORADeployment.java b/examples/v2/dora-metrics/GetDORADeployment.java index 1d0a1813cb4..f2c7e10c840 100644 --- a/examples/v2/dora-metrics/GetDORADeployment.java +++ b/examples/v2/dora-metrics/GetDORADeployment.java @@ -3,7 +3,7 @@ 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; +import com.datadog.api.client.v2.model.DORADeploymentFetchResponse; public class Example { public static void main(String[] args) { @@ -11,7 +11,7 @@ public static void main(String[] args) { DoraMetricsApi apiInstance = new DoraMetricsApi(defaultClient); try { - DORAFetchResponse result = apiInstance.getDORADeployment("deployment_id"); + DORADeploymentFetchResponse result = apiInstance.getDORADeployment("deployment_id"); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling DoraMetricsApi#getDORADeployment"); diff --git a/examples/v2/dora-metrics/GetDORAFailure.java b/examples/v2/dora-metrics/GetDORAFailure.java index 9a856540095..8f6c063febf 100644 --- a/examples/v2/dora-metrics/GetDORAFailure.java +++ b/examples/v2/dora-metrics/GetDORAFailure.java @@ -3,7 +3,7 @@ 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; +import com.datadog.api.client.v2.model.DORAFailureFetchResponse; public class Example { public static void main(String[] args) { @@ -11,7 +11,7 @@ public static void main(String[] args) { DoraMetricsApi apiInstance = new DoraMetricsApi(defaultClient); try { - DORAFetchResponse result = apiInstance.getDORAFailure("failure_id"); + DORAFailureFetchResponse result = apiInstance.getDORAFailure("failure_id"); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling DoraMetricsApi#getDORAFailure"); diff --git a/examples/v2/dora-metrics/ListDORADeployments.java b/examples/v2/dora-metrics/ListDORADeployments.java index cfe6c4eb52c..84d9b6766f4 100644 --- a/examples/v2/dora-metrics/ListDORADeployments.java +++ b/examples/v2/dora-metrics/ListDORADeployments.java @@ -3,11 +3,11 @@ 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.DORADeploymentsListResponse; 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 { @@ -27,7 +27,7 @@ public static void main(String[] args) { .type(DORAListDeploymentsRequestDataType.DORA_DEPLOYMENTS_LIST_REQUEST)); try { - DORAListResponse result = apiInstance.listDORADeployments(body); + DORADeploymentsListResponse result = apiInstance.listDORADeployments(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling DoraMetricsApi#listDORADeployments"); diff --git a/examples/v2/dora-metrics/ListDORAFailures.java b/examples/v2/dora-metrics/ListDORAFailures.java index dc0f181b69c..555266cd1eb 100644 --- a/examples/v2/dora-metrics/ListDORAFailures.java +++ b/examples/v2/dora-metrics/ListDORAFailures.java @@ -3,11 +3,11 @@ 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.DORAFailuresListResponse; 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 { @@ -27,7 +27,7 @@ public static void main(String[] args) { .type(DORAListFailuresRequestDataType.DORA_FAILURES_LIST_REQUEST)); try { - DORAListResponse result = apiInstance.listDORAFailures(body); + DORAFailuresListResponse result = apiInstance.listDORAFailures(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling DoraMetricsApi#listDORAFailures"); 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 74172e6088e..4bcd3e5359e 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 @@ -4,14 +4,16 @@ import com.datadog.api.client.ApiException; import com.datadog.api.client.ApiResponse; import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.DORADeploymentFetchResponse; import com.datadog.api.client.v2.model.DORADeploymentRequest; import com.datadog.api.client.v2.model.DORADeploymentResponse; +import com.datadog.api.client.v2.model.DORADeploymentsListResponse; +import com.datadog.api.client.v2.model.DORAFailureFetchResponse; import com.datadog.api.client.v2.model.DORAFailureRequest; import com.datadog.api.client.v2.model.DORAFailureResponse; -import com.datadog.api.client.v2.model.DORAFetchResponse; +import com.datadog.api.client.v2.model.DORAFailuresListResponse; 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; @@ -741,10 +743,10 @@ public CompletableFuture> deleteDORAFailureWithHttpInfoAsync(S *

See {@link #getDORADeploymentWithHttpInfo}. * * @param deploymentId The ID of the deployment event. (required) - * @return DORAFetchResponse + * @return DORADeploymentFetchResponse * @throws ApiException if fails to make API call */ - public DORAFetchResponse getDORADeployment(String deploymentId) throws ApiException { + public DORADeploymentFetchResponse getDORADeployment(String deploymentId) throws ApiException { return getDORADeploymentWithHttpInfo(deploymentId).getData(); } @@ -754,9 +756,10 @@ public DORAFetchResponse getDORADeployment(String deploymentId) throws ApiExcept *

See {@link #getDORADeploymentWithHttpInfoAsync}. * * @param deploymentId The ID of the deployment event. (required) - * @return CompletableFuture<DORAFetchResponse> + * @return CompletableFuture<DORADeploymentFetchResponse> */ - public CompletableFuture getDORADeploymentAsync(String deploymentId) { + public CompletableFuture getDORADeploymentAsync( + String deploymentId) { return getDORADeploymentWithHttpInfoAsync(deploymentId) .thenApply( response -> { @@ -768,7 +771,7 @@ public CompletableFuture getDORADeploymentAsync(String deploy * Use this API endpoint to get a deployment event. * * @param deploymentId The ID of the deployment event. (required) - * @return ApiResponse<DORAFetchResponse> + * @return ApiResponse<DORADeploymentFetchResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -780,7 +783,7 @@ public CompletableFuture getDORADeploymentAsync(String deploy * *
429 Too many requests -
*/ - public ApiResponse getDORADeploymentWithHttpInfo(String deploymentId) + public ApiResponse getDORADeploymentWithHttpInfo(String deploymentId) throws ApiException { Object localVarPostBody = null; @@ -814,7 +817,7 @@ public ApiResponse getDORADeploymentWithHttpInfo(String deplo localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -823,15 +826,16 @@ public ApiResponse getDORADeploymentWithHttpInfo(String deplo *

See {@link #getDORADeploymentWithHttpInfo}. * * @param deploymentId The ID of the deployment event. (required) - * @return CompletableFuture<ApiResponse<DORAFetchResponse>> + * @return CompletableFuture<ApiResponse<DORADeploymentFetchResponse>> */ - public CompletableFuture> getDORADeploymentWithHttpInfoAsync( - String deploymentId) { + public CompletableFuture> + getDORADeploymentWithHttpInfoAsync(String deploymentId) { Object localVarPostBody = null; // verify the required parameter 'deploymentId' is set if (deploymentId == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, "Missing the required parameter 'deploymentId' when calling getDORADeployment")); @@ -857,7 +861,8 @@ public CompletableFuture> getDORADeploymentWithHt new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -869,7 +874,7 @@ public CompletableFuture> getDORADeploymentWithHt localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -878,10 +883,10 @@ public CompletableFuture> getDORADeploymentWithHt *

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

See {@link #getDORAFailureWithHttpInfoAsync}. * * @param failureId The ID of the failure event. (required) - * @return CompletableFuture<DORAFetchResponse> + * @return CompletableFuture<DORAFailureFetchResponse> */ - public CompletableFuture getDORAFailureAsync(String failureId) { + public CompletableFuture getDORAFailureAsync(String failureId) { return getDORAFailureWithHttpInfoAsync(failureId) .thenApply( response -> { @@ -905,7 +910,7 @@ public CompletableFuture getDORAFailureAsync(String failureId * Use this API endpoint to get a failure event. * * @param failureId The ID of the failure event. (required) - * @return ApiResponse<DORAFetchResponse> + * @return ApiResponse<DORAFailureFetchResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -917,7 +922,7 @@ public CompletableFuture getDORAFailureAsync(String failureId * *
429 Too many requests -
*/ - public ApiResponse getDORAFailureWithHttpInfo(String failureId) + public ApiResponse getDORAFailureWithHttpInfo(String failureId) throws ApiException { Object localVarPostBody = null; @@ -950,7 +955,7 @@ public ApiResponse getDORAFailureWithHttpInfo(String failureI localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -959,15 +964,15 @@ public ApiResponse getDORAFailureWithHttpInfo(String failureI *

See {@link #getDORAFailureWithHttpInfo}. * * @param failureId The ID of the failure event. (required) - * @return CompletableFuture<ApiResponse<DORAFetchResponse>> + * @return CompletableFuture<ApiResponse<DORAFailureFetchResponse>> */ - public CompletableFuture> getDORAFailureWithHttpInfoAsync( + public CompletableFuture> getDORAFailureWithHttpInfoAsync( String failureId) { Object localVarPostBody = null; // verify the required parameter 'failureId' is set if (failureId == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, "Missing the required parameter 'failureId' when calling getDORAFailure")); @@ -992,7 +997,7 @@ public CompletableFuture> getDORAFailureWithHttpI new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -1004,7 +1009,7 @@ public CompletableFuture> getDORAFailureWithHttpI localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -1013,10 +1018,11 @@ public CompletableFuture> getDORAFailureWithHttpI *

See {@link #listDORADeploymentsWithHttpInfo}. * * @param body (required) - * @return DORAListResponse + * @return DORADeploymentsListResponse * @throws ApiException if fails to make API call */ - public DORAListResponse listDORADeployments(DORAListDeploymentsRequest body) throws ApiException { + public DORADeploymentsListResponse listDORADeployments(DORAListDeploymentsRequest body) + throws ApiException { return listDORADeploymentsWithHttpInfo(body).getData(); } @@ -1026,9 +1032,9 @@ public DORAListResponse listDORADeployments(DORAListDeploymentsRequest body) thr *

See {@link #listDORADeploymentsWithHttpInfoAsync}. * * @param body (required) - * @return CompletableFuture<DORAListResponse> + * @return CompletableFuture<DORADeploymentsListResponse> */ - public CompletableFuture listDORADeploymentsAsync( + public CompletableFuture listDORADeploymentsAsync( DORAListDeploymentsRequest body) { return listDORADeploymentsWithHttpInfoAsync(body) .thenApply( @@ -1041,7 +1047,7 @@ public CompletableFuture listDORADeploymentsAsync( * Use this API endpoint to get a list of deployment events. * * @param body (required) - * @return ApiResponse<DORAListResponse> + * @return ApiResponse<DORADeploymentsListResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -1053,7 +1059,7 @@ public CompletableFuture listDORADeploymentsAsync( * *
429 Too many requests -
*/ - public ApiResponse listDORADeploymentsWithHttpInfo( + public ApiResponse listDORADeploymentsWithHttpInfo( DORAListDeploymentsRequest body) throws ApiException { Object localVarPostBody = body; @@ -1084,7 +1090,7 @@ public ApiResponse listDORADeploymentsWithHttpInfo( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -1093,15 +1099,16 @@ public ApiResponse listDORADeploymentsWithHttpInfo( *

See {@link #listDORADeploymentsWithHttpInfo}. * * @param body (required) - * @return CompletableFuture<ApiResponse<DORAListResponse>> + * @return CompletableFuture<ApiResponse<DORADeploymentsListResponse>> */ - public CompletableFuture> listDORADeploymentsWithHttpInfoAsync( - DORAListDeploymentsRequest body) { + public CompletableFuture> + listDORADeploymentsWithHttpInfoAsync(DORAListDeploymentsRequest body) { Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, "Missing the required parameter 'body' when calling listDORADeployments")); @@ -1124,7 +1131,8 @@ public CompletableFuture> listDORADeploymentsWithH new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -1136,7 +1144,7 @@ public CompletableFuture> listDORADeploymentsWithH localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -1145,10 +1153,11 @@ public CompletableFuture> listDORADeploymentsWithH *

See {@link #listDORAFailuresWithHttpInfo}. * * @param body (required) - * @return DORAListResponse + * @return DORAFailuresListResponse * @throws ApiException if fails to make API call */ - public DORAListResponse listDORAFailures(DORAListFailuresRequest body) throws ApiException { + public DORAFailuresListResponse listDORAFailures(DORAListFailuresRequest body) + throws ApiException { return listDORAFailuresWithHttpInfo(body).getData(); } @@ -1158,9 +1167,10 @@ public DORAListResponse listDORAFailures(DORAListFailuresRequest body) throws Ap *

See {@link #listDORAFailuresWithHttpInfoAsync}. * * @param body (required) - * @return CompletableFuture<DORAListResponse> + * @return CompletableFuture<DORAFailuresListResponse> */ - public CompletableFuture listDORAFailuresAsync(DORAListFailuresRequest body) { + public CompletableFuture listDORAFailuresAsync( + DORAListFailuresRequest body) { return listDORAFailuresWithHttpInfoAsync(body) .thenApply( response -> { @@ -1172,7 +1182,7 @@ public CompletableFuture listDORAFailuresAsync(DORAListFailure * Use this API endpoint to get a list of failure events. * * @param body (required) - * @return ApiResponse<DORAListResponse> + * @return ApiResponse<DORAFailuresListResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -1184,8 +1194,8 @@ public CompletableFuture listDORAFailuresAsync(DORAListFailure * *
429 Too many requests -
*/ - public ApiResponse listDORAFailuresWithHttpInfo(DORAListFailuresRequest body) - throws ApiException { + public ApiResponse listDORAFailuresWithHttpInfo( + DORAListFailuresRequest body) throws ApiException { Object localVarPostBody = body; // verify the required parameter 'body' is set @@ -1215,7 +1225,7 @@ public ApiResponse listDORAFailuresWithHttpInfo(DORAListFailur localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -1224,15 +1234,15 @@ public ApiResponse listDORAFailuresWithHttpInfo(DORAListFailur *

See {@link #listDORAFailuresWithHttpInfo}. * * @param body (required) - * @return CompletableFuture<ApiResponse<DORAListResponse>> + * @return CompletableFuture<ApiResponse<DORAFailuresListResponse>> */ - public CompletableFuture> listDORAFailuresWithHttpInfoAsync( + public CompletableFuture> listDORAFailuresWithHttpInfoAsync( DORAListFailuresRequest body) { Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, "Missing the required parameter 'body' when calling listDORAFailures")); @@ -1255,7 +1265,7 @@ public CompletableFuture> listDORAFailuresWithHttp new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -1267,6 +1277,6 @@ public CompletableFuture> listDORAFailuresWithHttp localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } } diff --git a/src/main/java/com/datadog/api/client/v2/model/DORADeploymentFetchResponse.java b/src/main/java/com/datadog/api/client/v2/model/DORADeploymentFetchResponse.java new file mode 100644 index 00000000000..df8b7be5594 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DORADeploymentFetchResponse.java @@ -0,0 +1,137 @@ +/* + * 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 fetching a single deployment event. */ +@JsonPropertyOrder({DORADeploymentFetchResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DORADeploymentFetchResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private DORADeploymentObject data; + + public DORADeploymentFetchResponse data(DORADeploymentObject data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A DORA deployment event. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DORADeploymentObject getData() { + return data; + } + + public void setData(DORADeploymentObject 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 DORADeploymentFetchResponse + */ + @JsonAnySetter + public DORADeploymentFetchResponse 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 DORADeploymentFetchResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DORADeploymentFetchResponse doraDeploymentFetchResponse = (DORADeploymentFetchResponse) o; + return Objects.equals(this.data, doraDeploymentFetchResponse.data) + && Objects.equals( + this.additionalProperties, doraDeploymentFetchResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DORADeploymentFetchResponse {\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/DORADeploymentObject.java b/src/main/java/com/datadog/api/client/v2/model/DORADeploymentObject.java new file mode 100644 index 00000000000..eae9d3ebacf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DORADeploymentObject.java @@ -0,0 +1,196 @@ +/* + * 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 deployment event. */ +@JsonPropertyOrder({ + DORADeploymentObject.JSON_PROPERTY_ATTRIBUTES, + DORADeploymentObject.JSON_PROPERTY_ID, + DORADeploymentObject.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DORADeploymentObject { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private DORADeploymentObjectAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DORADeploymentType type = DORADeploymentType.DORA_DEPLOYMENT; + + public DORADeploymentObject attributes(DORADeploymentObjectAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The attributes of the deployment event. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DORADeploymentObjectAttributes getAttributes() { + return attributes; + } + + public void setAttributes(DORADeploymentObjectAttributes attributes) { + this.attributes = attributes; + } + + public DORADeploymentObject id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the deployment 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 DORADeploymentObject type(DORADeploymentType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API type for DORA deployment events. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DORADeploymentType getType() { + return type; + } + + public void setType(DORADeploymentType 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 DORADeploymentObject + */ + @JsonAnySetter + public DORADeploymentObject 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 DORADeploymentObject object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DORADeploymentObject doraDeploymentObject = (DORADeploymentObject) o; + return Objects.equals(this.attributes, doraDeploymentObject.attributes) + && Objects.equals(this.id, doraDeploymentObject.id) + && Objects.equals(this.type, doraDeploymentObject.type) + && Objects.equals(this.additionalProperties, doraDeploymentObject.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DORADeploymentObject {\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/DORADeploymentObjectAttributes.java b/src/main/java/com/datadog/api/client/v2/model/DORADeploymentObjectAttributes.java new file mode 100644 index 00000000000..7ca9d60809e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DORADeploymentObjectAttributes.java @@ -0,0 +1,366 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** The attributes of the deployment event. */ +@JsonPropertyOrder({ + DORADeploymentObjectAttributes.JSON_PROPERTY_CUSTOM_TAGS, + DORADeploymentObjectAttributes.JSON_PROPERTY_ENV, + DORADeploymentObjectAttributes.JSON_PROPERTY_FINISHED_AT, + DORADeploymentObjectAttributes.JSON_PROPERTY_GIT, + DORADeploymentObjectAttributes.JSON_PROPERTY_SERVICE, + DORADeploymentObjectAttributes.JSON_PROPERTY_STARTED_AT, + DORADeploymentObjectAttributes.JSON_PROPERTY_TEAM, + DORADeploymentObjectAttributes.JSON_PROPERTY_VERSION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DORADeploymentObjectAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CUSTOM_TAGS = "custom_tags"; + private JsonNullable> customTags = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_ENV = "env"; + private String env; + + public static final String JSON_PROPERTY_FINISHED_AT = "finished_at"; + private Long finishedAt; + + public static final String JSON_PROPERTY_GIT = "git"; + private DORAGitInfo git; + + public static final String JSON_PROPERTY_SERVICE = "service"; + private String service; + + public static final String JSON_PROPERTY_STARTED_AT = "started_at"; + private Long startedAt; + + public static final String JSON_PROPERTY_TEAM = "team"; + private String team; + + public static final String JSON_PROPERTY_VERSION = "version"; + private String version; + + public DORADeploymentObjectAttributes() {} + + @JsonCreator + public DORADeploymentObjectAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_FINISHED_AT) Long finishedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_SERVICE) String service, + @JsonProperty(required = true, value = JSON_PROPERTY_STARTED_AT) Long startedAt) { + this.finishedAt = finishedAt; + this.service = service; + this.startedAt = startedAt; + } + + public DORADeploymentObjectAttributes customTags(List customTags) { + this.customTags = JsonNullable.>of(customTags); + return this; + } + + public DORADeploymentObjectAttributes addCustomTagsItem(String customTagsItem) { + if (this.customTags == null || !this.customTags.isPresent()) { + this.customTags = JsonNullable.>of(new ArrayList<>()); + } + try { + this.customTags.get().add(customTagsItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * A list of user-defined tags. The tags must follow the key:value pattern. Up to 100 + * may be added per event. + * + * @return customTags + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getCustomTags() { + return customTags.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getCustomTags_JsonNullable() { + return customTags; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_TAGS) + public void setCustomTags_JsonNullable(JsonNullable> customTags) { + this.customTags = customTags; + } + + public void setCustomTags(List customTags) { + this.customTags = JsonNullable.>of(customTags); + } + + public DORADeploymentObjectAttributes env(String env) { + this.env = env; + return this; + } + + /** + * Environment name to where the service was deployed. + * + * @return env + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENV) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEnv() { + return env; + } + + public void setEnv(String env) { + this.env = env; + } + + public DORADeploymentObjectAttributes finishedAt(Long finishedAt) { + this.finishedAt = finishedAt; + return this; + } + + /** + * Unix timestamp when the deployment finished. + * + * @return finishedAt + */ + @JsonProperty(JSON_PROPERTY_FINISHED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getFinishedAt() { + return finishedAt; + } + + public void setFinishedAt(Long finishedAt) { + this.finishedAt = finishedAt; + } + + public DORADeploymentObjectAttributes git(DORAGitInfo git) { + this.git = git; + this.unparsed |= git.unparsed; + return this; + } + + /** + * Git info for DORA Metrics events. + * + * @return git + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DORAGitInfo getGit() { + return git; + } + + public void setGit(DORAGitInfo git) { + this.git = git; + } + + public DORADeploymentObjectAttributes service(String service) { + this.service = service; + return this; + } + + /** + * Service name. + * + * @return service + */ + @JsonProperty(JSON_PROPERTY_SERVICE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getService() { + return service; + } + + public void setService(String service) { + this.service = service; + } + + public DORADeploymentObjectAttributes startedAt(Long startedAt) { + this.startedAt = startedAt; + return this; + } + + /** + * Unix timestamp when the deployment started. + * + * @return startedAt + */ + @JsonProperty(JSON_PROPERTY_STARTED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getStartedAt() { + return startedAt; + } + + public void setStartedAt(Long startedAt) { + this.startedAt = startedAt; + } + + public DORADeploymentObjectAttributes team(String team) { + this.team = team; + return this; + } + + /** + * Name of the team owning the deployed service. + * + * @return team + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTeam() { + return team; + } + + public void setTeam(String team) { + this.team = team; + } + + public DORADeploymentObjectAttributes version(String version) { + this.version = version; + return this; + } + + /** + * Version to correlate with APM Deployment Tracking. + * + * @return version + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + /** + * 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 DORADeploymentObjectAttributes + */ + @JsonAnySetter + public DORADeploymentObjectAttributes 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 DORADeploymentObjectAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DORADeploymentObjectAttributes doraDeploymentObjectAttributes = + (DORADeploymentObjectAttributes) o; + return Objects.equals(this.customTags, doraDeploymentObjectAttributes.customTags) + && Objects.equals(this.env, doraDeploymentObjectAttributes.env) + && Objects.equals(this.finishedAt, doraDeploymentObjectAttributes.finishedAt) + && Objects.equals(this.git, doraDeploymentObjectAttributes.git) + && Objects.equals(this.service, doraDeploymentObjectAttributes.service) + && Objects.equals(this.startedAt, doraDeploymentObjectAttributes.startedAt) + && Objects.equals(this.team, doraDeploymentObjectAttributes.team) + && Objects.equals(this.version, doraDeploymentObjectAttributes.version) + && Objects.equals( + this.additionalProperties, doraDeploymentObjectAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + customTags, env, finishedAt, git, service, startedAt, team, version, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DORADeploymentObjectAttributes {\n"); + sb.append(" customTags: ").append(toIndentedString(customTags)).append("\n"); + sb.append(" env: ").append(toIndentedString(env)).append("\n"); + sb.append(" finishedAt: ").append(toIndentedString(finishedAt)).append("\n"); + sb.append(" git: ").append(toIndentedString(git)).append("\n"); + sb.append(" service: ").append(toIndentedString(service)).append("\n"); + sb.append(" startedAt: ").append(toIndentedString(startedAt)).append("\n"); + sb.append(" team: ").append(toIndentedString(team)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).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/DORADeploymentsListResponse.java b/src/main/java/com/datadog/api/client/v2/model/DORADeploymentsListResponse.java new file mode 100644 index 00000000000..eeb731b59ad --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DORADeploymentsListResponse.java @@ -0,0 +1,150 @@ +/* + * 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 list deployments endpoint. */ +@JsonPropertyOrder({DORADeploymentsListResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DORADeploymentsListResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public DORADeploymentsListResponse data(List data) { + this.data = data; + for (DORADeploymentObject item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public DORADeploymentsListResponse addDataItem(DORADeploymentObject dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * The list of DORA deployment 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 DORADeploymentsListResponse + */ + @JsonAnySetter + public DORADeploymentsListResponse 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 DORADeploymentsListResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DORADeploymentsListResponse doraDeploymentsListResponse = (DORADeploymentsListResponse) o; + return Objects.equals(this.data, doraDeploymentsListResponse.data) + && Objects.equals( + this.additionalProperties, doraDeploymentsListResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DORADeploymentsListResponse {\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/DORAFetchResponse.java b/src/main/java/com/datadog/api/client/v2/model/DORAFailureFetchResponse.java similarity index 79% rename from src/main/java/com/datadog/api/client/v2/model/DORAFetchResponse.java rename to src/main/java/com/datadog/api/client/v2/model/DORAFailureFetchResponse.java index b06321fae34..278530d0160 100644 --- a/src/main/java/com/datadog/api/client/v2/model/DORAFetchResponse.java +++ b/src/main/java/com/datadog/api/client/v2/model/DORAFailureFetchResponse.java @@ -16,34 +16,34 @@ import java.util.Map; import java.util.Objects; -/** Response for the DORA fetch endpoints. */ -@JsonPropertyOrder({DORAFetchResponse.JSON_PROPERTY_DATA}) +/** Response for fetching a single failure event. */ +@JsonPropertyOrder({DORAFailureFetchResponse.JSON_PROPERTY_DATA}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class DORAFetchResponse { +public class DORAFailureFetchResponse { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_DATA = "data"; - private DORAEvent data; + private DORAIncidentObject data; - public DORAFetchResponse data(DORAEvent data) { + public DORAFailureFetchResponse data(DORAIncidentObject data) { this.data = data; this.unparsed |= data.unparsed; return this; } /** - * A DORA event. + * A DORA incident event. * * @return data */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public DORAEvent getData() { + public DORAIncidentObject getData() { return data; } - public void setData(DORAEvent data) { + public void setData(DORAIncidentObject data) { this.data = data; } @@ -59,10 +59,10 @@ public void setData(DORAEvent data) { * * @param key The arbitrary key to set * @param value The associated value - * @return DORAFetchResponse + * @return DORAFailureFetchResponse */ @JsonAnySetter - public DORAFetchResponse putAdditionalProperty(String key, Object value) { + public DORAFailureFetchResponse putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -93,7 +93,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** Return true if this DORAFetchResponse object is equal to o. */ + /** Return true if this DORAFailureFetchResponse object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -102,9 +102,9 @@ public boolean equals(Object o) { 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); + DORAFailureFetchResponse doraFailureFetchResponse = (DORAFailureFetchResponse) o; + return Objects.equals(this.data, doraFailureFetchResponse.data) + && Objects.equals(this.additionalProperties, doraFailureFetchResponse.additionalProperties); } @Override @@ -115,7 +115,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class DORAFetchResponse {\n"); + sb.append("class DORAFailureFetchResponse {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/DORAListResponse.java b/src/main/java/com/datadog/api/client/v2/model/DORAFailuresListResponse.java similarity index 77% rename from src/main/java/com/datadog/api/client/v2/model/DORAListResponse.java rename to src/main/java/com/datadog/api/client/v2/model/DORAFailuresListResponse.java index 3199fd3b3a9..1860de0abf4 100644 --- a/src/main/java/com/datadog/api/client/v2/model/DORAListResponse.java +++ b/src/main/java/com/datadog/api/client/v2/model/DORAFailuresListResponse.java @@ -18,24 +18,24 @@ import java.util.Map; import java.util.Objects; -/** Response for the DORA list endpoints. */ -@JsonPropertyOrder({DORAListResponse.JSON_PROPERTY_DATA}) +/** Response for the list failures endpoint. */ +@JsonPropertyOrder({DORAFailuresListResponse.JSON_PROPERTY_DATA}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class DORAListResponse { +public class DORAFailuresListResponse { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_DATA = "data"; - private List data = null; + private List data = null; - public DORAListResponse data(List data) { + public DORAFailuresListResponse data(List data) { this.data = data; - for (DORAEvent item : data) { + for (DORAIncidentObject item : data) { this.unparsed |= item.unparsed; } return this; } - public DORAListResponse addDataItem(DORAEvent dataItem) { + public DORAFailuresListResponse addDataItem(DORAIncidentObject dataItem) { if (this.data == null) { this.data = new ArrayList<>(); } @@ -45,18 +45,18 @@ public DORAListResponse addDataItem(DORAEvent dataItem) { } /** - * The list of DORA events. + * The list of DORA incident events. * * @return data */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getData() { + public List getData() { return data; } - public void setData(List data) { + public void setData(List data) { this.data = data; } @@ -72,10 +72,10 @@ public void setData(List data) { * * @param key The arbitrary key to set * @param value The associated value - * @return DORAListResponse + * @return DORAFailuresListResponse */ @JsonAnySetter - public DORAListResponse putAdditionalProperty(String key, Object value) { + public DORAFailuresListResponse putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -106,7 +106,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** Return true if this DORAListResponse object is equal to o. */ + /** Return true if this DORAFailuresListResponse object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -115,9 +115,9 @@ public boolean equals(Object o) { 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); + DORAFailuresListResponse doraFailuresListResponse = (DORAFailuresListResponse) o; + return Objects.equals(this.data, doraFailuresListResponse.data) + && Objects.equals(this.additionalProperties, doraFailuresListResponse.additionalProperties); } @Override @@ -128,7 +128,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class DORAListResponse {\n"); + sb.append("class DORAFailuresListResponse {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/DORAEvent.java b/src/main/java/com/datadog/api/client/v2/model/DORAIncidentObject.java similarity index 73% rename from src/main/java/com/datadog/api/client/v2/model/DORAEvent.java rename to src/main/java/com/datadog/api/client/v2/model/DORAIncidentObject.java index 16d0764e0f1..31995912458 100644 --- a/src/main/java/com/datadog/api/client/v2/model/DORAEvent.java +++ b/src/main/java/com/datadog/api/client/v2/model/DORAIncidentObject.java @@ -16,53 +16,54 @@ import java.util.Map; import java.util.Objects; -/** A DORA event. */ +/** A DORA incident event. */ @JsonPropertyOrder({ - DORAEvent.JSON_PROPERTY_ATTRIBUTES, - DORAEvent.JSON_PROPERTY_ID, - DORAEvent.JSON_PROPERTY_TYPE + DORAIncidentObject.JSON_PROPERTY_ATTRIBUTES, + DORAIncidentObject.JSON_PROPERTY_ID, + DORAIncidentObject.JSON_PROPERTY_TYPE }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class DORAEvent { +public class DORAIncidentObject { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; - private Object attributes; + private DORAIncidentObjectAttributes attributes; public static final String JSON_PROPERTY_ID = "id"; private String id; public static final String JSON_PROPERTY_TYPE = "type"; - private String type; + private DORAFailureType type = DORAFailureType.DORA_FAILURE; - public DORAEvent attributes(Object attributes) { + public DORAIncidentObject attributes(DORAIncidentObjectAttributes attributes) { this.attributes = attributes; + this.unparsed |= attributes.unparsed; return this; } /** - * The attributes of the event. + * The attributes of the incident event. * * @return attributes */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Object getAttributes() { + public DORAIncidentObjectAttributes getAttributes() { return attributes; } - public void setAttributes(Object attributes) { + public void setAttributes(DORAIncidentObjectAttributes attributes) { this.attributes = attributes; } - public DORAEvent id(String id) { + public DORAIncidentObject id(String id) { this.id = id; return this; } /** - * The ID of the event. + * The ID of the incident event. * * @return id */ @@ -77,24 +78,28 @@ public void setId(String id) { this.id = id; } - public DORAEvent type(String type) { + public DORAIncidentObject type(DORAFailureType type) { this.type = type; + this.unparsed |= !type.isValid(); return this; } /** - * The type of the event. + * JSON:API type for DORA failure events. * * @return type */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getType() { + public DORAFailureType getType() { return type; } - public void setType(String type) { + public void setType(DORAFailureType type) { + if (!type.isValid()) { + this.unparsed = true; + } this.type = type; } @@ -110,10 +115,10 @@ public void setType(String type) { * * @param key The arbitrary key to set * @param value The associated value - * @return DORAEvent + * @return DORAIncidentObject */ @JsonAnySetter - public DORAEvent putAdditionalProperty(String key, Object value) { + public DORAIncidentObject putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -144,7 +149,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** Return true if this DORAEvent object is equal to o. */ + /** Return true if this DORAIncidentObject object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -153,11 +158,11 @@ public boolean equals(Object o) { 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); + DORAIncidentObject doraIncidentObject = (DORAIncidentObject) o; + return Objects.equals(this.attributes, doraIncidentObject.attributes) + && Objects.equals(this.id, doraIncidentObject.id) + && Objects.equals(this.type, doraIncidentObject.type) + && Objects.equals(this.additionalProperties, doraIncidentObject.additionalProperties); } @Override @@ -168,7 +173,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class DORAEvent {\n"); + sb.append("class DORAIncidentObject {\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"); diff --git a/src/main/java/com/datadog/api/client/v2/model/DORAIncidentObjectAttributes.java b/src/main/java/com/datadog/api/client/v2/model/DORAIncidentObjectAttributes.java new file mode 100644 index 00000000000..123a70da8ff --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DORAIncidentObjectAttributes.java @@ -0,0 +1,435 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** The attributes of the incident event. */ +@JsonPropertyOrder({ + DORAIncidentObjectAttributes.JSON_PROPERTY_CUSTOM_TAGS, + DORAIncidentObjectAttributes.JSON_PROPERTY_ENV, + DORAIncidentObjectAttributes.JSON_PROPERTY_FINISHED_AT, + DORAIncidentObjectAttributes.JSON_PROPERTY_GIT, + DORAIncidentObjectAttributes.JSON_PROPERTY_NAME, + DORAIncidentObjectAttributes.JSON_PROPERTY_SERVICES, + DORAIncidentObjectAttributes.JSON_PROPERTY_SEVERITY, + DORAIncidentObjectAttributes.JSON_PROPERTY_STARTED_AT, + DORAIncidentObjectAttributes.JSON_PROPERTY_TEAM, + DORAIncidentObjectAttributes.JSON_PROPERTY_VERSION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DORAIncidentObjectAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CUSTOM_TAGS = "custom_tags"; + private JsonNullable> customTags = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_ENV = "env"; + private String env; + + public static final String JSON_PROPERTY_FINISHED_AT = "finished_at"; + private Long finishedAt; + + public static final String JSON_PROPERTY_GIT = "git"; + private DORAGitInfo git; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_SERVICES = "services"; + private List services = null; + + public static final String JSON_PROPERTY_SEVERITY = "severity"; + private String severity; + + public static final String JSON_PROPERTY_STARTED_AT = "started_at"; + private Long startedAt; + + public static final String JSON_PROPERTY_TEAM = "team"; + private String team; + + public static final String JSON_PROPERTY_VERSION = "version"; + private String version; + + public DORAIncidentObjectAttributes() {} + + @JsonCreator + public DORAIncidentObjectAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_STARTED_AT) Long startedAt) { + this.startedAt = startedAt; + } + + public DORAIncidentObjectAttributes customTags(List customTags) { + this.customTags = JsonNullable.>of(customTags); + return this; + } + + public DORAIncidentObjectAttributes addCustomTagsItem(String customTagsItem) { + if (this.customTags == null || !this.customTags.isPresent()) { + this.customTags = JsonNullable.>of(new ArrayList<>()); + } + try { + this.customTags.get().add(customTagsItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * A list of user-defined tags. The tags must follow the key:value pattern. Up to 100 + * may be added per event. + * + * @return customTags + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getCustomTags() { + return customTags.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getCustomTags_JsonNullable() { + return customTags; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_TAGS) + public void setCustomTags_JsonNullable(JsonNullable> customTags) { + this.customTags = customTags; + } + + public void setCustomTags(List customTags) { + this.customTags = JsonNullable.>of(customTags); + } + + public DORAIncidentObjectAttributes env(String env) { + this.env = env; + return this; + } + + /** + * Environment name that was impacted by the incident. + * + * @return env + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENV) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEnv() { + return env; + } + + public void setEnv(String env) { + this.env = env; + } + + public DORAIncidentObjectAttributes finishedAt(Long finishedAt) { + this.finishedAt = finishedAt; + return this; + } + + /** + * Unix timestamp when the incident finished. + * + * @return finishedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FINISHED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getFinishedAt() { + return finishedAt; + } + + public void setFinishedAt(Long finishedAt) { + this.finishedAt = finishedAt; + } + + public DORAIncidentObjectAttributes git(DORAGitInfo git) { + this.git = git; + this.unparsed |= git.unparsed; + return this; + } + + /** + * Git info for DORA Metrics events. + * + * @return git + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DORAGitInfo getGit() { + return git; + } + + public void setGit(DORAGitInfo git) { + this.git = git; + } + + public DORAIncidentObjectAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Incident name. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public DORAIncidentObjectAttributes services(List services) { + this.services = services; + return this; + } + + public DORAIncidentObjectAttributes addServicesItem(String servicesItem) { + if (this.services == null) { + this.services = new ArrayList<>(); + } + this.services.add(servicesItem); + return this; + } + + /** + * Service names impacted by the incident. + * + * @return services + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SERVICES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getServices() { + return services; + } + + public void setServices(List services) { + this.services = services; + } + + public DORAIncidentObjectAttributes severity(String severity) { + this.severity = severity; + return this; + } + + /** + * Incident severity. + * + * @return severity + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEVERITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeverity() { + return severity; + } + + public void setSeverity(String severity) { + this.severity = severity; + } + + public DORAIncidentObjectAttributes startedAt(Long startedAt) { + this.startedAt = startedAt; + return this; + } + + /** + * Unix timestamp when the incident started. + * + * @return startedAt + */ + @JsonProperty(JSON_PROPERTY_STARTED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getStartedAt() { + return startedAt; + } + + public void setStartedAt(Long startedAt) { + this.startedAt = startedAt; + } + + public DORAIncidentObjectAttributes team(String team) { + this.team = team; + return this; + } + + /** + * Name of the team owning the services impacted. + * + * @return team + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTeam() { + return team; + } + + public void setTeam(String team) { + this.team = team; + } + + public DORAIncidentObjectAttributes version(String version) { + this.version = version; + return this; + } + + /** + * Version to correlate with APM Deployment Tracking. + * + * @return version + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + /** + * 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 DORAIncidentObjectAttributes + */ + @JsonAnySetter + public DORAIncidentObjectAttributes 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 DORAIncidentObjectAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DORAIncidentObjectAttributes doraIncidentObjectAttributes = (DORAIncidentObjectAttributes) o; + return Objects.equals(this.customTags, doraIncidentObjectAttributes.customTags) + && Objects.equals(this.env, doraIncidentObjectAttributes.env) + && Objects.equals(this.finishedAt, doraIncidentObjectAttributes.finishedAt) + && Objects.equals(this.git, doraIncidentObjectAttributes.git) + && Objects.equals(this.name, doraIncidentObjectAttributes.name) + && Objects.equals(this.services, doraIncidentObjectAttributes.services) + && Objects.equals(this.severity, doraIncidentObjectAttributes.severity) + && Objects.equals(this.startedAt, doraIncidentObjectAttributes.startedAt) + && Objects.equals(this.team, doraIncidentObjectAttributes.team) + && Objects.equals(this.version, doraIncidentObjectAttributes.version) + && Objects.equals( + this.additionalProperties, doraIncidentObjectAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + customTags, + env, + finishedAt, + git, + name, + services, + severity, + startedAt, + team, + version, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DORAIncidentObjectAttributes {\n"); + sb.append(" customTags: ").append(toIndentedString(customTags)).append("\n"); + sb.append(" env: ").append(toIndentedString(env)).append("\n"); + sb.append(" finishedAt: ").append(toIndentedString(finishedAt)).append("\n"); + sb.append(" git: ").append(toIndentedString(git)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" services: ").append(toIndentedString(services)).append("\n"); + sb.append(" severity: ").append(toIndentedString(severity)).append("\n"); + sb.append(" startedAt: ").append(toIndentedString(startedAt)).append("\n"); + sb.append(" team: ").append(toIndentedString(team)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).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 index 91c08451c33..5802c413e6c 100644 --- a/src/main/java/com/datadog/api/client/v2/model/DORAListDeploymentsRequestData.java +++ b/src/main/java/com/datadog/api/client/v2/model/DORAListDeploymentsRequestData.java @@ -30,7 +30,8 @@ public class DORAListDeploymentsRequestData { private DORAListDeploymentsRequestAttributes attributes; public static final String JSON_PROPERTY_TYPE = "type"; - private DORAListDeploymentsRequestDataType type; + private DORAListDeploymentsRequestDataType type = + DORAListDeploymentsRequestDataType.DORA_DEPLOYMENTS_LIST_REQUEST; public DORAListDeploymentsRequestData() {} 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 index 77fd5209e95..8810af50dac 100644 --- a/src/main/java/com/datadog/api/client/v2/model/DORAListFailuresRequestData.java +++ b/src/main/java/com/datadog/api/client/v2/model/DORAListFailuresRequestData.java @@ -30,7 +30,8 @@ public class DORAListFailuresRequestData { private DORAListFailuresRequestAttributes attributes; public static final String JSON_PROPERTY_TYPE = "type"; - private DORAListFailuresRequestDataType type; + private DORAListFailuresRequestDataType type = + DORAListFailuresRequestDataType.DORA_FAILURES_LIST_REQUEST; public DORAListFailuresRequestData() {} diff --git a/src/test/resources/com/datadog/api/client/v2/api/teams.feature b/src/test/resources/com/datadog/api/client/v2/api/teams.feature index 41b57b14746..9deac2e88af 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/teams.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/teams.feature @@ -112,11 +112,8 @@ Feature: Teams And the response "data.attributes.name" is equal to "test-name-{{ unique_hash }}" And the response "data.attributes.avatar" is equal to "🥑" And the response "data.attributes.banner" is equal to 7 - And the response "data.attributes.visible_modules" has length 2 - And the response "data.attributes.visible_modules" array contains value "m1" - And the response "data.attributes.visible_modules" array contains value "m2" - And the response "data.attributes.hidden_modules" has length 1 - And the response "data.attributes.hidden_modules" array contains value "m3" + And the response "data.attributes.visible_modules" is equal to ["m1","m2"] + And the response "data.attributes.hidden_modules" is equal to ["m3"] @skip @team:DataDog/aaa-omg Scenario: Create team connections returns "Bad Request" response