From 08bd48bf03a4f79e9694c171eaa8d894795ea609 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 19 Feb 2026 15:29:48 +0000 Subject: [PATCH] Regenerate client from commit 3b03aa8 of spec repo --- .generator/schemas/v2/openapi.yaml | 901 +++++++++++++ .../CreateChangeRequest.java | 53 + .../CreateChangeRequestBranch.java | 39 + .../DeleteChangeRequestDecision.java | 26 + .../change-management/GetChangeRequest.java | 25 + .../UpdateChangeRequest.java | 85 ++ .../UpdateChangeRequestDecision.java | 76 ++ .../com/datadog/api/client/ApiClient.java | 6 + .../client/v2/api/ChangeManagementApi.java | 1116 +++++++++++++++++ .../ChangeRequestBranchCreateAttributes.java | 175 +++ .../model/ChangeRequestBranchCreateData.java | 183 +++ .../ChangeRequestBranchCreateRequest.java | 148 +++ .../ChangeRequestBranchResourceType.java | 58 + .../v2/model/ChangeRequestChangeType.java | 58 + .../model/ChangeRequestCreateAttributes.java | 460 +++++++ .../v2/model/ChangeRequestCreateData.java | 181 +++ .../v2/model/ChangeRequestCreateRequest.java | 146 +++ ...ChangeRequestDecisionCreateAttributes.java | 174 +++ .../ChangeRequestDecisionCreateItem.java | 239 ++++ ...ngeRequestDecisionCreateRelationships.java | 141 +++ ...ChangeRequestDecisionRelationshipData.java | 181 +++ .../ChangeRequestDecisionRelationships.java | 214 ++++ .../ChangeRequestDecisionResourceType.java | 58 + ...angeRequestDecisionResponseAttributes.java | 308 +++++ .../ChangeRequestDecisionStatusType.java | 62 + .../ChangeRequestDecisionUpdateData.java | 210 ++++ ...geRequestDecisionUpdateDataAttributes.java | 138 ++ ...equestDecisionUpdateDataRelationships.java | 157 +++ .../ChangeRequestDecisionUpdateRequest.java | 193 +++ .../ChangeRequestDecisionsRelationship.java | 158 +++ .../model/ChangeRequestIncludedDecision.java | 241 ++++ .../v2/model/ChangeRequestIncludedItem.java | 283 +++++ .../v2/model/ChangeRequestIncludedUser.java | 205 +++ .../ChangeRequestIncludedUserAttributes.java | 203 +++ .../v2/model/ChangeRequestRelationships.java | 215 ++++ .../v2/model/ChangeRequestResourceType.java | 57 + .../v2/model/ChangeRequestResponse.java | 188 +++ .../ChangeRequestResponseAttributes.java | 756 +++++++++++ .../v2/model/ChangeRequestResponseData.java | 238 ++++ .../v2/model/ChangeRequestRiskLevel.java | 59 + .../model/ChangeRequestUpdateAttributes.java | 290 +++++ .../v2/model/ChangeRequestUpdateData.java | 206 +++ .../ChangeRequestUpdateRelationships.java | 142 +++ .../v2/model/ChangeRequestUpdateRequest.java | 189 +++ .../model/ChangeRequestUserRelationship.java | 152 +++ .../ChangeRequestUserRelationshipData.java | 175 +++ .../client/v2/api/change_management.feature | 162 +++ .../com/datadog/api/client/v2/api/undo.json | 40 + 48 files changed, 9770 insertions(+) create mode 100644 examples/v2/change-management/CreateChangeRequest.java create mode 100644 examples/v2/change-management/CreateChangeRequestBranch.java create mode 100644 examples/v2/change-management/DeleteChangeRequestDecision.java create mode 100644 examples/v2/change-management/GetChangeRequest.java create mode 100644 examples/v2/change-management/UpdateChangeRequest.java create mode 100644 examples/v2/change-management/UpdateChangeRequestDecision.java create mode 100644 src/main/java/com/datadog/api/client/v2/api/ChangeManagementApi.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestBranchCreateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestBranchCreateData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestBranchCreateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestBranchResourceType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestChangeType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestCreateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestCreateData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestCreateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionCreateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionCreateItem.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionCreateRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionRelationshipData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionResourceType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionResponseAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionStatusType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionUpdateData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionUpdateDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionUpdateDataRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionUpdateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionsRelationship.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestIncludedDecision.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestIncludedItem.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestIncludedUser.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestIncludedUserAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestResourceType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestResponseAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestResponseData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestRiskLevel.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestUpdateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestUpdateData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestUpdateRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestUpdateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestUserRelationship.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ChangeRequestUserRelationshipData.java create mode 100644 src/test/resources/com/datadog/api/client/v2/api/change_management.feature diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a484bec1a76..22aa66aee70 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.java b/examples/v2/change-management/CreateChangeRequest.java new file mode 100644 index 00000000000..31590e9e876 --- /dev/null +++ b/examples/v2/change-management/CreateChangeRequest.java @@ -0,0 +1,53 @@ +// Create a change request returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ChangeManagementApi; +import com.datadog.api.client.v2.model.ChangeRequestChangeType; +import com.datadog.api.client.v2.model.ChangeRequestCreateAttributes; +import com.datadog.api.client.v2.model.ChangeRequestCreateData; +import com.datadog.api.client.v2.model.ChangeRequestCreateRequest; +import com.datadog.api.client.v2.model.ChangeRequestResourceType; +import com.datadog.api.client.v2.model.ChangeRequestResponse; +import com.datadog.api.client.v2.model.ChangeRequestRiskLevel; +import java.time.OffsetDateTime; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createChangeRequest", true); + ChangeManagementApi apiInstance = new ChangeManagementApi(defaultClient); + + ChangeRequestCreateRequest body = + new ChangeRequestCreateRequest() + .data( + new ChangeRequestCreateData() + .attributes( + new ChangeRequestCreateAttributes() + .changeRequestLinkedIncidentUuid("00000000-0000-0000-0000-000000000000") + .changeRequestMaintenanceWindowQuery("") + .changeRequestPlan( + "1. Deploy to staging 2. Run tests 3. Deploy to production") + .changeRequestRisk(ChangeRequestRiskLevel.LOW) + .changeRequestType(ChangeRequestChangeType.NORMAL) + .description("Deploying new payment service v2.1") + .endDate(OffsetDateTime.parse("2024-01-02T15:00:00Z")) + .projectId("d4bbe1af-f36e-42f1-87c1-493ca35c320e") + .requestedTeams(Collections.singletonList("team-handle-1")) + .startDate(OffsetDateTime.parse("2024-01-01T03:00:00Z")) + .title("Deploy new payment service")) + .type(ChangeRequestResourceType.CHANGE_REQUEST)); + + try { + ChangeRequestResponse result = apiInstance.createChangeRequest(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ChangeManagementApi#createChangeRequest"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/change-management/CreateChangeRequestBranch.java b/examples/v2/change-management/CreateChangeRequestBranch.java new file mode 100644 index 00000000000..19361f4c664 --- /dev/null +++ b/examples/v2/change-management/CreateChangeRequestBranch.java @@ -0,0 +1,39 @@ +// Create a change request branch returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ChangeManagementApi; +import com.datadog.api.client.v2.model.ChangeRequestBranchCreateAttributes; +import com.datadog.api.client.v2.model.ChangeRequestBranchCreateData; +import com.datadog.api.client.v2.model.ChangeRequestBranchCreateRequest; +import com.datadog.api.client.v2.model.ChangeRequestBranchResourceType; +import com.datadog.api.client.v2.model.ChangeRequestResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createChangeRequestBranch", true); + ChangeManagementApi apiInstance = new ChangeManagementApi(defaultClient); + + ChangeRequestBranchCreateRequest body = + new ChangeRequestBranchCreateRequest() + .data( + new ChangeRequestBranchCreateData() + .attributes( + new ChangeRequestBranchCreateAttributes() + .branchName("chm/CHM-1234") + .repoId("DataDog/dd-source")) + .type(ChangeRequestBranchResourceType.CHANGE_REQUEST_BRANCH)); + + try { + ChangeRequestResponse result = apiInstance.createChangeRequestBranch("CHM-1234", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ChangeManagementApi#createChangeRequestBranch"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/change-management/DeleteChangeRequestDecision.java b/examples/v2/change-management/DeleteChangeRequestDecision.java new file mode 100644 index 00000000000..3ede5575435 --- /dev/null +++ b/examples/v2/change-management/DeleteChangeRequestDecision.java @@ -0,0 +1,26 @@ +// Delete a change request decision returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ChangeManagementApi; +import com.datadog.api.client.v2.model.ChangeRequestResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.deleteChangeRequestDecision", true); + ChangeManagementApi apiInstance = new ChangeManagementApi(defaultClient); + + try { + ChangeRequestResponse result = + apiInstance.deleteChangeRequestDecision("CHM-1234", "decision-id-0"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ChangeManagementApi#deleteChangeRequestDecision"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/change-management/GetChangeRequest.java b/examples/v2/change-management/GetChangeRequest.java new file mode 100644 index 00000000000..510f5f15dfb --- /dev/null +++ b/examples/v2/change-management/GetChangeRequest.java @@ -0,0 +1,25 @@ +// Get a change request returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ChangeManagementApi; +import com.datadog.api.client.v2.model.ChangeRequestResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getChangeRequest", true); + ChangeManagementApi apiInstance = new ChangeManagementApi(defaultClient); + + try { + ChangeRequestResponse result = apiInstance.getChangeRequest("CHM-1234"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ChangeManagementApi#getChangeRequest"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/change-management/UpdateChangeRequest.java b/examples/v2/change-management/UpdateChangeRequest.java new file mode 100644 index 00000000000..655c13517f2 --- /dev/null +++ b/examples/v2/change-management/UpdateChangeRequest.java @@ -0,0 +1,85 @@ +// Update a change request returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ChangeManagementApi; +import com.datadog.api.client.v2.model.ChangeRequestChangeType; +import com.datadog.api.client.v2.model.ChangeRequestDecisionCreateAttributes; +import com.datadog.api.client.v2.model.ChangeRequestDecisionCreateItem; +import com.datadog.api.client.v2.model.ChangeRequestDecisionCreateRelationships; +import com.datadog.api.client.v2.model.ChangeRequestDecisionRelationshipData; +import com.datadog.api.client.v2.model.ChangeRequestDecisionResourceType; +import com.datadog.api.client.v2.model.ChangeRequestDecisionStatusType; +import com.datadog.api.client.v2.model.ChangeRequestDecisionsRelationship; +import com.datadog.api.client.v2.model.ChangeRequestResourceType; +import com.datadog.api.client.v2.model.ChangeRequestResponse; +import com.datadog.api.client.v2.model.ChangeRequestRiskLevel; +import com.datadog.api.client.v2.model.ChangeRequestUpdateAttributes; +import com.datadog.api.client.v2.model.ChangeRequestUpdateData; +import com.datadog.api.client.v2.model.ChangeRequestUpdateRelationships; +import com.datadog.api.client.v2.model.ChangeRequestUpdateRequest; +import com.datadog.api.client.v2.model.ChangeRequestUserRelationship; +import com.datadog.api.client.v2.model.ChangeRequestUserRelationshipData; +import java.time.OffsetDateTime; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateChangeRequest", true); + ChangeManagementApi apiInstance = new ChangeManagementApi(defaultClient); + + ChangeRequestUpdateRequest body = + new ChangeRequestUpdateRequest() + .data( + new ChangeRequestUpdateData() + .attributes( + new ChangeRequestUpdateAttributes() + .changeRequestPlan("Updated deployment plan") + .changeRequestRisk(ChangeRequestRiskLevel.LOW) + .changeRequestType(ChangeRequestChangeType.NORMAL) + .endDate(OffsetDateTime.parse("2024-01-02T15:00:00Z")) + .id("CHM-1234") + .startDate(OffsetDateTime.parse("2024-01-01T03:00:00Z"))) + .relationships( + new ChangeRequestUpdateRelationships() + .changeRequestDecisions( + new ChangeRequestDecisionsRelationship() + .data( + Collections.singletonList( + new ChangeRequestDecisionRelationshipData() + .id("decision-id-0") + .type( + ChangeRequestDecisionResourceType + .CHANGE_REQUEST_DECISION))))) + .type(ChangeRequestResourceType.CHANGE_REQUEST)) + .included( + Collections.singletonList( + new ChangeRequestDecisionCreateItem() + .attributes( + new ChangeRequestDecisionCreateAttributes() + .changeRequestStatus(ChangeRequestDecisionStatusType.REQUESTED) + .requestReason("Please review and approve this change")) + .id("decision-id-0") + .relationships( + new ChangeRequestDecisionCreateRelationships() + .requestedUser( + new ChangeRequestUserRelationship() + .data( + new ChangeRequestUserRelationshipData() + .id("00000000-0000-0000-0000-000000000000") + .type("user")))) + .type(ChangeRequestDecisionResourceType.CHANGE_REQUEST_DECISION))); + + try { + ChangeRequestResponse result = apiInstance.updateChangeRequest("CHM-1234", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ChangeManagementApi#updateChangeRequest"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/change-management/UpdateChangeRequestDecision.java b/examples/v2/change-management/UpdateChangeRequestDecision.java new file mode 100644 index 00000000000..02985e42dfa --- /dev/null +++ b/examples/v2/change-management/UpdateChangeRequestDecision.java @@ -0,0 +1,76 @@ +// Update a change request decision returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ChangeManagementApi; +import com.datadog.api.client.v2.model.ChangeRequestDecisionCreateAttributes; +import com.datadog.api.client.v2.model.ChangeRequestDecisionCreateItem; +import com.datadog.api.client.v2.model.ChangeRequestDecisionCreateRelationships; +import com.datadog.api.client.v2.model.ChangeRequestDecisionRelationshipData; +import com.datadog.api.client.v2.model.ChangeRequestDecisionResourceType; +import com.datadog.api.client.v2.model.ChangeRequestDecisionStatusType; +import com.datadog.api.client.v2.model.ChangeRequestDecisionUpdateData; +import com.datadog.api.client.v2.model.ChangeRequestDecisionUpdateDataAttributes; +import com.datadog.api.client.v2.model.ChangeRequestDecisionUpdateDataRelationships; +import com.datadog.api.client.v2.model.ChangeRequestDecisionUpdateRequest; +import com.datadog.api.client.v2.model.ChangeRequestDecisionsRelationship; +import com.datadog.api.client.v2.model.ChangeRequestResourceType; +import com.datadog.api.client.v2.model.ChangeRequestResponse; +import com.datadog.api.client.v2.model.ChangeRequestUserRelationship; +import com.datadog.api.client.v2.model.ChangeRequestUserRelationshipData; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateChangeRequestDecision", true); + ChangeManagementApi apiInstance = new ChangeManagementApi(defaultClient); + + ChangeRequestDecisionUpdateRequest body = + new ChangeRequestDecisionUpdateRequest() + .data( + new ChangeRequestDecisionUpdateData() + .attributes(new ChangeRequestDecisionUpdateDataAttributes().id("CHM-1234")) + .relationships( + new ChangeRequestDecisionUpdateDataRelationships() + .changeRequestDecisions( + new ChangeRequestDecisionsRelationship() + .data( + Collections.singletonList( + new ChangeRequestDecisionRelationshipData() + .id("decision-id-0") + .type( + ChangeRequestDecisionResourceType + .CHANGE_REQUEST_DECISION))))) + .type(ChangeRequestResourceType.CHANGE_REQUEST)) + .included( + Collections.singletonList( + new ChangeRequestDecisionCreateItem() + .attributes( + new ChangeRequestDecisionCreateAttributes() + .changeRequestStatus(ChangeRequestDecisionStatusType.REQUESTED) + .requestReason("Please review and approve this change")) + .id("decision-id-0") + .relationships( + new ChangeRequestDecisionCreateRelationships() + .requestedUser( + new ChangeRequestUserRelationship() + .data( + new ChangeRequestUserRelationshipData() + .id("00000000-0000-0000-0000-000000000000") + .type("user")))) + .type(ChangeRequestDecisionResourceType.CHANGE_REQUEST_DECISION))); + + try { + ChangeRequestResponse result = + apiInstance.updateChangeRequestDecision("CHM-1234", "decision-id-0", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ChangeManagementApi#updateChangeRequestDecision"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 7606b2b54f0..762908f9bb5 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -782,6 +782,12 @@ public class ApiClient { put("v2.linkJiraIssueToCase", false); put("v2.moveCaseToProject", false); put("v2.unlinkJiraIssue", false); + put("v2.createChangeRequest", false); + put("v2.createChangeRequestBranch", false); + put("v2.deleteChangeRequestDecision", false); + put("v2.getChangeRequest", false); + put("v2.updateChangeRequest", false); + put("v2.updateChangeRequestDecision", false); put("v2.listAWSCloudAuthPersonaMappings", false); put("v2.activateContentPack", false); put("v2.cancelThreatHuntingJob", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/ChangeManagementApi.java b/src/main/java/com/datadog/api/client/v2/api/ChangeManagementApi.java new file mode 100644 index 00000000000..f4554f41c09 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/ChangeManagementApi.java @@ -0,0 +1,1116 @@ +package com.datadog.api.client.v2.api; + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.ApiResponse; +import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.ChangeRequestBranchCreateRequest; +import com.datadog.api.client.v2.model.ChangeRequestCreateRequest; +import com.datadog.api.client.v2.model.ChangeRequestDecisionUpdateRequest; +import com.datadog.api.client.v2.model.ChangeRequestResponse; +import com.datadog.api.client.v2.model.ChangeRequestUpdateRequest; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.GenericType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeManagementApi { + private ApiClient apiClient; + + public ChangeManagementApi() { + this(ApiClient.getDefaultApiClient()); + } + + public ChangeManagementApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client. + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client. + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Create a change request. + * + *

