diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 1907f9ce4060..3340fb18c177 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1158,6 +1158,24 @@ components: schema: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden + HTTPCDGatesBadRequestResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPCDGatesBadRequestResponse' + description: Bad request. + HTTPCDGatesNotFoundResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPCDGatesNotFoundResponse' + description: Deployment gate not found. + HTTPCDRulesNotFoundResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPCDRulesNotFoundResponse' + description: Deployment rule not found. NotAuthorizedResponse: content: application/json: @@ -12733,6 +12751,91 @@ components: meta: $ref: '#/components/schemas/DataDeletionResponseMeta' type: object + CreateDeploymentGateParams: + description: Parameters for creating a deployment gate. + properties: + data: + $ref: '#/components/schemas/CreateDeploymentGateParamsData' + required: + - data + type: object + CreateDeploymentGateParamsData: + description: Parameters for creating a deployment gate. + properties: + attributes: + $ref: '#/components/schemas/CreateDeploymentGateParamsDataAttributes' + type: + $ref: '#/components/schemas/DeploymentGateDataType' + required: + - type + - attributes + type: object + CreateDeploymentGateParamsDataAttributes: + description: Parameters for creating a deployment gate. + properties: + dry_run: + default: false + description: Whether this gate is run in dry-run mode. + example: false + type: boolean + env: + description: The environment of the deployment gate. + example: production + type: string + identifier: + default: default + description: The identifier of the deployment gate. + example: pre + type: string + service: + description: The service of the deployment gate. + example: my-service + type: string + required: + - env + - service + type: object + CreateDeploymentRuleParams: + description: Parameters for creating a deployment rule. + properties: + data: + $ref: '#/components/schemas/CreateDeploymentRuleParamsData' + type: object + CreateDeploymentRuleParamsData: + description: Parameters for creating a deployment rule. + properties: + attributes: + $ref: '#/components/schemas/CreateDeploymentRuleParamsDataAttributes' + type: + $ref: '#/components/schemas/DeploymentRuleDataType' + required: + - type + - attributes + type: object + CreateDeploymentRuleParamsDataAttributes: + description: Parameters for creating a deployment rule. + properties: + dry_run: + default: false + description: Whether this rule is run in dry-run mode. + example: false + type: boolean + name: + description: The name of the deployment rule. + example: My deployment rule + type: string + options: + $ref: '#/components/schemas/DeploymentRulesOptions' + type: + description: The type of the deployment rule (faulty_deployment_detection + or monitor). + example: faulty_deployment_detection + type: string + required: + - name + - options + - type + type: object CreateIncidentNotificationRuleRequest: description: Create request for a notification rule. properties: @@ -16434,6 +16537,113 @@ components: format: uuid type: string type: object + DeploymentGateDataType: + description: Deployment gate resource type. + enum: + - deployment_gate + example: deployment_gate + type: string + x-enum-varnames: + - DEPLOYMENT_GATE + DeploymentGateResponse: + description: Response for a deployment gate. + properties: + data: + $ref: '#/components/schemas/DeploymentGateResponseData' + type: object + DeploymentGateResponseData: + description: Data for a deployment gate. + properties: + attributes: + $ref: '#/components/schemas/DeploymentGateResponseDataAttributes' + id: + description: Unique identifier of the deployment gate. + example: 1111-2222-3333-4444-555566667777 + type: string + type: + $ref: '#/components/schemas/DeploymentGateDataType' + required: + - type + - attributes + - id + type: object + DeploymentGateResponseDataAttributes: + description: Basic information about a deployment gate. + properties: + created_at: + description: The timestamp when the deployment gate was created. + example: '2021-01-01T00:00:00Z' + format: date-time + type: string + created_by: + $ref: '#/components/schemas/DeploymentGateResponseDataAttributesCreatedBy' + dry_run: + description: Whether this gate is run in dry-run mode. + example: false + type: boolean + env: + description: The environment of the deployment gate. + example: production + type: string + identifier: + description: The identifier of the deployment gate. + example: pre + type: string + service: + description: The service of the deployment gate. + example: my-service + type: string + updated_at: + description: The timestamp when the deployment gate was last updated. + example: '2021-01-01T00:00:00Z' + format: date-time + type: string + updated_by: + $ref: '#/components/schemas/DeploymentGateResponseDataAttributesUpdatedBy' + required: + - created_at + - created_by + - dry_run + - env + - identifier + - service + type: object + DeploymentGateResponseDataAttributesCreatedBy: + description: Information about the user who created the deployment gate. + properties: + handle: + description: The handle of the user who created the deployment rule. + example: test-user + type: string + id: + description: The ID of the user who created the deployment rule. + example: 1111-2222-3333-4444-555566667777 + type: string + name: + description: The name of the user who created the deployment rule. + example: Test User + type: string + required: + - id + type: object + DeploymentGateResponseDataAttributesUpdatedBy: + description: Information about the user who updated the deployment gate. + properties: + handle: + description: The handle of the user who updated the deployment rule. + example: test-user + type: string + id: + description: The ID of the user who updated the deployment rule. + example: 1111-2222-3333-4444-555566667777 + type: string + name: + description: The name of the user who updated the deployment rule. + example: Test User + type: string + required: + - id + type: object DeploymentMetadata: description: Metadata object containing the publication creation information. properties: @@ -16473,6 +16683,164 @@ components: type: $ref: '#/components/schemas/AppDeploymentType' type: object + DeploymentRuleDataType: + description: Deployment rule resource type. + enum: + - deployment_rule + example: deployment_rule + type: string + x-enum-varnames: + - DEPLOYMENT_RULE + DeploymentRuleOptionsFaultyDeploymentDetection: + additionalProperties: false + description: Faulty deployment detection options for deployment rules. + properties: + duration: + description: The duration for faulty deployment detection. + example: 3600 + format: int64 + type: integer + excluded_resources: + description: Resources to exclude from faulty deployment detection. + example: + - resource1 + - resource2 + items: + type: string + type: array + type: object + DeploymentRuleOptionsMonitor: + additionalProperties: false + description: Monitor options for deployment rules. + properties: + duration: + description: Seconds the monitor needs to stay in OK status for the rule + to pass. + example: 3600 + format: int64 + type: integer + query: + description: Monitors that match this query are evaluated. + example: service:my-service env:prod + type: string + required: + - query + type: object + DeploymentRuleResponse: + description: Response for a deployment rule. + properties: + data: + $ref: '#/components/schemas/DeploymentRuleResponseData' + type: object + DeploymentRuleResponseData: + description: Data for a deployment rule. + properties: + attributes: + $ref: '#/components/schemas/DeploymentRuleResponseDataAttributes' + id: + description: Unique identifier of the deployment rule. + example: 1111-2222-3333-4444-555566667777 + type: string + type: + $ref: '#/components/schemas/DeploymentRuleDataType' + required: + - type + - attributes + - id + type: object + DeploymentRuleResponseDataAttributes: + description: Basic information about a deployment rule. + properties: + created_at: + description: The timestamp when the deployment rule was created. + example: '2021-01-01T00:00:00Z' + format: date-time + type: string + created_by: + $ref: '#/components/schemas/DeploymentRuleResponseDataAttributesCreatedBy' + dry_run: + description: Whether this rule is run in dry-run mode. + example: false + type: boolean + gate_id: + description: The ID of the deployment gate. + example: 1111-2222-3333-4444-555566667777 + type: string + name: + description: The name of the deployment rule. + example: My deployment rule + type: string + options: + $ref: '#/components/schemas/DeploymentRulesOptions' + type: + $ref: '#/components/schemas/DeploymentRuleResponseDataAttributesType' + updated_at: + description: The timestamp when the deployment rule was last updated. + format: date-time + type: string + updated_by: + $ref: '#/components/schemas/DeploymentRuleResponseDataAttributesUpdatedBy' + required: + - created_at + - created_by + - dry_run + - gate_id + - name + - options + - type + type: object + DeploymentRuleResponseDataAttributesCreatedBy: + description: Information about the user who created the deployment rule. + properties: + handle: + description: The handle of the user who created the deployment rule. + example: test-user + type: string + id: + description: The ID of the user who created the deployment rule. + example: 1111-2222-3333-4444-555566667777 + type: string + name: + description: The name of the user who created the deployment rule. + example: Test User + type: string + required: + - id + type: object + DeploymentRuleResponseDataAttributesType: + description: The type of the deployment rule. + enum: + - faulty_deployment_detection + - monitor + example: faulty_deployment_detection + type: string + x-enum-varnames: + - FAULTY_DEPLOYMENT_DETECTION + - MONITOR + DeploymentRuleResponseDataAttributesUpdatedBy: + description: Information about the user who updated the deployment rule. + properties: + handle: + description: The handle of the user who updated the deployment rule. + example: test-user + type: string + id: + description: The ID of the user who updated the deployment rule. + example: 1111-2222-3333-4444-555566667777 + type: string + name: + description: The name of the user who updated the deployment rule. + example: Test User + type: string + required: + - id + type: object + DeploymentRulesOptions: + description: Options for deployment rule response representing either faulty + deployment detection or monitor options. + oneOf: + - $ref: '#/components/schemas/DeploymentRuleOptionsFaultyDeploymentDetection' + - $ref: '#/components/schemas/DeploymentRuleOptionsMonitor' DetailedFinding: description: A single finding with with message and resource configuration. properties: @@ -23420,6 +23788,33 @@ components: example: application/json type: string type: object + HTTPCDGatesBadRequestResponse: + description: Bad request. + properties: + errors: + description: Structured errors. + items: + $ref: '#/components/schemas/HTTPCIAppError' + type: array + type: object + HTTPCDGatesNotFoundResponse: + description: Deployment gate not found. + properties: + errors: + description: Structured errors. + items: + $ref: '#/components/schemas/HTTPCIAppError' + type: array + type: object + HTTPCDRulesNotFoundResponse: + description: Deployment rule not found. + properties: + errors: + description: Structured errors. + items: + $ref: '#/components/schemas/HTTPCIAppError' + type: array + type: object HTTPCIAppError: description: List of errors. properties: @@ -53596,6 +53991,77 @@ components: required: - data type: object + UpdateDeploymentGateParams: + description: Parameters for updating a deployment gate. + properties: + data: + $ref: '#/components/schemas/UpdateDeploymentGateParamsData' + required: + - data + type: object + UpdateDeploymentGateParamsData: + description: Parameters for updating a deployment gate. + properties: + attributes: + $ref: '#/components/schemas/UpdateDeploymentGateParamsDataAttributes' + id: + description: Unique identifier of the deployment gate. + example: 12345678-1234-1234-1234-123456789012 + type: string + type: + $ref: '#/components/schemas/DeploymentGateDataType' + required: + - type + - id + - attributes + type: object + UpdateDeploymentGateParamsDataAttributes: + description: Attributes for updating a deployment gate. + properties: + dry_run: + description: Whether to run in dry-run mode. + example: false + type: boolean + required: + - dry_run + type: object + UpdateDeploymentRuleParams: + description: Parameters for updating a deployment rule. + properties: + data: + $ref: '#/components/schemas/UpdateDeploymentRuleParamsData' + required: + - data + type: object + UpdateDeploymentRuleParamsData: + description: Parameters for updating a deployment rule. + properties: + attributes: + $ref: '#/components/schemas/UpdateDeploymentRuleParamsDataAttributes' + type: + $ref: '#/components/schemas/DeploymentRuleDataType' + required: + - type + - attributes + type: object + UpdateDeploymentRuleParamsDataAttributes: + description: Parameters for updating a deployment rule. + properties: + dry_run: + description: Whether to run this rule in dry-run mode. + example: false + type: boolean + name: + description: The name of the deployment rule. + example: Updated deployment rule + type: string + options: + $ref: '#/components/schemas/DeploymentRulesOptions' + required: + - dry_run + - name + - options + type: object UpdateOpenAPIResponse: description: Response for `UpdateOpenAPI`. properties: @@ -63852,6 +64318,403 @@ paths: x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/deployment_gates: + post: + description: Endpoint to create a deployment gate. + operationId: CreateDeploymentGate + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateDeploymentGateParams' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeploymentGateResponse' + 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: Create deployment gate + tags: + - Deployment Gates + x-permission: + operator: OR + permissions: + - deployment_gates_write + 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/deployment_gates/{gate_id}/rules: + post: + description: Endpoint to create a deployment rule. A gate for the rule must + already exist. + operationId: CreateDeploymentRule + parameters: + - description: The ID of the deployment gate. + in: path + name: gate_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateDeploymentRuleParams' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeploymentRuleResponse' + 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: Create deployment rule + tags: + - Deployment Gates + x-permission: + operator: OR + permissions: + - deployment_gates_write + 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/deployment_gates/{gate_id}/rules/{id}: + delete: + description: Endpoint to delete a deployment rule. + operationId: DeleteDeploymentRule + parameters: + - description: The ID of the deployment gate. + in: path + name: gate_id + required: true + schema: + type: string + - description: The ID of the deployment rule. + in: path + name: id + required: true + schema: + type: string + responses: + '204': + description: No Content + '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: Delete deployment rule + tags: + - Deployment Gates + x-permission: + operator: OR + permissions: + - deployment_gates_write + 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/).' + get: + description: Endpoint to get a deployment rule. + operationId: GetDeploymentRule + parameters: + - description: The ID of the deployment gate. + in: path + name: gate_id + required: true + schema: + type: string + - description: The ID of the deployment rule. + in: path + name: id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeploymentRuleResponse' + description: OK + '400': + $ref: '#/components/responses/HTTPCDGatesBadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/HTTPCDRulesNotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPCIAppErrors' + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get deployment rule + 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/).' + put: + description: Endpoint to update a deployment rule. + operationId: UpdateDeploymentRule + parameters: + - description: The ID of the deployment gate. + in: path + name: gate_id + required: true + schema: + type: string + - description: The ID of the deployment rule. + in: path + name: id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateDeploymentRuleParams' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeploymentRuleResponse' + description: OK + '400': + $ref: '#/components/responses/HTTPCDGatesBadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/HTTPCDRulesNotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPCIAppErrors' + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update deployment rule + tags: + - Deployment Gates + x-permission: + operator: OR + permissions: + - deployment_gates_write + 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/deployment_gates/{id}: + delete: + description: Endpoint to delete a deployment gate. Rules associated with the + gate are also deleted. + operationId: DeleteDeploymentGate + parameters: + - description: The ID of the deployment gate. + in: path + name: id + required: true + schema: + type: string + responses: + '204': + description: No Content + '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: Delete deployment gate + tags: + - Deployment Gates + x-permission: + operator: OR + permissions: + - deployment_gates_write + 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/).' + get: + description: Endpoint to get a deployment gate. + operationId: GetDeploymentGate + parameters: + - description: The ID of the deployment gate. + in: path + name: id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeploymentGateResponse' + 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 deployment gate + 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/).' + put: + description: Endpoint to update a deployment gate. + operationId: UpdateDeploymentGate + parameters: + - description: The ID of the deployment gate. + in: path + name: id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateDeploymentGateParams' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeploymentGateResponse' + 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: Update deployment gate + tags: + - Deployment Gates + x-permission: + operator: OR + permissions: + - deployment_gates_write + x-unstable: '**Note**: This endpoint is in preview and may be subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/domain_allowlist: get: description: Get the domain allowlist for an organization. @@ -82419,8 +83282,7 @@ paths: operator: OR permissions: - test_optimization_read - x-unstable: '**Note**: This endpoint is in public beta and may be subject to - change. + 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/usage/application_security: @@ -84154,6 +85016,10 @@ tags: view certain types of telemetry (for example, logs, traces, metrics, and RUM data).' name: Datasets +- description: Manage Deployment Gates using this API to reduce the likelihood and + impact of incidents caused by deployments. See the [Deployment Gates documentation](https://docs.datadoghq.com/deployment_gates/) + for more information. + name: Deployment Gates - description: 'Configure your Datadog Email Domain Allowlist directly through the Datadog API. diff --git a/cassettes/v2/Deployment-Gates_4242274226/Create-deployment-gate-returns-Bad-Request-response_2727087309/frozen.json b/cassettes/v2/Deployment-Gates_4242274226/Create-deployment-gate-returns-Bad-Request-response_2727087309/frozen.json new file mode 100644 index 000000000000..8f43d2ecbca0 --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Create-deployment-gate-returns-Bad-Request-response_2727087309/frozen.json @@ -0,0 +1 @@ +"2025-10-28T14:03:25.410Z" diff --git a/cassettes/v2/Deployment-Gates_4242274226/Create-deployment-gate-returns-Bad-Request-response_2727087309/recording.har b/cassettes/v2/Deployment-Gates_4242274226/Create-deployment-gate-returns-Bad-Request-response_2727087309/recording.har new file mode 100644 index 000000000000..9123e8cddb45 --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Create-deployment-gate-returns-Bad-Request-response_2727087309/recording.har @@ -0,0 +1,67 @@ +{ + "log": { + "_recordingName": "Deployment Gates/Create deployment gate returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "6d773a528027f1e46c219fb0abee8579", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 107, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 571, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"env\":\"\",\"identifier\":\"my-gate\",\"service\":\"test-service\"},\"type\":\"deployment_gate\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates" + }, + "response": { + "bodySize": 92, + "content": { + "mimeType": "application/vnd.api+json", + "size": 92, + "text": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"env\\\" is required\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 682, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-10-28T14:03:25.648Z", + "time": 444 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Deployment-Gates_4242274226/Create-deployment-gate-returns-OK-response_4140973969/frozen.json b/cassettes/v2/Deployment-Gates_4242274226/Create-deployment-gate-returns-OK-response_4140973969/frozen.json new file mode 100644 index 000000000000..49f606e746d3 --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Create-deployment-gate-returns-OK-response_4140973969/frozen.json @@ -0,0 +1 @@ +"2025-10-28T14:03:26.103Z" diff --git a/cassettes/v2/Deployment-Gates_4242274226/Create-deployment-gate-returns-OK-response_4140973969/recording.har b/cassettes/v2/Deployment-Gates_4242274226/Create-deployment-gate-returns-OK-response_4140973969/recording.har new file mode 100644 index 000000000000..dcf215866774 --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Create-deployment-gate-returns-OK-response_4140973969/recording.har @@ -0,0 +1,104 @@ +{ + "log": { + "_recordingName": "Deployment Gates/Create deployment gate returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "e8fb7fa60b102413da27b9f59ff3d533", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 133, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 571, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-1\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates" + }, + "response": { + "bodySize": 517, + "content": { + "mimeType": "application/vnd.api+json", + "size": 517, + "text": "{\"data\":{\"id\":\"0cc075c2-fec1-4ed3-9e43-0882646fac07\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-10-28T14:03:26.337009Z\",\"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-1\",\"service\":\"my-service\",\"updated_at\":\"2025-10-28T14:03:26.337009Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 683, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-10-28T14:03:26.125Z", + "time": 284 + }, + { + "_id": "e3bbf4cef8434084dcf97fce973633d8", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 544, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/0cc075c2-fec1-4ed3-9e43-0882646fac07" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 623, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-10-28T14:03:26.415Z", + "time": 297 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Deployment-Gates_4242274226/Create-deployment-rule-returns-Bad-Request-response_2824092514/frozen.json b/cassettes/v2/Deployment-Gates_4242274226/Create-deployment-rule-returns-Bad-Request-response_2824092514/frozen.json new file mode 100644 index 000000000000..1d0cadcdf471 --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Create-deployment-rule-returns-Bad-Request-response_2824092514/frozen.json @@ -0,0 +1 @@ +"2025-10-28T14:51:12.459Z" diff --git a/cassettes/v2/Deployment-Gates_4242274226/Create-deployment-rule-returns-Bad-Request-response_2824092514/recording.har b/cassettes/v2/Deployment-Gates_4242274226/Create-deployment-rule-returns-Bad-Request-response_2824092514/recording.har new file mode 100644 index 000000000000..153fc0694114 --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Create-deployment-rule-returns-Bad-Request-response_2824092514/recording.har @@ -0,0 +1,157 @@ +{ + "log": { + "_recordingName": "Deployment Gates/Create deployment rule returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "70acb264a190c9504530585b68c408be", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 131, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 570, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates" + }, + "response": { + "bodySize": 515, + "content": { + "mimeType": "application/vnd.api+json", + "size": 515, + "text": "{\"data\":{\"id\":\"c7d0bed9-01dc-45d5-88ad-242123881f81\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-10-28T14:51:13.006792Z\",\"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\",\"service\":\"my-service\",\"updated_at\":\"2025-10-28T14:51:13.006792Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 683, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-10-28T14:51:12.875Z", + "time": 166 + }, + { + "_id": "4b327a76c9fae0b340074881b6c955cf", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 129, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 612, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"dry_run\":false,\"name\":\"test\",\"options\":{\"excluded_resources\":[]},\"type\":\"fdd\"},\"type\":\"deployment_rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/c7d0bed9-01dc-45d5-88ad-242123881f81/rules" + }, + "response": { + "bodySize": 136, + "content": { + "mimeType": "application/vnd.api+json", + "size": 136, + "text": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"type\\\" must be one of \\\"monitor faulty_deployment_detection\\\"\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 682, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-10-28T14:51:13.049Z", + "time": 144 + }, + { + "_id": "6fd06ae07209b0038c7df57e1adc7c10", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 543, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/c7d0bed9-01dc-45d5-88ad-242123881f81" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 623, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-10-28T14:51:13.199Z", + "time": 156 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Deployment-Gates_4242274226/Create-deployment-rule-returns-OK-response_36464608/frozen.json b/cassettes/v2/Deployment-Gates_4242274226/Create-deployment-rule-returns-OK-response_36464608/frozen.json new file mode 100644 index 000000000000..0bd2627a649b --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Create-deployment-rule-returns-OK-response_36464608/frozen.json @@ -0,0 +1 @@ +"2025-10-28T14:51:13.363Z" diff --git a/cassettes/v2/Deployment-Gates_4242274226/Create-deployment-rule-returns-OK-response_36464608/recording.har b/cassettes/v2/Deployment-Gates_4242274226/Create-deployment-rule-returns-OK-response_36464608/recording.har new file mode 100644 index 000000000000..96f87a5d3221 --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Create-deployment-rule-returns-OK-response_36464608/recording.har @@ -0,0 +1,194 @@ +{ + "log": { + "_recordingName": "Deployment Gates/Create deployment rule returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "70acb264a190c9504530585b68c408be", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 131, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 570, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates" + }, + "response": { + "bodySize": 515, + "content": { + "mimeType": "application/vnd.api+json", + "size": 515, + "text": "{\"data\":{\"id\":\"58066a8e-44e7-4119-8ac6-a5ecc3b31c1b\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-10-28T14:51:13.477518Z\",\"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\",\"service\":\"my-service\",\"updated_at\":\"2025-10-28T14:51:13.477518Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 683, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-10-28T14:51:13.365Z", + "time": 352 + }, + { + "_id": "a1ccd12a79836f5c10aa48b476b8a478", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 167, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 614, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"dry_run\":false,\"name\":\"My deployment rule\",\"options\":{\"excluded_resources\":[]},\"type\":\"faulty_deployment_detection\"},\"type\":\"deployment_rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/58066a8e-44e7-4119-8ac6-a5ecc3b31c1b/rules" + }, + "response": { + "bodySize": 577, + "content": { + "mimeType": "application/vnd.api+json", + "size": 577, + "text": "{\"data\":{\"id\":\"8330bf79-6906-4cea-85d5-a4da6767458e\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-10-28T14:51:13.852895Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"58066a8e-44e7-4119-8ac6-a5ecc3b31c1b\",\"name\":\"My deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-10-28T14:51:13.852895Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 682, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-10-28T14:51:13.722Z", + "time": 160 + }, + { + "_id": "8b403cc98e592b75b680b567c7637e14", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 587, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/58066a8e-44e7-4119-8ac6-a5ecc3b31c1b/rules/8330bf79-6906-4cea-85d5-a4da6767458e" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 623, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-10-28T14:51:13.888Z", + "time": 147 + }, + { + "_id": "35fb0c5236b4db7c94899e6b8c393fe5", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 544, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/58066a8e-44e7-4119-8ac6-a5ecc3b31c1b" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 623, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-10-28T14:51:14.038Z", + "time": 148 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Deployment-Gates_4242274226/Delete-deployment-gate-returns-Bad-Request-response_770984992/frozen.json b/cassettes/v2/Deployment-Gates_4242274226/Delete-deployment-gate-returns-Bad-Request-response_770984992/frozen.json new file mode 100644 index 000000000000..5b3e5e0f5b8c --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Delete-deployment-gate-returns-Bad-Request-response_770984992/frozen.json @@ -0,0 +1 @@ +"2025-10-28T14:03:29.170Z" diff --git a/cassettes/v2/Deployment-Gates_4242274226/Delete-deployment-gate-returns-Bad-Request-response_770984992/recording.har b/cassettes/v2/Deployment-Gates_4242274226/Delete-deployment-gate-returns-Bad-Request-response_770984992/recording.har new file mode 100644 index 000000000000..de0c0c860d6d --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Delete-deployment-gate-returns-Bad-Request-response_770984992/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Deployment Gates/Delete deployment gate returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "a7bb4f92537941a50187bfc1bbffbeee", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 523, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/invalid-gate-id" + }, + "response": { + "bodySize": 90, + "content": { + "mimeType": "application/vnd.api+json", + "size": 90, + "text": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"id\\\" Invalid id\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 683, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-10-28T14:03:29.172Z", + "time": 244 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Deployment-Gates_4242274226/Delete-deployment-gate-returns-No-Content-response_2018192270/frozen.json b/cassettes/v2/Deployment-Gates_4242274226/Delete-deployment-gate-returns-No-Content-response_2018192270/frozen.json new file mode 100644 index 000000000000..b9c5a46bd220 --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Delete-deployment-gate-returns-No-Content-response_2018192270/frozen.json @@ -0,0 +1 @@ +"2025-10-28T14:51:14.192Z" diff --git a/cassettes/v2/Deployment-Gates_4242274226/Delete-deployment-gate-returns-No-Content-response_2018192270/recording.har b/cassettes/v2/Deployment-Gates_4242274226/Delete-deployment-gate-returns-No-Content-response_2018192270/recording.har new file mode 100644 index 000000000000..950ba7c4c881 --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Delete-deployment-gate-returns-No-Content-response_2018192270/recording.har @@ -0,0 +1,147 @@ +{ + "log": { + "_recordingName": "Deployment Gates/Delete deployment gate returns \"No Content\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "70acb264a190c9504530585b68c408be", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 131, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 571, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates" + }, + "response": { + "bodySize": 515, + "content": { + "mimeType": "application/vnd.api+json", + "size": 515, + "text": "{\"data\":{\"id\":\"dba6d48b-b7ac-4ac8-b2d5-70e45b500eed\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-10-28T14:51:14.313688Z\",\"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\",\"service\":\"my-service\",\"updated_at\":\"2025-10-28T14:51:14.313688Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 683, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-10-28T14:51:14.195Z", + "time": 156 + }, + { + "_id": "06c13af0863190d610201b7ddf35a59e", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 544, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/dba6d48b-b7ac-4ac8-b2d5-70e45b500eed" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 623, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-10-28T14:51:14.356Z", + "time": 134 + }, + { + "_id": "06c13af0863190d610201b7ddf35a59e", + "_order": 1, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 544, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/dba6d48b-b7ac-4ac8-b2d5-70e45b500eed" + }, + "response": { + "bodySize": 80, + "content": { + "mimeType": "application/vnd.api+json", + "size": 80, + "text": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"Gate does not exist\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 683, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-10-28T14:51:14.494Z", + "time": 129 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Deployment-Gates_4242274226/Delete-deployment-rule-returns-Bad-Request-response_244866955/frozen.json b/cassettes/v2/Deployment-Gates_4242274226/Delete-deployment-rule-returns-Bad-Request-response_244866955/frozen.json new file mode 100644 index 000000000000..c1567417cc07 --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Delete-deployment-rule-returns-Bad-Request-response_244866955/frozen.json @@ -0,0 +1 @@ +"2025-10-28T14:03:30.230Z" diff --git a/cassettes/v2/Deployment-Gates_4242274226/Delete-deployment-rule-returns-Bad-Request-response_244866955/recording.har b/cassettes/v2/Deployment-Gates_4242274226/Delete-deployment-rule-returns-Bad-Request-response_244866955/recording.har new file mode 100644 index 000000000000..9f3f44320cc2 --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Delete-deployment-rule-returns-Bad-Request-response_244866955/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Deployment Gates/Delete deployment rule returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "addfa3900dcbad10c64cb7be21ff7604", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 545, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/invalid-gate-id/rules/invalid-rule-id" + }, + "response": { + "bodySize": 95, + "content": { + "mimeType": "application/vnd.api+json", + "size": 95, + "text": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"gate_id\\\" Invalid id\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 683, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-10-28T14:03:30.236Z", + "time": 265 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Deployment-Gates_4242274226/Delete-deployment-rule-returns-No-Content-response_3926285415/frozen.json b/cassettes/v2/Deployment-Gates_4242274226/Delete-deployment-rule-returns-No-Content-response_3926285415/frozen.json new file mode 100644 index 000000000000..81aa804a75ea --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Delete-deployment-rule-returns-No-Content-response_3926285415/frozen.json @@ -0,0 +1 @@ +"2025-10-28T14:51:14.630Z" diff --git a/cassettes/v2/Deployment-Gates_4242274226/Delete-deployment-rule-returns-No-Content-response_3926285415/recording.har b/cassettes/v2/Deployment-Gates_4242274226/Delete-deployment-rule-returns-No-Content-response_3926285415/recording.har new file mode 100644 index 000000000000..8b2cd92070d8 --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Delete-deployment-rule-returns-No-Content-response_3926285415/recording.har @@ -0,0 +1,237 @@ +{ + "log": { + "_recordingName": "Deployment Gates/Delete deployment rule returns \"No Content\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "70acb264a190c9504530585b68c408be", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 131, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 571, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates" + }, + "response": { + "bodySize": 515, + "content": { + "mimeType": "application/vnd.api+json", + "size": 515, + "text": "{\"data\":{\"id\":\"8e202ae7-a86b-4f4a-a213-585801a42630\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-10-28T14:51:14.754979Z\",\"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\",\"service\":\"my-service\",\"updated_at\":\"2025-10-28T14:51:14.754979Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 683, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-10-28T14:51:14.634Z", + "time": 154 + }, + { + "_id": "64372ed15fc942eca46e9526e5fc1dac", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 167, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 614, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"dry_run\":false,\"name\":\"My deployment rule\",\"options\":{\"excluded_resources\":[]},\"type\":\"faulty_deployment_detection\"},\"type\":\"deployment_rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/8e202ae7-a86b-4f4a-a213-585801a42630/rules" + }, + "response": { + "bodySize": 577, + "content": { + "mimeType": "application/vnd.api+json", + "size": 577, + "text": "{\"data\":{\"id\":\"31e6717f-2eaa-45e5-9559-a55ca9d45f8d\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-10-28T14:51:14.911642Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"8e202ae7-a86b-4f4a-a213-585801a42630\",\"name\":\"My deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-10-28T14:51:14.911642Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 682, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-10-28T14:51:14.796Z", + "time": 140 + }, + { + "_id": "7750dd6b72c8a686a6679e3cd66d2694", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 587, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/8e202ae7-a86b-4f4a-a213-585801a42630/rules/31e6717f-2eaa-45e5-9559-a55ca9d45f8d" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 623, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-10-28T14:51:14.940Z", + "time": 145 + }, + { + "_id": "7750dd6b72c8a686a6679e3cd66d2694", + "_order": 1, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 587, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/8e202ae7-a86b-4f4a-a213-585801a42630/rules/31e6717f-2eaa-45e5-9559-a55ca9d45f8d" + }, + "response": { + "bodySize": 80, + "content": { + "mimeType": "application/vnd.api+json", + "size": 80, + "text": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"Rule does not exist\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 683, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-10-28T14:51:15.090Z", + "time": 142 + }, + { + "_id": "dd8ed37e3b60352bb1d1b3f4c8e39a88", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 544, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/8e202ae7-a86b-4f4a-a213-585801a42630" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 623, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-10-28T14:51:15.235Z", + "time": 130 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Deployment-Gates_4242274226/Get-deployment-gate-returns-Bad-Request-response_842931407/frozen.json b/cassettes/v2/Deployment-Gates_4242274226/Get-deployment-gate-returns-Bad-Request-response_842931407/frozen.json new file mode 100644 index 000000000000..9a6b3cd38497 --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Get-deployment-gate-returns-Bad-Request-response_842931407/frozen.json @@ -0,0 +1 @@ +"2025-10-28T14:03:31.887Z" diff --git a/cassettes/v2/Deployment-Gates_4242274226/Get-deployment-gate-returns-Bad-Request-response_842931407/recording.har b/cassettes/v2/Deployment-Gates_4242274226/Get-deployment-gate-returns-Bad-Request-response_842931407/recording.har new file mode 100644 index 000000000000..8dd0a8ea9c11 --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Get-deployment-gate-returns-Bad-Request-response_842931407/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Deployment Gates/Get deployment gate returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "59b4094790d4685a2b0de1f51f0ff6c1", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 530, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/invalid-gate-id" + }, + "response": { + "bodySize": 90, + "content": { + "mimeType": "application/vnd.api+json", + "size": 90, + "text": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"id\\\" Invalid id\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 680, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-10-28T14:03:31.889Z", + "time": 250 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Deployment-Gates_4242274226/Get-deployment-gate-returns-OK-response_1812155259/frozen.json b/cassettes/v2/Deployment-Gates_4242274226/Get-deployment-gate-returns-OK-response_1812155259/frozen.json new file mode 100644 index 000000000000..d1f252c97398 --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Get-deployment-gate-returns-OK-response_1812155259/frozen.json @@ -0,0 +1 @@ +"2025-10-28T14:51:15.372Z" diff --git a/cassettes/v2/Deployment-Gates_4242274226/Get-deployment-gate-returns-OK-response_1812155259/recording.har b/cassettes/v2/Deployment-Gates_4242274226/Get-deployment-gate-returns-OK-response_1812155259/recording.har new file mode 100644 index 000000000000..58b90e5fd6bb --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Get-deployment-gate-returns-OK-response_1812155259/recording.har @@ -0,0 +1,147 @@ +{ + "log": { + "_recordingName": "Deployment Gates/Get deployment gate returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "70acb264a190c9504530585b68c408be", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 131, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 571, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates" + }, + "response": { + "bodySize": 515, + "content": { + "mimeType": "application/vnd.api+json", + "size": 515, + "text": "{\"data\":{\"id\":\"ed4085c5-e8d3-4bf8-89a6-c257164d8952\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-10-28T14:51:15.478086Z\",\"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\",\"service\":\"my-service\",\"updated_at\":\"2025-10-28T14:51:15.478086Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 683, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-10-28T14:51:15.373Z", + "time": 124 + }, + { + "_id": "a69cb1bc0a267ed9f06d1e6e1c5ae317", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 551, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/ed4085c5-e8d3-4bf8-89a6-c257164d8952" + }, + "response": { + "bodySize": 515, + "content": { + "mimeType": "application/vnd.api+json", + "size": 515, + "text": "{\"data\":{\"id\":\"ed4085c5-e8d3-4bf8-89a6-c257164d8952\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-10-28T14:51:15.478086Z\",\"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\",\"service\":\"my-service\",\"updated_at\":\"2025-10-28T14:51:15.478086Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 681, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-10-28T14:51:15.505Z", + "time": 219 + }, + { + "_id": "52e4fdebcdb58662dbd88b5df13ce3ab", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 543, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/ed4085c5-e8d3-4bf8-89a6-c257164d8952" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 623, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-10-28T14:51:15.728Z", + "time": 151 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Deployment-Gates_4242274226/Get-deployment-rule-returns-Bad-Request-response_2127960932/frozen.json b/cassettes/v2/Deployment-Gates_4242274226/Get-deployment-rule-returns-Bad-Request-response_2127960932/frozen.json new file mode 100644 index 000000000000..af761a7f62a3 --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Get-deployment-rule-returns-Bad-Request-response_2127960932/frozen.json @@ -0,0 +1 @@ +"2025-10-28T14:51:15.883Z" diff --git a/cassettes/v2/Deployment-Gates_4242274226/Get-deployment-rule-returns-Bad-Request-response_2127960932/recording.har b/cassettes/v2/Deployment-Gates_4242274226/Get-deployment-rule-returns-Bad-Request-response_2127960932/recording.har new file mode 100644 index 000000000000..24232388b1f7 --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Get-deployment-rule-returns-Bad-Request-response_2127960932/recording.har @@ -0,0 +1,237 @@ +{ + "log": { + "_recordingName": "Deployment Gates/Get deployment rule returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "70acb264a190c9504530585b68c408be", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 131, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 571, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates" + }, + "response": { + "bodySize": 515, + "content": { + "mimeType": "application/vnd.api+json", + "size": 515, + "text": "{\"data\":{\"id\":\"d49e6d82-2dc4-45b6-ab50-4fb09feae18e\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-10-28T14:51:16.013862Z\",\"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\",\"service\":\"my-service\",\"updated_at\":\"2025-10-28T14:51:16.013862Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 683, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-10-28T14:51:15.885Z", + "time": 168 + }, + { + "_id": "666c0abd7c83dd7653a7a000b0b18cf5", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 167, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 613, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"dry_run\":false,\"name\":\"My deployment rule\",\"options\":{\"excluded_resources\":[]},\"type\":\"faulty_deployment_detection\"},\"type\":\"deployment_rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/d49e6d82-2dc4-45b6-ab50-4fb09feae18e/rules" + }, + "response": { + "bodySize": 577, + "content": { + "mimeType": "application/vnd.api+json", + "size": 577, + "text": "{\"data\":{\"id\":\"611707d2-276e-4dc5-b754-db8f94eab0b5\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-10-28T14:51:16.184094Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"d49e6d82-2dc4-45b6-ab50-4fb09feae18e\",\"name\":\"My deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-10-28T14:51:16.184094Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 682, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-10-28T14:51:16.057Z", + "time": 143 + }, + { + "_id": "fb33a6dc801c60adbeedde2e3d4a63f4", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 552, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/invalid-gate-id/rules/invalid-rule-id" + }, + "response": { + "bodySize": 95, + "content": { + "mimeType": "application/vnd.api+json", + "size": 95, + "text": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"gate_id\\\" Invalid id\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 680, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-10-28T14:51:16.203Z", + "time": 131 + }, + { + "_id": "3b3081f939d99c5ed9c1935012a85099", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 587, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/d49e6d82-2dc4-45b6-ab50-4fb09feae18e/rules/611707d2-276e-4dc5-b754-db8f94eab0b5" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 623, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-10-28T14:51:16.338Z", + "time": 146 + }, + { + "_id": "f13a69de96efbc88bccd7dada289daf1", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 544, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/d49e6d82-2dc4-45b6-ab50-4fb09feae18e" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 623, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-10-28T14:51:16.487Z", + "time": 149 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Deployment-Gates_4242274226/Get-deployment-rule-returns-OK-response_3558316506/frozen.json b/cassettes/v2/Deployment-Gates_4242274226/Get-deployment-rule-returns-OK-response_3558316506/frozen.json new file mode 100644 index 000000000000..44578f89d6b5 --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Get-deployment-rule-returns-OK-response_3558316506/frozen.json @@ -0,0 +1 @@ +"2025-10-28T14:51:16.642Z" diff --git a/cassettes/v2/Deployment-Gates_4242274226/Get-deployment-rule-returns-OK-response_3558316506/recording.har b/cassettes/v2/Deployment-Gates_4242274226/Get-deployment-rule-returns-OK-response_3558316506/recording.har new file mode 100644 index 000000000000..95bc86b7ba5e --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Get-deployment-rule-returns-OK-response_3558316506/recording.har @@ -0,0 +1,237 @@ +{ + "log": { + "_recordingName": "Deployment Gates/Get deployment rule returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "70acb264a190c9504530585b68c408be", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 131, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 571, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates" + }, + "response": { + "bodySize": 515, + "content": { + "mimeType": "application/vnd.api+json", + "size": 515, + "text": "{\"data\":{\"id\":\"50df9de0-aa0c-4d7c-8fc8-811ee2ab4e56\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-10-28T14:51:16.752908Z\",\"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\",\"service\":\"my-service\",\"updated_at\":\"2025-10-28T14:51:16.752908Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 683, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-10-28T14:51:16.644Z", + "time": 168 + }, + { + "_id": "c9781ea9bfaa1188d56bbb91d1421fad", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 167, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 614, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"dry_run\":false,\"name\":\"My deployment rule\",\"options\":{\"excluded_resources\":[]},\"type\":\"faulty_deployment_detection\"},\"type\":\"deployment_rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/50df9de0-aa0c-4d7c-8fc8-811ee2ab4e56/rules" + }, + "response": { + "bodySize": 577, + "content": { + "mimeType": "application/vnd.api+json", + "size": 577, + "text": "{\"data\":{\"id\":\"a38ab685-4ef9-4000-a938-740da6c37296\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-10-28T14:51:16.947341Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"50df9de0-aa0c-4d7c-8fc8-811ee2ab4e56\",\"name\":\"My deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-10-28T14:51:16.947341Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 682, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-10-28T14:51:16.827Z", + "time": 157 + }, + { + "_id": "285a097680b4ee662ad73bb66a7d8b0e", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 594, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/50df9de0-aa0c-4d7c-8fc8-811ee2ab4e56/rules/a38ab685-4ef9-4000-a938-740da6c37296" + }, + "response": { + "bodySize": 577, + "content": { + "mimeType": "application/vnd.api+json", + "size": 577, + "text": "{\"data\":{\"id\":\"a38ab685-4ef9-4000-a938-740da6c37296\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-10-28T14:51:16.947341Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"50df9de0-aa0c-4d7c-8fc8-811ee2ab4e56\",\"name\":\"My deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-10-28T14:51:16.947341Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 681, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-10-28T14:51:16.989Z", + "time": 329 + }, + { + "_id": "5309ca55be5902cdda2211e46b01ec30", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 587, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/50df9de0-aa0c-4d7c-8fc8-811ee2ab4e56/rules/a38ab685-4ef9-4000-a938-740da6c37296" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 623, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-10-28T14:51:17.323Z", + "time": 125 + }, + { + "_id": "ee7ee84971489b99357a9f3a0dd6e77f", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 544, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/50df9de0-aa0c-4d7c-8fc8-811ee2ab4e56" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 623, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-10-28T14:51:17.450Z", + "time": 130 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Deployment-Gates_4242274226/Update-deployment-gate-returns-Bad-Request-response_4008552930/frozen.json b/cassettes/v2/Deployment-Gates_4242274226/Update-deployment-gate-returns-Bad-Request-response_4008552930/frozen.json new file mode 100644 index 000000000000..aae4e8051e33 --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Update-deployment-gate-returns-Bad-Request-response_4008552930/frozen.json @@ -0,0 +1 @@ +"2025-10-28T14:03:35.734Z" diff --git a/cassettes/v2/Deployment-Gates_4242274226/Update-deployment-gate-returns-Bad-Request-response_4008552930/recording.har b/cassettes/v2/Deployment-Gates_4242274226/Update-deployment-gate-returns-Bad-Request-response_4008552930/recording.har new file mode 100644 index 000000000000..abdc5e13aaca --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Update-deployment-gate-returns-Bad-Request-response_4008552930/recording.har @@ -0,0 +1,67 @@ +{ + "log": { + "_recordingName": "Deployment Gates/Update deployment gate returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "224572ce70db2f4beebce12f55df633f", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 88, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 585, + "httpVersion": "HTTP/1.1", + "method": "PUT", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"dry_run\":true},\"id\":\"invalid-gate-id\",\"type\":\"deployment_gate\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/invalid-gate-id" + }, + "response": { + "bodySize": 90, + "content": { + "mimeType": "application/vnd.api+json", + "size": 90, + "text": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"id\\\" Invalid id\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 680, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-10-28T14:03:35.736Z", + "time": 233 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Deployment-Gates_4242274226/Update-deployment-gate-returns-OK-response_3515146080/frozen.json b/cassettes/v2/Deployment-Gates_4242274226/Update-deployment-gate-returns-OK-response_3515146080/frozen.json new file mode 100644 index 000000000000..0647a82aca50 --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Update-deployment-gate-returns-OK-response_3515146080/frozen.json @@ -0,0 +1 @@ +"2025-10-28T14:51:17.586Z" diff --git a/cassettes/v2/Deployment-Gates_4242274226/Update-deployment-gate-returns-OK-response_3515146080/recording.har b/cassettes/v2/Deployment-Gates_4242274226/Update-deployment-gate-returns-OK-response_3515146080/recording.har new file mode 100644 index 000000000000..6c3aa18f5acf --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Update-deployment-gate-returns-OK-response_3515146080/recording.har @@ -0,0 +1,157 @@ +{ + "log": { + "_recordingName": "Deployment Gates/Update deployment gate returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "70acb264a190c9504530585b68c408be", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 131, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 571, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates" + }, + "response": { + "bodySize": 515, + "content": { + "mimeType": "application/vnd.api+json", + "size": 515, + "text": "{\"data\":{\"id\":\"ef672c2e-81fc-4fcc-9690-392a9cf0d70c\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-10-28T14:51:17.693361Z\",\"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\",\"service\":\"my-service\",\"updated_at\":\"2025-10-28T14:51:17.693361Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 683, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-10-28T14:51:17.589Z", + "time": 143 + }, + { + "_id": "b2eddf9a10a6ae934e739b613b82db5b", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 110, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 606, + "httpVersion": "HTTP/1.1", + "method": "PUT", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"dry_run\":false},\"id\":\"12345678-1234-1234-1234-123456789012\",\"type\":\"deployment_gate\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/ef672c2e-81fc-4fcc-9690-392a9cf0d70c" + }, + "response": { + "bodySize": 515, + "content": { + "mimeType": "application/vnd.api+json", + "size": 515, + "text": "{\"data\":{\"id\":\"ef672c2e-81fc-4fcc-9690-392a9cf0d70c\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-10-28T14:51:17.693361Z\",\"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\",\"service\":\"my-service\",\"updated_at\":\"2025-10-28T14:51:17.841019Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 681, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-10-28T14:51:17.736Z", + "time": 132 + }, + { + "_id": "2cd4c09eed517fb13a942907f1e39850", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 544, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/ef672c2e-81fc-4fcc-9690-392a9cf0d70c" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 623, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-10-28T14:51:17.872Z", + "time": 129 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Deployment-Gates_4242274226/Update-deployment-rule-returns-Bad-Request-response_1486779637/frozen.json b/cassettes/v2/Deployment-Gates_4242274226/Update-deployment-rule-returns-Bad-Request-response_1486779637/frozen.json new file mode 100644 index 000000000000..0120d7086a81 --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Update-deployment-rule-returns-Bad-Request-response_1486779637/frozen.json @@ -0,0 +1 @@ +"2025-10-28T14:51:18.004Z" diff --git a/cassettes/v2/Deployment-Gates_4242274226/Update-deployment-rule-returns-Bad-Request-response_1486779637/recording.har b/cassettes/v2/Deployment-Gates_4242274226/Update-deployment-rule-returns-Bad-Request-response_1486779637/recording.har new file mode 100644 index 000000000000..66c33e209f79 --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Update-deployment-rule-returns-Bad-Request-response_1486779637/recording.har @@ -0,0 +1,247 @@ +{ + "log": { + "_recordingName": "Deployment Gates/Update deployment rule returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "70acb264a190c9504530585b68c408be", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 131, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 571, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates" + }, + "response": { + "bodySize": 515, + "content": { + "mimeType": "application/vnd.api+json", + "size": 515, + "text": "{\"data\":{\"id\":\"b2bd3ad3-f414-4f05-9ad6-248ed3f99f4d\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-10-28T14:51:18.108594Z\",\"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\",\"service\":\"my-service\",\"updated_at\":\"2025-10-28T14:51:18.108594Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 683, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-10-28T14:51:18.010Z", + "time": 116 + }, + { + "_id": "4d5ec8dd7568e1653db866b89e5054a0", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 167, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 614, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"dry_run\":false,\"name\":\"My deployment rule\",\"options\":{\"excluded_resources\":[]},\"type\":\"faulty_deployment_detection\"},\"type\":\"deployment_rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/b2bd3ad3-f414-4f05-9ad6-248ed3f99f4d/rules" + }, + "response": { + "bodySize": 577, + "content": { + "mimeType": "application/vnd.api+json", + "size": 577, + "text": "{\"data\":{\"id\":\"189846d6-3c19-46e8-98d1-9d05a2f43361\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-10-28T14:51:18.251816Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"b2bd3ad3-f414-4f05-9ad6-248ed3f99f4d\",\"name\":\"My deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-10-28T14:51:18.251816Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 682, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-10-28T14:51:18.130Z", + "time": 165 + }, + { + "_id": "7d25d788cd9d6480d8210f5a5ca31a95", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 135, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 608, + "httpVersion": "HTTP/1.1", + "method": "PUT", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"dry_run\":false,\"name\":\"Updated deployment rule\",\"options\":{\"excluded_resources\":[]}},\"type\":\"deployment_rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/invalid-gate-id/rules/invalid-rule-id" + }, + "response": { + "bodySize": 95, + "content": { + "mimeType": "application/vnd.api+json", + "size": 95, + "text": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"gate_id\\\" Invalid id\"}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 680, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-10-28T14:51:18.299Z", + "time": 132 + }, + { + "_id": "59d200b66705c933cac03db89a7c5766", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 587, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/b2bd3ad3-f414-4f05-9ad6-248ed3f99f4d/rules/189846d6-3c19-46e8-98d1-9d05a2f43361" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 623, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-10-28T14:51:18.435Z", + "time": 132 + }, + { + "_id": "c175fc7e9e8ccefbe430ba4e5818f497", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 544, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/b2bd3ad3-f414-4f05-9ad6-248ed3f99f4d" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 623, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-10-28T14:51:18.569Z", + "time": 146 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Deployment-Gates_4242274226/Update-deployment-rule-returns-OK-response_2914944649/frozen.json b/cassettes/v2/Deployment-Gates_4242274226/Update-deployment-rule-returns-OK-response_2914944649/frozen.json new file mode 100644 index 000000000000..7c0776180795 --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Update-deployment-rule-returns-OK-response_2914944649/frozen.json @@ -0,0 +1 @@ +"2025-10-28T14:51:18.721Z" diff --git a/cassettes/v2/Deployment-Gates_4242274226/Update-deployment-rule-returns-OK-response_2914944649/recording.har b/cassettes/v2/Deployment-Gates_4242274226/Update-deployment-rule-returns-OK-response_2914944649/recording.har new file mode 100644 index 000000000000..0f451a258f2e --- /dev/null +++ b/cassettes/v2/Deployment-Gates_4242274226/Update-deployment-rule-returns-OK-response_2914944649/recording.har @@ -0,0 +1,247 @@ +{ + "log": { + "_recordingName": "Deployment Gates/Update deployment rule returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "70acb264a190c9504530585b68c408be", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 131, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 570, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates" + }, + "response": { + "bodySize": 515, + "content": { + "mimeType": "application/vnd.api+json", + "size": 515, + "text": "{\"data\":{\"id\":\"301122dd-9022-40f0-886f-f9a6c227dc9a\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-10-28T14:51:18.845469Z\",\"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\",\"service\":\"my-service\",\"updated_at\":\"2025-10-28T14:51:18.845469Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 683, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-10-28T14:51:18.722Z", + "time": 164 + }, + { + "_id": "ec0c5f43e8d98a9463cea8e99d31eb69", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 167, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 613, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"dry_run\":false,\"name\":\"My deployment rule\",\"options\":{\"excluded_resources\":[]},\"type\":\"faulty_deployment_detection\"},\"type\":\"deployment_rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/301122dd-9022-40f0-886f-f9a6c227dc9a/rules" + }, + "response": { + "bodySize": 577, + "content": { + "mimeType": "application/vnd.api+json", + "size": 577, + "text": "{\"data\":{\"id\":\"483937d1-efc4-4a7c-95a6-89bd6b2e4e75\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-10-28T14:51:19.007448Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"301122dd-9022-40f0-886f-f9a6c227dc9a\",\"name\":\"My deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-10-28T14:51:19.007448Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 682, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-10-28T14:51:18.890Z", + "time": 135 + }, + { + "_id": "4d411959683ad10dc42bfd77aea1fbcb", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 135, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 648, + "httpVersion": "HTTP/1.1", + "method": "PUT", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"dry_run\":false,\"name\":\"Updated deployment rule\",\"options\":{\"excluded_resources\":[]}},\"type\":\"deployment_rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/301122dd-9022-40f0-886f-f9a6c227dc9a/rules/483937d1-efc4-4a7c-95a6-89bd6b2e4e75" + }, + "response": { + "bodySize": 582, + "content": { + "mimeType": "application/vnd.api+json", + "size": 582, + "text": "{\"data\":{\"id\":\"483937d1-efc4-4a7c-95a6-89bd6b2e4e75\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-10-28T14:51:19.007448Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"301122dd-9022-40f0-886f-f9a6c227dc9a\",\"name\":\"Updated deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-10-28T14:51:19.134366Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 681, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-10-28T14:51:19.030Z", + "time": 175 + }, + { + "_id": "97979e7e57c7d9bdd1bd4385af7df9ac", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 586, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/301122dd-9022-40f0-886f-f9a6c227dc9a/rules/483937d1-efc4-4a7c-95a6-89bd6b2e4e75" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 623, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-10-28T14:51:19.209Z", + "time": 135 + }, + { + "_id": "f8b7f255e2f0fcc6d32d78d9e518f898", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 542, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/deployment_gates/301122dd-9022-40f0-886f-f9a6c227dc9a" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 623, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-10-28T14:51:19.347Z", + "time": 143 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/features/v2/deployment_gates.feature b/features/v2/deployment_gates.feature new file mode 100644 index 000000000000..e4023c5650b1 --- /dev/null +++ b/features/v2/deployment_gates.feature @@ -0,0 +1,289 @@ +@endpoint(deployment-gates) @endpoint(deployment-gates-v2) +Feature: Deployment Gates + Manage Deployment Gates using this API to reduce the likelihood and impact + of incidents caused by deployments. See the [Deployment Gates + documentation](https://docs.datadoghq.com/deployment_gates/) for more + information. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "DeploymentGates" API + + @team:DataDog/ci-app-backend + Scenario: Create deployment gate returns "Bad Request" response + Given operation "CreateDeploymentGate" enabled + And new "CreateDeploymentGate" request + And body with value {"data": {"attributes": {"env": "", "service":"test-service", "identifier": "my-gate"}, "type": "deployment_gate"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Create deployment gate returns "Bad request." response + Given operation "CreateDeploymentGate" enabled + And new "CreateDeploymentGate" request + And body with value {"data": {"attributes": {"dry_run": false, "env": "production", "identifier": "pre", "service": "my-service"}, "type": "deployment_gate"}} + When the request is sent + Then the response status is 400 Bad request. + + @team:DataDog/ci-app-backend + Scenario: Create deployment gate returns "OK" response + Given operation "CreateDeploymentGate" enabled + And new "CreateDeploymentGate" request + And body with value {"data": {"attributes": {"dry_run": false, "env": "production", "identifier": "my-gate-1", "service": "my-service"}, "type": "deployment_gate"}} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/ci-app-backend + Scenario: Create deployment rule returns "Bad Request" response + Given there is a valid "deployment_gate" in the system + And operation "CreateDeploymentRule" enabled + And new "CreateDeploymentRule" request + And request contains "gate_id" parameter from "deployment_gate.data.id" + And body with value {"data": {"attributes": {"dry_run": false, "name":"test", "options": {"excluded_resources": []}, "type": "fdd"}, "type": "deployment_rule"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Create deployment rule returns "Bad request." response + Given operation "CreateDeploymentRule" enabled + And new "CreateDeploymentRule" request + And request contains "gate_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"dry_run": false, "name": "My deployment rule", "options": {"duration": 3600, "excluded_resources": ["resource1", "resource2"]}, "type": "faulty_deployment_detection"}, "type": "deployment_rule"}} + When the request is sent + Then the response status is 400 Bad request. + + @team:DataDog/ci-app-backend + Scenario: Create deployment rule returns "OK" response + Given there is a valid "deployment_gate" in the system + And operation "CreateDeploymentRule" enabled + And new "CreateDeploymentRule" request + And request contains "gate_id" parameter from "deployment_gate.data.id" + And body with value {"data": {"attributes": {"dry_run": false, "name": "My deployment rule", "options": {"excluded_resources": []}, "type": "faulty_deployment_detection"}, "type": "deployment_rule"}} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/ci-app-backend + Scenario: Delete deployment gate returns "Bad Request" response + Given operation "DeleteDeploymentGate" enabled + And new "DeleteDeploymentGate" request + And request contains "id" parameter with value "invalid-gate-id" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Delete deployment gate returns "Bad request." response + Given operation "DeleteDeploymentGate" enabled + And new "DeleteDeploymentGate" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad request. + + @generated @skip @team:DataDog/ci-app-backend + Scenario: 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" + When the request is sent + Then the response status is 404 Deployment gate not found. + + @team:DataDog/ci-app-backend + Scenario: Delete deployment gate returns "No Content" response + Given there is a valid "deployment_gate" in the system + And operation "DeleteDeploymentGate" enabled + And new "DeleteDeploymentGate" request + And request contains "id" parameter from "deployment_gate.data.id" + When the request is sent + Then the response status is 204 No Content + + @team:DataDog/ci-app-backend + Scenario: Delete deployment rule returns "Bad Request" response + Given operation "DeleteDeploymentRule" enabled + And new "DeleteDeploymentRule" request + And request contains "gate_id" parameter with value "invalid-gate-id" + And request contains "id" parameter with value "invalid-rule-id" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Delete deployment rule returns "Bad request." 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" + When the request is sent + Then the response status is 400 Bad request. + + @generated @skip @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" + When the request is sent + Then the response status is 404 Deployment gate not found. + + @team:DataDog/ci-app-backend + Scenario: Delete deployment rule returns "No Content" response + Given there is a valid "deployment_gate" in the system + And there is a valid "deployment_rule" in the system + And operation "DeleteDeploymentRule" enabled + And new "DeleteDeploymentRule" request + And request contains "gate_id" parameter from "deployment_gate.data.id" + And request contains "id" parameter from "deployment_rule.data.id" + When the request is sent + Then the response status is 204 No Content + + @team:DataDog/ci-app-backend + Scenario: Get deployment gate returns "Bad Request" response + Given operation "GetDeploymentGate" enabled + And new "GetDeploymentGate" request + And request contains "id" parameter with value "invalid-gate-id" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Get deployment gate returns "Bad request." response + Given operation "GetDeploymentGate" enabled + And new "GetDeploymentGate" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad request. + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Get deployment gate returns "Deployment gate not found." response + Given operation "GetDeploymentGate" enabled + And new "GetDeploymentGate" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Deployment gate not found. + + @team:DataDog/ci-app-backend + Scenario: Get deployment gate returns "OK" response + Given there is a valid "deployment_gate" in the system + And operation "GetDeploymentGate" enabled + And new "GetDeploymentGate" request + And request contains "id" parameter from "deployment_gate.data.id" + When the request is sent + Then the response status is 200 OK + + @team:DataDog/ci-app-backend + Scenario: Get deployment rule returns "Bad Request" response + Given there is a valid "deployment_gate" in the system + And there is a valid "deployment_rule" in the system + And operation "GetDeploymentRule" enabled + And new "GetDeploymentRule" request + And request contains "gate_id" parameter with value "invalid-gate-id" + And request contains "id" parameter with value "invalid-rule-id" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Get deployment rule returns "Bad request." 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" + When the request is sent + Then the response status is 400 Bad request. + + @generated @skip @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" + When the request is sent + Then the response status is 404 Deployment rule not found. + + @team:DataDog/ci-app-backend + Scenario: Get deployment rule returns "OK" response + Given there is a valid "deployment_gate" in the system + And there is a valid "deployment_rule" in the system + And operation "GetDeploymentRule" enabled + And new "GetDeploymentRule" request + And request contains "gate_id" parameter from "deployment_gate.data.id" + And request contains "id" parameter from "deployment_rule.data.id" + When the request is sent + Then the response status is 200 OK + + @team:DataDog/ci-app-backend + Scenario: Update deployment gate returns "Bad Request" response + Given operation "UpdateDeploymentGate" enabled + And new "UpdateDeploymentGate" request + And request contains "id" parameter with value "invalid-gate-id" + And body with value {"data": {"attributes": {"dry_run":true}, "id": "invalid-gate-id", "type": "deployment_gate"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Update deployment gate returns "Bad request." response + Given operation "UpdateDeploymentGate" enabled + And new "UpdateDeploymentGate" request + And request contains "id" parameter from "REPLACE.ME" + 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 400 Bad request. + + @generated @skip @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 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. + + @team:DataDog/ci-app-backend + Scenario: Update deployment gate returns "OK" response + Given there is a valid "deployment_gate" in the system + And operation "UpdateDeploymentGate" enabled + And new "UpdateDeploymentGate" request + And request contains "id" parameter from "deployment_gate.data.id" + 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 200 OK + + @team:DataDog/ci-app-backend + Scenario: Update deployment rule returns "Bad Request" response + Given there is a valid "deployment_gate" in the system + And there is a valid "deployment_rule" in the system + And operation "UpdateDeploymentRule" enabled + And new "UpdateDeploymentRule" request + And request contains "gate_id" parameter with value "invalid-gate-id" + And request contains "id" parameter with value "invalid-rule-id" + And body with value {"data": {"attributes": {"dry_run": false, "name": "Updated deployment rule", "options": {"excluded_resources": []}}, "type": "deployment_rule"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Update deployment rule returns "Bad request." 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 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 400 Bad request. + + @generated @skip @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 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. + + @team:DataDog/ci-app-backend + Scenario: Update deployment rule returns "OK" response + Given there is a valid "deployment_gate" in the system + And there is a valid "deployment_rule" in the system + And operation "UpdateDeploymentRule" enabled + And new "UpdateDeploymentRule" request + And request contains "gate_id" parameter from "deployment_gate.data.id" + And request contains "id" parameter from "deployment_rule.data.id" + And body with value {"data": {"attributes": {"dry_run": false, "name": "Updated deployment rule", "options": {"excluded_resources": []}}, "type": "deployment_rule"}} + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/given.json b/features/v2/given.json index 8afb9b89bda5..198c7af1b51d 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -346,6 +346,34 @@ "tag": "Data Deletion", "operationId": "CreateDataDeletionRequest" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"deployment_gate\",\n \"attributes\": {\n \"service\": \"my-service\",\n \"env\": \"production\",\n \"identifier\": \"my-gate\",\n \"dry_run\": false\n }\n }\n}" + } + ], + "step": "there is a valid \"deployment_gate\" in the system", + "key": "deployment_gate", + "tag": "Deployment Gates", + "operationId": "CreateDeploymentGate" + }, + { + "parameters": [ + { + "name": "gate_id", + "source": "deployment_gate.data.id" + }, + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"deployment_rule\",\n \"attributes\": {\n \"name\": \"My deployment rule\",\n \"type\": \"faulty_deployment_detection\",\n \"options\": {\n \"excluded_resources\": []\n },\n \"dry_run\": false\n }\n }\n}" + } + ], + "step": "there is a valid \"deployment_rule\" in the system", + "key": "deployment_rule", + "tag": "Deployment Gates", + "operationId": "CreateDeploymentRule" + }, { "parameters": [ { diff --git a/features/v2/undo.json b/features/v2/undo.json index dba9a5e29d71..0ed8bec8f3ea 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1310,6 +1310,72 @@ "type": "idempotent" } }, + "CreateDeploymentGate": { + "tag": "Deployment Gates", + "undo": { + "operationId": "DeleteDeploymentGate", + "parameters": [ + { + "name": "id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "CreateDeploymentRule": { + "tag": "Deployment Gates", + "undo": { + "operationId": "DeleteDeploymentRule", + "parameters": [ + { + "name": "gate_id", + "source": "data.attributes.gate_id" + }, + { + "name": "id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteDeploymentRule": { + "tag": "Deployment Gates", + "undo": { + "type": "idempotent" + } + }, + "GetDeploymentRule": { + "tag": "Deployment Gates", + "undo": { + "type": "safe" + } + }, + "UpdateDeploymentRule": { + "tag": "Deployment Gates", + "undo": { + "type": "idempotent" + } + }, + "DeleteDeploymentGate": { + "tag": "Deployment Gates", + "undo": { + "type": "idempotent" + } + }, + "GetDeploymentGate": { + "tag": "Deployment Gates", + "undo": { + "type": "safe" + } + }, + "UpdateDeploymentGate": { + "tag": "Deployment Gates", + "undo": { + "type": "idempotent" + } + }, "GetDomainAllowlist": { "tag": "Domain Allowlist", "undo": { diff --git a/packages/datadog-api-client/README.md b/packages/datadog-api-client/README.md index afd9fea69672..90524f12425d 100644 --- a/packages/datadog-api-client/README.md +++ b/packages/datadog-api-client/README.md @@ -377,6 +377,7 @@ apiInstance | Dashboards | @datadog/datadog-api-client-dashboards | [README.md](../../services/dashboards/README.md) | | Data Deletion | @datadog/datadog-api-client-data-deletion | [README.md](../../services/data-deletion/README.md) | | Datasets | @datadog/datadog-api-client-datasets | [README.md](../../services/datasets/README.md) | +| Deployment Gates | @datadog/datadog-api-client-deployment-gates | [README.md](../../services/deployment-gates/README.md) | | Domain Allowlist | @datadog/datadog-api-client-domain-allowlist | [README.md](../../services/domain-allowlist/README.md) | | DORA Metrics | @datadog/datadog-api-client-dora-metrics | [README.md](../../services/dora-metrics/README.md) | | Downtimes | @datadog/datadog-api-client-downtimes | [README.md](../../services/downtimes/README.md) | diff --git a/private/bdd_runner/src/support/scenarios_model_mapping.ts b/private/bdd_runner/src/support/scenarios_model_mapping.ts index 620124ad0974..a918b3e7a5c9 100644 --- a/private/bdd_runner/src/support/scenarios_model_mapping.ts +++ b/private/bdd_runner/src/support/scenarios_model_mapping.ts @@ -5323,6 +5323,86 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { }, operationResponseType: "CancelDataDeletionResponseBody", }, + "DeploymentGatesApi.V2.CreateDeploymentGate": { + body: { + type: "CreateDeploymentGateParams", + format: "", + }, + operationResponseType: "DeploymentGateResponse", + }, + "DeploymentGatesApi.V2.CreateDeploymentRule": { + gateId: { + type: "string", + format: "", + }, + body: { + type: "CreateDeploymentRuleParams", + format: "", + }, + operationResponseType: "DeploymentRuleResponse", + }, + "DeploymentGatesApi.V2.GetDeploymentRule": { + gateId: { + type: "string", + format: "", + }, + id: { + type: "string", + format: "", + }, + operationResponseType: "DeploymentRuleResponse", + }, + "DeploymentGatesApi.V2.UpdateDeploymentRule": { + gateId: { + type: "string", + format: "", + }, + id: { + type: "string", + format: "", + }, + body: { + type: "UpdateDeploymentRuleParams", + format: "", + }, + operationResponseType: "DeploymentRuleResponse", + }, + "DeploymentGatesApi.V2.DeleteDeploymentRule": { + gateId: { + type: "string", + format: "", + }, + id: { + type: "string", + format: "", + }, + operationResponseType: "{}", + }, + "DeploymentGatesApi.V2.GetDeploymentGate": { + id: { + type: "string", + format: "", + }, + operationResponseType: "DeploymentGateResponse", + }, + "DeploymentGatesApi.V2.UpdateDeploymentGate": { + id: { + type: "string", + format: "", + }, + body: { + type: "UpdateDeploymentGateParams", + format: "", + }, + operationResponseType: "DeploymentGateResponse", + }, + "DeploymentGatesApi.V2.DeleteDeploymentGate": { + id: { + type: "string", + format: "", + }, + operationResponseType: "{}", + }, "DomainAllowlistApi.V2.GetDomainAllowlist": { operationResponseType: "DomainAllowlistResponse", }, diff --git a/services/deployment_gates/.yarnrc.yml b/services/deployment_gates/.yarnrc.yml new file mode 100644 index 000000000000..3186f3f0795a --- /dev/null +++ b/services/deployment_gates/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/services/deployment_gates/README.md b/services/deployment_gates/README.md new file mode 100644 index 000000000000..944e352279c2 --- /dev/null +++ b/services/deployment_gates/README.md @@ -0,0 +1,44 @@ +# @datadog/datadog-api-client-deployment-gates + +## Description + +Manage Deployment Gates using this API to reduce the likelihood and impact of incidents caused by deployments. See the [Deployment Gates documentation](https://docs.datadoghq.com/deployment_gates/) for more information. + +## Navigation + +- [Installation](#installation) +- [Getting Started](#getting-started) + +## Installation + +```sh +# NPM +npm install @datadog/datadog-api-client-deployment-gates +# Yarn +yarn add @datadog/datadog-api-client-deployment-gates +``` + +## Getting Started +```ts +import { createConfiguration } from "@datadog/datadog-api-client"; +import { DeploymentGatesApiV2 } from "@datadog/datadog-api-client-deployment-gates"; +import { v2 } from "@datadog/datadog-api-client-deployment-gates"; + +const configuration = createConfiguration(); +// Enable unstable operations +const configurationOpts = { + unstableOperations: { + "DeploymentGatesApi.v2.createDeploymentGate": true + } +} + +const configuration = createConfiguration(configurationOpts); +const apiInstance = new DeploymentGatesApiV2(configuration); +const params = {/* parameters */}; + +apiInstance.createDeploymentGate(params).then((data) => { + console.log("API called successfully. Returned data: " + JSON.stringify(data)); +}).catch((error) => { + console.error("Error calling API: " + error); +}); +``` \ No newline at end of file diff --git a/services/deployment_gates/package.json b/services/deployment_gates/package.json new file mode 100644 index 000000000000..ea0644f405c6 --- /dev/null +++ b/services/deployment_gates/package.json @@ -0,0 +1,43 @@ +{ + "name": "@datadog/datadog-api-client-deployment-gates", + "description": "", + "author": "", + "keywords": [ + "api", + "fetch", + "typescript" + ], + "license": "Apache-2.0", + "licenses": [ + { + "type": "Apache-2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/DataDog/datadog-api-client-typescript.git", + "directory": "services/deployment-gates" + }, + "files": [ + "dist/**/*" + ], + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "scripts": { + "prepack": "yarn workspace @datadog/datadog-api-client build && yarn build", + "build": "yarn generate-version-files && tsc", + "generate-version-files": "node -p \"'export const version = ' + JSON.stringify(require('./package.json').version)\" > src/version.ts" + }, + "dependencies": { + "@datadog/datadog-api-client": "^2.0.0-beta.0" + }, + "devDependencies": { + "typescript": "5.8.3" + }, + "engines": { + "node": ">=18.0.0" + }, + "version": "0.0.1", + "packageManager": "yarn@4.9.1" +} diff --git a/services/deployment_gates/src/index.ts b/services/deployment_gates/src/index.ts new file mode 100644 index 000000000000..fc36af5a1e54 --- /dev/null +++ b/services/deployment_gates/src/index.ts @@ -0,0 +1,3 @@ +export * as v2 from "./v2"; + +export { DeploymentGatesApi as DeploymentGatesApiV2 } from "./v2/DeploymentGatesApi"; diff --git a/services/deployment_gates/src/v2/DeploymentGatesApi.ts b/services/deployment_gates/src/v2/DeploymentGatesApi.ts new file mode 100644 index 000000000000..7072e65499f8 --- /dev/null +++ b/services/deployment_gates/src/v2/DeploymentGatesApi.ts @@ -0,0 +1,1707 @@ +import { + ApiException, + BaseAPIRequestFactory, + BaseServerConfiguration, + buildUserAgent, + Configuration, + createConfiguration, + deserialize, + getPreferredMediaType, + HttpMethod, + isBrowser, + logger, + normalizeMediaType, + parse, + RequiredError, + RequestContext, + ResponseContext, + serialize, + ServerConfiguration, + stringify, + applySecurityAuthentication, +} from "@datadog/datadog-api-client"; + +import { TypingInfo } from "./models/TypingInfo"; +import { APIErrorResponse } from "./models/APIErrorResponse"; +import { CreateDeploymentGateParams } from "./models/CreateDeploymentGateParams"; +import { CreateDeploymentRuleParams } from "./models/CreateDeploymentRuleParams"; +import { DeploymentGateResponse } from "./models/DeploymentGateResponse"; +import { DeploymentRuleResponse } from "./models/DeploymentRuleResponse"; +import { HTTPCDGatesBadRequestResponse } from "./models/HTTPCDGatesBadRequestResponse"; +import { HTTPCDGatesNotFoundResponse } from "./models/HTTPCDGatesNotFoundResponse"; +import { HTTPCDRulesNotFoundResponse } from "./models/HTTPCDRulesNotFoundResponse"; +import { HTTPCIAppErrors } from "./models/HTTPCIAppErrors"; +import { UpdateDeploymentGateParams } from "./models/UpdateDeploymentGateParams"; +import { UpdateDeploymentRuleParams } from "./models/UpdateDeploymentRuleParams"; +import { version } from "../version"; + +export class DeploymentGatesApiRequestFactory extends BaseAPIRequestFactory { + public userAgent: string | undefined; + + public constructor(configuration: Configuration) { + super(configuration); + if (!isBrowser) { + this.userAgent = buildUserAgent("deployment-gates", version); + } + } + public async createDeploymentGate( + body: CreateDeploymentGateParams, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations["DeploymentGatesApi.v2.createDeploymentGate"] + ) { + throw new Error( + "Unstable operation 'createDeploymentGate' is disabled. Enable it by setting `configuration.unstableOperations['DeploymentGatesApi.v2.createDeploymentGate'] = true`", + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createDeploymentGate"); + } + + // Path Params + const localVarPath = "/api/v2/deployment_gates"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "DeploymentGatesApi.v2.createDeploymentGate", + DeploymentGatesApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.POST, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "CreateDeploymentGateParams", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async createDeploymentRule( + gateId: string, + body: CreateDeploymentRuleParams, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations["DeploymentGatesApi.v2.createDeploymentRule"] + ) { + throw new Error( + "Unstable operation 'createDeploymentRule' is disabled. Enable it by setting `configuration.unstableOperations['DeploymentGatesApi.v2.createDeploymentRule'] = true`", + ); + } + + // verify required parameter 'gateId' is not null or undefined + if (gateId === null || gateId === undefined) { + throw new RequiredError("gateId", "createDeploymentRule"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createDeploymentRule"); + } + + // Path Params + const localVarPath = "/api/v2/deployment_gates/{gate_id}/rules".replace( + "{gate_id}", + encodeURIComponent(String(gateId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "DeploymentGatesApi.v2.createDeploymentRule", + DeploymentGatesApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.POST, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "CreateDeploymentRuleParams", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async deleteDeploymentGate( + id: string, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations["DeploymentGatesApi.v2.deleteDeploymentGate"] + ) { + throw new Error( + "Unstable operation 'deleteDeploymentGate' is disabled. Enable it by setting `configuration.unstableOperations['DeploymentGatesApi.v2.deleteDeploymentGate'] = true`", + ); + } + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError("id", "deleteDeploymentGate"); + } + + // Path Params + const localVarPath = "/api/v2/deployment_gates/{id}".replace( + "{id}", + encodeURIComponent(String(id)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "DeploymentGatesApi.v2.deleteDeploymentGate", + DeploymentGatesApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.DELETE, + overrides, + ); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async deleteDeploymentRule( + gateId: string, + id: string, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations["DeploymentGatesApi.v2.deleteDeploymentRule"] + ) { + throw new Error( + "Unstable operation 'deleteDeploymentRule' is disabled. Enable it by setting `configuration.unstableOperations['DeploymentGatesApi.v2.deleteDeploymentRule'] = true`", + ); + } + + // verify required parameter 'gateId' is not null or undefined + if (gateId === null || gateId === undefined) { + throw new RequiredError("gateId", "deleteDeploymentRule"); + } + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError("id", "deleteDeploymentRule"); + } + + // Path Params + const localVarPath = "/api/v2/deployment_gates/{gate_id}/rules/{id}" + .replace("{gate_id}", encodeURIComponent(String(gateId))) + .replace("{id}", encodeURIComponent(String(id))); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "DeploymentGatesApi.v2.deleteDeploymentRule", + DeploymentGatesApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.DELETE, + overrides, + ); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async getDeploymentGate( + id: string, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations["DeploymentGatesApi.v2.getDeploymentGate"] + ) { + throw new Error( + "Unstable operation 'getDeploymentGate' is disabled. Enable it by setting `configuration.unstableOperations['DeploymentGatesApi.v2.getDeploymentGate'] = true`", + ); + } + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError("id", "getDeploymentGate"); + } + + // Path Params + const localVarPath = "/api/v2/deployment_gates/{id}".replace( + "{id}", + encodeURIComponent(String(id)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "DeploymentGatesApi.v2.getDeploymentGate", + DeploymentGatesApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.GET, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async getDeploymentRule( + gateId: string, + id: string, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations["DeploymentGatesApi.v2.getDeploymentRule"] + ) { + throw new Error( + "Unstable operation 'getDeploymentRule' is disabled. Enable it by setting `configuration.unstableOperations['DeploymentGatesApi.v2.getDeploymentRule'] = true`", + ); + } + + // verify required parameter 'gateId' is not null or undefined + if (gateId === null || gateId === undefined) { + throw new RequiredError("gateId", "getDeploymentRule"); + } + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError("id", "getDeploymentRule"); + } + + // Path Params + const localVarPath = "/api/v2/deployment_gates/{gate_id}/rules/{id}" + .replace("{gate_id}", encodeURIComponent(String(gateId))) + .replace("{id}", encodeURIComponent(String(id))); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "DeploymentGatesApi.v2.getDeploymentRule", + DeploymentGatesApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.GET, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async updateDeploymentGate( + id: string, + body: UpdateDeploymentGateParams, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations["DeploymentGatesApi.v2.updateDeploymentGate"] + ) { + throw new Error( + "Unstable operation 'updateDeploymentGate' is disabled. Enable it by setting `configuration.unstableOperations['DeploymentGatesApi.v2.updateDeploymentGate'] = true`", + ); + } + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError("id", "updateDeploymentGate"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "updateDeploymentGate"); + } + + // Path Params + const localVarPath = "/api/v2/deployment_gates/{id}".replace( + "{id}", + encodeURIComponent(String(id)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "DeploymentGatesApi.v2.updateDeploymentGate", + DeploymentGatesApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.PUT, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "UpdateDeploymentGateParams", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async updateDeploymentRule( + gateId: string, + id: string, + body: UpdateDeploymentRuleParams, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations["DeploymentGatesApi.v2.updateDeploymentRule"] + ) { + throw new Error( + "Unstable operation 'updateDeploymentRule' is disabled. Enable it by setting `configuration.unstableOperations['DeploymentGatesApi.v2.updateDeploymentRule'] = true`", + ); + } + + // verify required parameter 'gateId' is not null or undefined + if (gateId === null || gateId === undefined) { + throw new RequiredError("gateId", "updateDeploymentRule"); + } + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError("id", "updateDeploymentRule"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "updateDeploymentRule"); + } + + // Path Params + const localVarPath = "/api/v2/deployment_gates/{gate_id}/rules/{id}" + .replace("{gate_id}", encodeURIComponent(String(gateId))) + .replace("{id}", encodeURIComponent(String(id))); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "DeploymentGatesApi.v2.updateDeploymentRule", + DeploymentGatesApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.PUT, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "UpdateDeploymentRuleParams", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } +} + +export class DeploymentGatesApiResponseProcessor { + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createDeploymentGate + * @throws ApiException if the response code was not in [200, 299] + */ + public async createDeploymentGate( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: DeploymentGateResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "DeploymentGateResponse", + ) as DeploymentGateResponse; + return body; + } + if (response.httpStatusCode === 400) { + const bodyText = parse(await response.body.text(), contentType); + let body: HTTPCDGatesBadRequestResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "HTTPCDGatesBadRequestResponse", + ) as HTTPCDGatesBadRequestResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException( + response.httpStatusCode, + body, + ); + } + if ( + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + if (response.httpStatusCode === 500) { + const bodyText = parse(await response.body.text(), contentType); + let body: HTTPCIAppErrors; + try { + body = deserialize( + bodyText, + TypingInfo, + "HTTPCIAppErrors", + ) as HTTPCIAppErrors; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: DeploymentGateResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "DeploymentGateResponse", + "", + ) as DeploymentGateResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createDeploymentRule + * @throws ApiException if the response code was not in [200, 299] + */ + public async createDeploymentRule( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: DeploymentRuleResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "DeploymentRuleResponse", + ) as DeploymentRuleResponse; + return body; + } + if (response.httpStatusCode === 400) { + const bodyText = parse(await response.body.text(), contentType); + let body: HTTPCDGatesBadRequestResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "HTTPCDGatesBadRequestResponse", + ) as HTTPCDGatesBadRequestResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException( + response.httpStatusCode, + body, + ); + } + if ( + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + if (response.httpStatusCode === 500) { + const bodyText = parse(await response.body.text(), contentType); + let body: HTTPCIAppErrors; + try { + body = deserialize( + bodyText, + TypingInfo, + "HTTPCIAppErrors", + ) as HTTPCIAppErrors; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: DeploymentRuleResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "DeploymentRuleResponse", + "", + ) as DeploymentRuleResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteDeploymentGate + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteDeploymentGate(response: ResponseContext): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 204) { + return; + } + if (response.httpStatusCode === 400) { + const bodyText = parse(await response.body.text(), contentType); + let body: HTTPCDGatesBadRequestResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "HTTPCDGatesBadRequestResponse", + ) as HTTPCDGatesBadRequestResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException( + response.httpStatusCode, + body, + ); + } + if ( + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + if (response.httpStatusCode === 404) { + const bodyText = parse(await response.body.text(), contentType); + let body: HTTPCDGatesNotFoundResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "HTTPCDGatesNotFoundResponse", + ) as HTTPCDGatesNotFoundResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException( + response.httpStatusCode, + body, + ); + } + if (response.httpStatusCode === 500) { + const bodyText = parse(await response.body.text(), contentType); + let body: HTTPCIAppErrors; + try { + body = deserialize( + bodyText, + TypingInfo, + "HTTPCIAppErrors", + ) as HTTPCIAppErrors; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + return; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteDeploymentRule + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteDeploymentRule(response: ResponseContext): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 204) { + return; + } + if (response.httpStatusCode === 400) { + const bodyText = parse(await response.body.text(), contentType); + let body: HTTPCDGatesBadRequestResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "HTTPCDGatesBadRequestResponse", + ) as HTTPCDGatesBadRequestResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException( + response.httpStatusCode, + body, + ); + } + if ( + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + if (response.httpStatusCode === 404) { + const bodyText = parse(await response.body.text(), contentType); + let body: HTTPCDGatesNotFoundResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "HTTPCDGatesNotFoundResponse", + ) as HTTPCDGatesNotFoundResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException( + response.httpStatusCode, + body, + ); + } + if (response.httpStatusCode === 500) { + const bodyText = parse(await response.body.text(), contentType); + let body: HTTPCIAppErrors; + try { + body = deserialize( + bodyText, + TypingInfo, + "HTTPCIAppErrors", + ) as HTTPCIAppErrors; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + return; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getDeploymentGate + * @throws ApiException if the response code was not in [200, 299] + */ + public async getDeploymentGate( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: DeploymentGateResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "DeploymentGateResponse", + ) as DeploymentGateResponse; + return body; + } + if (response.httpStatusCode === 400) { + const bodyText = parse(await response.body.text(), contentType); + let body: HTTPCDGatesBadRequestResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "HTTPCDGatesBadRequestResponse", + ) as HTTPCDGatesBadRequestResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException( + response.httpStatusCode, + body, + ); + } + if ( + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + if (response.httpStatusCode === 404) { + const bodyText = parse(await response.body.text(), contentType); + let body: HTTPCDGatesNotFoundResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "HTTPCDGatesNotFoundResponse", + ) as HTTPCDGatesNotFoundResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException( + response.httpStatusCode, + body, + ); + } + if (response.httpStatusCode === 500) { + const bodyText = parse(await response.body.text(), contentType); + let body: HTTPCIAppErrors; + try { + body = deserialize( + bodyText, + TypingInfo, + "HTTPCIAppErrors", + ) as HTTPCIAppErrors; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: DeploymentGateResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "DeploymentGateResponse", + "", + ) as DeploymentGateResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getDeploymentRule + * @throws ApiException if the response code was not in [200, 299] + */ + public async getDeploymentRule( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: DeploymentRuleResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "DeploymentRuleResponse", + ) as DeploymentRuleResponse; + return body; + } + if (response.httpStatusCode === 400) { + const bodyText = parse(await response.body.text(), contentType); + let body: HTTPCDGatesBadRequestResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "HTTPCDGatesBadRequestResponse", + ) as HTTPCDGatesBadRequestResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException( + response.httpStatusCode, + body, + ); + } + if ( + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + if (response.httpStatusCode === 404) { + const bodyText = parse(await response.body.text(), contentType); + let body: HTTPCDRulesNotFoundResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "HTTPCDRulesNotFoundResponse", + ) as HTTPCDRulesNotFoundResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException( + response.httpStatusCode, + body, + ); + } + if (response.httpStatusCode === 500) { + const bodyText = parse(await response.body.text(), contentType); + let body: HTTPCIAppErrors; + try { + body = deserialize( + bodyText, + TypingInfo, + "HTTPCIAppErrors", + ) as HTTPCIAppErrors; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: DeploymentRuleResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "DeploymentRuleResponse", + "", + ) as DeploymentRuleResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to updateDeploymentGate + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateDeploymentGate( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: DeploymentGateResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "DeploymentGateResponse", + ) as DeploymentGateResponse; + return body; + } + if (response.httpStatusCode === 400) { + const bodyText = parse(await response.body.text(), contentType); + let body: HTTPCDGatesBadRequestResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "HTTPCDGatesBadRequestResponse", + ) as HTTPCDGatesBadRequestResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException( + response.httpStatusCode, + body, + ); + } + if ( + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + if (response.httpStatusCode === 404) { + const bodyText = parse(await response.body.text(), contentType); + let body: HTTPCDGatesNotFoundResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "HTTPCDGatesNotFoundResponse", + ) as HTTPCDGatesNotFoundResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException( + response.httpStatusCode, + body, + ); + } + if (response.httpStatusCode === 500) { + const bodyText = parse(await response.body.text(), contentType); + let body: HTTPCIAppErrors; + try { + body = deserialize( + bodyText, + TypingInfo, + "HTTPCIAppErrors", + ) as HTTPCIAppErrors; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: DeploymentGateResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "DeploymentGateResponse", + "", + ) as DeploymentGateResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to updateDeploymentRule + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateDeploymentRule( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: DeploymentRuleResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "DeploymentRuleResponse", + ) as DeploymentRuleResponse; + return body; + } + if (response.httpStatusCode === 400) { + const bodyText = parse(await response.body.text(), contentType); + let body: HTTPCDGatesBadRequestResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "HTTPCDGatesBadRequestResponse", + ) as HTTPCDGatesBadRequestResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException( + response.httpStatusCode, + body, + ); + } + if ( + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + if (response.httpStatusCode === 404) { + const bodyText = parse(await response.body.text(), contentType); + let body: HTTPCDRulesNotFoundResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "HTTPCDRulesNotFoundResponse", + ) as HTTPCDRulesNotFoundResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException( + response.httpStatusCode, + body, + ); + } + if (response.httpStatusCode === 500) { + const bodyText = parse(await response.body.text(), contentType); + let body: HTTPCIAppErrors; + try { + body = deserialize( + bodyText, + TypingInfo, + "HTTPCIAppErrors", + ) as HTTPCIAppErrors; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: DeploymentRuleResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "DeploymentRuleResponse", + "", + ) as DeploymentRuleResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } +} + +export interface DeploymentGatesApiCreateDeploymentGateRequest { + /** + * @type CreateDeploymentGateParams + */ + body: CreateDeploymentGateParams; +} + +export interface DeploymentGatesApiCreateDeploymentRuleRequest { + /** + * The ID of the deployment gate. + * @type string + */ + gateId: string; + /** + * @type CreateDeploymentRuleParams + */ + body: CreateDeploymentRuleParams; +} + +export interface DeploymentGatesApiDeleteDeploymentGateRequest { + /** + * The ID of the deployment gate. + * @type string + */ + id: string; +} + +export interface DeploymentGatesApiDeleteDeploymentRuleRequest { + /** + * The ID of the deployment gate. + * @type string + */ + gateId: string; + /** + * The ID of the deployment rule. + * @type string + */ + id: string; +} + +export interface DeploymentGatesApiGetDeploymentGateRequest { + /** + * The ID of the deployment gate. + * @type string + */ + id: string; +} + +export interface DeploymentGatesApiGetDeploymentRuleRequest { + /** + * The ID of the deployment gate. + * @type string + */ + gateId: string; + /** + * The ID of the deployment rule. + * @type string + */ + id: string; +} + +export interface DeploymentGatesApiUpdateDeploymentGateRequest { + /** + * The ID of the deployment gate. + * @type string + */ + id: string; + /** + * @type UpdateDeploymentGateParams + */ + body: UpdateDeploymentGateParams; +} + +export interface DeploymentGatesApiUpdateDeploymentRuleRequest { + /** + * The ID of the deployment gate. + * @type string + */ + gateId: string; + /** + * The ID of the deployment rule. + * @type string + */ + id: string; + /** + * @type UpdateDeploymentRuleParams + */ + body: UpdateDeploymentRuleParams; +} + +export class DeploymentGatesApi { + private requestFactory: DeploymentGatesApiRequestFactory; + private responseProcessor: DeploymentGatesApiResponseProcessor; + private configuration: Configuration; + + static operationServers: { [key: string]: BaseServerConfiguration[] } = {}; + + public constructor( + configuration?: Configuration, + requestFactory?: DeploymentGatesApiRequestFactory, + responseProcessor?: DeploymentGatesApiResponseProcessor, + ) { + this.configuration = configuration || createConfiguration(); + this.requestFactory = + requestFactory || + new DeploymentGatesApiRequestFactory(this.configuration); + this.responseProcessor = + responseProcessor || new DeploymentGatesApiResponseProcessor(); + } + + /** + * Endpoint to create a deployment gate. + * @param param The request object + */ + public createDeploymentGate( + param: DeploymentGatesApiCreateDeploymentGateRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.createDeploymentGate( + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createDeploymentGate(responseContext); + }); + }); + } + + /** + * Endpoint to create a deployment rule. A gate for the rule must already exist. + * @param param The request object + */ + public createDeploymentRule( + param: DeploymentGatesApiCreateDeploymentRuleRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.createDeploymentRule( + param.gateId, + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createDeploymentRule(responseContext); + }); + }); + } + + /** + * Endpoint to delete a deployment gate. Rules associated with the gate are also deleted. + * @param param The request object + */ + public deleteDeploymentGate( + param: DeploymentGatesApiDeleteDeploymentGateRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.deleteDeploymentGate( + param.id, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteDeploymentGate(responseContext); + }); + }); + } + + /** + * Endpoint to delete a deployment rule. + * @param param The request object + */ + public deleteDeploymentRule( + param: DeploymentGatesApiDeleteDeploymentRuleRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.deleteDeploymentRule( + param.gateId, + param.id, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteDeploymentRule(responseContext); + }); + }); + } + + /** + * Endpoint to get a deployment gate. + * @param param The request object + */ + public getDeploymentGate( + param: DeploymentGatesApiGetDeploymentGateRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.getDeploymentGate( + param.id, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getDeploymentGate(responseContext); + }); + }); + } + + /** + * Endpoint to get a deployment rule. + * @param param The request object + */ + public getDeploymentRule( + param: DeploymentGatesApiGetDeploymentRuleRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.getDeploymentRule( + param.gateId, + param.id, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getDeploymentRule(responseContext); + }); + }); + } + + /** + * Endpoint to update a deployment gate. + * @param param The request object + */ + public updateDeploymentGate( + param: DeploymentGatesApiUpdateDeploymentGateRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.updateDeploymentGate( + param.id, + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.updateDeploymentGate(responseContext); + }); + }); + } + + /** + * Endpoint to update a deployment rule. + * @param param The request object + */ + public updateDeploymentRule( + param: DeploymentGatesApiUpdateDeploymentRuleRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.updateDeploymentRule( + param.gateId, + param.id, + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.updateDeploymentRule(responseContext); + }); + }); + } +} diff --git a/services/deployment_gates/src/v2/index.ts b/services/deployment_gates/src/v2/index.ts new file mode 100644 index 000000000000..39795012091b --- /dev/null +++ b/services/deployment_gates/src/v2/index.ts @@ -0,0 +1,46 @@ +export { + DeploymentGatesApiCreateDeploymentGateRequest, + DeploymentGatesApiCreateDeploymentRuleRequest, + DeploymentGatesApiDeleteDeploymentGateRequest, + DeploymentGatesApiDeleteDeploymentRuleRequest, + DeploymentGatesApiGetDeploymentGateRequest, + DeploymentGatesApiGetDeploymentRuleRequest, + DeploymentGatesApiUpdateDeploymentGateRequest, + DeploymentGatesApiUpdateDeploymentRuleRequest, + DeploymentGatesApi, +} from "./DeploymentGatesApi"; + +export { APIErrorResponse } from "./models/APIErrorResponse"; +export { CreateDeploymentGateParams } from "./models/CreateDeploymentGateParams"; +export { CreateDeploymentGateParamsData } from "./models/CreateDeploymentGateParamsData"; +export { CreateDeploymentGateParamsDataAttributes } from "./models/CreateDeploymentGateParamsDataAttributes"; +export { CreateDeploymentRuleParams } from "./models/CreateDeploymentRuleParams"; +export { CreateDeploymentRuleParamsData } from "./models/CreateDeploymentRuleParamsData"; +export { CreateDeploymentRuleParamsDataAttributes } from "./models/CreateDeploymentRuleParamsDataAttributes"; +export { DeploymentGateDataType } from "./models/DeploymentGateDataType"; +export { DeploymentGateResponse } from "./models/DeploymentGateResponse"; +export { DeploymentGateResponseData } from "./models/DeploymentGateResponseData"; +export { DeploymentGateResponseDataAttributes } from "./models/DeploymentGateResponseDataAttributes"; +export { DeploymentGateResponseDataAttributesCreatedBy } from "./models/DeploymentGateResponseDataAttributesCreatedBy"; +export { DeploymentGateResponseDataAttributesUpdatedBy } from "./models/DeploymentGateResponseDataAttributesUpdatedBy"; +export { DeploymentRuleDataType } from "./models/DeploymentRuleDataType"; +export { DeploymentRuleOptionsFaultyDeploymentDetection } from "./models/DeploymentRuleOptionsFaultyDeploymentDetection"; +export { DeploymentRuleOptionsMonitor } from "./models/DeploymentRuleOptionsMonitor"; +export { DeploymentRuleResponse } from "./models/DeploymentRuleResponse"; +export { DeploymentRuleResponseData } from "./models/DeploymentRuleResponseData"; +export { DeploymentRuleResponseDataAttributes } from "./models/DeploymentRuleResponseDataAttributes"; +export { DeploymentRuleResponseDataAttributesCreatedBy } from "./models/DeploymentRuleResponseDataAttributesCreatedBy"; +export { DeploymentRuleResponseDataAttributesType } from "./models/DeploymentRuleResponseDataAttributesType"; +export { DeploymentRuleResponseDataAttributesUpdatedBy } from "./models/DeploymentRuleResponseDataAttributesUpdatedBy"; +export { DeploymentRulesOptions } from "./models/DeploymentRulesOptions"; +export { HTTPCDGatesBadRequestResponse } from "./models/HTTPCDGatesBadRequestResponse"; +export { HTTPCDGatesNotFoundResponse } from "./models/HTTPCDGatesNotFoundResponse"; +export { HTTPCDRulesNotFoundResponse } from "./models/HTTPCDRulesNotFoundResponse"; +export { HTTPCIAppError } from "./models/HTTPCIAppError"; +export { HTTPCIAppErrors } from "./models/HTTPCIAppErrors"; +export { UpdateDeploymentGateParams } from "./models/UpdateDeploymentGateParams"; +export { UpdateDeploymentGateParamsData } from "./models/UpdateDeploymentGateParamsData"; +export { UpdateDeploymentGateParamsDataAttributes } from "./models/UpdateDeploymentGateParamsDataAttributes"; +export { UpdateDeploymentRuleParams } from "./models/UpdateDeploymentRuleParams"; +export { UpdateDeploymentRuleParamsData } from "./models/UpdateDeploymentRuleParamsData"; +export { UpdateDeploymentRuleParamsDataAttributes } from "./models/UpdateDeploymentRuleParamsDataAttributes"; diff --git a/services/deployment_gates/src/v2/models/APIErrorResponse.ts b/services/deployment_gates/src/v2/models/APIErrorResponse.ts new file mode 100644 index 000000000000..58d6c35b80f0 --- /dev/null +++ b/services/deployment_gates/src/v2/models/APIErrorResponse.ts @@ -0,0 +1,45 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * API error response. + */ +export class APIErrorResponse { + /** + * A list of errors. + */ + "errors": Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + errors: { + baseName: "errors", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return APIErrorResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/CreateDeploymentGateParams.ts b/services/deployment_gates/src/v2/models/CreateDeploymentGateParams.ts new file mode 100644 index 000000000000..027a4b36e785 --- /dev/null +++ b/services/deployment_gates/src/v2/models/CreateDeploymentGateParams.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { CreateDeploymentGateParamsData } from "./CreateDeploymentGateParamsData"; + +/** + * Parameters for creating a deployment gate. + */ +export class CreateDeploymentGateParams { + /** + * Parameters for creating a deployment gate. + */ + "data": CreateDeploymentGateParamsData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "CreateDeploymentGateParamsData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CreateDeploymentGateParams.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/CreateDeploymentGateParamsData.ts b/services/deployment_gates/src/v2/models/CreateDeploymentGateParamsData.ts new file mode 100644 index 000000000000..4432f77c8885 --- /dev/null +++ b/services/deployment_gates/src/v2/models/CreateDeploymentGateParamsData.ts @@ -0,0 +1,57 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { CreateDeploymentGateParamsDataAttributes } from "./CreateDeploymentGateParamsDataAttributes"; +import { DeploymentGateDataType } from "./DeploymentGateDataType"; + +/** + * Parameters for creating a deployment gate. + */ +export class CreateDeploymentGateParamsData { + /** + * Parameters for creating a deployment gate. + */ + "attributes": CreateDeploymentGateParamsDataAttributes; + /** + * Deployment gate resource type. + */ + "type": DeploymentGateDataType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "CreateDeploymentGateParamsDataAttributes", + required: true, + }, + type: { + baseName: "type", + type: "DeploymentGateDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CreateDeploymentGateParamsData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/CreateDeploymentGateParamsDataAttributes.ts b/services/deployment_gates/src/v2/models/CreateDeploymentGateParamsDataAttributes.ts new file mode 100644 index 000000000000..f46a5a8c6eb9 --- /dev/null +++ b/services/deployment_gates/src/v2/models/CreateDeploymentGateParamsDataAttributes.ts @@ -0,0 +1,70 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Parameters for creating a deployment gate. + */ +export class CreateDeploymentGateParamsDataAttributes { + /** + * Whether this gate is run in dry-run mode. + */ + "dryRun"?: boolean; + /** + * The environment of the deployment gate. + */ + "env": string; + /** + * The identifier of the deployment gate. + */ + "identifier"?: string; + /** + * The service of the deployment gate. + */ + "service": string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + dryRun: { + baseName: "dry_run", + type: "boolean", + }, + env: { + baseName: "env", + type: "string", + required: true, + }, + identifier: { + baseName: "identifier", + type: "string", + }, + service: { + baseName: "service", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CreateDeploymentGateParamsDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/CreateDeploymentRuleParams.ts b/services/deployment_gates/src/v2/models/CreateDeploymentRuleParams.ts new file mode 100644 index 000000000000..5f33f9ab5a85 --- /dev/null +++ b/services/deployment_gates/src/v2/models/CreateDeploymentRuleParams.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { CreateDeploymentRuleParamsData } from "./CreateDeploymentRuleParamsData"; + +/** + * Parameters for creating a deployment rule. + */ +export class CreateDeploymentRuleParams { + /** + * Parameters for creating a deployment rule. + */ + "data"?: CreateDeploymentRuleParamsData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "CreateDeploymentRuleParamsData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CreateDeploymentRuleParams.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/CreateDeploymentRuleParamsData.ts b/services/deployment_gates/src/v2/models/CreateDeploymentRuleParamsData.ts new file mode 100644 index 000000000000..089f69cb37c0 --- /dev/null +++ b/services/deployment_gates/src/v2/models/CreateDeploymentRuleParamsData.ts @@ -0,0 +1,57 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { CreateDeploymentRuleParamsDataAttributes } from "./CreateDeploymentRuleParamsDataAttributes"; +import { DeploymentRuleDataType } from "./DeploymentRuleDataType"; + +/** + * Parameters for creating a deployment rule. + */ +export class CreateDeploymentRuleParamsData { + /** + * Parameters for creating a deployment rule. + */ + "attributes": CreateDeploymentRuleParamsDataAttributes; + /** + * Deployment rule resource type. + */ + "type": DeploymentRuleDataType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "CreateDeploymentRuleParamsDataAttributes", + required: true, + }, + type: { + baseName: "type", + type: "DeploymentRuleDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CreateDeploymentRuleParamsData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/CreateDeploymentRuleParamsDataAttributes.ts b/services/deployment_gates/src/v2/models/CreateDeploymentRuleParamsDataAttributes.ts new file mode 100644 index 000000000000..1bc9e12cb87f --- /dev/null +++ b/services/deployment_gates/src/v2/models/CreateDeploymentRuleParamsDataAttributes.ts @@ -0,0 +1,73 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { DeploymentRulesOptions } from "./DeploymentRulesOptions"; + +/** + * Parameters for creating a deployment rule. + */ +export class CreateDeploymentRuleParamsDataAttributes { + /** + * Whether this rule is run in dry-run mode. + */ + "dryRun"?: boolean; + /** + * The name of the deployment rule. + */ + "name": string; + /** + * Options for deployment rule response representing either faulty deployment detection or monitor options. + */ + "options": DeploymentRulesOptions; + /** + * The type of the deployment rule (faulty_deployment_detection or monitor). + */ + "type": string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + dryRun: { + baseName: "dry_run", + type: "boolean", + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + options: { + baseName: "options", + type: "DeploymentRulesOptions", + required: true, + }, + type: { + baseName: "type", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CreateDeploymentRuleParamsDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/DeploymentGateDataType.ts b/services/deployment_gates/src/v2/models/DeploymentGateDataType.ts new file mode 100644 index 000000000000..50b47c36fdbf --- /dev/null +++ b/services/deployment_gates/src/v2/models/DeploymentGateDataType.ts @@ -0,0 +1,7 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Deployment gate resource type. + */ +export type DeploymentGateDataType = typeof DEPLOYMENT_GATE | UnparsedObject; +export const DEPLOYMENT_GATE = "deployment_gate"; diff --git a/services/deployment_gates/src/v2/models/DeploymentGateResponse.ts b/services/deployment_gates/src/v2/models/DeploymentGateResponse.ts new file mode 100644 index 000000000000..8a6162204e5a --- /dev/null +++ b/services/deployment_gates/src/v2/models/DeploymentGateResponse.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { DeploymentGateResponseData } from "./DeploymentGateResponseData"; + +/** + * Response for a deployment gate. + */ +export class DeploymentGateResponse { + /** + * Data for a deployment gate. + */ + "data"?: DeploymentGateResponseData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "DeploymentGateResponseData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DeploymentGateResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/DeploymentGateResponseData.ts b/services/deployment_gates/src/v2/models/DeploymentGateResponseData.ts new file mode 100644 index 000000000000..4aff520d3d21 --- /dev/null +++ b/services/deployment_gates/src/v2/models/DeploymentGateResponseData.ts @@ -0,0 +1,66 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { DeploymentGateDataType } from "./DeploymentGateDataType"; +import { DeploymentGateResponseDataAttributes } from "./DeploymentGateResponseDataAttributes"; + +/** + * Data for a deployment gate. + */ +export class DeploymentGateResponseData { + /** + * Basic information about a deployment gate. + */ + "attributes": DeploymentGateResponseDataAttributes; + /** + * Unique identifier of the deployment gate. + */ + "id": string; + /** + * Deployment gate resource type. + */ + "type": DeploymentGateDataType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "DeploymentGateResponseDataAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "DeploymentGateDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DeploymentGateResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/DeploymentGateResponseDataAttributes.ts b/services/deployment_gates/src/v2/models/DeploymentGateResponseDataAttributes.ts new file mode 100644 index 000000000000..e8a8bc7a24f6 --- /dev/null +++ b/services/deployment_gates/src/v2/models/DeploymentGateResponseDataAttributes.ts @@ -0,0 +1,111 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { DeploymentGateResponseDataAttributesCreatedBy } from "./DeploymentGateResponseDataAttributesCreatedBy"; +import { DeploymentGateResponseDataAttributesUpdatedBy } from "./DeploymentGateResponseDataAttributesUpdatedBy"; + +/** + * Basic information about a deployment gate. + */ +export class DeploymentGateResponseDataAttributes { + /** + * The timestamp when the deployment gate was created. + */ + "createdAt": Date; + /** + * Information about the user who created the deployment gate. + */ + "createdBy": DeploymentGateResponseDataAttributesCreatedBy; + /** + * Whether this gate is run in dry-run mode. + */ + "dryRun": boolean; + /** + * The environment of the deployment gate. + */ + "env": string; + /** + * The identifier of the deployment gate. + */ + "identifier": string; + /** + * The service of the deployment gate. + */ + "service": string; + /** + * The timestamp when the deployment gate was last updated. + */ + "updatedAt"?: Date; + /** + * Information about the user who updated the deployment gate. + */ + "updatedBy"?: DeploymentGateResponseDataAttributesUpdatedBy; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + createdAt: { + baseName: "created_at", + type: "Date", + required: true, + format: "date-time", + }, + createdBy: { + baseName: "created_by", + type: "DeploymentGateResponseDataAttributesCreatedBy", + required: true, + }, + dryRun: { + baseName: "dry_run", + type: "boolean", + required: true, + }, + env: { + baseName: "env", + type: "string", + required: true, + }, + identifier: { + baseName: "identifier", + type: "string", + required: true, + }, + service: { + baseName: "service", + type: "string", + required: true, + }, + updatedAt: { + baseName: "updated_at", + type: "Date", + format: "date-time", + }, + updatedBy: { + baseName: "updated_by", + type: "DeploymentGateResponseDataAttributesUpdatedBy", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DeploymentGateResponseDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/DeploymentGateResponseDataAttributesCreatedBy.ts b/services/deployment_gates/src/v2/models/DeploymentGateResponseDataAttributesCreatedBy.ts new file mode 100644 index 000000000000..c9a4ad08c3e5 --- /dev/null +++ b/services/deployment_gates/src/v2/models/DeploymentGateResponseDataAttributesCreatedBy.ts @@ -0,0 +1,61 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Information about the user who created the deployment gate. + */ +export class DeploymentGateResponseDataAttributesCreatedBy { + /** + * The handle of the user who created the deployment rule. + */ + "handle"?: string; + /** + * The ID of the user who created the deployment rule. + */ + "id": string; + /** + * The name of the user who created the deployment rule. + */ + "name"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + handle: { + baseName: "handle", + type: "string", + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + name: { + baseName: "name", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DeploymentGateResponseDataAttributesCreatedBy.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/DeploymentGateResponseDataAttributesUpdatedBy.ts b/services/deployment_gates/src/v2/models/DeploymentGateResponseDataAttributesUpdatedBy.ts new file mode 100644 index 000000000000..4d743c18254d --- /dev/null +++ b/services/deployment_gates/src/v2/models/DeploymentGateResponseDataAttributesUpdatedBy.ts @@ -0,0 +1,61 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Information about the user who updated the deployment gate. + */ +export class DeploymentGateResponseDataAttributesUpdatedBy { + /** + * The handle of the user who updated the deployment rule. + */ + "handle"?: string; + /** + * The ID of the user who updated the deployment rule. + */ + "id": string; + /** + * The name of the user who updated the deployment rule. + */ + "name"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + handle: { + baseName: "handle", + type: "string", + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + name: { + baseName: "name", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DeploymentGateResponseDataAttributesUpdatedBy.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/DeploymentRuleDataType.ts b/services/deployment_gates/src/v2/models/DeploymentRuleDataType.ts new file mode 100644 index 000000000000..a81d1521f987 --- /dev/null +++ b/services/deployment_gates/src/v2/models/DeploymentRuleDataType.ts @@ -0,0 +1,7 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Deployment rule resource type. + */ +export type DeploymentRuleDataType = typeof DEPLOYMENT_RULE | UnparsedObject; +export const DEPLOYMENT_RULE = "deployment_rule"; diff --git a/services/deployment_gates/src/v2/models/DeploymentRuleOptionsFaultyDeploymentDetection.ts b/services/deployment_gates/src/v2/models/DeploymentRuleOptionsFaultyDeploymentDetection.ts new file mode 100644 index 000000000000..eb77a69cb734 --- /dev/null +++ b/services/deployment_gates/src/v2/models/DeploymentRuleOptionsFaultyDeploymentDetection.ts @@ -0,0 +1,43 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Faulty deployment detection options for deployment rules. + */ +export class DeploymentRuleOptionsFaultyDeploymentDetection { + /** + * The duration for faulty deployment detection. + */ + "duration"?: number; + /** + * Resources to exclude from faulty deployment detection. + */ + "excludedResources"?: Array; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + duration: { + baseName: "duration", + type: "number", + format: "int64", + }, + excludedResources: { + baseName: "excluded_resources", + type: "Array", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DeploymentRuleOptionsFaultyDeploymentDetection.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/DeploymentRuleOptionsMonitor.ts b/services/deployment_gates/src/v2/models/DeploymentRuleOptionsMonitor.ts new file mode 100644 index 000000000000..b4942971055f --- /dev/null +++ b/services/deployment_gates/src/v2/models/DeploymentRuleOptionsMonitor.ts @@ -0,0 +1,44 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Monitor options for deployment rules. + */ +export class DeploymentRuleOptionsMonitor { + /** + * Seconds the monitor needs to stay in OK status for the rule to pass. + */ + "duration"?: number; + /** + * Monitors that match this query are evaluated. + */ + "query": string; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + duration: { + baseName: "duration", + type: "number", + format: "int64", + }, + query: { + baseName: "query", + type: "string", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DeploymentRuleOptionsMonitor.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/DeploymentRuleResponse.ts b/services/deployment_gates/src/v2/models/DeploymentRuleResponse.ts new file mode 100644 index 000000000000..392c0f9631dc --- /dev/null +++ b/services/deployment_gates/src/v2/models/DeploymentRuleResponse.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { DeploymentRuleResponseData } from "./DeploymentRuleResponseData"; + +/** + * Response for a deployment rule. + */ +export class DeploymentRuleResponse { + /** + * Data for a deployment rule. + */ + "data"?: DeploymentRuleResponseData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "DeploymentRuleResponseData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DeploymentRuleResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/DeploymentRuleResponseData.ts b/services/deployment_gates/src/v2/models/DeploymentRuleResponseData.ts new file mode 100644 index 000000000000..92c3bd907354 --- /dev/null +++ b/services/deployment_gates/src/v2/models/DeploymentRuleResponseData.ts @@ -0,0 +1,66 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { DeploymentRuleDataType } from "./DeploymentRuleDataType"; +import { DeploymentRuleResponseDataAttributes } from "./DeploymentRuleResponseDataAttributes"; + +/** + * Data for a deployment rule. + */ +export class DeploymentRuleResponseData { + /** + * Basic information about a deployment rule. + */ + "attributes": DeploymentRuleResponseDataAttributes; + /** + * Unique identifier of the deployment rule. + */ + "id": string; + /** + * Deployment rule resource type. + */ + "type": DeploymentRuleDataType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "DeploymentRuleResponseDataAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "DeploymentRuleDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DeploymentRuleResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/DeploymentRuleResponseDataAttributes.ts b/services/deployment_gates/src/v2/models/DeploymentRuleResponseDataAttributes.ts new file mode 100644 index 000000000000..1f71608bd69f --- /dev/null +++ b/services/deployment_gates/src/v2/models/DeploymentRuleResponseDataAttributes.ts @@ -0,0 +1,122 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { DeploymentRuleResponseDataAttributesCreatedBy } from "./DeploymentRuleResponseDataAttributesCreatedBy"; +import { DeploymentRuleResponseDataAttributesType } from "./DeploymentRuleResponseDataAttributesType"; +import { DeploymentRuleResponseDataAttributesUpdatedBy } from "./DeploymentRuleResponseDataAttributesUpdatedBy"; +import { DeploymentRulesOptions } from "./DeploymentRulesOptions"; + +/** + * Basic information about a deployment rule. + */ +export class DeploymentRuleResponseDataAttributes { + /** + * The timestamp when the deployment rule was created. + */ + "createdAt": Date; + /** + * Information about the user who created the deployment rule. + */ + "createdBy": DeploymentRuleResponseDataAttributesCreatedBy; + /** + * Whether this rule is run in dry-run mode. + */ + "dryRun": boolean; + /** + * The ID of the deployment gate. + */ + "gateId": string; + /** + * The name of the deployment rule. + */ + "name": string; + /** + * Options for deployment rule response representing either faulty deployment detection or monitor options. + */ + "options": DeploymentRulesOptions; + /** + * The type of the deployment rule. + */ + "type": DeploymentRuleResponseDataAttributesType; + /** + * The timestamp when the deployment rule was last updated. + */ + "updatedAt"?: Date; + /** + * Information about the user who updated the deployment rule. + */ + "updatedBy"?: DeploymentRuleResponseDataAttributesUpdatedBy; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + createdAt: { + baseName: "created_at", + type: "Date", + required: true, + format: "date-time", + }, + createdBy: { + baseName: "created_by", + type: "DeploymentRuleResponseDataAttributesCreatedBy", + required: true, + }, + dryRun: { + baseName: "dry_run", + type: "boolean", + required: true, + }, + gateId: { + baseName: "gate_id", + type: "string", + required: true, + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + options: { + baseName: "options", + type: "DeploymentRulesOptions", + required: true, + }, + type: { + baseName: "type", + type: "DeploymentRuleResponseDataAttributesType", + required: true, + }, + updatedAt: { + baseName: "updated_at", + type: "Date", + format: "date-time", + }, + updatedBy: { + baseName: "updated_by", + type: "DeploymentRuleResponseDataAttributesUpdatedBy", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DeploymentRuleResponseDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/DeploymentRuleResponseDataAttributesCreatedBy.ts b/services/deployment_gates/src/v2/models/DeploymentRuleResponseDataAttributesCreatedBy.ts new file mode 100644 index 000000000000..1235088e43a0 --- /dev/null +++ b/services/deployment_gates/src/v2/models/DeploymentRuleResponseDataAttributesCreatedBy.ts @@ -0,0 +1,61 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Information about the user who created the deployment rule. + */ +export class DeploymentRuleResponseDataAttributesCreatedBy { + /** + * The handle of the user who created the deployment rule. + */ + "handle"?: string; + /** + * The ID of the user who created the deployment rule. + */ + "id": string; + /** + * The name of the user who created the deployment rule. + */ + "name"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + handle: { + baseName: "handle", + type: "string", + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + name: { + baseName: "name", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DeploymentRuleResponseDataAttributesCreatedBy.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/DeploymentRuleResponseDataAttributesType.ts b/services/deployment_gates/src/v2/models/DeploymentRuleResponseDataAttributesType.ts new file mode 100644 index 000000000000..2f9040c86b6f --- /dev/null +++ b/services/deployment_gates/src/v2/models/DeploymentRuleResponseDataAttributesType.ts @@ -0,0 +1,11 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * The type of the deployment rule. + */ +export type DeploymentRuleResponseDataAttributesType = + | typeof FAULTY_DEPLOYMENT_DETECTION + | typeof MONITOR + | UnparsedObject; +export const FAULTY_DEPLOYMENT_DETECTION = "faulty_deployment_detection"; +export const MONITOR = "monitor"; diff --git a/services/deployment_gates/src/v2/models/DeploymentRuleResponseDataAttributesUpdatedBy.ts b/services/deployment_gates/src/v2/models/DeploymentRuleResponseDataAttributesUpdatedBy.ts new file mode 100644 index 000000000000..484c0cc594f2 --- /dev/null +++ b/services/deployment_gates/src/v2/models/DeploymentRuleResponseDataAttributesUpdatedBy.ts @@ -0,0 +1,61 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Information about the user who updated the deployment rule. + */ +export class DeploymentRuleResponseDataAttributesUpdatedBy { + /** + * The handle of the user who updated the deployment rule. + */ + "handle"?: string; + /** + * The ID of the user who updated the deployment rule. + */ + "id": string; + /** + * The name of the user who updated the deployment rule. + */ + "name"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + handle: { + baseName: "handle", + type: "string", + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + name: { + baseName: "name", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DeploymentRuleResponseDataAttributesUpdatedBy.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/DeploymentRulesOptions.ts b/services/deployment_gates/src/v2/models/DeploymentRulesOptions.ts new file mode 100644 index 000000000000..2b0f1af12eb2 --- /dev/null +++ b/services/deployment_gates/src/v2/models/DeploymentRulesOptions.ts @@ -0,0 +1,12 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +import { DeploymentRuleOptionsFaultyDeploymentDetection } from "./DeploymentRuleOptionsFaultyDeploymentDetection"; +import { DeploymentRuleOptionsMonitor } from "./DeploymentRuleOptionsMonitor"; + +/** + * Options for deployment rule response representing either faulty deployment detection or monitor options. + */ +export type DeploymentRulesOptions = + | DeploymentRuleOptionsFaultyDeploymentDetection + | DeploymentRuleOptionsMonitor + | UnparsedObject; diff --git a/services/deployment_gates/src/v2/models/HTTPCDGatesBadRequestResponse.ts b/services/deployment_gates/src/v2/models/HTTPCDGatesBadRequestResponse.ts new file mode 100644 index 000000000000..075820a271fd --- /dev/null +++ b/services/deployment_gates/src/v2/models/HTTPCDGatesBadRequestResponse.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { HTTPCIAppError } from "./HTTPCIAppError"; + +/** + * Bad request. + */ +export class HTTPCDGatesBadRequestResponse { + /** + * Structured errors. + */ + "errors"?: Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + errors: { + baseName: "errors", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return HTTPCDGatesBadRequestResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/HTTPCDGatesNotFoundResponse.ts b/services/deployment_gates/src/v2/models/HTTPCDGatesNotFoundResponse.ts new file mode 100644 index 000000000000..27950809a829 --- /dev/null +++ b/services/deployment_gates/src/v2/models/HTTPCDGatesNotFoundResponse.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { HTTPCIAppError } from "./HTTPCIAppError"; + +/** + * Deployment gate not found. + */ +export class HTTPCDGatesNotFoundResponse { + /** + * Structured errors. + */ + "errors"?: Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + errors: { + baseName: "errors", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return HTTPCDGatesNotFoundResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/HTTPCDRulesNotFoundResponse.ts b/services/deployment_gates/src/v2/models/HTTPCDRulesNotFoundResponse.ts new file mode 100644 index 000000000000..0e34f3d12b21 --- /dev/null +++ b/services/deployment_gates/src/v2/models/HTTPCDRulesNotFoundResponse.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { HTTPCIAppError } from "./HTTPCIAppError"; + +/** + * Deployment rule not found. + */ +export class HTTPCDRulesNotFoundResponse { + /** + * Structured errors. + */ + "errors"?: Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + errors: { + baseName: "errors", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return HTTPCDRulesNotFoundResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/HTTPCIAppError.ts b/services/deployment_gates/src/v2/models/HTTPCIAppError.ts new file mode 100644 index 000000000000..795e23d04acd --- /dev/null +++ b/services/deployment_gates/src/v2/models/HTTPCIAppError.ts @@ -0,0 +1,60 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * List of errors. + */ +export class HTTPCIAppError { + /** + * Error message. + */ + "detail"?: string; + /** + * Error code. + */ + "status"?: string; + /** + * Error title. + */ + "title"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + detail: { + baseName: "detail", + type: "string", + }, + status: { + baseName: "status", + type: "string", + }, + title: { + baseName: "title", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return HTTPCIAppError.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/HTTPCIAppErrors.ts b/services/deployment_gates/src/v2/models/HTTPCIAppErrors.ts new file mode 100644 index 000000000000..7ad7dcde0a07 --- /dev/null +++ b/services/deployment_gates/src/v2/models/HTTPCIAppErrors.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { HTTPCIAppError } from "./HTTPCIAppError"; + +/** + * Errors occurred. + */ +export class HTTPCIAppErrors { + /** + * Structured errors. + */ + "errors"?: Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + errors: { + baseName: "errors", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return HTTPCIAppErrors.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/TypingInfo.ts b/services/deployment_gates/src/v2/models/TypingInfo.ts new file mode 100644 index 000000000000..555c97f3f461 --- /dev/null +++ b/services/deployment_gates/src/v2/models/TypingInfo.ts @@ -0,0 +1,90 @@ +import { ModelTypingInfo } from "@datadog/datadog-api-client"; + +import { APIErrorResponse } from "./APIErrorResponse"; +import { CreateDeploymentGateParams } from "./CreateDeploymentGateParams"; +import { CreateDeploymentGateParamsData } from "./CreateDeploymentGateParamsData"; +import { CreateDeploymentGateParamsDataAttributes } from "./CreateDeploymentGateParamsDataAttributes"; +import { CreateDeploymentRuleParams } from "./CreateDeploymentRuleParams"; +import { CreateDeploymentRuleParamsData } from "./CreateDeploymentRuleParamsData"; +import { CreateDeploymentRuleParamsDataAttributes } from "./CreateDeploymentRuleParamsDataAttributes"; +import { DeploymentGateResponse } from "./DeploymentGateResponse"; +import { DeploymentGateResponseData } from "./DeploymentGateResponseData"; +import { DeploymentGateResponseDataAttributes } from "./DeploymentGateResponseDataAttributes"; +import { DeploymentGateResponseDataAttributesCreatedBy } from "./DeploymentGateResponseDataAttributesCreatedBy"; +import { DeploymentGateResponseDataAttributesUpdatedBy } from "./DeploymentGateResponseDataAttributesUpdatedBy"; +import { DeploymentRuleOptionsFaultyDeploymentDetection } from "./DeploymentRuleOptionsFaultyDeploymentDetection"; +import { DeploymentRuleOptionsMonitor } from "./DeploymentRuleOptionsMonitor"; +import { DeploymentRuleResponse } from "./DeploymentRuleResponse"; +import { DeploymentRuleResponseData } from "./DeploymentRuleResponseData"; +import { DeploymentRuleResponseDataAttributes } from "./DeploymentRuleResponseDataAttributes"; +import { DeploymentRuleResponseDataAttributesCreatedBy } from "./DeploymentRuleResponseDataAttributesCreatedBy"; +import { DeploymentRuleResponseDataAttributesUpdatedBy } from "./DeploymentRuleResponseDataAttributesUpdatedBy"; +import { HTTPCDGatesBadRequestResponse } from "./HTTPCDGatesBadRequestResponse"; +import { HTTPCDGatesNotFoundResponse } from "./HTTPCDGatesNotFoundResponse"; +import { HTTPCDRulesNotFoundResponse } from "./HTTPCDRulesNotFoundResponse"; +import { HTTPCIAppError } from "./HTTPCIAppError"; +import { HTTPCIAppErrors } from "./HTTPCIAppErrors"; +import { UpdateDeploymentGateParams } from "./UpdateDeploymentGateParams"; +import { UpdateDeploymentGateParamsData } from "./UpdateDeploymentGateParamsData"; +import { UpdateDeploymentGateParamsDataAttributes } from "./UpdateDeploymentGateParamsDataAttributes"; +import { UpdateDeploymentRuleParams } from "./UpdateDeploymentRuleParams"; +import { UpdateDeploymentRuleParamsData } from "./UpdateDeploymentRuleParamsData"; +import { UpdateDeploymentRuleParamsDataAttributes } from "./UpdateDeploymentRuleParamsDataAttributes"; + +export const TypingInfo: ModelTypingInfo = { + enumsMap: { + DeploymentGateDataType: ["deployment_gate"], + DeploymentRuleDataType: ["deployment_rule"], + DeploymentRuleResponseDataAttributesType: [ + "faulty_deployment_detection", + "monitor", + ], + }, + oneOfMap: { + DeploymentRulesOptions: [ + "DeploymentRuleOptionsFaultyDeploymentDetection", + "DeploymentRuleOptionsMonitor", + ], + }, + typeMap: { + APIErrorResponse: APIErrorResponse, + CreateDeploymentGateParams: CreateDeploymentGateParams, + CreateDeploymentGateParamsData: CreateDeploymentGateParamsData, + CreateDeploymentGateParamsDataAttributes: + CreateDeploymentGateParamsDataAttributes, + CreateDeploymentRuleParams: CreateDeploymentRuleParams, + CreateDeploymentRuleParamsData: CreateDeploymentRuleParamsData, + CreateDeploymentRuleParamsDataAttributes: + CreateDeploymentRuleParamsDataAttributes, + DeploymentGateResponse: DeploymentGateResponse, + DeploymentGateResponseData: DeploymentGateResponseData, + DeploymentGateResponseDataAttributes: DeploymentGateResponseDataAttributes, + DeploymentGateResponseDataAttributesCreatedBy: + DeploymentGateResponseDataAttributesCreatedBy, + DeploymentGateResponseDataAttributesUpdatedBy: + DeploymentGateResponseDataAttributesUpdatedBy, + DeploymentRuleOptionsFaultyDeploymentDetection: + DeploymentRuleOptionsFaultyDeploymentDetection, + DeploymentRuleOptionsMonitor: DeploymentRuleOptionsMonitor, + DeploymentRuleResponse: DeploymentRuleResponse, + DeploymentRuleResponseData: DeploymentRuleResponseData, + DeploymentRuleResponseDataAttributes: DeploymentRuleResponseDataAttributes, + DeploymentRuleResponseDataAttributesCreatedBy: + DeploymentRuleResponseDataAttributesCreatedBy, + DeploymentRuleResponseDataAttributesUpdatedBy: + DeploymentRuleResponseDataAttributesUpdatedBy, + HTTPCDGatesBadRequestResponse: HTTPCDGatesBadRequestResponse, + HTTPCDGatesNotFoundResponse: HTTPCDGatesNotFoundResponse, + HTTPCDRulesNotFoundResponse: HTTPCDRulesNotFoundResponse, + HTTPCIAppError: HTTPCIAppError, + HTTPCIAppErrors: HTTPCIAppErrors, + UpdateDeploymentGateParams: UpdateDeploymentGateParams, + UpdateDeploymentGateParamsData: UpdateDeploymentGateParamsData, + UpdateDeploymentGateParamsDataAttributes: + UpdateDeploymentGateParamsDataAttributes, + UpdateDeploymentRuleParams: UpdateDeploymentRuleParams, + UpdateDeploymentRuleParamsData: UpdateDeploymentRuleParamsData, + UpdateDeploymentRuleParamsDataAttributes: + UpdateDeploymentRuleParamsDataAttributes, + }, +}; diff --git a/services/deployment_gates/src/v2/models/UpdateDeploymentGateParams.ts b/services/deployment_gates/src/v2/models/UpdateDeploymentGateParams.ts new file mode 100644 index 000000000000..b49d285ad722 --- /dev/null +++ b/services/deployment_gates/src/v2/models/UpdateDeploymentGateParams.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { UpdateDeploymentGateParamsData } from "./UpdateDeploymentGateParamsData"; + +/** + * Parameters for updating a deployment gate. + */ +export class UpdateDeploymentGateParams { + /** + * Parameters for updating a deployment gate. + */ + "data": UpdateDeploymentGateParamsData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "UpdateDeploymentGateParamsData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return UpdateDeploymentGateParams.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/UpdateDeploymentGateParamsData.ts b/services/deployment_gates/src/v2/models/UpdateDeploymentGateParamsData.ts new file mode 100644 index 000000000000..00dd4eea52f2 --- /dev/null +++ b/services/deployment_gates/src/v2/models/UpdateDeploymentGateParamsData.ts @@ -0,0 +1,66 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { DeploymentGateDataType } from "./DeploymentGateDataType"; +import { UpdateDeploymentGateParamsDataAttributes } from "./UpdateDeploymentGateParamsDataAttributes"; + +/** + * Parameters for updating a deployment gate. + */ +export class UpdateDeploymentGateParamsData { + /** + * Attributes for updating a deployment gate. + */ + "attributes": UpdateDeploymentGateParamsDataAttributes; + /** + * Unique identifier of the deployment gate. + */ + "id": string; + /** + * Deployment gate resource type. + */ + "type": DeploymentGateDataType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "UpdateDeploymentGateParamsDataAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "DeploymentGateDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return UpdateDeploymentGateParamsData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/UpdateDeploymentGateParamsDataAttributes.ts b/services/deployment_gates/src/v2/models/UpdateDeploymentGateParamsDataAttributes.ts new file mode 100644 index 000000000000..f1eadc7a410a --- /dev/null +++ b/services/deployment_gates/src/v2/models/UpdateDeploymentGateParamsDataAttributes.ts @@ -0,0 +1,45 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Attributes for updating a deployment gate. + */ +export class UpdateDeploymentGateParamsDataAttributes { + /** + * Whether to run in dry-run mode. + */ + "dryRun": boolean; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + dryRun: { + baseName: "dry_run", + type: "boolean", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return UpdateDeploymentGateParamsDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/UpdateDeploymentRuleParams.ts b/services/deployment_gates/src/v2/models/UpdateDeploymentRuleParams.ts new file mode 100644 index 000000000000..1f52a8687dab --- /dev/null +++ b/services/deployment_gates/src/v2/models/UpdateDeploymentRuleParams.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { UpdateDeploymentRuleParamsData } from "./UpdateDeploymentRuleParamsData"; + +/** + * Parameters for updating a deployment rule. + */ +export class UpdateDeploymentRuleParams { + /** + * Parameters for updating a deployment rule. + */ + "data": UpdateDeploymentRuleParamsData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "UpdateDeploymentRuleParamsData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return UpdateDeploymentRuleParams.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/UpdateDeploymentRuleParamsData.ts b/services/deployment_gates/src/v2/models/UpdateDeploymentRuleParamsData.ts new file mode 100644 index 000000000000..cb6f589082e2 --- /dev/null +++ b/services/deployment_gates/src/v2/models/UpdateDeploymentRuleParamsData.ts @@ -0,0 +1,57 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { DeploymentRuleDataType } from "./DeploymentRuleDataType"; +import { UpdateDeploymentRuleParamsDataAttributes } from "./UpdateDeploymentRuleParamsDataAttributes"; + +/** + * Parameters for updating a deployment rule. + */ +export class UpdateDeploymentRuleParamsData { + /** + * Parameters for updating a deployment rule. + */ + "attributes": UpdateDeploymentRuleParamsDataAttributes; + /** + * Deployment rule resource type. + */ + "type": DeploymentRuleDataType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "UpdateDeploymentRuleParamsDataAttributes", + required: true, + }, + type: { + baseName: "type", + type: "DeploymentRuleDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return UpdateDeploymentRuleParamsData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/src/v2/models/UpdateDeploymentRuleParamsDataAttributes.ts b/services/deployment_gates/src/v2/models/UpdateDeploymentRuleParamsDataAttributes.ts new file mode 100644 index 000000000000..a9db02186bc6 --- /dev/null +++ b/services/deployment_gates/src/v2/models/UpdateDeploymentRuleParamsDataAttributes.ts @@ -0,0 +1,65 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { DeploymentRulesOptions } from "./DeploymentRulesOptions"; + +/** + * Parameters for updating a deployment rule. + */ +export class UpdateDeploymentRuleParamsDataAttributes { + /** + * Whether to run this rule in dry-run mode. + */ + "dryRun": boolean; + /** + * The name of the deployment rule. + */ + "name": string; + /** + * Options for deployment rule response representing either faulty deployment detection or monitor options. + */ + "options": DeploymentRulesOptions; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + dryRun: { + baseName: "dry_run", + type: "boolean", + required: true, + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + options: { + baseName: "options", + type: "DeploymentRulesOptions", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return UpdateDeploymentRuleParamsDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/deployment_gates/tsconfig.json b/services/deployment_gates/tsconfig.json new file mode 100644 index 000000000000..d6c32bfb893c --- /dev/null +++ b/services/deployment_gates/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "strict": true, + /* Basic Options */ + "target": "es6", + "module": "commonjs", + "moduleResolution": "node", + "declaration": true, + + "esModuleInterop": true, + "resolveJsonModule": true, + + "noImplicitAny": true, + "noImplicitThis": true, + + /* Additional Checks */ + "noUnusedLocals": false /* Report errors on unused locals. */, // TODO: reenable (unused imports!) + "noUnusedParameters": false /* Report errors on unused parameters. */, // TODO: set to true again + "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, + "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, + + "sourceMap": true, + "outDir": "./dist", + "lib": ["es6", "es7"] + }, + "exclude": ["dist", "node_modules", "tests"], + "include": ["src"] +} diff --git a/yarn.lock b/yarn.lock index 4092bd31e9f2..72f4ea79aae8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -532,6 +532,15 @@ __metadata: languageName: unknown linkType: soft +"@datadog/datadog-api-client-deployment-gates@workspace:services/deployment_gates": + version: 0.0.0-use.local + resolution: "@datadog/datadog-api-client-deployment-gates@workspace:services/deployment_gates" + dependencies: + "@datadog/datadog-api-client": "npm:^2.0.0-beta.0" + typescript: "npm:5.8.3" + languageName: unknown + linkType: soft + "@datadog/datadog-api-client-domain-allowlist@workspace:services/domain_allowlist": version: 0.0.0-use.local resolution: "@datadog/datadog-api-client-domain-allowlist@workspace:services/domain_allowlist"