From eb902ce07f53efdd38aa32e96fb893f38b233553 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 19 Feb 2026 15:27:53 +0000 Subject: [PATCH] Regenerate client from commit 3b03aa8 of spec repo --- .generator/schemas/v2/openapi.yaml | 901 ++++++++++++++++++ docs/datadog_api_client.v2.api.rst | 7 + docs/datadog_api_client.v2.model.rst | 266 ++++++ .../change-management/CreateChangeRequest.py | 43 + .../CreateChangeRequestBranch.py | 28 + .../DeleteChangeRequestDecision.py | 17 + .../v2/change-management/GetChangeRequest.py | 16 + .../change-management/UpdateChangeRequest.py | 76 ++ .../UpdateChangeRequestDecision.py | 73 ++ src/datadog_api_client/configuration.py | 6 + .../v2/api/change_management_api.py | 308 ++++++ src/datadog_api_client/v2/apis/__init__.py | 2 + ...change_request_branch_create_attributes.py | 39 + .../change_request_branch_create_data.py | 52 + .../change_request_branch_create_request.py | 40 + .../change_request_branch_resource_type.py | 35 + .../v2/model/change_request_change_type.py | 41 + .../model/change_request_create_attributes.py | 129 +++ .../v2/model/change_request_create_data.py | 48 + .../v2/model/change_request_create_request.py | 40 + ...ange_request_decision_create_attributes.py | 54 ++ .../change_request_decision_create_item.py | 81 ++ ...e_request_decision_create_relationships.py | 42 + ...ange_request_decision_relationship_data.py | 46 + .../change_request_decision_relationships.py | 58 ++ .../change_request_decision_resource_type.py | 35 + ...ge_request_decision_response_attributes.py | 80 ++ .../change_request_decision_status_type.py | 41 + .../change_request_decision_update_data.py | 74 ++ ...request_decision_update_data_attributes.py | 36 + ...uest_decision_update_data_relationships.py | 40 + .../change_request_decision_update_request.py | 56 ++ .../change_request_decisions_relationship.py | 44 + .../model/change_request_included_decision.py | 76 ++ .../v2/model/change_request_included_item.py | 49 + .../v2/model/change_request_included_user.py | 54 ++ ...change_request_included_user_attributes.py | 45 + .../model/change_request_object_attributes.py | 22 + .../v2/model/change_request_relationships.py | 60 ++ .../v2/model/change_request_resource_type.py | 35 + .../v2/model/change_request_response.py | 60 ++ .../change_request_response_attributes.py | 202 ++++ .../v2/model/change_request_response_data.py | 72 ++ .../v2/model/change_request_risk_level.py | 44 + .../model/change_request_update_attributes.py | 89 ++ .../v2/model/change_request_update_data.py | 66 ++ .../change_request_update_relationships.py | 44 + .../v2/model/change_request_update_request.py | 56 ++ .../model/change_request_user_relationship.py | 41 + .../change_request_user_relationship_data.py | 41 + src/datadog_api_client/v2/models/__init__.py | 84 ++ tests/v2/features/change_management.feature | 162 ++++ tests/v2/features/undo.json | 40 + 53 files changed, 4196 insertions(+) create mode 100644 examples/v2/change-management/CreateChangeRequest.py create mode 100644 examples/v2/change-management/CreateChangeRequestBranch.py create mode 100644 examples/v2/change-management/DeleteChangeRequestDecision.py create mode 100644 examples/v2/change-management/GetChangeRequest.py create mode 100644 examples/v2/change-management/UpdateChangeRequest.py create mode 100644 examples/v2/change-management/UpdateChangeRequestDecision.py create mode 100644 src/datadog_api_client/v2/api/change_management_api.py create mode 100644 src/datadog_api_client/v2/model/change_request_branch_create_attributes.py create mode 100644 src/datadog_api_client/v2/model/change_request_branch_create_data.py create mode 100644 src/datadog_api_client/v2/model/change_request_branch_create_request.py create mode 100644 src/datadog_api_client/v2/model/change_request_branch_resource_type.py create mode 100644 src/datadog_api_client/v2/model/change_request_change_type.py create mode 100644 src/datadog_api_client/v2/model/change_request_create_attributes.py create mode 100644 src/datadog_api_client/v2/model/change_request_create_data.py create mode 100644 src/datadog_api_client/v2/model/change_request_create_request.py create mode 100644 src/datadog_api_client/v2/model/change_request_decision_create_attributes.py create mode 100644 src/datadog_api_client/v2/model/change_request_decision_create_item.py create mode 100644 src/datadog_api_client/v2/model/change_request_decision_create_relationships.py create mode 100644 src/datadog_api_client/v2/model/change_request_decision_relationship_data.py create mode 100644 src/datadog_api_client/v2/model/change_request_decision_relationships.py create mode 100644 src/datadog_api_client/v2/model/change_request_decision_resource_type.py create mode 100644 src/datadog_api_client/v2/model/change_request_decision_response_attributes.py create mode 100644 src/datadog_api_client/v2/model/change_request_decision_status_type.py create mode 100644 src/datadog_api_client/v2/model/change_request_decision_update_data.py create mode 100644 src/datadog_api_client/v2/model/change_request_decision_update_data_attributes.py create mode 100644 src/datadog_api_client/v2/model/change_request_decision_update_data_relationships.py create mode 100644 src/datadog_api_client/v2/model/change_request_decision_update_request.py create mode 100644 src/datadog_api_client/v2/model/change_request_decisions_relationship.py create mode 100644 src/datadog_api_client/v2/model/change_request_included_decision.py create mode 100644 src/datadog_api_client/v2/model/change_request_included_item.py create mode 100644 src/datadog_api_client/v2/model/change_request_included_user.py create mode 100644 src/datadog_api_client/v2/model/change_request_included_user_attributes.py create mode 100644 src/datadog_api_client/v2/model/change_request_object_attributes.py create mode 100644 src/datadog_api_client/v2/model/change_request_relationships.py create mode 100644 src/datadog_api_client/v2/model/change_request_resource_type.py create mode 100644 src/datadog_api_client/v2/model/change_request_response.py create mode 100644 src/datadog_api_client/v2/model/change_request_response_attributes.py create mode 100644 src/datadog_api_client/v2/model/change_request_response_data.py create mode 100644 src/datadog_api_client/v2/model/change_request_risk_level.py create mode 100644 src/datadog_api_client/v2/model/change_request_update_attributes.py create mode 100644 src/datadog_api_client/v2/model/change_request_update_data.py create mode 100644 src/datadog_api_client/v2/model/change_request_update_relationships.py create mode 100644 src/datadog_api_client/v2/model/change_request_update_request.py create mode 100644 src/datadog_api_client/v2/model/change_request_user_relationship.py create mode 100644 src/datadog_api_client/v2/model/change_request_user_relationship_data.py create mode 100644 tests/v2/features/change_management.feature diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a484bec1a7..22aa66aee7 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -264,6 +264,22 @@ components: required: true schema: type: string + ChangeRequestDecisionIDPathParameter: + description: The identifier of the change request decision. + example: decision-id-0 + in: path + name: decision_id + required: true + schema: + type: string + ChangeRequestIDPathParameter: + description: The identifier of the change request. + example: CHM-1234 + in: path + name: change_request_id + required: true + schema: + type: string CloudAccountID: description: Cloud Account id. in: path @@ -10567,6 +10583,626 @@ components: required: - changeEventTrigger type: object + ChangeRequestBranchCreateAttributes: + description: Attributes for creating a change request branch. + properties: + branch_name: + description: The name of the branch to create. + example: chm/CHM-1234 + type: string + repo_id: + description: The repository identifier in the format owner/repository. + example: DataDog/dd-source + type: string + required: + - repo_id + - branch_name + type: object + ChangeRequestBranchCreateData: + description: Data object to create a change request branch. + properties: + attributes: + $ref: '#/components/schemas/ChangeRequestBranchCreateAttributes' + type: + $ref: '#/components/schemas/ChangeRequestBranchResourceType' + required: + - type + - attributes + type: object + ChangeRequestBranchCreateRequest: + description: Request object to create a branch for a change request. + properties: + data: + $ref: '#/components/schemas/ChangeRequestBranchCreateData' + required: + - data + type: object + ChangeRequestBranchResourceType: + description: Change request branch resource type. + enum: + - change_request_branch + example: change_request_branch + type: string + x-enum-varnames: + - CHANGE_REQUEST_BRANCH + ChangeRequestChangeType: + description: The type of the change request. + enum: + - NORMAL + - STANDARD + - EMERGENCY + example: NORMAL + type: string + x-enum-varnames: + - NORMAL + - STANDARD + - EMERGENCY + ChangeRequestCreateAttributes: + description: Attributes for creating a change request. + properties: + change_request_linked_incident_uuid: + description: The UUID of an incident to link to the change request. + example: 00000000-0000-0000-0000-000000000000 + type: string + change_request_maintenance_window_query: + description: The maintenance window query for the change request. + example: '' + type: string + change_request_plan: + description: The plan associated with the change request. + example: 1. Deploy to staging 2. Run tests 3. Deploy to production + type: string + change_request_risk: + $ref: '#/components/schemas/ChangeRequestRiskLevel' + change_request_type: + $ref: '#/components/schemas/ChangeRequestChangeType' + description: + description: The description of the change request. + example: Deploying new payment service v2.1 + type: string + end_date: + description: The planned end date of the change request. + example: '2024-01-02T15:00:00Z' + format: date-time + type: string + project_id: + description: The project UUID to associate with the change request. + example: d4bbe1af-f36e-42f1-87c1-493ca35c320e + type: string + requested_teams: + description: A list of team handles to request decisions from. + example: + - team-handle-1 + items: + type: string + type: array + start_date: + description: The planned start date of the change request. + example: '2024-01-01T03:00:00Z' + format: date-time + type: string + title: + description: The title of the change request. + example: Deploy new payment service + type: string + required: + - title + type: object + ChangeRequestCreateData: + description: Data object to create a change request. + properties: + attributes: + $ref: '#/components/schemas/ChangeRequestCreateAttributes' + type: + $ref: '#/components/schemas/ChangeRequestResourceType' + required: + - type + - attributes + type: object + ChangeRequestCreateRequest: + description: Request object to create a change request. + properties: + data: + $ref: '#/components/schemas/ChangeRequestCreateData' + required: + - data + type: object + ChangeRequestDecisionCreateAttributes: + description: Attributes for creating a change request decision. + properties: + change_request_status: + $ref: '#/components/schemas/ChangeRequestDecisionStatusType' + request_reason: + description: The reason for requesting the decision. + example: Please review and approve this change + type: string + type: object + ChangeRequestDecisionCreateItem: + description: An included change request decision for a create or update operation. + properties: + attributes: + $ref: '#/components/schemas/ChangeRequestDecisionCreateAttributes' + id: + description: The decision identifier. + example: decision-id-0 + type: string + relationships: + $ref: '#/components/schemas/ChangeRequestDecisionCreateRelationships' + type: + $ref: '#/components/schemas/ChangeRequestDecisionResourceType' + required: + - type + - id + type: object + ChangeRequestDecisionCreateRelationships: + description: Relationships for creating a change request decision. + properties: + requested_user: + $ref: '#/components/schemas/ChangeRequestUserRelationship' + type: object + ChangeRequestDecisionRelationshipData: + description: Change request decision relationship data. + properties: + id: + description: The decision UUID. + example: decision-id-0 + type: string + type: + $ref: '#/components/schemas/ChangeRequestDecisionResourceType' + required: + - id + - type + type: object + ChangeRequestDecisionRelationships: + description: Relationships of a change request decision. + properties: + modified_by: + $ref: '#/components/schemas/ChangeRequestUserRelationship' + requested_by_user: + $ref: '#/components/schemas/ChangeRequestUserRelationship' + requested_user: + $ref: '#/components/schemas/ChangeRequestUserRelationship' + required: + - requested_user + - requested_by_user + - modified_by + type: object + ChangeRequestDecisionResourceType: + description: Change request decision resource type. + enum: + - change_request_decision + example: change_request_decision + type: string + x-enum-varnames: + - CHANGE_REQUEST_DECISION + ChangeRequestDecisionResponseAttributes: + description: Attributes of a change request decision in a response. + properties: + change_request_status: + $ref: '#/components/schemas/ChangeRequestDecisionStatusType' + decided_at: + description: Timestamp of when the decision was made. + example: '2024-01-02T00:00:00Z' + format: date-time + type: string + decision_reason: + description: The reason for the decision. + example: LGTM + type: string + deleted_at: + description: Timestamp of when the decision was deleted. + example: '0001-01-01T00:00:00Z' + format: date-time + type: string + request_reason: + description: The reason for requesting the decision. + example: Please review this change + type: string + requested_at: + description: Timestamp of when the decision was requested. + example: '2024-01-01T00:00:00Z' + format: date-time + type: string + required: + - change_request_status + - request_reason + - decision_reason + - requested_at + - decided_at + - deleted_at + type: object + ChangeRequestDecisionStatusType: + description: The status of a change request decision. + enum: + - REQUESTED + - APPROVED + - DECLINED + example: REQUESTED + type: string + x-enum-varnames: + - REQUESTED + - APPROVED + - DECLINED + ChangeRequestDecisionUpdateData: + description: Data object to update a change request decision. + properties: + attributes: + $ref: '#/components/schemas/ChangeRequestDecisionUpdateDataAttributes' + relationships: + $ref: '#/components/schemas/ChangeRequestDecisionUpdateDataRelationships' + type: + $ref: '#/components/schemas/ChangeRequestResourceType' + required: + - type + type: object + ChangeRequestDecisionUpdateDataAttributes: + description: Attributes of the parent change request for a decision update. + properties: + id: + description: The identifier of the change request. + example: CHM-1234 + type: string + type: object + ChangeRequestDecisionUpdateDataRelationships: + description: Relationships for updating a change request decision. + properties: + change_request_decisions: + $ref: '#/components/schemas/ChangeRequestDecisionsRelationship' + required: + - change_request_decisions + type: object + ChangeRequestDecisionUpdateRequest: + description: Request object to update a change request decision. + properties: + data: + $ref: '#/components/schemas/ChangeRequestDecisionUpdateData' + included: + $ref: '#/components/schemas/ChangeRequestUpdateIncluded' + required: + - data + type: object + ChangeRequestDecisionsRelationship: + description: Relationship to change request decisions. + properties: + data: + description: Array of decision relationship data. + items: + $ref: '#/components/schemas/ChangeRequestDecisionRelationshipData' + type: array + required: + - data + type: object + ChangeRequestIncluded: + description: Included resources related to the change request. + items: + $ref: '#/components/schemas/ChangeRequestIncludedItem' + type: array + ChangeRequestIncludedDecision: + description: An included change request decision resource. + properties: + attributes: + $ref: '#/components/schemas/ChangeRequestDecisionResponseAttributes' + id: + description: The decision UUID. + example: decision-id-0 + type: string + relationships: + $ref: '#/components/schemas/ChangeRequestDecisionRelationships' + type: + $ref: '#/components/schemas/ChangeRequestDecisionResourceType' + required: + - type + - id + - attributes + type: object + ChangeRequestIncludedItem: + description: An included resource item in the change request response. + oneOf: + - $ref: '#/components/schemas/ChangeRequestIncludedUser' + - $ref: '#/components/schemas/ChangeRequestIncludedDecision' + ChangeRequestIncludedUser: + description: An included user resource. + properties: + attributes: + $ref: '#/components/schemas/ChangeRequestIncludedUserAttributes' + id: + description: The user UUID. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + description: The resource type. + example: user + type: string + required: + - type + - id + - attributes + type: object + ChangeRequestIncludedUserAttributes: + description: Attributes of an included user. + properties: + email: + description: The email of the user. + example: john.doe@example.com + type: string + handle: + description: The handle of the user. + example: john.doe@example.com + type: string + name: + description: The name of the user. + example: John Doe + type: string + required: + - name + - email + - handle + type: object + ChangeRequestObjectAttributes: + additionalProperties: + items: + type: string + type: array + description: Custom attributes of the change request as key-value pairs. + type: object + ChangeRequestRelationships: + description: Relationships of a change request. + properties: + change_request_decisions: + $ref: '#/components/schemas/ChangeRequestDecisionsRelationship' + created_by: + $ref: '#/components/schemas/ChangeRequestUserRelationship' + modified_by: + $ref: '#/components/schemas/ChangeRequestUserRelationship' + required: + - created_by + - modified_by + - change_request_decisions + type: object + ChangeRequestResourceType: + description: Change request resource type. + enum: + - change_request + example: change_request + type: string + x-enum-varnames: + - CHANGE_REQUEST + ChangeRequestResponse: + description: Response object for a change request. + properties: + data: + $ref: '#/components/schemas/ChangeRequestResponseData' + included: + $ref: '#/components/schemas/ChangeRequestIncluded' + required: + - data + type: object + ChangeRequestResponseAttributes: + description: Attributes of a change request response. + properties: + archived_at: + description: Timestamp of when the change request was archived. + format: date-time + nullable: true + readOnly: true + type: string + attributes: + $ref: '#/components/schemas/ChangeRequestObjectAttributes' + change_request_linked_incident_uuid: + description: The UUID of the linked incident. + example: '' + type: string + change_request_maintenance_window_query: + description: The maintenance window query for the change request. + example: '' + type: string + change_request_plan: + description: The plan associated with the change request. + example: '' + type: string + change_request_risk: + $ref: '#/components/schemas/ChangeRequestRiskLevel' + change_request_type: + $ref: '#/components/schemas/ChangeRequestChangeType' + closed_at: + description: Timestamp of when the change request was closed. + format: date-time + nullable: true + readOnly: true + type: string + created_at: + description: Timestamp of when the change request was created. + example: '2024-01-01T00:00:00Z' + format: date-time + readOnly: true + type: string + creation_source: + description: The source from which the change request was created. + example: CS_MANUAL + type: string + description: + description: The description of the change request. + example: Deploying new payment service v2.1 + type: string + end_date: + description: The planned end date of the change request. + example: '2024-01-02T15:00:00Z' + format: date-time + type: string + key: + description: The human-readable key of the change request. + example: CHM-1234 + type: string + modified_at: + description: Timestamp of when the change request was last modified. + example: '2024-01-01T00:00:00Z' + format: date-time + readOnly: true + type: string + plan_notebook_id: + description: The notebook ID associated with the change request plan. + example: 0 + format: int64 + type: integer + priority: + description: The priority of the change request. + example: NOT_DEFINED + type: string + project_id: + description: The project UUID associated with the change request. + example: d4bbe1af-f36e-42f1-87c1-493ca35c320e + type: string + start_date: + description: The planned start date of the change request. + example: '2024-01-01T03:00:00Z' + format: date-time + type: string + status: + description: The current status of the change request. + example: OPEN + type: string + title: + description: The title of the change request. + example: Deploy new payment service + type: string + type: + description: The case type. + example: CHANGE_REQUEST + type: string + required: + - key + - title + - type + - priority + - status + - description + - creation_source + - plan_notebook_id + - project_id + - attributes + - created_at + - modified_at + - change_request_type + - change_request_risk + - change_request_plan + - change_request_linked_incident_uuid + - change_request_maintenance_window_query + type: object + ChangeRequestResponseData: + description: Data object for a change request response. + properties: + attributes: + $ref: '#/components/schemas/ChangeRequestResponseAttributes' + id: + description: The identifier of the change request. + example: CHM-1234 + type: string + relationships: + $ref: '#/components/schemas/ChangeRequestRelationships' + type: + $ref: '#/components/schemas/ChangeRequestResourceType' + required: + - id + - type + - attributes + type: object + ChangeRequestRiskLevel: + description: The risk level of the change request. + enum: + - UNDEFINED + - LOW + - MEDIUM + - HIGH + example: LOW + type: string + x-enum-varnames: + - UNDEFINED + - LOW + - MEDIUM + - HIGH + ChangeRequestUpdateAttributes: + description: Attributes for updating a change request. + properties: + change_request_plan: + description: The plan associated with the change request. + example: Updated deployment plan + type: string + change_request_risk: + $ref: '#/components/schemas/ChangeRequestRiskLevel' + change_request_type: + $ref: '#/components/schemas/ChangeRequestChangeType' + end_date: + description: The planned end date of the change request. + example: '2024-01-02T15:00:00Z' + format: date-time + type: string + id: + description: The identifier of the change request to update. + example: CHM-1234 + type: string + start_date: + description: The planned start date of the change request. + example: '2024-01-01T03:00:00Z' + format: date-time + type: string + type: object + ChangeRequestUpdateData: + description: Data object to update a change request. + properties: + attributes: + $ref: '#/components/schemas/ChangeRequestUpdateAttributes' + relationships: + $ref: '#/components/schemas/ChangeRequestUpdateRelationships' + type: + $ref: '#/components/schemas/ChangeRequestResourceType' + required: + - type + type: object + ChangeRequestUpdateIncluded: + description: Included resources for the change request update. + items: + $ref: '#/components/schemas/ChangeRequestDecisionCreateItem' + type: array + ChangeRequestUpdateRelationships: + description: Relationships for updating a change request. + properties: + change_request_decisions: + $ref: '#/components/schemas/ChangeRequestDecisionsRelationship' + type: object + ChangeRequestUpdateRequest: + description: Request object to update a change request. + properties: + data: + $ref: '#/components/schemas/ChangeRequestUpdateData' + included: + $ref: '#/components/schemas/ChangeRequestUpdateIncluded' + required: + - data + type: object + ChangeRequestUserRelationship: + description: Relationship to a user. + properties: + data: + $ref: '#/components/schemas/ChangeRequestUserRelationshipData' + required: + - data + type: object + ChangeRequestUserRelationshipData: + description: User relationship data. + nullable: true + properties: + id: + description: The user UUID. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + description: The user resource type. + example: user + type: string + required: + - id + - type + type: object ChargebackBreakdown: description: Charges breakdown. properties: @@ -74763,6 +75399,267 @@ paths: limitParam: page[limit] pageOffsetParam: page[offset] resultsPath: data + /api/v2/change-management/change-request: + post: + description: Create a new change request. + operationId: CreateChangeRequest + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChangeRequestCreateRequest' + description: Change request payload. + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/ChangeRequestResponse' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Create a change request + tags: + - Change Management + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/change-management/change-request/{change_request_id}: + get: + description: Get the details of a change request by its ID. + operationId: GetChangeRequest + parameters: + - $ref: '#/components/parameters/ChangeRequestIDPathParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ChangeRequestResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: Get a change request + tags: + - Change Management + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + patch: + description: Update the properties of a change request. + operationId: UpdateChangeRequest + parameters: + - $ref: '#/components/parameters/ChangeRequestIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChangeRequestUpdateRequest' + description: Change request update payload. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ChangeRequestResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Update a change request + tags: + - Change Management + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/change-management/change-request/{change_request_id}/branch: + post: + description: Create a new branch in a repository for a change request. + operationId: CreateChangeRequestBranch + parameters: + - $ref: '#/components/parameters/ChangeRequestIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChangeRequestBranchCreateRequest' + description: Branch creation payload. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ChangeRequestResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Create a change request branch + tags: + - Change Management + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id}: + delete: + description: Delete a decision from a change request. + operationId: DeleteChangeRequestDecision + parameters: + - $ref: '#/components/parameters/ChangeRequestIDPathParameter' + - $ref: '#/components/parameters/ChangeRequestDecisionIDPathParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ChangeRequestResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Delete a change request decision + tags: + - Change Management + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + patch: + description: Update a decision on a change request, such as approving or declining + it. + operationId: UpdateChangeRequestDecision + parameters: + - $ref: '#/components/parameters/ChangeRequestIDPathParameter' + - $ref: '#/components/parameters/ChangeRequestDecisionIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChangeRequestDecisionUpdateRequest' + description: Decision update payload. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ChangeRequestResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Update a change request decision + tags: + - Change Management + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/ci/pipeline: post: description: 'Send your pipeline event to your Datadog platform over HTTP. For @@ -105183,6 +106080,10 @@ tags: Management page](https://docs.datadoghq.com/service_management/case_management/) for more information. name: Case Management Type +- description: View and manage change requests within Change Management. See the [Case + Management page](https://docs.datadoghq.com/service_management/case_management/) + for more information. + name: Change Management - description: Configure AWS cloud authentication mappings for persona and intake authentication through the Datadog API. name: Cloud Authentication diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index 09298657ad..38db0da328 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -109,6 +109,13 @@ datadog\_api\_client.v2.api.case\_management\_type\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.change\_management\_api module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.change_management_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.ci\_visibility\_pipelines\_api module ----------------------------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 9db68f5500..5e413a37b3 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -3623,6 +3623,272 @@ datadog\_api\_client.v2.model.change\_event\_trigger\_wrapper module :members: :show-inheritance: +datadog\_api\_client.v2.model.change\_request\_branch\_create\_attributes module +-------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_branch_create_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_branch\_create\_data module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_branch_create_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_branch\_create\_request module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_branch_create_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_branch\_resource\_type module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_branch_resource_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_change\_type module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.change_request_change_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_create\_attributes module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.change_request_create_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_create\_data module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.change_request_create_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_create\_request module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_create_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_decision\_create\_attributes module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_decision_create_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_decision\_create\_item module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_decision_create_item + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_decision\_create\_relationships module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_decision_create_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_decision\_relationship\_data module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_decision_relationship_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_decision\_relationships module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_decision_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_decision\_resource\_type module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.change_request_decision_resource_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_decision\_response\_attributes module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.change_request_decision_response_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_decision\_status\_type module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_decision_status_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_decision\_update\_data module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_decision_update_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_decision\_update\_data\_attributes module +---------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_decision_update_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_decision\_update\_data\_relationships module +------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_decision_update_data_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_decision\_update\_request module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_decision_update_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_decisions\_relationship module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_decisions_relationship + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_included\_decision module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.change_request_included_decision + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_included\_item module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_included_item + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_included\_user module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_included_user + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_included\_user\_attributes module +-------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_included_user_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_object\_attributes module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.change_request_object_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_relationships module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_resource\_type module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_resource_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_response module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_response\_attributes module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_response_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_response\_data module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_risk\_level module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_risk_level + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_update\_attributes module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.change_request_update_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_update\_data module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.change_request_update_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_update\_relationships module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_update_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_update\_request module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.change_request_update_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_user\_relationship module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.change_request_user_relationship + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.change\_request\_user\_relationship\_data module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.change_request_user_relationship_data + :members: + :show-inheritance: + datadog\_api\_client.v2.model.chargeback\_breakdown module ---------------------------------------------------------- diff --git a/examples/v2/change-management/CreateChangeRequest.py b/examples/v2/change-management/CreateChangeRequest.py new file mode 100644 index 0000000000..d27f7e6ece --- /dev/null +++ b/examples/v2/change-management/CreateChangeRequest.py @@ -0,0 +1,43 @@ +""" +Create a change request returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.change_management_api import ChangeManagementApi +from datadog_api_client.v2.model.change_request_change_type import ChangeRequestChangeType +from datadog_api_client.v2.model.change_request_create_attributes import ChangeRequestCreateAttributes +from datadog_api_client.v2.model.change_request_create_data import ChangeRequestCreateData +from datadog_api_client.v2.model.change_request_create_request import ChangeRequestCreateRequest +from datadog_api_client.v2.model.change_request_resource_type import ChangeRequestResourceType +from datadog_api_client.v2.model.change_request_risk_level import ChangeRequestRiskLevel +from datetime import datetime +from dateutil.tz import tzutc + +body = ChangeRequestCreateRequest( + data=ChangeRequestCreateData( + attributes=ChangeRequestCreateAttributes( + change_request_linked_incident_uuid="00000000-0000-0000-0000-000000000000", + change_request_maintenance_window_query="", + change_request_plan="1. Deploy to staging 2. Run tests 3. Deploy to production", + change_request_risk=ChangeRequestRiskLevel.LOW, + change_request_type=ChangeRequestChangeType.NORMAL, + description="Deploying new payment service v2.1", + end_date=datetime(2024, 1, 2, 15, 0, tzinfo=tzutc()), + project_id="d4bbe1af-f36e-42f1-87c1-493ca35c320e", + requested_teams=[ + "team-handle-1", + ], + start_date=datetime(2024, 1, 1, 3, 0, tzinfo=tzutc()), + title="Deploy new payment service", + ), + type=ChangeRequestResourceType.CHANGE_REQUEST, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_change_request"] = True +with ApiClient(configuration) as api_client: + api_instance = ChangeManagementApi(api_client) + response = api_instance.create_change_request(body=body) + + print(response) diff --git a/examples/v2/change-management/CreateChangeRequestBranch.py b/examples/v2/change-management/CreateChangeRequestBranch.py new file mode 100644 index 0000000000..cfc87e17e1 --- /dev/null +++ b/examples/v2/change-management/CreateChangeRequestBranch.py @@ -0,0 +1,28 @@ +""" +Create a change request branch returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.change_management_api import ChangeManagementApi +from datadog_api_client.v2.model.change_request_branch_create_attributes import ChangeRequestBranchCreateAttributes +from datadog_api_client.v2.model.change_request_branch_create_data import ChangeRequestBranchCreateData +from datadog_api_client.v2.model.change_request_branch_create_request import ChangeRequestBranchCreateRequest +from datadog_api_client.v2.model.change_request_branch_resource_type import ChangeRequestBranchResourceType + +body = ChangeRequestBranchCreateRequest( + data=ChangeRequestBranchCreateData( + attributes=ChangeRequestBranchCreateAttributes( + branch_name="chm/CHM-1234", + repo_id="DataDog/dd-source", + ), + type=ChangeRequestBranchResourceType.CHANGE_REQUEST_BRANCH, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_change_request_branch"] = True +with ApiClient(configuration) as api_client: + api_instance = ChangeManagementApi(api_client) + response = api_instance.create_change_request_branch(change_request_id="change_request_id", body=body) + + print(response) diff --git a/examples/v2/change-management/DeleteChangeRequestDecision.py b/examples/v2/change-management/DeleteChangeRequestDecision.py new file mode 100644 index 0000000000..db1713d928 --- /dev/null +++ b/examples/v2/change-management/DeleteChangeRequestDecision.py @@ -0,0 +1,17 @@ +""" +Delete a change request decision returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.change_management_api import ChangeManagementApi + +configuration = Configuration() +configuration.unstable_operations["delete_change_request_decision"] = True +with ApiClient(configuration) as api_client: + api_instance = ChangeManagementApi(api_client) + response = api_instance.delete_change_request_decision( + change_request_id="change_request_id", + decision_id="decision_id", + ) + + print(response) diff --git a/examples/v2/change-management/GetChangeRequest.py b/examples/v2/change-management/GetChangeRequest.py new file mode 100644 index 0000000000..a2711b94c6 --- /dev/null +++ b/examples/v2/change-management/GetChangeRequest.py @@ -0,0 +1,16 @@ +""" +Get a change request returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.change_management_api import ChangeManagementApi + +configuration = Configuration() +configuration.unstable_operations["get_change_request"] = True +with ApiClient(configuration) as api_client: + api_instance = ChangeManagementApi(api_client) + response = api_instance.get_change_request( + change_request_id="change_request_id", + ) + + print(response) diff --git a/examples/v2/change-management/UpdateChangeRequest.py b/examples/v2/change-management/UpdateChangeRequest.py new file mode 100644 index 0000000000..0a5d290a35 --- /dev/null +++ b/examples/v2/change-management/UpdateChangeRequest.py @@ -0,0 +1,76 @@ +""" +Update a change request returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.change_management_api import ChangeManagementApi +from datadog_api_client.v2.model.change_request_change_type import ChangeRequestChangeType +from datadog_api_client.v2.model.change_request_decision_create_attributes import ChangeRequestDecisionCreateAttributes +from datadog_api_client.v2.model.change_request_decision_create_item import ChangeRequestDecisionCreateItem +from datadog_api_client.v2.model.change_request_decision_create_relationships import ( + ChangeRequestDecisionCreateRelationships, +) +from datadog_api_client.v2.model.change_request_decision_relationship_data import ChangeRequestDecisionRelationshipData +from datadog_api_client.v2.model.change_request_decision_resource_type import ChangeRequestDecisionResourceType +from datadog_api_client.v2.model.change_request_decision_status_type import ChangeRequestDecisionStatusType +from datadog_api_client.v2.model.change_request_decisions_relationship import ChangeRequestDecisionsRelationship +from datadog_api_client.v2.model.change_request_resource_type import ChangeRequestResourceType +from datadog_api_client.v2.model.change_request_risk_level import ChangeRequestRiskLevel +from datadog_api_client.v2.model.change_request_update_attributes import ChangeRequestUpdateAttributes +from datadog_api_client.v2.model.change_request_update_data import ChangeRequestUpdateData +from datadog_api_client.v2.model.change_request_update_relationships import ChangeRequestUpdateRelationships +from datadog_api_client.v2.model.change_request_update_request import ChangeRequestUpdateRequest +from datadog_api_client.v2.model.change_request_user_relationship import ChangeRequestUserRelationship +from datadog_api_client.v2.model.change_request_user_relationship_data import ChangeRequestUserRelationshipData +from datetime import datetime +from dateutil.tz import tzutc + +body = ChangeRequestUpdateRequest( + data=ChangeRequestUpdateData( + attributes=ChangeRequestUpdateAttributes( + change_request_plan="Updated deployment plan", + change_request_risk=ChangeRequestRiskLevel.LOW, + change_request_type=ChangeRequestChangeType.NORMAL, + end_date=datetime(2024, 1, 2, 15, 0, tzinfo=tzutc()), + id="CHM-1234", + start_date=datetime(2024, 1, 1, 3, 0, tzinfo=tzutc()), + ), + relationships=ChangeRequestUpdateRelationships( + change_request_decisions=ChangeRequestDecisionsRelationship( + data=[ + ChangeRequestDecisionRelationshipData( + id="decision-id-0", + type=ChangeRequestDecisionResourceType.CHANGE_REQUEST_DECISION, + ), + ], + ), + ), + type=ChangeRequestResourceType.CHANGE_REQUEST, + ), + included=[ + ChangeRequestDecisionCreateItem( + attributes=ChangeRequestDecisionCreateAttributes( + change_request_status=ChangeRequestDecisionStatusType.REQUESTED, + request_reason="Please review and approve this change", + ), + id="decision-id-0", + relationships=ChangeRequestDecisionCreateRelationships( + requested_user=ChangeRequestUserRelationship( + data=ChangeRequestUserRelationshipData( + id="00000000-0000-0000-0000-000000000000", + type="user", + ), + ), + ), + type=ChangeRequestDecisionResourceType.CHANGE_REQUEST_DECISION, + ), + ], +) + +configuration = Configuration() +configuration.unstable_operations["update_change_request"] = True +with ApiClient(configuration) as api_client: + api_instance = ChangeManagementApi(api_client) + response = api_instance.update_change_request(change_request_id="change_request_id", body=body) + + print(response) diff --git a/examples/v2/change-management/UpdateChangeRequestDecision.py b/examples/v2/change-management/UpdateChangeRequestDecision.py new file mode 100644 index 0000000000..438e342a1b --- /dev/null +++ b/examples/v2/change-management/UpdateChangeRequestDecision.py @@ -0,0 +1,73 @@ +""" +Update a change request decision returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.change_management_api import ChangeManagementApi +from datadog_api_client.v2.model.change_request_decision_create_attributes import ChangeRequestDecisionCreateAttributes +from datadog_api_client.v2.model.change_request_decision_create_item import ChangeRequestDecisionCreateItem +from datadog_api_client.v2.model.change_request_decision_create_relationships import ( + ChangeRequestDecisionCreateRelationships, +) +from datadog_api_client.v2.model.change_request_decision_relationship_data import ChangeRequestDecisionRelationshipData +from datadog_api_client.v2.model.change_request_decision_resource_type import ChangeRequestDecisionResourceType +from datadog_api_client.v2.model.change_request_decision_status_type import ChangeRequestDecisionStatusType +from datadog_api_client.v2.model.change_request_decision_update_data import ChangeRequestDecisionUpdateData +from datadog_api_client.v2.model.change_request_decision_update_data_attributes import ( + ChangeRequestDecisionUpdateDataAttributes, +) +from datadog_api_client.v2.model.change_request_decision_update_data_relationships import ( + ChangeRequestDecisionUpdateDataRelationships, +) +from datadog_api_client.v2.model.change_request_decision_update_request import ChangeRequestDecisionUpdateRequest +from datadog_api_client.v2.model.change_request_decisions_relationship import ChangeRequestDecisionsRelationship +from datadog_api_client.v2.model.change_request_resource_type import ChangeRequestResourceType +from datadog_api_client.v2.model.change_request_user_relationship import ChangeRequestUserRelationship +from datadog_api_client.v2.model.change_request_user_relationship_data import ChangeRequestUserRelationshipData + +body = ChangeRequestDecisionUpdateRequest( + data=ChangeRequestDecisionUpdateData( + attributes=ChangeRequestDecisionUpdateDataAttributes( + id="CHM-1234", + ), + relationships=ChangeRequestDecisionUpdateDataRelationships( + change_request_decisions=ChangeRequestDecisionsRelationship( + data=[ + ChangeRequestDecisionRelationshipData( + id="decision-id-0", + type=ChangeRequestDecisionResourceType.CHANGE_REQUEST_DECISION, + ), + ], + ), + ), + type=ChangeRequestResourceType.CHANGE_REQUEST, + ), + included=[ + ChangeRequestDecisionCreateItem( + attributes=ChangeRequestDecisionCreateAttributes( + change_request_status=ChangeRequestDecisionStatusType.REQUESTED, + request_reason="Please review and approve this change", + ), + id="decision-id-0", + relationships=ChangeRequestDecisionCreateRelationships( + requested_user=ChangeRequestUserRelationship( + data=ChangeRequestUserRelationshipData( + id="00000000-0000-0000-0000-000000000000", + type="user", + ), + ), + ), + type=ChangeRequestDecisionResourceType.CHANGE_REQUEST_DECISION, + ), + ], +) + +configuration = Configuration() +configuration.unstable_operations["update_change_request_decision"] = True +with ApiClient(configuration) as api_client: + api_instance = ChangeManagementApi(api_client) + response = api_instance.update_change_request_decision( + change_request_id="change_request_id", decision_id="decision_id", body=body + ) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 21a039a1d8..97882611f6 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -273,6 +273,12 @@ def __init__( "v2.link_jira_issue_to_case": False, "v2.move_case_to_project": False, "v2.unlink_jira_issue": False, + "v2.create_change_request": False, + "v2.create_change_request_branch": False, + "v2.delete_change_request_decision": False, + "v2.get_change_request": False, + "v2.update_change_request": False, + "v2.update_change_request_decision": False, "v2.list_aws_cloud_auth_persona_mappings": False, "v2.activate_content_pack": False, "v2.cancel_threat_hunting_job": False, diff --git a/src/datadog_api_client/v2/api/change_management_api.py b/src/datadog_api_client/v2/api/change_management_api.py new file mode 100644 index 0000000000..0a70144f9a --- /dev/null +++ b/src/datadog_api_client/v2/api/change_management_api.py @@ -0,0 +1,308 @@ +# 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. +from __future__ import annotations + +from typing import Any, Dict + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.v2.model.change_request_response import ChangeRequestResponse +from datadog_api_client.v2.model.change_request_create_request import ChangeRequestCreateRequest +from datadog_api_client.v2.model.change_request_update_request import ChangeRequestUpdateRequest +from datadog_api_client.v2.model.change_request_branch_create_request import ChangeRequestBranchCreateRequest +from datadog_api_client.v2.model.change_request_decision_update_request import ChangeRequestDecisionUpdateRequest + + +class ChangeManagementApi: + """ + View and manage change requests within Change Management. See the `Case Management page `_ for more information. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._create_change_request_endpoint = _Endpoint( + settings={ + "response_type": (ChangeRequestResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/change-management/change-request", + "operation_id": "create_change_request", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (ChangeRequestCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._create_change_request_branch_endpoint = _Endpoint( + settings={ + "response_type": (ChangeRequestResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/change-management/change-request/{change_request_id}/branch", + "operation_id": "create_change_request_branch", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "change_request_id": { + "required": True, + "openapi_types": (str,), + "attribute": "change_request_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (ChangeRequestBranchCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._delete_change_request_decision_endpoint = _Endpoint( + settings={ + "response_type": (ChangeRequestResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id}", + "operation_id": "delete_change_request_decision", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "change_request_id": { + "required": True, + "openapi_types": (str,), + "attribute": "change_request_id", + "location": "path", + }, + "decision_id": { + "required": True, + "openapi_types": (str,), + "attribute": "decision_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._get_change_request_endpoint = _Endpoint( + settings={ + "response_type": (ChangeRequestResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/change-management/change-request/{change_request_id}", + "operation_id": "get_change_request", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "change_request_id": { + "required": True, + "openapi_types": (str,), + "attribute": "change_request_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._update_change_request_endpoint = _Endpoint( + settings={ + "response_type": (ChangeRequestResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/change-management/change-request/{change_request_id}", + "operation_id": "update_change_request", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "change_request_id": { + "required": True, + "openapi_types": (str,), + "attribute": "change_request_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (ChangeRequestUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._update_change_request_decision_endpoint = _Endpoint( + settings={ + "response_type": (ChangeRequestResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id}", + "operation_id": "update_change_request_decision", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "change_request_id": { + "required": True, + "openapi_types": (str,), + "attribute": "change_request_id", + "location": "path", + }, + "decision_id": { + "required": True, + "openapi_types": (str,), + "attribute": "decision_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (ChangeRequestDecisionUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def create_change_request( + self, + body: ChangeRequestCreateRequest, + ) -> ChangeRequestResponse: + """Create a change request. + + Create a new change request. + + :param body: Change request payload. + :type body: ChangeRequestCreateRequest + :rtype: ChangeRequestResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_change_request_endpoint.call_with_http_info(**kwargs) + + def create_change_request_branch( + self, + change_request_id: str, + body: ChangeRequestBranchCreateRequest, + ) -> ChangeRequestResponse: + """Create a change request branch. + + Create a new branch in a repository for a change request. + + :param change_request_id: The identifier of the change request. + :type change_request_id: str + :param body: Branch creation payload. + :type body: ChangeRequestBranchCreateRequest + :rtype: ChangeRequestResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["change_request_id"] = change_request_id + + kwargs["body"] = body + + return self._create_change_request_branch_endpoint.call_with_http_info(**kwargs) + + def delete_change_request_decision( + self, + change_request_id: str, + decision_id: str, + ) -> ChangeRequestResponse: + """Delete a change request decision. + + Delete a decision from a change request. + + :param change_request_id: The identifier of the change request. + :type change_request_id: str + :param decision_id: The identifier of the change request decision. + :type decision_id: str + :rtype: ChangeRequestResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["change_request_id"] = change_request_id + + kwargs["decision_id"] = decision_id + + return self._delete_change_request_decision_endpoint.call_with_http_info(**kwargs) + + def get_change_request( + self, + change_request_id: str, + ) -> ChangeRequestResponse: + """Get a change request. + + Get the details of a change request by its ID. + + :param change_request_id: The identifier of the change request. + :type change_request_id: str + :rtype: ChangeRequestResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["change_request_id"] = change_request_id + + return self._get_change_request_endpoint.call_with_http_info(**kwargs) + + def update_change_request( + self, + change_request_id: str, + body: ChangeRequestUpdateRequest, + ) -> ChangeRequestResponse: + """Update a change request. + + Update the properties of a change request. + + :param change_request_id: The identifier of the change request. + :type change_request_id: str + :param body: Change request update payload. + :type body: ChangeRequestUpdateRequest + :rtype: ChangeRequestResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["change_request_id"] = change_request_id + + kwargs["body"] = body + + return self._update_change_request_endpoint.call_with_http_info(**kwargs) + + def update_change_request_decision( + self, + change_request_id: str, + decision_id: str, + body: ChangeRequestDecisionUpdateRequest, + ) -> ChangeRequestResponse: + """Update a change request decision. + + Update a decision on a change request, such as approving or declining it. + + :param change_request_id: The identifier of the change request. + :type change_request_id: str + :param decision_id: The identifier of the change request decision. + :type decision_id: str + :param body: Decision update payload. + :type body: ChangeRequestDecisionUpdateRequest + :rtype: ChangeRequestResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["change_request_id"] = change_request_id + + kwargs["decision_id"] = decision_id + + kwargs["body"] = body + + return self._update_change_request_decision_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index c8272e85ae..4cf449bfe3 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -18,6 +18,7 @@ from datadog_api_client.v2.api.case_management_api import CaseManagementApi from datadog_api_client.v2.api.case_management_attribute_api import CaseManagementAttributeApi from datadog_api_client.v2.api.case_management_type_api import CaseManagementTypeApi +from datadog_api_client.v2.api.change_management_api import ChangeManagementApi from datadog_api_client.v2.api.cloud_authentication_api import CloudAuthenticationApi from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi from datadog_api_client.v2.api.cloud_network_monitoring_api import CloudNetworkMonitoringApi @@ -120,6 +121,7 @@ "CaseManagementApi", "CaseManagementAttributeApi", "CaseManagementTypeApi", + "ChangeManagementApi", "CloudAuthenticationApi", "CloudCostManagementApi", "CloudNetworkMonitoringApi", diff --git a/src/datadog_api_client/v2/model/change_request_branch_create_attributes.py b/src/datadog_api_client/v2/model/change_request_branch_create_attributes.py new file mode 100644 index 0000000000..7fe128bd89 --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_branch_create_attributes.py @@ -0,0 +1,39 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class ChangeRequestBranchCreateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "branch_name": (str,), + "repo_id": (str,), + } + + attribute_map = { + "branch_name": "branch_name", + "repo_id": "repo_id", + } + + def __init__(self_, branch_name: str, repo_id: str, **kwargs): + """ + Attributes for creating a change request branch. + + :param branch_name: The name of the branch to create. + :type branch_name: str + + :param repo_id: The repository identifier in the format owner/repository. + :type repo_id: str + """ + super().__init__(kwargs) + + self_.branch_name = branch_name + self_.repo_id = repo_id diff --git a/src/datadog_api_client/v2/model/change_request_branch_create_data.py b/src/datadog_api_client/v2/model/change_request_branch_create_data.py new file mode 100644 index 0000000000..2de6095358 --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_branch_create_data.py @@ -0,0 +1,52 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_branch_create_attributes import ChangeRequestBranchCreateAttributes + from datadog_api_client.v2.model.change_request_branch_resource_type import ChangeRequestBranchResourceType + + +class ChangeRequestBranchCreateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_branch_create_attributes import ( + ChangeRequestBranchCreateAttributes, + ) + from datadog_api_client.v2.model.change_request_branch_resource_type import ChangeRequestBranchResourceType + + return { + "attributes": (ChangeRequestBranchCreateAttributes,), + "type": (ChangeRequestBranchResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, attributes: ChangeRequestBranchCreateAttributes, type: ChangeRequestBranchResourceType, **kwargs + ): + """ + Data object to create a change request branch. + + :param attributes: Attributes for creating a change request branch. + :type attributes: ChangeRequestBranchCreateAttributes + + :param type: Change request branch resource type. + :type type: ChangeRequestBranchResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/change_request_branch_create_request.py b/src/datadog_api_client/v2/model/change_request_branch_create_request.py new file mode 100644 index 0000000000..1b3db12507 --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_branch_create_request.py @@ -0,0 +1,40 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_branch_create_data import ChangeRequestBranchCreateData + + +class ChangeRequestBranchCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_branch_create_data import ChangeRequestBranchCreateData + + return { + "data": (ChangeRequestBranchCreateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ChangeRequestBranchCreateData, **kwargs): + """ + Request object to create a branch for a change request. + + :param data: Data object to create a change request branch. + :type data: ChangeRequestBranchCreateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/change_request_branch_resource_type.py b/src/datadog_api_client/v2/model/change_request_branch_resource_type.py new file mode 100644 index 0000000000..9328478e3a --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_branch_resource_type.py @@ -0,0 +1,35 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ChangeRequestBranchResourceType(ModelSimple): + """ + Change request branch resource type. + + :param value: If omitted defaults to "change_request_branch". Must be one of ["change_request_branch"]. + :type value: str + """ + + allowed_values = { + "change_request_branch", + } + CHANGE_REQUEST_BRANCH: ClassVar["ChangeRequestBranchResourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ChangeRequestBranchResourceType.CHANGE_REQUEST_BRANCH = ChangeRequestBranchResourceType("change_request_branch") diff --git a/src/datadog_api_client/v2/model/change_request_change_type.py b/src/datadog_api_client/v2/model/change_request_change_type.py new file mode 100644 index 0000000000..b7cec11898 --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_change_type.py @@ -0,0 +1,41 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ChangeRequestChangeType(ModelSimple): + """ + The type of the change request. + + :param value: Must be one of ["NORMAL", "STANDARD", "EMERGENCY"]. + :type value: str + """ + + allowed_values = { + "NORMAL", + "STANDARD", + "EMERGENCY", + } + NORMAL: ClassVar["ChangeRequestChangeType"] + STANDARD: ClassVar["ChangeRequestChangeType"] + EMERGENCY: ClassVar["ChangeRequestChangeType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ChangeRequestChangeType.NORMAL = ChangeRequestChangeType("NORMAL") +ChangeRequestChangeType.STANDARD = ChangeRequestChangeType("STANDARD") +ChangeRequestChangeType.EMERGENCY = ChangeRequestChangeType("EMERGENCY") diff --git a/src/datadog_api_client/v2/model/change_request_create_attributes.py b/src/datadog_api_client/v2/model/change_request_create_attributes.py new file mode 100644 index 0000000000..06e11f1b22 --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_create_attributes.py @@ -0,0 +1,129 @@ +# 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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_risk_level import ChangeRequestRiskLevel + from datadog_api_client.v2.model.change_request_change_type import ChangeRequestChangeType + + +class ChangeRequestCreateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_risk_level import ChangeRequestRiskLevel + from datadog_api_client.v2.model.change_request_change_type import ChangeRequestChangeType + + return { + "change_request_linked_incident_uuid": (str,), + "change_request_maintenance_window_query": (str,), + "change_request_plan": (str,), + "change_request_risk": (ChangeRequestRiskLevel,), + "change_request_type": (ChangeRequestChangeType,), + "description": (str,), + "end_date": (datetime,), + "project_id": (str,), + "requested_teams": ([str],), + "start_date": (datetime,), + "title": (str,), + } + + attribute_map = { + "change_request_linked_incident_uuid": "change_request_linked_incident_uuid", + "change_request_maintenance_window_query": "change_request_maintenance_window_query", + "change_request_plan": "change_request_plan", + "change_request_risk": "change_request_risk", + "change_request_type": "change_request_type", + "description": "description", + "end_date": "end_date", + "project_id": "project_id", + "requested_teams": "requested_teams", + "start_date": "start_date", + "title": "title", + } + + def __init__( + self_, + title: str, + change_request_linked_incident_uuid: Union[str, UnsetType] = unset, + change_request_maintenance_window_query: Union[str, UnsetType] = unset, + change_request_plan: Union[str, UnsetType] = unset, + change_request_risk: Union[ChangeRequestRiskLevel, UnsetType] = unset, + change_request_type: Union[ChangeRequestChangeType, UnsetType] = unset, + description: Union[str, UnsetType] = unset, + end_date: Union[datetime, UnsetType] = unset, + project_id: Union[str, UnsetType] = unset, + requested_teams: Union[List[str], UnsetType] = unset, + start_date: Union[datetime, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for creating a change request. + + :param change_request_linked_incident_uuid: The UUID of an incident to link to the change request. + :type change_request_linked_incident_uuid: str, optional + + :param change_request_maintenance_window_query: The maintenance window query for the change request. + :type change_request_maintenance_window_query: str, optional + + :param change_request_plan: The plan associated with the change request. + :type change_request_plan: str, optional + + :param change_request_risk: The risk level of the change request. + :type change_request_risk: ChangeRequestRiskLevel, optional + + :param change_request_type: The type of the change request. + :type change_request_type: ChangeRequestChangeType, optional + + :param description: The description of the change request. + :type description: str, optional + + :param end_date: The planned end date of the change request. + :type end_date: datetime, optional + + :param project_id: The project UUID to associate with the change request. + :type project_id: str, optional + + :param requested_teams: A list of team handles to request decisions from. + :type requested_teams: [str], optional + + :param start_date: The planned start date of the change request. + :type start_date: datetime, optional + + :param title: The title of the change request. + :type title: str + """ + if change_request_linked_incident_uuid is not unset: + kwargs["change_request_linked_incident_uuid"] = change_request_linked_incident_uuid + if change_request_maintenance_window_query is not unset: + kwargs["change_request_maintenance_window_query"] = change_request_maintenance_window_query + if change_request_plan is not unset: + kwargs["change_request_plan"] = change_request_plan + if change_request_risk is not unset: + kwargs["change_request_risk"] = change_request_risk + if change_request_type is not unset: + kwargs["change_request_type"] = change_request_type + if description is not unset: + kwargs["description"] = description + if end_date is not unset: + kwargs["end_date"] = end_date + if project_id is not unset: + kwargs["project_id"] = project_id + if requested_teams is not unset: + kwargs["requested_teams"] = requested_teams + if start_date is not unset: + kwargs["start_date"] = start_date + super().__init__(kwargs) + + self_.title = title diff --git a/src/datadog_api_client/v2/model/change_request_create_data.py b/src/datadog_api_client/v2/model/change_request_create_data.py new file mode 100644 index 0000000000..a2157a3922 --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_create_data.py @@ -0,0 +1,48 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_create_attributes import ChangeRequestCreateAttributes + from datadog_api_client.v2.model.change_request_resource_type import ChangeRequestResourceType + + +class ChangeRequestCreateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_create_attributes import ChangeRequestCreateAttributes + from datadog_api_client.v2.model.change_request_resource_type import ChangeRequestResourceType + + return { + "attributes": (ChangeRequestCreateAttributes,), + "type": (ChangeRequestResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: ChangeRequestCreateAttributes, type: ChangeRequestResourceType, **kwargs): + """ + Data object to create a change request. + + :param attributes: Attributes for creating a change request. + :type attributes: ChangeRequestCreateAttributes + + :param type: Change request resource type. + :type type: ChangeRequestResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/change_request_create_request.py b/src/datadog_api_client/v2/model/change_request_create_request.py new file mode 100644 index 0000000000..8128aa6f82 --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_create_request.py @@ -0,0 +1,40 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_create_data import ChangeRequestCreateData + + +class ChangeRequestCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_create_data import ChangeRequestCreateData + + return { + "data": (ChangeRequestCreateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ChangeRequestCreateData, **kwargs): + """ + Request object to create a change request. + + :param data: Data object to create a change request. + :type data: ChangeRequestCreateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/change_request_decision_create_attributes.py b/src/datadog_api_client/v2/model/change_request_decision_create_attributes.py new file mode 100644 index 0000000000..4ffe017f92 --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_decision_create_attributes.py @@ -0,0 +1,54 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_decision_status_type import ChangeRequestDecisionStatusType + + +class ChangeRequestDecisionCreateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_decision_status_type import ChangeRequestDecisionStatusType + + return { + "change_request_status": (ChangeRequestDecisionStatusType,), + "request_reason": (str,), + } + + attribute_map = { + "change_request_status": "change_request_status", + "request_reason": "request_reason", + } + + def __init__( + self_, + change_request_status: Union[ChangeRequestDecisionStatusType, UnsetType] = unset, + request_reason: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for creating a change request decision. + + :param change_request_status: The status of a change request decision. + :type change_request_status: ChangeRequestDecisionStatusType, optional + + :param request_reason: The reason for requesting the decision. + :type request_reason: str, optional + """ + if change_request_status is not unset: + kwargs["change_request_status"] = change_request_status + if request_reason is not unset: + kwargs["request_reason"] = request_reason + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/change_request_decision_create_item.py b/src/datadog_api_client/v2/model/change_request_decision_create_item.py new file mode 100644 index 0000000000..205162cc1e --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_decision_create_item.py @@ -0,0 +1,81 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_decision_create_attributes import ( + ChangeRequestDecisionCreateAttributes, + ) + from datadog_api_client.v2.model.change_request_decision_create_relationships import ( + ChangeRequestDecisionCreateRelationships, + ) + from datadog_api_client.v2.model.change_request_decision_resource_type import ChangeRequestDecisionResourceType + + +class ChangeRequestDecisionCreateItem(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_decision_create_attributes import ( + ChangeRequestDecisionCreateAttributes, + ) + from datadog_api_client.v2.model.change_request_decision_create_relationships import ( + ChangeRequestDecisionCreateRelationships, + ) + from datadog_api_client.v2.model.change_request_decision_resource_type import ChangeRequestDecisionResourceType + + return { + "attributes": (ChangeRequestDecisionCreateAttributes,), + "id": (str,), + "relationships": (ChangeRequestDecisionCreateRelationships,), + "type": (ChangeRequestDecisionResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + id: str, + type: ChangeRequestDecisionResourceType, + attributes: Union[ChangeRequestDecisionCreateAttributes, UnsetType] = unset, + relationships: Union[ChangeRequestDecisionCreateRelationships, UnsetType] = unset, + **kwargs, + ): + """ + An included change request decision for a create or update operation. + + :param attributes: Attributes for creating a change request decision. + :type attributes: ChangeRequestDecisionCreateAttributes, optional + + :param id: The decision identifier. + :type id: str + + :param relationships: Relationships for creating a change request decision. + :type relationships: ChangeRequestDecisionCreateRelationships, optional + + :param type: Change request decision resource type. + :type type: ChangeRequestDecisionResourceType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/change_request_decision_create_relationships.py b/src/datadog_api_client/v2/model/change_request_decision_create_relationships.py new file mode 100644 index 0000000000..c772607a1e --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_decision_create_relationships.py @@ -0,0 +1,42 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_user_relationship import ChangeRequestUserRelationship + + +class ChangeRequestDecisionCreateRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_user_relationship import ChangeRequestUserRelationship + + return { + "requested_user": (ChangeRequestUserRelationship,), + } + + attribute_map = { + "requested_user": "requested_user", + } + + def __init__(self_, requested_user: Union[ChangeRequestUserRelationship, UnsetType] = unset, **kwargs): + """ + Relationships for creating a change request decision. + + :param requested_user: Relationship to a user. + :type requested_user: ChangeRequestUserRelationship, optional + """ + if requested_user is not unset: + kwargs["requested_user"] = requested_user + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/change_request_decision_relationship_data.py b/src/datadog_api_client/v2/model/change_request_decision_relationship_data.py new file mode 100644 index 0000000000..cf6c5933cf --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_decision_relationship_data.py @@ -0,0 +1,46 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_decision_resource_type import ChangeRequestDecisionResourceType + + +class ChangeRequestDecisionRelationshipData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_decision_resource_type import ChangeRequestDecisionResourceType + + return { + "id": (str,), + "type": (ChangeRequestDecisionResourceType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: ChangeRequestDecisionResourceType, **kwargs): + """ + Change request decision relationship data. + + :param id: The decision UUID. + :type id: str + + :param type: Change request decision resource type. + :type type: ChangeRequestDecisionResourceType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/change_request_decision_relationships.py b/src/datadog_api_client/v2/model/change_request_decision_relationships.py new file mode 100644 index 0000000000..d603688594 --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_decision_relationships.py @@ -0,0 +1,58 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_user_relationship import ChangeRequestUserRelationship + + +class ChangeRequestDecisionRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_user_relationship import ChangeRequestUserRelationship + + return { + "modified_by": (ChangeRequestUserRelationship,), + "requested_by_user": (ChangeRequestUserRelationship,), + "requested_user": (ChangeRequestUserRelationship,), + } + + attribute_map = { + "modified_by": "modified_by", + "requested_by_user": "requested_by_user", + "requested_user": "requested_user", + } + + def __init__( + self_, + modified_by: ChangeRequestUserRelationship, + requested_by_user: ChangeRequestUserRelationship, + requested_user: ChangeRequestUserRelationship, + **kwargs, + ): + """ + Relationships of a change request decision. + + :param modified_by: Relationship to a user. + :type modified_by: ChangeRequestUserRelationship + + :param requested_by_user: Relationship to a user. + :type requested_by_user: ChangeRequestUserRelationship + + :param requested_user: Relationship to a user. + :type requested_user: ChangeRequestUserRelationship + """ + super().__init__(kwargs) + + self_.modified_by = modified_by + self_.requested_by_user = requested_by_user + self_.requested_user = requested_user diff --git a/src/datadog_api_client/v2/model/change_request_decision_resource_type.py b/src/datadog_api_client/v2/model/change_request_decision_resource_type.py new file mode 100644 index 0000000000..19a801c75c --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_decision_resource_type.py @@ -0,0 +1,35 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ChangeRequestDecisionResourceType(ModelSimple): + """ + Change request decision resource type. + + :param value: If omitted defaults to "change_request_decision". Must be one of ["change_request_decision"]. + :type value: str + """ + + allowed_values = { + "change_request_decision", + } + CHANGE_REQUEST_DECISION: ClassVar["ChangeRequestDecisionResourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ChangeRequestDecisionResourceType.CHANGE_REQUEST_DECISION = ChangeRequestDecisionResourceType("change_request_decision") diff --git a/src/datadog_api_client/v2/model/change_request_decision_response_attributes.py b/src/datadog_api_client/v2/model/change_request_decision_response_attributes.py new file mode 100644 index 0000000000..e8f2f0d8eb --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_decision_response_attributes.py @@ -0,0 +1,80 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_decision_status_type import ChangeRequestDecisionStatusType + + +class ChangeRequestDecisionResponseAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_decision_status_type import ChangeRequestDecisionStatusType + + return { + "change_request_status": (ChangeRequestDecisionStatusType,), + "decided_at": (datetime,), + "decision_reason": (str,), + "deleted_at": (datetime,), + "request_reason": (str,), + "requested_at": (datetime,), + } + + attribute_map = { + "change_request_status": "change_request_status", + "decided_at": "decided_at", + "decision_reason": "decision_reason", + "deleted_at": "deleted_at", + "request_reason": "request_reason", + "requested_at": "requested_at", + } + + def __init__( + self_, + change_request_status: ChangeRequestDecisionStatusType, + decided_at: datetime, + decision_reason: str, + deleted_at: datetime, + request_reason: str, + requested_at: datetime, + **kwargs, + ): + """ + Attributes of a change request decision in a response. + + :param change_request_status: The status of a change request decision. + :type change_request_status: ChangeRequestDecisionStatusType + + :param decided_at: Timestamp of when the decision was made. + :type decided_at: datetime + + :param decision_reason: The reason for the decision. + :type decision_reason: str + + :param deleted_at: Timestamp of when the decision was deleted. + :type deleted_at: datetime + + :param request_reason: The reason for requesting the decision. + :type request_reason: str + + :param requested_at: Timestamp of when the decision was requested. + :type requested_at: datetime + """ + super().__init__(kwargs) + + self_.change_request_status = change_request_status + self_.decided_at = decided_at + self_.decision_reason = decision_reason + self_.deleted_at = deleted_at + self_.request_reason = request_reason + self_.requested_at = requested_at diff --git a/src/datadog_api_client/v2/model/change_request_decision_status_type.py b/src/datadog_api_client/v2/model/change_request_decision_status_type.py new file mode 100644 index 0000000000..8e023789ac --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_decision_status_type.py @@ -0,0 +1,41 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ChangeRequestDecisionStatusType(ModelSimple): + """ + The status of a change request decision. + + :param value: Must be one of ["REQUESTED", "APPROVED", "DECLINED"]. + :type value: str + """ + + allowed_values = { + "REQUESTED", + "APPROVED", + "DECLINED", + } + REQUESTED: ClassVar["ChangeRequestDecisionStatusType"] + APPROVED: ClassVar["ChangeRequestDecisionStatusType"] + DECLINED: ClassVar["ChangeRequestDecisionStatusType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ChangeRequestDecisionStatusType.REQUESTED = ChangeRequestDecisionStatusType("REQUESTED") +ChangeRequestDecisionStatusType.APPROVED = ChangeRequestDecisionStatusType("APPROVED") +ChangeRequestDecisionStatusType.DECLINED = ChangeRequestDecisionStatusType("DECLINED") diff --git a/src/datadog_api_client/v2/model/change_request_decision_update_data.py b/src/datadog_api_client/v2/model/change_request_decision_update_data.py new file mode 100644 index 0000000000..76f3118cb9 --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_decision_update_data.py @@ -0,0 +1,74 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_decision_update_data_attributes import ( + ChangeRequestDecisionUpdateDataAttributes, + ) + from datadog_api_client.v2.model.change_request_decision_update_data_relationships import ( + ChangeRequestDecisionUpdateDataRelationships, + ) + from datadog_api_client.v2.model.change_request_resource_type import ChangeRequestResourceType + + +class ChangeRequestDecisionUpdateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_decision_update_data_attributes import ( + ChangeRequestDecisionUpdateDataAttributes, + ) + from datadog_api_client.v2.model.change_request_decision_update_data_relationships import ( + ChangeRequestDecisionUpdateDataRelationships, + ) + from datadog_api_client.v2.model.change_request_resource_type import ChangeRequestResourceType + + return { + "attributes": (ChangeRequestDecisionUpdateDataAttributes,), + "relationships": (ChangeRequestDecisionUpdateDataRelationships,), + "type": (ChangeRequestResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + type: ChangeRequestResourceType, + attributes: Union[ChangeRequestDecisionUpdateDataAttributes, UnsetType] = unset, + relationships: Union[ChangeRequestDecisionUpdateDataRelationships, UnsetType] = unset, + **kwargs, + ): + """ + Data object to update a change request decision. + + :param attributes: Attributes of the parent change request for a decision update. + :type attributes: ChangeRequestDecisionUpdateDataAttributes, optional + + :param relationships: Relationships for updating a change request decision. + :type relationships: ChangeRequestDecisionUpdateDataRelationships, optional + + :param type: Change request resource type. + :type type: ChangeRequestResourceType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/change_request_decision_update_data_attributes.py b/src/datadog_api_client/v2/model/change_request_decision_update_data_attributes.py new file mode 100644 index 0000000000..1a8645420f --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_decision_update_data_attributes.py @@ -0,0 +1,36 @@ +# 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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ChangeRequestDecisionUpdateDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "id": (str,), + } + + attribute_map = { + "id": "id", + } + + def __init__(self_, id: Union[str, UnsetType] = unset, **kwargs): + """ + Attributes of the parent change request for a decision update. + + :param id: The identifier of the change request. + :type id: str, optional + """ + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/change_request_decision_update_data_relationships.py b/src/datadog_api_client/v2/model/change_request_decision_update_data_relationships.py new file mode 100644 index 0000000000..930537cedf --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_decision_update_data_relationships.py @@ -0,0 +1,40 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_decisions_relationship import ChangeRequestDecisionsRelationship + + +class ChangeRequestDecisionUpdateDataRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_decisions_relationship import ChangeRequestDecisionsRelationship + + return { + "change_request_decisions": (ChangeRequestDecisionsRelationship,), + } + + attribute_map = { + "change_request_decisions": "change_request_decisions", + } + + def __init__(self_, change_request_decisions: ChangeRequestDecisionsRelationship, **kwargs): + """ + Relationships for updating a change request decision. + + :param change_request_decisions: Relationship to change request decisions. + :type change_request_decisions: ChangeRequestDecisionsRelationship + """ + super().__init__(kwargs) + + self_.change_request_decisions = change_request_decisions diff --git a/src/datadog_api_client/v2/model/change_request_decision_update_request.py b/src/datadog_api_client/v2/model/change_request_decision_update_request.py new file mode 100644 index 0000000000..7a44deb4e7 --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_decision_update_request.py @@ -0,0 +1,56 @@ +# 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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_decision_update_data import ChangeRequestDecisionUpdateData + from datadog_api_client.v2.model.change_request_decision_create_item import ChangeRequestDecisionCreateItem + + +class ChangeRequestDecisionUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_decision_update_data import ChangeRequestDecisionUpdateData + from datadog_api_client.v2.model.change_request_decision_create_item import ChangeRequestDecisionCreateItem + + return { + "data": (ChangeRequestDecisionUpdateData,), + "included": ([ChangeRequestDecisionCreateItem],), + } + + attribute_map = { + "data": "data", + "included": "included", + } + + def __init__( + self_, + data: ChangeRequestDecisionUpdateData, + included: Union[List[ChangeRequestDecisionCreateItem], UnsetType] = unset, + **kwargs, + ): + """ + Request object to update a change request decision. + + :param data: Data object to update a change request decision. + :type data: ChangeRequestDecisionUpdateData + + :param included: Included resources for the change request update. + :type included: [ChangeRequestDecisionCreateItem], optional + """ + if included is not unset: + kwargs["included"] = included + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/change_request_decisions_relationship.py b/src/datadog_api_client/v2/model/change_request_decisions_relationship.py new file mode 100644 index 0000000000..7183b4e403 --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_decisions_relationship.py @@ -0,0 +1,44 @@ +# 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. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_decision_relationship_data import ( + ChangeRequestDecisionRelationshipData, + ) + + +class ChangeRequestDecisionsRelationship(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_decision_relationship_data import ( + ChangeRequestDecisionRelationshipData, + ) + + return { + "data": ([ChangeRequestDecisionRelationshipData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[ChangeRequestDecisionRelationshipData], **kwargs): + """ + Relationship to change request decisions. + + :param data: Array of decision relationship data. + :type data: [ChangeRequestDecisionRelationshipData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/change_request_included_decision.py b/src/datadog_api_client/v2/model/change_request_included_decision.py new file mode 100644 index 0000000000..ec34eaaa0b --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_included_decision.py @@ -0,0 +1,76 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_decision_response_attributes import ( + ChangeRequestDecisionResponseAttributes, + ) + from datadog_api_client.v2.model.change_request_decision_relationships import ChangeRequestDecisionRelationships + from datadog_api_client.v2.model.change_request_decision_resource_type import ChangeRequestDecisionResourceType + + +class ChangeRequestIncludedDecision(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_decision_response_attributes import ( + ChangeRequestDecisionResponseAttributes, + ) + from datadog_api_client.v2.model.change_request_decision_relationships import ChangeRequestDecisionRelationships + from datadog_api_client.v2.model.change_request_decision_resource_type import ChangeRequestDecisionResourceType + + return { + "attributes": (ChangeRequestDecisionResponseAttributes,), + "id": (str,), + "relationships": (ChangeRequestDecisionRelationships,), + "type": (ChangeRequestDecisionResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: ChangeRequestDecisionResponseAttributes, + id: str, + type: ChangeRequestDecisionResourceType, + relationships: Union[ChangeRequestDecisionRelationships, UnsetType] = unset, + **kwargs, + ): + """ + An included change request decision resource. + + :param attributes: Attributes of a change request decision in a response. + :type attributes: ChangeRequestDecisionResponseAttributes + + :param id: The decision UUID. + :type id: str + + :param relationships: Relationships of a change request decision. + :type relationships: ChangeRequestDecisionRelationships, optional + + :param type: Change request decision resource type. + :type type: ChangeRequestDecisionResourceType + """ + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/change_request_included_item.py b/src/datadog_api_client/v2/model/change_request_included_item.py new file mode 100644 index 0000000000..b2474dee02 --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_included_item.py @@ -0,0 +1,49 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class ChangeRequestIncludedItem(ModelComposed): + def __init__(self, **kwargs): + """ + An included resource item in the change request response. + + :param attributes: Attributes of an included user. + :type attributes: ChangeRequestIncludedUserAttributes + + :param id: The user UUID. + :type id: str + + :param type: The resource type. + :type type: str + + :param relationships: Relationships of a change request decision. + :type relationships: ChangeRequestDecisionRelationships, optional + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.change_request_included_user import ChangeRequestIncludedUser + from datadog_api_client.v2.model.change_request_included_decision import ChangeRequestIncludedDecision + + return { + "oneOf": [ + ChangeRequestIncludedUser, + ChangeRequestIncludedDecision, + ], + } diff --git a/src/datadog_api_client/v2/model/change_request_included_user.py b/src/datadog_api_client/v2/model/change_request_included_user.py new file mode 100644 index 0000000000..9d9319351a --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_included_user.py @@ -0,0 +1,54 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_included_user_attributes import ChangeRequestIncludedUserAttributes + + +class ChangeRequestIncludedUser(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_included_user_attributes import ( + ChangeRequestIncludedUserAttributes, + ) + + return { + "attributes": (ChangeRequestIncludedUserAttributes,), + "id": (str,), + "type": (str,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: ChangeRequestIncludedUserAttributes, id: str, type: str, **kwargs): + """ + An included user resource. + + :param attributes: Attributes of an included user. + :type attributes: ChangeRequestIncludedUserAttributes + + :param id: The user UUID. + :type id: str + + :param type: The resource type. + :type type: str + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/change_request_included_user_attributes.py b/src/datadog_api_client/v2/model/change_request_included_user_attributes.py new file mode 100644 index 0000000000..e5dc0517cd --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_included_user_attributes.py @@ -0,0 +1,45 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class ChangeRequestIncludedUserAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "email": (str,), + "handle": (str,), + "name": (str,), + } + + attribute_map = { + "email": "email", + "handle": "handle", + "name": "name", + } + + def __init__(self_, email: str, handle: str, name: str, **kwargs): + """ + Attributes of an included user. + + :param email: The email of the user. + :type email: str + + :param handle: The handle of the user. + :type handle: str + + :param name: The name of the user. + :type name: str + """ + super().__init__(kwargs) + + self_.email = email + self_.handle = handle + self_.name = name diff --git a/src/datadog_api_client/v2/model/change_request_object_attributes.py b/src/datadog_api_client/v2/model/change_request_object_attributes.py new file mode 100644 index 0000000000..2070789d4e --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_object_attributes.py @@ -0,0 +1,22 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class ChangeRequestObjectAttributes(ModelNormal): + @cached_property + def additional_properties_type(_): + return ([str],) + + def __init__(self_, **kwargs): + """ + Custom attributes of the change request as key-value pairs. + """ + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/change_request_relationships.py b/src/datadog_api_client/v2/model/change_request_relationships.py new file mode 100644 index 0000000000..9696107916 --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_relationships.py @@ -0,0 +1,60 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_decisions_relationship import ChangeRequestDecisionsRelationship + from datadog_api_client.v2.model.change_request_user_relationship import ChangeRequestUserRelationship + + +class ChangeRequestRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_decisions_relationship import ChangeRequestDecisionsRelationship + from datadog_api_client.v2.model.change_request_user_relationship import ChangeRequestUserRelationship + + return { + "change_request_decisions": (ChangeRequestDecisionsRelationship,), + "created_by": (ChangeRequestUserRelationship,), + "modified_by": (ChangeRequestUserRelationship,), + } + + attribute_map = { + "change_request_decisions": "change_request_decisions", + "created_by": "created_by", + "modified_by": "modified_by", + } + + def __init__( + self_, + change_request_decisions: ChangeRequestDecisionsRelationship, + created_by: ChangeRequestUserRelationship, + modified_by: ChangeRequestUserRelationship, + **kwargs, + ): + """ + Relationships of a change request. + + :param change_request_decisions: Relationship to change request decisions. + :type change_request_decisions: ChangeRequestDecisionsRelationship + + :param created_by: Relationship to a user. + :type created_by: ChangeRequestUserRelationship + + :param modified_by: Relationship to a user. + :type modified_by: ChangeRequestUserRelationship + """ + super().__init__(kwargs) + + self_.change_request_decisions = change_request_decisions + self_.created_by = created_by + self_.modified_by = modified_by diff --git a/src/datadog_api_client/v2/model/change_request_resource_type.py b/src/datadog_api_client/v2/model/change_request_resource_type.py new file mode 100644 index 0000000000..06969dd5dd --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_resource_type.py @@ -0,0 +1,35 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ChangeRequestResourceType(ModelSimple): + """ + Change request resource type. + + :param value: If omitted defaults to "change_request". Must be one of ["change_request"]. + :type value: str + """ + + allowed_values = { + "change_request", + } + CHANGE_REQUEST: ClassVar["ChangeRequestResourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ChangeRequestResourceType.CHANGE_REQUEST = ChangeRequestResourceType("change_request") diff --git a/src/datadog_api_client/v2/model/change_request_response.py b/src/datadog_api_client/v2/model/change_request_response.py new file mode 100644 index 0000000000..e37d434e24 --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_response.py @@ -0,0 +1,60 @@ +# 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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_response_data import ChangeRequestResponseData + from datadog_api_client.v2.model.change_request_included_item import ChangeRequestIncludedItem + from datadog_api_client.v2.model.change_request_included_user import ChangeRequestIncludedUser + from datadog_api_client.v2.model.change_request_included_decision import ChangeRequestIncludedDecision + + +class ChangeRequestResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_response_data import ChangeRequestResponseData + from datadog_api_client.v2.model.change_request_included_item import ChangeRequestIncludedItem + + return { + "data": (ChangeRequestResponseData,), + "included": ([ChangeRequestIncludedItem],), + } + + attribute_map = { + "data": "data", + "included": "included", + } + + def __init__( + self_, + data: ChangeRequestResponseData, + included: Union[ + List[Union[ChangeRequestIncludedItem, ChangeRequestIncludedUser, ChangeRequestIncludedDecision]], UnsetType + ] = unset, + **kwargs, + ): + """ + Response object for a change request. + + :param data: Data object for a change request response. + :type data: ChangeRequestResponseData + + :param included: Included resources related to the change request. + :type included: [ChangeRequestIncludedItem], optional + """ + if included is not unset: + kwargs["included"] = included + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/change_request_response_attributes.py b/src/datadog_api_client/v2/model/change_request_response_attributes.py new file mode 100644 index 0000000000..06eaee6b6f --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_response_attributes.py @@ -0,0 +1,202 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_object_attributes import ChangeRequestObjectAttributes + from datadog_api_client.v2.model.change_request_risk_level import ChangeRequestRiskLevel + from datadog_api_client.v2.model.change_request_change_type import ChangeRequestChangeType + + +class ChangeRequestResponseAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_object_attributes import ChangeRequestObjectAttributes + from datadog_api_client.v2.model.change_request_risk_level import ChangeRequestRiskLevel + from datadog_api_client.v2.model.change_request_change_type import ChangeRequestChangeType + + return { + "archived_at": (datetime, none_type), + "attributes": (ChangeRequestObjectAttributes,), + "change_request_linked_incident_uuid": (str,), + "change_request_maintenance_window_query": (str,), + "change_request_plan": (str,), + "change_request_risk": (ChangeRequestRiskLevel,), + "change_request_type": (ChangeRequestChangeType,), + "closed_at": (datetime, none_type), + "created_at": (datetime,), + "creation_source": (str,), + "description": (str,), + "end_date": (datetime,), + "key": (str,), + "modified_at": (datetime,), + "plan_notebook_id": (int,), + "priority": (str,), + "project_id": (str,), + "start_date": (datetime,), + "status": (str,), + "title": (str,), + "type": (str,), + } + + attribute_map = { + "archived_at": "archived_at", + "attributes": "attributes", + "change_request_linked_incident_uuid": "change_request_linked_incident_uuid", + "change_request_maintenance_window_query": "change_request_maintenance_window_query", + "change_request_plan": "change_request_plan", + "change_request_risk": "change_request_risk", + "change_request_type": "change_request_type", + "closed_at": "closed_at", + "created_at": "created_at", + "creation_source": "creation_source", + "description": "description", + "end_date": "end_date", + "key": "key", + "modified_at": "modified_at", + "plan_notebook_id": "plan_notebook_id", + "priority": "priority", + "project_id": "project_id", + "start_date": "start_date", + "status": "status", + "title": "title", + "type": "type", + } + read_only_vars = { + "archived_at", + "closed_at", + "created_at", + "modified_at", + } + + def __init__( + self_, + attributes: ChangeRequestObjectAttributes, + change_request_linked_incident_uuid: str, + change_request_maintenance_window_query: str, + change_request_plan: str, + change_request_risk: ChangeRequestRiskLevel, + change_request_type: ChangeRequestChangeType, + created_at: datetime, + creation_source: str, + description: str, + key: str, + modified_at: datetime, + plan_notebook_id: int, + priority: str, + project_id: str, + status: str, + title: str, + type: str, + archived_at: Union[datetime, none_type, UnsetType] = unset, + closed_at: Union[datetime, none_type, UnsetType] = unset, + end_date: Union[datetime, UnsetType] = unset, + start_date: Union[datetime, UnsetType] = unset, + **kwargs, + ): + """ + Attributes of a change request response. + + :param archived_at: Timestamp of when the change request was archived. + :type archived_at: datetime, none_type, optional + + :param attributes: Custom attributes of the change request as key-value pairs. + :type attributes: ChangeRequestObjectAttributes + + :param change_request_linked_incident_uuid: The UUID of the linked incident. + :type change_request_linked_incident_uuid: str + + :param change_request_maintenance_window_query: The maintenance window query for the change request. + :type change_request_maintenance_window_query: str + + :param change_request_plan: The plan associated with the change request. + :type change_request_plan: str + + :param change_request_risk: The risk level of the change request. + :type change_request_risk: ChangeRequestRiskLevel + + :param change_request_type: The type of the change request. + :type change_request_type: ChangeRequestChangeType + + :param closed_at: Timestamp of when the change request was closed. + :type closed_at: datetime, none_type, optional + + :param created_at: Timestamp of when the change request was created. + :type created_at: datetime + + :param creation_source: The source from which the change request was created. + :type creation_source: str + + :param description: The description of the change request. + :type description: str + + :param end_date: The planned end date of the change request. + :type end_date: datetime, optional + + :param key: The human-readable key of the change request. + :type key: str + + :param modified_at: Timestamp of when the change request was last modified. + :type modified_at: datetime + + :param plan_notebook_id: The notebook ID associated with the change request plan. + :type plan_notebook_id: int + + :param priority: The priority of the change request. + :type priority: str + + :param project_id: The project UUID associated with the change request. + :type project_id: str + + :param start_date: The planned start date of the change request. + :type start_date: datetime, optional + + :param status: The current status of the change request. + :type status: str + + :param title: The title of the change request. + :type title: str + + :param type: The case type. + :type type: str + """ + if archived_at is not unset: + kwargs["archived_at"] = archived_at + if closed_at is not unset: + kwargs["closed_at"] = closed_at + if end_date is not unset: + kwargs["end_date"] = end_date + if start_date is not unset: + kwargs["start_date"] = start_date + super().__init__(kwargs) + + self_.attributes = attributes + self_.change_request_linked_incident_uuid = change_request_linked_incident_uuid + self_.change_request_maintenance_window_query = change_request_maintenance_window_query + self_.change_request_plan = change_request_plan + self_.change_request_risk = change_request_risk + self_.change_request_type = change_request_type + self_.created_at = created_at + self_.creation_source = creation_source + self_.description = description + self_.key = key + self_.modified_at = modified_at + self_.plan_notebook_id = plan_notebook_id + self_.priority = priority + self_.project_id = project_id + self_.status = status + self_.title = title + self_.type = type diff --git a/src/datadog_api_client/v2/model/change_request_response_data.py b/src/datadog_api_client/v2/model/change_request_response_data.py new file mode 100644 index 0000000000..9a9ff65542 --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_response_data.py @@ -0,0 +1,72 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_response_attributes import ChangeRequestResponseAttributes + from datadog_api_client.v2.model.change_request_relationships import ChangeRequestRelationships + from datadog_api_client.v2.model.change_request_resource_type import ChangeRequestResourceType + + +class ChangeRequestResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_response_attributes import ChangeRequestResponseAttributes + from datadog_api_client.v2.model.change_request_relationships import ChangeRequestRelationships + from datadog_api_client.v2.model.change_request_resource_type import ChangeRequestResourceType + + return { + "attributes": (ChangeRequestResponseAttributes,), + "id": (str,), + "relationships": (ChangeRequestRelationships,), + "type": (ChangeRequestResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: ChangeRequestResponseAttributes, + id: str, + type: ChangeRequestResourceType, + relationships: Union[ChangeRequestRelationships, UnsetType] = unset, + **kwargs, + ): + """ + Data object for a change request response. + + :param attributes: Attributes of a change request response. + :type attributes: ChangeRequestResponseAttributes + + :param id: The identifier of the change request. + :type id: str + + :param relationships: Relationships of a change request. + :type relationships: ChangeRequestRelationships, optional + + :param type: Change request resource type. + :type type: ChangeRequestResourceType + """ + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/change_request_risk_level.py b/src/datadog_api_client/v2/model/change_request_risk_level.py new file mode 100644 index 0000000000..7675f6d75a --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_risk_level.py @@ -0,0 +1,44 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ChangeRequestRiskLevel(ModelSimple): + """ + The risk level of the change request. + + :param value: Must be one of ["UNDEFINED", "LOW", "MEDIUM", "HIGH"]. + :type value: str + """ + + allowed_values = { + "UNDEFINED", + "LOW", + "MEDIUM", + "HIGH", + } + UNDEFINED: ClassVar["ChangeRequestRiskLevel"] + LOW: ClassVar["ChangeRequestRiskLevel"] + MEDIUM: ClassVar["ChangeRequestRiskLevel"] + HIGH: ClassVar["ChangeRequestRiskLevel"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ChangeRequestRiskLevel.UNDEFINED = ChangeRequestRiskLevel("UNDEFINED") +ChangeRequestRiskLevel.LOW = ChangeRequestRiskLevel("LOW") +ChangeRequestRiskLevel.MEDIUM = ChangeRequestRiskLevel("MEDIUM") +ChangeRequestRiskLevel.HIGH = ChangeRequestRiskLevel("HIGH") diff --git a/src/datadog_api_client/v2/model/change_request_update_attributes.py b/src/datadog_api_client/v2/model/change_request_update_attributes.py new file mode 100644 index 0000000000..863852fd6a --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_update_attributes.py @@ -0,0 +1,89 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_risk_level import ChangeRequestRiskLevel + from datadog_api_client.v2.model.change_request_change_type import ChangeRequestChangeType + + +class ChangeRequestUpdateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_risk_level import ChangeRequestRiskLevel + from datadog_api_client.v2.model.change_request_change_type import ChangeRequestChangeType + + return { + "change_request_plan": (str,), + "change_request_risk": (ChangeRequestRiskLevel,), + "change_request_type": (ChangeRequestChangeType,), + "end_date": (datetime,), + "id": (str,), + "start_date": (datetime,), + } + + attribute_map = { + "change_request_plan": "change_request_plan", + "change_request_risk": "change_request_risk", + "change_request_type": "change_request_type", + "end_date": "end_date", + "id": "id", + "start_date": "start_date", + } + + def __init__( + self_, + change_request_plan: Union[str, UnsetType] = unset, + change_request_risk: Union[ChangeRequestRiskLevel, UnsetType] = unset, + change_request_type: Union[ChangeRequestChangeType, UnsetType] = unset, + end_date: Union[datetime, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + start_date: Union[datetime, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for updating a change request. + + :param change_request_plan: The plan associated with the change request. + :type change_request_plan: str, optional + + :param change_request_risk: The risk level of the change request. + :type change_request_risk: ChangeRequestRiskLevel, optional + + :param change_request_type: The type of the change request. + :type change_request_type: ChangeRequestChangeType, optional + + :param end_date: The planned end date of the change request. + :type end_date: datetime, optional + + :param id: The identifier of the change request to update. + :type id: str, optional + + :param start_date: The planned start date of the change request. + :type start_date: datetime, optional + """ + if change_request_plan is not unset: + kwargs["change_request_plan"] = change_request_plan + if change_request_risk is not unset: + kwargs["change_request_risk"] = change_request_risk + if change_request_type is not unset: + kwargs["change_request_type"] = change_request_type + if end_date is not unset: + kwargs["end_date"] = end_date + if id is not unset: + kwargs["id"] = id + if start_date is not unset: + kwargs["start_date"] = start_date + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/change_request_update_data.py b/src/datadog_api_client/v2/model/change_request_update_data.py new file mode 100644 index 0000000000..4d3bedb208 --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_update_data.py @@ -0,0 +1,66 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_update_attributes import ChangeRequestUpdateAttributes + from datadog_api_client.v2.model.change_request_update_relationships import ChangeRequestUpdateRelationships + from datadog_api_client.v2.model.change_request_resource_type import ChangeRequestResourceType + + +class ChangeRequestUpdateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_update_attributes import ChangeRequestUpdateAttributes + from datadog_api_client.v2.model.change_request_update_relationships import ChangeRequestUpdateRelationships + from datadog_api_client.v2.model.change_request_resource_type import ChangeRequestResourceType + + return { + "attributes": (ChangeRequestUpdateAttributes,), + "relationships": (ChangeRequestUpdateRelationships,), + "type": (ChangeRequestResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + type: ChangeRequestResourceType, + attributes: Union[ChangeRequestUpdateAttributes, UnsetType] = unset, + relationships: Union[ChangeRequestUpdateRelationships, UnsetType] = unset, + **kwargs, + ): + """ + Data object to update a change request. + + :param attributes: Attributes for updating a change request. + :type attributes: ChangeRequestUpdateAttributes, optional + + :param relationships: Relationships for updating a change request. + :type relationships: ChangeRequestUpdateRelationships, optional + + :param type: Change request resource type. + :type type: ChangeRequestResourceType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/change_request_update_relationships.py b/src/datadog_api_client/v2/model/change_request_update_relationships.py new file mode 100644 index 0000000000..efcdd8b9f2 --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_update_relationships.py @@ -0,0 +1,44 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_decisions_relationship import ChangeRequestDecisionsRelationship + + +class ChangeRequestUpdateRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_decisions_relationship import ChangeRequestDecisionsRelationship + + return { + "change_request_decisions": (ChangeRequestDecisionsRelationship,), + } + + attribute_map = { + "change_request_decisions": "change_request_decisions", + } + + def __init__( + self_, change_request_decisions: Union[ChangeRequestDecisionsRelationship, UnsetType] = unset, **kwargs + ): + """ + Relationships for updating a change request. + + :param change_request_decisions: Relationship to change request decisions. + :type change_request_decisions: ChangeRequestDecisionsRelationship, optional + """ + if change_request_decisions is not unset: + kwargs["change_request_decisions"] = change_request_decisions + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/change_request_update_request.py b/src/datadog_api_client/v2/model/change_request_update_request.py new file mode 100644 index 0000000000..0e07f0026a --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_update_request.py @@ -0,0 +1,56 @@ +# 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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_update_data import ChangeRequestUpdateData + from datadog_api_client.v2.model.change_request_decision_create_item import ChangeRequestDecisionCreateItem + + +class ChangeRequestUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_update_data import ChangeRequestUpdateData + from datadog_api_client.v2.model.change_request_decision_create_item import ChangeRequestDecisionCreateItem + + return { + "data": (ChangeRequestUpdateData,), + "included": ([ChangeRequestDecisionCreateItem],), + } + + attribute_map = { + "data": "data", + "included": "included", + } + + def __init__( + self_, + data: ChangeRequestUpdateData, + included: Union[List[ChangeRequestDecisionCreateItem], UnsetType] = unset, + **kwargs, + ): + """ + Request object to update a change request. + + :param data: Data object to update a change request. + :type data: ChangeRequestUpdateData + + :param included: Included resources for the change request update. + :type included: [ChangeRequestDecisionCreateItem], optional + """ + if included is not unset: + kwargs["included"] = included + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/change_request_user_relationship.py b/src/datadog_api_client/v2/model/change_request_user_relationship.py new file mode 100644 index 0000000000..e0d9333dee --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_user_relationship.py @@ -0,0 +1,41 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.change_request_user_relationship_data import ChangeRequestUserRelationshipData + + +class ChangeRequestUserRelationship(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.change_request_user_relationship_data import ChangeRequestUserRelationshipData + + return { + "data": (ChangeRequestUserRelationshipData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[ChangeRequestUserRelationshipData, none_type], **kwargs): + """ + Relationship to a user. + + :param data: User relationship data. + :type data: ChangeRequestUserRelationshipData, none_type + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/change_request_user_relationship_data.py b/src/datadog_api_client/v2/model/change_request_user_relationship_data.py new file mode 100644 index 0000000000..b0e5eec242 --- /dev/null +++ b/src/datadog_api_client/v2/model/change_request_user_relationship_data.py @@ -0,0 +1,41 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class ChangeRequestUserRelationshipData(ModelNormal): + _nullable = True + + @cached_property + def openapi_types(_): + return { + "id": (str,), + "type": (str,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: str, **kwargs): + """ + User relationship data. + + :param id: The user UUID. + :type id: str + + :param type: The user resource type. + :type type: str + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 492533f790..21f05de7be 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -775,6 +775,52 @@ ChangeEventCustomAttributesImpactedResourcesItemsType, ) from datadog_api_client.v2.model.change_event_trigger_wrapper import ChangeEventTriggerWrapper +from datadog_api_client.v2.model.change_request_branch_create_attributes import ChangeRequestBranchCreateAttributes +from datadog_api_client.v2.model.change_request_branch_create_data import ChangeRequestBranchCreateData +from datadog_api_client.v2.model.change_request_branch_create_request import ChangeRequestBranchCreateRequest +from datadog_api_client.v2.model.change_request_branch_resource_type import ChangeRequestBranchResourceType +from datadog_api_client.v2.model.change_request_change_type import ChangeRequestChangeType +from datadog_api_client.v2.model.change_request_create_attributes import ChangeRequestCreateAttributes +from datadog_api_client.v2.model.change_request_create_data import ChangeRequestCreateData +from datadog_api_client.v2.model.change_request_create_request import ChangeRequestCreateRequest +from datadog_api_client.v2.model.change_request_decision_create_attributes import ChangeRequestDecisionCreateAttributes +from datadog_api_client.v2.model.change_request_decision_create_item import ChangeRequestDecisionCreateItem +from datadog_api_client.v2.model.change_request_decision_create_relationships import ( + ChangeRequestDecisionCreateRelationships, +) +from datadog_api_client.v2.model.change_request_decision_relationship_data import ChangeRequestDecisionRelationshipData +from datadog_api_client.v2.model.change_request_decision_relationships import ChangeRequestDecisionRelationships +from datadog_api_client.v2.model.change_request_decision_resource_type import ChangeRequestDecisionResourceType +from datadog_api_client.v2.model.change_request_decision_response_attributes import ( + ChangeRequestDecisionResponseAttributes, +) +from datadog_api_client.v2.model.change_request_decision_status_type import ChangeRequestDecisionStatusType +from datadog_api_client.v2.model.change_request_decision_update_data import ChangeRequestDecisionUpdateData +from datadog_api_client.v2.model.change_request_decision_update_data_attributes import ( + ChangeRequestDecisionUpdateDataAttributes, +) +from datadog_api_client.v2.model.change_request_decision_update_data_relationships import ( + ChangeRequestDecisionUpdateDataRelationships, +) +from datadog_api_client.v2.model.change_request_decision_update_request import ChangeRequestDecisionUpdateRequest +from datadog_api_client.v2.model.change_request_decisions_relationship import ChangeRequestDecisionsRelationship +from datadog_api_client.v2.model.change_request_included_decision import ChangeRequestIncludedDecision +from datadog_api_client.v2.model.change_request_included_item import ChangeRequestIncludedItem +from datadog_api_client.v2.model.change_request_included_user import ChangeRequestIncludedUser +from datadog_api_client.v2.model.change_request_included_user_attributes import ChangeRequestIncludedUserAttributes +from datadog_api_client.v2.model.change_request_object_attributes import ChangeRequestObjectAttributes +from datadog_api_client.v2.model.change_request_relationships import ChangeRequestRelationships +from datadog_api_client.v2.model.change_request_resource_type import ChangeRequestResourceType +from datadog_api_client.v2.model.change_request_response import ChangeRequestResponse +from datadog_api_client.v2.model.change_request_response_attributes import ChangeRequestResponseAttributes +from datadog_api_client.v2.model.change_request_response_data import ChangeRequestResponseData +from datadog_api_client.v2.model.change_request_risk_level import ChangeRequestRiskLevel +from datadog_api_client.v2.model.change_request_update_attributes import ChangeRequestUpdateAttributes +from datadog_api_client.v2.model.change_request_update_data import ChangeRequestUpdateData +from datadog_api_client.v2.model.change_request_update_relationships import ChangeRequestUpdateRelationships +from datadog_api_client.v2.model.change_request_update_request import ChangeRequestUpdateRequest +from datadog_api_client.v2.model.change_request_user_relationship import ChangeRequestUserRelationship +from datadog_api_client.v2.model.change_request_user_relationship_data import ChangeRequestUserRelationshipData from datadog_api_client.v2.model.chargeback_breakdown import ChargebackBreakdown from datadog_api_client.v2.model.circle_ciapi_key import CircleCIAPIKey from datadog_api_client.v2.model.circle_ciapi_key_type import CircleCIAPIKeyType @@ -6711,6 +6757,44 @@ "ChangeEventCustomAttributesImpactedResourcesItems", "ChangeEventCustomAttributesImpactedResourcesItemsType", "ChangeEventTriggerWrapper", + "ChangeRequestBranchCreateAttributes", + "ChangeRequestBranchCreateData", + "ChangeRequestBranchCreateRequest", + "ChangeRequestBranchResourceType", + "ChangeRequestChangeType", + "ChangeRequestCreateAttributes", + "ChangeRequestCreateData", + "ChangeRequestCreateRequest", + "ChangeRequestDecisionCreateAttributes", + "ChangeRequestDecisionCreateItem", + "ChangeRequestDecisionCreateRelationships", + "ChangeRequestDecisionRelationshipData", + "ChangeRequestDecisionRelationships", + "ChangeRequestDecisionResourceType", + "ChangeRequestDecisionResponseAttributes", + "ChangeRequestDecisionStatusType", + "ChangeRequestDecisionUpdateData", + "ChangeRequestDecisionUpdateDataAttributes", + "ChangeRequestDecisionUpdateDataRelationships", + "ChangeRequestDecisionUpdateRequest", + "ChangeRequestDecisionsRelationship", + "ChangeRequestIncludedDecision", + "ChangeRequestIncludedItem", + "ChangeRequestIncludedUser", + "ChangeRequestIncludedUserAttributes", + "ChangeRequestObjectAttributes", + "ChangeRequestRelationships", + "ChangeRequestResourceType", + "ChangeRequestResponse", + "ChangeRequestResponseAttributes", + "ChangeRequestResponseData", + "ChangeRequestRiskLevel", + "ChangeRequestUpdateAttributes", + "ChangeRequestUpdateData", + "ChangeRequestUpdateRelationships", + "ChangeRequestUpdateRequest", + "ChangeRequestUserRelationship", + "ChangeRequestUserRelationshipData", "ChargebackBreakdown", "CircleCIAPIKey", "CircleCIAPIKeyType", diff --git a/tests/v2/features/change_management.feature b/tests/v2/features/change_management.feature new file mode 100644 index 0000000000..dbbae657bb --- /dev/null +++ b/tests/v2/features/change_management.feature @@ -0,0 +1,162 @@ +@endpoint(change-management) @endpoint(change-management-v2) +Feature: Change Management + View and manage change requests within Change Management. See the [Case + Management + page](https://docs.datadoghq.com/service_management/case_management/) for + more information. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "ChangeManagement" API + + @generated @skip @team:DataDog/case-management + Scenario: Create a change request branch returns "Bad Request" response + Given operation "CreateChangeRequestBranch" enabled + And new "CreateChangeRequestBranch" request + And request contains "change_request_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"branch_name": "chm/CHM-1234", "repo_id": "DataDog/dd-source"}, "type": "change_request_branch"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Create a change request branch returns "Not Found" response + Given operation "CreateChangeRequestBranch" enabled + And new "CreateChangeRequestBranch" request + And request contains "change_request_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"branch_name": "chm/CHM-1234", "repo_id": "DataDog/dd-source"}, "type": "change_request_branch"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Create a change request branch returns "OK" response + Given operation "CreateChangeRequestBranch" enabled + And new "CreateChangeRequestBranch" request + And request contains "change_request_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"branch_name": "chm/CHM-1234", "repo_id": "DataDog/dd-source"}, "type": "change_request_branch"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Create a change request returns "Bad Request" response + Given operation "CreateChangeRequest" enabled + And new "CreateChangeRequest" request + And body with value {"data": {"attributes": {"change_request_linked_incident_uuid": "00000000-0000-0000-0000-000000000000", "change_request_maintenance_window_query": "", "change_request_plan": "1. Deploy to staging 2. Run tests 3. Deploy to production", "change_request_risk": "LOW", "change_request_type": "NORMAL", "description": "Deploying new payment service v2.1", "end_date": "2024-01-02T15:00:00Z", "project_id": "d4bbe1af-f36e-42f1-87c1-493ca35c320e", "requested_teams": ["team-handle-1"], "start_date": "2024-01-01T03:00:00Z", "title": "Deploy new payment service"}, "type": "change_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Create a change request returns "Created" response + Given operation "CreateChangeRequest" enabled + And new "CreateChangeRequest" request + And body with value {"data": {"attributes": {"change_request_linked_incident_uuid": "00000000-0000-0000-0000-000000000000", "change_request_maintenance_window_query": "", "change_request_plan": "1. Deploy to staging 2. Run tests 3. Deploy to production", "change_request_risk": "LOW", "change_request_type": "NORMAL", "description": "Deploying new payment service v2.1", "end_date": "2024-01-02T15:00:00Z", "project_id": "d4bbe1af-f36e-42f1-87c1-493ca35c320e", "requested_teams": ["team-handle-1"], "start_date": "2024-01-01T03:00:00Z", "title": "Deploy new payment service"}, "type": "change_request"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/case-management + Scenario: Delete a change request decision returns "Bad Request" response + Given operation "DeleteChangeRequestDecision" enabled + And new "DeleteChangeRequestDecision" request + And request contains "change_request_id" parameter from "REPLACE.ME" + And request contains "decision_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Delete a change request decision returns "Not Found" response + Given operation "DeleteChangeRequestDecision" enabled + And new "DeleteChangeRequestDecision" request + And request contains "change_request_id" parameter from "REPLACE.ME" + And request contains "decision_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Delete a change request decision returns "OK" response + Given operation "DeleteChangeRequestDecision" enabled + And new "DeleteChangeRequestDecision" request + And request contains "change_request_id" parameter from "REPLACE.ME" + And request contains "decision_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Get a change request returns "Bad Request" response + Given operation "GetChangeRequest" enabled + And new "GetChangeRequest" request + And request contains "change_request_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Get a change request returns "Not Found" response + Given operation "GetChangeRequest" enabled + And new "GetChangeRequest" request + And request contains "change_request_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Get a change request returns "OK" response + Given operation "GetChangeRequest" enabled + And new "GetChangeRequest" request + And request contains "change_request_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Update a change request decision returns "Bad Request" response + Given operation "UpdateChangeRequestDecision" enabled + And new "UpdateChangeRequestDecision" request + And request contains "change_request_id" parameter from "REPLACE.ME" + And request contains "decision_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"id": "CHM-1234"}, "relationships": {"change_request_decisions": {"data": [{"id": "decision-id-0", "type": "change_request_decision"}]}}, "type": "change_request"}, "included": [{"attributes": {"change_request_status": "REQUESTED", "request_reason": "Please review and approve this change"}, "id": "decision-id-0", "relationships": {"requested_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "user"}}}, "type": "change_request_decision"}]} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Update a change request decision returns "Not Found" response + Given operation "UpdateChangeRequestDecision" enabled + And new "UpdateChangeRequestDecision" request + And request contains "change_request_id" parameter from "REPLACE.ME" + And request contains "decision_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"id": "CHM-1234"}, "relationships": {"change_request_decisions": {"data": [{"id": "decision-id-0", "type": "change_request_decision"}]}}, "type": "change_request"}, "included": [{"attributes": {"change_request_status": "REQUESTED", "request_reason": "Please review and approve this change"}, "id": "decision-id-0", "relationships": {"requested_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "user"}}}, "type": "change_request_decision"}]} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Update a change request decision returns "OK" response + Given operation "UpdateChangeRequestDecision" enabled + And new "UpdateChangeRequestDecision" request + And request contains "change_request_id" parameter from "REPLACE.ME" + And request contains "decision_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"id": "CHM-1234"}, "relationships": {"change_request_decisions": {"data": [{"id": "decision-id-0", "type": "change_request_decision"}]}}, "type": "change_request"}, "included": [{"attributes": {"change_request_status": "REQUESTED", "request_reason": "Please review and approve this change"}, "id": "decision-id-0", "relationships": {"requested_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "user"}}}, "type": "change_request_decision"}]} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Update a change request returns "Bad Request" response + Given operation "UpdateChangeRequest" enabled + And new "UpdateChangeRequest" request + And request contains "change_request_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"change_request_plan": "Updated deployment plan", "change_request_risk": "LOW", "change_request_type": "NORMAL", "end_date": "2024-01-02T15:00:00Z", "id": "CHM-1234", "start_date": "2024-01-01T03:00:00Z"}, "relationships": {"change_request_decisions": {"data": [{"id": "decision-id-0", "type": "change_request_decision"}]}}, "type": "change_request"}, "included": [{"attributes": {"change_request_status": "REQUESTED", "request_reason": "Please review and approve this change"}, "id": "decision-id-0", "relationships": {"requested_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "user"}}}, "type": "change_request_decision"}]} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Update a change request returns "Not Found" response + Given operation "UpdateChangeRequest" enabled + And new "UpdateChangeRequest" request + And request contains "change_request_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"change_request_plan": "Updated deployment plan", "change_request_risk": "LOW", "change_request_type": "NORMAL", "end_date": "2024-01-02T15:00:00Z", "id": "CHM-1234", "start_date": "2024-01-01T03:00:00Z"}, "relationships": {"change_request_decisions": {"data": [{"id": "decision-id-0", "type": "change_request_decision"}]}}, "type": "change_request"}, "included": [{"attributes": {"change_request_status": "REQUESTED", "request_reason": "Please review and approve this change"}, "id": "decision-id-0", "relationships": {"requested_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "user"}}}, "type": "change_request_decision"}]} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Update a change request returns "OK" response + Given operation "UpdateChangeRequest" enabled + And new "UpdateChangeRequest" request + And request contains "change_request_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"change_request_plan": "Updated deployment plan", "change_request_risk": "LOW", "change_request_type": "NORMAL", "end_date": "2024-01-02T15:00:00Z", "id": "CHM-1234", "start_date": "2024-01-01T03:00:00Z"}, "relationships": {"change_request_decisions": {"data": [{"id": "decision-id-0", "type": "change_request_decision"}]}}, "type": "change_request"}, "included": [{"attributes": {"change_request_status": "REQUESTED", "request_reason": "Please review and approve this change"}, "id": "decision-id-0", "relationships": {"requested_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "user"}}}, "type": "change_request_decision"}]} + When the request is sent + Then the response status is 200 OK diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 10efec9a5c..5389038140 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -972,6 +972,46 @@ "type": "safe" } }, + "CreateChangeRequest": { + "tag": "Change Management", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, + "GetChangeRequest": { + "tag": "Change Management", + "undo": { + "type": "safe" + } + }, + "UpdateChangeRequest": { + "tag": "Change Management", + "undo": { + "type": "idempotent" + } + }, + "CreateChangeRequestBranch": { + "tag": "Change Management", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, + "DeleteChangeRequestDecision": { + "tag": "Change Management", + "undo": { + "type": "idempotent" + } + }, + "UpdateChangeRequestDecision": { + "tag": "Change Management", + "undo": { + "type": "idempotent" + } + }, "CreateCIAppPipelineEvent": { "tag": "CI Visibility Pipelines", "undo": {