See {@link #createChangeRequestWithHttpInfo}. + * + * @param body Change request payload. (required) + * @return ChangeRequestResponse + * @throws ApiException if fails to make API call + */ + public ChangeRequestResponse createChangeRequest(ChangeRequestCreateRequest body) + throws ApiException { + return createChangeRequestWithHttpInfo(body).getData(); + } + + /** + * Create a change request. + * + *

See {@link #createChangeRequestWithHttpInfoAsync}. + * + * @param body Change request payload. (required) + * @return CompletableFuture<ChangeRequestResponse> + */ + public CompletableFuture createChangeRequestAsync( + ChangeRequestCreateRequest body) { + return createChangeRequestWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a new change request. + * + * @param body Change request payload. (required) + * @return ApiResponse<ChangeRequestResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse createChangeRequestWithHttpInfo( + ChangeRequestCreateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "createChangeRequest"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createChangeRequest"); + } + // create path and map variables + String localVarPath = "/api/v2/change-management/change-request"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ChangeManagementApi.createChangeRequest", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create a change request. + * + *

See {@link #createChangeRequestWithHttpInfo}. + * + * @param body Change request payload. (required) + * @return CompletableFuture<ApiResponse<ChangeRequestResponse>> + */ + public CompletableFuture> createChangeRequestWithHttpInfoAsync( + ChangeRequestCreateRequest body) { + // Check if unstable operation is enabled + String operationId = "createChangeRequest"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createChangeRequest")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/change-management/change-request"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ChangeManagementApi.createChangeRequest", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create a change request branch. + * + *

See {@link #createChangeRequestBranchWithHttpInfo}. + * + * @param changeRequestId The identifier of the change request. (required) + * @param body Branch creation payload. (required) + * @return ChangeRequestResponse + * @throws ApiException if fails to make API call + */ + public ChangeRequestResponse createChangeRequestBranch( + String changeRequestId, ChangeRequestBranchCreateRequest body) throws ApiException { + return createChangeRequestBranchWithHttpInfo(changeRequestId, body).getData(); + } + + /** + * Create a change request branch. + * + *

See {@link #createChangeRequestBranchWithHttpInfoAsync}. + * + * @param changeRequestId The identifier of the change request. (required) + * @param body Branch creation payload. (required) + * @return CompletableFuture<ChangeRequestResponse> + */ + public CompletableFuture createChangeRequestBranchAsync( + String changeRequestId, ChangeRequestBranchCreateRequest body) { + return createChangeRequestBranchWithHttpInfoAsync(changeRequestId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a new branch in a repository for a change request. + * + * @param changeRequestId The identifier of the change request. (required) + * @param body Branch creation payload. (required) + * @return ApiResponse<ChangeRequestResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse createChangeRequestBranchWithHttpInfo( + String changeRequestId, ChangeRequestBranchCreateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "createChangeRequestBranch"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'changeRequestId' is set + if (changeRequestId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'changeRequestId' when calling" + + " createChangeRequestBranch"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createChangeRequestBranch"); + } + // create path and map variables + String localVarPath = + "/api/v2/change-management/change-request/{change_request_id}/branch" + .replaceAll( + "\\{" + "change_request_id" + "\\}", + apiClient.escapeString(changeRequestId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ChangeManagementApi.createChangeRequestBranch", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create a change request branch. + * + *

See {@link #createChangeRequestBranchWithHttpInfo}. + * + * @param changeRequestId The identifier of the change request. (required) + * @param body Branch creation payload. (required) + * @return CompletableFuture<ApiResponse<ChangeRequestResponse>> + */ + public CompletableFuture> + createChangeRequestBranchWithHttpInfoAsync( + String changeRequestId, ChangeRequestBranchCreateRequest body) { + // Check if unstable operation is enabled + String operationId = "createChangeRequestBranch"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'changeRequestId' is set + if (changeRequestId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'changeRequestId' when calling" + + " createChangeRequestBranch")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createChangeRequestBranch")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/change-management/change-request/{change_request_id}/branch" + .replaceAll( + "\\{" + "change_request_id" + "\\}", + apiClient.escapeString(changeRequestId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ChangeManagementApi.createChangeRequestBranch", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Delete a change request decision. + * + *

See {@link #deleteChangeRequestDecisionWithHttpInfo}. + * + * @param changeRequestId The identifier of the change request. (required) + * @param decisionId The identifier of the change request decision. (required) + * @return ChangeRequestResponse + * @throws ApiException if fails to make API call + */ + public ChangeRequestResponse deleteChangeRequestDecision( + String changeRequestId, String decisionId) throws ApiException { + return deleteChangeRequestDecisionWithHttpInfo(changeRequestId, decisionId).getData(); + } + + /** + * Delete a change request decision. + * + *

See {@link #deleteChangeRequestDecisionWithHttpInfoAsync}. + * + * @param changeRequestId The identifier of the change request. (required) + * @param decisionId The identifier of the change request decision. (required) + * @return CompletableFuture<ChangeRequestResponse> + */ + public CompletableFuture deleteChangeRequestDecisionAsync( + String changeRequestId, String decisionId) { + return deleteChangeRequestDecisionWithHttpInfoAsync(changeRequestId, decisionId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete a decision from a change request. + * + * @param changeRequestId The identifier of the change request. (required) + * @param decisionId The identifier of the change request decision. (required) + * @return ApiResponse<ChangeRequestResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteChangeRequestDecisionWithHttpInfo( + String changeRequestId, String decisionId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteChangeRequestDecision"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'changeRequestId' is set + if (changeRequestId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'changeRequestId' when calling" + + " deleteChangeRequestDecision"); + } + + // verify the required parameter 'decisionId' is set + if (decisionId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'decisionId' when calling deleteChangeRequestDecision"); + } + // create path and map variables + String localVarPath = + "/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id}" + .replaceAll( + "\\{" + "change_request_id" + "\\}", + apiClient.escapeString(changeRequestId.toString())) + .replaceAll( + "\\{" + "decision_id" + "\\}", apiClient.escapeString(decisionId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ChangeManagementApi.deleteChangeRequestDecision", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Delete a change request decision. + * + *

See {@link #deleteChangeRequestDecisionWithHttpInfo}. + * + * @param changeRequestId The identifier of the change request. (required) + * @param decisionId The identifier of the change request decision. (required) + * @return CompletableFuture<ApiResponse<ChangeRequestResponse>> + */ + public CompletableFuture> + deleteChangeRequestDecisionWithHttpInfoAsync(String changeRequestId, String decisionId) { + // Check if unstable operation is enabled + String operationId = "deleteChangeRequestDecision"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'changeRequestId' is set + if (changeRequestId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'changeRequestId' when calling" + + " deleteChangeRequestDecision")); + return result; + } + + // verify the required parameter 'decisionId' is set + if (decisionId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'decisionId' when calling" + + " deleteChangeRequestDecision")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id}" + .replaceAll( + "\\{" + "change_request_id" + "\\}", + apiClient.escapeString(changeRequestId.toString())) + .replaceAll( + "\\{" + "decision_id" + "\\}", apiClient.escapeString(decisionId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ChangeManagementApi.deleteChangeRequestDecision", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a change request. + * + *

See {@link #getChangeRequestWithHttpInfo}. + * + * @param changeRequestId The identifier of the change request. (required) + * @return ChangeRequestResponse + * @throws ApiException if fails to make API call + */ + public ChangeRequestResponse getChangeRequest(String changeRequestId) throws ApiException { + return getChangeRequestWithHttpInfo(changeRequestId).getData(); + } + + /** + * Get a change request. + * + *

See {@link #getChangeRequestWithHttpInfoAsync}. + * + * @param changeRequestId The identifier of the change request. (required) + * @return CompletableFuture<ChangeRequestResponse> + */ + public CompletableFuture getChangeRequestAsync(String changeRequestId) { + return getChangeRequestWithHttpInfoAsync(changeRequestId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the details of a change request by its ID. + * + * @param changeRequestId The identifier of the change request. (required) + * @return ApiResponse<ChangeRequestResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getChangeRequestWithHttpInfo(String changeRequestId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getChangeRequest"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'changeRequestId' is set + if (changeRequestId == null) { + throw new ApiException( + 400, "Missing the required parameter 'changeRequestId' when calling getChangeRequest"); + } + // create path and map variables + String localVarPath = + "/api/v2/change-management/change-request/{change_request_id}" + .replaceAll( + "\\{" + "change_request_id" + "\\}", + apiClient.escapeString(changeRequestId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ChangeManagementApi.getChangeRequest", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a change request. + * + *

See {@link #getChangeRequestWithHttpInfo}. + * + * @param changeRequestId The identifier of the change request. (required) + * @return CompletableFuture<ApiResponse<ChangeRequestResponse>> + */ + public CompletableFuture> getChangeRequestWithHttpInfoAsync( + String changeRequestId) { + // Check if unstable operation is enabled + String operationId = "getChangeRequest"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'changeRequestId' is set + if (changeRequestId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'changeRequestId' when calling getChangeRequest")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/change-management/change-request/{change_request_id}" + .replaceAll( + "\\{" + "change_request_id" + "\\}", + apiClient.escapeString(changeRequestId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ChangeManagementApi.getChangeRequest", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update a change request. + * + *

See {@link #updateChangeRequestWithHttpInfo}. + * + * @param changeRequestId The identifier of the change request. (required) + * @param body Change request update payload. (required) + * @return ChangeRequestResponse + * @throws ApiException if fails to make API call + */ + public ChangeRequestResponse updateChangeRequest( + String changeRequestId, ChangeRequestUpdateRequest body) throws ApiException { + return updateChangeRequestWithHttpInfo(changeRequestId, body).getData(); + } + + /** + * Update a change request. + * + *

See {@link #updateChangeRequestWithHttpInfoAsync}. + * + * @param changeRequestId The identifier of the change request. (required) + * @param body Change request update payload. (required) + * @return CompletableFuture<ChangeRequestResponse> + */ + public CompletableFuture updateChangeRequestAsync( + String changeRequestId, ChangeRequestUpdateRequest body) { + return updateChangeRequestWithHttpInfoAsync(changeRequestId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update the properties of a change request. + * + * @param changeRequestId The identifier of the change request. (required) + * @param body Change request update payload. (required) + * @return ApiResponse<ChangeRequestResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updateChangeRequestWithHttpInfo( + String changeRequestId, ChangeRequestUpdateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateChangeRequest"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'changeRequestId' is set + if (changeRequestId == null) { + throw new ApiException( + 400, "Missing the required parameter 'changeRequestId' when calling updateChangeRequest"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateChangeRequest"); + } + // create path and map variables + String localVarPath = + "/api/v2/change-management/change-request/{change_request_id}" + .replaceAll( + "\\{" + "change_request_id" + "\\}", + apiClient.escapeString(changeRequestId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ChangeManagementApi.updateChangeRequest", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update a change request. + * + *

See {@link #updateChangeRequestWithHttpInfo}. + * + * @param changeRequestId The identifier of the change request. (required) + * @param body Change request update payload. (required) + * @return CompletableFuture<ApiResponse<ChangeRequestResponse>> + */ + public CompletableFuture> updateChangeRequestWithHttpInfoAsync( + String changeRequestId, ChangeRequestUpdateRequest body) { + // Check if unstable operation is enabled + String operationId = "updateChangeRequest"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'changeRequestId' is set + if (changeRequestId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'changeRequestId' when calling updateChangeRequest")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateChangeRequest")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/change-management/change-request/{change_request_id}" + .replaceAll( + "\\{" + "change_request_id" + "\\}", + apiClient.escapeString(changeRequestId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ChangeManagementApi.updateChangeRequest", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update a change request decision. + * + *

See {@link #updateChangeRequestDecisionWithHttpInfo}. + * + * @param changeRequestId The identifier of the change request. (required) + * @param decisionId The identifier of the change request decision. (required) + * @param body Decision update payload. (required) + * @return ChangeRequestResponse + * @throws ApiException if fails to make API call + */ + public ChangeRequestResponse updateChangeRequestDecision( + String changeRequestId, String decisionId, ChangeRequestDecisionUpdateRequest body) + throws ApiException { + return updateChangeRequestDecisionWithHttpInfo(changeRequestId, decisionId, body).getData(); + } + + /** + * Update a change request decision. + * + *

See {@link #updateChangeRequestDecisionWithHttpInfoAsync}. + * + * @param changeRequestId The identifier of the change request. (required) + * @param decisionId The identifier of the change request decision. (required) + * @param body Decision update payload. (required) + * @return CompletableFuture<ChangeRequestResponse> + */ + public CompletableFuture updateChangeRequestDecisionAsync( + String changeRequestId, String decisionId, ChangeRequestDecisionUpdateRequest body) { + return updateChangeRequestDecisionWithHttpInfoAsync(changeRequestId, decisionId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update a decision on a change request, such as approving or declining it. + * + * @param changeRequestId The identifier of the change request. (required) + * @param decisionId The identifier of the change request decision. (required) + * @param body Decision update payload. (required) + * @return ApiResponse<ChangeRequestResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updateChangeRequestDecisionWithHttpInfo( + String changeRequestId, String decisionId, ChangeRequestDecisionUpdateRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateChangeRequestDecision"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'changeRequestId' is set + if (changeRequestId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'changeRequestId' when calling" + + " updateChangeRequestDecision"); + } + + // verify the required parameter 'decisionId' is set + if (decisionId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'decisionId' when calling updateChangeRequestDecision"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateChangeRequestDecision"); + } + // create path and map variables + String localVarPath = + "/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id}" + .replaceAll( + "\\{" + "change_request_id" + "\\}", + apiClient.escapeString(changeRequestId.toString())) + .replaceAll( + "\\{" + "decision_id" + "\\}", apiClient.escapeString(decisionId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ChangeManagementApi.updateChangeRequestDecision", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update a change request decision. + * + *

See {@link #updateChangeRequestDecisionWithHttpInfo}. + * + * @param changeRequestId The identifier of the change request. (required) + * @param decisionId The identifier of the change request decision. (required) + * @param body Decision update payload. (required) + * @return CompletableFuture<ApiResponse<ChangeRequestResponse>> + */ + public CompletableFuture> + updateChangeRequestDecisionWithHttpInfoAsync( + String changeRequestId, String decisionId, ChangeRequestDecisionUpdateRequest body) { + // Check if unstable operation is enabled + String operationId = "updateChangeRequestDecision"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'changeRequestId' is set + if (changeRequestId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'changeRequestId' when calling" + + " updateChangeRequestDecision")); + return result; + } + + // verify the required parameter 'decisionId' is set + if (decisionId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'decisionId' when calling" + + " updateChangeRequestDecision")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling updateChangeRequestDecision")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id}" + .replaceAll( + "\\{" + "change_request_id" + "\\}", + apiClient.escapeString(changeRequestId.toString())) + .replaceAll( + "\\{" + "decision_id" + "\\}", apiClient.escapeString(decisionId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ChangeManagementApi.updateChangeRequestDecision", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestBranchCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestBranchCreateAttributes.java new file mode 100644 index 00000000000..ecacbf36a15 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestBranchCreateAttributes.java @@ -0,0 +1,175 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for creating a change request branch. */ +@JsonPropertyOrder({ + ChangeRequestBranchCreateAttributes.JSON_PROPERTY_BRANCH_NAME, + ChangeRequestBranchCreateAttributes.JSON_PROPERTY_REPO_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestBranchCreateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_BRANCH_NAME = "branch_name"; + private String branchName; + + public static final String JSON_PROPERTY_REPO_ID = "repo_id"; + private String repoId; + + public ChangeRequestBranchCreateAttributes() {} + + @JsonCreator + public ChangeRequestBranchCreateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_BRANCH_NAME) String branchName, + @JsonProperty(required = true, value = JSON_PROPERTY_REPO_ID) String repoId) { + this.branchName = branchName; + this.repoId = repoId; + } + + public ChangeRequestBranchCreateAttributes branchName(String branchName) { + this.branchName = branchName; + return this; + } + + /** + * The name of the branch to create. + * + * @return branchName + */ + @JsonProperty(JSON_PROPERTY_BRANCH_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getBranchName() { + return branchName; + } + + public void setBranchName(String branchName) { + this.branchName = branchName; + } + + public ChangeRequestBranchCreateAttributes repoId(String repoId) { + this.repoId = repoId; + return this; + } + + /** + * The repository identifier in the format owner/repository. + * + * @return repoId + */ + @JsonProperty(JSON_PROPERTY_REPO_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRepoId() { + return repoId; + } + + public void setRepoId(String repoId) { + this.repoId = repoId; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestBranchCreateAttributes + */ + @JsonAnySetter + public ChangeRequestBranchCreateAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestBranchCreateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestBranchCreateAttributes changeRequestBranchCreateAttributes = + (ChangeRequestBranchCreateAttributes) o; + return Objects.equals(this.branchName, changeRequestBranchCreateAttributes.branchName) + && Objects.equals(this.repoId, changeRequestBranchCreateAttributes.repoId) + && Objects.equals( + this.additionalProperties, changeRequestBranchCreateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(branchName, repoId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestBranchCreateAttributes {\n"); + sb.append(" branchName: ").append(toIndentedString(branchName)).append("\n"); + sb.append(" repoId: ").append(toIndentedString(repoId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestBranchCreateData.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestBranchCreateData.java new file mode 100644 index 00000000000..68e5d7d26b6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestBranchCreateData.java @@ -0,0 +1,183 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object to create a change request branch. */ +@JsonPropertyOrder({ + ChangeRequestBranchCreateData.JSON_PROPERTY_ATTRIBUTES, + ChangeRequestBranchCreateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestBranchCreateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ChangeRequestBranchCreateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ChangeRequestBranchResourceType type; + + public ChangeRequestBranchCreateData() {} + + @JsonCreator + public ChangeRequestBranchCreateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ChangeRequestBranchCreateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ChangeRequestBranchResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ChangeRequestBranchCreateData attributes(ChangeRequestBranchCreateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for creating a change request branch. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestBranchCreateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ChangeRequestBranchCreateAttributes attributes) { + this.attributes = attributes; + } + + public ChangeRequestBranchCreateData type(ChangeRequestBranchResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Change request branch resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestBranchResourceType getType() { + return type; + } + + public void setType(ChangeRequestBranchResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestBranchCreateData + */ + @JsonAnySetter + public ChangeRequestBranchCreateData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestBranchCreateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestBranchCreateData changeRequestBranchCreateData = (ChangeRequestBranchCreateData) o; + return Objects.equals(this.attributes, changeRequestBranchCreateData.attributes) + && Objects.equals(this.type, changeRequestBranchCreateData.type) + && Objects.equals( + this.additionalProperties, changeRequestBranchCreateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestBranchCreateData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestBranchCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestBranchCreateRequest.java new file mode 100644 index 00000000000..06693000448 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestBranchCreateRequest.java @@ -0,0 +1,148 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request object to create a branch for a change request. */ +@JsonPropertyOrder({ChangeRequestBranchCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestBranchCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ChangeRequestBranchCreateData data; + + public ChangeRequestBranchCreateRequest() {} + + @JsonCreator + public ChangeRequestBranchCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ChangeRequestBranchCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ChangeRequestBranchCreateRequest data(ChangeRequestBranchCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object to create a change request branch. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestBranchCreateData getData() { + return data; + } + + public void setData(ChangeRequestBranchCreateData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestBranchCreateRequest + */ + @JsonAnySetter + public ChangeRequestBranchCreateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestBranchCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestBranchCreateRequest changeRequestBranchCreateRequest = + (ChangeRequestBranchCreateRequest) o; + return Objects.equals(this.data, changeRequestBranchCreateRequest.data) + && Objects.equals( + this.additionalProperties, changeRequestBranchCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestBranchCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestBranchResourceType.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestBranchResourceType.java new file mode 100644 index 00000000000..5372c22a70b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestBranchResourceType.java @@ -0,0 +1,58 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Change request branch resource type. */ +@JsonSerialize( + using = ChangeRequestBranchResourceType.ChangeRequestBranchResourceTypeSerializer.class) +public class ChangeRequestBranchResourceType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("change_request_branch")); + + public static final ChangeRequestBranchResourceType CHANGE_REQUEST_BRANCH = + new ChangeRequestBranchResourceType("change_request_branch"); + + ChangeRequestBranchResourceType(String value) { + super(value, allowedValues); + } + + public static class ChangeRequestBranchResourceTypeSerializer + extends StdSerializer { + public ChangeRequestBranchResourceTypeSerializer(Class t) { + super(t); + } + + public ChangeRequestBranchResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ChangeRequestBranchResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ChangeRequestBranchResourceType fromValue(String value) { + return new ChangeRequestBranchResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestChangeType.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestChangeType.java new file mode 100644 index 00000000000..80f4a4c049f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestChangeType.java @@ -0,0 +1,58 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The type of the change request. */ +@JsonSerialize(using = ChangeRequestChangeType.ChangeRequestChangeTypeSerializer.class) +public class ChangeRequestChangeType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("NORMAL", "STANDARD", "EMERGENCY")); + + public static final ChangeRequestChangeType NORMAL = new ChangeRequestChangeType("NORMAL"); + public static final ChangeRequestChangeType STANDARD = new ChangeRequestChangeType("STANDARD"); + public static final ChangeRequestChangeType EMERGENCY = new ChangeRequestChangeType("EMERGENCY"); + + ChangeRequestChangeType(String value) { + super(value, allowedValues); + } + + public static class ChangeRequestChangeTypeSerializer + extends StdSerializer { + public ChangeRequestChangeTypeSerializer(Class t) { + super(t); + } + + public ChangeRequestChangeTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ChangeRequestChangeType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ChangeRequestChangeType fromValue(String value) { + return new ChangeRequestChangeType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestCreateAttributes.java new file mode 100644 index 00000000000..7616f314e29 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestCreateAttributes.java @@ -0,0 +1,460 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes for creating a change request. */ +@JsonPropertyOrder({ + ChangeRequestCreateAttributes.JSON_PROPERTY_CHANGE_REQUEST_LINKED_INCIDENT_UUID, + ChangeRequestCreateAttributes.JSON_PROPERTY_CHANGE_REQUEST_MAINTENANCE_WINDOW_QUERY, + ChangeRequestCreateAttributes.JSON_PROPERTY_CHANGE_REQUEST_PLAN, + ChangeRequestCreateAttributes.JSON_PROPERTY_CHANGE_REQUEST_RISK, + ChangeRequestCreateAttributes.JSON_PROPERTY_CHANGE_REQUEST_TYPE, + ChangeRequestCreateAttributes.JSON_PROPERTY_DESCRIPTION, + ChangeRequestCreateAttributes.JSON_PROPERTY_END_DATE, + ChangeRequestCreateAttributes.JSON_PROPERTY_PROJECT_ID, + ChangeRequestCreateAttributes.JSON_PROPERTY_REQUESTED_TEAMS, + ChangeRequestCreateAttributes.JSON_PROPERTY_START_DATE, + ChangeRequestCreateAttributes.JSON_PROPERTY_TITLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestCreateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CHANGE_REQUEST_LINKED_INCIDENT_UUID = + "change_request_linked_incident_uuid"; + private String changeRequestLinkedIncidentUuid; + + public static final String JSON_PROPERTY_CHANGE_REQUEST_MAINTENANCE_WINDOW_QUERY = + "change_request_maintenance_window_query"; + private String changeRequestMaintenanceWindowQuery; + + public static final String JSON_PROPERTY_CHANGE_REQUEST_PLAN = "change_request_plan"; + private String changeRequestPlan; + + public static final String JSON_PROPERTY_CHANGE_REQUEST_RISK = "change_request_risk"; + private ChangeRequestRiskLevel changeRequestRisk; + + public static final String JSON_PROPERTY_CHANGE_REQUEST_TYPE = "change_request_type"; + private ChangeRequestChangeType changeRequestType; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_END_DATE = "end_date"; + private OffsetDateTime endDate; + + public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; + private String projectId; + + public static final String JSON_PROPERTY_REQUESTED_TEAMS = "requested_teams"; + private List requestedTeams = null; + + public static final String JSON_PROPERTY_START_DATE = "start_date"; + private OffsetDateTime startDate; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public ChangeRequestCreateAttributes() {} + + @JsonCreator + public ChangeRequestCreateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_TITLE) String title) { + this.title = title; + } + + public ChangeRequestCreateAttributes changeRequestLinkedIncidentUuid( + String changeRequestLinkedIncidentUuid) { + this.changeRequestLinkedIncidentUuid = changeRequestLinkedIncidentUuid; + return this; + } + + /** + * The UUID of an incident to link to the change request. + * + * @return changeRequestLinkedIncidentUuid + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANGE_REQUEST_LINKED_INCIDENT_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChangeRequestLinkedIncidentUuid() { + return changeRequestLinkedIncidentUuid; + } + + public void setChangeRequestLinkedIncidentUuid(String changeRequestLinkedIncidentUuid) { + this.changeRequestLinkedIncidentUuid = changeRequestLinkedIncidentUuid; + } + + public ChangeRequestCreateAttributes changeRequestMaintenanceWindowQuery( + String changeRequestMaintenanceWindowQuery) { + this.changeRequestMaintenanceWindowQuery = changeRequestMaintenanceWindowQuery; + return this; + } + + /** + * The maintenance window query for the change request. + * + * @return changeRequestMaintenanceWindowQuery + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANGE_REQUEST_MAINTENANCE_WINDOW_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChangeRequestMaintenanceWindowQuery() { + return changeRequestMaintenanceWindowQuery; + } + + public void setChangeRequestMaintenanceWindowQuery(String changeRequestMaintenanceWindowQuery) { + this.changeRequestMaintenanceWindowQuery = changeRequestMaintenanceWindowQuery; + } + + public ChangeRequestCreateAttributes changeRequestPlan(String changeRequestPlan) { + this.changeRequestPlan = changeRequestPlan; + return this; + } + + /** + * The plan associated with the change request. + * + * @return changeRequestPlan + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANGE_REQUEST_PLAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChangeRequestPlan() { + return changeRequestPlan; + } + + public void setChangeRequestPlan(String changeRequestPlan) { + this.changeRequestPlan = changeRequestPlan; + } + + public ChangeRequestCreateAttributes changeRequestRisk(ChangeRequestRiskLevel changeRequestRisk) { + this.changeRequestRisk = changeRequestRisk; + this.unparsed |= !changeRequestRisk.isValid(); + return this; + } + + /** + * The risk level of the change request. + * + * @return changeRequestRisk + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANGE_REQUEST_RISK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ChangeRequestRiskLevel getChangeRequestRisk() { + return changeRequestRisk; + } + + public void setChangeRequestRisk(ChangeRequestRiskLevel changeRequestRisk) { + if (!changeRequestRisk.isValid()) { + this.unparsed = true; + } + this.changeRequestRisk = changeRequestRisk; + } + + public ChangeRequestCreateAttributes changeRequestType( + ChangeRequestChangeType changeRequestType) { + this.changeRequestType = changeRequestType; + this.unparsed |= !changeRequestType.isValid(); + return this; + } + + /** + * The type of the change request. + * + * @return changeRequestType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANGE_REQUEST_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ChangeRequestChangeType getChangeRequestType() { + return changeRequestType; + } + + public void setChangeRequestType(ChangeRequestChangeType changeRequestType) { + if (!changeRequestType.isValid()) { + this.unparsed = true; + } + this.changeRequestType = changeRequestType; + } + + public ChangeRequestCreateAttributes description(String description) { + this.description = description; + return this; + } + + /** + * The description of the change request. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public ChangeRequestCreateAttributes endDate(OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * The planned end date of the change request. + * + * @return endDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getEndDate() { + return endDate; + } + + public void setEndDate(OffsetDateTime endDate) { + this.endDate = endDate; + } + + public ChangeRequestCreateAttributes projectId(String projectId) { + this.projectId = projectId; + return this; + } + + /** + * The project UUID to associate with the change request. + * + * @return projectId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROJECT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public ChangeRequestCreateAttributes requestedTeams(List requestedTeams) { + this.requestedTeams = requestedTeams; + return this; + } + + public ChangeRequestCreateAttributes addRequestedTeamsItem(String requestedTeamsItem) { + if (this.requestedTeams == null) { + this.requestedTeams = new ArrayList<>(); + } + this.requestedTeams.add(requestedTeamsItem); + return this; + } + + /** + * A list of team handles to request decisions from. + * + * @return requestedTeams + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUESTED_TEAMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getRequestedTeams() { + return requestedTeams; + } + + public void setRequestedTeams(List requestedTeams) { + this.requestedTeams = requestedTeams; + } + + public ChangeRequestCreateAttributes startDate(OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * The planned start date of the change request. + * + * @return startDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(OffsetDateTime startDate) { + this.startDate = startDate; + } + + public ChangeRequestCreateAttributes title(String title) { + this.title = title; + return this; + } + + /** + * The title of the change request. + * + * @return title + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestCreateAttributes + */ + @JsonAnySetter + public ChangeRequestCreateAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestCreateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestCreateAttributes changeRequestCreateAttributes = (ChangeRequestCreateAttributes) o; + return Objects.equals( + this.changeRequestLinkedIncidentUuid, + changeRequestCreateAttributes.changeRequestLinkedIncidentUuid) + && Objects.equals( + this.changeRequestMaintenanceWindowQuery, + changeRequestCreateAttributes.changeRequestMaintenanceWindowQuery) + && Objects.equals(this.changeRequestPlan, changeRequestCreateAttributes.changeRequestPlan) + && Objects.equals(this.changeRequestRisk, changeRequestCreateAttributes.changeRequestRisk) + && Objects.equals(this.changeRequestType, changeRequestCreateAttributes.changeRequestType) + && Objects.equals(this.description, changeRequestCreateAttributes.description) + && Objects.equals(this.endDate, changeRequestCreateAttributes.endDate) + && Objects.equals(this.projectId, changeRequestCreateAttributes.projectId) + && Objects.equals(this.requestedTeams, changeRequestCreateAttributes.requestedTeams) + && Objects.equals(this.startDate, changeRequestCreateAttributes.startDate) + && Objects.equals(this.title, changeRequestCreateAttributes.title) + && Objects.equals( + this.additionalProperties, changeRequestCreateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + changeRequestLinkedIncidentUuid, + changeRequestMaintenanceWindowQuery, + changeRequestPlan, + changeRequestRisk, + changeRequestType, + description, + endDate, + projectId, + requestedTeams, + startDate, + title, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestCreateAttributes {\n"); + sb.append(" changeRequestLinkedIncidentUuid: ") + .append(toIndentedString(changeRequestLinkedIncidentUuid)) + .append("\n"); + sb.append(" changeRequestMaintenanceWindowQuery: ") + .append(toIndentedString(changeRequestMaintenanceWindowQuery)) + .append("\n"); + sb.append(" changeRequestPlan: ").append(toIndentedString(changeRequestPlan)).append("\n"); + sb.append(" changeRequestRisk: ").append(toIndentedString(changeRequestRisk)).append("\n"); + sb.append(" changeRequestType: ").append(toIndentedString(changeRequestType)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); + sb.append(" requestedTeams: ").append(toIndentedString(requestedTeams)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestCreateData.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestCreateData.java new file mode 100644 index 00000000000..308b408b29a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestCreateData.java @@ -0,0 +1,181 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object to create a change request. */ +@JsonPropertyOrder({ + ChangeRequestCreateData.JSON_PROPERTY_ATTRIBUTES, + ChangeRequestCreateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestCreateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ChangeRequestCreateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ChangeRequestResourceType type; + + public ChangeRequestCreateData() {} + + @JsonCreator + public ChangeRequestCreateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ChangeRequestCreateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ChangeRequestResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ChangeRequestCreateData attributes(ChangeRequestCreateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for creating a change request. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestCreateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ChangeRequestCreateAttributes attributes) { + this.attributes = attributes; + } + + public ChangeRequestCreateData type(ChangeRequestResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Change request resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestResourceType getType() { + return type; + } + + public void setType(ChangeRequestResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestCreateData + */ + @JsonAnySetter + public ChangeRequestCreateData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestCreateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestCreateData changeRequestCreateData = (ChangeRequestCreateData) o; + return Objects.equals(this.attributes, changeRequestCreateData.attributes) + && Objects.equals(this.type, changeRequestCreateData.type) + && Objects.equals(this.additionalProperties, changeRequestCreateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestCreateData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestCreateRequest.java new file mode 100644 index 00000000000..c0442e93fa2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestCreateRequest.java @@ -0,0 +1,146 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request object to create a change request. */ +@JsonPropertyOrder({ChangeRequestCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ChangeRequestCreateData data; + + public ChangeRequestCreateRequest() {} + + @JsonCreator + public ChangeRequestCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) ChangeRequestCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ChangeRequestCreateRequest data(ChangeRequestCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object to create a change request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestCreateData getData() { + return data; + } + + public void setData(ChangeRequestCreateData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestCreateRequest + */ + @JsonAnySetter + public ChangeRequestCreateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestCreateRequest changeRequestCreateRequest = (ChangeRequestCreateRequest) o; + return Objects.equals(this.data, changeRequestCreateRequest.data) + && Objects.equals( + this.additionalProperties, changeRequestCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionCreateAttributes.java new file mode 100644 index 00000000000..db34e2c9716 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionCreateAttributes.java @@ -0,0 +1,174 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for creating a change request decision. */ +@JsonPropertyOrder({ + ChangeRequestDecisionCreateAttributes.JSON_PROPERTY_CHANGE_REQUEST_STATUS, + ChangeRequestDecisionCreateAttributes.JSON_PROPERTY_REQUEST_REASON +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestDecisionCreateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CHANGE_REQUEST_STATUS = "change_request_status"; + private ChangeRequestDecisionStatusType changeRequestStatus; + + public static final String JSON_PROPERTY_REQUEST_REASON = "request_reason"; + private String requestReason; + + public ChangeRequestDecisionCreateAttributes changeRequestStatus( + ChangeRequestDecisionStatusType changeRequestStatus) { + this.changeRequestStatus = changeRequestStatus; + this.unparsed |= !changeRequestStatus.isValid(); + return this; + } + + /** + * The status of a change request decision. + * + * @return changeRequestStatus + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANGE_REQUEST_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ChangeRequestDecisionStatusType getChangeRequestStatus() { + return changeRequestStatus; + } + + public void setChangeRequestStatus(ChangeRequestDecisionStatusType changeRequestStatus) { + if (!changeRequestStatus.isValid()) { + this.unparsed = true; + } + this.changeRequestStatus = changeRequestStatus; + } + + public ChangeRequestDecisionCreateAttributes requestReason(String requestReason) { + this.requestReason = requestReason; + return this; + } + + /** + * The reason for requesting the decision. + * + * @return requestReason + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUEST_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRequestReason() { + return requestReason; + } + + public void setRequestReason(String requestReason) { + this.requestReason = requestReason; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestDecisionCreateAttributes + */ + @JsonAnySetter + public ChangeRequestDecisionCreateAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestDecisionCreateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestDecisionCreateAttributes changeRequestDecisionCreateAttributes = + (ChangeRequestDecisionCreateAttributes) o; + return Objects.equals( + this.changeRequestStatus, changeRequestDecisionCreateAttributes.changeRequestStatus) + && Objects.equals(this.requestReason, changeRequestDecisionCreateAttributes.requestReason) + && Objects.equals( + this.additionalProperties, changeRequestDecisionCreateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(changeRequestStatus, requestReason, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestDecisionCreateAttributes {\n"); + sb.append(" changeRequestStatus: ") + .append(toIndentedString(changeRequestStatus)) + .append("\n"); + sb.append(" requestReason: ").append(toIndentedString(requestReason)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionCreateItem.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionCreateItem.java new file mode 100644 index 00000000000..08cefd3137e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionCreateItem.java @@ -0,0 +1,239 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** An included change request decision for a create or update operation. */ +@JsonPropertyOrder({ + ChangeRequestDecisionCreateItem.JSON_PROPERTY_ATTRIBUTES, + ChangeRequestDecisionCreateItem.JSON_PROPERTY_ID, + ChangeRequestDecisionCreateItem.JSON_PROPERTY_RELATIONSHIPS, + ChangeRequestDecisionCreateItem.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestDecisionCreateItem { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ChangeRequestDecisionCreateAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private ChangeRequestDecisionCreateRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ChangeRequestDecisionResourceType type; + + public ChangeRequestDecisionCreateItem() {} + + @JsonCreator + public ChangeRequestDecisionCreateItem( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ChangeRequestDecisionResourceType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ChangeRequestDecisionCreateItem attributes( + ChangeRequestDecisionCreateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for creating a change request decision. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ChangeRequestDecisionCreateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ChangeRequestDecisionCreateAttributes attributes) { + this.attributes = attributes; + } + + public ChangeRequestDecisionCreateItem id(String id) { + this.id = id; + return this; + } + + /** + * The decision identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ChangeRequestDecisionCreateItem relationships( + ChangeRequestDecisionCreateRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships for creating a change request decision. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ChangeRequestDecisionCreateRelationships getRelationships() { + return relationships; + } + + public void setRelationships(ChangeRequestDecisionCreateRelationships relationships) { + this.relationships = relationships; + } + + public ChangeRequestDecisionCreateItem type(ChangeRequestDecisionResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Change request decision resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestDecisionResourceType getType() { + return type; + } + + public void setType(ChangeRequestDecisionResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestDecisionCreateItem + */ + @JsonAnySetter + public ChangeRequestDecisionCreateItem putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestDecisionCreateItem object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestDecisionCreateItem changeRequestDecisionCreateItem = + (ChangeRequestDecisionCreateItem) o; + return Objects.equals(this.attributes, changeRequestDecisionCreateItem.attributes) + && Objects.equals(this.id, changeRequestDecisionCreateItem.id) + && Objects.equals(this.relationships, changeRequestDecisionCreateItem.relationships) + && Objects.equals(this.type, changeRequestDecisionCreateItem.type) + && Objects.equals( + this.additionalProperties, changeRequestDecisionCreateItem.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestDecisionCreateItem {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionCreateRelationships.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionCreateRelationships.java new file mode 100644 index 00000000000..1106b8d929a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionCreateRelationships.java @@ -0,0 +1,141 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationships for creating a change request decision. */ +@JsonPropertyOrder({ChangeRequestDecisionCreateRelationships.JSON_PROPERTY_REQUESTED_USER}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestDecisionCreateRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_REQUESTED_USER = "requested_user"; + private ChangeRequestUserRelationship requestedUser; + + public ChangeRequestDecisionCreateRelationships requestedUser( + ChangeRequestUserRelationship requestedUser) { + this.requestedUser = requestedUser; + this.unparsed |= requestedUser.unparsed; + return this; + } + + /** + * Relationship to a user. + * + * @return requestedUser + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUESTED_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ChangeRequestUserRelationship getRequestedUser() { + return requestedUser; + } + + public void setRequestedUser(ChangeRequestUserRelationship requestedUser) { + this.requestedUser = requestedUser; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestDecisionCreateRelationships + */ + @JsonAnySetter + public ChangeRequestDecisionCreateRelationships putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestDecisionCreateRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestDecisionCreateRelationships changeRequestDecisionCreateRelationships = + (ChangeRequestDecisionCreateRelationships) o; + return Objects.equals( + this.requestedUser, changeRequestDecisionCreateRelationships.requestedUser) + && Objects.equals( + this.additionalProperties, + changeRequestDecisionCreateRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(requestedUser, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestDecisionCreateRelationships {\n"); + sb.append(" requestedUser: ").append(toIndentedString(requestedUser)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionRelationshipData.java new file mode 100644 index 00000000000..2fa31649fc8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionRelationshipData.java @@ -0,0 +1,181 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Change request decision relationship data. */ +@JsonPropertyOrder({ + ChangeRequestDecisionRelationshipData.JSON_PROPERTY_ID, + ChangeRequestDecisionRelationshipData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestDecisionRelationshipData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ChangeRequestDecisionResourceType type; + + public ChangeRequestDecisionRelationshipData() {} + + @JsonCreator + public ChangeRequestDecisionRelationshipData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ChangeRequestDecisionResourceType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ChangeRequestDecisionRelationshipData id(String id) { + this.id = id; + return this; + } + + /** + * The decision UUID. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ChangeRequestDecisionRelationshipData type(ChangeRequestDecisionResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Change request decision resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestDecisionResourceType getType() { + return type; + } + + public void setType(ChangeRequestDecisionResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestDecisionRelationshipData + */ + @JsonAnySetter + public ChangeRequestDecisionRelationshipData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestDecisionRelationshipData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestDecisionRelationshipData changeRequestDecisionRelationshipData = + (ChangeRequestDecisionRelationshipData) o; + return Objects.equals(this.id, changeRequestDecisionRelationshipData.id) + && Objects.equals(this.type, changeRequestDecisionRelationshipData.type) + && Objects.equals( + this.additionalProperties, changeRequestDecisionRelationshipData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestDecisionRelationshipData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionRelationships.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionRelationships.java new file mode 100644 index 00000000000..8a029ec49bd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionRelationships.java @@ -0,0 +1,214 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationships of a change request decision. */ +@JsonPropertyOrder({ + ChangeRequestDecisionRelationships.JSON_PROPERTY_MODIFIED_BY, + ChangeRequestDecisionRelationships.JSON_PROPERTY_REQUESTED_BY_USER, + ChangeRequestDecisionRelationships.JSON_PROPERTY_REQUESTED_USER +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestDecisionRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_MODIFIED_BY = "modified_by"; + private ChangeRequestUserRelationship modifiedBy; + + public static final String JSON_PROPERTY_REQUESTED_BY_USER = "requested_by_user"; + private ChangeRequestUserRelationship requestedByUser; + + public static final String JSON_PROPERTY_REQUESTED_USER = "requested_user"; + private ChangeRequestUserRelationship requestedUser; + + public ChangeRequestDecisionRelationships() {} + + @JsonCreator + public ChangeRequestDecisionRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_BY) + ChangeRequestUserRelationship modifiedBy, + @JsonProperty(required = true, value = JSON_PROPERTY_REQUESTED_BY_USER) + ChangeRequestUserRelationship requestedByUser, + @JsonProperty(required = true, value = JSON_PROPERTY_REQUESTED_USER) + ChangeRequestUserRelationship requestedUser) { + this.modifiedBy = modifiedBy; + this.unparsed |= modifiedBy.unparsed; + this.requestedByUser = requestedByUser; + this.unparsed |= requestedByUser.unparsed; + this.requestedUser = requestedUser; + this.unparsed |= requestedUser.unparsed; + } + + public ChangeRequestDecisionRelationships modifiedBy(ChangeRequestUserRelationship modifiedBy) { + this.modifiedBy = modifiedBy; + this.unparsed |= modifiedBy.unparsed; + return this; + } + + /** + * Relationship to a user. + * + * @return modifiedBy + */ + @JsonProperty(JSON_PROPERTY_MODIFIED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestUserRelationship getModifiedBy() { + return modifiedBy; + } + + public void setModifiedBy(ChangeRequestUserRelationship modifiedBy) { + this.modifiedBy = modifiedBy; + } + + public ChangeRequestDecisionRelationships requestedByUser( + ChangeRequestUserRelationship requestedByUser) { + this.requestedByUser = requestedByUser; + this.unparsed |= requestedByUser.unparsed; + return this; + } + + /** + * Relationship to a user. + * + * @return requestedByUser + */ + @JsonProperty(JSON_PROPERTY_REQUESTED_BY_USER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestUserRelationship getRequestedByUser() { + return requestedByUser; + } + + public void setRequestedByUser(ChangeRequestUserRelationship requestedByUser) { + this.requestedByUser = requestedByUser; + } + + public ChangeRequestDecisionRelationships requestedUser( + ChangeRequestUserRelationship requestedUser) { + this.requestedUser = requestedUser; + this.unparsed |= requestedUser.unparsed; + return this; + } + + /** + * Relationship to a user. + * + * @return requestedUser + */ + @JsonProperty(JSON_PROPERTY_REQUESTED_USER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestUserRelationship getRequestedUser() { + return requestedUser; + } + + public void setRequestedUser(ChangeRequestUserRelationship requestedUser) { + this.requestedUser = requestedUser; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestDecisionRelationships + */ + @JsonAnySetter + public ChangeRequestDecisionRelationships putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestDecisionRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestDecisionRelationships changeRequestDecisionRelationships = + (ChangeRequestDecisionRelationships) o; + return Objects.equals(this.modifiedBy, changeRequestDecisionRelationships.modifiedBy) + && Objects.equals(this.requestedByUser, changeRequestDecisionRelationships.requestedByUser) + && Objects.equals(this.requestedUser, changeRequestDecisionRelationships.requestedUser) + && Objects.equals( + this.additionalProperties, changeRequestDecisionRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(modifiedBy, requestedByUser, requestedUser, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestDecisionRelationships {\n"); + sb.append(" modifiedBy: ").append(toIndentedString(modifiedBy)).append("\n"); + sb.append(" requestedByUser: ").append(toIndentedString(requestedByUser)).append("\n"); + sb.append(" requestedUser: ").append(toIndentedString(requestedUser)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionResourceType.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionResourceType.java new file mode 100644 index 00000000000..7c234440ad1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionResourceType.java @@ -0,0 +1,58 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Change request decision resource type. */ +@JsonSerialize( + using = ChangeRequestDecisionResourceType.ChangeRequestDecisionResourceTypeSerializer.class) +public class ChangeRequestDecisionResourceType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("change_request_decision")); + + public static final ChangeRequestDecisionResourceType CHANGE_REQUEST_DECISION = + new ChangeRequestDecisionResourceType("change_request_decision"); + + ChangeRequestDecisionResourceType(String value) { + super(value, allowedValues); + } + + public static class ChangeRequestDecisionResourceTypeSerializer + extends StdSerializer { + public ChangeRequestDecisionResourceTypeSerializer(Class t) { + super(t); + } + + public ChangeRequestDecisionResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ChangeRequestDecisionResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ChangeRequestDecisionResourceType fromValue(String value) { + return new ChangeRequestDecisionResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionResponseAttributes.java new file mode 100644 index 00000000000..c0dedd7c1bd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionResponseAttributes.java @@ -0,0 +1,308 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of a change request decision in a response. */ +@JsonPropertyOrder({ + ChangeRequestDecisionResponseAttributes.JSON_PROPERTY_CHANGE_REQUEST_STATUS, + ChangeRequestDecisionResponseAttributes.JSON_PROPERTY_DECIDED_AT, + ChangeRequestDecisionResponseAttributes.JSON_PROPERTY_DECISION_REASON, + ChangeRequestDecisionResponseAttributes.JSON_PROPERTY_DELETED_AT, + ChangeRequestDecisionResponseAttributes.JSON_PROPERTY_REQUEST_REASON, + ChangeRequestDecisionResponseAttributes.JSON_PROPERTY_REQUESTED_AT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestDecisionResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CHANGE_REQUEST_STATUS = "change_request_status"; + private ChangeRequestDecisionStatusType changeRequestStatus; + + public static final String JSON_PROPERTY_DECIDED_AT = "decided_at"; + private OffsetDateTime decidedAt; + + public static final String JSON_PROPERTY_DECISION_REASON = "decision_reason"; + private String decisionReason; + + public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; + private OffsetDateTime deletedAt; + + public static final String JSON_PROPERTY_REQUEST_REASON = "request_reason"; + private String requestReason; + + public static final String JSON_PROPERTY_REQUESTED_AT = "requested_at"; + private OffsetDateTime requestedAt; + + public ChangeRequestDecisionResponseAttributes() {} + + @JsonCreator + public ChangeRequestDecisionResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CHANGE_REQUEST_STATUS) + ChangeRequestDecisionStatusType changeRequestStatus, + @JsonProperty(required = true, value = JSON_PROPERTY_DECIDED_AT) OffsetDateTime decidedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_DECISION_REASON) String decisionReason, + @JsonProperty(required = true, value = JSON_PROPERTY_DELETED_AT) OffsetDateTime deletedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_REQUEST_REASON) String requestReason, + @JsonProperty(required = true, value = JSON_PROPERTY_REQUESTED_AT) + OffsetDateTime requestedAt) { + this.changeRequestStatus = changeRequestStatus; + this.unparsed |= !changeRequestStatus.isValid(); + this.decidedAt = decidedAt; + this.decisionReason = decisionReason; + this.deletedAt = deletedAt; + this.requestReason = requestReason; + this.requestedAt = requestedAt; + } + + public ChangeRequestDecisionResponseAttributes changeRequestStatus( + ChangeRequestDecisionStatusType changeRequestStatus) { + this.changeRequestStatus = changeRequestStatus; + this.unparsed |= !changeRequestStatus.isValid(); + return this; + } + + /** + * The status of a change request decision. + * + * @return changeRequestStatus + */ + @JsonProperty(JSON_PROPERTY_CHANGE_REQUEST_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestDecisionStatusType getChangeRequestStatus() { + return changeRequestStatus; + } + + public void setChangeRequestStatus(ChangeRequestDecisionStatusType changeRequestStatus) { + if (!changeRequestStatus.isValid()) { + this.unparsed = true; + } + this.changeRequestStatus = changeRequestStatus; + } + + public ChangeRequestDecisionResponseAttributes decidedAt(OffsetDateTime decidedAt) { + this.decidedAt = decidedAt; + return this; + } + + /** + * Timestamp of when the decision was made. + * + * @return decidedAt + */ + @JsonProperty(JSON_PROPERTY_DECIDED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getDecidedAt() { + return decidedAt; + } + + public void setDecidedAt(OffsetDateTime decidedAt) { + this.decidedAt = decidedAt; + } + + public ChangeRequestDecisionResponseAttributes decisionReason(String decisionReason) { + this.decisionReason = decisionReason; + return this; + } + + /** + * The reason for the decision. + * + * @return decisionReason + */ + @JsonProperty(JSON_PROPERTY_DECISION_REASON) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDecisionReason() { + return decisionReason; + } + + public void setDecisionReason(String decisionReason) { + this.decisionReason = decisionReason; + } + + public ChangeRequestDecisionResponseAttributes deletedAt(OffsetDateTime deletedAt) { + this.deletedAt = deletedAt; + return this; + } + + /** + * Timestamp of when the decision was deleted. + * + * @return deletedAt + */ + @JsonProperty(JSON_PROPERTY_DELETED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getDeletedAt() { + return deletedAt; + } + + public void setDeletedAt(OffsetDateTime deletedAt) { + this.deletedAt = deletedAt; + } + + public ChangeRequestDecisionResponseAttributes requestReason(String requestReason) { + this.requestReason = requestReason; + return this; + } + + /** + * The reason for requesting the decision. + * + * @return requestReason + */ + @JsonProperty(JSON_PROPERTY_REQUEST_REASON) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRequestReason() { + return requestReason; + } + + public void setRequestReason(String requestReason) { + this.requestReason = requestReason; + } + + public ChangeRequestDecisionResponseAttributes requestedAt(OffsetDateTime requestedAt) { + this.requestedAt = requestedAt; + return this; + } + + /** + * Timestamp of when the decision was requested. + * + * @return requestedAt + */ + @JsonProperty(JSON_PROPERTY_REQUESTED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getRequestedAt() { + return requestedAt; + } + + public void setRequestedAt(OffsetDateTime requestedAt) { + this.requestedAt = requestedAt; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestDecisionResponseAttributes + */ + @JsonAnySetter + public ChangeRequestDecisionResponseAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestDecisionResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestDecisionResponseAttributes changeRequestDecisionResponseAttributes = + (ChangeRequestDecisionResponseAttributes) o; + return Objects.equals( + this.changeRequestStatus, changeRequestDecisionResponseAttributes.changeRequestStatus) + && Objects.equals(this.decidedAt, changeRequestDecisionResponseAttributes.decidedAt) + && Objects.equals( + this.decisionReason, changeRequestDecisionResponseAttributes.decisionReason) + && Objects.equals(this.deletedAt, changeRequestDecisionResponseAttributes.deletedAt) + && Objects.equals(this.requestReason, changeRequestDecisionResponseAttributes.requestReason) + && Objects.equals(this.requestedAt, changeRequestDecisionResponseAttributes.requestedAt) + && Objects.equals( + this.additionalProperties, + changeRequestDecisionResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + changeRequestStatus, + decidedAt, + decisionReason, + deletedAt, + requestReason, + requestedAt, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestDecisionResponseAttributes {\n"); + sb.append(" changeRequestStatus: ") + .append(toIndentedString(changeRequestStatus)) + .append("\n"); + sb.append(" decidedAt: ").append(toIndentedString(decidedAt)).append("\n"); + sb.append(" decisionReason: ").append(toIndentedString(decisionReason)).append("\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).append("\n"); + sb.append(" requestReason: ").append(toIndentedString(requestReason)).append("\n"); + sb.append(" requestedAt: ").append(toIndentedString(requestedAt)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionStatusType.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionStatusType.java new file mode 100644 index 00000000000..b0602e5d7ca --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionStatusType.java @@ -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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The status of a change request decision. */ +@JsonSerialize( + using = ChangeRequestDecisionStatusType.ChangeRequestDecisionStatusTypeSerializer.class) +public class ChangeRequestDecisionStatusType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("REQUESTED", "APPROVED", "DECLINED")); + + public static final ChangeRequestDecisionStatusType REQUESTED = + new ChangeRequestDecisionStatusType("REQUESTED"); + public static final ChangeRequestDecisionStatusType APPROVED = + new ChangeRequestDecisionStatusType("APPROVED"); + public static final ChangeRequestDecisionStatusType DECLINED = + new ChangeRequestDecisionStatusType("DECLINED"); + + ChangeRequestDecisionStatusType(String value) { + super(value, allowedValues); + } + + public static class ChangeRequestDecisionStatusTypeSerializer + extends StdSerializer { + public ChangeRequestDecisionStatusTypeSerializer(Class t) { + super(t); + } + + public ChangeRequestDecisionStatusTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ChangeRequestDecisionStatusType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ChangeRequestDecisionStatusType fromValue(String value) { + return new ChangeRequestDecisionStatusType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionUpdateData.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionUpdateData.java new file mode 100644 index 00000000000..4fbdb3401cb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionUpdateData.java @@ -0,0 +1,210 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object to update a change request decision. */ +@JsonPropertyOrder({ + ChangeRequestDecisionUpdateData.JSON_PROPERTY_ATTRIBUTES, + ChangeRequestDecisionUpdateData.JSON_PROPERTY_RELATIONSHIPS, + ChangeRequestDecisionUpdateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestDecisionUpdateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ChangeRequestDecisionUpdateDataAttributes attributes; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private ChangeRequestDecisionUpdateDataRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ChangeRequestResourceType type; + + public ChangeRequestDecisionUpdateData() {} + + @JsonCreator + public ChangeRequestDecisionUpdateData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ChangeRequestResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ChangeRequestDecisionUpdateData attributes( + ChangeRequestDecisionUpdateDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the parent change request for a decision update. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ChangeRequestDecisionUpdateDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ChangeRequestDecisionUpdateDataAttributes attributes) { + this.attributes = attributes; + } + + public ChangeRequestDecisionUpdateData relationships( + ChangeRequestDecisionUpdateDataRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships for updating a change request decision. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ChangeRequestDecisionUpdateDataRelationships getRelationships() { + return relationships; + } + + public void setRelationships(ChangeRequestDecisionUpdateDataRelationships relationships) { + this.relationships = relationships; + } + + public ChangeRequestDecisionUpdateData type(ChangeRequestResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Change request resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestResourceType getType() { + return type; + } + + public void setType(ChangeRequestResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestDecisionUpdateData + */ + @JsonAnySetter + public ChangeRequestDecisionUpdateData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestDecisionUpdateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestDecisionUpdateData changeRequestDecisionUpdateData = + (ChangeRequestDecisionUpdateData) o; + return Objects.equals(this.attributes, changeRequestDecisionUpdateData.attributes) + && Objects.equals(this.relationships, changeRequestDecisionUpdateData.relationships) + && Objects.equals(this.type, changeRequestDecisionUpdateData.type) + && Objects.equals( + this.additionalProperties, changeRequestDecisionUpdateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestDecisionUpdateData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionUpdateDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionUpdateDataAttributes.java new file mode 100644 index 00000000000..b7aa71bcf2b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionUpdateDataAttributes.java @@ -0,0 +1,138 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of the parent change request for a decision update. */ +@JsonPropertyOrder({ChangeRequestDecisionUpdateDataAttributes.JSON_PROPERTY_ID}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestDecisionUpdateDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public ChangeRequestDecisionUpdateDataAttributes id(String id) { + this.id = id; + return this; + } + + /** + * The identifier of the change request. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestDecisionUpdateDataAttributes + */ + @JsonAnySetter + public ChangeRequestDecisionUpdateDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestDecisionUpdateDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestDecisionUpdateDataAttributes changeRequestDecisionUpdateDataAttributes = + (ChangeRequestDecisionUpdateDataAttributes) o; + return Objects.equals(this.id, changeRequestDecisionUpdateDataAttributes.id) + && Objects.equals( + this.additionalProperties, + changeRequestDecisionUpdateDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestDecisionUpdateDataAttributes {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionUpdateDataRelationships.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionUpdateDataRelationships.java new file mode 100644 index 00000000000..b65f371ed05 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionUpdateDataRelationships.java @@ -0,0 +1,157 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationships for updating a change request decision. */ +@JsonPropertyOrder({ + ChangeRequestDecisionUpdateDataRelationships.JSON_PROPERTY_CHANGE_REQUEST_DECISIONS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestDecisionUpdateDataRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CHANGE_REQUEST_DECISIONS = "change_request_decisions"; + private ChangeRequestDecisionsRelationship changeRequestDecisions; + + public ChangeRequestDecisionUpdateDataRelationships() {} + + @JsonCreator + public ChangeRequestDecisionUpdateDataRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_CHANGE_REQUEST_DECISIONS) + ChangeRequestDecisionsRelationship changeRequestDecisions) { + this.changeRequestDecisions = changeRequestDecisions; + this.unparsed |= changeRequestDecisions.unparsed; + } + + public ChangeRequestDecisionUpdateDataRelationships changeRequestDecisions( + ChangeRequestDecisionsRelationship changeRequestDecisions) { + this.changeRequestDecisions = changeRequestDecisions; + this.unparsed |= changeRequestDecisions.unparsed; + return this; + } + + /** + * Relationship to change request decisions. + * + * @return changeRequestDecisions + */ + @JsonProperty(JSON_PROPERTY_CHANGE_REQUEST_DECISIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestDecisionsRelationship getChangeRequestDecisions() { + return changeRequestDecisions; + } + + public void setChangeRequestDecisions(ChangeRequestDecisionsRelationship changeRequestDecisions) { + this.changeRequestDecisions = changeRequestDecisions; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestDecisionUpdateDataRelationships + */ + @JsonAnySetter + public ChangeRequestDecisionUpdateDataRelationships putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestDecisionUpdateDataRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestDecisionUpdateDataRelationships changeRequestDecisionUpdateDataRelationships = + (ChangeRequestDecisionUpdateDataRelationships) o; + return Objects.equals( + this.changeRequestDecisions, + changeRequestDecisionUpdateDataRelationships.changeRequestDecisions) + && Objects.equals( + this.additionalProperties, + changeRequestDecisionUpdateDataRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(changeRequestDecisions, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestDecisionUpdateDataRelationships {\n"); + sb.append(" changeRequestDecisions: ") + .append(toIndentedString(changeRequestDecisions)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionUpdateRequest.java new file mode 100644 index 00000000000..d901e251985 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionUpdateRequest.java @@ -0,0 +1,193 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Request object to update a change request decision. */ +@JsonPropertyOrder({ + ChangeRequestDecisionUpdateRequest.JSON_PROPERTY_DATA, + ChangeRequestDecisionUpdateRequest.JSON_PROPERTY_INCLUDED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestDecisionUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ChangeRequestDecisionUpdateData data; + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public ChangeRequestDecisionUpdateRequest() {} + + @JsonCreator + public ChangeRequestDecisionUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ChangeRequestDecisionUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ChangeRequestDecisionUpdateRequest data(ChangeRequestDecisionUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object to update a change request decision. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestDecisionUpdateData getData() { + return data; + } + + public void setData(ChangeRequestDecisionUpdateData data) { + this.data = data; + } + + public ChangeRequestDecisionUpdateRequest included( + List included) { + this.included = included; + for (ChangeRequestDecisionCreateItem item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ChangeRequestDecisionUpdateRequest addIncludedItem( + ChangeRequestDecisionCreateItem includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Included resources for the change request update. + * + * @return included + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIncluded() { + return included; + } + + public void setIncluded(List included) { + this.included = included; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestDecisionUpdateRequest + */ + @JsonAnySetter + public ChangeRequestDecisionUpdateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestDecisionUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestDecisionUpdateRequest changeRequestDecisionUpdateRequest = + (ChangeRequestDecisionUpdateRequest) o; + return Objects.equals(this.data, changeRequestDecisionUpdateRequest.data) + && Objects.equals(this.included, changeRequestDecisionUpdateRequest.included) + && Objects.equals( + this.additionalProperties, changeRequestDecisionUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestDecisionUpdateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionsRelationship.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionsRelationship.java new file mode 100644 index 00000000000..be0eede673b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestDecisionsRelationship.java @@ -0,0 +1,158 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Relationship to change request decisions. */ +@JsonPropertyOrder({ChangeRequestDecisionsRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestDecisionsRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public ChangeRequestDecisionsRelationship() {} + + @JsonCreator + public ChangeRequestDecisionsRelationship( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + } + + public ChangeRequestDecisionsRelationship data(List data) { + this.data = data; + for (ChangeRequestDecisionRelationshipData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ChangeRequestDecisionsRelationship addDataItem( + ChangeRequestDecisionRelationshipData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of decision relationship data. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestDecisionsRelationship + */ + @JsonAnySetter + public ChangeRequestDecisionsRelationship putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestDecisionsRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestDecisionsRelationship changeRequestDecisionsRelationship = + (ChangeRequestDecisionsRelationship) o; + return Objects.equals(this.data, changeRequestDecisionsRelationship.data) + && Objects.equals( + this.additionalProperties, changeRequestDecisionsRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestDecisionsRelationship {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestIncludedDecision.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestIncludedDecision.java new file mode 100644 index 00000000000..a47ef4d16d7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestIncludedDecision.java @@ -0,0 +1,241 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** An included change request decision resource. */ +@JsonPropertyOrder({ + ChangeRequestIncludedDecision.JSON_PROPERTY_ATTRIBUTES, + ChangeRequestIncludedDecision.JSON_PROPERTY_ID, + ChangeRequestIncludedDecision.JSON_PROPERTY_RELATIONSHIPS, + ChangeRequestIncludedDecision.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestIncludedDecision { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ChangeRequestDecisionResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private ChangeRequestDecisionRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ChangeRequestDecisionResourceType type; + + public ChangeRequestIncludedDecision() {} + + @JsonCreator + public ChangeRequestIncludedDecision( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ChangeRequestDecisionResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ChangeRequestDecisionResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ChangeRequestIncludedDecision attributes( + ChangeRequestDecisionResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a change request decision in a response. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestDecisionResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ChangeRequestDecisionResponseAttributes attributes) { + this.attributes = attributes; + } + + public ChangeRequestIncludedDecision id(String id) { + this.id = id; + return this; + } + + /** + * The decision UUID. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ChangeRequestIncludedDecision relationships( + ChangeRequestDecisionRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships of a change request decision. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ChangeRequestDecisionRelationships getRelationships() { + return relationships; + } + + public void setRelationships(ChangeRequestDecisionRelationships relationships) { + this.relationships = relationships; + } + + public ChangeRequestIncludedDecision type(ChangeRequestDecisionResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Change request decision resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestDecisionResourceType getType() { + return type; + } + + public void setType(ChangeRequestDecisionResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestIncludedDecision + */ + @JsonAnySetter + public ChangeRequestIncludedDecision putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestIncludedDecision object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestIncludedDecision changeRequestIncludedDecision = (ChangeRequestIncludedDecision) o; + return Objects.equals(this.attributes, changeRequestIncludedDecision.attributes) + && Objects.equals(this.id, changeRequestIncludedDecision.id) + && Objects.equals(this.relationships, changeRequestIncludedDecision.relationships) + && Objects.equals(this.type, changeRequestIncludedDecision.type) + && Objects.equals( + this.additionalProperties, changeRequestIncludedDecision.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestIncludedDecision {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestIncludedItem.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestIncludedItem.java new file mode 100644 index 00000000000..8462e6cdac3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestIncludedItem.java @@ -0,0 +1,283 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize(using = ChangeRequestIncludedItem.ChangeRequestIncludedItemDeserializer.class) +@JsonSerialize(using = ChangeRequestIncludedItem.ChangeRequestIncludedItemSerializer.class) +public class ChangeRequestIncludedItem extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ChangeRequestIncludedItem.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class ChangeRequestIncludedItemSerializer + extends StdSerializer { + public ChangeRequestIncludedItemSerializer(Class t) { + super(t); + } + + public ChangeRequestIncludedItemSerializer() { + this(null); + } + + @Override + public void serialize( + ChangeRequestIncludedItem value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class ChangeRequestIncludedItemDeserializer + extends StdDeserializer { + public ChangeRequestIncludedItemDeserializer() { + this(ChangeRequestIncludedItem.class); + } + + public ChangeRequestIncludedItemDeserializer(Class vc) { + super(vc); + } + + @Override + public ChangeRequestIncludedItem deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize ChangeRequestIncludedUser + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ChangeRequestIncludedUser.class.equals(Integer.class) + || ChangeRequestIncludedUser.class.equals(Long.class) + || ChangeRequestIncludedUser.class.equals(Float.class) + || ChangeRequestIncludedUser.class.equals(Double.class) + || ChangeRequestIncludedUser.class.equals(Boolean.class) + || ChangeRequestIncludedUser.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((ChangeRequestIncludedUser.class.equals(Integer.class) + || ChangeRequestIncludedUser.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((ChangeRequestIncludedUser.class.equals(Float.class) + || ChangeRequestIncludedUser.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (ChangeRequestIncludedUser.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (ChangeRequestIncludedUser.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(ChangeRequestIncludedUser.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((ChangeRequestIncludedUser) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'ChangeRequestIncludedUser'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ChangeRequestIncludedUser'", e); + } + + // deserialize ChangeRequestIncludedDecision + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ChangeRequestIncludedDecision.class.equals(Integer.class) + || ChangeRequestIncludedDecision.class.equals(Long.class) + || ChangeRequestIncludedDecision.class.equals(Float.class) + || ChangeRequestIncludedDecision.class.equals(Double.class) + || ChangeRequestIncludedDecision.class.equals(Boolean.class) + || ChangeRequestIncludedDecision.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((ChangeRequestIncludedDecision.class.equals(Integer.class) + || ChangeRequestIncludedDecision.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((ChangeRequestIncludedDecision.class.equals(Float.class) + || ChangeRequestIncludedDecision.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (ChangeRequestIncludedDecision.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (ChangeRequestIncludedDecision.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(ChangeRequestIncludedDecision.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((ChangeRequestIncludedDecision) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'ChangeRequestIncludedDecision'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ChangeRequestIncludedDecision'", e); + } + + ChangeRequestIncludedItem ret = new ChangeRequestIncludedItem(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public ChangeRequestIncludedItem getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "ChangeRequestIncludedItem cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public ChangeRequestIncludedItem() { + super("oneOf", Boolean.FALSE); + } + + public ChangeRequestIncludedItem(ChangeRequestIncludedUser o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public ChangeRequestIncludedItem(ChangeRequestIncludedDecision o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("ChangeRequestIncludedUser", new GenericType() {}); + schemas.put( + "ChangeRequestIncludedDecision", new GenericType() {}); + JSON.registerDescendants(ChangeRequestIncludedItem.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return ChangeRequestIncludedItem.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: ChangeRequestIncludedUser, ChangeRequestIncludedDecision + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(ChangeRequestIncludedUser.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(ChangeRequestIncludedDecision.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( + "Invalid instance type. Must be ChangeRequestIncludedUser, ChangeRequestIncludedDecision"); + } + + /** + * Get the actual instance, which can be the following: ChangeRequestIncludedUser, + * ChangeRequestIncludedDecision + * + * @return The actual instance (ChangeRequestIncludedUser, ChangeRequestIncludedDecision) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ChangeRequestIncludedUser`. If the actual instance is not + * `ChangeRequestIncludedUser`, the ClassCastException will be thrown. + * + * @return The actual instance of `ChangeRequestIncludedUser` + * @throws ClassCastException if the instance is not `ChangeRequestIncludedUser` + */ + public ChangeRequestIncludedUser getChangeRequestIncludedUser() throws ClassCastException { + return (ChangeRequestIncludedUser) super.getActualInstance(); + } + + /** + * Get the actual instance of `ChangeRequestIncludedDecision`. If the actual instance is not + * `ChangeRequestIncludedDecision`, the ClassCastException will be thrown. + * + * @return The actual instance of `ChangeRequestIncludedDecision` + * @throws ClassCastException if the instance is not `ChangeRequestIncludedDecision` + */ + public ChangeRequestIncludedDecision getChangeRequestIncludedDecision() + throws ClassCastException { + return (ChangeRequestIncludedDecision) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestIncludedUser.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestIncludedUser.java new file mode 100644 index 00000000000..b3b833953be --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestIncludedUser.java @@ -0,0 +1,205 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** An included user resource. */ +@JsonPropertyOrder({ + ChangeRequestIncludedUser.JSON_PROPERTY_ATTRIBUTES, + ChangeRequestIncludedUser.JSON_PROPERTY_ID, + ChangeRequestIncludedUser.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestIncludedUser { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ChangeRequestIncludedUserAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public ChangeRequestIncludedUser() {} + + @JsonCreator + public ChangeRequestIncludedUser( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ChangeRequestIncludedUserAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + } + + public ChangeRequestIncludedUser attributes(ChangeRequestIncludedUserAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an included user. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestIncludedUserAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ChangeRequestIncludedUserAttributes attributes) { + this.attributes = attributes; + } + + public ChangeRequestIncludedUser id(String id) { + this.id = id; + return this; + } + + /** + * The user UUID. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ChangeRequestIncludedUser type(String type) { + this.type = type; + return this; + } + + /** + * The resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestIncludedUser + */ + @JsonAnySetter + public ChangeRequestIncludedUser putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestIncludedUser object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestIncludedUser changeRequestIncludedUser = (ChangeRequestIncludedUser) o; + return Objects.equals(this.attributes, changeRequestIncludedUser.attributes) + && Objects.equals(this.id, changeRequestIncludedUser.id) + && Objects.equals(this.type, changeRequestIncludedUser.type) + && Objects.equals( + this.additionalProperties, changeRequestIncludedUser.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestIncludedUser {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestIncludedUserAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestIncludedUserAttributes.java new file mode 100644 index 00000000000..1fb39471428 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestIncludedUserAttributes.java @@ -0,0 +1,203 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of an included user. */ +@JsonPropertyOrder({ + ChangeRequestIncludedUserAttributes.JSON_PROPERTY_EMAIL, + ChangeRequestIncludedUserAttributes.JSON_PROPERTY_HANDLE, + ChangeRequestIncludedUserAttributes.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestIncludedUserAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_HANDLE = "handle"; + private String handle; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public ChangeRequestIncludedUserAttributes() {} + + @JsonCreator + public ChangeRequestIncludedUserAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_EMAIL) String email, + @JsonProperty(required = true, value = JSON_PROPERTY_HANDLE) String handle, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.email = email; + this.handle = handle; + this.name = name; + } + + public ChangeRequestIncludedUserAttributes email(String email) { + this.email = email; + return this; + } + + /** + * The email of the user. + * + * @return email + */ + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public ChangeRequestIncludedUserAttributes handle(String handle) { + this.handle = handle; + return this; + } + + /** + * The handle of the user. + * + * @return handle + */ + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public ChangeRequestIncludedUserAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the user. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestIncludedUserAttributes + */ + @JsonAnySetter + public ChangeRequestIncludedUserAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestIncludedUserAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestIncludedUserAttributes changeRequestIncludedUserAttributes = + (ChangeRequestIncludedUserAttributes) o; + return Objects.equals(this.email, changeRequestIncludedUserAttributes.email) + && Objects.equals(this.handle, changeRequestIncludedUserAttributes.handle) + && Objects.equals(this.name, changeRequestIncludedUserAttributes.name) + && Objects.equals( + this.additionalProperties, changeRequestIncludedUserAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, handle, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestIncludedUserAttributes {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestRelationships.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestRelationships.java new file mode 100644 index 00000000000..a357f07f874 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestRelationships.java @@ -0,0 +1,215 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationships of a change request. */ +@JsonPropertyOrder({ + ChangeRequestRelationships.JSON_PROPERTY_CHANGE_REQUEST_DECISIONS, + ChangeRequestRelationships.JSON_PROPERTY_CREATED_BY, + ChangeRequestRelationships.JSON_PROPERTY_MODIFIED_BY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CHANGE_REQUEST_DECISIONS = "change_request_decisions"; + private ChangeRequestDecisionsRelationship changeRequestDecisions; + + public static final String JSON_PROPERTY_CREATED_BY = "created_by"; + private ChangeRequestUserRelationship createdBy; + + public static final String JSON_PROPERTY_MODIFIED_BY = "modified_by"; + private ChangeRequestUserRelationship modifiedBy; + + public ChangeRequestRelationships() {} + + @JsonCreator + public ChangeRequestRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_CHANGE_REQUEST_DECISIONS) + ChangeRequestDecisionsRelationship changeRequestDecisions, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_BY) + ChangeRequestUserRelationship createdBy, + @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_BY) + ChangeRequestUserRelationship modifiedBy) { + this.changeRequestDecisions = changeRequestDecisions; + this.unparsed |= changeRequestDecisions.unparsed; + this.createdBy = createdBy; + this.unparsed |= createdBy.unparsed; + this.modifiedBy = modifiedBy; + this.unparsed |= modifiedBy.unparsed; + } + + public ChangeRequestRelationships changeRequestDecisions( + ChangeRequestDecisionsRelationship changeRequestDecisions) { + this.changeRequestDecisions = changeRequestDecisions; + this.unparsed |= changeRequestDecisions.unparsed; + return this; + } + + /** + * Relationship to change request decisions. + * + * @return changeRequestDecisions + */ + @JsonProperty(JSON_PROPERTY_CHANGE_REQUEST_DECISIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestDecisionsRelationship getChangeRequestDecisions() { + return changeRequestDecisions; + } + + public void setChangeRequestDecisions(ChangeRequestDecisionsRelationship changeRequestDecisions) { + this.changeRequestDecisions = changeRequestDecisions; + } + + public ChangeRequestRelationships createdBy(ChangeRequestUserRelationship createdBy) { + this.createdBy = createdBy; + this.unparsed |= createdBy.unparsed; + return this; + } + + /** + * Relationship to a user. + * + * @return createdBy + */ + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestUserRelationship getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(ChangeRequestUserRelationship createdBy) { + this.createdBy = createdBy; + } + + public ChangeRequestRelationships modifiedBy(ChangeRequestUserRelationship modifiedBy) { + this.modifiedBy = modifiedBy; + this.unparsed |= modifiedBy.unparsed; + return this; + } + + /** + * Relationship to a user. + * + * @return modifiedBy + */ + @JsonProperty(JSON_PROPERTY_MODIFIED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestUserRelationship getModifiedBy() { + return modifiedBy; + } + + public void setModifiedBy(ChangeRequestUserRelationship modifiedBy) { + this.modifiedBy = modifiedBy; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestRelationships + */ + @JsonAnySetter + public ChangeRequestRelationships putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestRelationships changeRequestRelationships = (ChangeRequestRelationships) o; + return Objects.equals( + this.changeRequestDecisions, changeRequestRelationships.changeRequestDecisions) + && Objects.equals(this.createdBy, changeRequestRelationships.createdBy) + && Objects.equals(this.modifiedBy, changeRequestRelationships.modifiedBy) + && Objects.equals( + this.additionalProperties, changeRequestRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(changeRequestDecisions, createdBy, modifiedBy, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestRelationships {\n"); + sb.append(" changeRequestDecisions: ") + .append(toIndentedString(changeRequestDecisions)) + .append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" modifiedBy: ").append(toIndentedString(modifiedBy)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestResourceType.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestResourceType.java new file mode 100644 index 00000000000..416166bce98 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestResourceType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Change request resource type. */ +@JsonSerialize(using = ChangeRequestResourceType.ChangeRequestResourceTypeSerializer.class) +public class ChangeRequestResourceType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("change_request")); + + public static final ChangeRequestResourceType CHANGE_REQUEST = + new ChangeRequestResourceType("change_request"); + + ChangeRequestResourceType(String value) { + super(value, allowedValues); + } + + public static class ChangeRequestResourceTypeSerializer + extends StdSerializer { + public ChangeRequestResourceTypeSerializer(Class t) { + super(t); + } + + public ChangeRequestResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ChangeRequestResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ChangeRequestResourceType fromValue(String value) { + return new ChangeRequestResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestResponse.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestResponse.java new file mode 100644 index 00000000000..c214f3b7776 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestResponse.java @@ -0,0 +1,188 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response object for a change request. */ +@JsonPropertyOrder({ + ChangeRequestResponse.JSON_PROPERTY_DATA, + ChangeRequestResponse.JSON_PROPERTY_INCLUDED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ChangeRequestResponseData data; + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public ChangeRequestResponse() {} + + @JsonCreator + public ChangeRequestResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) ChangeRequestResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ChangeRequestResponse data(ChangeRequestResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for a change request response. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestResponseData getData() { + return data; + } + + public void setData(ChangeRequestResponseData data) { + this.data = data; + } + + public ChangeRequestResponse included(List included) { + this.included = included; + for (ChangeRequestIncludedItem item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ChangeRequestResponse addIncludedItem(ChangeRequestIncludedItem includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Included resources related to the change request. + * + * @return included + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIncluded() { + return included; + } + + public void setIncluded(List included) { + this.included = included; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestResponse + */ + @JsonAnySetter + public ChangeRequestResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestResponse changeRequestResponse = (ChangeRequestResponse) o; + return Objects.equals(this.data, changeRequestResponse.data) + && Objects.equals(this.included, changeRequestResponse.included) + && Objects.equals(this.additionalProperties, changeRequestResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestResponseAttributes.java new file mode 100644 index 00000000000..c5a0cac53ba --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestResponseAttributes.java @@ -0,0 +1,756 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Attributes of a change request response. */ +@JsonPropertyOrder({ + ChangeRequestResponseAttributes.JSON_PROPERTY_ARCHIVED_AT, + ChangeRequestResponseAttributes.JSON_PROPERTY_ATTRIBUTES, + ChangeRequestResponseAttributes.JSON_PROPERTY_CHANGE_REQUEST_LINKED_INCIDENT_UUID, + ChangeRequestResponseAttributes.JSON_PROPERTY_CHANGE_REQUEST_MAINTENANCE_WINDOW_QUERY, + ChangeRequestResponseAttributes.JSON_PROPERTY_CHANGE_REQUEST_PLAN, + ChangeRequestResponseAttributes.JSON_PROPERTY_CHANGE_REQUEST_RISK, + ChangeRequestResponseAttributes.JSON_PROPERTY_CHANGE_REQUEST_TYPE, + ChangeRequestResponseAttributes.JSON_PROPERTY_CLOSED_AT, + ChangeRequestResponseAttributes.JSON_PROPERTY_CREATED_AT, + ChangeRequestResponseAttributes.JSON_PROPERTY_CREATION_SOURCE, + ChangeRequestResponseAttributes.JSON_PROPERTY_DESCRIPTION, + ChangeRequestResponseAttributes.JSON_PROPERTY_END_DATE, + ChangeRequestResponseAttributes.JSON_PROPERTY_KEY, + ChangeRequestResponseAttributes.JSON_PROPERTY_MODIFIED_AT, + ChangeRequestResponseAttributes.JSON_PROPERTY_PLAN_NOTEBOOK_ID, + ChangeRequestResponseAttributes.JSON_PROPERTY_PRIORITY, + ChangeRequestResponseAttributes.JSON_PROPERTY_PROJECT_ID, + ChangeRequestResponseAttributes.JSON_PROPERTY_START_DATE, + ChangeRequestResponseAttributes.JSON_PROPERTY_STATUS, + ChangeRequestResponseAttributes.JSON_PROPERTY_TITLE, + ChangeRequestResponseAttributes.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ARCHIVED_AT = "archived_at"; + private JsonNullable archivedAt = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private Map> attributes = new HashMap>(); + + public static final String JSON_PROPERTY_CHANGE_REQUEST_LINKED_INCIDENT_UUID = + "change_request_linked_incident_uuid"; + private String changeRequestLinkedIncidentUuid; + + public static final String JSON_PROPERTY_CHANGE_REQUEST_MAINTENANCE_WINDOW_QUERY = + "change_request_maintenance_window_query"; + private String changeRequestMaintenanceWindowQuery; + + public static final String JSON_PROPERTY_CHANGE_REQUEST_PLAN = "change_request_plan"; + private String changeRequestPlan; + + public static final String JSON_PROPERTY_CHANGE_REQUEST_RISK = "change_request_risk"; + private ChangeRequestRiskLevel changeRequestRisk; + + public static final String JSON_PROPERTY_CHANGE_REQUEST_TYPE = "change_request_type"; + private ChangeRequestChangeType changeRequestType; + + public static final String JSON_PROPERTY_CLOSED_AT = "closed_at"; + private JsonNullable closedAt = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_CREATION_SOURCE = "creation_source"; + private String creationSource; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_END_DATE = "end_date"; + private OffsetDateTime endDate; + + public static final String JSON_PROPERTY_KEY = "key"; + private String key; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private OffsetDateTime modifiedAt; + + public static final String JSON_PROPERTY_PLAN_NOTEBOOK_ID = "plan_notebook_id"; + private Long planNotebookId; + + public static final String JSON_PROPERTY_PRIORITY = "priority"; + private String priority; + + public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; + private String projectId; + + public static final String JSON_PROPERTY_START_DATE = "start_date"; + private OffsetDateTime startDate; + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public ChangeRequestResponseAttributes() {} + + @JsonCreator + public ChangeRequestResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + Map> attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_CHANGE_REQUEST_LINKED_INCIDENT_UUID) + String changeRequestLinkedIncidentUuid, + @JsonProperty(required = true, value = JSON_PROPERTY_CHANGE_REQUEST_MAINTENANCE_WINDOW_QUERY) + String changeRequestMaintenanceWindowQuery, + @JsonProperty(required = true, value = JSON_PROPERTY_CHANGE_REQUEST_PLAN) + String changeRequestPlan, + @JsonProperty(required = true, value = JSON_PROPERTY_CHANGE_REQUEST_RISK) + ChangeRequestRiskLevel changeRequestRisk, + @JsonProperty(required = true, value = JSON_PROPERTY_CHANGE_REQUEST_TYPE) + ChangeRequestChangeType changeRequestType, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATION_SOURCE) String creationSource, + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description, + @JsonProperty(required = true, value = JSON_PROPERTY_KEY) String key, + @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_AT) OffsetDateTime modifiedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_PLAN_NOTEBOOK_ID) Long planNotebookId, + @JsonProperty(required = true, value = JSON_PROPERTY_PRIORITY) String priority, + @JsonProperty(required = true, value = JSON_PROPERTY_PROJECT_ID) String projectId, + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) String status, + @JsonProperty(required = true, value = JSON_PROPERTY_TITLE) String title, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.attributes = attributes; + this.changeRequestLinkedIncidentUuid = changeRequestLinkedIncidentUuid; + this.changeRequestMaintenanceWindowQuery = changeRequestMaintenanceWindowQuery; + this.changeRequestPlan = changeRequestPlan; + this.changeRequestRisk = changeRequestRisk; + this.unparsed |= !changeRequestRisk.isValid(); + this.changeRequestType = changeRequestType; + this.unparsed |= !changeRequestType.isValid(); + this.createdAt = createdAt; + this.creationSource = creationSource; + this.description = description; + this.key = key; + this.modifiedAt = modifiedAt; + this.planNotebookId = planNotebookId; + this.priority = priority; + this.projectId = projectId; + this.status = status; + this.title = title; + this.type = type; + } + + /** + * Timestamp of when the change request was archived. + * + * @return archivedAt + */ + @jakarta.annotation.Nullable + @JsonIgnore + public OffsetDateTime getArchivedAt() { + + if (archivedAt == null) { + archivedAt = JsonNullable.undefined(); + } + return archivedAt.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ARCHIVED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getArchivedAt_JsonNullable() { + return archivedAt; + } + + @JsonProperty(JSON_PROPERTY_ARCHIVED_AT) + private void setArchivedAt_JsonNullable(JsonNullable archivedAt) { + this.archivedAt = archivedAt; + } + + public ChangeRequestResponseAttributes attributes(Map> attributes) { + this.attributes = attributes; + return this; + } + + public ChangeRequestResponseAttributes putAttributesItem( + String key, List attributesItem) { + this.attributes.put(key, attributesItem); + return this; + } + + /** + * Custom attributes of the change request as key-value pairs. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Map> getAttributes() { + return attributes; + } + + public void setAttributes(Map> attributes) { + this.attributes = attributes; + } + + public ChangeRequestResponseAttributes changeRequestLinkedIncidentUuid( + String changeRequestLinkedIncidentUuid) { + this.changeRequestLinkedIncidentUuid = changeRequestLinkedIncidentUuid; + return this; + } + + /** + * The UUID of the linked incident. + * + * @return changeRequestLinkedIncidentUuid + */ + @JsonProperty(JSON_PROPERTY_CHANGE_REQUEST_LINKED_INCIDENT_UUID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getChangeRequestLinkedIncidentUuid() { + return changeRequestLinkedIncidentUuid; + } + + public void setChangeRequestLinkedIncidentUuid(String changeRequestLinkedIncidentUuid) { + this.changeRequestLinkedIncidentUuid = changeRequestLinkedIncidentUuid; + } + + public ChangeRequestResponseAttributes changeRequestMaintenanceWindowQuery( + String changeRequestMaintenanceWindowQuery) { + this.changeRequestMaintenanceWindowQuery = changeRequestMaintenanceWindowQuery; + return this; + } + + /** + * The maintenance window query for the change request. + * + * @return changeRequestMaintenanceWindowQuery + */ + @JsonProperty(JSON_PROPERTY_CHANGE_REQUEST_MAINTENANCE_WINDOW_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getChangeRequestMaintenanceWindowQuery() { + return changeRequestMaintenanceWindowQuery; + } + + public void setChangeRequestMaintenanceWindowQuery(String changeRequestMaintenanceWindowQuery) { + this.changeRequestMaintenanceWindowQuery = changeRequestMaintenanceWindowQuery; + } + + public ChangeRequestResponseAttributes changeRequestPlan(String changeRequestPlan) { + this.changeRequestPlan = changeRequestPlan; + return this; + } + + /** + * The plan associated with the change request. + * + * @return changeRequestPlan + */ + @JsonProperty(JSON_PROPERTY_CHANGE_REQUEST_PLAN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getChangeRequestPlan() { + return changeRequestPlan; + } + + public void setChangeRequestPlan(String changeRequestPlan) { + this.changeRequestPlan = changeRequestPlan; + } + + public ChangeRequestResponseAttributes changeRequestRisk( + ChangeRequestRiskLevel changeRequestRisk) { + this.changeRequestRisk = changeRequestRisk; + this.unparsed |= !changeRequestRisk.isValid(); + return this; + } + + /** + * The risk level of the change request. + * + * @return changeRequestRisk + */ + @JsonProperty(JSON_PROPERTY_CHANGE_REQUEST_RISK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestRiskLevel getChangeRequestRisk() { + return changeRequestRisk; + } + + public void setChangeRequestRisk(ChangeRequestRiskLevel changeRequestRisk) { + if (!changeRequestRisk.isValid()) { + this.unparsed = true; + } + this.changeRequestRisk = changeRequestRisk; + } + + public ChangeRequestResponseAttributes changeRequestType( + ChangeRequestChangeType changeRequestType) { + this.changeRequestType = changeRequestType; + this.unparsed |= !changeRequestType.isValid(); + return this; + } + + /** + * The type of the change request. + * + * @return changeRequestType + */ + @JsonProperty(JSON_PROPERTY_CHANGE_REQUEST_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestChangeType getChangeRequestType() { + return changeRequestType; + } + + public void setChangeRequestType(ChangeRequestChangeType changeRequestType) { + if (!changeRequestType.isValid()) { + this.unparsed = true; + } + this.changeRequestType = changeRequestType; + } + + /** + * Timestamp of when the change request was closed. + * + * @return closedAt + */ + @jakarta.annotation.Nullable + @JsonIgnore + public OffsetDateTime getClosedAt() { + + if (closedAt == null) { + closedAt = JsonNullable.undefined(); + } + return closedAt.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_CLOSED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getClosedAt_JsonNullable() { + return closedAt; + } + + @JsonProperty(JSON_PROPERTY_CLOSED_AT) + private void setClosedAt_JsonNullable(JsonNullable closedAt) { + this.closedAt = closedAt; + } + + /** + * Timestamp of when the change request was created. + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public ChangeRequestResponseAttributes creationSource(String creationSource) { + this.creationSource = creationSource; + return this; + } + + /** + * The source from which the change request was created. + * + * @return creationSource + */ + @JsonProperty(JSON_PROPERTY_CREATION_SOURCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCreationSource() { + return creationSource; + } + + public void setCreationSource(String creationSource) { + this.creationSource = creationSource; + } + + public ChangeRequestResponseAttributes description(String description) { + this.description = description; + return this; + } + + /** + * The description of the change request. + * + * @return description + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public ChangeRequestResponseAttributes endDate(OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * The planned end date of the change request. + * + * @return endDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getEndDate() { + return endDate; + } + + public void setEndDate(OffsetDateTime endDate) { + this.endDate = endDate; + } + + public ChangeRequestResponseAttributes key(String key) { + this.key = key; + return this; + } + + /** + * The human-readable key of the change request. + * + * @return key + */ + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + /** + * Timestamp of when the change request was last modified. + * + * @return modifiedAt + */ + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + public ChangeRequestResponseAttributes planNotebookId(Long planNotebookId) { + this.planNotebookId = planNotebookId; + return this; + } + + /** + * The notebook ID associated with the change request plan. + * + * @return planNotebookId + */ + @JsonProperty(JSON_PROPERTY_PLAN_NOTEBOOK_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getPlanNotebookId() { + return planNotebookId; + } + + public void setPlanNotebookId(Long planNotebookId) { + this.planNotebookId = planNotebookId; + } + + public ChangeRequestResponseAttributes priority(String priority) { + this.priority = priority; + return this; + } + + /** + * The priority of the change request. + * + * @return priority + */ + @JsonProperty(JSON_PROPERTY_PRIORITY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPriority() { + return priority; + } + + public void setPriority(String priority) { + this.priority = priority; + } + + public ChangeRequestResponseAttributes projectId(String projectId) { + this.projectId = projectId; + return this; + } + + /** + * The project UUID associated with the change request. + * + * @return projectId + */ + @JsonProperty(JSON_PROPERTY_PROJECT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public ChangeRequestResponseAttributes startDate(OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * The planned start date of the change request. + * + * @return startDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(OffsetDateTime startDate) { + this.startDate = startDate; + } + + public ChangeRequestResponseAttributes status(String status) { + this.status = status; + return this; + } + + /** + * The current status of the change request. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public ChangeRequestResponseAttributes title(String title) { + this.title = title; + return this; + } + + /** + * The title of the change request. + * + * @return title + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public ChangeRequestResponseAttributes type(String type) { + this.type = type; + return this; + } + + /** + * The case type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestResponseAttributes + */ + @JsonAnySetter + public ChangeRequestResponseAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestResponseAttributes changeRequestResponseAttributes = + (ChangeRequestResponseAttributes) o; + return Objects.equals(this.archivedAt, changeRequestResponseAttributes.archivedAt) + && Objects.equals(this.attributes, changeRequestResponseAttributes.attributes) + && Objects.equals( + this.changeRequestLinkedIncidentUuid, + changeRequestResponseAttributes.changeRequestLinkedIncidentUuid) + && Objects.equals( + this.changeRequestMaintenanceWindowQuery, + changeRequestResponseAttributes.changeRequestMaintenanceWindowQuery) + && Objects.equals(this.changeRequestPlan, changeRequestResponseAttributes.changeRequestPlan) + && Objects.equals(this.changeRequestRisk, changeRequestResponseAttributes.changeRequestRisk) + && Objects.equals(this.changeRequestType, changeRequestResponseAttributes.changeRequestType) + && Objects.equals(this.closedAt, changeRequestResponseAttributes.closedAt) + && Objects.equals(this.createdAt, changeRequestResponseAttributes.createdAt) + && Objects.equals(this.creationSource, changeRequestResponseAttributes.creationSource) + && Objects.equals(this.description, changeRequestResponseAttributes.description) + && Objects.equals(this.endDate, changeRequestResponseAttributes.endDate) + && Objects.equals(this.key, changeRequestResponseAttributes.key) + && Objects.equals(this.modifiedAt, changeRequestResponseAttributes.modifiedAt) + && Objects.equals(this.planNotebookId, changeRequestResponseAttributes.planNotebookId) + && Objects.equals(this.priority, changeRequestResponseAttributes.priority) + && Objects.equals(this.projectId, changeRequestResponseAttributes.projectId) + && Objects.equals(this.startDate, changeRequestResponseAttributes.startDate) + && Objects.equals(this.status, changeRequestResponseAttributes.status) + && Objects.equals(this.title, changeRequestResponseAttributes.title) + && Objects.equals(this.type, changeRequestResponseAttributes.type) + && Objects.equals( + this.additionalProperties, changeRequestResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + archivedAt, + attributes, + changeRequestLinkedIncidentUuid, + changeRequestMaintenanceWindowQuery, + changeRequestPlan, + changeRequestRisk, + changeRequestType, + closedAt, + createdAt, + creationSource, + description, + endDate, + key, + modifiedAt, + planNotebookId, + priority, + projectId, + startDate, + status, + title, + type, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestResponseAttributes {\n"); + sb.append(" archivedAt: ").append(toIndentedString(archivedAt)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" changeRequestLinkedIncidentUuid: ") + .append(toIndentedString(changeRequestLinkedIncidentUuid)) + .append("\n"); + sb.append(" changeRequestMaintenanceWindowQuery: ") + .append(toIndentedString(changeRequestMaintenanceWindowQuery)) + .append("\n"); + sb.append(" changeRequestPlan: ").append(toIndentedString(changeRequestPlan)).append("\n"); + sb.append(" changeRequestRisk: ").append(toIndentedString(changeRequestRisk)).append("\n"); + sb.append(" changeRequestType: ").append(toIndentedString(changeRequestType)).append("\n"); + sb.append(" closedAt: ").append(toIndentedString(closedAt)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" creationSource: ").append(toIndentedString(creationSource)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" planNotebookId: ").append(toIndentedString(planNotebookId)).append("\n"); + sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); + sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestResponseData.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestResponseData.java new file mode 100644 index 00000000000..aae773e76f6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestResponseData.java @@ -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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for a change request response. */ +@JsonPropertyOrder({ + ChangeRequestResponseData.JSON_PROPERTY_ATTRIBUTES, + ChangeRequestResponseData.JSON_PROPERTY_ID, + ChangeRequestResponseData.JSON_PROPERTY_RELATIONSHIPS, + ChangeRequestResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ChangeRequestResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private ChangeRequestRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ChangeRequestResourceType type; + + public ChangeRequestResponseData() {} + + @JsonCreator + public ChangeRequestResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ChangeRequestResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ChangeRequestResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ChangeRequestResponseData attributes(ChangeRequestResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a change request response. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ChangeRequestResponseAttributes attributes) { + this.attributes = attributes; + } + + public ChangeRequestResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The identifier of the change request. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ChangeRequestResponseData relationships(ChangeRequestRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships of a change request. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ChangeRequestRelationships getRelationships() { + return relationships; + } + + public void setRelationships(ChangeRequestRelationships relationships) { + this.relationships = relationships; + } + + public ChangeRequestResponseData type(ChangeRequestResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Change request resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestResourceType getType() { + return type; + } + + public void setType(ChangeRequestResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestResponseData + */ + @JsonAnySetter + public ChangeRequestResponseData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestResponseData changeRequestResponseData = (ChangeRequestResponseData) o; + return Objects.equals(this.attributes, changeRequestResponseData.attributes) + && Objects.equals(this.id, changeRequestResponseData.id) + && Objects.equals(this.relationships, changeRequestResponseData.relationships) + && Objects.equals(this.type, changeRequestResponseData.type) + && Objects.equals( + this.additionalProperties, changeRequestResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestRiskLevel.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestRiskLevel.java new file mode 100644 index 00000000000..641e84f4adf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestRiskLevel.java @@ -0,0 +1,59 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The risk level of the change request. */ +@JsonSerialize(using = ChangeRequestRiskLevel.ChangeRequestRiskLevelSerializer.class) +public class ChangeRequestRiskLevel extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("UNDEFINED", "LOW", "MEDIUM", "HIGH")); + + public static final ChangeRequestRiskLevel UNDEFINED = new ChangeRequestRiskLevel("UNDEFINED"); + public static final ChangeRequestRiskLevel LOW = new ChangeRequestRiskLevel("LOW"); + public static final ChangeRequestRiskLevel MEDIUM = new ChangeRequestRiskLevel("MEDIUM"); + public static final ChangeRequestRiskLevel HIGH = new ChangeRequestRiskLevel("HIGH"); + + ChangeRequestRiskLevel(String value) { + super(value, allowedValues); + } + + public static class ChangeRequestRiskLevelSerializer + extends StdSerializer { + public ChangeRequestRiskLevelSerializer(Class t) { + super(t); + } + + public ChangeRequestRiskLevelSerializer() { + this(null); + } + + @Override + public void serialize( + ChangeRequestRiskLevel value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ChangeRequestRiskLevel fromValue(String value) { + return new ChangeRequestRiskLevel(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestUpdateAttributes.java new file mode 100644 index 00000000000..351c5741007 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestUpdateAttributes.java @@ -0,0 +1,290 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for updating a change request. */ +@JsonPropertyOrder({ + ChangeRequestUpdateAttributes.JSON_PROPERTY_CHANGE_REQUEST_PLAN, + ChangeRequestUpdateAttributes.JSON_PROPERTY_CHANGE_REQUEST_RISK, + ChangeRequestUpdateAttributes.JSON_PROPERTY_CHANGE_REQUEST_TYPE, + ChangeRequestUpdateAttributes.JSON_PROPERTY_END_DATE, + ChangeRequestUpdateAttributes.JSON_PROPERTY_ID, + ChangeRequestUpdateAttributes.JSON_PROPERTY_START_DATE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestUpdateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CHANGE_REQUEST_PLAN = "change_request_plan"; + private String changeRequestPlan; + + public static final String JSON_PROPERTY_CHANGE_REQUEST_RISK = "change_request_risk"; + private ChangeRequestRiskLevel changeRequestRisk; + + public static final String JSON_PROPERTY_CHANGE_REQUEST_TYPE = "change_request_type"; + private ChangeRequestChangeType changeRequestType; + + public static final String JSON_PROPERTY_END_DATE = "end_date"; + private OffsetDateTime endDate; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_START_DATE = "start_date"; + private OffsetDateTime startDate; + + public ChangeRequestUpdateAttributes changeRequestPlan(String changeRequestPlan) { + this.changeRequestPlan = changeRequestPlan; + return this; + } + + /** + * The plan associated with the change request. + * + * @return changeRequestPlan + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANGE_REQUEST_PLAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChangeRequestPlan() { + return changeRequestPlan; + } + + public void setChangeRequestPlan(String changeRequestPlan) { + this.changeRequestPlan = changeRequestPlan; + } + + public ChangeRequestUpdateAttributes changeRequestRisk(ChangeRequestRiskLevel changeRequestRisk) { + this.changeRequestRisk = changeRequestRisk; + this.unparsed |= !changeRequestRisk.isValid(); + return this; + } + + /** + * The risk level of the change request. + * + * @return changeRequestRisk + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANGE_REQUEST_RISK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ChangeRequestRiskLevel getChangeRequestRisk() { + return changeRequestRisk; + } + + public void setChangeRequestRisk(ChangeRequestRiskLevel changeRequestRisk) { + if (!changeRequestRisk.isValid()) { + this.unparsed = true; + } + this.changeRequestRisk = changeRequestRisk; + } + + public ChangeRequestUpdateAttributes changeRequestType( + ChangeRequestChangeType changeRequestType) { + this.changeRequestType = changeRequestType; + this.unparsed |= !changeRequestType.isValid(); + return this; + } + + /** + * The type of the change request. + * + * @return changeRequestType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANGE_REQUEST_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ChangeRequestChangeType getChangeRequestType() { + return changeRequestType; + } + + public void setChangeRequestType(ChangeRequestChangeType changeRequestType) { + if (!changeRequestType.isValid()) { + this.unparsed = true; + } + this.changeRequestType = changeRequestType; + } + + public ChangeRequestUpdateAttributes endDate(OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * The planned end date of the change request. + * + * @return endDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getEndDate() { + return endDate; + } + + public void setEndDate(OffsetDateTime endDate) { + this.endDate = endDate; + } + + public ChangeRequestUpdateAttributes id(String id) { + this.id = id; + return this; + } + + /** + * The identifier of the change request to update. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ChangeRequestUpdateAttributes startDate(OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * The planned start date of the change request. + * + * @return startDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(OffsetDateTime startDate) { + this.startDate = startDate; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestUpdateAttributes + */ + @JsonAnySetter + public ChangeRequestUpdateAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestUpdateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestUpdateAttributes changeRequestUpdateAttributes = (ChangeRequestUpdateAttributes) o; + return Objects.equals(this.changeRequestPlan, changeRequestUpdateAttributes.changeRequestPlan) + && Objects.equals(this.changeRequestRisk, changeRequestUpdateAttributes.changeRequestRisk) + && Objects.equals(this.changeRequestType, changeRequestUpdateAttributes.changeRequestType) + && Objects.equals(this.endDate, changeRequestUpdateAttributes.endDate) + && Objects.equals(this.id, changeRequestUpdateAttributes.id) + && Objects.equals(this.startDate, changeRequestUpdateAttributes.startDate) + && Objects.equals( + this.additionalProperties, changeRequestUpdateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + changeRequestPlan, + changeRequestRisk, + changeRequestType, + endDate, + id, + startDate, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestUpdateAttributes {\n"); + sb.append(" changeRequestPlan: ").append(toIndentedString(changeRequestPlan)).append("\n"); + sb.append(" changeRequestRisk: ").append(toIndentedString(changeRequestRisk)).append("\n"); + sb.append(" changeRequestType: ").append(toIndentedString(changeRequestType)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestUpdateData.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestUpdateData.java new file mode 100644 index 00000000000..36dfe368910 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestUpdateData.java @@ -0,0 +1,206 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object to update a change request. */ +@JsonPropertyOrder({ + ChangeRequestUpdateData.JSON_PROPERTY_ATTRIBUTES, + ChangeRequestUpdateData.JSON_PROPERTY_RELATIONSHIPS, + ChangeRequestUpdateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestUpdateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ChangeRequestUpdateAttributes attributes; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private ChangeRequestUpdateRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ChangeRequestResourceType type; + + public ChangeRequestUpdateData() {} + + @JsonCreator + public ChangeRequestUpdateData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ChangeRequestResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ChangeRequestUpdateData attributes(ChangeRequestUpdateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for updating a change request. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ChangeRequestUpdateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ChangeRequestUpdateAttributes attributes) { + this.attributes = attributes; + } + + public ChangeRequestUpdateData relationships(ChangeRequestUpdateRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships for updating a change request. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ChangeRequestUpdateRelationships getRelationships() { + return relationships; + } + + public void setRelationships(ChangeRequestUpdateRelationships relationships) { + this.relationships = relationships; + } + + public ChangeRequestUpdateData type(ChangeRequestResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Change request resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestResourceType getType() { + return type; + } + + public void setType(ChangeRequestResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestUpdateData + */ + @JsonAnySetter + public ChangeRequestUpdateData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestUpdateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestUpdateData changeRequestUpdateData = (ChangeRequestUpdateData) o; + return Objects.equals(this.attributes, changeRequestUpdateData.attributes) + && Objects.equals(this.relationships, changeRequestUpdateData.relationships) + && Objects.equals(this.type, changeRequestUpdateData.type) + && Objects.equals(this.additionalProperties, changeRequestUpdateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestUpdateData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestUpdateRelationships.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestUpdateRelationships.java new file mode 100644 index 00000000000..fa96d6dd6ed --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestUpdateRelationships.java @@ -0,0 +1,142 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationships for updating a change request. */ +@JsonPropertyOrder({ChangeRequestUpdateRelationships.JSON_PROPERTY_CHANGE_REQUEST_DECISIONS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestUpdateRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CHANGE_REQUEST_DECISIONS = "change_request_decisions"; + private ChangeRequestDecisionsRelationship changeRequestDecisions; + + public ChangeRequestUpdateRelationships changeRequestDecisions( + ChangeRequestDecisionsRelationship changeRequestDecisions) { + this.changeRequestDecisions = changeRequestDecisions; + this.unparsed |= changeRequestDecisions.unparsed; + return this; + } + + /** + * Relationship to change request decisions. + * + * @return changeRequestDecisions + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANGE_REQUEST_DECISIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ChangeRequestDecisionsRelationship getChangeRequestDecisions() { + return changeRequestDecisions; + } + + public void setChangeRequestDecisions(ChangeRequestDecisionsRelationship changeRequestDecisions) { + this.changeRequestDecisions = changeRequestDecisions; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestUpdateRelationships + */ + @JsonAnySetter + public ChangeRequestUpdateRelationships putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestUpdateRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestUpdateRelationships changeRequestUpdateRelationships = + (ChangeRequestUpdateRelationships) o; + return Objects.equals( + this.changeRequestDecisions, changeRequestUpdateRelationships.changeRequestDecisions) + && Objects.equals( + this.additionalProperties, changeRequestUpdateRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(changeRequestDecisions, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestUpdateRelationships {\n"); + sb.append(" changeRequestDecisions: ") + .append(toIndentedString(changeRequestDecisions)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestUpdateRequest.java new file mode 100644 index 00000000000..306747ad6d8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestUpdateRequest.java @@ -0,0 +1,189 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Request object to update a change request. */ +@JsonPropertyOrder({ + ChangeRequestUpdateRequest.JSON_PROPERTY_DATA, + ChangeRequestUpdateRequest.JSON_PROPERTY_INCLUDED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ChangeRequestUpdateData data; + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public ChangeRequestUpdateRequest() {} + + @JsonCreator + public ChangeRequestUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) ChangeRequestUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ChangeRequestUpdateRequest data(ChangeRequestUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object to update a change request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestUpdateData getData() { + return data; + } + + public void setData(ChangeRequestUpdateData data) { + this.data = data; + } + + public ChangeRequestUpdateRequest included(List included) { + this.included = included; + for (ChangeRequestDecisionCreateItem item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ChangeRequestUpdateRequest addIncludedItem(ChangeRequestDecisionCreateItem includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Included resources for the change request update. + * + * @return included + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIncluded() { + return included; + } + + public void setIncluded(List included) { + this.included = included; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestUpdateRequest + */ + @JsonAnySetter + public ChangeRequestUpdateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestUpdateRequest changeRequestUpdateRequest = (ChangeRequestUpdateRequest) o; + return Objects.equals(this.data, changeRequestUpdateRequest.data) + && Objects.equals(this.included, changeRequestUpdateRequest.included) + && Objects.equals( + this.additionalProperties, changeRequestUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestUpdateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestUserRelationship.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestUserRelationship.java new file mode 100644 index 00000000000..15730ba4a05 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestUserRelationship.java @@ -0,0 +1,152 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationship to a user. */ +@JsonPropertyOrder({ChangeRequestUserRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestUserRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ChangeRequestUserRelationshipData data; + + public ChangeRequestUserRelationship() {} + + @JsonCreator + public ChangeRequestUserRelationship( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ChangeRequestUserRelationshipData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + public ChangeRequestUserRelationship data(ChangeRequestUserRelationshipData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + return this; + } + + /** + * User relationship data. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ChangeRequestUserRelationshipData getData() { + return data; + } + + public void setData(ChangeRequestUserRelationshipData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestUserRelationship + */ + @JsonAnySetter + public ChangeRequestUserRelationship putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestUserRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestUserRelationship changeRequestUserRelationship = (ChangeRequestUserRelationship) o; + return Objects.equals(this.data, changeRequestUserRelationship.data) + && Objects.equals( + this.additionalProperties, changeRequestUserRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestUserRelationship {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeRequestUserRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestUserRelationshipData.java new file mode 100644 index 00000000000..789af42a670 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeRequestUserRelationshipData.java @@ -0,0 +1,175 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** User relationship data. */ +@JsonPropertyOrder({ + ChangeRequestUserRelationshipData.JSON_PROPERTY_ID, + ChangeRequestUserRelationshipData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeRequestUserRelationshipData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public ChangeRequestUserRelationshipData() {} + + @JsonCreator + public ChangeRequestUserRelationshipData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.id = id; + this.type = type; + } + + public ChangeRequestUserRelationshipData id(String id) { + this.id = id; + return this; + } + + /** + * The user UUID. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ChangeRequestUserRelationshipData type(String type) { + this.type = type; + return this; + } + + /** + * The user resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeRequestUserRelationshipData + */ + @JsonAnySetter + public ChangeRequestUserRelationshipData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeRequestUserRelationshipData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeRequestUserRelationshipData changeRequestUserRelationshipData = + (ChangeRequestUserRelationshipData) o; + return Objects.equals(this.id, changeRequestUserRelationshipData.id) + && Objects.equals(this.type, changeRequestUserRelationshipData.type) + && Objects.equals( + this.additionalProperties, changeRequestUserRelationshipData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeRequestUserRelationshipData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/change_management.feature b/src/test/resources/com/datadog/api/client/v2/api/change_management.feature new file mode 100644 index 00000000000..dbbae657bb8 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/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/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 10efec9a5c1..53890381408 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -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": {