From 005b112f386dae57fbf907c2611a5ade81aa0429 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 19 Feb 2026 15:31:00 +0000 Subject: [PATCH] Regenerate client from commit 3b03aa8 of spec repo --- .generator/schemas/v2/openapi.yaml | 901 ++++++++++++++ .../change-management/CreateChangeRequest.ts | 40 + .../CreateChangeRequestBranch.ts | 31 + .../DeleteChangeRequestDecision.ts | 23 + .../v2/change-management/GetChangeRequest.ts | 22 + .../change-management/UpdateChangeRequest.ts | 63 + .../UpdateChangeRequestDecision.ts | 59 + features/support/scenarios_model_mapping.ts | 62 + features/v2/change_management.feature | 162 +++ features/v2/undo.json | 40 + .../configuration.ts | 6 + .../apis/ChangeManagementApi.ts | 1073 +++++++++++++++++ packages/datadog-api-client-v2/index.ts | 47 + .../ChangeRequestBranchCreateAttributes.ts | 62 + .../models/ChangeRequestBranchCreateData.ts | 64 + .../ChangeRequestBranchCreateRequest.ts | 54 + .../models/ChangeRequestBranchResourceType.ts | 16 + .../models/ChangeRequestChangeType.ts | 20 + .../models/ChangeRequestCreateAttributes.ts | 137 +++ .../models/ChangeRequestCreateData.ts | 64 + .../models/ChangeRequestCreateRequest.ts | 54 + .../ChangeRequestDecisionCreateAttributes.ts | 61 + .../models/ChangeRequestDecisionCreateItem.ts | 81 ++ ...hangeRequestDecisionCreateRelationships.ts | 53 + .../ChangeRequestDecisionRelationshipData.ts | 63 + .../ChangeRequestDecisionRelationships.ts | 72 ++ .../ChangeRequestDecisionResourceType.ts | 16 + ...ChangeRequestDecisionResponseAttributes.ts | 102 ++ .../models/ChangeRequestDecisionStatusType.ts | 20 + .../models/ChangeRequestDecisionUpdateData.ts | 72 ++ ...angeRequestDecisionUpdateDataAttributes.ts | 52 + ...eRequestDecisionUpdateDataRelationships.ts | 54 + .../ChangeRequestDecisionUpdateRequest.ts | 63 + .../ChangeRequestDecisionsRelationship.ts | 54 + .../models/ChangeRequestIncludedDecision.ts | 82 ++ .../models/ChangeRequestIncludedItem.ts | 18 + .../models/ChangeRequestIncludedUser.ts | 72 ++ .../ChangeRequestIncludedUserAttributes.ts | 71 ++ .../models/ChangeRequestRelationships.ts | 73 ++ .../models/ChangeRequestResourceType.ts | 14 + .../models/ChangeRequestResponse.ts | 63 + .../models/ChangeRequestResponseAttributes.ts | 238 ++++ .../models/ChangeRequestResponseData.ts | 82 ++ .../models/ChangeRequestRiskLevel.ts | 22 + .../models/ChangeRequestUpdateAttributes.ts | 96 ++ .../models/ChangeRequestUpdateData.ts | 72 ++ .../ChangeRequestUpdateRelationships.ts | 53 + .../models/ChangeRequestUpdateRequest.ts | 63 + .../models/ChangeRequestUserRelationship.ts | 54 + .../ChangeRequestUserRelationshipData.ts | 62 + .../models/ObjectSerializer.ts | 74 ++ 51 files changed, 4972 insertions(+) create mode 100644 examples/v2/change-management/CreateChangeRequest.ts create mode 100644 examples/v2/change-management/CreateChangeRequestBranch.ts create mode 100644 examples/v2/change-management/DeleteChangeRequestDecision.ts create mode 100644 examples/v2/change-management/GetChangeRequest.ts create mode 100644 examples/v2/change-management/UpdateChangeRequest.ts create mode 100644 examples/v2/change-management/UpdateChangeRequestDecision.ts create mode 100644 features/v2/change_management.feature create mode 100644 packages/datadog-api-client-v2/apis/ChangeManagementApi.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestBranchCreateAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestBranchCreateData.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestBranchCreateRequest.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestBranchResourceType.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestChangeType.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestCreateAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestCreateData.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestCreateRequest.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestDecisionCreateAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestDecisionCreateItem.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestDecisionCreateRelationships.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestDecisionRelationshipData.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestDecisionRelationships.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestDecisionResourceType.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestDecisionResponseAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestDecisionStatusType.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestDecisionUpdateData.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestDecisionUpdateDataAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestDecisionUpdateDataRelationships.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestDecisionUpdateRequest.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestDecisionsRelationship.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestIncludedDecision.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestIncludedItem.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestIncludedUser.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestIncludedUserAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestRelationships.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestResourceType.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestResponse.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestResponseAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestResponseData.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestRiskLevel.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestUpdateAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestUpdateData.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestUpdateRelationships.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestUpdateRequest.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestUserRelationship.ts create mode 100644 packages/datadog-api-client-v2/models/ChangeRequestUserRelationshipData.ts diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a484bec1a76a..22aa66aee706 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/examples/v2/change-management/CreateChangeRequest.ts b/examples/v2/change-management/CreateChangeRequest.ts new file mode 100644 index 000000000000..0294fb9fa3b3 --- /dev/null +++ b/examples/v2/change-management/CreateChangeRequest.ts @@ -0,0 +1,40 @@ +/** + * Create a change request returns "Created" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.createChangeRequest"] = true; +const apiInstance = new v2.ChangeManagementApi(configuration); + +const params: v2.ChangeManagementApiCreateChangeRequestRequest = { + body: { + data: { + attributes: { + changeRequestLinkedIncidentUuid: "00000000-0000-0000-0000-000000000000", + changeRequestMaintenanceWindowQuery: "", + changeRequestPlan: + "1. Deploy to staging 2. Run tests 3. Deploy to production", + changeRequestRisk: "LOW", + changeRequestType: "NORMAL", + description: "Deploying new payment service v2.1", + endDate: new Date(2024, 1, 2, 15, 0, 0, 0), + projectId: "d4bbe1af-f36e-42f1-87c1-493ca35c320e", + requestedTeams: ["team-handle-1"], + startDate: new Date(2024, 1, 1, 3, 0, 0, 0), + title: "Deploy new payment service", + }, + type: "change_request", + }, + }, +}; + +apiInstance + .createChangeRequest(params) + .then((data: v2.ChangeRequestResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/change-management/CreateChangeRequestBranch.ts b/examples/v2/change-management/CreateChangeRequestBranch.ts new file mode 100644 index 000000000000..050b7dbac8ef --- /dev/null +++ b/examples/v2/change-management/CreateChangeRequestBranch.ts @@ -0,0 +1,31 @@ +/** + * Create a change request branch returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.createChangeRequestBranch"] = true; +const apiInstance = new v2.ChangeManagementApi(configuration); + +const params: v2.ChangeManagementApiCreateChangeRequestBranchRequest = { + body: { + data: { + attributes: { + branchName: "chm/CHM-1234", + repoId: "DataDog/dd-source", + }, + type: "change_request_branch", + }, + }, + changeRequestId: "change_request_id", +}; + +apiInstance + .createChangeRequestBranch(params) + .then((data: v2.ChangeRequestResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/change-management/DeleteChangeRequestDecision.ts b/examples/v2/change-management/DeleteChangeRequestDecision.ts new file mode 100644 index 000000000000..d3a869b29588 --- /dev/null +++ b/examples/v2/change-management/DeleteChangeRequestDecision.ts @@ -0,0 +1,23 @@ +/** + * Delete a change request decision returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.deleteChangeRequestDecision"] = true; +const apiInstance = new v2.ChangeManagementApi(configuration); + +const params: v2.ChangeManagementApiDeleteChangeRequestDecisionRequest = { + changeRequestId: "change_request_id", + decisionId: "decision_id", +}; + +apiInstance + .deleteChangeRequestDecision(params) + .then((data: v2.ChangeRequestResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/change-management/GetChangeRequest.ts b/examples/v2/change-management/GetChangeRequest.ts new file mode 100644 index 000000000000..2a5fcc538ea5 --- /dev/null +++ b/examples/v2/change-management/GetChangeRequest.ts @@ -0,0 +1,22 @@ +/** + * Get a change request returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.getChangeRequest"] = true; +const apiInstance = new v2.ChangeManagementApi(configuration); + +const params: v2.ChangeManagementApiGetChangeRequestRequest = { + changeRequestId: "change_request_id", +}; + +apiInstance + .getChangeRequest(params) + .then((data: v2.ChangeRequestResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/change-management/UpdateChangeRequest.ts b/examples/v2/change-management/UpdateChangeRequest.ts new file mode 100644 index 000000000000..662c6bd384fa --- /dev/null +++ b/examples/v2/change-management/UpdateChangeRequest.ts @@ -0,0 +1,63 @@ +/** + * Update a change request returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.updateChangeRequest"] = true; +const apiInstance = new v2.ChangeManagementApi(configuration); + +const params: v2.ChangeManagementApiUpdateChangeRequestRequest = { + body: { + data: { + attributes: { + changeRequestPlan: "Updated deployment plan", + changeRequestRisk: "LOW", + changeRequestType: "NORMAL", + endDate: new Date(2024, 1, 2, 15, 0, 0, 0), + id: "CHM-1234", + startDate: new Date(2024, 1, 1, 3, 0, 0, 0), + }, + relationships: { + changeRequestDecisions: { + data: [ + { + id: "decision-id-0", + type: "change_request_decision", + }, + ], + }, + }, + type: "change_request", + }, + included: [ + { + attributes: { + changeRequestStatus: "REQUESTED", + requestReason: "Please review and approve this change", + }, + id: "decision-id-0", + relationships: { + requestedUser: { + data: { + id: "00000000-0000-0000-0000-000000000000", + type: "user", + }, + }, + }, + type: "change_request_decision", + }, + ], + }, + changeRequestId: "change_request_id", +}; + +apiInstance + .updateChangeRequest(params) + .then((data: v2.ChangeRequestResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/change-management/UpdateChangeRequestDecision.ts b/examples/v2/change-management/UpdateChangeRequestDecision.ts new file mode 100644 index 000000000000..a0145d04c496 --- /dev/null +++ b/examples/v2/change-management/UpdateChangeRequestDecision.ts @@ -0,0 +1,59 @@ +/** + * Update a change request decision returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.updateChangeRequestDecision"] = true; +const apiInstance = new v2.ChangeManagementApi(configuration); + +const params: v2.ChangeManagementApiUpdateChangeRequestDecisionRequest = { + body: { + data: { + attributes: { + id: "CHM-1234", + }, + relationships: { + changeRequestDecisions: { + data: [ + { + id: "decision-id-0", + type: "change_request_decision", + }, + ], + }, + }, + type: "change_request", + }, + included: [ + { + attributes: { + changeRequestStatus: "REQUESTED", + requestReason: "Please review and approve this change", + }, + id: "decision-id-0", + relationships: { + requestedUser: { + data: { + id: "00000000-0000-0000-0000-000000000000", + type: "user", + }, + }, + }, + type: "change_request_decision", + }, + ], + }, + changeRequestId: "change_request_id", + decisionId: "decision_id", +}; + +apiInstance + .updateChangeRequestDecision(params) + .then((data: v2.ChangeRequestResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 0e7144ae3d2b..2ca8b77ed6c2 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -3805,6 +3805,68 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "ListRelationCatalogResponse", }, + "v2.CreateChangeRequest": { + "body": { + "type": "ChangeRequestCreateRequest", + "format": "", + }, + "operationResponseType": "ChangeRequestResponse", + }, + "v2.GetChangeRequest": { + "changeRequestId": { + "type": "string", + "format": "", + }, + "operationResponseType": "ChangeRequestResponse", + }, + "v2.UpdateChangeRequest": { + "changeRequestId": { + "type": "string", + "format": "", + }, + "body": { + "type": "ChangeRequestUpdateRequest", + "format": "", + }, + "operationResponseType": "ChangeRequestResponse", + }, + "v2.CreateChangeRequestBranch": { + "changeRequestId": { + "type": "string", + "format": "", + }, + "body": { + "type": "ChangeRequestBranchCreateRequest", + "format": "", + }, + "operationResponseType": "ChangeRequestResponse", + }, + "v2.DeleteChangeRequestDecision": { + "changeRequestId": { + "type": "string", + "format": "", + }, + "decisionId": { + "type": "string", + "format": "", + }, + "operationResponseType": "ChangeRequestResponse", + }, + "v2.UpdateChangeRequestDecision": { + "changeRequestId": { + "type": "string", + "format": "", + }, + "decisionId": { + "type": "string", + "format": "", + }, + "body": { + "type": "ChangeRequestDecisionUpdateRequest", + "format": "", + }, + "operationResponseType": "ChangeRequestResponse", + }, "v2.CreateCIAppPipelineEvent": { "body": { "type": "CIAppCreatePipelineEventRequest", diff --git a/features/v2/change_management.feature b/features/v2/change_management.feature new file mode 100644 index 000000000000..dbbae657bb80 --- /dev/null +++ b/features/v2/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/features/v2/undo.json b/features/v2/undo.json index 10efec9a5c1b..53890381408a 100644 --- a/features/v2/undo.json +++ b/features/v2/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": { diff --git a/packages/datadog-api-client-common/configuration.ts b/packages/datadog-api-client-common/configuration.ts index 276f1255c419..3286733e0230 100644 --- a/packages/datadog-api-client-common/configuration.ts +++ b/packages/datadog-api-client-common/configuration.ts @@ -248,6 +248,12 @@ export function createConfiguration( "v2.linkJiraIssueToCase": false, "v2.moveCaseToProject": false, "v2.unlinkJiraIssue": false, + "v2.createChangeRequest": false, + "v2.createChangeRequestBranch": false, + "v2.deleteChangeRequestDecision": false, + "v2.getChangeRequest": false, + "v2.updateChangeRequest": false, + "v2.updateChangeRequestDecision": false, "v2.listAWSCloudAuthPersonaMappings": false, "v2.activateContentPack": false, "v2.cancelThreatHuntingJob": false, diff --git a/packages/datadog-api-client-v2/apis/ChangeManagementApi.ts b/packages/datadog-api-client-v2/apis/ChangeManagementApi.ts new file mode 100644 index 000000000000..5247fa7fcf07 --- /dev/null +++ b/packages/datadog-api-client-v2/apis/ChangeManagementApi.ts @@ -0,0 +1,1073 @@ +import { + BaseAPIRequestFactory, + RequiredError, +} from "../../datadog-api-client-common/baseapi"; +import { + Configuration, + applySecurityAuthentication, +} from "../../datadog-api-client-common/configuration"; +import { + RequestContext, + HttpMethod, + ResponseContext, +} from "../../datadog-api-client-common/http/http"; + +import { logger } from "../../../logger"; +import { ObjectSerializer } from "../models/ObjectSerializer"; +import { ApiException } from "../../datadog-api-client-common/exception"; + +import { APIErrorResponse } from "../models/APIErrorResponse"; +import { ChangeRequestBranchCreateRequest } from "../models/ChangeRequestBranchCreateRequest"; +import { ChangeRequestCreateRequest } from "../models/ChangeRequestCreateRequest"; +import { ChangeRequestDecisionUpdateRequest } from "../models/ChangeRequestDecisionUpdateRequest"; +import { ChangeRequestResponse } from "../models/ChangeRequestResponse"; +import { ChangeRequestUpdateRequest } from "../models/ChangeRequestUpdateRequest"; +import { JSONAPIErrorResponse } from "../models/JSONAPIErrorResponse"; + +export class ChangeManagementApiRequestFactory extends BaseAPIRequestFactory { + public async createChangeRequest( + body: ChangeRequestCreateRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'createChangeRequest'"); + if (!_config.unstableOperations["v2.createChangeRequest"]) { + throw new Error("Unstable operation 'createChangeRequest' is disabled"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createChangeRequest"); + } + + // Path Params + const localVarPath = "/api/v2/change-management/change-request"; + + // Make Request Context + const requestContext = _config + .getServer("v2.ChangeManagementApi.createChangeRequest") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "ChangeRequestCreateRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async createChangeRequestBranch( + changeRequestId: string, + body: ChangeRequestBranchCreateRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'createChangeRequestBranch'"); + if (!_config.unstableOperations["v2.createChangeRequestBranch"]) { + throw new Error( + "Unstable operation 'createChangeRequestBranch' is disabled" + ); + } + + // verify required parameter 'changeRequestId' is not null or undefined + if (changeRequestId === null || changeRequestId === undefined) { + throw new RequiredError("changeRequestId", "createChangeRequestBranch"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createChangeRequestBranch"); + } + + // Path Params + const localVarPath = + "/api/v2/change-management/change-request/{change_request_id}/branch".replace( + "{change_request_id}", + encodeURIComponent(String(changeRequestId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.ChangeManagementApi.createChangeRequestBranch") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "ChangeRequestBranchCreateRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async deleteChangeRequestDecision( + changeRequestId: string, + decisionId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'deleteChangeRequestDecision'"); + if (!_config.unstableOperations["v2.deleteChangeRequestDecision"]) { + throw new Error( + "Unstable operation 'deleteChangeRequestDecision' is disabled" + ); + } + + // verify required parameter 'changeRequestId' is not null or undefined + if (changeRequestId === null || changeRequestId === undefined) { + throw new RequiredError("changeRequestId", "deleteChangeRequestDecision"); + } + + // verify required parameter 'decisionId' is not null or undefined + if (decisionId === null || decisionId === undefined) { + throw new RequiredError("decisionId", "deleteChangeRequestDecision"); + } + + // Path Params + const localVarPath = + "/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id}" + .replace( + "{change_request_id}", + encodeURIComponent(String(changeRequestId)) + ) + .replace("{decision_id}", encodeURIComponent(String(decisionId))); + + // Make Request Context + const requestContext = _config + .getServer("v2.ChangeManagementApi.deleteChangeRequestDecision") + .makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async getChangeRequest( + changeRequestId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'getChangeRequest'"); + if (!_config.unstableOperations["v2.getChangeRequest"]) { + throw new Error("Unstable operation 'getChangeRequest' is disabled"); + } + + // verify required parameter 'changeRequestId' is not null or undefined + if (changeRequestId === null || changeRequestId === undefined) { + throw new RequiredError("changeRequestId", "getChangeRequest"); + } + + // Path Params + const localVarPath = + "/api/v2/change-management/change-request/{change_request_id}".replace( + "{change_request_id}", + encodeURIComponent(String(changeRequestId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.ChangeManagementApi.getChangeRequest") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async updateChangeRequest( + changeRequestId: string, + body: ChangeRequestUpdateRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'updateChangeRequest'"); + if (!_config.unstableOperations["v2.updateChangeRequest"]) { + throw new Error("Unstable operation 'updateChangeRequest' is disabled"); + } + + // verify required parameter 'changeRequestId' is not null or undefined + if (changeRequestId === null || changeRequestId === undefined) { + throw new RequiredError("changeRequestId", "updateChangeRequest"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "updateChangeRequest"); + } + + // Path Params + const localVarPath = + "/api/v2/change-management/change-request/{change_request_id}".replace( + "{change_request_id}", + encodeURIComponent(String(changeRequestId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.ChangeManagementApi.updateChangeRequest") + .makeRequestContext(localVarPath, HttpMethod.PATCH); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "ChangeRequestUpdateRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async updateChangeRequestDecision( + changeRequestId: string, + decisionId: string, + body: ChangeRequestDecisionUpdateRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'updateChangeRequestDecision'"); + if (!_config.unstableOperations["v2.updateChangeRequestDecision"]) { + throw new Error( + "Unstable operation 'updateChangeRequestDecision' is disabled" + ); + } + + // verify required parameter 'changeRequestId' is not null or undefined + if (changeRequestId === null || changeRequestId === undefined) { + throw new RequiredError("changeRequestId", "updateChangeRequestDecision"); + } + + // verify required parameter 'decisionId' is not null or undefined + if (decisionId === null || decisionId === undefined) { + throw new RequiredError("decisionId", "updateChangeRequestDecision"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "updateChangeRequestDecision"); + } + + // Path Params + const localVarPath = + "/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id}" + .replace( + "{change_request_id}", + encodeURIComponent(String(changeRequestId)) + ) + .replace("{decision_id}", encodeURIComponent(String(decisionId))); + + // Make Request Context + const requestContext = _config + .getServer("v2.ChangeManagementApi.updateChangeRequestDecision") + .makeRequestContext(localVarPath, HttpMethod.PATCH); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize( + body, + "ChangeRequestDecisionUpdateRequest", + "" + ), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } +} + +export class ChangeManagementApiResponseProcessor { + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createChangeRequest + * @throws ApiException if the response code was not in [200, 299] + */ + public async createChangeRequest( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 201) { + const body: ChangeRequestResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ChangeRequestResponse" + ) as ChangeRequestResponse; + return body; + } + if (response.httpStatusCode === 400 || response.httpStatusCode === 403) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ChangeRequestResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ChangeRequestResponse", + "" + ) as ChangeRequestResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createChangeRequestBranch + * @throws ApiException if the response code was not in [200, 299] + */ + public async createChangeRequestBranch( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: ChangeRequestResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ChangeRequestResponse" + ) as ChangeRequestResponse; + return body; + } + if (response.httpStatusCode === 400 || response.httpStatusCode === 404) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ChangeRequestResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ChangeRequestResponse", + "" + ) as ChangeRequestResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteChangeRequestDecision + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteChangeRequestDecision( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: ChangeRequestResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ChangeRequestResponse" + ) as ChangeRequestResponse; + return body; + } + if (response.httpStatusCode === 400 || response.httpStatusCode === 404) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ChangeRequestResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ChangeRequestResponse", + "" + ) as ChangeRequestResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getChangeRequest + * @throws ApiException if the response code was not in [200, 299] + */ + public async getChangeRequest( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: ChangeRequestResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ChangeRequestResponse" + ) as ChangeRequestResponse; + return body; + } + if (response.httpStatusCode === 400 || response.httpStatusCode === 404) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ChangeRequestResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ChangeRequestResponse", + "" + ) as ChangeRequestResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to updateChangeRequest + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateChangeRequest( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: ChangeRequestResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ChangeRequestResponse" + ) as ChangeRequestResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ChangeRequestResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ChangeRequestResponse", + "" + ) as ChangeRequestResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to updateChangeRequestDecision + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateChangeRequestDecision( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: ChangeRequestResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ChangeRequestResponse" + ) as ChangeRequestResponse; + return body; + } + if (response.httpStatusCode === 400 || response.httpStatusCode === 404) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ChangeRequestResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ChangeRequestResponse", + "" + ) as ChangeRequestResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } +} + +export interface ChangeManagementApiCreateChangeRequestRequest { + /** + * Change request payload. + * @type ChangeRequestCreateRequest + */ + body: ChangeRequestCreateRequest; +} + +export interface ChangeManagementApiCreateChangeRequestBranchRequest { + /** + * The identifier of the change request. + * @type string + */ + changeRequestId: string; + /** + * Branch creation payload. + * @type ChangeRequestBranchCreateRequest + */ + body: ChangeRequestBranchCreateRequest; +} + +export interface ChangeManagementApiDeleteChangeRequestDecisionRequest { + /** + * The identifier of the change request. + * @type string + */ + changeRequestId: string; + /** + * The identifier of the change request decision. + * @type string + */ + decisionId: string; +} + +export interface ChangeManagementApiGetChangeRequestRequest { + /** + * The identifier of the change request. + * @type string + */ + changeRequestId: string; +} + +export interface ChangeManagementApiUpdateChangeRequestRequest { + /** + * The identifier of the change request. + * @type string + */ + changeRequestId: string; + /** + * Change request update payload. + * @type ChangeRequestUpdateRequest + */ + body: ChangeRequestUpdateRequest; +} + +export interface ChangeManagementApiUpdateChangeRequestDecisionRequest { + /** + * The identifier of the change request. + * @type string + */ + changeRequestId: string; + /** + * The identifier of the change request decision. + * @type string + */ + decisionId: string; + /** + * Decision update payload. + * @type ChangeRequestDecisionUpdateRequest + */ + body: ChangeRequestDecisionUpdateRequest; +} + +export class ChangeManagementApi { + private requestFactory: ChangeManagementApiRequestFactory; + private responseProcessor: ChangeManagementApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: ChangeManagementApiRequestFactory, + responseProcessor?: ChangeManagementApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = + requestFactory || new ChangeManagementApiRequestFactory(configuration); + this.responseProcessor = + responseProcessor || new ChangeManagementApiResponseProcessor(); + } + + /** + * Create a new change request. + * @param param The request object + */ + public createChangeRequest( + param: ChangeManagementApiCreateChangeRequestRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.createChangeRequest( + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createChangeRequest(responseContext); + }); + }); + } + + /** + * Create a new branch in a repository for a change request. + * @param param The request object + */ + public createChangeRequestBranch( + param: ChangeManagementApiCreateChangeRequestBranchRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.createChangeRequestBranch( + param.changeRequestId, + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createChangeRequestBranch( + responseContext + ); + }); + }); + } + + /** + * Delete a decision from a change request. + * @param param The request object + */ + public deleteChangeRequestDecision( + param: ChangeManagementApiDeleteChangeRequestDecisionRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.deleteChangeRequestDecision( + param.changeRequestId, + param.decisionId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteChangeRequestDecision( + responseContext + ); + }); + }); + } + + /** + * Get the details of a change request by its ID. + * @param param The request object + */ + public getChangeRequest( + param: ChangeManagementApiGetChangeRequestRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.getChangeRequest( + param.changeRequestId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getChangeRequest(responseContext); + }); + }); + } + + /** + * Update the properties of a change request. + * @param param The request object + */ + public updateChangeRequest( + param: ChangeManagementApiUpdateChangeRequestRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.updateChangeRequest( + param.changeRequestId, + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.updateChangeRequest(responseContext); + }); + }); + } + + /** + * Update a decision on a change request, such as approving or declining it. + * @param param The request object + */ + public updateChangeRequestDecision( + param: ChangeManagementApiUpdateChangeRequestDecisionRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.updateChangeRequestDecision( + param.changeRequestId, + param.decisionId, + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.updateChangeRequestDecision( + responseContext + ); + }); + }); + } +} diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index 7f5a54da9324..6ce03ed92002 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -201,6 +201,16 @@ export { CaseManagementTypeApi, } from "./apis/CaseManagementTypeApi"; +export { + ChangeManagementApiCreateChangeRequestRequest, + ChangeManagementApiCreateChangeRequestBranchRequest, + ChangeManagementApiDeleteChangeRequestDecisionRequest, + ChangeManagementApiGetChangeRequestRequest, + ChangeManagementApiUpdateChangeRequestRequest, + ChangeManagementApiUpdateChangeRequestDecisionRequest, + ChangeManagementApi, +} from "./apis/ChangeManagementApi"; + export { CloudAuthenticationApi } from "./apis/CloudAuthenticationApi"; export { @@ -1670,6 +1680,43 @@ export { ChangeEventCustomAttributesChangedResourceType } from "./models/ChangeE export { ChangeEventCustomAttributesImpactedResourcesItems } from "./models/ChangeEventCustomAttributesImpactedResourcesItems"; export { ChangeEventCustomAttributesImpactedResourcesItemsType } from "./models/ChangeEventCustomAttributesImpactedResourcesItemsType"; export { ChangeEventTriggerWrapper } from "./models/ChangeEventTriggerWrapper"; +export { ChangeRequestBranchCreateAttributes } from "./models/ChangeRequestBranchCreateAttributes"; +export { ChangeRequestBranchCreateData } from "./models/ChangeRequestBranchCreateData"; +export { ChangeRequestBranchCreateRequest } from "./models/ChangeRequestBranchCreateRequest"; +export { ChangeRequestBranchResourceType } from "./models/ChangeRequestBranchResourceType"; +export { ChangeRequestChangeType } from "./models/ChangeRequestChangeType"; +export { ChangeRequestCreateAttributes } from "./models/ChangeRequestCreateAttributes"; +export { ChangeRequestCreateData } from "./models/ChangeRequestCreateData"; +export { ChangeRequestCreateRequest } from "./models/ChangeRequestCreateRequest"; +export { ChangeRequestDecisionCreateAttributes } from "./models/ChangeRequestDecisionCreateAttributes"; +export { ChangeRequestDecisionCreateItem } from "./models/ChangeRequestDecisionCreateItem"; +export { ChangeRequestDecisionCreateRelationships } from "./models/ChangeRequestDecisionCreateRelationships"; +export { ChangeRequestDecisionRelationshipData } from "./models/ChangeRequestDecisionRelationshipData"; +export { ChangeRequestDecisionRelationships } from "./models/ChangeRequestDecisionRelationships"; +export { ChangeRequestDecisionResourceType } from "./models/ChangeRequestDecisionResourceType"; +export { ChangeRequestDecisionResponseAttributes } from "./models/ChangeRequestDecisionResponseAttributes"; +export { ChangeRequestDecisionsRelationship } from "./models/ChangeRequestDecisionsRelationship"; +export { ChangeRequestDecisionStatusType } from "./models/ChangeRequestDecisionStatusType"; +export { ChangeRequestDecisionUpdateData } from "./models/ChangeRequestDecisionUpdateData"; +export { ChangeRequestDecisionUpdateDataAttributes } from "./models/ChangeRequestDecisionUpdateDataAttributes"; +export { ChangeRequestDecisionUpdateDataRelationships } from "./models/ChangeRequestDecisionUpdateDataRelationships"; +export { ChangeRequestDecisionUpdateRequest } from "./models/ChangeRequestDecisionUpdateRequest"; +export { ChangeRequestIncludedDecision } from "./models/ChangeRequestIncludedDecision"; +export { ChangeRequestIncludedItem } from "./models/ChangeRequestIncludedItem"; +export { ChangeRequestIncludedUser } from "./models/ChangeRequestIncludedUser"; +export { ChangeRequestIncludedUserAttributes } from "./models/ChangeRequestIncludedUserAttributes"; +export { ChangeRequestRelationships } from "./models/ChangeRequestRelationships"; +export { ChangeRequestResourceType } from "./models/ChangeRequestResourceType"; +export { ChangeRequestResponse } from "./models/ChangeRequestResponse"; +export { ChangeRequestResponseAttributes } from "./models/ChangeRequestResponseAttributes"; +export { ChangeRequestResponseData } from "./models/ChangeRequestResponseData"; +export { ChangeRequestRiskLevel } from "./models/ChangeRequestRiskLevel"; +export { ChangeRequestUpdateAttributes } from "./models/ChangeRequestUpdateAttributes"; +export { ChangeRequestUpdateData } from "./models/ChangeRequestUpdateData"; +export { ChangeRequestUpdateRelationships } from "./models/ChangeRequestUpdateRelationships"; +export { ChangeRequestUpdateRequest } from "./models/ChangeRequestUpdateRequest"; +export { ChangeRequestUserRelationship } from "./models/ChangeRequestUserRelationship"; +export { ChangeRequestUserRelationshipData } from "./models/ChangeRequestUserRelationshipData"; export { ChargebackBreakdown } from "./models/ChargebackBreakdown"; export { CIAppAggregateBucketValue } from "./models/CIAppAggregateBucketValue"; export { CIAppAggregateBucketValueTimeseriesPoint } from "./models/CIAppAggregateBucketValueTimeseriesPoint"; diff --git a/packages/datadog-api-client-v2/models/ChangeRequestBranchCreateAttributes.ts b/packages/datadog-api-client-v2/models/ChangeRequestBranchCreateAttributes.ts new file mode 100644 index 000000000000..2c5eb6d337cf --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestBranchCreateAttributes.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes for creating a change request branch. + */ +export class ChangeRequestBranchCreateAttributes { + /** + * The name of the branch to create. + */ + "branchName": string; + /** + * The repository identifier in the format owner/repository. + */ + "repoId": string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + branchName: { + baseName: "branch_name", + type: "string", + required: true, + }, + repoId: { + baseName: "repo_id", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestBranchCreateAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestBranchCreateData.ts b/packages/datadog-api-client-v2/models/ChangeRequestBranchCreateData.ts new file mode 100644 index 000000000000..d9a9a20cf484 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestBranchCreateData.ts @@ -0,0 +1,64 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ChangeRequestBranchCreateAttributes } from "./ChangeRequestBranchCreateAttributes"; +import { ChangeRequestBranchResourceType } from "./ChangeRequestBranchResourceType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data object to create a change request branch. + */ +export class ChangeRequestBranchCreateData { + /** + * Attributes for creating a change request branch. + */ + "attributes": ChangeRequestBranchCreateAttributes; + /** + * Change request branch resource type. + */ + "type": ChangeRequestBranchResourceType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "ChangeRequestBranchCreateAttributes", + required: true, + }, + type: { + baseName: "type", + type: "ChangeRequestBranchResourceType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestBranchCreateData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestBranchCreateRequest.ts b/packages/datadog-api-client-v2/models/ChangeRequestBranchCreateRequest.ts new file mode 100644 index 000000000000..18ec71335622 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestBranchCreateRequest.ts @@ -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 2020-Present Datadog, Inc. + */ +import { ChangeRequestBranchCreateData } from "./ChangeRequestBranchCreateData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request object to create a branch for a change request. + */ +export class ChangeRequestBranchCreateRequest { + /** + * Data object to create a change request branch. + */ + "data": ChangeRequestBranchCreateData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "ChangeRequestBranchCreateData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestBranchCreateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestBranchResourceType.ts b/packages/datadog-api-client-v2/models/ChangeRequestBranchResourceType.ts new file mode 100644 index 000000000000..c480e9251873 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestBranchResourceType.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Change request branch resource type. + */ + +export type ChangeRequestBranchResourceType = + | typeof CHANGE_REQUEST_BRANCH + | UnparsedObject; +export const CHANGE_REQUEST_BRANCH = "change_request_branch"; diff --git a/packages/datadog-api-client-v2/models/ChangeRequestChangeType.ts b/packages/datadog-api-client-v2/models/ChangeRequestChangeType.ts new file mode 100644 index 000000000000..2ae4badd2ba8 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestChangeType.ts @@ -0,0 +1,20 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The type of the change request. + */ + +export type ChangeRequestChangeType = + | typeof NORMAL + | typeof STANDARD + | typeof EMERGENCY + | UnparsedObject; +export const NORMAL = "NORMAL"; +export const STANDARD = "STANDARD"; +export const EMERGENCY = "EMERGENCY"; diff --git a/packages/datadog-api-client-v2/models/ChangeRequestCreateAttributes.ts b/packages/datadog-api-client-v2/models/ChangeRequestCreateAttributes.ts new file mode 100644 index 000000000000..25a2482abdb3 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestCreateAttributes.ts @@ -0,0 +1,137 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ChangeRequestChangeType } from "./ChangeRequestChangeType"; +import { ChangeRequestRiskLevel } from "./ChangeRequestRiskLevel"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes for creating a change request. + */ +export class ChangeRequestCreateAttributes { + /** + * The UUID of an incident to link to the change request. + */ + "changeRequestLinkedIncidentUuid"?: string; + /** + * The maintenance window query for the change request. + */ + "changeRequestMaintenanceWindowQuery"?: string; + /** + * The plan associated with the change request. + */ + "changeRequestPlan"?: string; + /** + * The risk level of the change request. + */ + "changeRequestRisk"?: ChangeRequestRiskLevel; + /** + * The type of the change request. + */ + "changeRequestType"?: ChangeRequestChangeType; + /** + * The description of the change request. + */ + "description"?: string; + /** + * The planned end date of the change request. + */ + "endDate"?: Date; + /** + * The project UUID to associate with the change request. + */ + "projectId"?: string; + /** + * A list of team handles to request decisions from. + */ + "requestedTeams"?: Array; + /** + * The planned start date of the change request. + */ + "startDate"?: Date; + /** + * The title of the change request. + */ + "title": string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + changeRequestLinkedIncidentUuid: { + baseName: "change_request_linked_incident_uuid", + type: "string", + }, + changeRequestMaintenanceWindowQuery: { + baseName: "change_request_maintenance_window_query", + type: "string", + }, + changeRequestPlan: { + baseName: "change_request_plan", + type: "string", + }, + changeRequestRisk: { + baseName: "change_request_risk", + type: "ChangeRequestRiskLevel", + }, + changeRequestType: { + baseName: "change_request_type", + type: "ChangeRequestChangeType", + }, + description: { + baseName: "description", + type: "string", + }, + endDate: { + baseName: "end_date", + type: "Date", + format: "date-time", + }, + projectId: { + baseName: "project_id", + type: "string", + }, + requestedTeams: { + baseName: "requested_teams", + type: "Array", + }, + startDate: { + baseName: "start_date", + type: "Date", + format: "date-time", + }, + title: { + baseName: "title", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestCreateAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestCreateData.ts b/packages/datadog-api-client-v2/models/ChangeRequestCreateData.ts new file mode 100644 index 000000000000..52ebe1e69f24 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestCreateData.ts @@ -0,0 +1,64 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ChangeRequestCreateAttributes } from "./ChangeRequestCreateAttributes"; +import { ChangeRequestResourceType } from "./ChangeRequestResourceType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data object to create a change request. + */ +export class ChangeRequestCreateData { + /** + * Attributes for creating a change request. + */ + "attributes": ChangeRequestCreateAttributes; + /** + * Change request resource type. + */ + "type": ChangeRequestResourceType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "ChangeRequestCreateAttributes", + required: true, + }, + type: { + baseName: "type", + type: "ChangeRequestResourceType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestCreateData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestCreateRequest.ts b/packages/datadog-api-client-v2/models/ChangeRequestCreateRequest.ts new file mode 100644 index 000000000000..7a155fc6400a --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestCreateRequest.ts @@ -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 2020-Present Datadog, Inc. + */ +import { ChangeRequestCreateData } from "./ChangeRequestCreateData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request object to create a change request. + */ +export class ChangeRequestCreateRequest { + /** + * Data object to create a change request. + */ + "data": ChangeRequestCreateData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "ChangeRequestCreateData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestCreateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestDecisionCreateAttributes.ts b/packages/datadog-api-client-v2/models/ChangeRequestDecisionCreateAttributes.ts new file mode 100644 index 000000000000..a23dd794bf94 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestDecisionCreateAttributes.ts @@ -0,0 +1,61 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ChangeRequestDecisionStatusType } from "./ChangeRequestDecisionStatusType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes for creating a change request decision. + */ +export class ChangeRequestDecisionCreateAttributes { + /** + * The status of a change request decision. + */ + "changeRequestStatus"?: ChangeRequestDecisionStatusType; + /** + * The reason for requesting the decision. + */ + "requestReason"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + changeRequestStatus: { + baseName: "change_request_status", + type: "ChangeRequestDecisionStatusType", + }, + requestReason: { + baseName: "request_reason", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestDecisionCreateAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestDecisionCreateItem.ts b/packages/datadog-api-client-v2/models/ChangeRequestDecisionCreateItem.ts new file mode 100644 index 000000000000..6e82c8f98e94 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestDecisionCreateItem.ts @@ -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 2020-Present Datadog, Inc. + */ +import { ChangeRequestDecisionCreateAttributes } from "./ChangeRequestDecisionCreateAttributes"; +import { ChangeRequestDecisionCreateRelationships } from "./ChangeRequestDecisionCreateRelationships"; +import { ChangeRequestDecisionResourceType } from "./ChangeRequestDecisionResourceType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * An included change request decision for a create or update operation. + */ +export class ChangeRequestDecisionCreateItem { + /** + * Attributes for creating a change request decision. + */ + "attributes"?: ChangeRequestDecisionCreateAttributes; + /** + * The decision identifier. + */ + "id": string; + /** + * Relationships for creating a change request decision. + */ + "relationships"?: ChangeRequestDecisionCreateRelationships; + /** + * Change request decision resource type. + */ + "type": ChangeRequestDecisionResourceType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "ChangeRequestDecisionCreateAttributes", + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + relationships: { + baseName: "relationships", + type: "ChangeRequestDecisionCreateRelationships", + }, + type: { + baseName: "type", + type: "ChangeRequestDecisionResourceType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestDecisionCreateItem.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestDecisionCreateRelationships.ts b/packages/datadog-api-client-v2/models/ChangeRequestDecisionCreateRelationships.ts new file mode 100644 index 000000000000..ad882f4da350 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestDecisionCreateRelationships.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ChangeRequestUserRelationship } from "./ChangeRequestUserRelationship"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Relationships for creating a change request decision. + */ +export class ChangeRequestDecisionCreateRelationships { + /** + * Relationship to a user. + */ + "requestedUser"?: ChangeRequestUserRelationship; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + requestedUser: { + baseName: "requested_user", + type: "ChangeRequestUserRelationship", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestDecisionCreateRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestDecisionRelationshipData.ts b/packages/datadog-api-client-v2/models/ChangeRequestDecisionRelationshipData.ts new file mode 100644 index 000000000000..91390673fed5 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestDecisionRelationshipData.ts @@ -0,0 +1,63 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ChangeRequestDecisionResourceType } from "./ChangeRequestDecisionResourceType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Change request decision relationship data. + */ +export class ChangeRequestDecisionRelationshipData { + /** + * The decision UUID. + */ + "id": string; + /** + * Change request decision resource type. + */ + "type": ChangeRequestDecisionResourceType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "ChangeRequestDecisionResourceType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestDecisionRelationshipData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestDecisionRelationships.ts b/packages/datadog-api-client-v2/models/ChangeRequestDecisionRelationships.ts new file mode 100644 index 000000000000..17d210108b70 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestDecisionRelationships.ts @@ -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 2020-Present Datadog, Inc. + */ +import { ChangeRequestUserRelationship } from "./ChangeRequestUserRelationship"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Relationships of a change request decision. + */ +export class ChangeRequestDecisionRelationships { + /** + * Relationship to a user. + */ + "modifiedBy": ChangeRequestUserRelationship; + /** + * Relationship to a user. + */ + "requestedByUser": ChangeRequestUserRelationship; + /** + * Relationship to a user. + */ + "requestedUser": ChangeRequestUserRelationship; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + modifiedBy: { + baseName: "modified_by", + type: "ChangeRequestUserRelationship", + required: true, + }, + requestedByUser: { + baseName: "requested_by_user", + type: "ChangeRequestUserRelationship", + required: true, + }, + requestedUser: { + baseName: "requested_user", + type: "ChangeRequestUserRelationship", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestDecisionRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestDecisionResourceType.ts b/packages/datadog-api-client-v2/models/ChangeRequestDecisionResourceType.ts new file mode 100644 index 000000000000..aacfb1110def --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestDecisionResourceType.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Change request decision resource type. + */ + +export type ChangeRequestDecisionResourceType = + | typeof CHANGE_REQUEST_DECISION + | UnparsedObject; +export const CHANGE_REQUEST_DECISION = "change_request_decision"; diff --git a/packages/datadog-api-client-v2/models/ChangeRequestDecisionResponseAttributes.ts b/packages/datadog-api-client-v2/models/ChangeRequestDecisionResponseAttributes.ts new file mode 100644 index 000000000000..9560da75f070 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestDecisionResponseAttributes.ts @@ -0,0 +1,102 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ChangeRequestDecisionStatusType } from "./ChangeRequestDecisionStatusType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of a change request decision in a response. + */ +export class ChangeRequestDecisionResponseAttributes { + /** + * The status of a change request decision. + */ + "changeRequestStatus": ChangeRequestDecisionStatusType; + /** + * Timestamp of when the decision was made. + */ + "decidedAt": Date; + /** + * The reason for the decision. + */ + "decisionReason": string; + /** + * Timestamp of when the decision was deleted. + */ + "deletedAt": Date; + /** + * The reason for requesting the decision. + */ + "requestReason": string; + /** + * Timestamp of when the decision was requested. + */ + "requestedAt": Date; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + changeRequestStatus: { + baseName: "change_request_status", + type: "ChangeRequestDecisionStatusType", + required: true, + }, + decidedAt: { + baseName: "decided_at", + type: "Date", + required: true, + format: "date-time", + }, + decisionReason: { + baseName: "decision_reason", + type: "string", + required: true, + }, + deletedAt: { + baseName: "deleted_at", + type: "Date", + required: true, + format: "date-time", + }, + requestReason: { + baseName: "request_reason", + type: "string", + required: true, + }, + requestedAt: { + baseName: "requested_at", + type: "Date", + required: true, + format: "date-time", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestDecisionResponseAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestDecisionStatusType.ts b/packages/datadog-api-client-v2/models/ChangeRequestDecisionStatusType.ts new file mode 100644 index 000000000000..c84d4e416c2a --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestDecisionStatusType.ts @@ -0,0 +1,20 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The status of a change request decision. + */ + +export type ChangeRequestDecisionStatusType = + | typeof REQUESTED + | typeof APPROVED + | typeof DECLINED + | UnparsedObject; +export const REQUESTED = "REQUESTED"; +export const APPROVED = "APPROVED"; +export const DECLINED = "DECLINED"; diff --git a/packages/datadog-api-client-v2/models/ChangeRequestDecisionUpdateData.ts b/packages/datadog-api-client-v2/models/ChangeRequestDecisionUpdateData.ts new file mode 100644 index 000000000000..ebcd14e79803 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestDecisionUpdateData.ts @@ -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 2020-Present Datadog, Inc. + */ +import { ChangeRequestDecisionUpdateDataAttributes } from "./ChangeRequestDecisionUpdateDataAttributes"; +import { ChangeRequestDecisionUpdateDataRelationships } from "./ChangeRequestDecisionUpdateDataRelationships"; +import { ChangeRequestResourceType } from "./ChangeRequestResourceType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data object to update a change request decision. + */ +export class ChangeRequestDecisionUpdateData { + /** + * Attributes of the parent change request for a decision update. + */ + "attributes"?: ChangeRequestDecisionUpdateDataAttributes; + /** + * Relationships for updating a change request decision. + */ + "relationships"?: ChangeRequestDecisionUpdateDataRelationships; + /** + * Change request resource type. + */ + "type": ChangeRequestResourceType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "ChangeRequestDecisionUpdateDataAttributes", + }, + relationships: { + baseName: "relationships", + type: "ChangeRequestDecisionUpdateDataRelationships", + }, + type: { + baseName: "type", + type: "ChangeRequestResourceType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestDecisionUpdateData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestDecisionUpdateDataAttributes.ts b/packages/datadog-api-client-v2/models/ChangeRequestDecisionUpdateDataAttributes.ts new file mode 100644 index 000000000000..b5fad9320c75 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestDecisionUpdateDataAttributes.ts @@ -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 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of the parent change request for a decision update. + */ +export class ChangeRequestDecisionUpdateDataAttributes { + /** + * The identifier of the change request. + */ + "id"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestDecisionUpdateDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestDecisionUpdateDataRelationships.ts b/packages/datadog-api-client-v2/models/ChangeRequestDecisionUpdateDataRelationships.ts new file mode 100644 index 000000000000..b11dab982fb8 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestDecisionUpdateDataRelationships.ts @@ -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 2020-Present Datadog, Inc. + */ +import { ChangeRequestDecisionsRelationship } from "./ChangeRequestDecisionsRelationship"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Relationships for updating a change request decision. + */ +export class ChangeRequestDecisionUpdateDataRelationships { + /** + * Relationship to change request decisions. + */ + "changeRequestDecisions": ChangeRequestDecisionsRelationship; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + changeRequestDecisions: { + baseName: "change_request_decisions", + type: "ChangeRequestDecisionsRelationship", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestDecisionUpdateDataRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestDecisionUpdateRequest.ts b/packages/datadog-api-client-v2/models/ChangeRequestDecisionUpdateRequest.ts new file mode 100644 index 000000000000..4943a23df234 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestDecisionUpdateRequest.ts @@ -0,0 +1,63 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ChangeRequestDecisionCreateItem } from "./ChangeRequestDecisionCreateItem"; +import { ChangeRequestDecisionUpdateData } from "./ChangeRequestDecisionUpdateData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request object to update a change request decision. + */ +export class ChangeRequestDecisionUpdateRequest { + /** + * Data object to update a change request decision. + */ + "data": ChangeRequestDecisionUpdateData; + /** + * Included resources for the change request update. + */ + "included"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "ChangeRequestDecisionUpdateData", + required: true, + }, + included: { + baseName: "included", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestDecisionUpdateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestDecisionsRelationship.ts b/packages/datadog-api-client-v2/models/ChangeRequestDecisionsRelationship.ts new file mode 100644 index 000000000000..2663d2b60931 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestDecisionsRelationship.ts @@ -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 2020-Present Datadog, Inc. + */ +import { ChangeRequestDecisionRelationshipData } from "./ChangeRequestDecisionRelationshipData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Relationship to change request decisions. + */ +export class ChangeRequestDecisionsRelationship { + /** + * Array of decision relationship data. + */ + "data": Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestDecisionsRelationship.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestIncludedDecision.ts b/packages/datadog-api-client-v2/models/ChangeRequestIncludedDecision.ts new file mode 100644 index 000000000000..bef392ecd05e --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestIncludedDecision.ts @@ -0,0 +1,82 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ChangeRequestDecisionRelationships } from "./ChangeRequestDecisionRelationships"; +import { ChangeRequestDecisionResourceType } from "./ChangeRequestDecisionResourceType"; +import { ChangeRequestDecisionResponseAttributes } from "./ChangeRequestDecisionResponseAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * An included change request decision resource. + */ +export class ChangeRequestIncludedDecision { + /** + * Attributes of a change request decision in a response. + */ + "attributes": ChangeRequestDecisionResponseAttributes; + /** + * The decision UUID. + */ + "id": string; + /** + * Relationships of a change request decision. + */ + "relationships"?: ChangeRequestDecisionRelationships; + /** + * Change request decision resource type. + */ + "type": ChangeRequestDecisionResourceType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "ChangeRequestDecisionResponseAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + relationships: { + baseName: "relationships", + type: "ChangeRequestDecisionRelationships", + }, + type: { + baseName: "type", + type: "ChangeRequestDecisionResourceType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestIncludedDecision.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestIncludedItem.ts b/packages/datadog-api-client-v2/models/ChangeRequestIncludedItem.ts new file mode 100644 index 000000000000..d54ff15c87c7 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestIncludedItem.ts @@ -0,0 +1,18 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ChangeRequestIncludedDecision } from "./ChangeRequestIncludedDecision"; +import { ChangeRequestIncludedUser } from "./ChangeRequestIncludedUser"; + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * An included resource item in the change request response. + */ + +export type ChangeRequestIncludedItem = + | ChangeRequestIncludedUser + | ChangeRequestIncludedDecision + | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/ChangeRequestIncludedUser.ts b/packages/datadog-api-client-v2/models/ChangeRequestIncludedUser.ts new file mode 100644 index 000000000000..24ae4eb54d50 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestIncludedUser.ts @@ -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 2020-Present Datadog, Inc. + */ +import { ChangeRequestIncludedUserAttributes } from "./ChangeRequestIncludedUserAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * An included user resource. + */ +export class ChangeRequestIncludedUser { + /** + * Attributes of an included user. + */ + "attributes": ChangeRequestIncludedUserAttributes; + /** + * The user UUID. + */ + "id": string; + /** + * The resource type. + */ + "type": string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "ChangeRequestIncludedUserAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestIncludedUser.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestIncludedUserAttributes.ts b/packages/datadog-api-client-v2/models/ChangeRequestIncludedUserAttributes.ts new file mode 100644 index 000000000000..64348f0777ec --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestIncludedUserAttributes.ts @@ -0,0 +1,71 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of an included user. + */ +export class ChangeRequestIncludedUserAttributes { + /** + * The email of the user. + */ + "email": string; + /** + * The handle of the user. + */ + "handle": string; + /** + * The name of the user. + */ + "name": string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + email: { + baseName: "email", + type: "string", + required: true, + }, + handle: { + baseName: "handle", + type: "string", + required: true, + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestIncludedUserAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestRelationships.ts b/packages/datadog-api-client-v2/models/ChangeRequestRelationships.ts new file mode 100644 index 000000000000..54cd15881a4d --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestRelationships.ts @@ -0,0 +1,73 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ChangeRequestDecisionsRelationship } from "./ChangeRequestDecisionsRelationship"; +import { ChangeRequestUserRelationship } from "./ChangeRequestUserRelationship"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Relationships of a change request. + */ +export class ChangeRequestRelationships { + /** + * Relationship to change request decisions. + */ + "changeRequestDecisions": ChangeRequestDecisionsRelationship; + /** + * Relationship to a user. + */ + "createdBy": ChangeRequestUserRelationship; + /** + * Relationship to a user. + */ + "modifiedBy": ChangeRequestUserRelationship; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + changeRequestDecisions: { + baseName: "change_request_decisions", + type: "ChangeRequestDecisionsRelationship", + required: true, + }, + createdBy: { + baseName: "created_by", + type: "ChangeRequestUserRelationship", + required: true, + }, + modifiedBy: { + baseName: "modified_by", + type: "ChangeRequestUserRelationship", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestResourceType.ts b/packages/datadog-api-client-v2/models/ChangeRequestResourceType.ts new file mode 100644 index 000000000000..377781ccb4e5 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestResourceType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Change request resource type. + */ + +export type ChangeRequestResourceType = typeof CHANGE_REQUEST | UnparsedObject; +export const CHANGE_REQUEST = "change_request"; diff --git a/packages/datadog-api-client-v2/models/ChangeRequestResponse.ts b/packages/datadog-api-client-v2/models/ChangeRequestResponse.ts new file mode 100644 index 000000000000..25a398aece2a --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestResponse.ts @@ -0,0 +1,63 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ChangeRequestIncludedItem } from "./ChangeRequestIncludedItem"; +import { ChangeRequestResponseData } from "./ChangeRequestResponseData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response object for a change request. + */ +export class ChangeRequestResponse { + /** + * Data object for a change request response. + */ + "data": ChangeRequestResponseData; + /** + * Included resources related to the change request. + */ + "included"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "ChangeRequestResponseData", + required: true, + }, + included: { + baseName: "included", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestResponseAttributes.ts b/packages/datadog-api-client-v2/models/ChangeRequestResponseAttributes.ts new file mode 100644 index 000000000000..32886e08d298 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestResponseAttributes.ts @@ -0,0 +1,238 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ChangeRequestChangeType } from "./ChangeRequestChangeType"; +import { ChangeRequestRiskLevel } from "./ChangeRequestRiskLevel"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of a change request response. + */ +export class ChangeRequestResponseAttributes { + /** + * Timestamp of when the change request was archived. + */ + "archivedAt"?: Date; + /** + * Custom attributes of the change request as key-value pairs. + */ + "attributes": { [key: string]: Array }; + /** + * The UUID of the linked incident. + */ + "changeRequestLinkedIncidentUuid": string; + /** + * The maintenance window query for the change request. + */ + "changeRequestMaintenanceWindowQuery": string; + /** + * The plan associated with the change request. + */ + "changeRequestPlan": string; + /** + * The risk level of the change request. + */ + "changeRequestRisk": ChangeRequestRiskLevel; + /** + * The type of the change request. + */ + "changeRequestType": ChangeRequestChangeType; + /** + * Timestamp of when the change request was closed. + */ + "closedAt"?: Date; + /** + * Timestamp of when the change request was created. + */ + "createdAt": Date; + /** + * The source from which the change request was created. + */ + "creationSource": string; + /** + * The description of the change request. + */ + "description": string; + /** + * The planned end date of the change request. + */ + "endDate"?: Date; + /** + * The human-readable key of the change request. + */ + "key": string; + /** + * Timestamp of when the change request was last modified. + */ + "modifiedAt": Date; + /** + * The notebook ID associated with the change request plan. + */ + "planNotebookId": number; + /** + * The priority of the change request. + */ + "priority": string; + /** + * The project UUID associated with the change request. + */ + "projectId": string; + /** + * The planned start date of the change request. + */ + "startDate"?: Date; + /** + * The current status of the change request. + */ + "status": string; + /** + * The title of the change request. + */ + "title": string; + /** + * The case type. + */ + "type": string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + archivedAt: { + baseName: "archived_at", + type: "Date", + format: "date-time", + }, + attributes: { + baseName: "attributes", + type: "{ [key: string]: Array; }", + required: true, + }, + changeRequestLinkedIncidentUuid: { + baseName: "change_request_linked_incident_uuid", + type: "string", + required: true, + }, + changeRequestMaintenanceWindowQuery: { + baseName: "change_request_maintenance_window_query", + type: "string", + required: true, + }, + changeRequestPlan: { + baseName: "change_request_plan", + type: "string", + required: true, + }, + changeRequestRisk: { + baseName: "change_request_risk", + type: "ChangeRequestRiskLevel", + required: true, + }, + changeRequestType: { + baseName: "change_request_type", + type: "ChangeRequestChangeType", + required: true, + }, + closedAt: { + baseName: "closed_at", + type: "Date", + format: "date-time", + }, + createdAt: { + baseName: "created_at", + type: "Date", + required: true, + format: "date-time", + }, + creationSource: { + baseName: "creation_source", + type: "string", + required: true, + }, + description: { + baseName: "description", + type: "string", + required: true, + }, + endDate: { + baseName: "end_date", + type: "Date", + format: "date-time", + }, + key: { + baseName: "key", + type: "string", + required: true, + }, + modifiedAt: { + baseName: "modified_at", + type: "Date", + required: true, + format: "date-time", + }, + planNotebookId: { + baseName: "plan_notebook_id", + type: "number", + required: true, + format: "int64", + }, + priority: { + baseName: "priority", + type: "string", + required: true, + }, + projectId: { + baseName: "project_id", + type: "string", + required: true, + }, + startDate: { + baseName: "start_date", + type: "Date", + format: "date-time", + }, + status: { + baseName: "status", + type: "string", + required: true, + }, + title: { + baseName: "title", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestResponseAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestResponseData.ts b/packages/datadog-api-client-v2/models/ChangeRequestResponseData.ts new file mode 100644 index 000000000000..6a56abe229a4 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestResponseData.ts @@ -0,0 +1,82 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ChangeRequestRelationships } from "./ChangeRequestRelationships"; +import { ChangeRequestResourceType } from "./ChangeRequestResourceType"; +import { ChangeRequestResponseAttributes } from "./ChangeRequestResponseAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data object for a change request response. + */ +export class ChangeRequestResponseData { + /** + * Attributes of a change request response. + */ + "attributes": ChangeRequestResponseAttributes; + /** + * The identifier of the change request. + */ + "id": string; + /** + * Relationships of a change request. + */ + "relationships"?: ChangeRequestRelationships; + /** + * Change request resource type. + */ + "type": ChangeRequestResourceType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "ChangeRequestResponseAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + relationships: { + baseName: "relationships", + type: "ChangeRequestRelationships", + }, + type: { + baseName: "type", + type: "ChangeRequestResourceType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestRiskLevel.ts b/packages/datadog-api-client-v2/models/ChangeRequestRiskLevel.ts new file mode 100644 index 000000000000..37bfc8a9d237 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestRiskLevel.ts @@ -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 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The risk level of the change request. + */ + +export type ChangeRequestRiskLevel = + | typeof UNDEFINED + | typeof LOW + | typeof MEDIUM + | typeof HIGH + | UnparsedObject; +export const UNDEFINED = "UNDEFINED"; +export const LOW = "LOW"; +export const MEDIUM = "MEDIUM"; +export const HIGH = "HIGH"; diff --git a/packages/datadog-api-client-v2/models/ChangeRequestUpdateAttributes.ts b/packages/datadog-api-client-v2/models/ChangeRequestUpdateAttributes.ts new file mode 100644 index 000000000000..09d7ca921346 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestUpdateAttributes.ts @@ -0,0 +1,96 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ChangeRequestChangeType } from "./ChangeRequestChangeType"; +import { ChangeRequestRiskLevel } from "./ChangeRequestRiskLevel"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes for updating a change request. + */ +export class ChangeRequestUpdateAttributes { + /** + * The plan associated with the change request. + */ + "changeRequestPlan"?: string; + /** + * The risk level of the change request. + */ + "changeRequestRisk"?: ChangeRequestRiskLevel; + /** + * The type of the change request. + */ + "changeRequestType"?: ChangeRequestChangeType; + /** + * The planned end date of the change request. + */ + "endDate"?: Date; + /** + * The identifier of the change request to update. + */ + "id"?: string; + /** + * The planned start date of the change request. + */ + "startDate"?: Date; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + changeRequestPlan: { + baseName: "change_request_plan", + type: "string", + }, + changeRequestRisk: { + baseName: "change_request_risk", + type: "ChangeRequestRiskLevel", + }, + changeRequestType: { + baseName: "change_request_type", + type: "ChangeRequestChangeType", + }, + endDate: { + baseName: "end_date", + type: "Date", + format: "date-time", + }, + id: { + baseName: "id", + type: "string", + }, + startDate: { + baseName: "start_date", + type: "Date", + format: "date-time", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestUpdateAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestUpdateData.ts b/packages/datadog-api-client-v2/models/ChangeRequestUpdateData.ts new file mode 100644 index 000000000000..ba74de5b0979 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestUpdateData.ts @@ -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 2020-Present Datadog, Inc. + */ +import { ChangeRequestResourceType } from "./ChangeRequestResourceType"; +import { ChangeRequestUpdateAttributes } from "./ChangeRequestUpdateAttributes"; +import { ChangeRequestUpdateRelationships } from "./ChangeRequestUpdateRelationships"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data object to update a change request. + */ +export class ChangeRequestUpdateData { + /** + * Attributes for updating a change request. + */ + "attributes"?: ChangeRequestUpdateAttributes; + /** + * Relationships for updating a change request. + */ + "relationships"?: ChangeRequestUpdateRelationships; + /** + * Change request resource type. + */ + "type": ChangeRequestResourceType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "ChangeRequestUpdateAttributes", + }, + relationships: { + baseName: "relationships", + type: "ChangeRequestUpdateRelationships", + }, + type: { + baseName: "type", + type: "ChangeRequestResourceType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestUpdateData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestUpdateRelationships.ts b/packages/datadog-api-client-v2/models/ChangeRequestUpdateRelationships.ts new file mode 100644 index 000000000000..caac0eab1d63 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestUpdateRelationships.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ChangeRequestDecisionsRelationship } from "./ChangeRequestDecisionsRelationship"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Relationships for updating a change request. + */ +export class ChangeRequestUpdateRelationships { + /** + * Relationship to change request decisions. + */ + "changeRequestDecisions"?: ChangeRequestDecisionsRelationship; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + changeRequestDecisions: { + baseName: "change_request_decisions", + type: "ChangeRequestDecisionsRelationship", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestUpdateRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestUpdateRequest.ts b/packages/datadog-api-client-v2/models/ChangeRequestUpdateRequest.ts new file mode 100644 index 000000000000..5165a115dbca --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestUpdateRequest.ts @@ -0,0 +1,63 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ChangeRequestDecisionCreateItem } from "./ChangeRequestDecisionCreateItem"; +import { ChangeRequestUpdateData } from "./ChangeRequestUpdateData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request object to update a change request. + */ +export class ChangeRequestUpdateRequest { + /** + * Data object to update a change request. + */ + "data": ChangeRequestUpdateData; + /** + * Included resources for the change request update. + */ + "included"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "ChangeRequestUpdateData", + required: true, + }, + included: { + baseName: "included", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestUpdateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestUserRelationship.ts b/packages/datadog-api-client-v2/models/ChangeRequestUserRelationship.ts new file mode 100644 index 000000000000..6fdbc95cccad --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestUserRelationship.ts @@ -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 2020-Present Datadog, Inc. + */ +import { ChangeRequestUserRelationshipData } from "./ChangeRequestUserRelationshipData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Relationship to a user. + */ +export class ChangeRequestUserRelationship { + /** + * User relationship data. + */ + "data": ChangeRequestUserRelationshipData | null; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "ChangeRequestUserRelationshipData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestUserRelationship.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeRequestUserRelationshipData.ts b/packages/datadog-api-client-v2/models/ChangeRequestUserRelationshipData.ts new file mode 100644 index 000000000000..310b8d797c23 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeRequestUserRelationshipData.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * User relationship data. + */ +export class ChangeRequestUserRelationshipData { + /** + * The user UUID. + */ + "id": string; + /** + * The user resource type. + */ + "type": string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeRequestUserRelationshipData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 4fe7db3842a5..8b579af1c04a 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -436,6 +436,36 @@ import { ChangeEventCustomAttributesAuthor } from "./ChangeEventCustomAttributes import { ChangeEventCustomAttributesChangedResource } from "./ChangeEventCustomAttributesChangedResource"; import { ChangeEventCustomAttributesImpactedResourcesItems } from "./ChangeEventCustomAttributesImpactedResourcesItems"; import { ChangeEventTriggerWrapper } from "./ChangeEventTriggerWrapper"; +import { ChangeRequestBranchCreateAttributes } from "./ChangeRequestBranchCreateAttributes"; +import { ChangeRequestBranchCreateData } from "./ChangeRequestBranchCreateData"; +import { ChangeRequestBranchCreateRequest } from "./ChangeRequestBranchCreateRequest"; +import { ChangeRequestCreateAttributes } from "./ChangeRequestCreateAttributes"; +import { ChangeRequestCreateData } from "./ChangeRequestCreateData"; +import { ChangeRequestCreateRequest } from "./ChangeRequestCreateRequest"; +import { ChangeRequestDecisionCreateAttributes } from "./ChangeRequestDecisionCreateAttributes"; +import { ChangeRequestDecisionCreateItem } from "./ChangeRequestDecisionCreateItem"; +import { ChangeRequestDecisionCreateRelationships } from "./ChangeRequestDecisionCreateRelationships"; +import { ChangeRequestDecisionRelationshipData } from "./ChangeRequestDecisionRelationshipData"; +import { ChangeRequestDecisionRelationships } from "./ChangeRequestDecisionRelationships"; +import { ChangeRequestDecisionResponseAttributes } from "./ChangeRequestDecisionResponseAttributes"; +import { ChangeRequestDecisionUpdateData } from "./ChangeRequestDecisionUpdateData"; +import { ChangeRequestDecisionUpdateDataAttributes } from "./ChangeRequestDecisionUpdateDataAttributes"; +import { ChangeRequestDecisionUpdateDataRelationships } from "./ChangeRequestDecisionUpdateDataRelationships"; +import { ChangeRequestDecisionUpdateRequest } from "./ChangeRequestDecisionUpdateRequest"; +import { ChangeRequestDecisionsRelationship } from "./ChangeRequestDecisionsRelationship"; +import { ChangeRequestIncludedDecision } from "./ChangeRequestIncludedDecision"; +import { ChangeRequestIncludedUser } from "./ChangeRequestIncludedUser"; +import { ChangeRequestIncludedUserAttributes } from "./ChangeRequestIncludedUserAttributes"; +import { ChangeRequestRelationships } from "./ChangeRequestRelationships"; +import { ChangeRequestResponse } from "./ChangeRequestResponse"; +import { ChangeRequestResponseAttributes } from "./ChangeRequestResponseAttributes"; +import { ChangeRequestResponseData } from "./ChangeRequestResponseData"; +import { ChangeRequestUpdateAttributes } from "./ChangeRequestUpdateAttributes"; +import { ChangeRequestUpdateData } from "./ChangeRequestUpdateData"; +import { ChangeRequestUpdateRelationships } from "./ChangeRequestUpdateRelationships"; +import { ChangeRequestUpdateRequest } from "./ChangeRequestUpdateRequest"; +import { ChangeRequestUserRelationship } from "./ChangeRequestUserRelationship"; +import { ChangeRequestUserRelationshipData } from "./ChangeRequestUserRelationshipData"; import { ChargebackBreakdown } from "./ChargebackBreakdown"; import { CircleCIAPIKey } from "./CircleCIAPIKey"; import { CircleCIAPIKeyUpdate } from "./CircleCIAPIKeyUpdate"; @@ -3551,6 +3581,12 @@ const enumsMap: { [key: string]: any[] } = { "configuration", ], ChangeEventCustomAttributesImpactedResourcesItemsType: ["service"], + ChangeRequestBranchResourceType: ["change_request_branch"], + ChangeRequestChangeType: ["NORMAL", "STANDARD", "EMERGENCY"], + ChangeRequestDecisionResourceType: ["change_request_decision"], + ChangeRequestDecisionStatusType: ["REQUESTED", "APPROVED", "DECLINED"], + ChangeRequestResourceType: ["change_request"], + ChangeRequestRiskLevel: ["UNDEFINED", "LOW", "MEDIUM", "HIGH"], CircleCIAPIKeyType: ["CircleCIAPIKey"], CircleCIIntegrationType: ["CircleCI"], ClickupAPIKeyType: ["ClickupAPIKey"], @@ -5736,6 +5772,40 @@ const typeMap: { [index: string]: any } = { ChangeEventCustomAttributesImpactedResourcesItems: ChangeEventCustomAttributesImpactedResourcesItems, ChangeEventTriggerWrapper: ChangeEventTriggerWrapper, + ChangeRequestBranchCreateAttributes: ChangeRequestBranchCreateAttributes, + ChangeRequestBranchCreateData: ChangeRequestBranchCreateData, + ChangeRequestBranchCreateRequest: ChangeRequestBranchCreateRequest, + ChangeRequestCreateAttributes: ChangeRequestCreateAttributes, + ChangeRequestCreateData: ChangeRequestCreateData, + ChangeRequestCreateRequest: ChangeRequestCreateRequest, + ChangeRequestDecisionCreateAttributes: ChangeRequestDecisionCreateAttributes, + ChangeRequestDecisionCreateItem: ChangeRequestDecisionCreateItem, + ChangeRequestDecisionCreateRelationships: + ChangeRequestDecisionCreateRelationships, + ChangeRequestDecisionRelationshipData: ChangeRequestDecisionRelationshipData, + ChangeRequestDecisionRelationships: ChangeRequestDecisionRelationships, + ChangeRequestDecisionResponseAttributes: + ChangeRequestDecisionResponseAttributes, + ChangeRequestDecisionUpdateData: ChangeRequestDecisionUpdateData, + ChangeRequestDecisionUpdateDataAttributes: + ChangeRequestDecisionUpdateDataAttributes, + ChangeRequestDecisionUpdateDataRelationships: + ChangeRequestDecisionUpdateDataRelationships, + ChangeRequestDecisionUpdateRequest: ChangeRequestDecisionUpdateRequest, + ChangeRequestDecisionsRelationship: ChangeRequestDecisionsRelationship, + ChangeRequestIncludedDecision: ChangeRequestIncludedDecision, + ChangeRequestIncludedUser: ChangeRequestIncludedUser, + ChangeRequestIncludedUserAttributes: ChangeRequestIncludedUserAttributes, + ChangeRequestRelationships: ChangeRequestRelationships, + ChangeRequestResponse: ChangeRequestResponse, + ChangeRequestResponseAttributes: ChangeRequestResponseAttributes, + ChangeRequestResponseData: ChangeRequestResponseData, + ChangeRequestUpdateAttributes: ChangeRequestUpdateAttributes, + ChangeRequestUpdateData: ChangeRequestUpdateData, + ChangeRequestUpdateRelationships: ChangeRequestUpdateRelationships, + ChangeRequestUpdateRequest: ChangeRequestUpdateRequest, + ChangeRequestUserRelationship: ChangeRequestUserRelationship, + ChangeRequestUserRelationshipData: ChangeRequestUserRelationshipData, ChargebackBreakdown: ChargebackBreakdown, CircleCIAPIKey: CircleCIAPIKey, CircleCIAPIKeyUpdate: CircleCIAPIKeyUpdate, @@ -9256,6 +9326,10 @@ const oneOfMap: { [index: string]: string[] } = { "CIAppPipelineEventFinishedPipeline", "CIAppPipelineEventInProgressPipeline", ], + ChangeRequestIncludedItem: [ + "ChangeRequestIncludedUser", + "ChangeRequestIncludedDecision", + ], CircleCICredentials: ["CircleCIAPIKey"], CircleCICredentialsUpdate: ["CircleCIAPIKeyUpdate"], ClickupCredentials: ["ClickupAPIKey"],