diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ccc3331457d..ac890a965f9 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -20382,6 +20382,238 @@ components: data: $ref: "#/components/schemas/ListDeploymentRuleResponseData" type: object + DeploymentGatesEvaluationRequest: + description: Request body for triggering a deployment gate evaluation. + properties: + data: + $ref: "#/components/schemas/DeploymentGatesEvaluationRequestData" + required: + - data + type: object + DeploymentGatesEvaluationRequestAttributes: + description: Attributes for a deployment gate evaluation request. + properties: + env: + description: The environment of the deployment. + example: "staging" + type: string + identifier: + default: default + description: The identifier of the deployment gate. Defaults to "default". + example: "pre-deploy" + type: string + primary_tag: + description: A primary tag to scope APM Faulty Deployment Detection rules. + example: "region:us-east-1" + type: string + service: + description: The service being deployed. + example: "transaction-backend" + type: string + version: + description: The version of the deployment. Required for APM Faulty Deployment Detection rules. + example: "v1.2.3" + type: string + required: + - env + - service + type: object + DeploymentGatesEvaluationRequestData: + description: Data for a deployment gate evaluation request. + properties: + attributes: + $ref: "#/components/schemas/DeploymentGatesEvaluationRequestAttributes" + type: + $ref: "#/components/schemas/DeploymentGatesEvaluationRequestDataType" + required: + - type + - attributes + type: object + DeploymentGatesEvaluationRequestDataType: + default: deployment_gates_evaluation_request + description: JSON:API type for a deployment gate evaluation request. + enum: + - deployment_gates_evaluation_request + example: deployment_gates_evaluation_request + type: string + x-enum-varnames: + - DEPLOYMENT_GATES_EVALUATION_REQUEST + DeploymentGatesEvaluationResponse: + description: Response for a deployment gate evaluation request. + properties: + data: + $ref: "#/components/schemas/DeploymentGatesEvaluationResponseData" + type: object + DeploymentGatesEvaluationResponseAttributes: + description: Attributes for a deployment gate evaluation response. + properties: + evaluation_id: + description: The unique identifier of the gate evaluation. + example: "e9d2f04f-4f4b-494b-86e5-52f03e10c8e9" + type: string + required: + - evaluation_id + type: object + DeploymentGatesEvaluationResponseData: + description: Data for a deployment gate evaluation response. + properties: + attributes: + $ref: "#/components/schemas/DeploymentGatesEvaluationResponseAttributes" + id: + description: The unique identifier of the evaluation response. + example: "e9d2f04f-4f4b-494b-86e5-52f03e10c8e9" + format: uuid + type: string + type: + $ref: "#/components/schemas/DeploymentGatesEvaluationResponseDataType" + required: + - type + - attributes + - id + type: object + DeploymentGatesEvaluationResponseDataType: + default: deployment_gates_evaluation_response + description: JSON:API type for a deployment gate evaluation response. + enum: + - deployment_gates_evaluation_response + example: deployment_gates_evaluation_response + type: string + x-enum-varnames: + - DEPLOYMENT_GATES_EVALUATION_RESPONSE + DeploymentGatesEvaluationResultResponse: + description: Response containing the result of a deployment gate evaluation. + properties: + data: + $ref: "#/components/schemas/DeploymentGatesEvaluationResultResponseData" + type: object + DeploymentGatesEvaluationResultResponseAttributes: + description: Attributes for a deployment gate evaluation result response. + properties: + dry_run: + description: Whether the gate was evaluated in dry-run mode. + example: false + type: boolean + evaluation_id: + description: The unique identifier of the gate evaluation. + example: "e9d2f04f-4f4b-494b-86e5-52f03e10c8e9" + type: string + evaluation_url: + description: A URL to view the evaluation details in the Datadog UI. + example: "https://app.datadoghq.com/ci/deployment-gates/evaluations?index=cdgates&query=level%3Agate+%40evaluation_id%3Ae9d2f04f-4f4b-494b-86e5-52f03e10c8e9" + type: string + gate_id: + description: The unique identifier of the deployment gate. + example: "e140302e-0cba-40d2-978c-6780647f8f1c" + format: uuid + type: string + gate_status: + $ref: "#/components/schemas/DeploymentGatesEvaluationResultResponseAttributesGateStatus" + rules: + description: The results of individual rule evaluations. + items: + $ref: "#/components/schemas/DeploymentGatesRuleResponse" + type: array + required: + - dry_run + - evaluation_id + - evaluation_url + - gate_id + - gate_status + - rules + type: object + DeploymentGatesEvaluationResultResponseAttributesGateStatus: + description: |- + The overall status of the gate evaluation. + - `in_progress`: The evaluation is still running. + - `pass`: All rules passed successfully and the deployment is allowed to proceed. + - `fail`: One or more rules did not pass; the deployment should not proceed. + enum: + - in_progress + - pass + - fail + example: "pass" + type: string + x-enum-varnames: + - IN_PROGRESS + - PASS + - FAIL + DeploymentGatesEvaluationResultResponseData: + description: Data for a deployment gate evaluation result response. + properties: + attributes: + $ref: "#/components/schemas/DeploymentGatesEvaluationResultResponseAttributes" + id: + description: The unique identifier of the evaluation. + example: "e9d2f04f-4f4b-494b-86e5-52f03e10c8e9" + type: string + type: + $ref: "#/components/schemas/DeploymentGatesEvaluationResultResponseDataType" + required: + - type + - attributes + - id + type: object + DeploymentGatesEvaluationResultResponseDataType: + default: deployment_gates_evaluation_result_response + description: JSON:API type for a deployment gate evaluation result response. + enum: + - deployment_gates_evaluation_result_response + example: deployment_gates_evaluation_result_response + type: string + x-enum-varnames: + - DEPLOYMENT_GATES_EVALUATION_RESULT_RESPONSE + DeploymentGatesListResponse: + description: Response containing a paginated list of deployment gates. + properties: + data: + description: Array of deployment gates. + items: + $ref: "#/components/schemas/DeploymentGateResponseData" + type: array + meta: + $ref: "#/components/schemas/DeploymentGatesListResponseMeta" + type: object + DeploymentGatesListResponseMeta: + description: Metadata for a list of deployment gates response. + properties: + page: + $ref: "#/components/schemas/DeploymentGatesListResponseMetaPage" + type: object + DeploymentGatesListResponseMetaPage: + description: Pagination information for a list of deployment gates. + properties: + cursor: + description: The cursor used for the current page. + type: string + next_cursor: + description: The cursor to use to fetch the next page. This is absent when there are no more pages. + type: string + size: + default: 50 + description: The number of results per page. + format: int64 + maximum: 1000 + minimum: 1 + type: integer + type: object + DeploymentGatesRuleResponse: + description: The result of a single rule evaluation. + properties: + dry_run: + description: Whether this rule was evaluated in dry-run mode. + example: false + type: boolean + name: + description: The name of the rule. + example: "Check service monitors" + type: string + reason: + description: The reason for the rule result, if applicable. + example: "One or more monitors in ALERT state" + type: string + status: + $ref: "#/components/schemas/DeploymentGatesEvaluationResultResponseAttributesGateStatus" + type: object DeploymentMetadata: description: Metadata object containing the publication creation information. properties: @@ -79322,6 +79554,61 @@ paths: **Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/deployment_gates: + get: + description: |- + Returns a paginated list of all deployment gates for the organization. + Use `page[cursor]` and `page[size]` query parameters to paginate through results. + operationId: ListDeploymentGates + parameters: + - description: Cursor for pagination. Use the `meta.page.next_cursor` value from the previous response. + in: query + name: page[cursor] + required: false + schema: + type: string + - description: Number of results per page. Defaults to 50. Must be between 1 and 1000. + in: query + name: page[size] + required: false + schema: + default: 50 + format: int64 + maximum: 1000 + minimum: 1 + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/DeploymentGatesListResponse" + description: OK + "400": + $ref: "#/components/responses/HTTPCDGatesBadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/HTTPCIAppErrors" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get all deployment gates + tags: ["Deployment Gates"] + x-permission: + operator: OR + permissions: + - deployment_gates_read + x-unstable: |- + **Note**: This endpoint is in preview and may be subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). post: description: |- Endpoint to create a deployment gate. @@ -79760,6 +80047,106 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and may be subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/deployments/gates/evaluation: + post: + description: |- + Triggers an asynchronous deployment gate evaluation for the given service and environment. + Returns an evaluation ID that can be used to poll for the result via the + `GET /api/v2/deployments/gates/evaluation/{id}` endpoint. + operationId: TriggerDeploymentGatesEvaluation + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/DeploymentGatesEvaluationRequest" + required: true + responses: + "202": + content: + application/json: + schema: + $ref: "#/components/schemas/DeploymentGatesEvaluationResponse" + description: Accepted + "400": + $ref: "#/components/responses/HTTPCDGatesBadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/HTTPCDGatesNotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/HTTPCIAppErrors" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Trigger a deployment gate evaluation + tags: ["Deployment Gates"] + x-permission: + operator: OR + permissions: + - deployment_gates_evaluate + x-unstable: |- + **Note**: This endpoint is in preview and may be subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/deployments/gates/evaluation/{id}: + get: + description: |- + Retrieves the result of a deployment gate evaluation by its evaluation ID. + If the evaluation is still in progress, `data.attributes.gate_status` will be `in_progress`; + continue polling until it returns `pass` or `fail`. + Polling every 10-20 seconds is recommended. + The endpoint may return a 404 if called too soon after triggering; retry after a few seconds. + operationId: GetDeploymentGatesEvaluationResult + parameters: + - description: The evaluation ID returned by the trigger endpoint. + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/DeploymentGatesEvaluationResultResponse" + description: OK + "400": + $ref: "#/components/responses/HTTPCDGatesBadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/HTTPCDGatesNotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/HTTPCIAppErrors" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get a deployment gate evaluation result + tags: ["Deployment Gates"] + x-permission: + operator: OR + permissions: + - deployment_gates_evaluate + x-unstable: |- + **Note**: This endpoint is in preview and may be subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/domain_allowlist: get: description: Get the domain allowlist for an organization. diff --git a/examples/v2/deployment-gates/GetDeploymentGatesEvaluationResult.java b/examples/v2/deployment-gates/GetDeploymentGatesEvaluationResult.java new file mode 100644 index 00000000000..8342dda05c6 --- /dev/null +++ b/examples/v2/deployment-gates/GetDeploymentGatesEvaluationResult.java @@ -0,0 +1,29 @@ +// Get a deployment gate evaluation result returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.DeploymentGatesApi; +import com.datadog.api.client.v2.model.DeploymentGatesEvaluationResultResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getDeploymentGatesEvaluationResult", true); + DeploymentGatesApi apiInstance = new DeploymentGatesApi(defaultClient); + + try { + DeploymentGatesEvaluationResultResponse result = + apiInstance.getDeploymentGatesEvaluationResult( + UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d")); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling DeploymentGatesApi#getDeploymentGatesEvaluationResult"); + 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/deployment-gates/GetDeploymentGatesEvaluationResult_3594131214.java b/examples/v2/deployment-gates/GetDeploymentGatesEvaluationResult_3594131214.java new file mode 100644 index 00000000000..4248ba658dd --- /dev/null +++ b/examples/v2/deployment-gates/GetDeploymentGatesEvaluationResult_3594131214.java @@ -0,0 +1,37 @@ +// Get a deployment gates evaluation result returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.DeploymentGatesApi; +import com.datadog.api.client.v2.model.DeploymentGatesEvaluationResultResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getDeploymentGatesEvaluationResult", true); + DeploymentGatesApi apiInstance = new DeploymentGatesApi(defaultClient); + + // there is a valid "deployment_gates_evaluation" in the system + UUID DEPLOYMENT_GATES_EVALUATION_DATA_ID = null; + try { + DEPLOYMENT_GATES_EVALUATION_DATA_ID = + UUID.fromString(System.getenv("DEPLOYMENT_GATES_EVALUATION_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + try { + DeploymentGatesEvaluationResultResponse result = + apiInstance.getDeploymentGatesEvaluationResult(DEPLOYMENT_GATES_EVALUATION_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling DeploymentGatesApi#getDeploymentGatesEvaluationResult"); + 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/deployment-gates/ListDeploymentGates.java b/examples/v2/deployment-gates/ListDeploymentGates.java new file mode 100644 index 00000000000..35c4a9e7ad5 --- /dev/null +++ b/examples/v2/deployment-gates/ListDeploymentGates.java @@ -0,0 +1,25 @@ +// Get all deployment gates returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.DeploymentGatesApi; +import com.datadog.api.client.v2.model.DeploymentGatesListResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listDeploymentGates", true); + DeploymentGatesApi apiInstance = new DeploymentGatesApi(defaultClient); + + try { + DeploymentGatesListResponse result = apiInstance.listDeploymentGates(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DeploymentGatesApi#listDeploymentGates"); + 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/deployment-gates/TriggerDeploymentGatesEvaluation.java b/examples/v2/deployment-gates/TriggerDeploymentGatesEvaluation.java new file mode 100644 index 00000000000..e0068e2ffd5 --- /dev/null +++ b/examples/v2/deployment-gates/TriggerDeploymentGatesEvaluation.java @@ -0,0 +1,45 @@ +// Trigger a deployment gate evaluation returns "Accepted" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.DeploymentGatesApi; +import com.datadog.api.client.v2.model.DeploymentGatesEvaluationRequest; +import com.datadog.api.client.v2.model.DeploymentGatesEvaluationRequestAttributes; +import com.datadog.api.client.v2.model.DeploymentGatesEvaluationRequestData; +import com.datadog.api.client.v2.model.DeploymentGatesEvaluationRequestDataType; +import com.datadog.api.client.v2.model.DeploymentGatesEvaluationResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.triggerDeploymentGatesEvaluation", true); + DeploymentGatesApi apiInstance = new DeploymentGatesApi(defaultClient); + + DeploymentGatesEvaluationRequest body = + new DeploymentGatesEvaluationRequest() + .data( + new DeploymentGatesEvaluationRequestData() + .attributes( + new DeploymentGatesEvaluationRequestAttributes() + .env("staging") + .identifier("pre-deploy") + .primaryTag("region:us-east-1") + .service("transaction-backend") + .version("v1.2.3")) + .type( + DeploymentGatesEvaluationRequestDataType + .DEPLOYMENT_GATES_EVALUATION_REQUEST)); + + try { + DeploymentGatesEvaluationResponse result = apiInstance.triggerDeploymentGatesEvaluation(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling DeploymentGatesApi#triggerDeploymentGatesEvaluation"); + 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/deployment-gates/TriggerDeploymentGatesEvaluation_691804290.java b/examples/v2/deployment-gates/TriggerDeploymentGatesEvaluation_691804290.java new file mode 100644 index 00000000000..500fc2ed2c4 --- /dev/null +++ b/examples/v2/deployment-gates/TriggerDeploymentGatesEvaluation_691804290.java @@ -0,0 +1,47 @@ +// Trigger a deployment gates evaluation returns "Accepted" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.DeploymentGatesApi; +import com.datadog.api.client.v2.model.DeploymentGatesEvaluationRequest; +import com.datadog.api.client.v2.model.DeploymentGatesEvaluationRequestAttributes; +import com.datadog.api.client.v2.model.DeploymentGatesEvaluationRequestData; +import com.datadog.api.client.v2.model.DeploymentGatesEvaluationRequestDataType; +import com.datadog.api.client.v2.model.DeploymentGatesEvaluationResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.triggerDeploymentGatesEvaluation", true); + DeploymentGatesApi apiInstance = new DeploymentGatesApi(defaultClient); + + // there is a valid "deployment_gate" in the system + String DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER = + System.getenv("DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER"); + + DeploymentGatesEvaluationRequest body = + new DeploymentGatesEvaluationRequest() + .data( + new DeploymentGatesEvaluationRequestData() + .attributes( + new DeploymentGatesEvaluationRequestAttributes() + .env("production") + .identifier(DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER) + .service("my-service")) + .type( + DeploymentGatesEvaluationRequestDataType + .DEPLOYMENT_GATES_EVALUATION_REQUEST)); + + try { + DeploymentGatesEvaluationResponse result = apiInstance.triggerDeploymentGatesEvaluation(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling DeploymentGatesApi#triggerDeploymentGatesEvaluation"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 154be7692e9..2020d9872a9 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -824,7 +824,10 @@ public class ApiClient { put("v2.deleteDeploymentRule", false); put("v2.getDeploymentGate", false); put("v2.getDeploymentGateRules", false); + put("v2.getDeploymentGatesEvaluationResult", false); put("v2.getDeploymentRule", false); + put("v2.listDeploymentGates", false); + put("v2.triggerDeploymentGatesEvaluation", false); put("v2.updateDeploymentGate", false); put("v2.updateDeploymentRule", false); put("v2.createHamrOrgConnection", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/DeploymentGatesApi.java b/src/main/java/com/datadog/api/client/v2/api/DeploymentGatesApi.java index 5da77c2a5eb..787c6492a68 100644 --- a/src/main/java/com/datadog/api/client/v2/api/DeploymentGatesApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/DeploymentGatesApi.java @@ -8,6 +8,10 @@ import com.datadog.api.client.v2.model.CreateDeploymentRuleParams; import com.datadog.api.client.v2.model.DeploymentGateResponse; import com.datadog.api.client.v2.model.DeploymentGateRulesResponse; +import com.datadog.api.client.v2.model.DeploymentGatesEvaluationRequest; +import com.datadog.api.client.v2.model.DeploymentGatesEvaluationResponse; +import com.datadog.api.client.v2.model.DeploymentGatesEvaluationResultResponse; +import com.datadog.api.client.v2.model.DeploymentGatesListResponse; import com.datadog.api.client.v2.model.DeploymentRuleResponse; import com.datadog.api.client.v2.model.UpdateDeploymentGateParams; import com.datadog.api.client.v2.model.UpdateDeploymentRuleParams; @@ -15,7 +19,9 @@ import jakarta.ws.rs.core.GenericType; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; +import java.util.UUID; import java.util.concurrent.CompletableFuture; @jakarta.annotation.Generated( @@ -1015,6 +1021,173 @@ public ApiResponse getDeploymentGateRulesWithHttpIn new GenericType() {}); } + /** + * Get a deployment gate evaluation result. + * + *

