diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 93efc78e5a9..9632e2d7de2 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1157,6 +1157,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: @@ -12576,6 +12594,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: @@ -16284,6 +16387,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: @@ -16323,6 +16533,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: @@ -22414,6 +22782,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: @@ -51896,6 +52291,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: @@ -61541,6 +62007,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. @@ -79554,8 +80417,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: @@ -81289,6 +82151,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/examples/v2/deployment-gates/CreateDeploymentGate.java b/examples/v2/deployment-gates/CreateDeploymentGate.java new file mode 100644 index 00000000000..ce578e117da --- /dev/null +++ b/examples/v2/deployment-gates/CreateDeploymentGate.java @@ -0,0 +1,41 @@ +// Create deployment gate returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.DeploymentGatesApi; +import com.datadog.api.client.v2.model.CreateDeploymentGateParams; +import com.datadog.api.client.v2.model.CreateDeploymentGateParamsData; +import com.datadog.api.client.v2.model.CreateDeploymentGateParamsDataAttributes; +import com.datadog.api.client.v2.model.DeploymentGateDataType; +import com.datadog.api.client.v2.model.DeploymentGateResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createDeploymentGate", true); + DeploymentGatesApi apiInstance = new DeploymentGatesApi(defaultClient); + + CreateDeploymentGateParams body = + new CreateDeploymentGateParams() + .data( + new CreateDeploymentGateParamsData() + .attributes( + new CreateDeploymentGateParamsDataAttributes() + .dryRun(false) + .env("production") + .identifier("my-gate-1") + .service("my-service")) + .type(DeploymentGateDataType.DEPLOYMENT_GATE)); + + try { + DeploymentGateResponse result = apiInstance.createDeploymentGate(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DeploymentGatesApi#createDeploymentGate"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/deployment-gates/CreateDeploymentRule.java b/examples/v2/deployment-gates/CreateDeploymentRule.java new file mode 100644 index 00000000000..c4ebc6736cb --- /dev/null +++ b/examples/v2/deployment-gates/CreateDeploymentRule.java @@ -0,0 +1,49 @@ +// Create deployment rule returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.DeploymentGatesApi; +import com.datadog.api.client.v2.model.CreateDeploymentRuleParams; +import com.datadog.api.client.v2.model.CreateDeploymentRuleParamsData; +import com.datadog.api.client.v2.model.CreateDeploymentRuleParamsDataAttributes; +import com.datadog.api.client.v2.model.DeploymentRuleDataType; +import com.datadog.api.client.v2.model.DeploymentRuleOptionsFaultyDeploymentDetection; +import com.datadog.api.client.v2.model.DeploymentRuleResponse; +import com.datadog.api.client.v2.model.DeploymentRulesOptions; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createDeploymentRule", true); + DeploymentGatesApi apiInstance = new DeploymentGatesApi(defaultClient); + + // there is a valid "deployment_gate" in the system + String DEPLOYMENT_GATE_DATA_ID = System.getenv("DEPLOYMENT_GATE_DATA_ID"); + + CreateDeploymentRuleParams body = + new CreateDeploymentRuleParams() + .data( + new CreateDeploymentRuleParamsData() + .attributes( + new CreateDeploymentRuleParamsDataAttributes() + .dryRun(false) + .name("My deployment rule") + .options( + new DeploymentRulesOptions( + new DeploymentRuleOptionsFaultyDeploymentDetection())) + .type("faulty_deployment_detection")) + .type(DeploymentRuleDataType.DEPLOYMENT_RULE)); + + try { + DeploymentRuleResponse result = + apiInstance.createDeploymentRule(DEPLOYMENT_GATE_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DeploymentGatesApi#createDeploymentRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/deployment-gates/DeleteDeploymentGate.java b/examples/v2/deployment-gates/DeleteDeploymentGate.java new file mode 100644 index 00000000000..25115a21138 --- /dev/null +++ b/examples/v2/deployment-gates/DeleteDeploymentGate.java @@ -0,0 +1,26 @@ +// Delete deployment gate returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.DeploymentGatesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.deleteDeploymentGate", true); + DeploymentGatesApi apiInstance = new DeploymentGatesApi(defaultClient); + + // there is a valid "deployment_gate" in the system + String DEPLOYMENT_GATE_DATA_ID = System.getenv("DEPLOYMENT_GATE_DATA_ID"); + + try { + apiInstance.deleteDeploymentGate(DEPLOYMENT_GATE_DATA_ID); + } catch (ApiException e) { + System.err.println("Exception when calling DeploymentGatesApi#deleteDeploymentGate"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/deployment-gates/DeleteDeploymentRule.java b/examples/v2/deployment-gates/DeleteDeploymentRule.java new file mode 100644 index 00000000000..a20d43c9454 --- /dev/null +++ b/examples/v2/deployment-gates/DeleteDeploymentRule.java @@ -0,0 +1,29 @@ +// Delete deployment rule returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.DeploymentGatesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.deleteDeploymentRule", true); + DeploymentGatesApi apiInstance = new DeploymentGatesApi(defaultClient); + + // there is a valid "deployment_gate" in the system + String DEPLOYMENT_GATE_DATA_ID = System.getenv("DEPLOYMENT_GATE_DATA_ID"); + + // there is a valid "deployment_rule" in the system + String DEPLOYMENT_RULE_DATA_ID = System.getenv("DEPLOYMENT_RULE_DATA_ID"); + + try { + apiInstance.deleteDeploymentRule(DEPLOYMENT_GATE_DATA_ID, DEPLOYMENT_RULE_DATA_ID); + } catch (ApiException e) { + System.err.println("Exception when calling DeploymentGatesApi#deleteDeploymentRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/deployment-gates/GetDeploymentGate.java b/examples/v2/deployment-gates/GetDeploymentGate.java new file mode 100644 index 00000000000..b16d04c32a5 --- /dev/null +++ b/examples/v2/deployment-gates/GetDeploymentGate.java @@ -0,0 +1,28 @@ +// Get deployment gate returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.DeploymentGatesApi; +import com.datadog.api.client.v2.model.DeploymentGateResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getDeploymentGate", true); + DeploymentGatesApi apiInstance = new DeploymentGatesApi(defaultClient); + + // there is a valid "deployment_gate" in the system + String DEPLOYMENT_GATE_DATA_ID = System.getenv("DEPLOYMENT_GATE_DATA_ID"); + + try { + DeploymentGateResponse result = apiInstance.getDeploymentGate(DEPLOYMENT_GATE_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DeploymentGatesApi#getDeploymentGate"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/deployment-gates/GetDeploymentRule.java b/examples/v2/deployment-gates/GetDeploymentRule.java new file mode 100644 index 00000000000..0d20305100c --- /dev/null +++ b/examples/v2/deployment-gates/GetDeploymentRule.java @@ -0,0 +1,32 @@ +// Get deployment rule returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.DeploymentGatesApi; +import com.datadog.api.client.v2.model.DeploymentRuleResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getDeploymentRule", true); + DeploymentGatesApi apiInstance = new DeploymentGatesApi(defaultClient); + + // there is a valid "deployment_gate" in the system + String DEPLOYMENT_GATE_DATA_ID = System.getenv("DEPLOYMENT_GATE_DATA_ID"); + + // there is a valid "deployment_rule" in the system + String DEPLOYMENT_RULE_DATA_ID = System.getenv("DEPLOYMENT_RULE_DATA_ID"); + + try { + DeploymentRuleResponse result = + apiInstance.getDeploymentRule(DEPLOYMENT_GATE_DATA_ID, DEPLOYMENT_RULE_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DeploymentGatesApi#getDeploymentRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/deployment-gates/UpdateDeploymentGate.java b/examples/v2/deployment-gates/UpdateDeploymentGate.java new file mode 100644 index 00000000000..ffc6a5d0cbc --- /dev/null +++ b/examples/v2/deployment-gates/UpdateDeploymentGate.java @@ -0,0 +1,41 @@ +// Update deployment gate returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.DeploymentGatesApi; +import com.datadog.api.client.v2.model.DeploymentGateDataType; +import com.datadog.api.client.v2.model.DeploymentGateResponse; +import com.datadog.api.client.v2.model.UpdateDeploymentGateParams; +import com.datadog.api.client.v2.model.UpdateDeploymentGateParamsData; +import com.datadog.api.client.v2.model.UpdateDeploymentGateParamsDataAttributes; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateDeploymentGate", true); + DeploymentGatesApi apiInstance = new DeploymentGatesApi(defaultClient); + + // there is a valid "deployment_gate" in the system + String DEPLOYMENT_GATE_DATA_ID = System.getenv("DEPLOYMENT_GATE_DATA_ID"); + + UpdateDeploymentGateParams body = + new UpdateDeploymentGateParams() + .data( + new UpdateDeploymentGateParamsData() + .attributes(new UpdateDeploymentGateParamsDataAttributes().dryRun(false)) + .id("12345678-1234-1234-1234-123456789012") + .type(DeploymentGateDataType.DEPLOYMENT_GATE)); + + try { + DeploymentGateResponse result = + apiInstance.updateDeploymentGate(DEPLOYMENT_GATE_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DeploymentGatesApi#updateDeploymentGate"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/deployment-gates/UpdateDeploymentRule.java b/examples/v2/deployment-gates/UpdateDeploymentRule.java new file mode 100644 index 00000000000..11aba148a37 --- /dev/null +++ b/examples/v2/deployment-gates/UpdateDeploymentRule.java @@ -0,0 +1,51 @@ +// Update deployment rule returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.DeploymentGatesApi; +import com.datadog.api.client.v2.model.DeploymentRuleDataType; +import com.datadog.api.client.v2.model.DeploymentRuleOptionsFaultyDeploymentDetection; +import com.datadog.api.client.v2.model.DeploymentRuleResponse; +import com.datadog.api.client.v2.model.DeploymentRulesOptions; +import com.datadog.api.client.v2.model.UpdateDeploymentRuleParams; +import com.datadog.api.client.v2.model.UpdateDeploymentRuleParamsData; +import com.datadog.api.client.v2.model.UpdateDeploymentRuleParamsDataAttributes; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateDeploymentRule", true); + DeploymentGatesApi apiInstance = new DeploymentGatesApi(defaultClient); + + // there is a valid "deployment_gate" in the system + String DEPLOYMENT_GATE_DATA_ID = System.getenv("DEPLOYMENT_GATE_DATA_ID"); + + // there is a valid "deployment_rule" in the system + String DEPLOYMENT_RULE_DATA_ID = System.getenv("DEPLOYMENT_RULE_DATA_ID"); + + UpdateDeploymentRuleParams body = + new UpdateDeploymentRuleParams() + .data( + new UpdateDeploymentRuleParamsData() + .attributes( + new UpdateDeploymentRuleParamsDataAttributes() + .dryRun(false) + .name("Updated deployment rule") + .options( + new DeploymentRulesOptions( + new DeploymentRuleOptionsFaultyDeploymentDetection()))) + .type(DeploymentRuleDataType.DEPLOYMENT_RULE)); + + try { + DeploymentRuleResponse result = + apiInstance.updateDeploymentRule(DEPLOYMENT_GATE_DATA_ID, DEPLOYMENT_RULE_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DeploymentGatesApi#updateDeploymentRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 790a403d960..d564828bf22 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -725,6 +725,14 @@ public class ApiClient { put("v2.cancelDataDeletionRequest", false); put("v2.createDataDeletionRequest", false); put("v2.getDataDeletionRequests", false); + put("v2.createDeploymentGate", false); + put("v2.createDeploymentRule", false); + put("v2.deleteDeploymentGate", false); + put("v2.deleteDeploymentRule", false); + put("v2.getDeploymentGate", false); + put("v2.getDeploymentRule", false); + put("v2.updateDeploymentGate", false); + put("v2.updateDeploymentRule", false); put("v2.createIncident", false); put("v2.createIncidentImpact", false); put("v2.createIncidentIntegration", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/DeploymentGatesApi.java b/src/main/java/com/datadog/api/client/v2/api/DeploymentGatesApi.java new file mode 100644 index 00000000000..7779295194d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/DeploymentGatesApi.java @@ -0,0 +1,1410 @@ +package com.datadog.api.client.v2.api; + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.ApiResponse; +import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.CreateDeploymentGateParams; +import com.datadog.api.client.v2.model.CreateDeploymentRuleParams; +import com.datadog.api.client.v2.model.DeploymentGateResponse; +import com.datadog.api.client.v2.model.DeploymentRuleResponse; +import com.datadog.api.client.v2.model.UpdateDeploymentGateParams; +import com.datadog.api.client.v2.model.UpdateDeploymentRuleParams; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.GenericType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentGatesApi { + private ApiClient apiClient; + + public DeploymentGatesApi() { + this(ApiClient.getDefaultApiClient()); + } + + public DeploymentGatesApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client. + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client. + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Create deployment gate. + * + *

