From 6b721ee4acea12a636a6678d931e7b236f6dc57c Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 18 Mar 2026 16:28:48 +0000 Subject: [PATCH] Regenerate client from commit de58be0 of spec repo --- .generator/schemas/v2/openapi.yaml | 409 ++++++++++++++++++ ...eturns-Bad-request-invalid-response.frozen | 1 + ...e-returns-Bad-request-invalid-response.yml | 65 +++ ...eturns-Bad-request-invalid-response.frozen | 1 + ...e-returns-Bad-request-invalid-response.yml | 25 ++ ...eturns-Bad-request-invalid-response.frozen | 1 + ...e-returns-Bad-request-invalid-response.yml | 21 + ...-Deployment-gate-not-found-response.frozen | 1 + ...rns-Deployment-gate-not-found-response.yml | 21 + ...eturns-Bad-request-invalid-response.frozen | 1 + ...e-returns-Bad-request-invalid-response.yml | 21 + ...-Deployment-gate-not-found-response.frozen | 1 + ...rns-Deployment-gate-not-found-response.yml | 21 + ...result-returns-Bad-request-response.frozen | 1 + ...on-result-returns-Bad-request-response.yml | 21 + ...-Deployment-gate-not-found-response.frozen | 1 + ...rns-Deployment-gate-not-found-response.yml | 21 + ...aluation-result-returns-OK-response.frozen | 1 + ...-evaluation-result-returns-OK-response.yml | 124 ++++++ ...eturns-Bad-request-invalid-response.frozen | 1 + ...e-returns-Bad-request-invalid-response.yml | 21 + ...-Deployment-gate-not-found-response.frozen | 1 + ...rns-Deployment-gate-not-found-response.yml | 21 + ...eturns-Bad-request-invalid-response.frozen | 1 + ...e-returns-Bad-request-invalid-response.yml | 21 + ...-Deployment-rule-not-found-response.frozen | 1 + ...rns-Deployment-rule-not-found-response.yml | 21 + ...t-gate-returns-Bad-request-response.frozen | 1 + ...ment-gate-returns-Bad-request-response.yml | 21 + ...valuation-returns-Accepted-response.frozen | 1 + ...s-evaluation-returns-Accepted-response.yml | 105 +++++ ...uation-returns-Bad-request-response.frozen | 1 + ...valuation-returns-Bad-request-response.yml | 25 ++ ...-Deployment-gate-not-found-response.frozen | 1 + ...rns-Deployment-gate-not-found-response.yml | 25 ++ ...eturns-Bad-request-invalid-response.frozen | 1 + ...e-returns-Bad-request-invalid-response.yml | 25 ++ ...-Deployment-gate-not-found-response.frozen | 1 + ...rns-Deployment-gate-not-found-response.yml | 25 ++ ...eturns-Bad-request-invalid-response.frozen | 1 + ...e-returns-Bad-request-invalid-response.yml | 25 ++ ...-Deployment-rule-not-found-response.frozen | 1 + ...rns-Deployment-rule-not-found-response.yml | 25 ++ .../GetDeploymentGatesEvaluationResult.rb | 8 + .../deployment-gates/ListDeploymentGates.rb | 8 + .../TriggerDeploymentGatesEvaluation.rb | 19 + features/scenarios_model_mapping.rb | 10 + features/v2/deployment_gates.feature | 95 +++- features/v2/given.json | 12 + features/v2/undo.json | 18 + lib/datadog_api_client/configuration.rb | 1 + lib/datadog_api_client/inflector.rb | 18 + .../v2/api/deployment_gates_api.rb | 215 +++++++++ .../deployment_gates_evaluation_request.rb | 123 ++++++ ...ent_gates_evaluation_request_attributes.rb | 183 ++++++++ ...eployment_gates_evaluation_request_data.rb | 144 ++++++ ...ment_gates_evaluation_request_data_type.rb | 26 ++ .../deployment_gates_evaluation_response.rb | 105 +++++ ...nt_gates_evaluation_response_attributes.rb | 123 ++++++ ...ployment_gates_evaluation_response_data.rb | 165 +++++++ ...ent_gates_evaluation_response_data_type.rb | 26 ++ ...oyment_gates_evaluation_result_response.rb | 105 +++++ ...s_evaluation_result_response_attributes.rb | 197 +++++++++ ..._result_response_attributes_gate_status.rb | 28 ++ ...t_gates_evaluation_result_response_data.rb | 165 +++++++ ...es_evaluation_result_response_data_type.rb | 26 ++ .../models/deployment_gates_git_metadata.rb | 115 +++++ .../models/deployment_gates_list_response.rb | 117 +++++ .../deployment_gates_list_response_meta.rb | 105 +++++ ...eployment_gates_list_response_meta_page.rb | 147 +++++++ .../models/deployment_gates_rule_response.rb | 135 ++++++ 71 files changed, 3552 insertions(+), 17 deletions(-) create mode 100644 cassettes/features/v2/deployment_gates/Create-deployment-gate-returns-Bad-request-invalid-response.frozen create mode 100644 cassettes/features/v2/deployment_gates/Create-deployment-gate-returns-Bad-request-invalid-response.yml create mode 100644 cassettes/features/v2/deployment_gates/Create-deployment-rule-returns-Bad-request-invalid-response.frozen create mode 100644 cassettes/features/v2/deployment_gates/Create-deployment-rule-returns-Bad-request-invalid-response.yml create mode 100644 cassettes/features/v2/deployment_gates/Delete-deployment-gate-returns-Bad-request-invalid-response.frozen create mode 100644 cassettes/features/v2/deployment_gates/Delete-deployment-gate-returns-Bad-request-invalid-response.yml create mode 100644 cassettes/features/v2/deployment_gates/Delete-deployment-gate-returns-Deployment-gate-not-found-response.frozen create mode 100644 cassettes/features/v2/deployment_gates/Delete-deployment-gate-returns-Deployment-gate-not-found-response.yml create mode 100644 cassettes/features/v2/deployment_gates/Delete-deployment-rule-returns-Bad-request-invalid-response.frozen create mode 100644 cassettes/features/v2/deployment_gates/Delete-deployment-rule-returns-Bad-request-invalid-response.yml create mode 100644 cassettes/features/v2/deployment_gates/Delete-deployment-rule-returns-Deployment-gate-not-found-response.frozen create mode 100644 cassettes/features/v2/deployment_gates/Delete-deployment-rule-returns-Deployment-gate-not-found-response.yml create mode 100644 cassettes/features/v2/deployment_gates/Get-a-deployment-gates-evaluation-result-returns-Bad-request-response.frozen create mode 100644 cassettes/features/v2/deployment_gates/Get-a-deployment-gates-evaluation-result-returns-Bad-request-response.yml create mode 100644 cassettes/features/v2/deployment_gates/Get-a-deployment-gates-evaluation-result-returns-Deployment-gate-not-found-response.frozen create mode 100644 cassettes/features/v2/deployment_gates/Get-a-deployment-gates-evaluation-result-returns-Deployment-gate-not-found-response.yml create mode 100644 cassettes/features/v2/deployment_gates/Get-a-deployment-gates-evaluation-result-returns-OK-response.frozen create mode 100644 cassettes/features/v2/deployment_gates/Get-a-deployment-gates-evaluation-result-returns-OK-response.yml create mode 100644 cassettes/features/v2/deployment_gates/Get-deployment-gate-returns-Bad-request-invalid-response.frozen create mode 100644 cassettes/features/v2/deployment_gates/Get-deployment-gate-returns-Bad-request-invalid-response.yml create mode 100644 cassettes/features/v2/deployment_gates/Get-deployment-gate-returns-Deployment-gate-not-found-response.frozen create mode 100644 cassettes/features/v2/deployment_gates/Get-deployment-gate-returns-Deployment-gate-not-found-response.yml create mode 100644 cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-Bad-request-invalid-response.frozen create mode 100644 cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-Bad-request-invalid-response.yml create mode 100644 cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-Deployment-rule-not-found-response.frozen create mode 100644 cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-Deployment-rule-not-found-response.yml create mode 100644 cassettes/features/v2/deployment_gates/Get-rules-for-a-deployment-gate-returns-Bad-request-response.frozen create mode 100644 cassettes/features/v2/deployment_gates/Get-rules-for-a-deployment-gate-returns-Bad-request-response.yml create mode 100644 cassettes/features/v2/deployment_gates/Trigger-a-deployment-gates-evaluation-returns-Accepted-response.frozen create mode 100644 cassettes/features/v2/deployment_gates/Trigger-a-deployment-gates-evaluation-returns-Accepted-response.yml create mode 100644 cassettes/features/v2/deployment_gates/Trigger-a-deployment-gates-evaluation-returns-Bad-request-response.frozen create mode 100644 cassettes/features/v2/deployment_gates/Trigger-a-deployment-gates-evaluation-returns-Bad-request-response.yml create mode 100644 cassettes/features/v2/deployment_gates/Trigger-a-deployment-gates-evaluation-returns-Deployment-gate-not-found-response.frozen create mode 100644 cassettes/features/v2/deployment_gates/Trigger-a-deployment-gates-evaluation-returns-Deployment-gate-not-found-response.yml create mode 100644 cassettes/features/v2/deployment_gates/Update-deployment-gate-returns-Bad-request-invalid-response.frozen create mode 100644 cassettes/features/v2/deployment_gates/Update-deployment-gate-returns-Bad-request-invalid-response.yml create mode 100644 cassettes/features/v2/deployment_gates/Update-deployment-gate-returns-Deployment-gate-not-found-response.frozen create mode 100644 cassettes/features/v2/deployment_gates/Update-deployment-gate-returns-Deployment-gate-not-found-response.yml create mode 100644 cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-Bad-request-invalid-response.frozen create mode 100644 cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-Bad-request-invalid-response.yml create mode 100644 cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-Deployment-rule-not-found-response.frozen create mode 100644 cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-Deployment-rule-not-found-response.yml create mode 100644 examples/v2/deployment-gates/GetDeploymentGatesEvaluationResult.rb create mode 100644 examples/v2/deployment-gates/ListDeploymentGates.rb create mode 100644 examples/v2/deployment-gates/TriggerDeploymentGatesEvaluation.rb create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_evaluation_request.rb create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_evaluation_request_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_evaluation_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_evaluation_request_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_evaluation_response.rb create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_evaluation_response_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_evaluation_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_evaluation_response_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_evaluation_result_response.rb create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_evaluation_result_response_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_evaluation_result_response_attributes_gate_status.rb create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_evaluation_result_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_evaluation_result_response_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_git_metadata.rb create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_list_response.rb create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_list_response_meta.rb create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_list_response_meta_page.rb create mode 100644 lib/datadog_api_client/v2/models/deployment_gates_rule_response.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 7ae721a4124b..17be7825d704 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -20992,6 +20992,253 @@ components: data: $ref: '#/components/schemas/ListDeploymentRuleResponseData' type: object + DeploymentGatesEvaluationRequest: + description: Request body for triggering a deployment gates evaluation. + properties: + data: + $ref: '#/components/schemas/DeploymentGatesEvaluationRequestData' + required: + - data + type: object + DeploymentGatesEvaluationRequestAttributes: + description: Attributes for a deployment gates evaluation request. + properties: + env: + description: The environment of the deployment. + example: staging + type: string + git_metadata: + $ref: '#/components/schemas/DeploymentGatesGitMetadata' + identifier: + default: default + description: The identifier of the deployment gate. Defaults to "default". + example: pre-deploy + type: string + monitors_query_variable: + description: A query variable to scope monitor rules to a specific deployment. + example: service:my-service + 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 + type: object + DeploymentGatesEvaluationRequestData: + description: Data for a deployment gates 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 gates 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 gates evaluation request. + properties: + data: + $ref: '#/components/schemas/DeploymentGatesEvaluationResponseData' + type: object + DeploymentGatesEvaluationResponseAttributes: + description: Attributes for a deployment gates 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 gates 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 gates 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 gates evaluation. + properties: + data: + $ref: '#/components/schemas/DeploymentGatesEvaluationResultResponseData' + type: object + DeploymentGatesEvaluationResultResponseAttributes: + description: Attributes for a deployment gates 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: + - evaluation_id + - gate_status + - dry_run + type: object + DeploymentGatesEvaluationResultResponseAttributesGateStatus: + description: The overall status of the gate evaluation. A status of `in_progress` + means the evaluation is still running. + enum: + - in_progress + - pass + - fail + example: pass + type: string + x-enum-varnames: + - IN_PROGRESS + - PASS + - FAIL + DeploymentGatesEvaluationResultResponseData: + description: Data for a deployment gates 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 gates 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 + DeploymentGatesGitMetadata: + description: Git metadata for a deployment gates evaluation. + properties: + commit_sha: + description: The commit SHA of the deployment. + example: abc123def456 + type: string + repository_url: + description: The URL of the repository. + example: https://github.com/my-org/my-repo + type: string + type: object + 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: + description: The status of the rule evaluation. + example: pass + type: string + type: object DeploymentMetadata: description: Metadata object containing the publication creation information. properties: @@ -82447,6 +82694,64 @@ paths: 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. operationId: CreateDeploymentGate @@ -82887,6 +83192,110 @@ 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 gates 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. + + Polling every 10-20 seconds is recommended.' + 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 gates evaluation + tags: + - Deployment Gates + x-permission: + operator: OR + permissions: + - deployment_gates_evaluate + /api/v2/deployments/gates/evaluation/{id}: + get: + description: 'Retrieves the result of a deployment gates 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`. + + 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 gates evaluation result + tags: + - Deployment Gates + x-permission: + operator: OR + permissions: + - deployment_gates_evaluate /api/v2/domain_allowlist: get: description: Get the domain allowlist for an organization. diff --git a/cassettes/features/v2/deployment_gates/Create-deployment-gate-returns-Bad-request-invalid-response.frozen b/cassettes/features/v2/deployment_gates/Create-deployment-gate-returns-Bad-request-invalid-response.frozen new file mode 100644 index 000000000000..d82c14f94d08 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Create-deployment-gate-returns-Bad-request-invalid-response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:13.804Z \ No newline at end of file diff --git a/cassettes/features/v2/deployment_gates/Create-deployment-gate-returns-Bad-request-invalid-response.yml b/cassettes/features/v2/deployment_gates/Create-deployment-gate-returns-Bad-request-invalid-response.yml new file mode 100644 index 000000000000..9cd0f5db87c5 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Create-deployment-gate-returns-Bad-request-invalid-response.yml @@ -0,0 +1,65 @@ +http_interactions: +- recorded_at: Tue, 17 Mar 2026 10:23:13 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testcreatedeploymentgatereturnsbadrequestresponse1773742993","service":"my-service"},"type":"deployment_gate"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/deployment_gates + response: + body: + encoding: UTF-8 + string: '{"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 + status: + code: 200 + message: OK +- recorded_at: Tue, 17 Mar 2026 10:23:13 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testcreatedeploymentgatereturnsbadrequestresponse1773742993","service":"my-service"},"type":"deployment_gate"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/deployment_gates + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"Gate already + exists with the given env, service and identifier"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +- recorded_at: Tue, 17 Mar 2026 10:23:13 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/deployment_gates/2ddfb377-44de-47fe-b53c-58cf800cca1b + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/deployment_gates/Create-deployment-rule-returns-Bad-request-invalid-response.frozen b/cassettes/features/v2/deployment_gates/Create-deployment-rule-returns-Bad-request-invalid-response.frozen new file mode 100644 index 000000000000..51145fd23164 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Create-deployment-rule-returns-Bad-request-invalid-response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:14.811Z \ No newline at end of file diff --git a/cassettes/features/v2/deployment_gates/Create-deployment-rule-returns-Bad-request-invalid-response.yml b/cassettes/features/v2/deployment_gates/Create-deployment-rule-returns-Bad-request-invalid-response.yml new file mode 100644 index 000000000000..b023a7540181 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Create-deployment-rule-returns-Bad-request-invalid-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Tue, 17 Mar 2026 10:23:14 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"dry_run":false,"name":"My deployment rule","options":{"duration":3600,"excluded_resources":["resource1","resource2"]},"type":"faulty_deployment_detection"},"type":"deployment_rule"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/deployment_gates/not-a-valid-id/rules + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"gate_id\" Invalid id"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/deployment_gates/Delete-deployment-gate-returns-Bad-request-invalid-response.frozen b/cassettes/features/v2/deployment_gates/Delete-deployment-gate-returns-Bad-request-invalid-response.frozen new file mode 100644 index 000000000000..dd4ee3cef648 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Delete-deployment-gate-returns-Bad-request-invalid-response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:14.936Z \ No newline at end of file diff --git a/cassettes/features/v2/deployment_gates/Delete-deployment-gate-returns-Bad-request-invalid-response.yml b/cassettes/features/v2/deployment_gates/Delete-deployment-gate-returns-Bad-request-invalid-response.yml new file mode 100644 index 000000000000..e8510d40a41e --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Delete-deployment-gate-returns-Bad-request-invalid-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Tue, 17 Mar 2026 10:23:14 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/deployment_gates/not-a-valid-id + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"id\" Invalid id"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/deployment_gates/Delete-deployment-gate-returns-Deployment-gate-not-found-response.frozen b/cassettes/features/v2/deployment_gates/Delete-deployment-gate-returns-Deployment-gate-not-found-response.frozen new file mode 100644 index 000000000000..a44841431669 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Delete-deployment-gate-returns-Deployment-gate-not-found-response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:15.078Z \ No newline at end of file diff --git a/cassettes/features/v2/deployment_gates/Delete-deployment-gate-returns-Deployment-gate-not-found-response.yml b/cassettes/features/v2/deployment_gates/Delete-deployment-gate-returns-Deployment-gate-not-found-response.yml new file mode 100644 index 000000000000..c22373422c31 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Delete-deployment-gate-returns-Deployment-gate-not-found-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Tue, 17 Mar 2026 10:23:15 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/deployment_gates/00000000-0000-0000-0000-000000000000 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Gate does + not exist"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/deployment_gates/Delete-deployment-rule-returns-Bad-request-invalid-response.frozen b/cassettes/features/v2/deployment_gates/Delete-deployment-rule-returns-Bad-request-invalid-response.frozen new file mode 100644 index 000000000000..166e7ef115f8 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Delete-deployment-rule-returns-Bad-request-invalid-response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:15.199Z \ No newline at end of file diff --git a/cassettes/features/v2/deployment_gates/Delete-deployment-rule-returns-Bad-request-invalid-response.yml b/cassettes/features/v2/deployment_gates/Delete-deployment-rule-returns-Bad-request-invalid-response.yml new file mode 100644 index 000000000000..58897fb36959 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Delete-deployment-rule-returns-Bad-request-invalid-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Tue, 17 Mar 2026 10:23:15 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/deployment_gates/not-a-valid-id/rules/not-a-valid-id + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"gate_id\" Invalid id"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/deployment_gates/Delete-deployment-rule-returns-Deployment-gate-not-found-response.frozen b/cassettes/features/v2/deployment_gates/Delete-deployment-rule-returns-Deployment-gate-not-found-response.frozen new file mode 100644 index 000000000000..d7a7461d0358 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Delete-deployment-rule-returns-Deployment-gate-not-found-response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:15.316Z \ No newline at end of file diff --git a/cassettes/features/v2/deployment_gates/Delete-deployment-rule-returns-Deployment-gate-not-found-response.yml b/cassettes/features/v2/deployment_gates/Delete-deployment-rule-returns-Deployment-gate-not-found-response.yml new file mode 100644 index 000000000000..a58e5a410753 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Delete-deployment-rule-returns-Deployment-gate-not-found-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Tue, 17 Mar 2026 10:23:15 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/deployment_gates/00000000-0000-0000-0000-000000000000/rules/00000000-0000-0000-0000-000000000000 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/deployment_gates/Get-a-deployment-gates-evaluation-result-returns-Bad-request-response.frozen b/cassettes/features/v2/deployment_gates/Get-a-deployment-gates-evaluation-result-returns-Bad-request-response.frozen new file mode 100644 index 000000000000..3bd75e8166bd --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Get-a-deployment-gates-evaluation-result-returns-Bad-request-response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:15.458Z \ No newline at end of file diff --git a/cassettes/features/v2/deployment_gates/Get-a-deployment-gates-evaluation-result-returns-Bad-request-response.yml b/cassettes/features/v2/deployment_gates/Get-a-deployment-gates-evaluation-result-returns-Bad-request-response.yml new file mode 100644 index 000000000000..461053dbe919 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Get-a-deployment-gates-evaluation-result-returns-Bad-request-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Tue, 17 Mar 2026 10:23:15 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/deployments/gates/evaluation/not-a-valid-id + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"id\" Invalid id"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/deployment_gates/Get-a-deployment-gates-evaluation-result-returns-Deployment-gate-not-found-response.frozen b/cassettes/features/v2/deployment_gates/Get-a-deployment-gates-evaluation-result-returns-Deployment-gate-not-found-response.frozen new file mode 100644 index 000000000000..44058d5f1dd8 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Get-a-deployment-gates-evaluation-result-returns-Deployment-gate-not-found-response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:15.592Z \ No newline at end of file diff --git a/cassettes/features/v2/deployment_gates/Get-a-deployment-gates-evaluation-result-returns-Deployment-gate-not-found-response.yml b/cassettes/features/v2/deployment_gates/Get-a-deployment-gates-evaluation-result-returns-Deployment-gate-not-found-response.yml new file mode 100644 index 000000000000..46e48a55b6d2 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Get-a-deployment-gates-evaluation-result-returns-Deployment-gate-not-found-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Tue, 17 Mar 2026 10:23:15 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/deployments/gates/evaluation/00000000-0000-0000-0000-000000000000 + response: + body: + encoding: UTF-8 + string: '{"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 + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/deployment_gates/Get-a-deployment-gates-evaluation-result-returns-OK-response.frozen b/cassettes/features/v2/deployment_gates/Get-a-deployment-gates-evaluation-result-returns-OK-response.frozen new file mode 100644 index 000000000000..b929d919bfb7 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Get-a-deployment-gates-evaluation-result-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:15.715Z \ No newline at end of file diff --git a/cassettes/features/v2/deployment_gates/Get-a-deployment-gates-evaluation-result-returns-OK-response.yml b/cassettes/features/v2/deployment_gates/Get-a-deployment-gates-evaluation-result-returns-OK-response.yml new file mode 100644 index 000000000000..fcb2ee1ea385 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Get-a-deployment-gates-evaluation-result-returns-OK-response.yml @@ -0,0 +1,124 @@ +http_interactions: +- recorded_at: Tue, 17 Mar 2026 10:23:15 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testgetadeploymentgatesevaluationresultreturnsokresponse1773742995","service":"my-service"},"type":"deployment_gate"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/deployment_gates + response: + body: + encoding: UTF-8 + string: '{"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 + status: + code: 200 + message: OK +- recorded_at: Tue, 17 Mar 2026 10:23:15 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"dry_run":false,"name":"My deployment rule","options":{"excluded_resources":[]},"type":"faulty_deployment_detection"},"type":"deployment_rule"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/deployment_gates/7b930550-63b0-4002-8b74-4c827bd070d3/rules + response: + body: + encoding: UTF-8 + string: '{"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 + status: + code: 200 + message: OK +- recorded_at: Tue, 17 Mar 2026 10:23:15 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"env":"production","identifier":"my-gate-testgetadeploymentgatesevaluationresultreturnsokresponse1773742995","service":"my-service"},"type":"deployment_gates_evaluation_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/deployments/gates/evaluation + response: + body: + encoding: UTF-8 + string: '{"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 + status: + code: 202 + message: Accepted +- recorded_at: Tue, 17 Mar 2026 10:23:15 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/deployments/gates/evaluation/fb1d7aef-236f-433d-ab3e-11648edb64c0 + response: + body: + encoding: UTF-8 + string: '{"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 + status: + code: 200 + message: OK +- recorded_at: Tue, 17 Mar 2026 10:23:15 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/deployment_gates/7b930550-63b0-4002-8b74-4c827bd070d3/rules/c2058cfd-aa63-4efc-a8fe-a37d622e7cc3 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Tue, 17 Mar 2026 10:23:15 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/deployment_gates/7b930550-63b0-4002-8b74-4c827bd070d3 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/deployment_gates/Get-deployment-gate-returns-Bad-request-invalid-response.frozen b/cassettes/features/v2/deployment_gates/Get-deployment-gate-returns-Bad-request-invalid-response.frozen new file mode 100644 index 000000000000..fd19f0667fcb --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Get-deployment-gate-returns-Bad-request-invalid-response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:16.714Z \ No newline at end of file diff --git a/cassettes/features/v2/deployment_gates/Get-deployment-gate-returns-Bad-request-invalid-response.yml b/cassettes/features/v2/deployment_gates/Get-deployment-gate-returns-Bad-request-invalid-response.yml new file mode 100644 index 000000000000..55017907c3ca --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Get-deployment-gate-returns-Bad-request-invalid-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Tue, 17 Mar 2026 10:23:16 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/deployment_gates/not-a-valid-id + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"id\" Invalid id"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/deployment_gates/Get-deployment-gate-returns-Deployment-gate-not-found-response.frozen b/cassettes/features/v2/deployment_gates/Get-deployment-gate-returns-Deployment-gate-not-found-response.frozen new file mode 100644 index 000000000000..9e48a99314cf --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Get-deployment-gate-returns-Deployment-gate-not-found-response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:16.827Z \ No newline at end of file diff --git a/cassettes/features/v2/deployment_gates/Get-deployment-gate-returns-Deployment-gate-not-found-response.yml b/cassettes/features/v2/deployment_gates/Get-deployment-gate-returns-Deployment-gate-not-found-response.yml new file mode 100644 index 000000000000..e799b0bc50ef --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Get-deployment-gate-returns-Deployment-gate-not-found-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Tue, 17 Mar 2026 10:23:16 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/deployment_gates/00000000-0000-0000-0000-000000000000 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Gate does + not exist"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-Bad-request-invalid-response.frozen b/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-Bad-request-invalid-response.frozen new file mode 100644 index 000000000000..b549853588ca --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-Bad-request-invalid-response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:16.977Z \ No newline at end of file diff --git a/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-Bad-request-invalid-response.yml b/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-Bad-request-invalid-response.yml new file mode 100644 index 000000000000..ac32b8fc63b1 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-Bad-request-invalid-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Tue, 17 Mar 2026 10:23:16 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/deployment_gates/not-a-valid-id/rules/not-a-valid-id + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"gate_id\" Invalid id"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-Deployment-rule-not-found-response.frozen b/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-Deployment-rule-not-found-response.frozen new file mode 100644 index 000000000000..015ddfda3393 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-Deployment-rule-not-found-response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:17.101Z \ No newline at end of file diff --git a/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-Deployment-rule-not-found-response.yml b/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-Deployment-rule-not-found-response.yml new file mode 100644 index 000000000000..ad72d78c5f14 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-Deployment-rule-not-found-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Tue, 17 Mar 2026 10:23:17 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/deployment_gates/00000000-0000-0000-0000-000000000000/rules/00000000-0000-0000-0000-000000000000 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/deployment_gates/Get-rules-for-a-deployment-gate-returns-Bad-request-response.frozen b/cassettes/features/v2/deployment_gates/Get-rules-for-a-deployment-gate-returns-Bad-request-response.frozen new file mode 100644 index 000000000000..bec78d5b82ef --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Get-rules-for-a-deployment-gate-returns-Bad-request-response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:17.224Z \ No newline at end of file diff --git a/cassettes/features/v2/deployment_gates/Get-rules-for-a-deployment-gate-returns-Bad-request-response.yml b/cassettes/features/v2/deployment_gates/Get-rules-for-a-deployment-gate-returns-Bad-request-response.yml new file mode 100644 index 000000000000..3b5c7dc9e3de --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Get-rules-for-a-deployment-gate-returns-Bad-request-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Tue, 17 Mar 2026 10:23:17 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/deployment_gates/not-a-valid-id/rules + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"gate_id\" Invalid id"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/deployment_gates/Trigger-a-deployment-gates-evaluation-returns-Accepted-response.frozen b/cassettes/features/v2/deployment_gates/Trigger-a-deployment-gates-evaluation-returns-Accepted-response.frozen new file mode 100644 index 000000000000..de92181ae35c --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Trigger-a-deployment-gates-evaluation-returns-Accepted-response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:17.356Z \ No newline at end of file diff --git a/cassettes/features/v2/deployment_gates/Trigger-a-deployment-gates-evaluation-returns-Accepted-response.yml b/cassettes/features/v2/deployment_gates/Trigger-a-deployment-gates-evaluation-returns-Accepted-response.yml new file mode 100644 index 000000000000..49d9a847b972 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Trigger-a-deployment-gates-evaluation-returns-Accepted-response.yml @@ -0,0 +1,105 @@ +http_interactions: +- recorded_at: Tue, 17 Mar 2026 10:23:17 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testtriggeradeploymentgatesevaluationreturnsacceptedresponse1773742997","service":"my-service"},"type":"deployment_gate"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/deployment_gates + response: + body: + encoding: UTF-8 + string: '{"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 + status: + code: 200 + message: OK +- recorded_at: Tue, 17 Mar 2026 10:23:17 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"dry_run":false,"name":"My deployment rule","options":{"excluded_resources":[]},"type":"faulty_deployment_detection"},"type":"deployment_rule"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/deployment_gates/9d4fad94-29e3-452d-817d-5bc3f0ddbcb4/rules + response: + body: + encoding: UTF-8 + string: '{"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 + status: + code: 200 + message: OK +- recorded_at: Tue, 17 Mar 2026 10:23:17 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"env":"production","identifier":"my-gate-testtriggeradeploymentgatesevaluationreturnsacceptedresponse1773742997","service":"my-service"},"type":"deployment_gates_evaluation_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/deployments/gates/evaluation + response: + body: + encoding: UTF-8 + string: '{"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 + status: + code: 202 + message: Accepted +- recorded_at: Tue, 17 Mar 2026 10:23:17 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/deployment_gates/9d4fad94-29e3-452d-817d-5bc3f0ddbcb4/rules/891bdcc9-ae8f-4fbc-87ad-5dfb83fc447f + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Tue, 17 Mar 2026 10:23:17 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/deployment_gates/9d4fad94-29e3-452d-817d-5bc3f0ddbcb4 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/deployment_gates/Trigger-a-deployment-gates-evaluation-returns-Bad-request-response.frozen b/cassettes/features/v2/deployment_gates/Trigger-a-deployment-gates-evaluation-returns-Bad-request-response.frozen new file mode 100644 index 000000000000..2966caa090cd --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Trigger-a-deployment-gates-evaluation-returns-Bad-request-response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:18.495Z \ No newline at end of file diff --git a/cassettes/features/v2/deployment_gates/Trigger-a-deployment-gates-evaluation-returns-Bad-request-response.yml b/cassettes/features/v2/deployment_gates/Trigger-a-deployment-gates-evaluation-returns-Bad-request-response.yml new file mode 100644 index 000000000000..5eea7f778311 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Trigger-a-deployment-gates-evaluation-returns-Bad-request-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Tue, 17 Mar 2026 10:23:18 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"env":"staging"},"type":"deployment_gates_evaluation_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/deployments/gates/evaluation + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"required + service field is missing"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/deployment_gates/Trigger-a-deployment-gates-evaluation-returns-Deployment-gate-not-found-response.frozen b/cassettes/features/v2/deployment_gates/Trigger-a-deployment-gates-evaluation-returns-Deployment-gate-not-found-response.frozen new file mode 100644 index 000000000000..273be7a0789d --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Trigger-a-deployment-gates-evaluation-returns-Deployment-gate-not-found-response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:18.627Z \ No newline at end of file diff --git a/cassettes/features/v2/deployment_gates/Trigger-a-deployment-gates-evaluation-returns-Deployment-gate-not-found-response.yml b/cassettes/features/v2/deployment_gates/Trigger-a-deployment-gates-evaluation-returns-Deployment-gate-not-found-response.yml new file mode 100644 index 000000000000..37ebc606162b --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Trigger-a-deployment-gates-evaluation-returns-Deployment-gate-not-found-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Tue, 17 Mar 2026 10:23:18 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"env":"staging","service":"non-existent-service-xyz"},"type":"deployment_gates_evaluation_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/deployments/gates/evaluation + response: + body: + encoding: UTF-8 + string: '{"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 + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/deployment_gates/Update-deployment-gate-returns-Bad-request-invalid-response.frozen b/cassettes/features/v2/deployment_gates/Update-deployment-gate-returns-Bad-request-invalid-response.frozen new file mode 100644 index 000000000000..1b2c93460c4d --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Update-deployment-gate-returns-Bad-request-invalid-response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:18.738Z \ No newline at end of file diff --git a/cassettes/features/v2/deployment_gates/Update-deployment-gate-returns-Bad-request-invalid-response.yml b/cassettes/features/v2/deployment_gates/Update-deployment-gate-returns-Bad-request-invalid-response.yml new file mode 100644 index 000000000000..4c818b37cc4e --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Update-deployment-gate-returns-Bad-request-invalid-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Tue, 17 Mar 2026 10:23:18 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"dry_run":false},"id":"12345678-1234-1234-1234-123456789012","type":"deployment_gate"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/deployment_gates/not-a-valid-id + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"id\" Invalid id"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/deployment_gates/Update-deployment-gate-returns-Deployment-gate-not-found-response.frozen b/cassettes/features/v2/deployment_gates/Update-deployment-gate-returns-Deployment-gate-not-found-response.frozen new file mode 100644 index 000000000000..b5a2443187a8 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Update-deployment-gate-returns-Deployment-gate-not-found-response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:18.854Z \ No newline at end of file diff --git a/cassettes/features/v2/deployment_gates/Update-deployment-gate-returns-Deployment-gate-not-found-response.yml b/cassettes/features/v2/deployment_gates/Update-deployment-gate-returns-Deployment-gate-not-found-response.yml new file mode 100644 index 000000000000..ae51b82f24f0 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Update-deployment-gate-returns-Deployment-gate-not-found-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Tue, 17 Mar 2026 10:23:18 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"dry_run":false},"id":"12345678-1234-1234-1234-123456789012","type":"deployment_gate"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/deployment_gates/00000000-0000-0000-0000-000000000000 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Gate does + not exist"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-Bad-request-invalid-response.frozen b/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-Bad-request-invalid-response.frozen new file mode 100644 index 000000000000..a30a58dadc0d --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-Bad-request-invalid-response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:18.972Z \ No newline at end of file diff --git a/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-Bad-request-invalid-response.yml b/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-Bad-request-invalid-response.yml new file mode 100644 index 000000000000..9c7be3783a13 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-Bad-request-invalid-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Tue, 17 Mar 2026 10:23:18 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"dry_run":false,"name":"Updated deployment rule","options":{"duration":3600,"excluded_resources":["resource1","resource2"]}},"type":"deployment_rule"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/deployment_gates/not-a-valid-id/rules/not-a-valid-id + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"gate_id\" Invalid id"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-Deployment-rule-not-found-response.frozen b/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-Deployment-rule-not-found-response.frozen new file mode 100644 index 000000000000..cd87ba2394c2 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-Deployment-rule-not-found-response.frozen @@ -0,0 +1 @@ +2026-03-17T10:23:19.084Z \ No newline at end of file diff --git a/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-Deployment-rule-not-found-response.yml b/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-Deployment-rule-not-found-response.yml new file mode 100644 index 000000000000..1119304f8884 --- /dev/null +++ b/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-Deployment-rule-not-found-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Tue, 17 Mar 2026 10:23:19 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"dry_run":false,"name":"Updated deployment rule","options":{"duration":3600,"excluded_resources":["resource1","resource2"]}},"type":"deployment_rule"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/deployment_gates/00000000-0000-0000-0000-000000000000/rules/00000000-0000-0000-0000-000000000000 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/examples/v2/deployment-gates/GetDeploymentGatesEvaluationResult.rb b/examples/v2/deployment-gates/GetDeploymentGatesEvaluationResult.rb new file mode 100644 index 000000000000..c88eb0c00b56 --- /dev/null +++ b/examples/v2/deployment-gates/GetDeploymentGatesEvaluationResult.rb @@ -0,0 +1,8 @@ +# Get a deployment gates evaluation result returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::DeploymentGatesAPI.new + +# there is a valid "deployment_gates_evaluation" in the system +DEPLOYMENT_GATES_EVALUATION_DATA_ID = ENV["DEPLOYMENT_GATES_EVALUATION_DATA_ID"] +p api_instance.get_deployment_gates_evaluation_result(DEPLOYMENT_GATES_EVALUATION_DATA_ID) diff --git a/examples/v2/deployment-gates/ListDeploymentGates.rb b/examples/v2/deployment-gates/ListDeploymentGates.rb new file mode 100644 index 000000000000..0a49841793d1 --- /dev/null +++ b/examples/v2/deployment-gates/ListDeploymentGates.rb @@ -0,0 +1,8 @@ +# Get all deployment gates returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_deployment_gates".to_sym] = true +end +api_instance = DatadogAPIClient::V2::DeploymentGatesAPI.new +p api_instance.list_deployment_gates() diff --git a/examples/v2/deployment-gates/TriggerDeploymentGatesEvaluation.rb b/examples/v2/deployment-gates/TriggerDeploymentGatesEvaluation.rb new file mode 100644 index 000000000000..630e3b5248e6 --- /dev/null +++ b/examples/v2/deployment-gates/TriggerDeploymentGatesEvaluation.rb @@ -0,0 +1,19 @@ +# Trigger a deployment gates evaluation returns "Accepted" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::DeploymentGatesAPI.new + +# there is a valid "deployment_gate" in the system +DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER = ENV["DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER"] + +body = DatadogAPIClient::V2::DeploymentGatesEvaluationRequest.new({ + data: DatadogAPIClient::V2::DeploymentGatesEvaluationRequestData.new({ + attributes: DatadogAPIClient::V2::DeploymentGatesEvaluationRequestAttributes.new({ + env: "production", + identifier: DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER, + service: "my-service", + }), + type: DatadogAPIClient::V2::DeploymentGatesEvaluationRequestDataType::DEPLOYMENT_GATES_EVALUATION_REQUEST, + }), +}) +p api_instance.trigger_deployment_gates_evaluation(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 95f3727d7bec..c2b32a146aad 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2028,6 +2028,10 @@ "v2.CancelDataDeletionRequest" => { "id" => "String", }, + "v2.ListDeploymentGates" => { + "page_cursor" => "String", + "page_size" => "Integer", + }, "v2.CreateDeploymentGate" => { "body" => "CreateDeploymentGateParams", }, @@ -2061,6 +2065,12 @@ "id" => "String", "body" => "UpdateDeploymentGateParams", }, + "v2.TriggerDeploymentGatesEvaluation" => { + "body" => "DeploymentGatesEvaluationRequest", + }, + "v2.GetDeploymentGatesEvaluationResult" => { + "id" => "UUID", + }, "v2.PatchDomainAllowlist" => { "body" => "DomainAllowlistRequest", }, diff --git a/features/v2/deployment_gates.feature b/features/v2/deployment_gates.feature index cb0c5a1262d6..aa802041c76b 100644 --- a/features/v2/deployment_gates.feature +++ b/features/v2/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,44 @@ 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 gates evaluation result returns "Bad request." response + Given new "GetDeploymentGatesEvaluationResult" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad request. + + @team:DataDog/ci-app-backend + Scenario: Get a deployment gates evaluation result returns "Deployment gate not found." response + Given 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 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 + + @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 +188,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 +225,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 +245,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 +262,29 @@ Feature: Deployment Gates When the request is sent Then the response status is 200 OK + @team:DataDog/ci-app-backend + Scenario: Trigger a deployment gates evaluation returns "Accepted" response + Given 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 + + @team:DataDog/ci-app-backend + Scenario: Trigger a deployment gates evaluation returns "Bad request." response + Given new "TriggerDeploymentGatesEvaluation" request + And body with value {"data": {"attributes": {"env": "staging"}, "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 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 +303,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 +344,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/features/v2/given.json b/features/v2/given.json index 76980d4ce3dc..6db555790600 100644 --- a/features/v2/given.json +++ b/features/v2/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/features/v2/undo.json b/features/v2/undo.json index a04c9b283b90..8d70cb214cfe 100644 --- a/features/v2/undo.json +++ b/features/v2/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": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 81b467f8be00..8c799a4a6906 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -264,6 +264,7 @@ def initialize "v2.get_deployment_gate": false, "v2.get_deployment_gate_rules": false, "v2.get_deployment_rule": false, + "v2.list_deployment_gates": false, "v2.update_deployment_gate": false, "v2.update_deployment_rule": false, "v2.create_hamr_org_connection": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 53171cd9b40d..e15569d3d0c0 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2193,6 +2193,24 @@ def overrides "v2.deployment_gate_response_data_attributes_created_by" => "DeploymentGateResponseDataAttributesCreatedBy", "v2.deployment_gate_response_data_attributes_updated_by" => "DeploymentGateResponseDataAttributesUpdatedBy", "v2.deployment_gate_rules_response" => "DeploymentGateRulesResponse", + "v2.deployment_gates_evaluation_request" => "DeploymentGatesEvaluationRequest", + "v2.deployment_gates_evaluation_request_attributes" => "DeploymentGatesEvaluationRequestAttributes", + "v2.deployment_gates_evaluation_request_data" => "DeploymentGatesEvaluationRequestData", + "v2.deployment_gates_evaluation_request_data_type" => "DeploymentGatesEvaluationRequestDataType", + "v2.deployment_gates_evaluation_response" => "DeploymentGatesEvaluationResponse", + "v2.deployment_gates_evaluation_response_attributes" => "DeploymentGatesEvaluationResponseAttributes", + "v2.deployment_gates_evaluation_response_data" => "DeploymentGatesEvaluationResponseData", + "v2.deployment_gates_evaluation_response_data_type" => "DeploymentGatesEvaluationResponseDataType", + "v2.deployment_gates_evaluation_result_response" => "DeploymentGatesEvaluationResultResponse", + "v2.deployment_gates_evaluation_result_response_attributes" => "DeploymentGatesEvaluationResultResponseAttributes", + "v2.deployment_gates_evaluation_result_response_attributes_gate_status" => "DeploymentGatesEvaluationResultResponseAttributesGateStatus", + "v2.deployment_gates_evaluation_result_response_data" => "DeploymentGatesEvaluationResultResponseData", + "v2.deployment_gates_evaluation_result_response_data_type" => "DeploymentGatesEvaluationResultResponseDataType", + "v2.deployment_gates_git_metadata" => "DeploymentGatesGitMetadata", + "v2.deployment_gates_list_response" => "DeploymentGatesListResponse", + "v2.deployment_gates_list_response_meta" => "DeploymentGatesListResponseMeta", + "v2.deployment_gates_list_response_meta_page" => "DeploymentGatesListResponseMetaPage", + "v2.deployment_gates_rule_response" => "DeploymentGatesRuleResponse", "v2.deployment_metadata" => "DeploymentMetadata", "v2.deployment_relationship" => "DeploymentRelationship", "v2.deployment_relationship_data" => "DeploymentRelationshipData", diff --git a/lib/datadog_api_client/v2/api/deployment_gates_api.rb b/lib/datadog_api_client/v2/api/deployment_gates_api.rb index e81fc32f44b7..faf87b631b25 100644 --- a/lib/datadog_api_client/v2/api/deployment_gates_api.rb +++ b/lib/datadog_api_client/v2/api/deployment_gates_api.rb @@ -463,6 +463,74 @@ def get_deployment_gate_rules_with_http_info(gate_id, opts = {}) return data, status_code, headers end + # Get a deployment gates evaluation result. + # + # @see #get_deployment_gates_evaluation_result_with_http_info + def get_deployment_gates_evaluation_result(id, opts = {}) + data, _status_code, _headers = get_deployment_gates_evaluation_result_with_http_info(id, opts) + data + end + + # Get a deployment gates evaluation result. + # + # Retrieves the result of a deployment gates 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`. + # The endpoint may return a 404 if called too soon after triggering; retry after a few seconds. + # + # @param id [UUID] The evaluation ID returned by the trigger endpoint. + # @param opts [Hash] the optional parameters + # @return [Array<(DeploymentGatesEvaluationResultResponse, Integer, Hash)>] DeploymentGatesEvaluationResultResponse data, response status code and response headers + def get_deployment_gates_evaluation_result_with_http_info(id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DeploymentGatesAPI.get_deployment_gates_evaluation_result ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling DeploymentGatesAPI.get_deployment_gates_evaluation_result" + end + # resource path + local_var_path = '/api/v2/deployments/gates/evaluation/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'DeploymentGatesEvaluationResultResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_deployment_gates_evaluation_result, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DeploymentGatesAPI#get_deployment_gates_evaluation_result\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get deployment rule. # # @see #get_deployment_rule_with_http_info @@ -539,6 +607,153 @@ def get_deployment_rule_with_http_info(gate_id, id, opts = {}) return data, status_code, headers end + # Get all deployment gates. + # + # @see #list_deployment_gates_with_http_info + def list_deployment_gates(opts = {}) + data, _status_code, _headers = list_deployment_gates_with_http_info(opts) + data + end + + # Get all deployment gates. + # + # Returns a paginated list of all deployment gates for the organization. + # Use `page[cursor]` and `page[size]` query parameters to paginate through results. + # + # @param opts [Hash] the optional parameters + # @option opts [String] :page_cursor Cursor for pagination. Use the `meta.page.next_cursor` value from the previous response. + # @option opts [Integer] :page_size Number of results per page. Defaults to 50. Must be between 1 and 1000. + # @return [Array<(DeploymentGatesListResponse, Integer, Hash)>] DeploymentGatesListResponse data, response status code and response headers + def list_deployment_gates_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_deployment_gates".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_deployment_gates") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_deployment_gates")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DeploymentGatesAPI.list_deployment_gates ...' + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling DeploymentGatesAPI.list_deployment_gates, must be smaller than or equal to 1000.' + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling DeploymentGatesAPI.list_deployment_gates, must be greater than or equal to 1.' + end + # resource path + local_var_path = '/api/v2/deployment_gates' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'DeploymentGatesListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_deployment_gates, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DeploymentGatesAPI#list_deployment_gates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Trigger a deployment gates evaluation. + # + # @see #trigger_deployment_gates_evaluation_with_http_info + def trigger_deployment_gates_evaluation(body, opts = {}) + data, _status_code, _headers = trigger_deployment_gates_evaluation_with_http_info(body, opts) + data + end + + # Trigger a deployment gates evaluation. + # + # Triggers an asynchronous deployment gates 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. + # Polling every 10-20 seconds is recommended. + # + # @param body [DeploymentGatesEvaluationRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(DeploymentGatesEvaluationResponse, Integer, Hash)>] DeploymentGatesEvaluationResponse data, response status code and response headers + def trigger_deployment_gates_evaluation_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DeploymentGatesAPI.trigger_deployment_gates_evaluation ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling DeploymentGatesAPI.trigger_deployment_gates_evaluation" + end + # resource path + local_var_path = '/api/v2/deployments/gates/evaluation' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'DeploymentGatesEvaluationResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :trigger_deployment_gates_evaluation, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DeploymentGatesAPI#trigger_deployment_gates_evaluation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update deployment gate. # # @see #update_deployment_gate_with_http_info diff --git a/lib/datadog_api_client/v2/models/deployment_gates_evaluation_request.rb b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_request.rb new file mode 100644 index 000000000000..364a2d068fb4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request body for triggering a deployment gates evaluation. + class DeploymentGatesEvaluationRequest + include BaseGenericModel + + # Data for a deployment gates evaluation request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'DeploymentGatesEvaluationRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DeploymentGatesEvaluationRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/deployment_gates_evaluation_request_attributes.rb b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_request_attributes.rb new file mode 100644 index 000000000000..ba189c7c223f --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_request_attributes.rb @@ -0,0 +1,183 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for a deployment gates evaluation request. + class DeploymentGatesEvaluationRequestAttributes + include BaseGenericModel + + # The environment of the deployment. + attr_reader :env + + # Git metadata for a deployment gates evaluation. + attr_accessor :git_metadata + + # The identifier of the deployment gate. Defaults to "default". + attr_accessor :identifier + + # A query variable to scope monitor rules to a specific deployment. + attr_accessor :monitors_query_variable + + # A primary tag to scope APM Faulty Deployment Detection rules. + attr_accessor :primary_tag + + # The service being deployed. + attr_accessor :service + + # The version of the deployment. Required for APM Faulty Deployment Detection rules. + attr_accessor :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'env' => :'env', + :'git_metadata' => :'git_metadata', + :'identifier' => :'identifier', + :'monitors_query_variable' => :'monitors_query_variable', + :'primary_tag' => :'primary_tag', + :'service' => :'service', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'env' => :'String', + :'git_metadata' => :'DeploymentGatesGitMetadata', + :'identifier' => :'String', + :'monitors_query_variable' => :'String', + :'primary_tag' => :'String', + :'service' => :'String', + :'version' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DeploymentGatesEvaluationRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'env') + self.env = attributes[:'env'] + end + + if attributes.key?(:'git_metadata') + self.git_metadata = attributes[:'git_metadata'] + end + + if attributes.key?(:'identifier') + self.identifier = attributes[:'identifier'] + end + + if attributes.key?(:'monitors_query_variable') + self.monitors_query_variable = attributes[:'monitors_query_variable'] + end + + if attributes.key?(:'primary_tag') + self.primary_tag = attributes[:'primary_tag'] + end + + if attributes.key?(:'service') + self.service = attributes[:'service'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @env.nil? + true + end + + # Custom attribute writer method with validation + # @param env [Object] Object to be assigned + # @!visibility private + def env=(env) + if env.nil? + fail ArgumentError, 'invalid value for "env", env cannot be nil.' + end + @env = env + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + env == o.env && + git_metadata == o.git_metadata && + identifier == o.identifier && + monitors_query_variable == o.monitors_query_variable && + primary_tag == o.primary_tag && + service == o.service && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [env, git_metadata, identifier, monitors_query_variable, primary_tag, service, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/deployment_gates_evaluation_request_data.rb b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_request_data.rb new file mode 100644 index 000000000000..f09b34b51372 --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for a deployment gates evaluation request. + class DeploymentGatesEvaluationRequestData + include BaseGenericModel + + # Attributes for a deployment gates evaluation request. + attr_reader :attributes + + # JSON:API type for a deployment gates evaluation request. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'DeploymentGatesEvaluationRequestAttributes', + :'type' => :'DeploymentGatesEvaluationRequestDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DeploymentGatesEvaluationRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/deployment_gates_evaluation_request_data_type.rb b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_request_data_type.rb new file mode 100644 index 000000000000..64257ff9ac03 --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_request_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # JSON:API type for a deployment gates evaluation request. + class DeploymentGatesEvaluationRequestDataType + include BaseEnumModel + + DEPLOYMENT_GATES_EVALUATION_REQUEST = "deployment_gates_evaluation_request".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/deployment_gates_evaluation_response.rb b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_response.rb new file mode 100644 index 000000000000..12b531fd51be --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response for a deployment gates evaluation request. + class DeploymentGatesEvaluationResponse + include BaseGenericModel + + # Data for a deployment gates evaluation response. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'DeploymentGatesEvaluationResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DeploymentGatesEvaluationResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/deployment_gates_evaluation_response_attributes.rb b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_response_attributes.rb new file mode 100644 index 000000000000..dcec17032a62 --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_response_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for a deployment gates evaluation response. + class DeploymentGatesEvaluationResponseAttributes + include BaseGenericModel + + # The unique identifier of the gate evaluation. + attr_reader :evaluation_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'evaluation_id' => :'evaluation_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'evaluation_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DeploymentGatesEvaluationResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'evaluation_id') + self.evaluation_id = attributes[:'evaluation_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @evaluation_id.nil? + true + end + + # Custom attribute writer method with validation + # @param evaluation_id [Object] Object to be assigned + # @!visibility private + def evaluation_id=(evaluation_id) + if evaluation_id.nil? + fail ArgumentError, 'invalid value for "evaluation_id", evaluation_id cannot be nil.' + end + @evaluation_id = evaluation_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + evaluation_id == o.evaluation_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [evaluation_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/deployment_gates_evaluation_response_data.rb b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_response_data.rb new file mode 100644 index 000000000000..970bbd48614c --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for a deployment gates evaluation response. + class DeploymentGatesEvaluationResponseData + include BaseGenericModel + + # Attributes for a deployment gates evaluation response. + attr_reader :attributes + + # The unique identifier of the evaluation response. + attr_reader :id + + # JSON:API type for a deployment gates evaluation response. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'DeploymentGatesEvaluationResponseAttributes', + :'id' => :'UUID', + :'type' => :'DeploymentGatesEvaluationResponseDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DeploymentGatesEvaluationResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/deployment_gates_evaluation_response_data_type.rb b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_response_data_type.rb new file mode 100644 index 000000000000..5b8e75f3b5b1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_response_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # JSON:API type for a deployment gates evaluation response. + class DeploymentGatesEvaluationResponseDataType + include BaseEnumModel + + DEPLOYMENT_GATES_EVALUATION_RESPONSE = "deployment_gates_evaluation_response".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/deployment_gates_evaluation_result_response.rb b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_result_response.rb new file mode 100644 index 000000000000..d55eefae9458 --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_result_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing the result of a deployment gates evaluation. + class DeploymentGatesEvaluationResultResponse + include BaseGenericModel + + # Data for a deployment gates evaluation result response. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'DeploymentGatesEvaluationResultResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DeploymentGatesEvaluationResultResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/deployment_gates_evaluation_result_response_attributes.rb b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_result_response_attributes.rb new file mode 100644 index 000000000000..eea0ae0ce2a3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_result_response_attributes.rb @@ -0,0 +1,197 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for a deployment gates evaluation result response. + class DeploymentGatesEvaluationResultResponseAttributes + include BaseGenericModel + + # Whether the gate was evaluated in dry-run mode. + attr_reader :dry_run + + # The unique identifier of the gate evaluation. + attr_reader :evaluation_id + + # A URL to view the evaluation details in the Datadog UI. + attr_accessor :evaluation_url + + # The unique identifier of the deployment gate. + attr_accessor :gate_id + + # The overall status of the gate evaluation. A status of `in_progress` means the evaluation is still running. + attr_reader :gate_status + + # The results of individual rule evaluations. + attr_accessor :rules + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'dry_run' => :'dry_run', + :'evaluation_id' => :'evaluation_id', + :'evaluation_url' => :'evaluation_url', + :'gate_id' => :'gate_id', + :'gate_status' => :'gate_status', + :'rules' => :'rules' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'dry_run' => :'Boolean', + :'evaluation_id' => :'String', + :'evaluation_url' => :'String', + :'gate_id' => :'UUID', + :'gate_status' => :'DeploymentGatesEvaluationResultResponseAttributesGateStatus', + :'rules' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DeploymentGatesEvaluationResultResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'dry_run') + self.dry_run = attributes[:'dry_run'] + end + + if attributes.key?(:'evaluation_id') + self.evaluation_id = attributes[:'evaluation_id'] + end + + if attributes.key?(:'evaluation_url') + self.evaluation_url = attributes[:'evaluation_url'] + end + + if attributes.key?(:'gate_id') + self.gate_id = attributes[:'gate_id'] + end + + if attributes.key?(:'gate_status') + self.gate_status = attributes[:'gate_status'] + end + + if attributes.key?(:'rules') + if (value = attributes[:'rules']).is_a?(Array) + self.rules = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @dry_run.nil? + return false if @evaluation_id.nil? + return false if @gate_status.nil? + true + end + + # Custom attribute writer method with validation + # @param dry_run [Object] Object to be assigned + # @!visibility private + def dry_run=(dry_run) + if dry_run.nil? + fail ArgumentError, 'invalid value for "dry_run", dry_run cannot be nil.' + end + @dry_run = dry_run + end + + # Custom attribute writer method with validation + # @param evaluation_id [Object] Object to be assigned + # @!visibility private + def evaluation_id=(evaluation_id) + if evaluation_id.nil? + fail ArgumentError, 'invalid value for "evaluation_id", evaluation_id cannot be nil.' + end + @evaluation_id = evaluation_id + end + + # Custom attribute writer method with validation + # @param gate_status [Object] Object to be assigned + # @!visibility private + def gate_status=(gate_status) + if gate_status.nil? + fail ArgumentError, 'invalid value for "gate_status", gate_status cannot be nil.' + end + @gate_status = gate_status + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + dry_run == o.dry_run && + evaluation_id == o.evaluation_id && + evaluation_url == o.evaluation_url && + gate_id == o.gate_id && + gate_status == o.gate_status && + rules == o.rules && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [dry_run, evaluation_id, evaluation_url, gate_id, gate_status, rules, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/deployment_gates_evaluation_result_response_attributes_gate_status.rb b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_result_response_attributes_gate_status.rb new file mode 100644 index 000000000000..673349529e2f --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_result_response_attributes_gate_status.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The overall status of the gate evaluation. A status of `in_progress` means the evaluation is still running. + class DeploymentGatesEvaluationResultResponseAttributesGateStatus + include BaseEnumModel + + IN_PROGRESS = "in_progress".freeze + PASS = "pass".freeze + FAIL = "fail".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/deployment_gates_evaluation_result_response_data.rb b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_result_response_data.rb new file mode 100644 index 000000000000..a53a1d222a52 --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_result_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for a deployment gates evaluation result response. + class DeploymentGatesEvaluationResultResponseData + include BaseGenericModel + + # Attributes for a deployment gates evaluation result response. + attr_reader :attributes + + # The unique identifier of the evaluation. + attr_reader :id + + # JSON:API type for a deployment gates evaluation result response. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'DeploymentGatesEvaluationResultResponseAttributes', + :'id' => :'String', + :'type' => :'DeploymentGatesEvaluationResultResponseDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DeploymentGatesEvaluationResultResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/deployment_gates_evaluation_result_response_data_type.rb b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_result_response_data_type.rb new file mode 100644 index 000000000000..e5bbfb8b1be7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_evaluation_result_response_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # JSON:API type for a deployment gates evaluation result response. + class DeploymentGatesEvaluationResultResponseDataType + include BaseEnumModel + + DEPLOYMENT_GATES_EVALUATION_RESULT_RESPONSE = "deployment_gates_evaluation_result_response".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/deployment_gates_git_metadata.rb b/lib/datadog_api_client/v2/models/deployment_gates_git_metadata.rb new file mode 100644 index 000000000000..e93388f3b151 --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_git_metadata.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Git metadata for a deployment gates evaluation. + class DeploymentGatesGitMetadata + include BaseGenericModel + + # The commit SHA of the deployment. + attr_accessor :commit_sha + + # The URL of the repository. + attr_accessor :repository_url + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'commit_sha' => :'commit_sha', + :'repository_url' => :'repository_url' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'commit_sha' => :'String', + :'repository_url' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DeploymentGatesGitMetadata` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'commit_sha') + self.commit_sha = attributes[:'commit_sha'] + end + + if attributes.key?(:'repository_url') + self.repository_url = attributes[:'repository_url'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + commit_sha == o.commit_sha && + repository_url == o.repository_url && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [commit_sha, repository_url, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/deployment_gates_list_response.rb b/lib/datadog_api_client/v2/models/deployment_gates_list_response.rb new file mode 100644 index 000000000000..90baee6fc753 --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_list_response.rb @@ -0,0 +1,117 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a paginated list of deployment gates. + class DeploymentGatesListResponse + include BaseGenericModel + + # Array of deployment gates. + attr_accessor :data + + # Metadata for a list of deployment gates response. + attr_accessor :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'DeploymentGatesListResponseMeta' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DeploymentGatesListResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/deployment_gates_list_response_meta.rb b/lib/datadog_api_client/v2/models/deployment_gates_list_response_meta.rb new file mode 100644 index 000000000000..f79f184243b1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_list_response_meta.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Metadata for a list of deployment gates response. + class DeploymentGatesListResponseMeta + include BaseGenericModel + + # Pagination information for a list of deployment gates. + attr_accessor :page + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'page' => :'page' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'page' => :'DeploymentGatesListResponseMetaPage' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DeploymentGatesListResponseMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'page') + self.page = attributes[:'page'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + page == o.page && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [page, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/deployment_gates_list_response_meta_page.rb b/lib/datadog_api_client/v2/models/deployment_gates_list_response_meta_page.rb new file mode 100644 index 000000000000..5f9e66555b25 --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_list_response_meta_page.rb @@ -0,0 +1,147 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Pagination information for a list of deployment gates. + class DeploymentGatesListResponseMetaPage + include BaseGenericModel + + # The cursor used for the current page. + attr_accessor :cursor + + # The cursor to use to fetch the next page. This is absent when there are no more pages. + attr_accessor :next_cursor + + # The number of results per page. + attr_reader :size + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'cursor' => :'cursor', + :'next_cursor' => :'next_cursor', + :'size' => :'size' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'cursor' => :'String', + :'next_cursor' => :'String', + :'size' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DeploymentGatesListResponseMetaPage` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'cursor') + self.cursor = attributes[:'cursor'] + end + + if attributes.key?(:'next_cursor') + self.next_cursor = attributes[:'next_cursor'] + end + + if attributes.key?(:'size') + self.size = attributes[:'size'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@size.nil? && @size > 1000 + return false if !@size.nil? && @size < 1 + true + end + + # Custom attribute writer method with validation + # @param size [Object] Object to be assigned + # @!visibility private + def size=(size) + if !size.nil? && size > 1000 + fail ArgumentError, 'invalid value for "size", must be smaller than or equal to 1000.' + end + if !size.nil? && size < 1 + fail ArgumentError, 'invalid value for "size", must be greater than or equal to 1.' + end + @size = size + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + cursor == o.cursor && + next_cursor == o.next_cursor && + size == o.size && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [cursor, next_cursor, size, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/deployment_gates_rule_response.rb b/lib/datadog_api_client/v2/models/deployment_gates_rule_response.rb new file mode 100644 index 000000000000..6ae9687ca6e8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/deployment_gates_rule_response.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The result of a single rule evaluation. + class DeploymentGatesRuleResponse + include BaseGenericModel + + # Whether this rule was evaluated in dry-run mode. + attr_accessor :dry_run + + # The name of the rule. + attr_accessor :name + + # The reason for the rule result, if applicable. + attr_accessor :reason + + # The status of the rule evaluation. + attr_accessor :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'dry_run' => :'dry_run', + :'name' => :'name', + :'reason' => :'reason', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'dry_run' => :'Boolean', + :'name' => :'String', + :'reason' => :'String', + :'status' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DeploymentGatesRuleResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'dry_run') + self.dry_run = attributes[:'dry_run'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'reason') + self.reason = attributes[:'reason'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + dry_run == o.dry_run && + name == o.name && + reason == o.reason && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [dry_run, name, reason, status, additional_properties].hash + end + end +end