See {@link #getDeploymentGatesEvaluationResultWithHttpInfo}. + * + * @param id The evaluation ID returned by the trigger endpoint. (required) + * @return DeploymentGatesEvaluationResultResponse + * @throws ApiException if fails to make API call + */ + public DeploymentGatesEvaluationResultResponse getDeploymentGatesEvaluationResult(UUID id) + throws ApiException { + return getDeploymentGatesEvaluationResultWithHttpInfo(id).getData(); + } + + /** + * Get a deployment gate evaluation result. + * + *

See {@link #getDeploymentGatesEvaluationResultWithHttpInfoAsync}. + * + * @param id The evaluation ID returned by the trigger endpoint. (required) + * @return CompletableFuture<DeploymentGatesEvaluationResultResponse> + */ + public CompletableFuture + getDeploymentGatesEvaluationResultAsync(UUID id) { + return getDeploymentGatesEvaluationResultWithHttpInfoAsync(id) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Retrieves the result of a deployment gate evaluation by its evaluation ID. If the evaluation is + * still in progress, data.attributes.gate_status will be in_progress; + * continue polling until it returns pass or fail. Polling every 10-20 + * seconds is recommended. The endpoint may return a 404 if called too soon after triggering; + * retry after a few seconds. + * + * @param id The evaluation ID returned by the trigger endpoint. (required) + * @return ApiResponse<DeploymentGatesEvaluationResultResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad request. -
401 Unauthorized -
403 Forbidden -
404 Deployment gate not found. -
429 Too many requests -
500 Internal Server Error -
+ */ + public ApiResponse + getDeploymentGatesEvaluationResultWithHttpInfo(UUID id) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getDeploymentGatesEvaluationResult"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, + "Missing the required parameter 'id' when calling getDeploymentGatesEvaluationResult"); + } + // create path and map variables + String localVarPath = + "/api/v2/deployments/gates/evaluation/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.DeploymentGatesApi.getDeploymentGatesEvaluationResult", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a deployment gate evaluation result. + * + *

See {@link #getDeploymentGatesEvaluationResultWithHttpInfo}. + * + * @param id The evaluation ID returned by the trigger endpoint. (required) + * @return CompletableFuture<ApiResponse<DeploymentGatesEvaluationResultResponse>> + */ + public CompletableFuture> + getDeploymentGatesEvaluationResultWithHttpInfoAsync(UUID id) { + // Check if unstable operation is enabled + String operationId = "getDeploymentGatesEvaluationResult"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'id' when calling" + + " getDeploymentGatesEvaluationResult")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/deployments/gates/evaluation/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.DeploymentGatesApi.getDeploymentGatesEvaluationResult", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Get deployment rule. * @@ -1192,6 +1365,377 @@ public CompletableFuture> getDeploymentRuleW new GenericType() {}); } + /** Manage optional parameters to listDeploymentGates. */ + public static class ListDeploymentGatesOptionalParameters { + private String pageCursor; + private Long pageSize; + + /** + * Set pageCursor. + * + * @param pageCursor Cursor for pagination. Use the meta.page.next_cursor value + * from the previous response. (optional) + * @return ListDeploymentGatesOptionalParameters + */ + public ListDeploymentGatesOptionalParameters pageCursor(String pageCursor) { + this.pageCursor = pageCursor; + return this; + } + + /** + * Set pageSize. + * + * @param pageSize Number of results per page. Defaults to 50. Must be between 1 and 1000. + * (optional, default to 50) + * @return ListDeploymentGatesOptionalParameters + */ + public ListDeploymentGatesOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + } + + /** + * Get all deployment gates. + * + *

See {@link #listDeploymentGatesWithHttpInfo}. + * + * @return DeploymentGatesListResponse + * @throws ApiException if fails to make API call + */ + public DeploymentGatesListResponse listDeploymentGates() throws ApiException { + return listDeploymentGatesWithHttpInfo(new ListDeploymentGatesOptionalParameters()).getData(); + } + + /** + * Get all deployment gates. + * + *

See {@link #listDeploymentGatesWithHttpInfoAsync}. + * + * @return CompletableFuture<DeploymentGatesListResponse> + */ + public CompletableFuture listDeploymentGatesAsync() { + return listDeploymentGatesWithHttpInfoAsync(new ListDeploymentGatesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all deployment gates. + * + *

See {@link #listDeploymentGatesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return DeploymentGatesListResponse + * @throws ApiException if fails to make API call + */ + public DeploymentGatesListResponse listDeploymentGates( + ListDeploymentGatesOptionalParameters parameters) throws ApiException { + return listDeploymentGatesWithHttpInfo(parameters).getData(); + } + + /** + * Get all deployment gates. + * + *

See {@link #listDeploymentGatesWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<DeploymentGatesListResponse> + */ + public CompletableFuture listDeploymentGatesAsync( + ListDeploymentGatesOptionalParameters parameters) { + return listDeploymentGatesWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Returns a paginated list of all deployment gates for the organization. Use page[cursor] + * and page[size] query parameters to paginate through results. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<DeploymentGatesListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad request. -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
500 Internal Server Error -
+ */ + public ApiResponse listDeploymentGatesWithHttpInfo( + ListDeploymentGatesOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listDeploymentGates"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + String pageCursor = parameters.pageCursor; + Long pageSize = parameters.pageSize; + // create path and map variables + String localVarPath = "/api/v2/deployment_gates"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.DeploymentGatesApi.listDeploymentGates", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get all deployment gates. + * + *

See {@link #listDeploymentGatesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<DeploymentGatesListResponse>> + */ + public CompletableFuture> + listDeploymentGatesWithHttpInfoAsync(ListDeploymentGatesOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listDeploymentGates"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + String pageCursor = parameters.pageCursor; + Long pageSize = parameters.pageSize; + // create path and map variables + String localVarPath = "/api/v2/deployment_gates"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.DeploymentGatesApi.listDeploymentGates", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Trigger a deployment gate evaluation. + * + *

See {@link #triggerDeploymentGatesEvaluationWithHttpInfo}. + * + * @param body (required) + * @return DeploymentGatesEvaluationResponse + * @throws ApiException if fails to make API call + */ + public DeploymentGatesEvaluationResponse triggerDeploymentGatesEvaluation( + DeploymentGatesEvaluationRequest body) throws ApiException { + return triggerDeploymentGatesEvaluationWithHttpInfo(body).getData(); + } + + /** + * Trigger a deployment gate evaluation. + * + *

See {@link #triggerDeploymentGatesEvaluationWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<DeploymentGatesEvaluationResponse> + */ + public CompletableFuture triggerDeploymentGatesEvaluationAsync( + DeploymentGatesEvaluationRequest body) { + return triggerDeploymentGatesEvaluationWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Triggers an asynchronous deployment gate evaluation for the given service and environment. + * Returns an evaluation ID that can be used to poll for the result via the + * GET /api/v2/deployments/gates/evaluation/{id} endpoint. + * + * @param body (required) + * @return ApiResponse<DeploymentGatesEvaluationResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
202 Accepted -
400 Bad request. -
401 Unauthorized -
403 Forbidden -
404 Deployment gate not found. -
429 Too many requests -
500 Internal Server Error -
+ */ + public ApiResponse + triggerDeploymentGatesEvaluationWithHttpInfo(DeploymentGatesEvaluationRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "triggerDeploymentGatesEvaluation"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling triggerDeploymentGatesEvaluation"); + } + // create path and map variables + String localVarPath = "/api/v2/deployments/gates/evaluation"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.DeploymentGatesApi.triggerDeploymentGatesEvaluation", + 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() {}); + } + + /** + * Trigger a deployment gate evaluation. + * + *

See {@link #triggerDeploymentGatesEvaluationWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<DeploymentGatesEvaluationResponse>> + */ + public CompletableFuture> + triggerDeploymentGatesEvaluationWithHttpInfoAsync(DeploymentGatesEvaluationRequest body) { + // Check if unstable operation is enabled + String operationId = "triggerDeploymentGatesEvaluation"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " triggerDeploymentGatesEvaluation")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/deployments/gates/evaluation"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.DeploymentGatesApi.triggerDeploymentGatesEvaluation", + 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() {}); + } + /** * Update deployment gate. * diff --git a/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationRequest.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationRequest.java new file mode 100644 index 00000000000..6da88fac835 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationRequest.java @@ -0,0 +1,148 @@ +/* + * 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 body for triggering a deployment gate evaluation. */ +@JsonPropertyOrder({DeploymentGatesEvaluationRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentGatesEvaluationRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private DeploymentGatesEvaluationRequestData data; + + public DeploymentGatesEvaluationRequest() {} + + @JsonCreator + public DeploymentGatesEvaluationRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + DeploymentGatesEvaluationRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public DeploymentGatesEvaluationRequest data(DeploymentGatesEvaluationRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for a deployment gate evaluation request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeploymentGatesEvaluationRequestData getData() { + return data; + } + + public void setData(DeploymentGatesEvaluationRequestData 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 DeploymentGatesEvaluationRequest + */ + @JsonAnySetter + public DeploymentGatesEvaluationRequest 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 DeploymentGatesEvaluationRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentGatesEvaluationRequest deploymentGatesEvaluationRequest = + (DeploymentGatesEvaluationRequest) o; + return Objects.equals(this.data, deploymentGatesEvaluationRequest.data) + && Objects.equals( + this.additionalProperties, deploymentGatesEvaluationRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentGatesEvaluationRequest {\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/DeploymentGatesEvaluationRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationRequestAttributes.java new file mode 100644 index 00000000000..c80c21c82be --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationRequestAttributes.java @@ -0,0 +1,258 @@ +/* + * 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; + +/** Attributes for a deployment gate evaluation request. */ +@JsonPropertyOrder({ + DeploymentGatesEvaluationRequestAttributes.JSON_PROPERTY_ENV, + DeploymentGatesEvaluationRequestAttributes.JSON_PROPERTY_IDENTIFIER, + DeploymentGatesEvaluationRequestAttributes.JSON_PROPERTY_PRIMARY_TAG, + DeploymentGatesEvaluationRequestAttributes.JSON_PROPERTY_SERVICE, + DeploymentGatesEvaluationRequestAttributes.JSON_PROPERTY_VERSION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentGatesEvaluationRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ENV = "env"; + private String env; + + public static final String JSON_PROPERTY_IDENTIFIER = "identifier"; + private String identifier = "default"; + + public static final String JSON_PROPERTY_PRIMARY_TAG = "primary_tag"; + private String primaryTag; + + public static final String JSON_PROPERTY_SERVICE = "service"; + private String service; + + public static final String JSON_PROPERTY_VERSION = "version"; + private String version; + + public DeploymentGatesEvaluationRequestAttributes() {} + + @JsonCreator + public DeploymentGatesEvaluationRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ENV) String env, + @JsonProperty(required = true, value = JSON_PROPERTY_SERVICE) String service) { + this.env = env; + this.service = service; + } + + public DeploymentGatesEvaluationRequestAttributes env(String env) { + this.env = env; + return this; + } + + /** + * The environment of the deployment. + * + * @return env + */ + @JsonProperty(JSON_PROPERTY_ENV) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEnv() { + return env; + } + + public void setEnv(String env) { + this.env = env; + } + + public DeploymentGatesEvaluationRequestAttributes identifier(String identifier) { + this.identifier = identifier; + return this; + } + + /** + * The identifier of the deployment gate. Defaults to "default". + * + * @return identifier + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTIFIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + public DeploymentGatesEvaluationRequestAttributes primaryTag(String primaryTag) { + this.primaryTag = primaryTag; + return this; + } + + /** + * A primary tag to scope APM Faulty Deployment Detection rules. + * + * @return primaryTag + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIMARY_TAG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrimaryTag() { + return primaryTag; + } + + public void setPrimaryTag(String primaryTag) { + this.primaryTag = primaryTag; + } + + public DeploymentGatesEvaluationRequestAttributes service(String service) { + this.service = service; + return this; + } + + /** + * The service being deployed. + * + * @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 DeploymentGatesEvaluationRequestAttributes version(String version) { + this.version = version; + return this; + } + + /** + * The version of the deployment. Required for APM Faulty Deployment Detection rules. + * + * @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 DeploymentGatesEvaluationRequestAttributes + */ + @JsonAnySetter + public DeploymentGatesEvaluationRequestAttributes 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 DeploymentGatesEvaluationRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentGatesEvaluationRequestAttributes deploymentGatesEvaluationRequestAttributes = + (DeploymentGatesEvaluationRequestAttributes) o; + return Objects.equals(this.env, deploymentGatesEvaluationRequestAttributes.env) + && Objects.equals(this.identifier, deploymentGatesEvaluationRequestAttributes.identifier) + && Objects.equals(this.primaryTag, deploymentGatesEvaluationRequestAttributes.primaryTag) + && Objects.equals(this.service, deploymentGatesEvaluationRequestAttributes.service) + && Objects.equals(this.version, deploymentGatesEvaluationRequestAttributes.version) + && Objects.equals( + this.additionalProperties, + deploymentGatesEvaluationRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(env, identifier, primaryTag, service, version, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentGatesEvaluationRequestAttributes {\n"); + sb.append(" env: ").append(toIndentedString(env)).append("\n"); + sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); + sb.append(" primaryTag: ").append(toIndentedString(primaryTag)).append("\n"); + sb.append(" service: ").append(toIndentedString(service)).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/DeploymentGatesEvaluationRequestData.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationRequestData.java new file mode 100644 index 00000000000..2bc3584b112 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationRequestData.java @@ -0,0 +1,186 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for a deployment gate evaluation request. */ +@JsonPropertyOrder({ + DeploymentGatesEvaluationRequestData.JSON_PROPERTY_ATTRIBUTES, + DeploymentGatesEvaluationRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentGatesEvaluationRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private DeploymentGatesEvaluationRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DeploymentGatesEvaluationRequestDataType type = + DeploymentGatesEvaluationRequestDataType.DEPLOYMENT_GATES_EVALUATION_REQUEST; + + public DeploymentGatesEvaluationRequestData() {} + + @JsonCreator + public DeploymentGatesEvaluationRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + DeploymentGatesEvaluationRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + DeploymentGatesEvaluationRequestDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public DeploymentGatesEvaluationRequestData attributes( + DeploymentGatesEvaluationRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for a deployment gate evaluation request. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeploymentGatesEvaluationRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(DeploymentGatesEvaluationRequestAttributes attributes) { + this.attributes = attributes; + } + + public DeploymentGatesEvaluationRequestData type(DeploymentGatesEvaluationRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API type for a deployment gate evaluation request. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeploymentGatesEvaluationRequestDataType getType() { + return type; + } + + public void setType(DeploymentGatesEvaluationRequestDataType 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 DeploymentGatesEvaluationRequestData + */ + @JsonAnySetter + public DeploymentGatesEvaluationRequestData 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 DeploymentGatesEvaluationRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentGatesEvaluationRequestData deploymentGatesEvaluationRequestData = + (DeploymentGatesEvaluationRequestData) o; + return Objects.equals(this.attributes, deploymentGatesEvaluationRequestData.attributes) + && Objects.equals(this.type, deploymentGatesEvaluationRequestData.type) + && Objects.equals( + this.additionalProperties, deploymentGatesEvaluationRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentGatesEvaluationRequestData {\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/DeploymentGatesEvaluationRequestDataType.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationRequestDataType.java new file mode 100644 index 00000000000..c1e80fcf545 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationRequestDataType.java @@ -0,0 +1,63 @@ +/* + * 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; + +/** JSON:API type for a deployment gate evaluation request. */ +@JsonSerialize( + using = + DeploymentGatesEvaluationRequestDataType.DeploymentGatesEvaluationRequestDataTypeSerializer + .class) +public class DeploymentGatesEvaluationRequestDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("deployment_gates_evaluation_request")); + + public static final DeploymentGatesEvaluationRequestDataType DEPLOYMENT_GATES_EVALUATION_REQUEST = + new DeploymentGatesEvaluationRequestDataType("deployment_gates_evaluation_request"); + + DeploymentGatesEvaluationRequestDataType(String value) { + super(value, allowedValues); + } + + public static class DeploymentGatesEvaluationRequestDataTypeSerializer + extends StdSerializer { + public DeploymentGatesEvaluationRequestDataTypeSerializer( + Class t) { + super(t); + } + + public DeploymentGatesEvaluationRequestDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + DeploymentGatesEvaluationRequestDataType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static DeploymentGatesEvaluationRequestDataType fromValue(String value) { + return new DeploymentGatesEvaluationRequestDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationResponse.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationResponse.java new file mode 100644 index 00000000000..f94944992ca --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationResponse.java @@ -0,0 +1,138 @@ +/* + * 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 a deployment gate evaluation request. */ +@JsonPropertyOrder({DeploymentGatesEvaluationResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentGatesEvaluationResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private DeploymentGatesEvaluationResponseData data; + + public DeploymentGatesEvaluationResponse data(DeploymentGatesEvaluationResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for a deployment gate evaluation response. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeploymentGatesEvaluationResponseData getData() { + return data; + } + + public void setData(DeploymentGatesEvaluationResponseData 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 DeploymentGatesEvaluationResponse + */ + @JsonAnySetter + public DeploymentGatesEvaluationResponse 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 DeploymentGatesEvaluationResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentGatesEvaluationResponse deploymentGatesEvaluationResponse = + (DeploymentGatesEvaluationResponse) o; + return Objects.equals(this.data, deploymentGatesEvaluationResponse.data) + && Objects.equals( + this.additionalProperties, deploymentGatesEvaluationResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentGatesEvaluationResponse {\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/DeploymentGatesEvaluationResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationResponseAttributes.java new file mode 100644 index 00000000000..89c9499ce19 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationResponseAttributes.java @@ -0,0 +1,148 @@ +/* + * 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; + +/** Attributes for a deployment gate evaluation response. */ +@JsonPropertyOrder({DeploymentGatesEvaluationResponseAttributes.JSON_PROPERTY_EVALUATION_ID}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentGatesEvaluationResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_EVALUATION_ID = "evaluation_id"; + private String evaluationId; + + public DeploymentGatesEvaluationResponseAttributes() {} + + @JsonCreator + public DeploymentGatesEvaluationResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_EVALUATION_ID) String evaluationId) { + this.evaluationId = evaluationId; + } + + public DeploymentGatesEvaluationResponseAttributes evaluationId(String evaluationId) { + this.evaluationId = evaluationId; + return this; + } + + /** + * The unique identifier of the gate evaluation. + * + * @return evaluationId + */ + @JsonProperty(JSON_PROPERTY_EVALUATION_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEvaluationId() { + return evaluationId; + } + + public void setEvaluationId(String evaluationId) { + this.evaluationId = evaluationId; + } + + /** + * 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 DeploymentGatesEvaluationResponseAttributes + */ + @JsonAnySetter + public DeploymentGatesEvaluationResponseAttributes 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 DeploymentGatesEvaluationResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentGatesEvaluationResponseAttributes deploymentGatesEvaluationResponseAttributes = + (DeploymentGatesEvaluationResponseAttributes) o; + return Objects.equals( + this.evaluationId, deploymentGatesEvaluationResponseAttributes.evaluationId) + && Objects.equals( + this.additionalProperties, + deploymentGatesEvaluationResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(evaluationId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentGatesEvaluationResponseAttributes {\n"); + sb.append(" evaluationId: ").append(toIndentedString(evaluationId)).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/DeploymentGatesEvaluationResponseData.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationResponseData.java new file mode 100644 index 00000000000..919ed6acb8a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationResponseData.java @@ -0,0 +1,216 @@ +/* + * 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; +import java.util.UUID; + +/** Data for a deployment gate evaluation response. */ +@JsonPropertyOrder({ + DeploymentGatesEvaluationResponseData.JSON_PROPERTY_ATTRIBUTES, + DeploymentGatesEvaluationResponseData.JSON_PROPERTY_ID, + DeploymentGatesEvaluationResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentGatesEvaluationResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private DeploymentGatesEvaluationResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DeploymentGatesEvaluationResponseDataType type = + DeploymentGatesEvaluationResponseDataType.DEPLOYMENT_GATES_EVALUATION_RESPONSE; + + public DeploymentGatesEvaluationResponseData() {} + + @JsonCreator + public DeploymentGatesEvaluationResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + DeploymentGatesEvaluationResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + DeploymentGatesEvaluationResponseDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public DeploymentGatesEvaluationResponseData attributes( + DeploymentGatesEvaluationResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for a deployment gate evaluation response. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeploymentGatesEvaluationResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(DeploymentGatesEvaluationResponseAttributes attributes) { + this.attributes = attributes; + } + + public DeploymentGatesEvaluationResponseData id(UUID id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the evaluation response. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public DeploymentGatesEvaluationResponseData type( + DeploymentGatesEvaluationResponseDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API type for a deployment gate evaluation response. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeploymentGatesEvaluationResponseDataType getType() { + return type; + } + + public void setType(DeploymentGatesEvaluationResponseDataType 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 DeploymentGatesEvaluationResponseData + */ + @JsonAnySetter + public DeploymentGatesEvaluationResponseData 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 DeploymentGatesEvaluationResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentGatesEvaluationResponseData deploymentGatesEvaluationResponseData = + (DeploymentGatesEvaluationResponseData) o; + return Objects.equals(this.attributes, deploymentGatesEvaluationResponseData.attributes) + && Objects.equals(this.id, deploymentGatesEvaluationResponseData.id) + && Objects.equals(this.type, deploymentGatesEvaluationResponseData.type) + && Objects.equals( + this.additionalProperties, deploymentGatesEvaluationResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentGatesEvaluationResponseData {\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/DeploymentGatesEvaluationResponseDataType.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationResponseDataType.java new file mode 100644 index 00000000000..a4485cfee4f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationResponseDataType.java @@ -0,0 +1,64 @@ +/* + * 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; + +/** JSON:API type for a deployment gate evaluation response. */ +@JsonSerialize( + using = + DeploymentGatesEvaluationResponseDataType + .DeploymentGatesEvaluationResponseDataTypeSerializer.class) +public class DeploymentGatesEvaluationResponseDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("deployment_gates_evaluation_response")); + + public static final DeploymentGatesEvaluationResponseDataType + DEPLOYMENT_GATES_EVALUATION_RESPONSE = + new DeploymentGatesEvaluationResponseDataType("deployment_gates_evaluation_response"); + + DeploymentGatesEvaluationResponseDataType(String value) { + super(value, allowedValues); + } + + public static class DeploymentGatesEvaluationResponseDataTypeSerializer + extends StdSerializer { + public DeploymentGatesEvaluationResponseDataTypeSerializer( + Class t) { + super(t); + } + + public DeploymentGatesEvaluationResponseDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + DeploymentGatesEvaluationResponseDataType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static DeploymentGatesEvaluationResponseDataType fromValue(String value) { + return new DeploymentGatesEvaluationResponseDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationResultResponse.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationResultResponse.java new file mode 100644 index 00000000000..6d60832e738 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationResultResponse.java @@ -0,0 +1,140 @@ +/* + * 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 containing the result of a deployment gate evaluation. */ +@JsonPropertyOrder({DeploymentGatesEvaluationResultResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentGatesEvaluationResultResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private DeploymentGatesEvaluationResultResponseData data; + + public DeploymentGatesEvaluationResultResponse data( + DeploymentGatesEvaluationResultResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for a deployment gate evaluation result response. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeploymentGatesEvaluationResultResponseData getData() { + return data; + } + + public void setData(DeploymentGatesEvaluationResultResponseData 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 DeploymentGatesEvaluationResultResponse + */ + @JsonAnySetter + public DeploymentGatesEvaluationResultResponse 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 DeploymentGatesEvaluationResultResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentGatesEvaluationResultResponse deploymentGatesEvaluationResultResponse = + (DeploymentGatesEvaluationResultResponse) o; + return Objects.equals(this.data, deploymentGatesEvaluationResultResponse.data) + && Objects.equals( + this.additionalProperties, + deploymentGatesEvaluationResultResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentGatesEvaluationResultResponse {\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/DeploymentGatesEvaluationResultResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationResultResponseAttributes.java new file mode 100644 index 00000000000..439a39fff40 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationResultResponseAttributes.java @@ -0,0 +1,320 @@ +/* + * 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 java.util.UUID; + +/** Attributes for a deployment gate evaluation result response. */ +@JsonPropertyOrder({ + DeploymentGatesEvaluationResultResponseAttributes.JSON_PROPERTY_DRY_RUN, + DeploymentGatesEvaluationResultResponseAttributes.JSON_PROPERTY_EVALUATION_ID, + DeploymentGatesEvaluationResultResponseAttributes.JSON_PROPERTY_EVALUATION_URL, + DeploymentGatesEvaluationResultResponseAttributes.JSON_PROPERTY_GATE_ID, + DeploymentGatesEvaluationResultResponseAttributes.JSON_PROPERTY_GATE_STATUS, + DeploymentGatesEvaluationResultResponseAttributes.JSON_PROPERTY_RULES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentGatesEvaluationResultResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DRY_RUN = "dry_run"; + private Boolean dryRun; + + public static final String JSON_PROPERTY_EVALUATION_ID = "evaluation_id"; + private String evaluationId; + + public static final String JSON_PROPERTY_EVALUATION_URL = "evaluation_url"; + private String evaluationUrl; + + public static final String JSON_PROPERTY_GATE_ID = "gate_id"; + private UUID gateId; + + public static final String JSON_PROPERTY_GATE_STATUS = "gate_status"; + private DeploymentGatesEvaluationResultResponseAttributesGateStatus gateStatus; + + public static final String JSON_PROPERTY_RULES = "rules"; + private List rules = new ArrayList<>(); + + public DeploymentGatesEvaluationResultResponseAttributes() {} + + @JsonCreator + public DeploymentGatesEvaluationResultResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_DRY_RUN) Boolean dryRun, + @JsonProperty(required = true, value = JSON_PROPERTY_EVALUATION_ID) String evaluationId, + @JsonProperty(required = true, value = JSON_PROPERTY_EVALUATION_URL) String evaluationUrl, + @JsonProperty(required = true, value = JSON_PROPERTY_GATE_ID) UUID gateId, + @JsonProperty(required = true, value = JSON_PROPERTY_GATE_STATUS) + DeploymentGatesEvaluationResultResponseAttributesGateStatus gateStatus, + @JsonProperty(required = true, value = JSON_PROPERTY_RULES) + List rules) { + this.dryRun = dryRun; + this.evaluationId = evaluationId; + this.evaluationUrl = evaluationUrl; + this.gateId = gateId; + this.gateStatus = gateStatus; + this.unparsed |= !gateStatus.isValid(); + this.rules = rules; + } + + public DeploymentGatesEvaluationResultResponseAttributes dryRun(Boolean dryRun) { + this.dryRun = dryRun; + return this; + } + + /** + * Whether the gate was evaluated in dry-run mode. + * + * @return dryRun + */ + @JsonProperty(JSON_PROPERTY_DRY_RUN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getDryRun() { + return dryRun; + } + + public void setDryRun(Boolean dryRun) { + this.dryRun = dryRun; + } + + public DeploymentGatesEvaluationResultResponseAttributes evaluationId(String evaluationId) { + this.evaluationId = evaluationId; + return this; + } + + /** + * The unique identifier of the gate evaluation. + * + * @return evaluationId + */ + @JsonProperty(JSON_PROPERTY_EVALUATION_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEvaluationId() { + return evaluationId; + } + + public void setEvaluationId(String evaluationId) { + this.evaluationId = evaluationId; + } + + public DeploymentGatesEvaluationResultResponseAttributes evaluationUrl(String evaluationUrl) { + this.evaluationUrl = evaluationUrl; + return this; + } + + /** + * A URL to view the evaluation details in the Datadog UI. + * + * @return evaluationUrl + */ + @JsonProperty(JSON_PROPERTY_EVALUATION_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEvaluationUrl() { + return evaluationUrl; + } + + public void setEvaluationUrl(String evaluationUrl) { + this.evaluationUrl = evaluationUrl; + } + + public DeploymentGatesEvaluationResultResponseAttributes gateId(UUID gateId) { + this.gateId = gateId; + return this; + } + + /** + * The unique identifier of the deployment gate. + * + * @return gateId + */ + @JsonProperty(JSON_PROPERTY_GATE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getGateId() { + return gateId; + } + + public void setGateId(UUID gateId) { + this.gateId = gateId; + } + + public DeploymentGatesEvaluationResultResponseAttributes gateStatus( + DeploymentGatesEvaluationResultResponseAttributesGateStatus gateStatus) { + this.gateStatus = gateStatus; + this.unparsed |= !gateStatus.isValid(); + return this; + } + + /** + * The overall status of the gate evaluation. - in_progress: The evaluation is still + * running. - pass: All rules passed successfully and the deployment is allowed to + * proceed. - fail: One or more rules did not pass; the deployment should not + * proceed. + * + * @return gateStatus + */ + @JsonProperty(JSON_PROPERTY_GATE_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeploymentGatesEvaluationResultResponseAttributesGateStatus getGateStatus() { + return gateStatus; + } + + public void setGateStatus( + DeploymentGatesEvaluationResultResponseAttributesGateStatus gateStatus) { + if (!gateStatus.isValid()) { + this.unparsed = true; + } + this.gateStatus = gateStatus; + } + + public DeploymentGatesEvaluationResultResponseAttributes rules( + List rules) { + this.rules = rules; + for (DeploymentGatesRuleResponse item : rules) { + this.unparsed |= item.unparsed; + } + return this; + } + + public DeploymentGatesEvaluationResultResponseAttributes addRulesItem( + DeploymentGatesRuleResponse rulesItem) { + this.rules.add(rulesItem); + this.unparsed |= rulesItem.unparsed; + return this; + } + + /** + * The results of individual rule evaluations. + * + * @return rules + */ + @JsonProperty(JSON_PROPERTY_RULES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getRules() { + return rules; + } + + public void setRules(List rules) { + this.rules = rules; + } + + /** + * 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 DeploymentGatesEvaluationResultResponseAttributes + */ + @JsonAnySetter + public DeploymentGatesEvaluationResultResponseAttributes 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 DeploymentGatesEvaluationResultResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentGatesEvaluationResultResponseAttributes + deploymentGatesEvaluationResultResponseAttributes = + (DeploymentGatesEvaluationResultResponseAttributes) o; + return Objects.equals(this.dryRun, deploymentGatesEvaluationResultResponseAttributes.dryRun) + && Objects.equals( + this.evaluationId, deploymentGatesEvaluationResultResponseAttributes.evaluationId) + && Objects.equals( + this.evaluationUrl, deploymentGatesEvaluationResultResponseAttributes.evaluationUrl) + && Objects.equals(this.gateId, deploymentGatesEvaluationResultResponseAttributes.gateId) + && Objects.equals( + this.gateStatus, deploymentGatesEvaluationResultResponseAttributes.gateStatus) + && Objects.equals(this.rules, deploymentGatesEvaluationResultResponseAttributes.rules) + && Objects.equals( + this.additionalProperties, + deploymentGatesEvaluationResultResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + dryRun, evaluationId, evaluationUrl, gateId, gateStatus, rules, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentGatesEvaluationResultResponseAttributes {\n"); + sb.append(" dryRun: ").append(toIndentedString(dryRun)).append("\n"); + sb.append(" evaluationId: ").append(toIndentedString(evaluationId)).append("\n"); + sb.append(" evaluationUrl: ").append(toIndentedString(evaluationUrl)).append("\n"); + sb.append(" gateId: ").append(toIndentedString(gateId)).append("\n"); + sb.append(" gateStatus: ").append(toIndentedString(gateStatus)).append("\n"); + sb.append(" rules: ").append(toIndentedString(rules)).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/DeploymentGatesEvaluationResultResponseAttributesGateStatus.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationResultResponseAttributesGateStatus.java new file mode 100644 index 00000000000..20dd8ff10f9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationResultResponseAttributesGateStatus.java @@ -0,0 +1,72 @@ +/* + * 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 overall status of the gate evaluation. - in_progress: The evaluation is still + * running. - pass: All rules passed successfully and the deployment is allowed to + * proceed. - fail: One or more rules did not pass; the deployment should not proceed. + */ +@JsonSerialize( + using = + DeploymentGatesEvaluationResultResponseAttributesGateStatus + .DeploymentGatesEvaluationResultResponseAttributesGateStatusSerializer.class) +public class DeploymentGatesEvaluationResultResponseAttributesGateStatus extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("in_progress", "pass", "fail")); + + public static final DeploymentGatesEvaluationResultResponseAttributesGateStatus IN_PROGRESS = + new DeploymentGatesEvaluationResultResponseAttributesGateStatus("in_progress"); + public static final DeploymentGatesEvaluationResultResponseAttributesGateStatus PASS = + new DeploymentGatesEvaluationResultResponseAttributesGateStatus("pass"); + public static final DeploymentGatesEvaluationResultResponseAttributesGateStatus FAIL = + new DeploymentGatesEvaluationResultResponseAttributesGateStatus("fail"); + + DeploymentGatesEvaluationResultResponseAttributesGateStatus(String value) { + super(value, allowedValues); + } + + public static class DeploymentGatesEvaluationResultResponseAttributesGateStatusSerializer + extends StdSerializer { + public DeploymentGatesEvaluationResultResponseAttributesGateStatusSerializer( + Class t) { + super(t); + } + + public DeploymentGatesEvaluationResultResponseAttributesGateStatusSerializer() { + this(null); + } + + @Override + public void serialize( + DeploymentGatesEvaluationResultResponseAttributesGateStatus value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static DeploymentGatesEvaluationResultResponseAttributesGateStatus fromValue( + String value) { + return new DeploymentGatesEvaluationResultResponseAttributesGateStatus(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationResultResponseData.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationResultResponseData.java new file mode 100644 index 00000000000..8bbf27fac98 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationResultResponseData.java @@ -0,0 +1,217 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for a deployment gate evaluation result response. */ +@JsonPropertyOrder({ + DeploymentGatesEvaluationResultResponseData.JSON_PROPERTY_ATTRIBUTES, + DeploymentGatesEvaluationResultResponseData.JSON_PROPERTY_ID, + DeploymentGatesEvaluationResultResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentGatesEvaluationResultResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private DeploymentGatesEvaluationResultResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DeploymentGatesEvaluationResultResponseDataType type = + DeploymentGatesEvaluationResultResponseDataType.DEPLOYMENT_GATES_EVALUATION_RESULT_RESPONSE; + + public DeploymentGatesEvaluationResultResponseData() {} + + @JsonCreator + public DeploymentGatesEvaluationResultResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + DeploymentGatesEvaluationResultResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + DeploymentGatesEvaluationResultResponseDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public DeploymentGatesEvaluationResultResponseData attributes( + DeploymentGatesEvaluationResultResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for a deployment gate evaluation result response. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeploymentGatesEvaluationResultResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(DeploymentGatesEvaluationResultResponseAttributes attributes) { + this.attributes = attributes; + } + + public DeploymentGatesEvaluationResultResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the evaluation. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public DeploymentGatesEvaluationResultResponseData type( + DeploymentGatesEvaluationResultResponseDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API type for a deployment gate evaluation result response. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeploymentGatesEvaluationResultResponseDataType getType() { + return type; + } + + public void setType(DeploymentGatesEvaluationResultResponseDataType 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 DeploymentGatesEvaluationResultResponseData + */ + @JsonAnySetter + public DeploymentGatesEvaluationResultResponseData 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 DeploymentGatesEvaluationResultResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentGatesEvaluationResultResponseData deploymentGatesEvaluationResultResponseData = + (DeploymentGatesEvaluationResultResponseData) o; + return Objects.equals(this.attributes, deploymentGatesEvaluationResultResponseData.attributes) + && Objects.equals(this.id, deploymentGatesEvaluationResultResponseData.id) + && Objects.equals(this.type, deploymentGatesEvaluationResultResponseData.type) + && Objects.equals( + this.additionalProperties, + deploymentGatesEvaluationResultResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentGatesEvaluationResultResponseData {\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/DeploymentGatesEvaluationResultResponseDataType.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationResultResponseDataType.java new file mode 100644 index 00000000000..50edebe7900 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesEvaluationResultResponseDataType.java @@ -0,0 +1,65 @@ +/* + * 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; + +/** JSON:API type for a deployment gate evaluation result response. */ +@JsonSerialize( + using = + DeploymentGatesEvaluationResultResponseDataType + .DeploymentGatesEvaluationResultResponseDataTypeSerializer.class) +public class DeploymentGatesEvaluationResultResponseDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("deployment_gates_evaluation_result_response")); + + public static final DeploymentGatesEvaluationResultResponseDataType + DEPLOYMENT_GATES_EVALUATION_RESULT_RESPONSE = + new DeploymentGatesEvaluationResultResponseDataType( + "deployment_gates_evaluation_result_response"); + + DeploymentGatesEvaluationResultResponseDataType(String value) { + super(value, allowedValues); + } + + public static class DeploymentGatesEvaluationResultResponseDataTypeSerializer + extends StdSerializer { + public DeploymentGatesEvaluationResultResponseDataTypeSerializer( + Class t) { + super(t); + } + + public DeploymentGatesEvaluationResultResponseDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + DeploymentGatesEvaluationResultResponseDataType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static DeploymentGatesEvaluationResultResponseDataType fromValue(String value) { + return new DeploymentGatesEvaluationResultResponseDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesListResponse.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesListResponse.java new file mode 100644 index 00000000000..a369b1c5f88 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesListResponse.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.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 containing a paginated list of deployment gates. */ +@JsonPropertyOrder({ + DeploymentGatesListResponse.JSON_PROPERTY_DATA, + DeploymentGatesListResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentGatesListResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public static final String JSON_PROPERTY_META = "meta"; + private DeploymentGatesListResponseMeta meta; + + public DeploymentGatesListResponse data(List data) { + this.data = data; + for (DeploymentGateResponseData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public DeploymentGatesListResponse addDataItem(DeploymentGateResponseData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of deployment gates. + * + * @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; + } + + public DeploymentGatesListResponse meta(DeploymentGatesListResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata for a list of deployment gates response. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeploymentGatesListResponseMeta getMeta() { + return meta; + } + + public void setMeta(DeploymentGatesListResponseMeta meta) { + this.meta = meta; + } + + /** + * 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 DeploymentGatesListResponse + */ + @JsonAnySetter + public DeploymentGatesListResponse 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 DeploymentGatesListResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentGatesListResponse deploymentGatesListResponse = (DeploymentGatesListResponse) o; + return Objects.equals(this.data, deploymentGatesListResponse.data) + && Objects.equals(this.meta, deploymentGatesListResponse.meta) + && Objects.equals( + this.additionalProperties, deploymentGatesListResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentGatesListResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).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/DeploymentGatesListResponseMeta.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesListResponseMeta.java new file mode 100644 index 00000000000..d8dcb45f3a5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesListResponseMeta.java @@ -0,0 +1,138 @@ +/* + * 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; + +/** Metadata for a list of deployment gates response. */ +@JsonPropertyOrder({DeploymentGatesListResponseMeta.JSON_PROPERTY_PAGE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentGatesListResponseMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PAGE = "page"; + private DeploymentGatesListResponseMetaPage page; + + public DeploymentGatesListResponseMeta page(DeploymentGatesListResponseMetaPage page) { + this.page = page; + this.unparsed |= page.unparsed; + return this; + } + + /** + * Pagination information for a list of deployment gates. + * + * @return page + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeploymentGatesListResponseMetaPage getPage() { + return page; + } + + public void setPage(DeploymentGatesListResponseMetaPage page) { + this.page = page; + } + + /** + * 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 DeploymentGatesListResponseMeta + */ + @JsonAnySetter + public DeploymentGatesListResponseMeta 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 DeploymentGatesListResponseMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentGatesListResponseMeta deploymentGatesListResponseMeta = + (DeploymentGatesListResponseMeta) o; + return Objects.equals(this.page, deploymentGatesListResponseMeta.page) + && Objects.equals( + this.additionalProperties, deploymentGatesListResponseMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(page, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentGatesListResponseMeta {\n"); + sb.append(" page: ").append(toIndentedString(page)).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/DeploymentGatesListResponseMetaPage.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesListResponseMetaPage.java new file mode 100644 index 00000000000..0475d8f316e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesListResponseMetaPage.java @@ -0,0 +1,193 @@ +/* + * 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; + +/** Pagination information for a list of deployment gates. */ +@JsonPropertyOrder({ + DeploymentGatesListResponseMetaPage.JSON_PROPERTY_CURSOR, + DeploymentGatesListResponseMetaPage.JSON_PROPERTY_NEXT_CURSOR, + DeploymentGatesListResponseMetaPage.JSON_PROPERTY_SIZE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentGatesListResponseMetaPage { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CURSOR = "cursor"; + private String cursor; + + public static final String JSON_PROPERTY_NEXT_CURSOR = "next_cursor"; + private String nextCursor; + + public static final String JSON_PROPERTY_SIZE = "size"; + private Long size = 50l; + + public DeploymentGatesListResponseMetaPage cursor(String cursor) { + this.cursor = cursor; + return this; + } + + /** + * The cursor used for the current page. + * + * @return cursor + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CURSOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCursor() { + return cursor; + } + + public void setCursor(String cursor) { + this.cursor = cursor; + } + + public DeploymentGatesListResponseMetaPage nextCursor(String nextCursor) { + this.nextCursor = nextCursor; + return this; + } + + /** + * The cursor to use to fetch the next page. This is absent when there are no more pages. + * + * @return nextCursor + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NEXT_CURSOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNextCursor() { + return nextCursor; + } + + public void setNextCursor(String nextCursor) { + this.nextCursor = nextCursor; + } + + public DeploymentGatesListResponseMetaPage size(Long size) { + this.size = size; + return this; + } + + /** + * The number of results per page. minimum: 1 maximum: 1000 + * + * @return size + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSize() { + return size; + } + + public void setSize(Long size) { + this.size = size; + } + + /** + * 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 DeploymentGatesListResponseMetaPage + */ + @JsonAnySetter + public DeploymentGatesListResponseMetaPage 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 DeploymentGatesListResponseMetaPage object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentGatesListResponseMetaPage deploymentGatesListResponseMetaPage = + (DeploymentGatesListResponseMetaPage) o; + return Objects.equals(this.cursor, deploymentGatesListResponseMetaPage.cursor) + && Objects.equals(this.nextCursor, deploymentGatesListResponseMetaPage.nextCursor) + && Objects.equals(this.size, deploymentGatesListResponseMetaPage.size) + && Objects.equals( + this.additionalProperties, deploymentGatesListResponseMetaPage.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(cursor, nextCursor, size, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentGatesListResponseMetaPage {\n"); + sb.append(" cursor: ").append(toIndentedString(cursor)).append("\n"); + sb.append(" nextCursor: ").append(toIndentedString(nextCursor)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).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/DeploymentGatesRuleResponse.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesRuleResponse.java new file mode 100644 index 00000000000..bd5196ee47e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentGatesRuleResponse.java @@ -0,0 +1,227 @@ +/* + * 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; + +/** The result of a single rule evaluation. */ +@JsonPropertyOrder({ + DeploymentGatesRuleResponse.JSON_PROPERTY_DRY_RUN, + DeploymentGatesRuleResponse.JSON_PROPERTY_NAME, + DeploymentGatesRuleResponse.JSON_PROPERTY_REASON, + DeploymentGatesRuleResponse.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentGatesRuleResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DRY_RUN = "dry_run"; + private Boolean dryRun; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_REASON = "reason"; + private String reason; + + public static final String JSON_PROPERTY_STATUS = "status"; + private DeploymentGatesEvaluationResultResponseAttributesGateStatus status; + + public DeploymentGatesRuleResponse dryRun(Boolean dryRun) { + this.dryRun = dryRun; + return this; + } + + /** + * Whether this rule was evaluated in dry-run mode. + * + * @return dryRun + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DRY_RUN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDryRun() { + return dryRun; + } + + public void setDryRun(Boolean dryRun) { + this.dryRun = dryRun; + } + + public DeploymentGatesRuleResponse name(String name) { + this.name = name; + return this; + } + + /** + * The name of the rule. + * + * @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 DeploymentGatesRuleResponse reason(String reason) { + this.reason = reason; + return this; + } + + /** + * The reason for the rule result, if applicable. + * + * @return reason + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReason() { + return reason; + } + + public void setReason(String reason) { + this.reason = reason; + } + + public DeploymentGatesRuleResponse status( + DeploymentGatesEvaluationResultResponseAttributesGateStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * The overall status of the gate evaluation. - in_progress: The evaluation is still + * running. - pass: All rules passed successfully and the deployment is allowed to + * proceed. - fail: One or more rules did not pass; the deployment should not + * proceed. + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeploymentGatesEvaluationResultResponseAttributesGateStatus getStatus() { + return status; + } + + public void setStatus(DeploymentGatesEvaluationResultResponseAttributesGateStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DeploymentGatesRuleResponse + */ + @JsonAnySetter + public DeploymentGatesRuleResponse 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 DeploymentGatesRuleResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentGatesRuleResponse deploymentGatesRuleResponse = (DeploymentGatesRuleResponse) o; + return Objects.equals(this.dryRun, deploymentGatesRuleResponse.dryRun) + && Objects.equals(this.name, deploymentGatesRuleResponse.name) + && Objects.equals(this.reason, deploymentGatesRuleResponse.reason) + && Objects.equals(this.status, deploymentGatesRuleResponse.status) + && Objects.equals( + this.additionalProperties, deploymentGatesRuleResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(dryRun, name, reason, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentGatesRuleResponse {\n"); + sb.append(" dryRun: ").append(toIndentedString(dryRun)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/cassettes/features/v2/Create_deployment_gate_returns_Bad_request_invalid_response.freeze b/src/test/resources/cassettes/features/v2/Create_deployment_gate_returns_Bad_request_invalid_response.freeze new file mode 100644 index 00000000000..d82c14f94d0 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_deployment_gate_returns_Bad_request_invalid_response.freeze @@ -0,0 +1 @@ +2026-03-17T10:23:13.804Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_deployment_gate_returns_Bad_request_invalid_response.json b/src/test/resources/cassettes/features/v2/Create_deployment_gate_returns_Bad_request_invalid_response.json new file mode 100644 index 00000000000..ba00ab5b164 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_deployment_gate_returns_Bad_request_invalid_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testcreatedeploymentgatereturnsbadrequestresponse1773742993\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"2ddfb377-44de-47fe-b53c-58cf800cca1b\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2026-03-17T10:23:14.339908Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testcreatedeploymentgatereturnsbadrequestresponse1773742993\",\"service\":\"my-service\",\"updated_at\":\"2026-03-17T10:23:14.339908Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "020ce72a-7ddc-0bcf-fbd6-0617025cb171" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testcreatedeploymentgatereturnsbadrequestresponse1773742993\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"Gate already exists with the given env, service and identifier\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "020ce72a-7ddc-0bcf-fbd6-0617025cb172" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/2ddfb377-44de-47fe-b53c-58cf800cca1b", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "4414ec54-0a1d-7e9f-a2c9-99f524473533" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_Bad_request_invalid_response.freeze b/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_Bad_request_invalid_response.freeze new file mode 100644 index 00000000000..51145fd2316 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_Bad_request_invalid_response.freeze @@ -0,0 +1 @@ +2026-03-17T10:23:14.811Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_Bad_request_invalid_response.json b/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_Bad_request_invalid_response.json new file mode 100644 index 00000000000..0c7bfd64814 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_Bad_request_invalid_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"name\":\"My deployment rule\",\"options\":{\"duration\":3600,\"excluded_resources\":[\"resource1\",\"resource2\"]},\"type\":\"faulty_deployment_detection\"},\"type\":\"deployment_rule\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates/not-a-valid-id/rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"gate_id\\\" Invalid id\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "3c48aa89-c5df-8a1d-8958-5b444e815819" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_Bad_request_invalid_response.freeze b/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_Bad_request_invalid_response.freeze new file mode 100644 index 00000000000..dd4ee3cef64 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_Bad_request_invalid_response.freeze @@ -0,0 +1 @@ +2026-03-17T10:23:14.936Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_Bad_request_invalid_response.json b/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_Bad_request_invalid_response.json new file mode 100644 index 00000000000..09dbb27c6d8 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_Bad_request_invalid_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/not-a-valid-id", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"id\\\" Invalid id\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "bea4f12a-db0b-70a4-125d-b34c8a4f9ff1" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_Deployment_gate_not_found_response.freeze b/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_Deployment_gate_not_found_response.freeze new file mode 100644 index 00000000000..a4484143166 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_Deployment_gate_not_found_response.freeze @@ -0,0 +1 @@ +2026-03-17T10:23:15.078Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_Deployment_gate_not_found_response.json b/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_Deployment_gate_not_found_response.json new file mode 100644 index 00000000000..f1352c789e9 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_Deployment_gate_not_found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/00000000-0000-0000-0000-000000000000", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"Gate does not exist\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a5b90335-da2e-61c8-ead3-f7988f71846e" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_Bad_request_invalid_response.freeze b/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_Bad_request_invalid_response.freeze new file mode 100644 index 00000000000..166e7ef115f --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_Bad_request_invalid_response.freeze @@ -0,0 +1 @@ +2026-03-17T10:23:15.199Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_Bad_request_invalid_response.json b/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_Bad_request_invalid_response.json new file mode 100644 index 00000000000..383831df9f4 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_Bad_request_invalid_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/not-a-valid-id/rules/not-a-valid-id", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"gate_id\\\" Invalid id\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c89b9025-cfcb-5785-7492-70d7341b5dec" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_Deployment_gate_not_found_response.freeze b/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_Deployment_gate_not_found_response.freeze new file mode 100644 index 00000000000..d7a7461d035 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_Deployment_gate_not_found_response.freeze @@ -0,0 +1 @@ +2026-03-17T10:23:15.316Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_Deployment_gate_not_found_response.json b/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_Deployment_gate_not_found_response.json new file mode 100644 index 00000000000..e860998e70d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_Deployment_gate_not_found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/00000000-0000-0000-0000-000000000000/rules/00000000-0000-0000-0000-000000000000", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"Rule does not exist\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "4f725524-bb38-591c-76e5-c80474399e67" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_deployment_gates_evaluation_result_returns_Bad_request_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_deployment_gates_evaluation_result_returns_Bad_request_response.freeze new file mode 100644 index 00000000000..3bd75e8166b --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_deployment_gates_evaluation_result_returns_Bad_request_response.freeze @@ -0,0 +1 @@ +2026-03-17T10:23:15.458Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_deployment_gates_evaluation_result_returns_Bad_request_response.json b/src/test/resources/cassettes/features/v2/Get_a_deployment_gates_evaluation_result_returns_Bad_request_response.json new file mode 100644 index 00000000000..1320913daf7 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_deployment_gates_evaluation_result_returns_Bad_request_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/deployments/gates/evaluation/not-a-valid-id", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"id\\\" Invalid id\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "61a71892-8e88-9cd7-1908-052859f50094" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_deployment_gates_evaluation_result_returns_Deployment_gate_not_found_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_deployment_gates_evaluation_result_returns_Deployment_gate_not_found_response.freeze new file mode 100644 index 00000000000..44058d5f1dd --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_deployment_gates_evaluation_result_returns_Deployment_gate_not_found_response.freeze @@ -0,0 +1 @@ +2026-03-17T10:23:15.592Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_deployment_gates_evaluation_result_returns_Deployment_gate_not_found_response.json b/src/test/resources/cassettes/features/v2/Get_a_deployment_gates_evaluation_result_returns_Deployment_gate_not_found_response.json new file mode 100644 index 00000000000..7d41783ffa0 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_deployment_gates_evaluation_result_returns_Deployment_gate_not_found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/deployments/gates/evaluation/00000000-0000-0000-0000-000000000000", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"gate evaluation with id 00000000-0000-0000-0000-000000000000 not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "abc570f7-6866-f86e-c809-4baf35dfabd2" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_deployment_gates_evaluation_result_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_deployment_gates_evaluation_result_returns_OK_response.freeze new file mode 100644 index 00000000000..b929d919bfb --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_deployment_gates_evaluation_result_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-03-17T10:23:15.715Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_deployment_gates_evaluation_result_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_a_deployment_gates_evaluation_result_returns_OK_response.json new file mode 100644 index 00000000000..72bc1daaf68 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_deployment_gates_evaluation_result_returns_OK_response.json @@ -0,0 +1,160 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testgetadeploymentgatesevaluationresultreturnsokresponse1773742995\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"7b930550-63b0-4002-8b74-4c827bd070d3\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2026-03-17T10:23:15.799742Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testgetadeploymentgatesevaluationresultreturnsokresponse1773742995\",\"service\":\"my-service\",\"updated_at\":\"2026-03-17T10:23:15.799742Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ca64f643-82d2-165c-b0e1-b61fc408de3e" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"name\":\"My deployment rule\",\"options\":{\"excluded_resources\":[]},\"type\":\"faulty_deployment_detection\"},\"type\":\"deployment_rule\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates/7b930550-63b0-4002-8b74-4c827bd070d3/rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"c2058cfd-aa63-4efc-a8fe-a37d622e7cc3\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2026-03-17T10:23:15.934037Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"7b930550-63b0-4002-8b74-4c827bd070d3\",\"name\":\"My deployment rule\",\"options\":{\"excluded_resources\":[]},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2026-03-17T10:23:15.934037Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f0d5d775-23e8-12df-3603-a5eeb7f5ef5c" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"env\":\"production\",\"identifier\":\"my-gate-testgetadeploymentgatesevaluationresultreturnsokresponse1773742995\",\"service\":\"my-service\"},\"type\":\"deployment_gates_evaluation_request\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployments/gates/evaluation", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"fb1d7aef-236f-433d-ab3e-11648edb64c0\",\"type\":\"deployment_gates_evaluation_response\",\"attributes\":{\"evaluation_id\":\"fb1d7aef-236f-433d-ab3e-11648edb64c0\"}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 202, + "reasonPhrase": "Accepted" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "1b809f42-9b29-ce08-1dbf-f079a65a9d6f" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/deployments/gates/evaluation/fb1d7aef-236f-433d-ab3e-11648edb64c0", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"fb1d7aef-236f-433d-ab3e-11648edb64c0\",\"type\":\"deployment_gates_evaluation_result_response\",\"attributes\":{\"dry_run\":false,\"evaluation_id\":\"fb1d7aef-236f-433d-ab3e-11648edb64c0\",\"evaluation_url\":\"https://frog.datadoghq.com/ci/deployment-gates/evaluations?deployment_gates_source=evaluation_result_url\\u0026end=1773743896343\\u0026index=cdgates\\u0026paused=true\\u0026query=level%3Agate+%40evaluation_id%3Afb1d7aef-236f-433d-ab3e-11648edb64c0\\u0026recent_gate_id=fb1d7aef-236f-433d-ab3e-11648edb64c0\\u0026start=1773742096343\",\"gate_id\":\"7b930550-63b0-4002-8b74-4c827bd070d3\",\"gate_status\":\"in_progress\",\"rules\":[{\"name\":\"My deployment rule\",\"status\":\"in_progress\",\"dry_run\":false}]}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "baafee81-b411-b794-1173-247548afa885" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/7b930550-63b0-4002-8b74-4c827bd070d3/rules/c2058cfd-aa63-4efc-a8fe-a37d622e7cc3", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0f00d228-d773-292a-48e0-3227ab6f0151" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/7b930550-63b0-4002-8b74-4c827bd070d3", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a21f9e91-78c3-04ad-72b8-c79347a837eb" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_Bad_request_invalid_response.freeze b/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_Bad_request_invalid_response.freeze new file mode 100644 index 00000000000..fd19f0667fc --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_Bad_request_invalid_response.freeze @@ -0,0 +1 @@ +2026-03-17T10:23:16.714Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_Bad_request_invalid_response.json b/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_Bad_request_invalid_response.json new file mode 100644 index 00000000000..cea3fd14b83 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_Bad_request_invalid_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/deployment_gates/not-a-valid-id", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"id\\\" Invalid id\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d75a04ba-bd99-5143-385d-0827f0291e8a" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_Deployment_gate_not_found_response.freeze b/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_Deployment_gate_not_found_response.freeze new file mode 100644 index 00000000000..9e48a99314c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_Deployment_gate_not_found_response.freeze @@ -0,0 +1 @@ +2026-03-17T10:23:16.827Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_Deployment_gate_not_found_response.json b/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_Deployment_gate_not_found_response.json new file mode 100644 index 00000000000..0cd5fbce1c1 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_Deployment_gate_not_found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/deployment_gates/00000000-0000-0000-0000-000000000000", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"Gate does not exist\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7162b372-af2f-758e-b8be-1ef46398a92f" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Bad_request_invalid_response.freeze b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Bad_request_invalid_response.freeze new file mode 100644 index 00000000000..b549853588c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Bad_request_invalid_response.freeze @@ -0,0 +1 @@ +2026-03-17T10:23:16.977Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Bad_request_invalid_response.json b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Bad_request_invalid_response.json new file mode 100644 index 00000000000..cd8130b9889 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Bad_request_invalid_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/deployment_gates/not-a-valid-id/rules/not-a-valid-id", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"gate_id\\\" Invalid id\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c46471e4-0f7f-c782-405d-2e7569c021fd" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Deployment_rule_not_found_response.freeze b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Deployment_rule_not_found_response.freeze new file mode 100644 index 00000000000..015ddfda339 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Deployment_rule_not_found_response.freeze @@ -0,0 +1 @@ +2026-03-17T10:23:17.101Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Deployment_rule_not_found_response.json b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Deployment_rule_not_found_response.json new file mode 100644 index 00000000000..278f60edb80 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Deployment_rule_not_found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/deployment_gates/00000000-0000-0000-0000-000000000000/rules/00000000-0000-0000-0000-000000000000", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"Rule does not exist\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "19eb4a82-9876-175c-98ce-4d9b70fe53d0" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_rules_for_a_deployment_gate_returns_Bad_request_response.freeze b/src/test/resources/cassettes/features/v2/Get_rules_for_a_deployment_gate_returns_Bad_request_response.freeze new file mode 100644 index 00000000000..bec78d5b82e --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_rules_for_a_deployment_gate_returns_Bad_request_response.freeze @@ -0,0 +1 @@ +2026-03-17T10:23:17.224Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_rules_for_a_deployment_gate_returns_Bad_request_response.json b/src/test/resources/cassettes/features/v2/Get_rules_for_a_deployment_gate_returns_Bad_request_response.json new file mode 100644 index 00000000000..6ac59553a5a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_rules_for_a_deployment_gate_returns_Bad_request_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/deployment_gates/not-a-valid-id/rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"gate_id\\\" Invalid id\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "71e32228-5e90-7e3f-4849-6b048d295662" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Trigger_a_deployment_gates_evaluation_returns_Accepted_response.freeze b/src/test/resources/cassettes/features/v2/Trigger_a_deployment_gates_evaluation_returns_Accepted_response.freeze new file mode 100644 index 00000000000..de92181ae35 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Trigger_a_deployment_gates_evaluation_returns_Accepted_response.freeze @@ -0,0 +1 @@ +2026-03-17T10:23:17.356Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Trigger_a_deployment_gates_evaluation_returns_Accepted_response.json b/src/test/resources/cassettes/features/v2/Trigger_a_deployment_gates_evaluation_returns_Accepted_response.json new file mode 100644 index 00000000000..850803e8b3e --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Trigger_a_deployment_gates_evaluation_returns_Accepted_response.json @@ -0,0 +1,134 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testtriggeradeploymentgatesevaluationreturnsacceptedresponse1773742997\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"9d4fad94-29e3-452d-817d-5bc3f0ddbcb4\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2026-03-17T10:23:17.458814Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testtriggeradeploymentgatesevaluationreturnsacceptedresponse1773742997\",\"service\":\"my-service\",\"updated_at\":\"2026-03-17T10:23:17.458814Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "3d3a7525-7f99-f856-037c-9ddc9ad995a4" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"name\":\"My deployment rule\",\"options\":{\"excluded_resources\":[]},\"type\":\"faulty_deployment_detection\"},\"type\":\"deployment_rule\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates/9d4fad94-29e3-452d-817d-5bc3f0ddbcb4/rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"891bdcc9-ae8f-4fbc-87ad-5dfb83fc447f\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2026-03-17T10:23:17.620863Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"9d4fad94-29e3-452d-817d-5bc3f0ddbcb4\",\"name\":\"My deployment rule\",\"options\":{\"excluded_resources\":[]},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2026-03-17T10:23:17.620863Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7cc1bb95-468e-67b0-0621-e7c1c2b467b2" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"env\":\"production\",\"identifier\":\"my-gate-testtriggeradeploymentgatesevaluationreturnsacceptedresponse1773742997\",\"service\":\"my-service\"},\"type\":\"deployment_gates_evaluation_request\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployments/gates/evaluation", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"a3d2923c-ee20-490c-bd12-7139a805c949\",\"type\":\"deployment_gates_evaluation_response\",\"attributes\":{\"evaluation_id\":\"a3d2923c-ee20-490c-bd12-7139a805c949\"}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 202, + "reasonPhrase": "Accepted" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b3b0f260-2d50-5a32-cbe5-2c35639bfba9" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/9d4fad94-29e3-452d-817d-5bc3f0ddbcb4/rules/891bdcc9-ae8f-4fbc-87ad-5dfb83fc447f", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "152e15f8-1245-d7b8-ac0e-ce058395a66e" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/9d4fad94-29e3-452d-817d-5bc3f0ddbcb4", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b01863b1-dd83-0fb9-17ad-dba42b1fa798" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Trigger_a_deployment_gates_evaluation_returns_Bad_request_response.freeze b/src/test/resources/cassettes/features/v2/Trigger_a_deployment_gates_evaluation_returns_Bad_request_response.freeze new file mode 100644 index 00000000000..882a0382f0b --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Trigger_a_deployment_gates_evaluation_returns_Bad_request_response.freeze @@ -0,0 +1 @@ +2026-03-20T09:57:05.683Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Trigger_a_deployment_gates_evaluation_returns_Bad_request_response.json b/src/test/resources/cassettes/features/v2/Trigger_a_deployment_gates_evaluation_returns_Bad_request_response.json new file mode 100644 index 00000000000..1b4b4527a1b --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Trigger_a_deployment_gates_evaluation_returns_Bad_request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"env\":\"\",\"service\":\"my-service\"},\"type\":\"deployment_gates_evaluation_request\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployments/gates/evaluation", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"required env field is missing\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "1c3abbc2-6587-119f-61fe-c01d3340a6cf" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Trigger_a_deployment_gates_evaluation_returns_Deployment_gate_not_found_response.freeze b/src/test/resources/cassettes/features/v2/Trigger_a_deployment_gates_evaluation_returns_Deployment_gate_not_found_response.freeze new file mode 100644 index 00000000000..273be7a0789 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Trigger_a_deployment_gates_evaluation_returns_Deployment_gate_not_found_response.freeze @@ -0,0 +1 @@ +2026-03-17T10:23:18.627Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Trigger_a_deployment_gates_evaluation_returns_Deployment_gate_not_found_response.json b/src/test/resources/cassettes/features/v2/Trigger_a_deployment_gates_evaluation_returns_Deployment_gate_not_found_response.json new file mode 100644 index 00000000000..f60e5deecb4 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Trigger_a_deployment_gates_evaluation_returns_Deployment_gate_not_found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"env\":\"staging\",\"service\":\"non-existent-service-xyz\"},\"type\":\"deployment_gates_evaluation_request\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployments/gates/evaluation", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"no gate found for service non-existent-service-xyz, env staging, and identifier default\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "98ce8f93-e367-4c45-1f46-caec999199e1" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_Bad_request_invalid_response.freeze b/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_Bad_request_invalid_response.freeze new file mode 100644 index 00000000000..1b2c93460c4 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_Bad_request_invalid_response.freeze @@ -0,0 +1 @@ +2026-03-17T10:23:18.738Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_Bad_request_invalid_response.json b/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_Bad_request_invalid_response.json new file mode 100644 index 00000000000..1b24ee4e4bf --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_Bad_request_invalid_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false},\"id\":\"12345678-1234-1234-1234-123456789012\",\"type\":\"deployment_gate\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/deployment_gates/not-a-valid-id", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"id\\\" Invalid id\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "248e6599-6962-a278-6784-cd52708fcfb5" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_Deployment_gate_not_found_response.freeze b/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_Deployment_gate_not_found_response.freeze new file mode 100644 index 00000000000..b5a2443187a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_Deployment_gate_not_found_response.freeze @@ -0,0 +1 @@ +2026-03-17T10:23:18.854Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_Deployment_gate_not_found_response.json b/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_Deployment_gate_not_found_response.json new file mode 100644 index 00000000000..8b3f97ecb1a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_Deployment_gate_not_found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false},\"id\":\"12345678-1234-1234-1234-123456789012\",\"type\":\"deployment_gate\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/deployment_gates/00000000-0000-0000-0000-000000000000", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"Gate does not exist\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7d26b071-6772-906d-2350-b6c151c052be" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Bad_request_invalid_response.freeze b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Bad_request_invalid_response.freeze new file mode 100644 index 00000000000..a30a58dadc0 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Bad_request_invalid_response.freeze @@ -0,0 +1 @@ +2026-03-17T10:23:18.972Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Bad_request_invalid_response.json b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Bad_request_invalid_response.json new file mode 100644 index 00000000000..915e2843b4d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Bad_request_invalid_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"name\":\"Updated deployment rule\",\"options\":{\"duration\":3600,\"excluded_resources\":[\"resource1\",\"resource2\"]}},\"type\":\"deployment_rule\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/deployment_gates/not-a-valid-id/rules/not-a-valid-id", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"gate_id\\\" Invalid id\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c6755845-3dad-4f38-551c-6c27299f0aba" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Deployment_rule_not_found_response.freeze b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Deployment_rule_not_found_response.freeze new file mode 100644 index 00000000000..cd87ba2394c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Deployment_rule_not_found_response.freeze @@ -0,0 +1 @@ +2026-03-17T10:23:19.084Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Deployment_rule_not_found_response.json b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Deployment_rule_not_found_response.json new file mode 100644 index 00000000000..332dbdb2aee --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Deployment_rule_not_found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"name\":\"Updated deployment rule\",\"options\":{\"duration\":3600,\"excluded_resources\":[\"resource1\",\"resource2\"]}},\"type\":\"deployment_rule\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/deployment_gates/00000000-0000-0000-0000-000000000000/rules/00000000-0000-0000-0000-000000000000", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"Rule does not exist\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "1f474ac7-2eae-9762-709f-f5ec8b69838c" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/deployment_gates.feature b/src/test/resources/com/datadog/api/client/v2/api/deployment_gates.feature index cb0c5a1262d..df9494d2aed 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/deployment_gates.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/deployment_gates.feature @@ -79,11 +79,11 @@ Feature: Deployment Gates When the request is sent Then the response status is 400 Bad request. - @generated @skip @team:DataDog/ci-app-backend + @team:DataDog/ci-app-backend Scenario: Delete deployment gate returns "Deployment gate not found." response Given operation "DeleteDeploymentGate" enabled And new "DeleteDeploymentGate" request - And request contains "id" parameter from "REPLACE.ME" + And request contains "id" parameter with value "00000000-0000-0000-0000-000000000000" When the request is sent Then the response status is 404 Deployment gate not found. @@ -114,12 +114,12 @@ Feature: Deployment Gates When the request is sent Then the response status is 400 Bad request. - @generated @skip @team:DataDog/ci-app-backend + @team:DataDog/ci-app-backend Scenario: Delete deployment rule returns "Deployment gate not found." response Given operation "DeleteDeploymentRule" enabled And new "DeleteDeploymentRule" request - And request contains "gate_id" parameter from "REPLACE.ME" - And request contains "id" parameter from "REPLACE.ME" + And request contains "gate_id" parameter with value "00000000-0000-0000-0000-000000000000" + And request contains "id" parameter with value "00000000-0000-0000-0000-000000000000" When the request is sent Then the response status is 404 Deployment gate not found. @@ -134,6 +134,64 @@ Feature: Deployment Gates When the request is sent Then the response status is 204 No Content + @generated @skip @team:DataDog/ci-app-backend + Scenario: Get a deployment gate evaluation result returns "Bad request." response + Given operation "GetDeploymentGatesEvaluationResult" enabled + And new "GetDeploymentGatesEvaluationResult" request + And request contains "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 gate evaluation result returns "Deployment gate not found." response + Given operation "GetDeploymentGatesEvaluationResult" enabled + And new "GetDeploymentGatesEvaluationResult" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Deployment gate not found. + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Get a deployment gate evaluation result returns "OK" response + Given operation "GetDeploymentGatesEvaluationResult" enabled + And new "GetDeploymentGatesEvaluationResult" request + And request contains "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 deployment gates evaluation result returns "Deployment gate not found." response + Given operation "GetDeploymentGatesEvaluationResult" enabled + And new "GetDeploymentGatesEvaluationResult" request + And request contains "id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 404 Deployment gate not found. + + @team:DataDog/ci-app-backend + Scenario: Get a deployment gates evaluation result returns "OK" response + Given operation "GetDeploymentGatesEvaluationResult" enabled + And there is a valid "deployment_gate" in the system + And there is a valid "deployment_rule" in the system + And there is a valid "deployment_gates_evaluation" in the system + And new "GetDeploymentGatesEvaluationResult" request + And request contains "id" parameter from "deployment_gates_evaluation.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "deployment_gates_evaluation_result_response" + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Get all deployment gates returns "Bad request." response + Given operation "ListDeploymentGates" enabled + And new "ListDeploymentGates" request + When the request is sent + Then the response status is 400 Bad request. + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Get all deployment gates returns "OK" response + Given operation "ListDeploymentGates" enabled + And new "ListDeploymentGates" request + When the request is sent + Then the response status is 200 OK + @team:DataDog/ci-app-backend Scenario: Get deployment gate returns "Bad Request" response Given operation "GetDeploymentGate" enabled @@ -150,11 +208,11 @@ Feature: Deployment Gates When the request is sent Then the response status is 400 Bad request. - @generated @skip @team:DataDog/ci-app-backend + @team:DataDog/ci-app-backend Scenario: Get deployment gate returns "Deployment gate not found." response Given operation "GetDeploymentGate" enabled And new "GetDeploymentGate" request - And request contains "id" parameter from "REPLACE.ME" + And request contains "id" parameter with value "00000000-0000-0000-0000-000000000000" When the request is sent Then the response status is 404 Deployment gate not found. @@ -187,12 +245,12 @@ Feature: Deployment Gates When the request is sent Then the response status is 400 Bad request. - @generated @skip @team:DataDog/ci-app-backend + @team:DataDog/ci-app-backend Scenario: Get deployment rule returns "Deployment rule not found." response Given operation "GetDeploymentRule" enabled And new "GetDeploymentRule" request - And request contains "gate_id" parameter from "REPLACE.ME" - And request contains "id" parameter from "REPLACE.ME" + And request contains "gate_id" parameter with value "00000000-0000-0000-0000-000000000000" + And request contains "id" parameter with value "00000000-0000-0000-0000-000000000000" When the request is sent Then the response status is 404 Deployment rule not found. @@ -207,11 +265,11 @@ Feature: Deployment Gates When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/ci-app-backend + @team:DataDog/ci-app-backend Scenario: Get rules for a deployment gate returns "Bad request." response Given operation "GetDeploymentGateRules" enabled And new "GetDeploymentGateRules" request - And request contains "gate_id" parameter from "REPLACE.ME" + And request contains "gate_id" parameter with value "not-a-valid-id" When the request is sent Then the response status is 400 Bad request. @@ -224,6 +282,57 @@ Feature: Deployment Gates When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ci-app-backend + Scenario: Trigger a deployment gate evaluation returns "Accepted" response + Given operation "TriggerDeploymentGatesEvaluation" enabled + And new "TriggerDeploymentGatesEvaluation" request + And body with value {"data": {"attributes": {"env": "staging", "identifier": "pre-deploy", "primary_tag": "region:us-east-1", "service": "transaction-backend", "version": "v1.2.3"}, "type": "deployment_gates_evaluation_request"}} + When the request is sent + Then the response status is 202 Accepted + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Trigger a deployment gate evaluation returns "Bad request." response + Given operation "TriggerDeploymentGatesEvaluation" enabled + And new "TriggerDeploymentGatesEvaluation" request + And body with value {"data": {"attributes": {"env": "staging", "identifier": "pre-deploy", "primary_tag": "region:us-east-1", "service": "transaction-backend", "version": "v1.2.3"}, "type": "deployment_gates_evaluation_request"}} + When the request is sent + Then the response status is 400 Bad request. + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Trigger a deployment gate evaluation returns "Deployment gate not found." response + Given operation "TriggerDeploymentGatesEvaluation" enabled + And new "TriggerDeploymentGatesEvaluation" request + And body with value {"data": {"attributes": {"env": "staging", "identifier": "pre-deploy", "primary_tag": "region:us-east-1", "service": "transaction-backend", "version": "v1.2.3"}, "type": "deployment_gates_evaluation_request"}} + When the request is sent + Then the response status is 404 Deployment gate not found. + + @team:DataDog/ci-app-backend + Scenario: Trigger a deployment gates evaluation returns "Accepted" response + Given operation "TriggerDeploymentGatesEvaluation" enabled + And there is a valid "deployment_gate" in the system + And there is a valid "deployment_rule" in the system + And new "TriggerDeploymentGatesEvaluation" request + And body with value {"data": {"attributes": {"env": "production", "identifier": "{{ deployment_gate.data.attributes.identifier }}", "service": "my-service"}, "type": "deployment_gates_evaluation_request"}} + When the request is sent + Then the response status is 202 Accepted + And the response "data.type" is equal to "deployment_gates_evaluation_response" + + @team:DataDog/ci-app-backend + Scenario: Trigger a deployment gates evaluation returns "Bad request." response + Given operation "TriggerDeploymentGatesEvaluation" enabled + And new "TriggerDeploymentGatesEvaluation" request + And body with value {"data": {"attributes": {"env": "", "service": "my-service"}, "type": "deployment_gates_evaluation_request"}} + When the request is sent + Then the response status is 400 Bad request. + + @team:DataDog/ci-app-backend + Scenario: Trigger a deployment gates evaluation returns "Deployment gate not found." response + Given operation "TriggerDeploymentGatesEvaluation" enabled + And new "TriggerDeploymentGatesEvaluation" request + And body with value {"data": {"attributes": {"env": "staging", "service": "non-existent-service-xyz"}, "type": "deployment_gates_evaluation_request"}} + When the request is sent + Then the response status is 404 Deployment gate not found. + @team:DataDog/ci-app-backend Scenario: Update deployment gate returns "Bad Request" response Given operation "UpdateDeploymentGate" enabled @@ -242,11 +351,11 @@ Feature: Deployment Gates When the request is sent Then the response status is 400 Bad request. - @generated @skip @team:DataDog/ci-app-backend + @team:DataDog/ci-app-backend Scenario: Update deployment gate returns "Deployment gate not found." response Given operation "UpdateDeploymentGate" enabled And new "UpdateDeploymentGate" request - And request contains "id" parameter from "REPLACE.ME" + And request contains "id" parameter with value "00000000-0000-0000-0000-000000000000" And body with value {"data": {"attributes": {"dry_run": false}, "id": "12345678-1234-1234-1234-123456789012", "type": "deployment_gate"}} When the request is sent Then the response status is 404 Deployment gate not found. @@ -283,12 +392,12 @@ Feature: Deployment Gates When the request is sent Then the response status is 400 Bad request. - @generated @skip @team:DataDog/ci-app-backend + @team:DataDog/ci-app-backend Scenario: Update deployment rule returns "Deployment rule not found." response Given operation "UpdateDeploymentRule" enabled And new "UpdateDeploymentRule" request - And request contains "gate_id" parameter from "REPLACE.ME" - And request contains "id" parameter from "REPLACE.ME" + And request contains "gate_id" parameter with value "00000000-0000-0000-0000-000000000000" + And request contains "id" parameter with value "00000000-0000-0000-0000-000000000000" And body with value {"data": {"attributes": {"dry_run": false, "name": "Updated deployment rule", "options": {"duration": 3600, "excluded_resources": ["resource1", "resource2"]}}, "type": "deployment_rule"}} When the request is sent Then the response status is 404 Deployment rule not found. diff --git a/src/test/resources/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json index 61c0b7da745..2fee80e2ff9 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/given.json +++ b/src/test/resources/com/datadog/api/client/v2/api/given.json @@ -404,6 +404,18 @@ "tag": "Deployment Gates", "operationId": "CreateDeploymentRule" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"deployment_gates_evaluation_request\",\n \"attributes\": {\n \"service\": \"my-service\",\n \"env\": \"production\",\n \"identifier\": \"{{ deployment_gate.data.attributes.identifier }}\"\n }\n }\n}" + } + ], + "step": "there is a valid \"deployment_gates_evaluation\" in the system", + "key": "deployment_gates_evaluation", + "tag": "Deployment Gates", + "operationId": "TriggerDeploymentGatesEvaluation" + }, { "parameters": [ { 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 28ebe49741d..405cf8c8f2b 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 @@ -1514,6 +1514,12 @@ "type": "idempotent" } }, + "ListDeploymentGates": { + "tag": "Deployment Gates", + "undo": { + "type": "safe" + } + }, "CreateDeploymentGate": { "tag": "Deployment Gates", "undo": { @@ -1586,6 +1592,18 @@ "type": "idempotent" } }, + "TriggerDeploymentGatesEvaluation": { + "tag": "Deployment Gates", + "undo": { + "type": "safe" + } + }, + "GetDeploymentGatesEvaluationResult": { + "tag": "Deployment Gates", + "undo": { + "type": "safe" + } + }, "GetDomainAllowlist": { "tag": "Domain Allowlist", "undo": {