See {@link #createDeploymentGateWithHttpInfo}. + * + * @param body (required) + * @return DeploymentGateResponse + * @throws ApiException if fails to make API call + */ + public DeploymentGateResponse createDeploymentGate(CreateDeploymentGateParams body) + throws ApiException { + return createDeploymentGateWithHttpInfo(body).getData(); + } + + /** + * Create deployment gate. + * + *

See {@link #createDeploymentGateWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<DeploymentGateResponse> + */ + public CompletableFuture createDeploymentGateAsync( + CreateDeploymentGateParams body) { + return createDeploymentGateWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Endpoint to create a deployment gate. + * + * @param body (required) + * @return ApiResponse<DeploymentGateResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad request. -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
500 Internal Server Error -
+ */ + public ApiResponse createDeploymentGateWithHttpInfo( + CreateDeploymentGateParams body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "createDeploymentGate"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createDeploymentGate"); + } + // create path and map variables + String localVarPath = "/api/v2/deployment_gates"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.DeploymentGatesApi.createDeploymentGate", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create deployment gate. + * + *

See {@link #createDeploymentGateWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<DeploymentGateResponse>> + */ + public CompletableFuture> + createDeploymentGateWithHttpInfoAsync(CreateDeploymentGateParams body) { + // Check if unstable operation is enabled + String operationId = "createDeploymentGate"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createDeploymentGate")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/deployment_gates"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.DeploymentGatesApi.createDeploymentGate", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create deployment rule. + * + *

See {@link #createDeploymentRuleWithHttpInfo}. + * + * @param gateId The ID of the deployment gate. (required) + * @param body (required) + * @return DeploymentRuleResponse + * @throws ApiException if fails to make API call + */ + public DeploymentRuleResponse createDeploymentRule(String gateId, CreateDeploymentRuleParams body) + throws ApiException { + return createDeploymentRuleWithHttpInfo(gateId, body).getData(); + } + + /** + * Create deployment rule. + * + *

See {@link #createDeploymentRuleWithHttpInfoAsync}. + * + * @param gateId The ID of the deployment gate. (required) + * @param body (required) + * @return CompletableFuture<DeploymentRuleResponse> + */ + public CompletableFuture createDeploymentRuleAsync( + String gateId, CreateDeploymentRuleParams body) { + return createDeploymentRuleWithHttpInfoAsync(gateId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Endpoint to create a deployment rule. A gate for the rule must already exist. + * + * @param gateId The ID of the deployment gate. (required) + * @param body (required) + * @return ApiResponse<DeploymentRuleResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad request. -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
500 Internal Server Error -
+ */ + public ApiResponse createDeploymentRuleWithHttpInfo( + String gateId, CreateDeploymentRuleParams body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "createDeploymentRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'gateId' is set + if (gateId == null) { + throw new ApiException( + 400, "Missing the required parameter 'gateId' when calling createDeploymentRule"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createDeploymentRule"); + } + // create path and map variables + String localVarPath = + "/api/v2/deployment_gates/{gate_id}/rules" + .replaceAll("\\{" + "gate_id" + "\\}", apiClient.escapeString(gateId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.DeploymentGatesApi.createDeploymentRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create deployment rule. + * + *

See {@link #createDeploymentRuleWithHttpInfo}. + * + * @param gateId The ID of the deployment gate. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<DeploymentRuleResponse>> + */ + public CompletableFuture> + createDeploymentRuleWithHttpInfoAsync(String gateId, CreateDeploymentRuleParams body) { + // Check if unstable operation is enabled + String operationId = "createDeploymentRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'gateId' is set + if (gateId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'gateId' when calling createDeploymentRule")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createDeploymentRule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/deployment_gates/{gate_id}/rules" + .replaceAll("\\{" + "gate_id" + "\\}", apiClient.escapeString(gateId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.DeploymentGatesApi.createDeploymentRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Delete deployment gate. + * + *

See {@link #deleteDeploymentGateWithHttpInfo}. + * + * @param id The ID of the deployment gate. (required) + * @throws ApiException if fails to make API call + */ + public void deleteDeploymentGate(String id) throws ApiException { + deleteDeploymentGateWithHttpInfo(id); + } + + /** + * Delete deployment gate. + * + *

See {@link #deleteDeploymentGateWithHttpInfoAsync}. + * + * @param id The ID of the deployment gate. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteDeploymentGateAsync(String id) { + return deleteDeploymentGateWithHttpInfoAsync(id) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Endpoint to delete a deployment gate. Rules associated with the gate are also deleted. + * + * @param id The ID of the deployment gate. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad request. -
401 Unauthorized -
403 Forbidden -
404 Deployment gate not found. -
429 Too many requests -
500 Internal Server Error -
+ */ + public ApiResponse deleteDeploymentGateWithHttpInfo(String id) throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteDeploymentGate"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling deleteDeploymentGate"); + } + // create path and map variables + String localVarPath = + "/api/v2/deployment_gates/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.DeploymentGatesApi.deleteDeploymentGate", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete deployment gate. + * + *

See {@link #deleteDeploymentGateWithHttpInfo}. + * + * @param id The ID of the deployment gate. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteDeploymentGateWithHttpInfoAsync(String id) { + // Check if unstable operation is enabled + String operationId = "deleteDeploymentGate"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'id' when calling deleteDeploymentGate")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/deployment_gates/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.DeploymentGatesApi.deleteDeploymentGate", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete deployment rule. + * + *

See {@link #deleteDeploymentRuleWithHttpInfo}. + * + * @param gateId The ID of the deployment gate. (required) + * @param id The ID of the deployment rule. (required) + * @throws ApiException if fails to make API call + */ + public void deleteDeploymentRule(String gateId, String id) throws ApiException { + deleteDeploymentRuleWithHttpInfo(gateId, id); + } + + /** + * Delete deployment rule. + * + *

See {@link #deleteDeploymentRuleWithHttpInfoAsync}. + * + * @param gateId The ID of the deployment gate. (required) + * @param id The ID of the deployment rule. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteDeploymentRuleAsync(String gateId, String id) { + return deleteDeploymentRuleWithHttpInfoAsync(gateId, id) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Endpoint to delete a deployment rule. + * + * @param gateId The ID of the deployment gate. (required) + * @param id The ID of the deployment rule. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad request. -
401 Unauthorized -
403 Forbidden -
404 Deployment gate not found. -
429 Too many requests -
500 Internal Server Error -
+ */ + public ApiResponse deleteDeploymentRuleWithHttpInfo(String gateId, String id) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteDeploymentRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'gateId' is set + if (gateId == null) { + throw new ApiException( + 400, "Missing the required parameter 'gateId' when calling deleteDeploymentRule"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling deleteDeploymentRule"); + } + // create path and map variables + String localVarPath = + "/api/v2/deployment_gates/{gate_id}/rules/{id}" + .replaceAll("\\{" + "gate_id" + "\\}", apiClient.escapeString(gateId.toString())) + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.DeploymentGatesApi.deleteDeploymentRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete deployment rule. + * + *

See {@link #deleteDeploymentRuleWithHttpInfo}. + * + * @param gateId The ID of the deployment gate. (required) + * @param id The ID of the deployment rule. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteDeploymentRuleWithHttpInfoAsync( + String gateId, String id) { + // Check if unstable operation is enabled + String operationId = "deleteDeploymentRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'gateId' is set + if (gateId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'gateId' when calling deleteDeploymentRule")); + return result; + } + + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'id' when calling deleteDeploymentRule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/deployment_gates/{gate_id}/rules/{id}" + .replaceAll("\\{" + "gate_id" + "\\}", apiClient.escapeString(gateId.toString())) + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.DeploymentGatesApi.deleteDeploymentRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Get deployment gate. + * + *

See {@link #getDeploymentGateWithHttpInfo}. + * + * @param id The ID of the deployment gate. (required) + * @return DeploymentGateResponse + * @throws ApiException if fails to make API call + */ + public DeploymentGateResponse getDeploymentGate(String id) throws ApiException { + return getDeploymentGateWithHttpInfo(id).getData(); + } + + /** + * Get deployment gate. + * + *

See {@link #getDeploymentGateWithHttpInfoAsync}. + * + * @param id The ID of the deployment gate. (required) + * @return CompletableFuture<DeploymentGateResponse> + */ + public CompletableFuture getDeploymentGateAsync(String id) { + return getDeploymentGateWithHttpInfoAsync(id) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Endpoint to get a deployment gate. + * + * @param id The ID of the deployment gate. (required) + * @return ApiResponse<DeploymentGateResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad request. -
401 Unauthorized -
403 Forbidden -
404 Deployment gate not found. -
429 Too many requests -
500 Internal Server Error -
+ */ + public ApiResponse getDeploymentGateWithHttpInfo(String id) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getDeploymentGate"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling getDeploymentGate"); + } + // create path and map variables + String localVarPath = + "/api/v2/deployment_gates/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.DeploymentGatesApi.getDeploymentGate", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get deployment gate. + * + *

See {@link #getDeploymentGateWithHttpInfo}. + * + * @param id The ID of the deployment gate. (required) + * @return CompletableFuture<ApiResponse<DeploymentGateResponse>> + */ + public CompletableFuture> getDeploymentGateWithHttpInfoAsync( + String id) { + // Check if unstable operation is enabled + String operationId = "getDeploymentGate"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'id' when calling getDeploymentGate")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/deployment_gates/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.DeploymentGatesApi.getDeploymentGate", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get deployment rule. + * + *

See {@link #getDeploymentRuleWithHttpInfo}. + * + * @param gateId The ID of the deployment gate. (required) + * @param id The ID of the deployment rule. (required) + * @return DeploymentRuleResponse + * @throws ApiException if fails to make API call + */ + public DeploymentRuleResponse getDeploymentRule(String gateId, String id) throws ApiException { + return getDeploymentRuleWithHttpInfo(gateId, id).getData(); + } + + /** + * Get deployment rule. + * + *

See {@link #getDeploymentRuleWithHttpInfoAsync}. + * + * @param gateId The ID of the deployment gate. (required) + * @param id The ID of the deployment rule. (required) + * @return CompletableFuture<DeploymentRuleResponse> + */ + public CompletableFuture getDeploymentRuleAsync( + String gateId, String id) { + return getDeploymentRuleWithHttpInfoAsync(gateId, id) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Endpoint to get a deployment rule. + * + * @param gateId The ID of the deployment gate. (required) + * @param id The ID of the deployment rule. (required) + * @return ApiResponse<DeploymentRuleResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad request. -
401 Unauthorized -
403 Forbidden -
404 Deployment rule not found. -
429 Too many requests -
500 Internal Server Error -
+ */ + public ApiResponse getDeploymentRuleWithHttpInfo(String gateId, String id) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getDeploymentRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'gateId' is set + if (gateId == null) { + throw new ApiException( + 400, "Missing the required parameter 'gateId' when calling getDeploymentRule"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling getDeploymentRule"); + } + // create path and map variables + String localVarPath = + "/api/v2/deployment_gates/{gate_id}/rules/{id}" + .replaceAll("\\{" + "gate_id" + "\\}", apiClient.escapeString(gateId.toString())) + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.DeploymentGatesApi.getDeploymentRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get deployment rule. + * + *

See {@link #getDeploymentRuleWithHttpInfo}. + * + * @param gateId The ID of the deployment gate. (required) + * @param id The ID of the deployment rule. (required) + * @return CompletableFuture<ApiResponse<DeploymentRuleResponse>> + */ + public CompletableFuture> getDeploymentRuleWithHttpInfoAsync( + String gateId, String id) { + // Check if unstable operation is enabled + String operationId = "getDeploymentRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'gateId' is set + if (gateId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'gateId' when calling getDeploymentRule")); + return result; + } + + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'id' when calling getDeploymentRule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/deployment_gates/{gate_id}/rules/{id}" + .replaceAll("\\{" + "gate_id" + "\\}", apiClient.escapeString(gateId.toString())) + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.DeploymentGatesApi.getDeploymentRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update deployment gate. + * + *

See {@link #updateDeploymentGateWithHttpInfo}. + * + * @param id The ID of the deployment gate. (required) + * @param body (required) + * @return DeploymentGateResponse + * @throws ApiException if fails to make API call + */ + public DeploymentGateResponse updateDeploymentGate(String id, UpdateDeploymentGateParams body) + throws ApiException { + return updateDeploymentGateWithHttpInfo(id, body).getData(); + } + + /** + * Update deployment gate. + * + *

See {@link #updateDeploymentGateWithHttpInfoAsync}. + * + * @param id The ID of the deployment gate. (required) + * @param body (required) + * @return CompletableFuture<DeploymentGateResponse> + */ + public CompletableFuture updateDeploymentGateAsync( + String id, UpdateDeploymentGateParams body) { + return updateDeploymentGateWithHttpInfoAsync(id, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Endpoint to update a deployment gate. + * + * @param id The ID of the deployment gate. (required) + * @param body (required) + * @return ApiResponse<DeploymentGateResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad request. -
401 Unauthorized -
403 Forbidden -
404 Deployment gate not found. -
429 Too many requests -
500 Internal Server Error -
+ */ + public ApiResponse updateDeploymentGateWithHttpInfo( + String id, UpdateDeploymentGateParams body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateDeploymentGate"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling updateDeploymentGate"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateDeploymentGate"); + } + // create path and map variables + String localVarPath = + "/api/v2/deployment_gates/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.DeploymentGatesApi.updateDeploymentGate", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update deployment gate. + * + *

See {@link #updateDeploymentGateWithHttpInfo}. + * + * @param id The ID of the deployment gate. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<DeploymentGateResponse>> + */ + public CompletableFuture> + updateDeploymentGateWithHttpInfoAsync(String id, UpdateDeploymentGateParams body) { + // Check if unstable operation is enabled + String operationId = "updateDeploymentGate"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'id' when calling updateDeploymentGate")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateDeploymentGate")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/deployment_gates/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.DeploymentGatesApi.updateDeploymentGate", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update deployment rule. + * + *

See {@link #updateDeploymentRuleWithHttpInfo}. + * + * @param gateId The ID of the deployment gate. (required) + * @param id The ID of the deployment rule. (required) + * @param body (required) + * @return DeploymentRuleResponse + * @throws ApiException if fails to make API call + */ + public DeploymentRuleResponse updateDeploymentRule( + String gateId, String id, UpdateDeploymentRuleParams body) throws ApiException { + return updateDeploymentRuleWithHttpInfo(gateId, id, body).getData(); + } + + /** + * Update deployment rule. + * + *

See {@link #updateDeploymentRuleWithHttpInfoAsync}. + * + * @param gateId The ID of the deployment gate. (required) + * @param id The ID of the deployment rule. (required) + * @param body (required) + * @return CompletableFuture<DeploymentRuleResponse> + */ + public CompletableFuture updateDeploymentRuleAsync( + String gateId, String id, UpdateDeploymentRuleParams body) { + return updateDeploymentRuleWithHttpInfoAsync(gateId, id, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Endpoint to update a deployment rule. + * + * @param gateId The ID of the deployment gate. (required) + * @param id The ID of the deployment rule. (required) + * @param body (required) + * @return ApiResponse<DeploymentRuleResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad request. -
401 Unauthorized -
403 Forbidden -
404 Deployment rule not found. -
429 Too many requests -
500 Internal Server Error -
+ */ + public ApiResponse updateDeploymentRuleWithHttpInfo( + String gateId, String id, UpdateDeploymentRuleParams body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateDeploymentRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'gateId' is set + if (gateId == null) { + throw new ApiException( + 400, "Missing the required parameter 'gateId' when calling updateDeploymentRule"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling updateDeploymentRule"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateDeploymentRule"); + } + // create path and map variables + String localVarPath = + "/api/v2/deployment_gates/{gate_id}/rules/{id}" + .replaceAll("\\{" + "gate_id" + "\\}", apiClient.escapeString(gateId.toString())) + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.DeploymentGatesApi.updateDeploymentRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update deployment rule. + * + *

See {@link #updateDeploymentRuleWithHttpInfo}. + * + * @param gateId The ID of the deployment gate. (required) + * @param id The ID of the deployment rule. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<DeploymentRuleResponse>> + */ + public CompletableFuture> + updateDeploymentRuleWithHttpInfoAsync( + String gateId, String id, UpdateDeploymentRuleParams body) { + // Check if unstable operation is enabled + String operationId = "updateDeploymentRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'gateId' is set + if (gateId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'gateId' when calling updateDeploymentRule")); + return result; + } + + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'id' when calling updateDeploymentRule")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateDeploymentRule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/deployment_gates/{gate_id}/rules/{id}" + .replaceAll("\\{" + "gate_id" + "\\}", apiClient.escapeString(gateId.toString())) + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.DeploymentGatesApi.updateDeploymentRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateDeploymentGateParams.java b/src/main/java/com/datadog/api/client/v2/model/CreateDeploymentGateParams.java new file mode 100644 index 00000000000..44eaced27b3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateDeploymentGateParams.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Parameters for creating a deployment gate. */ +@JsonPropertyOrder({CreateDeploymentGateParams.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateDeploymentGateParams { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CreateDeploymentGateParamsData data; + + public CreateDeploymentGateParams() {} + + @JsonCreator + public CreateDeploymentGateParams( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + CreateDeploymentGateParamsData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CreateDeploymentGateParams data(CreateDeploymentGateParamsData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Parameters for creating a deployment gate. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CreateDeploymentGateParamsData getData() { + return data; + } + + public void setData(CreateDeploymentGateParamsData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateDeploymentGateParams + */ + @JsonAnySetter + public CreateDeploymentGateParams putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateDeploymentGateParams object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDeploymentGateParams createDeploymentGateParams = (CreateDeploymentGateParams) o; + return Objects.equals(this.data, createDeploymentGateParams.data) + && Objects.equals( + this.additionalProperties, createDeploymentGateParams.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDeploymentGateParams {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateDeploymentGateParamsData.java b/src/main/java/com/datadog/api/client/v2/model/CreateDeploymentGateParamsData.java new file mode 100644 index 00000000000..7b96d22837a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateDeploymentGateParamsData.java @@ -0,0 +1,184 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Parameters for creating a deployment gate. */ +@JsonPropertyOrder({ + CreateDeploymentGateParamsData.JSON_PROPERTY_ATTRIBUTES, + CreateDeploymentGateParamsData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateDeploymentGateParamsData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CreateDeploymentGateParamsDataAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DeploymentGateDataType type; + + public CreateDeploymentGateParamsData() {} + + @JsonCreator + public CreateDeploymentGateParamsData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CreateDeploymentGateParamsDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) DeploymentGateDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CreateDeploymentGateParamsData attributes( + CreateDeploymentGateParamsDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Parameters for creating a deployment gate. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CreateDeploymentGateParamsDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CreateDeploymentGateParamsDataAttributes attributes) { + this.attributes = attributes; + } + + public CreateDeploymentGateParamsData type(DeploymentGateDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Deployment gate resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeploymentGateDataType getType() { + return type; + } + + public void setType(DeploymentGateDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateDeploymentGateParamsData + */ + @JsonAnySetter + public CreateDeploymentGateParamsData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateDeploymentGateParamsData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDeploymentGateParamsData createDeploymentGateParamsData = + (CreateDeploymentGateParamsData) o; + return Objects.equals(this.attributes, createDeploymentGateParamsData.attributes) + && Objects.equals(this.type, createDeploymentGateParamsData.type) + && Objects.equals( + this.additionalProperties, createDeploymentGateParamsData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDeploymentGateParamsData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateDeploymentGateParamsDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateDeploymentGateParamsDataAttributes.java new file mode 100644 index 00000000000..dc8ea772033 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateDeploymentGateParamsDataAttributes.java @@ -0,0 +1,230 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Parameters for creating a deployment gate. */ +@JsonPropertyOrder({ + CreateDeploymentGateParamsDataAttributes.JSON_PROPERTY_DRY_RUN, + CreateDeploymentGateParamsDataAttributes.JSON_PROPERTY_ENV, + CreateDeploymentGateParamsDataAttributes.JSON_PROPERTY_IDENTIFIER, + CreateDeploymentGateParamsDataAttributes.JSON_PROPERTY_SERVICE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateDeploymentGateParamsDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DRY_RUN = "dry_run"; + private Boolean dryRun = false; + + public static final String JSON_PROPERTY_ENV = "env"; + private String env; + + public static final String JSON_PROPERTY_IDENTIFIER = "identifier"; + private String identifier = "default"; + + public static final String JSON_PROPERTY_SERVICE = "service"; + private String service; + + public CreateDeploymentGateParamsDataAttributes() {} + + @JsonCreator + public CreateDeploymentGateParamsDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ENV) String env, + @JsonProperty(required = true, value = JSON_PROPERTY_SERVICE) String service) { + this.env = env; + this.service = service; + } + + public CreateDeploymentGateParamsDataAttributes dryRun(Boolean dryRun) { + this.dryRun = dryRun; + return this; + } + + /** + * Whether this gate is run in dry-run mode. + * + * @return dryRun + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DRY_RUN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDryRun() { + return dryRun; + } + + public void setDryRun(Boolean dryRun) { + this.dryRun = dryRun; + } + + public CreateDeploymentGateParamsDataAttributes env(String env) { + this.env = env; + return this; + } + + /** + * The environment of the deployment gate. + * + * @return env + */ + @JsonProperty(JSON_PROPERTY_ENV) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEnv() { + return env; + } + + public void setEnv(String env) { + this.env = env; + } + + public CreateDeploymentGateParamsDataAttributes identifier(String identifier) { + this.identifier = identifier; + return this; + } + + /** + * The identifier of the deployment gate. + * + * @return identifier + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDENTIFIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + public CreateDeploymentGateParamsDataAttributes service(String service) { + this.service = service; + return this; + } + + /** + * The service of the deployment gate. + * + * @return service + */ + @JsonProperty(JSON_PROPERTY_SERVICE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getService() { + return service; + } + + public void setService(String service) { + this.service = service; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateDeploymentGateParamsDataAttributes + */ + @JsonAnySetter + public CreateDeploymentGateParamsDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateDeploymentGateParamsDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDeploymentGateParamsDataAttributes createDeploymentGateParamsDataAttributes = + (CreateDeploymentGateParamsDataAttributes) o; + return Objects.equals(this.dryRun, createDeploymentGateParamsDataAttributes.dryRun) + && Objects.equals(this.env, createDeploymentGateParamsDataAttributes.env) + && Objects.equals(this.identifier, createDeploymentGateParamsDataAttributes.identifier) + && Objects.equals(this.service, createDeploymentGateParamsDataAttributes.service) + && Objects.equals( + this.additionalProperties, + createDeploymentGateParamsDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(dryRun, env, identifier, service, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDeploymentGateParamsDataAttributes {\n"); + sb.append(" dryRun: ").append(toIndentedString(dryRun)).append("\n"); + sb.append(" env: ").append(toIndentedString(env)).append("\n"); + sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); + sb.append(" service: ").append(toIndentedString(service)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateDeploymentRuleParams.java b/src/main/java/com/datadog/api/client/v2/model/CreateDeploymentRuleParams.java new file mode 100644 index 00000000000..05c5bfa34bc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateDeploymentRuleParams.java @@ -0,0 +1,137 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Parameters for creating a deployment rule. */ +@JsonPropertyOrder({CreateDeploymentRuleParams.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateDeploymentRuleParams { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CreateDeploymentRuleParamsData data; + + public CreateDeploymentRuleParams data(CreateDeploymentRuleParamsData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Parameters for creating a deployment rule. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateDeploymentRuleParamsData getData() { + return data; + } + + public void setData(CreateDeploymentRuleParamsData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateDeploymentRuleParams + */ + @JsonAnySetter + public CreateDeploymentRuleParams putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateDeploymentRuleParams object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDeploymentRuleParams createDeploymentRuleParams = (CreateDeploymentRuleParams) o; + return Objects.equals(this.data, createDeploymentRuleParams.data) + && Objects.equals( + this.additionalProperties, createDeploymentRuleParams.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDeploymentRuleParams {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateDeploymentRuleParamsData.java b/src/main/java/com/datadog/api/client/v2/model/CreateDeploymentRuleParamsData.java new file mode 100644 index 00000000000..a8feb49873b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateDeploymentRuleParamsData.java @@ -0,0 +1,184 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Parameters for creating a deployment rule. */ +@JsonPropertyOrder({ + CreateDeploymentRuleParamsData.JSON_PROPERTY_ATTRIBUTES, + CreateDeploymentRuleParamsData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateDeploymentRuleParamsData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CreateDeploymentRuleParamsDataAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DeploymentRuleDataType type; + + public CreateDeploymentRuleParamsData() {} + + @JsonCreator + public CreateDeploymentRuleParamsData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CreateDeploymentRuleParamsDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) DeploymentRuleDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CreateDeploymentRuleParamsData attributes( + CreateDeploymentRuleParamsDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Parameters for creating a deployment rule. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CreateDeploymentRuleParamsDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CreateDeploymentRuleParamsDataAttributes attributes) { + this.attributes = attributes; + } + + public CreateDeploymentRuleParamsData type(DeploymentRuleDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Deployment rule resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeploymentRuleDataType getType() { + return type; + } + + public void setType(DeploymentRuleDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateDeploymentRuleParamsData + */ + @JsonAnySetter + public CreateDeploymentRuleParamsData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateDeploymentRuleParamsData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDeploymentRuleParamsData createDeploymentRuleParamsData = + (CreateDeploymentRuleParamsData) o; + return Objects.equals(this.attributes, createDeploymentRuleParamsData.attributes) + && Objects.equals(this.type, createDeploymentRuleParamsData.type) + && Objects.equals( + this.additionalProperties, createDeploymentRuleParamsData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDeploymentRuleParamsData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateDeploymentRuleParamsDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateDeploymentRuleParamsDataAttributes.java new file mode 100644 index 00000000000..14bb4bc93e2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateDeploymentRuleParamsDataAttributes.java @@ -0,0 +1,234 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Parameters for creating a deployment rule. */ +@JsonPropertyOrder({ + CreateDeploymentRuleParamsDataAttributes.JSON_PROPERTY_DRY_RUN, + CreateDeploymentRuleParamsDataAttributes.JSON_PROPERTY_NAME, + CreateDeploymentRuleParamsDataAttributes.JSON_PROPERTY_OPTIONS, + CreateDeploymentRuleParamsDataAttributes.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateDeploymentRuleParamsDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DRY_RUN = "dry_run"; + private Boolean dryRun = false; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_OPTIONS = "options"; + private DeploymentRulesOptions options; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public CreateDeploymentRuleParamsDataAttributes() {} + + @JsonCreator + public CreateDeploymentRuleParamsDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_OPTIONS) DeploymentRulesOptions options, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.name = name; + this.options = options; + this.unparsed |= options.unparsed; + this.type = type; + } + + public CreateDeploymentRuleParamsDataAttributes dryRun(Boolean dryRun) { + this.dryRun = dryRun; + return this; + } + + /** + * Whether this rule is run in dry-run mode. + * + * @return dryRun + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DRY_RUN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDryRun() { + return dryRun; + } + + public void setDryRun(Boolean dryRun) { + this.dryRun = dryRun; + } + + public CreateDeploymentRuleParamsDataAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the deployment rule. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreateDeploymentRuleParamsDataAttributes options(DeploymentRulesOptions options) { + this.options = options; + this.unparsed |= options.unparsed; + return this; + } + + /** + * Options for deployment rule response representing either faulty deployment detection or monitor + * options. + * + * @return options + */ + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeploymentRulesOptions getOptions() { + return options; + } + + public void setOptions(DeploymentRulesOptions options) { + this.options = options; + } + + public CreateDeploymentRuleParamsDataAttributes type(String type) { + this.type = type; + return this; + } + + /** + * The type of the deployment rule (faulty_deployment_detection or monitor). + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateDeploymentRuleParamsDataAttributes + */ + @JsonAnySetter + public CreateDeploymentRuleParamsDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateDeploymentRuleParamsDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDeploymentRuleParamsDataAttributes createDeploymentRuleParamsDataAttributes = + (CreateDeploymentRuleParamsDataAttributes) o; + return Objects.equals(this.dryRun, createDeploymentRuleParamsDataAttributes.dryRun) + && Objects.equals(this.name, createDeploymentRuleParamsDataAttributes.name) + && Objects.equals(this.options, createDeploymentRuleParamsDataAttributes.options) + && Objects.equals(this.type, createDeploymentRuleParamsDataAttributes.type) + && Objects.equals( + this.additionalProperties, + createDeploymentRuleParamsDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(dryRun, name, options, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDeploymentRuleParamsDataAttributes {\n"); + sb.append(" dryRun: ").append(toIndentedString(dryRun)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeploymentGateDataType.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentGateDataType.java new file mode 100644 index 00000000000..b1b37193efc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentGateDataType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Deployment gate resource type. */ +@JsonSerialize(using = DeploymentGateDataType.DeploymentGateDataTypeSerializer.class) +public class DeploymentGateDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("deployment_gate")); + + public static final DeploymentGateDataType DEPLOYMENT_GATE = + new DeploymentGateDataType("deployment_gate"); + + DeploymentGateDataType(String value) { + super(value, allowedValues); + } + + public static class DeploymentGateDataTypeSerializer + extends StdSerializer { + public DeploymentGateDataTypeSerializer(Class t) { + super(t); + } + + public DeploymentGateDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + DeploymentGateDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static DeploymentGateDataType fromValue(String value) { + return new DeploymentGateDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeploymentGateResponse.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentGateResponse.java new file mode 100644 index 00000000000..acddc3c585e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentGateResponse.java @@ -0,0 +1,136 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response for a deployment gate. */ +@JsonPropertyOrder({DeploymentGateResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentGateResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private DeploymentGateResponseData data; + + public DeploymentGateResponse data(DeploymentGateResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for a deployment gate. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeploymentGateResponseData getData() { + return data; + } + + public void setData(DeploymentGateResponseData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DeploymentGateResponse + */ + @JsonAnySetter + public DeploymentGateResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DeploymentGateResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentGateResponse deploymentGateResponse = (DeploymentGateResponse) o; + return Objects.equals(this.data, deploymentGateResponse.data) + && Objects.equals(this.additionalProperties, deploymentGateResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentGateResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeploymentGateResponseData.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentGateResponseData.java new file mode 100644 index 00000000000..022be01ccfa --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentGateResponseData.java @@ -0,0 +1,210 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for a deployment gate. */ +@JsonPropertyOrder({ + DeploymentGateResponseData.JSON_PROPERTY_ATTRIBUTES, + DeploymentGateResponseData.JSON_PROPERTY_ID, + DeploymentGateResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentGateResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private DeploymentGateResponseDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DeploymentGateDataType type; + + public DeploymentGateResponseData() {} + + @JsonCreator + public DeploymentGateResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + DeploymentGateResponseDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) DeploymentGateDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public DeploymentGateResponseData attributes(DeploymentGateResponseDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Basic information about a deployment gate. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeploymentGateResponseDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(DeploymentGateResponseDataAttributes attributes) { + this.attributes = attributes; + } + + public DeploymentGateResponseData id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier of the deployment gate. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public DeploymentGateResponseData type(DeploymentGateDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Deployment gate resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeploymentGateDataType getType() { + return type; + } + + public void setType(DeploymentGateDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DeploymentGateResponseData + */ + @JsonAnySetter + public DeploymentGateResponseData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DeploymentGateResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentGateResponseData deploymentGateResponseData = (DeploymentGateResponseData) o; + return Objects.equals(this.attributes, deploymentGateResponseData.attributes) + && Objects.equals(this.id, deploymentGateResponseData.id) + && Objects.equals(this.type, deploymentGateResponseData.type) + && Objects.equals( + this.additionalProperties, deploymentGateResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentGateResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeploymentGateResponseDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentGateResponseDataAttributes.java new file mode 100644 index 00000000000..0f1350d70e1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentGateResponseDataAttributes.java @@ -0,0 +1,357 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Basic information about a deployment gate. */ +@JsonPropertyOrder({ + DeploymentGateResponseDataAttributes.JSON_PROPERTY_CREATED_AT, + DeploymentGateResponseDataAttributes.JSON_PROPERTY_CREATED_BY, + DeploymentGateResponseDataAttributes.JSON_PROPERTY_DRY_RUN, + DeploymentGateResponseDataAttributes.JSON_PROPERTY_ENV, + DeploymentGateResponseDataAttributes.JSON_PROPERTY_IDENTIFIER, + DeploymentGateResponseDataAttributes.JSON_PROPERTY_SERVICE, + DeploymentGateResponseDataAttributes.JSON_PROPERTY_UPDATED_AT, + DeploymentGateResponseDataAttributes.JSON_PROPERTY_UPDATED_BY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentGateResponseDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_CREATED_BY = "created_by"; + private DeploymentGateResponseDataAttributesCreatedBy createdBy; + + public static final String JSON_PROPERTY_DRY_RUN = "dry_run"; + private Boolean dryRun; + + public static final String JSON_PROPERTY_ENV = "env"; + private String env; + + public static final String JSON_PROPERTY_IDENTIFIER = "identifier"; + private String identifier; + + public static final String JSON_PROPERTY_SERVICE = "service"; + private String service; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + private OffsetDateTime updatedAt; + + public static final String JSON_PROPERTY_UPDATED_BY = "updated_by"; + private DeploymentGateResponseDataAttributesUpdatedBy updatedBy; + + public DeploymentGateResponseDataAttributes() {} + + @JsonCreator + public DeploymentGateResponseDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_BY) + DeploymentGateResponseDataAttributesCreatedBy createdBy, + @JsonProperty(required = true, value = JSON_PROPERTY_DRY_RUN) Boolean dryRun, + @JsonProperty(required = true, value = JSON_PROPERTY_ENV) String env, + @JsonProperty(required = true, value = JSON_PROPERTY_IDENTIFIER) String identifier, + @JsonProperty(required = true, value = JSON_PROPERTY_SERVICE) String service) { + this.createdAt = createdAt; + this.createdBy = createdBy; + this.unparsed |= createdBy.unparsed; + this.dryRun = dryRun; + this.env = env; + this.identifier = identifier; + this.service = service; + } + + public DeploymentGateResponseDataAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The timestamp when the deployment gate was created. + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public DeploymentGateResponseDataAttributes createdBy( + DeploymentGateResponseDataAttributesCreatedBy createdBy) { + this.createdBy = createdBy; + this.unparsed |= createdBy.unparsed; + return this; + } + + /** + * Information about the user who created the deployment gate. + * + * @return createdBy + */ + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeploymentGateResponseDataAttributesCreatedBy getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(DeploymentGateResponseDataAttributesCreatedBy createdBy) { + this.createdBy = createdBy; + } + + public DeploymentGateResponseDataAttributes dryRun(Boolean dryRun) { + this.dryRun = dryRun; + return this; + } + + /** + * Whether this gate is run in dry-run mode. + * + * @return dryRun + */ + @JsonProperty(JSON_PROPERTY_DRY_RUN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getDryRun() { + return dryRun; + } + + public void setDryRun(Boolean dryRun) { + this.dryRun = dryRun; + } + + public DeploymentGateResponseDataAttributes env(String env) { + this.env = env; + return this; + } + + /** + * The environment of the deployment gate. + * + * @return env + */ + @JsonProperty(JSON_PROPERTY_ENV) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEnv() { + return env; + } + + public void setEnv(String env) { + this.env = env; + } + + public DeploymentGateResponseDataAttributes identifier(String identifier) { + this.identifier = identifier; + return this; + } + + /** + * The identifier of the deployment gate. + * + * @return identifier + */ + @JsonProperty(JSON_PROPERTY_IDENTIFIER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + public DeploymentGateResponseDataAttributes service(String service) { + this.service = service; + return this; + } + + /** + * The service of the deployment gate. + * + * @return service + */ + @JsonProperty(JSON_PROPERTY_SERVICE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getService() { + return service; + } + + public void setService(String service) { + this.service = service; + } + + public DeploymentGateResponseDataAttributes updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * The timestamp when the deployment gate was last updated. + * + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + public DeploymentGateResponseDataAttributes updatedBy( + DeploymentGateResponseDataAttributesUpdatedBy updatedBy) { + this.updatedBy = updatedBy; + this.unparsed |= updatedBy.unparsed; + return this; + } + + /** + * Information about the user who updated the deployment gate. + * + * @return updatedBy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeploymentGateResponseDataAttributesUpdatedBy getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(DeploymentGateResponseDataAttributesUpdatedBy updatedBy) { + this.updatedBy = updatedBy; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DeploymentGateResponseDataAttributes + */ + @JsonAnySetter + public DeploymentGateResponseDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DeploymentGateResponseDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentGateResponseDataAttributes deploymentGateResponseDataAttributes = + (DeploymentGateResponseDataAttributes) o; + return Objects.equals(this.createdAt, deploymentGateResponseDataAttributes.createdAt) + && Objects.equals(this.createdBy, deploymentGateResponseDataAttributes.createdBy) + && Objects.equals(this.dryRun, deploymentGateResponseDataAttributes.dryRun) + && Objects.equals(this.env, deploymentGateResponseDataAttributes.env) + && Objects.equals(this.identifier, deploymentGateResponseDataAttributes.identifier) + && Objects.equals(this.service, deploymentGateResponseDataAttributes.service) + && Objects.equals(this.updatedAt, deploymentGateResponseDataAttributes.updatedAt) + && Objects.equals(this.updatedBy, deploymentGateResponseDataAttributes.updatedBy) + && Objects.equals( + this.additionalProperties, deploymentGateResponseDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + createdAt, + createdBy, + dryRun, + env, + identifier, + service, + updatedAt, + updatedBy, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentGateResponseDataAttributes {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" dryRun: ").append(toIndentedString(dryRun)).append("\n"); + sb.append(" env: ").append(toIndentedString(env)).append("\n"); + sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); + sb.append(" service: ").append(toIndentedString(service)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeploymentGateResponseDataAttributesCreatedBy.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentGateResponseDataAttributesCreatedBy.java new file mode 100644 index 00000000000..43866a96279 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentGateResponseDataAttributesCreatedBy.java @@ -0,0 +1,203 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Information about the user who created the deployment gate. */ +@JsonPropertyOrder({ + DeploymentGateResponseDataAttributesCreatedBy.JSON_PROPERTY_HANDLE, + DeploymentGateResponseDataAttributesCreatedBy.JSON_PROPERTY_ID, + DeploymentGateResponseDataAttributesCreatedBy.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentGateResponseDataAttributesCreatedBy { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_HANDLE = "handle"; + private String handle; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public DeploymentGateResponseDataAttributesCreatedBy() {} + + @JsonCreator + public DeploymentGateResponseDataAttributesCreatedBy( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id) { + this.id = id; + } + + public DeploymentGateResponseDataAttributesCreatedBy handle(String handle) { + this.handle = handle; + return this; + } + + /** + * The handle of the user who created the deployment rule. + * + * @return handle + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public DeploymentGateResponseDataAttributesCreatedBy id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the user who created the deployment rule. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public DeploymentGateResponseDataAttributesCreatedBy name(String name) { + this.name = name; + return this; + } + + /** + * The name of the user who created the deployment rule. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DeploymentGateResponseDataAttributesCreatedBy + */ + @JsonAnySetter + public DeploymentGateResponseDataAttributesCreatedBy putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DeploymentGateResponseDataAttributesCreatedBy object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentGateResponseDataAttributesCreatedBy deploymentGateResponseDataAttributesCreatedBy = + (DeploymentGateResponseDataAttributesCreatedBy) o; + return Objects.equals(this.handle, deploymentGateResponseDataAttributesCreatedBy.handle) + && Objects.equals(this.id, deploymentGateResponseDataAttributesCreatedBy.id) + && Objects.equals(this.name, deploymentGateResponseDataAttributesCreatedBy.name) + && Objects.equals( + this.additionalProperties, + deploymentGateResponseDataAttributesCreatedBy.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(handle, id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentGateResponseDataAttributesCreatedBy {\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeploymentGateResponseDataAttributesUpdatedBy.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentGateResponseDataAttributesUpdatedBy.java new file mode 100644 index 00000000000..5e702a3652b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentGateResponseDataAttributesUpdatedBy.java @@ -0,0 +1,203 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Information about the user who updated the deployment gate. */ +@JsonPropertyOrder({ + DeploymentGateResponseDataAttributesUpdatedBy.JSON_PROPERTY_HANDLE, + DeploymentGateResponseDataAttributesUpdatedBy.JSON_PROPERTY_ID, + DeploymentGateResponseDataAttributesUpdatedBy.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentGateResponseDataAttributesUpdatedBy { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_HANDLE = "handle"; + private String handle; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public DeploymentGateResponseDataAttributesUpdatedBy() {} + + @JsonCreator + public DeploymentGateResponseDataAttributesUpdatedBy( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id) { + this.id = id; + } + + public DeploymentGateResponseDataAttributesUpdatedBy handle(String handle) { + this.handle = handle; + return this; + } + + /** + * The handle of the user who updated the deployment rule. + * + * @return handle + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public DeploymentGateResponseDataAttributesUpdatedBy id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the user who updated the deployment rule. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public DeploymentGateResponseDataAttributesUpdatedBy name(String name) { + this.name = name; + return this; + } + + /** + * The name of the user who updated the deployment rule. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DeploymentGateResponseDataAttributesUpdatedBy + */ + @JsonAnySetter + public DeploymentGateResponseDataAttributesUpdatedBy putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DeploymentGateResponseDataAttributesUpdatedBy object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentGateResponseDataAttributesUpdatedBy deploymentGateResponseDataAttributesUpdatedBy = + (DeploymentGateResponseDataAttributesUpdatedBy) o; + return Objects.equals(this.handle, deploymentGateResponseDataAttributesUpdatedBy.handle) + && Objects.equals(this.id, deploymentGateResponseDataAttributesUpdatedBy.id) + && Objects.equals(this.name, deploymentGateResponseDataAttributesUpdatedBy.name) + && Objects.equals( + this.additionalProperties, + deploymentGateResponseDataAttributesUpdatedBy.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(handle, id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentGateResponseDataAttributesUpdatedBy {\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleDataType.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleDataType.java new file mode 100644 index 00000000000..f15a4618c9b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleDataType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Deployment rule resource type. */ +@JsonSerialize(using = DeploymentRuleDataType.DeploymentRuleDataTypeSerializer.class) +public class DeploymentRuleDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("deployment_rule")); + + public static final DeploymentRuleDataType DEPLOYMENT_RULE = + new DeploymentRuleDataType("deployment_rule"); + + DeploymentRuleDataType(String value) { + super(value, allowedValues); + } + + public static class DeploymentRuleDataTypeSerializer + extends StdSerializer { + public DeploymentRuleDataTypeSerializer(Class t) { + super(t); + } + + public DeploymentRuleDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + DeploymentRuleDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static DeploymentRuleDataType fromValue(String value) { + return new DeploymentRuleDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleOptionsFaultyDeploymentDetection.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleOptionsFaultyDeploymentDetection.java new file mode 100644 index 00000000000..d05637936a6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleOptionsFaultyDeploymentDetection.java @@ -0,0 +1,125 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Faulty deployment detection options for deployment rules. */ +@JsonPropertyOrder({ + DeploymentRuleOptionsFaultyDeploymentDetection.JSON_PROPERTY_DURATION, + DeploymentRuleOptionsFaultyDeploymentDetection.JSON_PROPERTY_EXCLUDED_RESOURCES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentRuleOptionsFaultyDeploymentDetection { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DURATION = "duration"; + private Long duration; + + public static final String JSON_PROPERTY_EXCLUDED_RESOURCES = "excluded_resources"; + private List excludedResources = null; + + public DeploymentRuleOptionsFaultyDeploymentDetection duration(Long duration) { + this.duration = duration; + return this; + } + + /** + * The duration for faulty deployment detection. + * + * @return duration + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getDuration() { + return duration; + } + + public void setDuration(Long duration) { + this.duration = duration; + } + + public DeploymentRuleOptionsFaultyDeploymentDetection excludedResources( + List excludedResources) { + this.excludedResources = excludedResources; + return this; + } + + public DeploymentRuleOptionsFaultyDeploymentDetection addExcludedResourcesItem( + String excludedResourcesItem) { + if (this.excludedResources == null) { + this.excludedResources = new ArrayList<>(); + } + this.excludedResources.add(excludedResourcesItem); + return this; + } + + /** + * Resources to exclude from faulty deployment detection. + * + * @return excludedResources + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXCLUDED_RESOURCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getExcludedResources() { + return excludedResources; + } + + public void setExcludedResources(List excludedResources) { + this.excludedResources = excludedResources; + } + + /** Return true if this DeploymentRuleOptionsFaultyDeploymentDetection object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentRuleOptionsFaultyDeploymentDetection deploymentRuleOptionsFaultyDeploymentDetection = + (DeploymentRuleOptionsFaultyDeploymentDetection) o; + return Objects.equals(this.duration, deploymentRuleOptionsFaultyDeploymentDetection.duration) + && Objects.equals( + this.excludedResources, + deploymentRuleOptionsFaultyDeploymentDetection.excludedResources); + } + + @Override + public int hashCode() { + return Objects.hash(duration, excludedResources); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentRuleOptionsFaultyDeploymentDetection {\n"); + sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); + sb.append(" excludedResources: ").append(toIndentedString(excludedResources)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleOptionsMonitor.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleOptionsMonitor.java new file mode 100644 index 00000000000..7436b00a94a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleOptionsMonitor.java @@ -0,0 +1,118 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Monitor options for deployment rules. */ +@JsonPropertyOrder({ + DeploymentRuleOptionsMonitor.JSON_PROPERTY_DURATION, + DeploymentRuleOptionsMonitor.JSON_PROPERTY_QUERY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentRuleOptionsMonitor { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DURATION = "duration"; + private Long duration; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public DeploymentRuleOptionsMonitor() {} + + @JsonCreator + public DeploymentRuleOptionsMonitor( + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) String query) { + this.query = query; + } + + public DeploymentRuleOptionsMonitor duration(Long duration) { + this.duration = duration; + return this; + } + + /** + * Seconds the monitor needs to stay in OK status for the rule to pass. + * + * @return duration + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getDuration() { + return duration; + } + + public void setDuration(Long duration) { + this.duration = duration; + } + + public DeploymentRuleOptionsMonitor query(String query) { + this.query = query; + return this; + } + + /** + * Monitors that match this query are evaluated. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + /** Return true if this DeploymentRuleOptionsMonitor object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentRuleOptionsMonitor deploymentRuleOptionsMonitor = (DeploymentRuleOptionsMonitor) o; + return Objects.equals(this.duration, deploymentRuleOptionsMonitor.duration) + && Objects.equals(this.query, deploymentRuleOptionsMonitor.query); + } + + @Override + public int hashCode() { + return Objects.hash(duration, query); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentRuleOptionsMonitor {\n"); + sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleResponse.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleResponse.java new file mode 100644 index 00000000000..9056c1c7161 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleResponse.java @@ -0,0 +1,136 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response for a deployment rule. */ +@JsonPropertyOrder({DeploymentRuleResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentRuleResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private DeploymentRuleResponseData data; + + public DeploymentRuleResponse data(DeploymentRuleResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for a deployment rule. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeploymentRuleResponseData getData() { + return data; + } + + public void setData(DeploymentRuleResponseData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DeploymentRuleResponse + */ + @JsonAnySetter + public DeploymentRuleResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DeploymentRuleResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentRuleResponse deploymentRuleResponse = (DeploymentRuleResponse) o; + return Objects.equals(this.data, deploymentRuleResponse.data) + && Objects.equals(this.additionalProperties, deploymentRuleResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentRuleResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleResponseData.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleResponseData.java new file mode 100644 index 00000000000..8bae71f026d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleResponseData.java @@ -0,0 +1,210 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for a deployment rule. */ +@JsonPropertyOrder({ + DeploymentRuleResponseData.JSON_PROPERTY_ATTRIBUTES, + DeploymentRuleResponseData.JSON_PROPERTY_ID, + DeploymentRuleResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentRuleResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private DeploymentRuleResponseDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DeploymentRuleDataType type; + + public DeploymentRuleResponseData() {} + + @JsonCreator + public DeploymentRuleResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + DeploymentRuleResponseDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) DeploymentRuleDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public DeploymentRuleResponseData attributes(DeploymentRuleResponseDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Basic information about a deployment rule. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeploymentRuleResponseDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(DeploymentRuleResponseDataAttributes attributes) { + this.attributes = attributes; + } + + public DeploymentRuleResponseData id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier of the deployment rule. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public DeploymentRuleResponseData type(DeploymentRuleDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Deployment rule resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeploymentRuleDataType getType() { + return type; + } + + public void setType(DeploymentRuleDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DeploymentRuleResponseData + */ + @JsonAnySetter + public DeploymentRuleResponseData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DeploymentRuleResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentRuleResponseData deploymentRuleResponseData = (DeploymentRuleResponseData) o; + return Objects.equals(this.attributes, deploymentRuleResponseData.attributes) + && Objects.equals(this.id, deploymentRuleResponseData.id) + && Objects.equals(this.type, deploymentRuleResponseData.type) + && Objects.equals( + this.additionalProperties, deploymentRuleResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentRuleResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleResponseDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleResponseDataAttributes.java new file mode 100644 index 00000000000..bf82bcbd45d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleResponseDataAttributes.java @@ -0,0 +1,395 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Basic information about a deployment rule. */ +@JsonPropertyOrder({ + DeploymentRuleResponseDataAttributes.JSON_PROPERTY_CREATED_AT, + DeploymentRuleResponseDataAttributes.JSON_PROPERTY_CREATED_BY, + DeploymentRuleResponseDataAttributes.JSON_PROPERTY_DRY_RUN, + DeploymentRuleResponseDataAttributes.JSON_PROPERTY_GATE_ID, + DeploymentRuleResponseDataAttributes.JSON_PROPERTY_NAME, + DeploymentRuleResponseDataAttributes.JSON_PROPERTY_OPTIONS, + DeploymentRuleResponseDataAttributes.JSON_PROPERTY_TYPE, + DeploymentRuleResponseDataAttributes.JSON_PROPERTY_UPDATED_AT, + DeploymentRuleResponseDataAttributes.JSON_PROPERTY_UPDATED_BY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentRuleResponseDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_CREATED_BY = "created_by"; + private DeploymentRuleResponseDataAttributesCreatedBy createdBy; + + public static final String JSON_PROPERTY_DRY_RUN = "dry_run"; + private Boolean dryRun; + + public static final String JSON_PROPERTY_GATE_ID = "gate_id"; + private String gateId; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_OPTIONS = "options"; + private DeploymentRulesOptions options; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DeploymentRuleResponseDataAttributesType type; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + private OffsetDateTime updatedAt; + + public static final String JSON_PROPERTY_UPDATED_BY = "updated_by"; + private DeploymentRuleResponseDataAttributesUpdatedBy updatedBy; + + public DeploymentRuleResponseDataAttributes() {} + + @JsonCreator + public DeploymentRuleResponseDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_BY) + DeploymentRuleResponseDataAttributesCreatedBy createdBy, + @JsonProperty(required = true, value = JSON_PROPERTY_DRY_RUN) Boolean dryRun, + @JsonProperty(required = true, value = JSON_PROPERTY_GATE_ID) String gateId, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_OPTIONS) DeploymentRulesOptions options, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + DeploymentRuleResponseDataAttributesType type) { + this.createdAt = createdAt; + this.createdBy = createdBy; + this.unparsed |= createdBy.unparsed; + this.dryRun = dryRun; + this.gateId = gateId; + this.name = name; + this.options = options; + this.unparsed |= options.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public DeploymentRuleResponseDataAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The timestamp when the deployment rule was created. + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public DeploymentRuleResponseDataAttributes createdBy( + DeploymentRuleResponseDataAttributesCreatedBy createdBy) { + this.createdBy = createdBy; + this.unparsed |= createdBy.unparsed; + return this; + } + + /** + * Information about the user who created the deployment rule. + * + * @return createdBy + */ + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeploymentRuleResponseDataAttributesCreatedBy getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(DeploymentRuleResponseDataAttributesCreatedBy createdBy) { + this.createdBy = createdBy; + } + + public DeploymentRuleResponseDataAttributes dryRun(Boolean dryRun) { + this.dryRun = dryRun; + return this; + } + + /** + * Whether this rule is run in dry-run mode. + * + * @return dryRun + */ + @JsonProperty(JSON_PROPERTY_DRY_RUN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getDryRun() { + return dryRun; + } + + public void setDryRun(Boolean dryRun) { + this.dryRun = dryRun; + } + + public DeploymentRuleResponseDataAttributes gateId(String gateId) { + this.gateId = gateId; + return this; + } + + /** + * The ID of the deployment gate. + * + * @return gateId + */ + @JsonProperty(JSON_PROPERTY_GATE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getGateId() { + return gateId; + } + + public void setGateId(String gateId) { + this.gateId = gateId; + } + + public DeploymentRuleResponseDataAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the deployment rule. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public DeploymentRuleResponseDataAttributes options(DeploymentRulesOptions options) { + this.options = options; + this.unparsed |= options.unparsed; + return this; + } + + /** + * Options for deployment rule response representing either faulty deployment detection or monitor + * options. + * + * @return options + */ + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeploymentRulesOptions getOptions() { + return options; + } + + public void setOptions(DeploymentRulesOptions options) { + this.options = options; + } + + public DeploymentRuleResponseDataAttributes type(DeploymentRuleResponseDataAttributesType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of the deployment rule. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeploymentRuleResponseDataAttributesType getType() { + return type; + } + + public void setType(DeploymentRuleResponseDataAttributesType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + public DeploymentRuleResponseDataAttributes updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * The timestamp when the deployment rule was last updated. + * + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + public DeploymentRuleResponseDataAttributes updatedBy( + DeploymentRuleResponseDataAttributesUpdatedBy updatedBy) { + this.updatedBy = updatedBy; + this.unparsed |= updatedBy.unparsed; + return this; + } + + /** + * Information about the user who updated the deployment rule. + * + * @return updatedBy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeploymentRuleResponseDataAttributesUpdatedBy getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(DeploymentRuleResponseDataAttributesUpdatedBy updatedBy) { + this.updatedBy = updatedBy; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DeploymentRuleResponseDataAttributes + */ + @JsonAnySetter + public DeploymentRuleResponseDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DeploymentRuleResponseDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentRuleResponseDataAttributes deploymentRuleResponseDataAttributes = + (DeploymentRuleResponseDataAttributes) o; + return Objects.equals(this.createdAt, deploymentRuleResponseDataAttributes.createdAt) + && Objects.equals(this.createdBy, deploymentRuleResponseDataAttributes.createdBy) + && Objects.equals(this.dryRun, deploymentRuleResponseDataAttributes.dryRun) + && Objects.equals(this.gateId, deploymentRuleResponseDataAttributes.gateId) + && Objects.equals(this.name, deploymentRuleResponseDataAttributes.name) + && Objects.equals(this.options, deploymentRuleResponseDataAttributes.options) + && Objects.equals(this.type, deploymentRuleResponseDataAttributes.type) + && Objects.equals(this.updatedAt, deploymentRuleResponseDataAttributes.updatedAt) + && Objects.equals(this.updatedBy, deploymentRuleResponseDataAttributes.updatedBy) + && Objects.equals( + this.additionalProperties, deploymentRuleResponseDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + createdAt, + createdBy, + dryRun, + gateId, + name, + options, + type, + updatedAt, + updatedBy, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentRuleResponseDataAttributes {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" dryRun: ").append(toIndentedString(dryRun)).append("\n"); + sb.append(" gateId: ").append(toIndentedString(gateId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleResponseDataAttributesCreatedBy.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleResponseDataAttributesCreatedBy.java new file mode 100644 index 00000000000..b98ef1ec02a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleResponseDataAttributesCreatedBy.java @@ -0,0 +1,203 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Information about the user who created the deployment rule. */ +@JsonPropertyOrder({ + DeploymentRuleResponseDataAttributesCreatedBy.JSON_PROPERTY_HANDLE, + DeploymentRuleResponseDataAttributesCreatedBy.JSON_PROPERTY_ID, + DeploymentRuleResponseDataAttributesCreatedBy.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentRuleResponseDataAttributesCreatedBy { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_HANDLE = "handle"; + private String handle; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public DeploymentRuleResponseDataAttributesCreatedBy() {} + + @JsonCreator + public DeploymentRuleResponseDataAttributesCreatedBy( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id) { + this.id = id; + } + + public DeploymentRuleResponseDataAttributesCreatedBy handle(String handle) { + this.handle = handle; + return this; + } + + /** + * The handle of the user who created the deployment rule. + * + * @return handle + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public DeploymentRuleResponseDataAttributesCreatedBy id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the user who created the deployment rule. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public DeploymentRuleResponseDataAttributesCreatedBy name(String name) { + this.name = name; + return this; + } + + /** + * The name of the user who created the deployment rule. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DeploymentRuleResponseDataAttributesCreatedBy + */ + @JsonAnySetter + public DeploymentRuleResponseDataAttributesCreatedBy putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DeploymentRuleResponseDataAttributesCreatedBy object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentRuleResponseDataAttributesCreatedBy deploymentRuleResponseDataAttributesCreatedBy = + (DeploymentRuleResponseDataAttributesCreatedBy) o; + return Objects.equals(this.handle, deploymentRuleResponseDataAttributesCreatedBy.handle) + && Objects.equals(this.id, deploymentRuleResponseDataAttributesCreatedBy.id) + && Objects.equals(this.name, deploymentRuleResponseDataAttributesCreatedBy.name) + && Objects.equals( + this.additionalProperties, + deploymentRuleResponseDataAttributesCreatedBy.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(handle, id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentRuleResponseDataAttributesCreatedBy {\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleResponseDataAttributesType.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleResponseDataAttributesType.java new file mode 100644 index 00000000000..11303902e66 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleResponseDataAttributesType.java @@ -0,0 +1,65 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The type of the deployment rule. */ +@JsonSerialize( + using = + DeploymentRuleResponseDataAttributesType.DeploymentRuleResponseDataAttributesTypeSerializer + .class) +public class DeploymentRuleResponseDataAttributesType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("faulty_deployment_detection", "monitor")); + + public static final DeploymentRuleResponseDataAttributesType FAULTY_DEPLOYMENT_DETECTION = + new DeploymentRuleResponseDataAttributesType("faulty_deployment_detection"); + public static final DeploymentRuleResponseDataAttributesType MONITOR = + new DeploymentRuleResponseDataAttributesType("monitor"); + + DeploymentRuleResponseDataAttributesType(String value) { + super(value, allowedValues); + } + + public static class DeploymentRuleResponseDataAttributesTypeSerializer + extends StdSerializer { + public DeploymentRuleResponseDataAttributesTypeSerializer( + Class t) { + super(t); + } + + public DeploymentRuleResponseDataAttributesTypeSerializer() { + this(null); + } + + @Override + public void serialize( + DeploymentRuleResponseDataAttributesType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static DeploymentRuleResponseDataAttributesType fromValue(String value) { + return new DeploymentRuleResponseDataAttributesType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleResponseDataAttributesUpdatedBy.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleResponseDataAttributesUpdatedBy.java new file mode 100644 index 00000000000..981b2387b70 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleResponseDataAttributesUpdatedBy.java @@ -0,0 +1,203 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Information about the user who updated the deployment rule. */ +@JsonPropertyOrder({ + DeploymentRuleResponseDataAttributesUpdatedBy.JSON_PROPERTY_HANDLE, + DeploymentRuleResponseDataAttributesUpdatedBy.JSON_PROPERTY_ID, + DeploymentRuleResponseDataAttributesUpdatedBy.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentRuleResponseDataAttributesUpdatedBy { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_HANDLE = "handle"; + private String handle; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public DeploymentRuleResponseDataAttributesUpdatedBy() {} + + @JsonCreator + public DeploymentRuleResponseDataAttributesUpdatedBy( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id) { + this.id = id; + } + + public DeploymentRuleResponseDataAttributesUpdatedBy handle(String handle) { + this.handle = handle; + return this; + } + + /** + * The handle of the user who updated the deployment rule. + * + * @return handle + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public DeploymentRuleResponseDataAttributesUpdatedBy id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the user who updated the deployment rule. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public DeploymentRuleResponseDataAttributesUpdatedBy name(String name) { + this.name = name; + return this; + } + + /** + * The name of the user who updated the deployment rule. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DeploymentRuleResponseDataAttributesUpdatedBy + */ + @JsonAnySetter + public DeploymentRuleResponseDataAttributesUpdatedBy putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DeploymentRuleResponseDataAttributesUpdatedBy object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentRuleResponseDataAttributesUpdatedBy deploymentRuleResponseDataAttributesUpdatedBy = + (DeploymentRuleResponseDataAttributesUpdatedBy) o; + return Objects.equals(this.handle, deploymentRuleResponseDataAttributesUpdatedBy.handle) + && Objects.equals(this.id, deploymentRuleResponseDataAttributesUpdatedBy.id) + && Objects.equals(this.name, deploymentRuleResponseDataAttributesUpdatedBy.name) + && Objects.equals( + this.additionalProperties, + deploymentRuleResponseDataAttributesUpdatedBy.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(handle, id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentRuleResponseDataAttributesUpdatedBy {\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeploymentRulesOptions.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentRulesOptions.java new file mode 100644 index 00000000000..001e810e18e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentRulesOptions.java @@ -0,0 +1,298 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize(using = DeploymentRulesOptions.DeploymentRulesOptionsDeserializer.class) +@JsonSerialize(using = DeploymentRulesOptions.DeploymentRulesOptionsSerializer.class) +public class DeploymentRulesOptions extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(DeploymentRulesOptions.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class DeploymentRulesOptionsSerializer + extends StdSerializer { + public DeploymentRulesOptionsSerializer(Class t) { + super(t); + } + + public DeploymentRulesOptionsSerializer() { + this(null); + } + + @Override + public void serialize( + DeploymentRulesOptions value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class DeploymentRulesOptionsDeserializer + extends StdDeserializer { + public DeploymentRulesOptionsDeserializer() { + this(DeploymentRulesOptions.class); + } + + public DeploymentRulesOptionsDeserializer(Class vc) { + super(vc); + } + + @Override + public DeploymentRulesOptions deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize DeploymentRuleOptionsFaultyDeploymentDetection + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (DeploymentRuleOptionsFaultyDeploymentDetection.class.equals(Integer.class) + || DeploymentRuleOptionsFaultyDeploymentDetection.class.equals(Long.class) + || DeploymentRuleOptionsFaultyDeploymentDetection.class.equals(Float.class) + || DeploymentRuleOptionsFaultyDeploymentDetection.class.equals(Double.class) + || DeploymentRuleOptionsFaultyDeploymentDetection.class.equals(Boolean.class) + || DeploymentRuleOptionsFaultyDeploymentDetection.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((DeploymentRuleOptionsFaultyDeploymentDetection.class.equals(Integer.class) + || DeploymentRuleOptionsFaultyDeploymentDetection.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((DeploymentRuleOptionsFaultyDeploymentDetection.class.equals(Float.class) + || DeploymentRuleOptionsFaultyDeploymentDetection.class.equals( + Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (DeploymentRuleOptionsFaultyDeploymentDetection.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (DeploymentRuleOptionsFaultyDeploymentDetection.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(DeploymentRuleOptionsFaultyDeploymentDetection.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((DeploymentRuleOptionsFaultyDeploymentDetection) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, + "Input data matches schema 'DeploymentRuleOptionsFaultyDeploymentDetection'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'DeploymentRuleOptionsFaultyDeploymentDetection'", + e); + } + + // deserialize DeploymentRuleOptionsMonitor + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (DeploymentRuleOptionsMonitor.class.equals(Integer.class) + || DeploymentRuleOptionsMonitor.class.equals(Long.class) + || DeploymentRuleOptionsMonitor.class.equals(Float.class) + || DeploymentRuleOptionsMonitor.class.equals(Double.class) + || DeploymentRuleOptionsMonitor.class.equals(Boolean.class) + || DeploymentRuleOptionsMonitor.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((DeploymentRuleOptionsMonitor.class.equals(Integer.class) + || DeploymentRuleOptionsMonitor.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((DeploymentRuleOptionsMonitor.class.equals(Float.class) + || DeploymentRuleOptionsMonitor.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (DeploymentRuleOptionsMonitor.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (DeploymentRuleOptionsMonitor.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(DeploymentRuleOptionsMonitor.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((DeploymentRuleOptionsMonitor) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'DeploymentRuleOptionsMonitor'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'DeploymentRuleOptionsMonitor'", e); + } + + DeploymentRulesOptions ret = new DeploymentRulesOptions(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public DeploymentRulesOptions getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "DeploymentRulesOptions cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public DeploymentRulesOptions() { + super("oneOf", Boolean.FALSE); + } + + public DeploymentRulesOptions(DeploymentRuleOptionsFaultyDeploymentDetection o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public DeploymentRulesOptions(DeploymentRuleOptionsMonitor o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put( + "DeploymentRuleOptionsFaultyDeploymentDetection", + new GenericType() {}); + schemas.put("DeploymentRuleOptionsMonitor", new GenericType() {}); + JSON.registerDescendants(DeploymentRulesOptions.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return DeploymentRulesOptions.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: DeploymentRuleOptionsFaultyDeploymentDetection, + * DeploymentRuleOptionsMonitor + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf( + DeploymentRuleOptionsFaultyDeploymentDetection.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(DeploymentRuleOptionsMonitor.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( + "Invalid instance type. Must be DeploymentRuleOptionsFaultyDeploymentDetection," + + " DeploymentRuleOptionsMonitor"); + } + + /** + * Get the actual instance, which can be the following: + * DeploymentRuleOptionsFaultyDeploymentDetection, DeploymentRuleOptionsMonitor + * + * @return The actual instance (DeploymentRuleOptionsFaultyDeploymentDetection, + * DeploymentRuleOptionsMonitor) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `DeploymentRuleOptionsFaultyDeploymentDetection`. If the actual + * instance is not `DeploymentRuleOptionsFaultyDeploymentDetection`, the ClassCastException will + * be thrown. + * + * @return The actual instance of `DeploymentRuleOptionsFaultyDeploymentDetection` + * @throws ClassCastException if the instance is not + * `DeploymentRuleOptionsFaultyDeploymentDetection` + */ + public DeploymentRuleOptionsFaultyDeploymentDetection + getDeploymentRuleOptionsFaultyDeploymentDetection() throws ClassCastException { + return (DeploymentRuleOptionsFaultyDeploymentDetection) super.getActualInstance(); + } + + /** + * Get the actual instance of `DeploymentRuleOptionsMonitor`. If the actual instance is not + * `DeploymentRuleOptionsMonitor`, the ClassCastException will be thrown. + * + * @return The actual instance of `DeploymentRuleOptionsMonitor` + * @throws ClassCastException if the instance is not `DeploymentRuleOptionsMonitor` + */ + public DeploymentRuleOptionsMonitor getDeploymentRuleOptionsMonitor() throws ClassCastException { + return (DeploymentRuleOptionsMonitor) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/HTTPCDGatesBadRequestResponse.java b/src/main/java/com/datadog/api/client/v2/model/HTTPCDGatesBadRequestResponse.java new file mode 100644 index 00000000000..e66f30f2803 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/HTTPCDGatesBadRequestResponse.java @@ -0,0 +1,150 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Bad request. */ +@JsonPropertyOrder({HTTPCDGatesBadRequestResponse.JSON_PROPERTY_ERRORS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class HTTPCDGatesBadRequestResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ERRORS = "errors"; + private List errors = null; + + public HTTPCDGatesBadRequestResponse errors(List errors) { + this.errors = errors; + for (HTTPCIAppError item : errors) { + this.unparsed |= item.unparsed; + } + return this; + } + + public HTTPCDGatesBadRequestResponse addErrorsItem(HTTPCIAppError errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(errorsItem); + this.unparsed |= errorsItem.unparsed; + return this; + } + + /** + * Structured errors. + * + * @return errors + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERRORS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getErrors() { + return errors; + } + + public void setErrors(List errors) { + this.errors = errors; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return HTTPCDGatesBadRequestResponse + */ + @JsonAnySetter + public HTTPCDGatesBadRequestResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this HTTPCDGatesBadRequestResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HTTPCDGatesBadRequestResponse httpcdGatesBadRequestResponse = (HTTPCDGatesBadRequestResponse) o; + return Objects.equals(this.errors, httpcdGatesBadRequestResponse.errors) + && Objects.equals( + this.additionalProperties, httpcdGatesBadRequestResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(errors, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HTTPCDGatesBadRequestResponse {\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/HTTPCDGatesNotFoundResponse.java b/src/main/java/com/datadog/api/client/v2/model/HTTPCDGatesNotFoundResponse.java new file mode 100644 index 00000000000..338df58c5d2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/HTTPCDGatesNotFoundResponse.java @@ -0,0 +1,150 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Deployment gate not found. */ +@JsonPropertyOrder({HTTPCDGatesNotFoundResponse.JSON_PROPERTY_ERRORS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class HTTPCDGatesNotFoundResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ERRORS = "errors"; + private List errors = null; + + public HTTPCDGatesNotFoundResponse errors(List errors) { + this.errors = errors; + for (HTTPCIAppError item : errors) { + this.unparsed |= item.unparsed; + } + return this; + } + + public HTTPCDGatesNotFoundResponse addErrorsItem(HTTPCIAppError errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(errorsItem); + this.unparsed |= errorsItem.unparsed; + return this; + } + + /** + * Structured errors. + * + * @return errors + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERRORS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getErrors() { + return errors; + } + + public void setErrors(List errors) { + this.errors = errors; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return HTTPCDGatesNotFoundResponse + */ + @JsonAnySetter + public HTTPCDGatesNotFoundResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this HTTPCDGatesNotFoundResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HTTPCDGatesNotFoundResponse httpcdGatesNotFoundResponse = (HTTPCDGatesNotFoundResponse) o; + return Objects.equals(this.errors, httpcdGatesNotFoundResponse.errors) + && Objects.equals( + this.additionalProperties, httpcdGatesNotFoundResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(errors, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HTTPCDGatesNotFoundResponse {\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/HTTPCDRulesNotFoundResponse.java b/src/main/java/com/datadog/api/client/v2/model/HTTPCDRulesNotFoundResponse.java new file mode 100644 index 00000000000..d1644c0c3ca --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/HTTPCDRulesNotFoundResponse.java @@ -0,0 +1,150 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Deployment rule not found. */ +@JsonPropertyOrder({HTTPCDRulesNotFoundResponse.JSON_PROPERTY_ERRORS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class HTTPCDRulesNotFoundResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ERRORS = "errors"; + private List errors = null; + + public HTTPCDRulesNotFoundResponse errors(List errors) { + this.errors = errors; + for (HTTPCIAppError item : errors) { + this.unparsed |= item.unparsed; + } + return this; + } + + public HTTPCDRulesNotFoundResponse addErrorsItem(HTTPCIAppError errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(errorsItem); + this.unparsed |= errorsItem.unparsed; + return this; + } + + /** + * Structured errors. + * + * @return errors + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERRORS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getErrors() { + return errors; + } + + public void setErrors(List errors) { + this.errors = errors; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return HTTPCDRulesNotFoundResponse + */ + @JsonAnySetter + public HTTPCDRulesNotFoundResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this HTTPCDRulesNotFoundResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HTTPCDRulesNotFoundResponse httpcdRulesNotFoundResponse = (HTTPCDRulesNotFoundResponse) o; + return Objects.equals(this.errors, httpcdRulesNotFoundResponse.errors) + && Objects.equals( + this.additionalProperties, httpcdRulesNotFoundResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(errors, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HTTPCDRulesNotFoundResponse {\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateDeploymentGateParams.java b/src/main/java/com/datadog/api/client/v2/model/UpdateDeploymentGateParams.java new file mode 100644 index 00000000000..2362293ccc9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateDeploymentGateParams.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Parameters for updating a deployment gate. */ +@JsonPropertyOrder({UpdateDeploymentGateParams.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateDeploymentGateParams { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private UpdateDeploymentGateParamsData data; + + public UpdateDeploymentGateParams() {} + + @JsonCreator + public UpdateDeploymentGateParams( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + UpdateDeploymentGateParamsData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public UpdateDeploymentGateParams data(UpdateDeploymentGateParamsData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Parameters for updating a deployment gate. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UpdateDeploymentGateParamsData getData() { + return data; + } + + public void setData(UpdateDeploymentGateParamsData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateDeploymentGateParams + */ + @JsonAnySetter + public UpdateDeploymentGateParams putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateDeploymentGateParams object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateDeploymentGateParams updateDeploymentGateParams = (UpdateDeploymentGateParams) o; + return Objects.equals(this.data, updateDeploymentGateParams.data) + && Objects.equals( + this.additionalProperties, updateDeploymentGateParams.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateDeploymentGateParams {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateDeploymentGateParamsData.java b/src/main/java/com/datadog/api/client/v2/model/UpdateDeploymentGateParamsData.java new file mode 100644 index 00000000000..009d314ed90 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateDeploymentGateParamsData.java @@ -0,0 +1,212 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Parameters for updating a deployment gate. */ +@JsonPropertyOrder({ + UpdateDeploymentGateParamsData.JSON_PROPERTY_ATTRIBUTES, + UpdateDeploymentGateParamsData.JSON_PROPERTY_ID, + UpdateDeploymentGateParamsData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateDeploymentGateParamsData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private UpdateDeploymentGateParamsDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DeploymentGateDataType type; + + public UpdateDeploymentGateParamsData() {} + + @JsonCreator + public UpdateDeploymentGateParamsData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + UpdateDeploymentGateParamsDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) DeploymentGateDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public UpdateDeploymentGateParamsData attributes( + UpdateDeploymentGateParamsDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for updating a deployment gate. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UpdateDeploymentGateParamsDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(UpdateDeploymentGateParamsDataAttributes attributes) { + this.attributes = attributes; + } + + public UpdateDeploymentGateParamsData id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier of the deployment gate. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public UpdateDeploymentGateParamsData type(DeploymentGateDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Deployment gate resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeploymentGateDataType getType() { + return type; + } + + public void setType(DeploymentGateDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateDeploymentGateParamsData + */ + @JsonAnySetter + public UpdateDeploymentGateParamsData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateDeploymentGateParamsData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateDeploymentGateParamsData updateDeploymentGateParamsData = + (UpdateDeploymentGateParamsData) o; + return Objects.equals(this.attributes, updateDeploymentGateParamsData.attributes) + && Objects.equals(this.id, updateDeploymentGateParamsData.id) + && Objects.equals(this.type, updateDeploymentGateParamsData.type) + && Objects.equals( + this.additionalProperties, updateDeploymentGateParamsData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateDeploymentGateParamsData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateDeploymentGateParamsDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UpdateDeploymentGateParamsDataAttributes.java new file mode 100644 index 00000000000..d534c2dfa9a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateDeploymentGateParamsDataAttributes.java @@ -0,0 +1,146 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for updating a deployment gate. */ +@JsonPropertyOrder({UpdateDeploymentGateParamsDataAttributes.JSON_PROPERTY_DRY_RUN}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateDeploymentGateParamsDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DRY_RUN = "dry_run"; + private Boolean dryRun; + + public UpdateDeploymentGateParamsDataAttributes() {} + + @JsonCreator + public UpdateDeploymentGateParamsDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_DRY_RUN) Boolean dryRun) { + this.dryRun = dryRun; + } + + public UpdateDeploymentGateParamsDataAttributes dryRun(Boolean dryRun) { + this.dryRun = dryRun; + return this; + } + + /** + * Whether to run in dry-run mode. + * + * @return dryRun + */ + @JsonProperty(JSON_PROPERTY_DRY_RUN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getDryRun() { + return dryRun; + } + + public void setDryRun(Boolean dryRun) { + this.dryRun = dryRun; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateDeploymentGateParamsDataAttributes + */ + @JsonAnySetter + public UpdateDeploymentGateParamsDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateDeploymentGateParamsDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateDeploymentGateParamsDataAttributes updateDeploymentGateParamsDataAttributes = + (UpdateDeploymentGateParamsDataAttributes) o; + return Objects.equals(this.dryRun, updateDeploymentGateParamsDataAttributes.dryRun) + && Objects.equals( + this.additionalProperties, + updateDeploymentGateParamsDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(dryRun, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateDeploymentGateParamsDataAttributes {\n"); + sb.append(" dryRun: ").append(toIndentedString(dryRun)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateDeploymentRuleParams.java b/src/main/java/com/datadog/api/client/v2/model/UpdateDeploymentRuleParams.java new file mode 100644 index 00000000000..198979f0aa3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateDeploymentRuleParams.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Parameters for updating a deployment rule. */ +@JsonPropertyOrder({UpdateDeploymentRuleParams.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateDeploymentRuleParams { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private UpdateDeploymentRuleParamsData data; + + public UpdateDeploymentRuleParams() {} + + @JsonCreator + public UpdateDeploymentRuleParams( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + UpdateDeploymentRuleParamsData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public UpdateDeploymentRuleParams data(UpdateDeploymentRuleParamsData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Parameters for updating a deployment rule. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UpdateDeploymentRuleParamsData getData() { + return data; + } + + public void setData(UpdateDeploymentRuleParamsData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateDeploymentRuleParams + */ + @JsonAnySetter + public UpdateDeploymentRuleParams putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateDeploymentRuleParams object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateDeploymentRuleParams updateDeploymentRuleParams = (UpdateDeploymentRuleParams) o; + return Objects.equals(this.data, updateDeploymentRuleParams.data) + && Objects.equals( + this.additionalProperties, updateDeploymentRuleParams.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateDeploymentRuleParams {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateDeploymentRuleParamsData.java b/src/main/java/com/datadog/api/client/v2/model/UpdateDeploymentRuleParamsData.java new file mode 100644 index 00000000000..73f8fe64ff6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateDeploymentRuleParamsData.java @@ -0,0 +1,184 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Parameters for updating a deployment rule. */ +@JsonPropertyOrder({ + UpdateDeploymentRuleParamsData.JSON_PROPERTY_ATTRIBUTES, + UpdateDeploymentRuleParamsData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateDeploymentRuleParamsData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private UpdateDeploymentRuleParamsDataAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DeploymentRuleDataType type; + + public UpdateDeploymentRuleParamsData() {} + + @JsonCreator + public UpdateDeploymentRuleParamsData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + UpdateDeploymentRuleParamsDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) DeploymentRuleDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public UpdateDeploymentRuleParamsData attributes( + UpdateDeploymentRuleParamsDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Parameters for updating a deployment rule. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UpdateDeploymentRuleParamsDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(UpdateDeploymentRuleParamsDataAttributes attributes) { + this.attributes = attributes; + } + + public UpdateDeploymentRuleParamsData type(DeploymentRuleDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Deployment rule resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeploymentRuleDataType getType() { + return type; + } + + public void setType(DeploymentRuleDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateDeploymentRuleParamsData + */ + @JsonAnySetter + public UpdateDeploymentRuleParamsData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateDeploymentRuleParamsData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateDeploymentRuleParamsData updateDeploymentRuleParamsData = + (UpdateDeploymentRuleParamsData) o; + return Objects.equals(this.attributes, updateDeploymentRuleParamsData.attributes) + && Objects.equals(this.type, updateDeploymentRuleParamsData.type) + && Objects.equals( + this.additionalProperties, updateDeploymentRuleParamsData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateDeploymentRuleParamsData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateDeploymentRuleParamsDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UpdateDeploymentRuleParamsDataAttributes.java new file mode 100644 index 00000000000..7159bb00ecc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateDeploymentRuleParamsDataAttributes.java @@ -0,0 +1,208 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Parameters for updating a deployment rule. */ +@JsonPropertyOrder({ + UpdateDeploymentRuleParamsDataAttributes.JSON_PROPERTY_DRY_RUN, + UpdateDeploymentRuleParamsDataAttributes.JSON_PROPERTY_NAME, + UpdateDeploymentRuleParamsDataAttributes.JSON_PROPERTY_OPTIONS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateDeploymentRuleParamsDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DRY_RUN = "dry_run"; + private Boolean dryRun; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_OPTIONS = "options"; + private DeploymentRulesOptions options; + + public UpdateDeploymentRuleParamsDataAttributes() {} + + @JsonCreator + public UpdateDeploymentRuleParamsDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_DRY_RUN) Boolean dryRun, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_OPTIONS) + DeploymentRulesOptions options) { + this.dryRun = dryRun; + this.name = name; + this.options = options; + this.unparsed |= options.unparsed; + } + + public UpdateDeploymentRuleParamsDataAttributes dryRun(Boolean dryRun) { + this.dryRun = dryRun; + return this; + } + + /** + * Whether to run this rule in dry-run mode. + * + * @return dryRun + */ + @JsonProperty(JSON_PROPERTY_DRY_RUN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getDryRun() { + return dryRun; + } + + public void setDryRun(Boolean dryRun) { + this.dryRun = dryRun; + } + + public UpdateDeploymentRuleParamsDataAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the deployment rule. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public UpdateDeploymentRuleParamsDataAttributes options(DeploymentRulesOptions options) { + this.options = options; + this.unparsed |= options.unparsed; + return this; + } + + /** + * Options for deployment rule response representing either faulty deployment detection or monitor + * options. + * + * @return options + */ + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeploymentRulesOptions getOptions() { + return options; + } + + public void setOptions(DeploymentRulesOptions options) { + this.options = options; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateDeploymentRuleParamsDataAttributes + */ + @JsonAnySetter + public UpdateDeploymentRuleParamsDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateDeploymentRuleParamsDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateDeploymentRuleParamsDataAttributes updateDeploymentRuleParamsDataAttributes = + (UpdateDeploymentRuleParamsDataAttributes) o; + return Objects.equals(this.dryRun, updateDeploymentRuleParamsDataAttributes.dryRun) + && Objects.equals(this.name, updateDeploymentRuleParamsDataAttributes.name) + && Objects.equals(this.options, updateDeploymentRuleParamsDataAttributes.options) + && Objects.equals( + this.additionalProperties, + updateDeploymentRuleParamsDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(dryRun, name, options, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateDeploymentRuleParamsDataAttributes {\n"); + sb.append(" dryRun: ").append(toIndentedString(dryRun)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/cassettes/features/v2/Create_deployment_gate_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Create_deployment_gate_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..3c155e79017 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_deployment_gate_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-10-28T14:03:25.410Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_deployment_gate_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Create_deployment_gate_returns_Bad_Request_response.json new file mode 100644 index 00000000000..20e1414a1f3 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_deployment_gate_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"env\":\"\",\"identifier\":\"my-gate\",\"service\":\"test-service\"},\"type\":\"deployment_gate\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"env\\\" is required\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6d773a52-8027-f1e4-6c21-9fb0abee8579" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_deployment_gate_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Create_deployment_gate_returns_OK_response.freeze new file mode 100644 index 00000000000..89457259cee --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_deployment_gate_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-10-28T14:03:26.103Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_deployment_gate_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Create_deployment_gate_returns_OK_response.json new file mode 100644 index 00000000000..c0969499810 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_deployment_gate_returns_OK_response.json @@ -0,0 +1,53 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-1\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e8fb7fa6-0b10-2413-da27-b9f59ff3d533" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/0cc075c2-fec1-4ed3-9e43-0882646fac07", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e3bbf4ce-f843-4084-dcf9-7fce973633d8" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..70cc3602d60 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-10-28T14:51:12.459Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_Bad_Request_response.json new file mode 100644 index 00000000000..09fff71070a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_Bad_Request_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "70acb264-a190-c950-4530-585b68c408c5" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"name\":\"test\",\"options\":{\"excluded_resources\":[]},\"type\":\"fdd\"},\"type\":\"deployment_rule\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates/c7d0bed9-01dc-45d5-88ad-242123881f81/rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"type\\\" must be one of \\\"monitor faulty_deployment_detection\\\"\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "4b327a76-c9fa-e0b3-4007-4881b6c955cf" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/c7d0bed9-01dc-45d5-88ad-242123881f81", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6fd06ae0-7209-b003-8c7d-f57e1adc7c10" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_OK_response.freeze new file mode 100644 index 00000000000..44db2e7bb5f --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-10-28T14:51:13.363Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_OK_response.json new file mode 100644 index 00000000000..1574a3956a9 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_OK_response.json @@ -0,0 +1,104 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "70acb264-a190-c950-4530-585b68c408bf" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"name\":\"My deployment rule\",\"options\":{\"excluded_resources\":[]},\"type\":\"faulty_deployment_detection\"},\"type\":\"deployment_rule\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates/58066a8e-44e7-4119-8ac6-a5ecc3b31c1b/rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a1ccd12a-7983-6f5c-10aa-48b476b8a478" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/58066a8e-44e7-4119-8ac6-a5ecc3b31c1b/rules/8330bf79-6906-4cea-85d5-a4da6767458e", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "8b403cc9-8e59-2b75-b680-b567c7637e14" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/58066a8e-44e7-4119-8ac6-a5ecc3b31c1b", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "35fb0c52-36b4-db7c-9489-9e6b8c393fe5" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..a5e028feae2 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-10-28T14:03:29.170Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_Bad_Request_response.json new file mode 100644 index 00000000000..a1867ea3ef7 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_Bad_Request_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/invalid-gate-id", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"id\\\" Invalid id\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a7bb4f92-5379-41a5-0187-bfc1bbffbeee" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_No_Content_response.freeze b/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_No_Content_response.freeze new file mode 100644 index 00000000000..88c603c5ccf --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_No_Content_response.freeze @@ -0,0 +1 @@ +2025-10-28T14:51:14.192Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_No_Content_response.json b/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_No_Content_response.json new file mode 100644 index 00000000000..39cb7236670 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_No_Content_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "70acb264-a190-c950-4530-585b68c408c7" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/dba6d48b-b7ac-4ac8-b2d5-70e45b500eed", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "06c13af0-8631-90d6-1020-1b7ddf35a59e" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/dba6d48b-b7ac-4ac8-b2d5-70e45b500eed", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"Gate does not exist\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "06c13af0-8631-90d6-1020-1b7ddf35a59f" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..8a22d65c1ac --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-10-28T14:03:30.230Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_Bad_Request_response.json new file mode 100644 index 00000000000..5d52a8fc8ea --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_Bad_Request_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/invalid-gate-id/rules/invalid-rule-id", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"gate_id\\\" Invalid id\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "addfa390-0dcb-ad10-c64c-b7be21ff7604" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_No_Content_response.freeze b/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_No_Content_response.freeze new file mode 100644 index 00000000000..6685aa65afe --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_No_Content_response.freeze @@ -0,0 +1 @@ +2025-10-28T14:51:14.630Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_No_Content_response.json b/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_No_Content_response.json new file mode 100644 index 00000000000..8680e5c5a98 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_No_Content_response.json @@ -0,0 +1,130 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "70acb264-a190-c950-4530-585b68c408c1" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"name\":\"My deployment rule\",\"options\":{\"excluded_resources\":[]},\"type\":\"faulty_deployment_detection\"},\"type\":\"deployment_rule\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates/8e202ae7-a86b-4f4a-a213-585801a42630/rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "64372ed1-5fc9-42ec-a46e-9526e5fc1dac" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/8e202ae7-a86b-4f4a-a213-585801a42630/rules/31e6717f-2eaa-45e5-9559-a55ca9d45f8d", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7750dd6b-72c8-a686-a667-9e3cd66d2694" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/8e202ae7-a86b-4f4a-a213-585801a42630/rules/31e6717f-2eaa-45e5-9559-a55ca9d45f8d", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"Rule does not exist\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7750dd6b-72c8-a686-a667-9e3cd66d2695" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/8e202ae7-a86b-4f4a-a213-585801a42630", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "dd8ed37e-3b60-352b-b1d1-b3f4c8e39a88" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..818f6bcc35a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-10-28T14:03:31.887Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_Bad_Request_response.json new file mode 100644 index 00000000000..91e9bdfc9ed --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_Bad_Request_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/deployment_gates/invalid-gate-id", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"id\\\" Invalid id\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "59b40947-90d4-685a-2b0d-e1f51f0ff6c1" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_OK_response.freeze new file mode 100644 index 00000000000..b38e931fdba --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-10-28T14:51:15.372Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_OK_response.json new file mode 100644 index 00000000000..78e19fc3664 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_OK_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "70acb264-a190-c950-4530-585b68c408c6" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/deployment_gates/ed4085c5-e8d3-4bf8-89a6-c257164d8952", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a69cb1bc-0a26-7ed9-f06d-1e6e1c5ae317" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/ed4085c5-e8d3-4bf8-89a6-c257164d8952", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "52e4fdeb-cdb5-8662-dbd8-8b5df13ce3ab" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..3246cdbd649 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-10-28T14:51:15.883Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Bad_Request_response.json new file mode 100644 index 00000000000..461f8a9d037 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Bad_Request_response.json @@ -0,0 +1,130 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "70acb264-a190-c950-4530-585b68c408be" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"name\":\"My deployment rule\",\"options\":{\"excluded_resources\":[]},\"type\":\"faulty_deployment_detection\"},\"type\":\"deployment_rule\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates/d49e6d82-2dc4-45b6-ab50-4fb09feae18e/rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "666c0abd-7c83-dd76-53a7-a000b0b18cf5" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/deployment_gates/invalid-gate-id/rules/invalid-rule-id", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"gate_id\\\" Invalid id\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "fb33a6dc-801c-60ad-beed-de2e3d4a63f4" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/d49e6d82-2dc4-45b6-ab50-4fb09feae18e/rules/611707d2-276e-4dc5-b754-db8f94eab0b5", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "3b3081f9-39d9-9c5e-d9c1-935012a85099" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/d49e6d82-2dc4-45b6-ab50-4fb09feae18e", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f13a69de-96ef-bc88-bccd-7dada289daf1" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_OK_response.freeze new file mode 100644 index 00000000000..f1e5e963932 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-10-28T14:51:16.642Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_OK_response.json new file mode 100644 index 00000000000..34ade7f81af --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_OK_response.json @@ -0,0 +1,130 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "70acb264-a190-c950-4530-585b68c408c2" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"name\":\"My deployment rule\",\"options\":{\"excluded_resources\":[]},\"type\":\"faulty_deployment_detection\"},\"type\":\"deployment_rule\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates/50df9de0-aa0c-4d7c-8fc8-811ee2ab4e56/rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c9781ea9-bfaa-1188-d56b-bb91d1421fad" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/deployment_gates/50df9de0-aa0c-4d7c-8fc8-811ee2ab4e56/rules/a38ab685-4ef9-4000-a938-740da6c37296", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "285a0976-80b4-ee66-2ad7-3bb66a7d8b0e" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/50df9de0-aa0c-4d7c-8fc8-811ee2ab4e56/rules/a38ab685-4ef9-4000-a938-740da6c37296", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "5309ca55-be59-02cd-da22-11e46b01ec30" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/50df9de0-aa0c-4d7c-8fc8-811ee2ab4e56", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ee7ee849-7148-9b99-357a-9f3a0dd6e77f" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..88eba0b9804 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-10-28T14:03:35.734Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_Bad_Request_response.json new file mode 100644 index 00000000000..38ae2024dbf --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":true},\"id\":\"invalid-gate-id\",\"type\":\"deployment_gate\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/deployment_gates/invalid-gate-id", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"id\\\" Invalid id\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "224572ce-70db-2f4b-eebc-e12f55df633f" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_OK_response.freeze new file mode 100644 index 00000000000..b67d99b534d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-10-28T14:51:17.586Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_OK_response.json new file mode 100644 index 00000000000..36a4e302150 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_OK_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "70acb264-a190-c950-4530-585b68c408c0" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false},\"id\":\"12345678-1234-1234-1234-123456789012\",\"type\":\"deployment_gate\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/deployment_gates/ef672c2e-81fc-4fcc-9690-392a9cf0d70c", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b2eddf9a-10a6-ae93-4e73-9b613b82db5b" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/ef672c2e-81fc-4fcc-9690-392a9cf0d70c", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "2cd4c09e-ed51-7fb1-3a94-2907f1e39850" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..1691ea92422 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-10-28T14:51:18.004Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Bad_Request_response.json new file mode 100644 index 00000000000..d77773d3b2e --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Bad_Request_response.json @@ -0,0 +1,134 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "70acb264-a190-c950-4530-585b68c408c4" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"name\":\"My deployment rule\",\"options\":{\"excluded_resources\":[]},\"type\":\"faulty_deployment_detection\"},\"type\":\"deployment_rule\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates/b2bd3ad3-f414-4f05-9ad6-248ed3f99f4d/rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "4d5ec8dd-7568-e165-3db8-66b89e5054a0" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"name\":\"Updated deployment rule\",\"options\":{\"excluded_resources\":[]}},\"type\":\"deployment_rule\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/deployment_gates/invalid-gate-id/rules/invalid-rule-id", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"gate_id\\\" Invalid id\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7d25d788-cd9d-6480-d821-0f5a5ca31a95" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/b2bd3ad3-f414-4f05-9ad6-248ed3f99f4d/rules/189846d6-3c19-46e8-98d1-9d05a2f43361", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "59d200b6-6705-c933-cac0-3db89a7c5766" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/b2bd3ad3-f414-4f05-9ad6-248ed3f99f4d", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c175fc7e-9e8c-cefb-e430-ba4e5818f497" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_OK_response.freeze new file mode 100644 index 00000000000..7ae0c5541e9 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-10-28T14:51:18.721Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_OK_response.json new file mode 100644 index 00000000000..2de61159014 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_OK_response.json @@ -0,0 +1,134 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "70acb264-a190-c950-4530-585b68c408c3" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"name\":\"My deployment rule\",\"options\":{\"excluded_resources\":[]},\"type\":\"faulty_deployment_detection\"},\"type\":\"deployment_rule\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/deployment_gates/301122dd-9022-40f0-886f-f9a6c227dc9a/rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ec0c5f43-e8d9-8a94-63ce-a8e99d31eb69" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"name\":\"Updated deployment rule\",\"options\":{\"excluded_resources\":[]}},\"type\":\"deployment_rule\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/deployment_gates/301122dd-9022-40f0-886f-f9a6c227dc9a/rules/483937d1-efc4-4a7c-95a6-89bd6b2e4e75", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "4d411959-683a-d10d-c42b-fd77aea1fbcb" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/301122dd-9022-40f0-886f-f9a6c227dc9a/rules/483937d1-efc4-4a7c-95a6-89bd6b2e4e75", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "97979e7e-57c7-d9bd-d1bd-4385af7df9ac" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/deployment_gates/301122dd-9022-40f0-886f-f9a6c227dc9a", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f8b7f255-e2f0-fcc6-d32d-78d9e518f898" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/deployment_gates.feature b/src/test/resources/com/datadog/api/client/v2/api/deployment_gates.feature new file mode 100644 index 00000000000..e4023c5650b --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/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/src/test/resources/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json index 7c9df160aad..dcd224b3e7d 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/given.json +++ b/src/test/resources/com/datadog/api/client/v2/api/given.json @@ -320,6 +320,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/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index f4a7f9e7f8d..26f29e81abe 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -1235,6 +1235,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": {