diff --git a/.apigentools-info b/.apigentools-info index 2b4eed9c993..3b34e6f1ed6 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-02-06 15:45:04.757484", - "spec_repo_commit": "46672359" + "regenerated": "2024-02-12 17:39:17.850030", + "spec_repo_commit": "3cda457d" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-02-06 15:45:04.772473", - "spec_repo_commit": "46672359" + "regenerated": "2024-02-12 17:39:17.866318", + "spec_repo_commit": "3cda457d" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 25c4b451339..4e26326131d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -151,6 +151,21 @@ components: required: true schema: type: string + CaseIDPathParameter: + description: Case's UUID or key + example: f98a5a5b-e0ff-45d4-b2f5-afe6e74de504 + in: path + name: case_id + required: true + schema: + type: string + CaseSortableFieldParameter: + description: Specify which field to sort + in: query + name: sort[field] + required: false + schema: + $ref: '#/components/schemas/CaseSortableField' CloudAccountID: description: Cloud Account id. in: path @@ -381,6 +396,14 @@ components: example: 10 format: int64 type: integer + ProjectIDPathParameter: + description: Project UUID + example: e555e290-ed65-49bd-ae18-8acbfcf18db7 + in: path + name: project_id + required: true + schema: + type: string ResourceID: description: 'Identifier, formatted as `type:id`. Supported types: `connection`, `dashboard`, `notebook`, `security-rule`, `slo`.' @@ -3332,6 +3355,345 @@ components: from the other indexes type: string type: object + Case: + description: A case + properties: + attributes: + $ref: '#/components/schemas/CaseAttributes' + id: + description: Case's identifier + example: aeadc05e-98a8-11ec-ac2c-da7ad0900001 + type: string + relationships: + $ref: '#/components/schemas/CaseRelationships' + type: + $ref: '#/components/schemas/CaseResourceType' + required: + - id + - type + - attributes + type: object + Case3rdPartyTicketStatus: + default: IN_PROGRESS + description: Case status + enum: + - IN_PROGRESS + - COMPLETED + - FAILED + example: COMPLETED + readOnly: true + type: string + x-enum-varnames: + - IN_PROGRESS + - COMPLETED + - FAILED + CaseAssign: + description: Case assign + properties: + attributes: + $ref: '#/components/schemas/CaseAssignAttributes' + type: + $ref: '#/components/schemas/CaseResourceType' + required: + - attributes + - type + type: object + CaseAssignAttributes: + description: Case assign attributes + properties: + assignee_id: + description: Assignee's UUID + example: f98a5a5b-e0ff-45d4-b2f5-afe6e74de504 + type: string + required: + - assignee_id + type: object + CaseAssignRequest: + description: Case assign request + properties: + data: + $ref: '#/components/schemas/CaseAssign' + required: + - data + type: object + CaseAttributes: + description: Case attributes + properties: + archived_at: + description: Timestamp of when the case was archived + format: date-time + nullable: true + readOnly: true + type: string + closed_at: + description: Timestamp of when the case was closed + format: date-time + nullable: true + readOnly: true + type: string + created_at: + description: Timestamp of when the case was created + format: date-time + readOnly: true + type: string + description: + description: Description + type: string + jira_issue: + $ref: '#/components/schemas/JiraIssue' + key: + description: Key + example: CASEM-4523 + type: string + modified_at: + description: Timestamp of when the case was last modified + format: date-time + nullable: true + readOnly: true + type: string + priority: + $ref: '#/components/schemas/CasePriority' + service_now_ticket: + $ref: '#/components/schemas/ServiceNowTicket' + status: + $ref: '#/components/schemas/CaseStatus' + title: + description: Title + example: Memory leak investigation on API + type: string + type: + $ref: '#/components/schemas/CaseType' + type: object + CaseCreate: + description: Case creation data + properties: + attributes: + $ref: '#/components/schemas/CaseCreateAttributes' + relationships: + $ref: '#/components/schemas/CaseCreateRelationships' + type: + $ref: '#/components/schemas/CaseResourceType' + required: + - attributes + - type + type: object + CaseCreateAttributes: + description: Case creation attributes + properties: + description: + description: Description + type: string + priority: + $ref: '#/components/schemas/CasePriority' + title: + description: Title + example: Security breach investigation + type: string + type: + $ref: '#/components/schemas/CaseType' + required: + - title + - type + type: object + CaseCreateRelationships: + description: Relationships formed with the case on creation + properties: + assignee: + $ref: '#/components/schemas/NullableUserRelationship' + project: + $ref: '#/components/schemas/ProjectRelationship' + required: + - project + type: object + CaseCreateRequest: + description: Case create request + properties: + data: + $ref: '#/components/schemas/CaseCreate' + required: + - data + type: object + CaseEmpty: + description: Case empty request data + properties: + type: + $ref: '#/components/schemas/CaseResourceType' + required: + - type + type: object + CaseEmptyRequest: + description: Case empty request + properties: + data: + $ref: '#/components/schemas/CaseEmpty' + required: + - data + type: object + CasePriority: + default: NOT_DEFINED + description: Case priority + enum: + - NOT_DEFINED + - P1 + - P2 + - P3 + - P4 + - P5 + example: NOT_DEFINED + type: string + x-enum-varnames: + - NOT_DEFINED + - P1 + - P2 + - P3 + - P4 + - P5 + CaseRelationships: + description: Resources related to a case + properties: + assignee: + $ref: '#/components/schemas/NullableUserRelationship' + created_by: + $ref: '#/components/schemas/NullableUserRelationship' + modified_by: + $ref: '#/components/schemas/NullableUserRelationship' + project: + $ref: '#/components/schemas/ProjectRelationship' + type: object + CaseResourceType: + default: case + description: Case resource type + enum: + - case + example: case + type: string + x-enum-varnames: + - CASE + CaseResponse: + description: Case response + properties: + data: + $ref: '#/components/schemas/Case' + type: object + CaseSortableField: + description: Case field that can be sorted on + enum: + - created_at + - priority + - status + example: created_at + type: string + x-enum-varnames: + - CREATED_AT + - PRIORITY + - STATUS + CaseStatus: + description: Case status + enum: + - OPEN + - IN_PROGRESS + - CLOSED + example: OPEN + type: string + x-enum-varnames: + - OPEN + - IN_PROGRESS + - CLOSED + CaseType: + description: Case type + enum: + - STANDARD + example: STANDARD + type: string + x-enum-varnames: + - STANDARD + CaseUpdatePriority: + description: Case priority status + properties: + attributes: + $ref: '#/components/schemas/CaseUpdatePriorityAttributes' + type: + $ref: '#/components/schemas/CaseResourceType' + required: + - attributes + - type + type: object + CaseUpdatePriorityAttributes: + description: Case update priority attributes + properties: + priority: + $ref: '#/components/schemas/CasePriority' + required: + - priority + type: object + CaseUpdatePriorityRequest: + description: Case update priority request + properties: + data: + $ref: '#/components/schemas/CaseUpdatePriority' + required: + - data + type: object + CaseUpdateStatus: + description: Case update status + properties: + attributes: + $ref: '#/components/schemas/CaseUpdateStatusAttributes' + type: + $ref: '#/components/schemas/CaseResourceType' + required: + - attributes + - type + type: object + CaseUpdateStatusAttributes: + description: Case update status attributes + properties: + status: + $ref: '#/components/schemas/CaseStatus' + required: + - status + type: object + CaseUpdateStatusRequest: + description: Case update status request + properties: + data: + $ref: '#/components/schemas/CaseUpdateStatus' + required: + - data + type: object + CasesResponse: + description: Response with cases + properties: + data: + description: Cases response data + items: + $ref: '#/components/schemas/Case' + type: array + meta: + $ref: '#/components/schemas/CasesResponseMeta' + type: object + CasesResponseMeta: + description: Cases response metadata + properties: + page: + $ref: '#/components/schemas/CasesResponseMetaPagination' + type: object + CasesResponseMetaPagination: + description: Pagination metadata + properties: + current: + description: Current page number + format: int64 + type: integer + size: + description: Number of cases in current page + format: int64 + type: integer + total: + description: Total number of pages + format: int64 + type: integer + type: object ChargebackBreakdown: description: Charges breakdown. properties: @@ -9344,6 +9706,32 @@ components: - project_key - account type: object + JiraIssue: + description: Jira issue attached to case + nullable: true + properties: + result: + $ref: '#/components/schemas/JiraIssueResult' + status: + $ref: '#/components/schemas/Case3rdPartyTicketStatus' + readOnly: true + type: object + JiraIssueResult: + description: Jira issue information + properties: + issue_id: + description: Jira issue ID + type: string + issue_key: + description: Jira issue key + type: string + issue_url: + description: Jira issue URL + type: string + project_key: + description: Jira project key + type: string + type: object ListApplicationKeysResponse: description: Response for a list of application keys. properties: @@ -11943,6 +12331,29 @@ components: - id - type type: object + NullableUserRelationship: + description: Relationship to user. + nullable: true + properties: + data: + $ref: '#/components/schemas/NullableUserRelationshipData' + required: + - data + type: object + NullableUserRelationshipData: + description: Relationship to user object. + nullable: true + properties: + id: + description: A unique identifier that represents the user. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + $ref: '#/components/schemas/UserResourceType' + required: + - id + - type + type: object OktaAccount: description: Schema for an Okta account. properties: @@ -13075,6 +13486,113 @@ components: type: string x-enum-varnames: - PROCESS + Project: + description: A Project + properties: + attributes: + $ref: '#/components/schemas/ProjectAttributes' + id: + description: The Project's identifier + example: aeadc05e-98a8-11ec-ac2c-da7ad0900001 + type: string + relationships: + $ref: '#/components/schemas/ProjectRelationships' + type: + $ref: '#/components/schemas/ProjectResourceType' + required: + - id + - type + - attributes + type: object + ProjectAttributes: + description: Project attributes + properties: + key: + description: The project's key + example: CASEM + type: string + name: + description: Project's name + type: string + type: object + ProjectCreate: + description: Project create + properties: + attributes: + $ref: '#/components/schemas/ProjectCreateAttributes' + type: + $ref: '#/components/schemas/ProjectResourceType' + required: + - attributes + - type + type: object + ProjectCreateAttributes: + description: Project creation attributes + properties: + key: + description: Project's key. Cannot be "CASE" + example: SEC + type: string + name: + description: name + example: Security Investigation + type: string + required: + - name + - key + type: object + ProjectCreateRequest: + description: Project create request + properties: + data: + $ref: '#/components/schemas/ProjectCreate' + required: + - data + type: object + ProjectRelationship: + description: Relationship to project + properties: + data: + $ref: '#/components/schemas/ProjectRelationshipData' + required: + - data + type: object + ProjectRelationshipData: + description: Relationship to project object + properties: + id: + description: A unique identifier that represents the project + example: e555e290-ed65-49bd-ae18-8acbfcf18db7 + type: string + type: + $ref: '#/components/schemas/ProjectResourceType' + required: + - id + - type + type: object + ProjectRelationships: + description: Project relationships + properties: + member_team: + $ref: '#/components/schemas/RelationshipToTeamLinks' + member_user: + $ref: '#/components/schemas/UsersRelationship' + type: object + ProjectResourceType: + default: project + description: Project resource type + enum: + - project + example: project + type: string + x-enum-varnames: + - PROJECT + ProjectResponse: + description: Project response + properties: + data: + $ref: '#/components/schemas/Project' + type: object ProjectedCost: description: Projected Cost data. properties: @@ -13131,6 +13649,15 @@ components: type: string x-enum-varnames: - PROJECt_COST + ProjectsResponse: + description: Response with projects + properties: + data: + description: Projects response data + items: + $ref: '#/components/schemas/Project' + type: array + type: object QueryFormula: description: A formula for calculation based on one or more queries. properties: @@ -18614,6 +19141,23 @@ components: $ref: '#/components/schemas/ServiceDefinitionData' type: array type: object + ServiceNowTicket: + description: ServiceNow ticket attached to case + nullable: true + properties: + result: + $ref: '#/components/schemas/ServiceNowTicketResult' + status: + $ref: '#/components/schemas/Case3rdPartyTicketStatus' + readOnly: true + type: object + ServiceNowTicketResult: + description: ServiceNow ticket information + properties: + sys_target_link: + description: Link to the Incident created on ServiceNow + type: string + type: object SlackIntegrationMetadata: description: Incident integration metadata for the Slack integration. properties: @@ -20615,12 +21159,34 @@ components: type: string x-enum-varnames: - USER_INVITATIONS + UserRelationshipData: + description: Relationship to user object. + properties: + id: + description: A unique identifier that represents the user. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + $ref: '#/components/schemas/UserResourceType' + required: + - id + - type + type: object UserRelationships: description: Relationships of the user object. properties: roles: $ref: '#/components/schemas/RelationshipToRoles' type: object + UserResourceType: + default: user + description: User resource type. + enum: + - user + example: user + type: string + x-enum-varnames: + - USER UserResponse: description: Response containing information about a single user. properties: @@ -20857,6 +21423,18 @@ components: required: - data type: object + UsersRelationship: + description: Relationship to users. + properties: + data: + description: Relationships to user objects. + example: [] + items: + $ref: '#/components/schemas/UserRelationshipData' + type: array + required: + - data + type: object UsersResponse: description: Response containing information about multiple users. properties: @@ -20929,6 +21507,8 @@ components: apm_service_catalog_read: View service catalog and service definitions. apm_service_catalog_write: Add, modify, and delete service catalog definitions when those definitions are maintained by Datadog. + cases_read: Read all cases data. + cases_write: Create, update and delete cases data. ci_visibility_pipelines_write: Create CI Visibility pipeline spans using the API. ci_visibility_read: View CI Visibility. @@ -22117,6 +22697,472 @@ paths: - AuthN Mappings x-codegen-request-body-name: body x-permission: OR(USER_ACCESS_MANAGE) + /api/v2/cases: + get: + description: Search cases. + operationId: SearchCases + parameters: + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageOffset' + - $ref: '#/components/parameters/CaseSortableFieldParameter' + - description: Search query + in: query + name: filter + required: false + schema: + example: status:open (team:case-management OR team:event-management) + type: string + - description: Specify if order is ascending or not + in: query + name: sort[asc] + required: false + schema: + default: false + type: boolean + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CasesResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: Search cases + tags: + - Cases + x-pagination: + limitParam: page[size] + pageOffsetParam: page[offset] + resultsPath: data + post: + description: Create a Case + operationId: CreateCase + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CaseCreateRequest' + description: Case payload + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/CaseResponse' + description: CREATED + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Create a case + tags: + - Cases + /api/v2/cases/projects: + get: + description: Get all projects. + operationId: GetProjects + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectsResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: Get all projects + tags: + - Cases Projects + post: + description: Create a project. + operationId: CreateProject + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectCreateRequest' + description: Project payload + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectResponse' + description: CREATED + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Create a project + tags: + - Cases Projects + /api/v2/cases/projects/{project_id}: + delete: + description: Remove a project using the project's `id`. + operationId: DeleteProject + parameters: + - $ref: '#/components/parameters/ProjectIDPathParameter' + responses: + '204': + description: No Content + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Remove a project + tags: + - Cases Projects + get: + description: Get the details of a project by `project_id`. + operationId: GetProject + parameters: + - $ref: '#/components/parameters/ProjectIDPathParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: Get the details of a project + tags: + - Cases Projects + /api/v2/cases/{case_id}: + get: + description: Get the details of case by `case_id` + operationId: GetCase + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CaseResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: Get the details of a case + tags: + - Cases + /api/v2/cases/{case_id}/archive: + post: + description: Archive case + operationId: ArchiveCase + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CaseEmptyRequest' + description: Archive case payload + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CaseResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Archive case + tags: + - Cases + /api/v2/cases/{case_id}/assign: + post: + description: Assign case to a user + operationId: AssignCase + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CaseAssignRequest' + description: Assign case payload + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CaseResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Assign case + tags: + - Cases + /api/v2/cases/{case_id}/priority: + post: + description: Update case priority + operationId: UpdatePriority + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CaseUpdatePriorityRequest' + description: Case priority update payload + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CaseResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Update case priority + tags: + - Cases + /api/v2/cases/{case_id}/status: + post: + description: Update case status + operationId: UpdateStatus + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CaseUpdateStatusRequest' + description: Case status update payload + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CaseResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Update case status + tags: + - Cases + /api/v2/cases/{case_id}/unarchive: + post: + description: Unarchive case + operationId: UnarchiveCase + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CaseEmptyRequest' + description: Unarchive case payload + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CaseResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Unarchive case + tags: + - Cases + /api/v2/cases/{case_id}/unassign: + post: + description: Unassign case + operationId: UnassignCase + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CaseEmptyRequest' + description: Unassign case payload + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CaseResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Unassign case + tags: + - Cases /api/v2/ci/pipeline: post: description: 'Send your pipeline event to your Datadog platform over HTTP. For @@ -33463,6 +34509,10 @@ tags: [Test Visibility in Datadog page](https://docs.datadoghq.com/tests/) for more information. name: CI Visibility Tests +- description: View and manage cases within Datadog + name: Cases +- description: View and manage project within Case Management + name: Cases Projects - description: The Cloud Cost Management API allows you to set up, edit, and delete Cloud Cost Management accounts for AWS and Azure. See the [Cloud Cost Management page](https://docs.datadoghq.com/cloud_cost_management/) for more information. diff --git a/examples/v2/cases-projects/CreateProject.java b/examples/v2/cases-projects/CreateProject.java new file mode 100644 index 00000000000..bb061cce46b --- /dev/null +++ b/examples/v2/cases-projects/CreateProject.java @@ -0,0 +1,36 @@ +// Create a project returns "CREATED" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CasesProjectsApi; +import com.datadog.api.client.v2.model.ProjectCreate; +import com.datadog.api.client.v2.model.ProjectCreateAttributes; +import com.datadog.api.client.v2.model.ProjectCreateRequest; +import com.datadog.api.client.v2.model.ProjectResourceType; +import com.datadog.api.client.v2.model.ProjectResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CasesProjectsApi apiInstance = new CasesProjectsApi(defaultClient); + + ProjectCreateRequest body = + new ProjectCreateRequest() + .data( + new ProjectCreate() + .attributes( + new ProjectCreateAttributes().key("SEC").name("Security Investigation")) + .type(ProjectResourceType.PROJECT)); + + try { + ProjectResponse result = apiInstance.createProject(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CasesProjectsApi#createProject"); + 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/cases-projects/DeleteProject.java b/examples/v2/cases-projects/DeleteProject.java new file mode 100644 index 00000000000..8c56665b3ad --- /dev/null +++ b/examples/v2/cases-projects/DeleteProject.java @@ -0,0 +1,22 @@ +// Remove a project returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CasesProjectsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CasesProjectsApi apiInstance = new CasesProjectsApi(defaultClient); + + try { + apiInstance.deleteProject("project_id"); + } catch (ApiException e) { + System.err.println("Exception when calling CasesProjectsApi#deleteProject"); + 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/cases-projects/GetProject.java b/examples/v2/cases-projects/GetProject.java new file mode 100644 index 00000000000..d924901edf3 --- /dev/null +++ b/examples/v2/cases-projects/GetProject.java @@ -0,0 +1,24 @@ +// Get the details of a project returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CasesProjectsApi; +import com.datadog.api.client.v2.model.ProjectResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CasesProjectsApi apiInstance = new CasesProjectsApi(defaultClient); + + try { + ProjectResponse result = apiInstance.getProject("project_id"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CasesProjectsApi#getProject"); + 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/cases-projects/GetProjects.java b/examples/v2/cases-projects/GetProjects.java new file mode 100644 index 00000000000..d68f4718eaa --- /dev/null +++ b/examples/v2/cases-projects/GetProjects.java @@ -0,0 +1,24 @@ +// Get all projects returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CasesProjectsApi; +import com.datadog.api.client.v2.model.ProjectsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CasesProjectsApi apiInstance = new CasesProjectsApi(defaultClient); + + try { + ProjectsResponse result = apiInstance.getProjects(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CasesProjectsApi#getProjects"); + 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/cases/ArchiveCase.java b/examples/v2/cases/ArchiveCase.java new file mode 100644 index 00000000000..da8e7fc6cf8 --- /dev/null +++ b/examples/v2/cases/ArchiveCase.java @@ -0,0 +1,33 @@ +// Archive case returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CasesApi; +import com.datadog.api.client.v2.model.CaseEmpty; +import com.datadog.api.client.v2.model.CaseEmptyRequest; +import com.datadog.api.client.v2.model.CaseResourceType; +import com.datadog.api.client.v2.model.CaseResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CasesApi apiInstance = new CasesApi(defaultClient); + + // there is a valid "case" in the system + String CASE_ID = System.getenv("CASE_ID"); + + CaseEmptyRequest body = + new CaseEmptyRequest().data(new CaseEmpty().type(CaseResourceType.CASE)); + + try { + CaseResponse result = apiInstance.archiveCase(CASE_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CasesApi#archiveCase"); + 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/cases/AssignCase.java b/examples/v2/cases/AssignCase.java new file mode 100644 index 00000000000..b30fa9888e3 --- /dev/null +++ b/examples/v2/cases/AssignCase.java @@ -0,0 +1,41 @@ +// Assign case returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CasesApi; +import com.datadog.api.client.v2.model.CaseAssign; +import com.datadog.api.client.v2.model.CaseAssignAttributes; +import com.datadog.api.client.v2.model.CaseAssignRequest; +import com.datadog.api.client.v2.model.CaseResourceType; +import com.datadog.api.client.v2.model.CaseResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CasesApi apiInstance = new CasesApi(defaultClient); + + // there is a valid "case" in the system + String CASE_ID = System.getenv("CASE_ID"); + + // there is a valid "user" in the system + String USER_DATA_ID = System.getenv("USER_DATA_ID"); + + CaseAssignRequest body = + new CaseAssignRequest() + .data( + new CaseAssign() + .attributes(new CaseAssignAttributes().assigneeId(USER_DATA_ID)) + .type(CaseResourceType.CASE)); + + try { + CaseResponse result = apiInstance.assignCase(CASE_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CasesApi#assignCase"); + 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/cases/CreateCase.java b/examples/v2/cases/CreateCase.java new file mode 100644 index 00000000000..956584d2fd4 --- /dev/null +++ b/examples/v2/cases/CreateCase.java @@ -0,0 +1,65 @@ +// Create a case returns "CREATED" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CasesApi; +import com.datadog.api.client.v2.model.CaseCreate; +import com.datadog.api.client.v2.model.CaseCreateAttributes; +import com.datadog.api.client.v2.model.CaseCreateRelationships; +import com.datadog.api.client.v2.model.CaseCreateRequest; +import com.datadog.api.client.v2.model.CasePriority; +import com.datadog.api.client.v2.model.CaseResourceType; +import com.datadog.api.client.v2.model.CaseResponse; +import com.datadog.api.client.v2.model.CaseType; +import com.datadog.api.client.v2.model.NullableUserRelationship; +import com.datadog.api.client.v2.model.NullableUserRelationshipData; +import com.datadog.api.client.v2.model.ProjectRelationship; +import com.datadog.api.client.v2.model.ProjectRelationshipData; +import com.datadog.api.client.v2.model.ProjectResourceType; +import com.datadog.api.client.v2.model.UserResourceType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CasesApi apiInstance = new CasesApi(defaultClient); + + // there is a valid "user" in the system + String USER_DATA_ID = System.getenv("USER_DATA_ID"); + + CaseCreateRequest body = + new CaseCreateRequest() + .data( + new CaseCreate() + .attributes( + new CaseCreateAttributes() + .priority(CasePriority.NOT_DEFINED) + .title("Security breach investigation in 3dcc5b2ebf9bfb8f") + .type(CaseType.STANDARD)) + .relationships( + new CaseCreateRelationships() + .assignee( + new NullableUserRelationship() + .data( + new NullableUserRelationshipData() + .id(USER_DATA_ID) + .type(UserResourceType.USER))) + .project( + new ProjectRelationship() + .data( + new ProjectRelationshipData() + .id("d4bbe1af-f36e-42f1-87c1-493ca35c320e") + .type(ProjectResourceType.PROJECT)))) + .type(CaseResourceType.CASE)); + + try { + CaseResponse result = apiInstance.createCase(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CasesApi#createCase"); + 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/cases/GetCase.java b/examples/v2/cases/GetCase.java new file mode 100644 index 00000000000..514de057f37 --- /dev/null +++ b/examples/v2/cases/GetCase.java @@ -0,0 +1,27 @@ +// Get the details of a case returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CasesApi; +import com.datadog.api.client.v2.model.CaseResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CasesApi apiInstance = new CasesApi(defaultClient); + + // there is a valid "case" in the system + String CASE_ID = System.getenv("CASE_ID"); + + try { + CaseResponse result = apiInstance.getCase(CASE_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CasesApi#getCase"); + 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/cases/SearchCases.java b/examples/v2/cases/SearchCases.java new file mode 100644 index 00000000000..c4df9207651 --- /dev/null +++ b/examples/v2/cases/SearchCases.java @@ -0,0 +1,24 @@ +// Search cases returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CasesApi; +import com.datadog.api.client.v2.model.CasesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CasesApi apiInstance = new CasesApi(defaultClient); + + try { + CasesResponse result = apiInstance.searchCases(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CasesApi#searchCases"); + 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/cases/SearchCases_3433960044.java b/examples/v2/cases/SearchCases_3433960044.java new file mode 100644 index 00000000000..e128772522c --- /dev/null +++ b/examples/v2/cases/SearchCases_3433960044.java @@ -0,0 +1,25 @@ +// Search cases returns "OK" response with pagination + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.PaginationIterable; +import com.datadog.api.client.v2.api.CasesApi; +import com.datadog.api.client.v2.model.Case; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CasesApi apiInstance = new CasesApi(defaultClient); + + try { + PaginationIterable iterable = apiInstance.searchCasesWithPagination(); + + for (Case item : iterable) { + System.out.println(item); + } + } catch (RuntimeException e) { + System.err.println("Exception when calling CasesApi#searchCasesWithPagination"); + System.err.println("Reason: " + e.getMessage()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/cases/UnarchiveCase.java b/examples/v2/cases/UnarchiveCase.java new file mode 100644 index 00000000000..5224f131003 --- /dev/null +++ b/examples/v2/cases/UnarchiveCase.java @@ -0,0 +1,33 @@ +// Unarchive case returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CasesApi; +import com.datadog.api.client.v2.model.CaseEmpty; +import com.datadog.api.client.v2.model.CaseEmptyRequest; +import com.datadog.api.client.v2.model.CaseResourceType; +import com.datadog.api.client.v2.model.CaseResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CasesApi apiInstance = new CasesApi(defaultClient); + + // there is a valid "case" in the system + String CASE_ID = System.getenv("CASE_ID"); + + CaseEmptyRequest body = + new CaseEmptyRequest().data(new CaseEmpty().type(CaseResourceType.CASE)); + + try { + CaseResponse result = apiInstance.unarchiveCase(CASE_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CasesApi#unarchiveCase"); + 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/cases/UnassignCase.java b/examples/v2/cases/UnassignCase.java new file mode 100644 index 00000000000..abac6fa02d0 --- /dev/null +++ b/examples/v2/cases/UnassignCase.java @@ -0,0 +1,33 @@ +// Unassign case returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CasesApi; +import com.datadog.api.client.v2.model.CaseEmpty; +import com.datadog.api.client.v2.model.CaseEmptyRequest; +import com.datadog.api.client.v2.model.CaseResourceType; +import com.datadog.api.client.v2.model.CaseResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CasesApi apiInstance = new CasesApi(defaultClient); + + // there is a valid "case" in the system + String CASE_ID = System.getenv("CASE_ID"); + + CaseEmptyRequest body = + new CaseEmptyRequest().data(new CaseEmpty().type(CaseResourceType.CASE)); + + try { + CaseResponse result = apiInstance.unassignCase(CASE_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CasesApi#unassignCase"); + 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/cases/UpdatePriority.java b/examples/v2/cases/UpdatePriority.java new file mode 100644 index 00000000000..6a7730a15aa --- /dev/null +++ b/examples/v2/cases/UpdatePriority.java @@ -0,0 +1,39 @@ +// Update case priority returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CasesApi; +import com.datadog.api.client.v2.model.CasePriority; +import com.datadog.api.client.v2.model.CaseResourceType; +import com.datadog.api.client.v2.model.CaseResponse; +import com.datadog.api.client.v2.model.CaseUpdatePriority; +import com.datadog.api.client.v2.model.CaseUpdatePriorityAttributes; +import com.datadog.api.client.v2.model.CaseUpdatePriorityRequest; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CasesApi apiInstance = new CasesApi(defaultClient); + + // there is a valid "case" in the system + String CASE_ID = System.getenv("CASE_ID"); + + CaseUpdatePriorityRequest body = + new CaseUpdatePriorityRequest() + .data( + new CaseUpdatePriority() + .attributes(new CaseUpdatePriorityAttributes().priority(CasePriority.P3)) + .type(CaseResourceType.CASE)); + + try { + CaseResponse result = apiInstance.updatePriority(CASE_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CasesApi#updatePriority"); + 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/cases/UpdateStatus.java b/examples/v2/cases/UpdateStatus.java new file mode 100644 index 00000000000..4621beb92d5 --- /dev/null +++ b/examples/v2/cases/UpdateStatus.java @@ -0,0 +1,39 @@ +// Update case status returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CasesApi; +import com.datadog.api.client.v2.model.CaseResourceType; +import com.datadog.api.client.v2.model.CaseResponse; +import com.datadog.api.client.v2.model.CaseStatus; +import com.datadog.api.client.v2.model.CaseUpdateStatus; +import com.datadog.api.client.v2.model.CaseUpdateStatusAttributes; +import com.datadog.api.client.v2.model.CaseUpdateStatusRequest; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CasesApi apiInstance = new CasesApi(defaultClient); + + // there is a valid "case" in the system + String CASE_ID = System.getenv("CASE_ID"); + + CaseUpdateStatusRequest body = + new CaseUpdateStatusRequest() + .data( + new CaseUpdateStatus() + .attributes(new CaseUpdateStatusAttributes().status(CaseStatus.IN_PROGRESS)) + .type(CaseResourceType.CASE)); + + try { + CaseResponse result = apiInstance.updateStatus(CASE_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CasesApi#updateStatus"); + 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/v2/api/CasesApi.java b/src/main/java/com/datadog/api/client/v2/api/CasesApi.java new file mode 100644 index 00000000000..c5a8967331e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/CasesApi.java @@ -0,0 +1,1541 @@ +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.PaginationIterable; +import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.Case; +import com.datadog.api.client.v2.model.CaseAssignRequest; +import com.datadog.api.client.v2.model.CaseCreateRequest; +import com.datadog.api.client.v2.model.CaseEmptyRequest; +import com.datadog.api.client.v2.model.CaseResponse; +import com.datadog.api.client.v2.model.CaseSortableField; +import com.datadog.api.client.v2.model.CaseUpdatePriorityRequest; +import com.datadog.api.client.v2.model.CaseUpdateStatusRequest; +import com.datadog.api.client.v2.model.CasesResponse; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.GenericType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +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 CasesApi { + private ApiClient apiClient; + + public CasesApi() { + this(ApiClient.getDefaultApiClient()); + } + + public CasesApi(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; + } + + /** + * Archive case. + * + *

See {@link #archiveCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Archive case payload (required) + * @return CaseResponse + * @throws ApiException if fails to make API call + */ + public CaseResponse archiveCase(String caseId, CaseEmptyRequest body) throws ApiException { + return archiveCaseWithHttpInfo(caseId, body).getData(); + } + + /** + * Archive case. + * + *

See {@link #archiveCaseWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @param body Archive case payload (required) + * @return CompletableFuture<CaseResponse> + */ + public CompletableFuture archiveCaseAsync(String caseId, CaseEmptyRequest body) { + return archiveCaseWithHttpInfoAsync(caseId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Archive case + * + * @param caseId Case's UUID or key (required) + * @param body Archive case payload (required) + * @return ApiResponse<CaseResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse archiveCaseWithHttpInfo(String caseId, CaseEmptyRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling archiveCase"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling archiveCase"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/archive" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CasesApi.archiveCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Archive case. + * + *

See {@link #archiveCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Archive case payload (required) + * @return CompletableFuture<ApiResponse<CaseResponse>> + */ + public CompletableFuture> archiveCaseWithHttpInfoAsync( + String caseId, CaseEmptyRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'caseId' when calling archiveCase")); + 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 archiveCase")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/archive" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CasesApi.archiveCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Assign case. + * + *

See {@link #assignCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Assign case payload (required) + * @return CaseResponse + * @throws ApiException if fails to make API call + */ + public CaseResponse assignCase(String caseId, CaseAssignRequest body) throws ApiException { + return assignCaseWithHttpInfo(caseId, body).getData(); + } + + /** + * Assign case. + * + *

See {@link #assignCaseWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @param body Assign case payload (required) + * @return CompletableFuture<CaseResponse> + */ + public CompletableFuture assignCaseAsync(String caseId, CaseAssignRequest body) { + return assignCaseWithHttpInfoAsync(caseId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Assign case to a user + * + * @param caseId Case's UUID or key (required) + * @param body Assign case payload (required) + * @return ApiResponse<CaseResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse assignCaseWithHttpInfo(String caseId, CaseAssignRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling assignCase"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling assignCase"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/assign" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CasesApi.assignCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Assign case. + * + *

See {@link #assignCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Assign case payload (required) + * @return CompletableFuture<ApiResponse<CaseResponse>> + */ + public CompletableFuture> assignCaseWithHttpInfoAsync( + String caseId, CaseAssignRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'caseId' when calling assignCase")); + 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 assignCase")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/assign" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CasesApi.assignCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create a case. + * + *

See {@link #createCaseWithHttpInfo}. + * + * @param body Case payload (required) + * @return CaseResponse + * @throws ApiException if fails to make API call + */ + public CaseResponse createCase(CaseCreateRequest body) throws ApiException { + return createCaseWithHttpInfo(body).getData(); + } + + /** + * Create a case. + * + *

See {@link #createCaseWithHttpInfoAsync}. + * + * @param body Case payload (required) + * @return CompletableFuture<CaseResponse> + */ + public CompletableFuture createCaseAsync(CaseCreateRequest body) { + return createCaseWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a Case + * + * @param body Case payload (required) + * @return ApiResponse<CaseResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 CREATED -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse createCaseWithHttpInfo(CaseCreateRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling createCase"); + } + // create path and map variables + String localVarPath = "/api/v2/cases"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CasesApi.createCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create a case. + * + *

See {@link #createCaseWithHttpInfo}. + * + * @param body Case payload (required) + * @return CompletableFuture<ApiResponse<CaseResponse>> + */ + public CompletableFuture> createCaseWithHttpInfoAsync( + CaseCreateRequest body) { + 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 createCase")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/cases"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CasesApi.createCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get the details of a case. + * + *

See {@link #getCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @return CaseResponse + * @throws ApiException if fails to make API call + */ + public CaseResponse getCase(String caseId) throws ApiException { + return getCaseWithHttpInfo(caseId).getData(); + } + + /** + * Get the details of a case. + * + *

See {@link #getCaseWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @return CompletableFuture<CaseResponse> + */ + public CompletableFuture getCaseAsync(String caseId) { + return getCaseWithHttpInfoAsync(caseId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the details of case by case_id + * + * @param caseId Case's UUID or key (required) + * @return ApiResponse<CaseResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getCaseWithHttpInfo(String caseId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException(400, "Missing the required parameter 'caseId' when calling getCase"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CasesApi.getCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get the details of a case. + * + *

See {@link #getCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @return CompletableFuture<ApiResponse<CaseResponse>> + */ + public CompletableFuture> getCaseWithHttpInfoAsync(String caseId) { + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'caseId' when calling getCase")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CasesApi.getCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to searchCases. */ + public static class SearchCasesOptionalParameters { + private Long pageSize; + private Long pageOffset; + private CaseSortableField sortField; + private String filter; + private Boolean sortAsc; + + /** + * Set pageSize. + * + * @param pageSize Size for a given page. The maximum allowed value is 100. (optional, default + * to 10) + * @return SearchCasesOptionalParameters + */ + public SearchCasesOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Set pageOffset. + * + * @param pageOffset Specific offset to use as the beginning of the returned page. (optional, + * default to 0) + * @return SearchCasesOptionalParameters + */ + public SearchCasesOptionalParameters pageOffset(Long pageOffset) { + this.pageOffset = pageOffset; + return this; + } + + /** + * Set sortField. + * + * @param sortField Specify which field to sort (optional) + * @return SearchCasesOptionalParameters + */ + public SearchCasesOptionalParameters sortField(CaseSortableField sortField) { + this.sortField = sortField; + return this; + } + + /** + * Set filter. + * + * @param filter Search query (optional) + * @return SearchCasesOptionalParameters + */ + public SearchCasesOptionalParameters filter(String filter) { + this.filter = filter; + return this; + } + + /** + * Set sortAsc. + * + * @param sortAsc Specify if order is ascending or not (optional, default to false) + * @return SearchCasesOptionalParameters + */ + public SearchCasesOptionalParameters sortAsc(Boolean sortAsc) { + this.sortAsc = sortAsc; + return this; + } + } + + /** + * Search cases. + * + *

See {@link #searchCasesWithHttpInfo}. + * + * @return CasesResponse + * @throws ApiException if fails to make API call + */ + public CasesResponse searchCases() throws ApiException { + return searchCasesWithHttpInfo(new SearchCasesOptionalParameters()).getData(); + } + + /** + * Search cases. + * + *

See {@link #searchCasesWithHttpInfoAsync}. + * + * @return CompletableFuture<CasesResponse> + */ + public CompletableFuture searchCasesAsync() { + return searchCasesWithHttpInfoAsync(new SearchCasesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Search cases. + * + *

See {@link #searchCasesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CasesResponse + * @throws ApiException if fails to make API call + */ + public CasesResponse searchCases(SearchCasesOptionalParameters parameters) throws ApiException { + return searchCasesWithHttpInfo(parameters).getData(); + } + + /** + * Search cases. + * + *

See {@link #searchCasesWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<CasesResponse> + */ + public CompletableFuture searchCasesAsync( + SearchCasesOptionalParameters parameters) { + return searchCasesWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Search cases. + * + *

See {@link #searchCasesWithHttpInfo}. + * + * @return PaginationIterable<Case> + */ + public PaginationIterable searchCasesWithPagination() { + SearchCasesOptionalParameters parameters = new SearchCasesOptionalParameters(); + return searchCasesWithPagination(parameters); + } + + /** + * Search cases. + * + *

See {@link #searchCasesWithHttpInfo}. + * + * @return CasesResponse + */ + public PaginationIterable searchCasesWithPagination( + SearchCasesOptionalParameters parameters) { + String resultsPath = "getData"; + String valueGetterPath = ""; + String valueSetterPath = "pageOffset"; + Boolean valueSetterParamOptional = true; + Long limit; + + if (parameters.pageSize == null) { + limit = 10l; + parameters.pageSize(limit); + } else { + limit = parameters.pageSize; + } + + LinkedHashMap args = new LinkedHashMap(); + args.put("optionalParams", parameters); + + PaginationIterable iterator = + new PaginationIterable( + this, + "searchCases", + resultsPath, + valueGetterPath, + valueSetterPath, + valueSetterParamOptional, + true, + limit, + args); + + return iterator; + } + + /** + * Search cases. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<CasesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse searchCasesWithHttpInfo( + SearchCasesOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageOffset = parameters.pageOffset; + CaseSortableField sortField = parameters.sortField; + String filter = parameters.filter; + Boolean sortAsc = parameters.sortAsc; + // create path and map variables + String localVarPath = "/api/v2/cases"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[field]", sortField)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter", filter)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[asc]", sortAsc)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CasesApi.searchCases", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Search cases. + * + *

See {@link #searchCasesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<CasesResponse>> + */ + public CompletableFuture> searchCasesWithHttpInfoAsync( + SearchCasesOptionalParameters parameters) { + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageOffset = parameters.pageOffset; + CaseSortableField sortField = parameters.sortField; + String filter = parameters.filter; + Boolean sortAsc = parameters.sortAsc; + // create path and map variables + String localVarPath = "/api/v2/cases"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[field]", sortField)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter", filter)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[asc]", sortAsc)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CasesApi.searchCases", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Unarchive case. + * + *

See {@link #unarchiveCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Unarchive case payload (required) + * @return CaseResponse + * @throws ApiException if fails to make API call + */ + public CaseResponse unarchiveCase(String caseId, CaseEmptyRequest body) throws ApiException { + return unarchiveCaseWithHttpInfo(caseId, body).getData(); + } + + /** + * Unarchive case. + * + *

See {@link #unarchiveCaseWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @param body Unarchive case payload (required) + * @return CompletableFuture<CaseResponse> + */ + public CompletableFuture unarchiveCaseAsync(String caseId, CaseEmptyRequest body) { + return unarchiveCaseWithHttpInfoAsync(caseId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Unarchive case + * + * @param caseId Case's UUID or key (required) + * @param body Unarchive case payload (required) + * @return ApiResponse<CaseResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse unarchiveCaseWithHttpInfo(String caseId, CaseEmptyRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling unarchiveCase"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling unarchiveCase"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/unarchive" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CasesApi.unarchiveCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Unarchive case. + * + *

See {@link #unarchiveCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Unarchive case payload (required) + * @return CompletableFuture<ApiResponse<CaseResponse>> + */ + public CompletableFuture> unarchiveCaseWithHttpInfoAsync( + String caseId, CaseEmptyRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'caseId' when calling unarchiveCase")); + 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 unarchiveCase")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/unarchive" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CasesApi.unarchiveCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Unassign case. + * + *

See {@link #unassignCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Unassign case payload (required) + * @return CaseResponse + * @throws ApiException if fails to make API call + */ + public CaseResponse unassignCase(String caseId, CaseEmptyRequest body) throws ApiException { + return unassignCaseWithHttpInfo(caseId, body).getData(); + } + + /** + * Unassign case. + * + *

See {@link #unassignCaseWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @param body Unassign case payload (required) + * @return CompletableFuture<CaseResponse> + */ + public CompletableFuture unassignCaseAsync(String caseId, CaseEmptyRequest body) { + return unassignCaseWithHttpInfoAsync(caseId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Unassign case + * + * @param caseId Case's UUID or key (required) + * @param body Unassign case payload (required) + * @return ApiResponse<CaseResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse unassignCaseWithHttpInfo(String caseId, CaseEmptyRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling unassignCase"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling unassignCase"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/unassign" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CasesApi.unassignCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Unassign case. + * + *

See {@link #unassignCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Unassign case payload (required) + * @return CompletableFuture<ApiResponse<CaseResponse>> + */ + public CompletableFuture> unassignCaseWithHttpInfoAsync( + String caseId, CaseEmptyRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'caseId' when calling unassignCase")); + 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 unassignCase")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/unassign" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CasesApi.unassignCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update case priority. + * + *

See {@link #updatePriorityWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Case priority update payload (required) + * @return CaseResponse + * @throws ApiException if fails to make API call + */ + public CaseResponse updatePriority(String caseId, CaseUpdatePriorityRequest body) + throws ApiException { + return updatePriorityWithHttpInfo(caseId, body).getData(); + } + + /** + * Update case priority. + * + *

See {@link #updatePriorityWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @param body Case priority update payload (required) + * @return CompletableFuture<CaseResponse> + */ + public CompletableFuture updatePriorityAsync( + String caseId, CaseUpdatePriorityRequest body) { + return updatePriorityWithHttpInfoAsync(caseId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update case priority + * + * @param caseId Case's UUID or key (required) + * @param body Case priority update payload (required) + * @return ApiResponse<CaseResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updatePriorityWithHttpInfo( + String caseId, CaseUpdatePriorityRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling updatePriority"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updatePriority"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/priority" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CasesApi.updatePriority", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update case priority. + * + *

See {@link #updatePriorityWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Case priority update payload (required) + * @return CompletableFuture<ApiResponse<CaseResponse>> + */ + public CompletableFuture> updatePriorityWithHttpInfoAsync( + String caseId, CaseUpdatePriorityRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'caseId' when calling updatePriority")); + 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 updatePriority")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/priority" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CasesApi.updatePriority", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update case status. + * + *

See {@link #updateStatusWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Case status update payload (required) + * @return CaseResponse + * @throws ApiException if fails to make API call + */ + public CaseResponse updateStatus(String caseId, CaseUpdateStatusRequest body) + throws ApiException { + return updateStatusWithHttpInfo(caseId, body).getData(); + } + + /** + * Update case status. + * + *

See {@link #updateStatusWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @param body Case status update payload (required) + * @return CompletableFuture<CaseResponse> + */ + public CompletableFuture updateStatusAsync( + String caseId, CaseUpdateStatusRequest body) { + return updateStatusWithHttpInfoAsync(caseId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update case status + * + * @param caseId Case's UUID or key (required) + * @param body Case status update payload (required) + * @return ApiResponse<CaseResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updateStatusWithHttpInfo( + String caseId, CaseUpdateStatusRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling updateStatus"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateStatus"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/status" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CasesApi.updateStatus", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update case status. + * + *

See {@link #updateStatusWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Case status update payload (required) + * @return CompletableFuture<ApiResponse<CaseResponse>> + */ + public CompletableFuture> updateStatusWithHttpInfoAsync( + String caseId, CaseUpdateStatusRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'caseId' when calling updateStatus")); + 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 updateStatus")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/status" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CasesApi.updateStatus", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/CasesProjectsApi.java b/src/main/java/com/datadog/api/client/v2/api/CasesProjectsApi.java new file mode 100644 index 00000000000..dba1e2b5bb1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/CasesProjectsApi.java @@ -0,0 +1,560 @@ +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.ProjectCreateRequest; +import com.datadog.api.client.v2.model.ProjectResponse; +import com.datadog.api.client.v2.model.ProjectsResponse; +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 CasesProjectsApi { + private ApiClient apiClient; + + public CasesProjectsApi() { + this(ApiClient.getDefaultApiClient()); + } + + public CasesProjectsApi(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 project. + * + *

See {@link #createProjectWithHttpInfo}. + * + * @param body Project payload (required) + * @return ProjectResponse + * @throws ApiException if fails to make API call + */ + public ProjectResponse createProject(ProjectCreateRequest body) throws ApiException { + return createProjectWithHttpInfo(body).getData(); + } + + /** + * Create a project. + * + *

See {@link #createProjectWithHttpInfoAsync}. + * + * @param body Project payload (required) + * @return CompletableFuture<ProjectResponse> + */ + public CompletableFuture createProjectAsync(ProjectCreateRequest body) { + return createProjectWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a project. + * + * @param body Project payload (required) + * @return ApiResponse<ProjectResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 CREATED -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse createProjectWithHttpInfo(ProjectCreateRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createProject"); + } + // create path and map variables + String localVarPath = "/api/v2/cases/projects"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CasesProjectsApi.createProject", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create a project. + * + *

See {@link #createProjectWithHttpInfo}. + * + * @param body Project payload (required) + * @return CompletableFuture<ApiResponse<ProjectResponse>> + */ + public CompletableFuture> createProjectWithHttpInfoAsync( + ProjectCreateRequest body) { + 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 createProject")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/cases/projects"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CasesProjectsApi.createProject", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Remove a project. + * + *

See {@link #deleteProjectWithHttpInfo}. + * + * @param projectId Project UUID (required) + * @throws ApiException if fails to make API call + */ + public void deleteProject(String projectId) throws ApiException { + deleteProjectWithHttpInfo(projectId); + } + + /** + * Remove a project. + * + *

See {@link #deleteProjectWithHttpInfoAsync}. + * + * @param projectId Project UUID (required) + * @return CompletableFuture + */ + public CompletableFuture deleteProjectAsync(String projectId) { + return deleteProjectWithHttpInfoAsync(projectId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Remove a project using the project's id. + * + * @param projectId Project UUID (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
403 Forbidden -
404 API error response -
429 Too many requests -
+ */ + public ApiResponse deleteProjectWithHttpInfo(String projectId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException( + 400, "Missing the required parameter 'projectId' when calling deleteProject"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CasesProjectsApi.deleteProject", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Remove a project. + * + *

See {@link #deleteProjectWithHttpInfo}. + * + * @param projectId Project UUID (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteProjectWithHttpInfoAsync(String projectId) { + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'projectId' when calling deleteProject")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CasesProjectsApi.deleteProject", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Get the details of a project. + * + *

See {@link #getProjectWithHttpInfo}. + * + * @param projectId Project UUID (required) + * @return ProjectResponse + * @throws ApiException if fails to make API call + */ + public ProjectResponse getProject(String projectId) throws ApiException { + return getProjectWithHttpInfo(projectId).getData(); + } + + /** + * Get the details of a project. + * + *

See {@link #getProjectWithHttpInfoAsync}. + * + * @param projectId Project UUID (required) + * @return CompletableFuture<ProjectResponse> + */ + public CompletableFuture getProjectAsync(String projectId) { + return getProjectWithHttpInfoAsync(projectId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the details of a project by project_id. + * + * @param projectId Project UUID (required) + * @return ApiResponse<ProjectResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getProjectWithHttpInfo(String projectId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException( + 400, "Missing the required parameter 'projectId' when calling getProject"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CasesProjectsApi.getProject", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get the details of a project. + * + *

See {@link #getProjectWithHttpInfo}. + * + * @param projectId Project UUID (required) + * @return CompletableFuture<ApiResponse<ProjectResponse>> + */ + public CompletableFuture> getProjectWithHttpInfoAsync( + String projectId) { + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'projectId' when calling getProject")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CasesProjectsApi.getProject", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get all projects. + * + *

See {@link #getProjectsWithHttpInfo}. + * + * @return ProjectsResponse + * @throws ApiException if fails to make API call + */ + public ProjectsResponse getProjects() throws ApiException { + return getProjectsWithHttpInfo().getData(); + } + + /** + * Get all projects. + * + *

See {@link #getProjectsWithHttpInfoAsync}. + * + * @return CompletableFuture<ProjectsResponse> + */ + public CompletableFuture getProjectsAsync() { + return getProjectsWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all projects. + * + * @return ApiResponse<ProjectsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getProjectsWithHttpInfo() throws ApiException { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/cases/projects"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CasesProjectsApi.getProjects", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get all projects. + * + *

See {@link #getProjectsWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<ProjectsResponse>> + */ + public CompletableFuture> getProjectsWithHttpInfoAsync() { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/cases/projects"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CasesProjectsApi.getProjects", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/Case.java b/src/main/java/com/datadog/api/client/v2/model/Case.java new file mode 100644 index 00000000000..1023e0ef486 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/Case.java @@ -0,0 +1,236 @@ +/* + * 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; + +/** A case */ +@JsonPropertyOrder({ + Case.JSON_PROPERTY_ATTRIBUTES, + Case.JSON_PROPERTY_ID, + Case.JSON_PROPERTY_RELATIONSHIPS, + Case.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class Case { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CaseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private CaseRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseResourceType type = CaseResourceType.CASE; + + public Case() {} + + @JsonCreator + public Case( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) CaseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public Case attributes(CaseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Case attributes + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CaseAttributes attributes) { + this.attributes = attributes; + } + + public Case id(String id) { + this.id = id; + return this; + } + + /** + * Case's 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 Case relationships(CaseRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Resources related to a case + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CaseRelationships getRelationships() { + return relationships; + } + + public void setRelationships(CaseRelationships relationships) { + this.relationships = relationships; + } + + public Case type(CaseResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Case resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseResourceType getType() { + return type; + } + + public void setType(CaseResourceType 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 Case + */ + @JsonAnySetter + public Case 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 Case object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Case _case = (Case) o; + return Objects.equals(this.attributes, _case.attributes) + && Objects.equals(this.id, _case.id) + && Objects.equals(this.relationships, _case.relationships) + && Objects.equals(this.type, _case.type) + && Objects.equals(this.additionalProperties, _case.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Case {\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/Case3rdPartyTicketStatus.java b/src/main/java/com/datadog/api/client/v2/model/Case3rdPartyTicketStatus.java new file mode 100644 index 00000000000..39e803011a1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/Case3rdPartyTicketStatus.java @@ -0,0 +1,60 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +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; + +/** Case status */ +@JsonSerialize(using = Case3rdPartyTicketStatus.Case3rdPartyTicketStatusSerializer.class) +public class Case3rdPartyTicketStatus extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("IN_PROGRESS", "COMPLETED", "FAILED")); + + public static final Case3rdPartyTicketStatus IN_PROGRESS = + new Case3rdPartyTicketStatus("IN_PROGRESS"); + public static final Case3rdPartyTicketStatus COMPLETED = + new Case3rdPartyTicketStatus("COMPLETED"); + public static final Case3rdPartyTicketStatus FAILED = new Case3rdPartyTicketStatus("FAILED"); + + Case3rdPartyTicketStatus(String value) { + super(value, allowedValues); + } + + public static class Case3rdPartyTicketStatusSerializer + extends StdSerializer { + public Case3rdPartyTicketStatusSerializer(Class t) { + super(t); + } + + public Case3rdPartyTicketStatusSerializer() { + this(null); + } + + @Override + public void serialize( + Case3rdPartyTicketStatus value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static Case3rdPartyTicketStatus fromValue(String value) { + return new Case3rdPartyTicketStatus(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseAssign.java b/src/main/java/com/datadog/api/client/v2/model/CaseAssign.java new file mode 100644 index 00000000000..cbeb0c8b0a4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseAssign.java @@ -0,0 +1,178 @@ +/* + * 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; + +/** Case assign */ +@JsonPropertyOrder({CaseAssign.JSON_PROPERTY_ATTRIBUTES, CaseAssign.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseAssign { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CaseAssignAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseResourceType type = CaseResourceType.CASE; + + public CaseAssign() {} + + @JsonCreator + public CaseAssign( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CaseAssignAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CaseAssign attributes(CaseAssignAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Case assign attributes + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseAssignAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CaseAssignAttributes attributes) { + this.attributes = attributes; + } + + public CaseAssign type(CaseResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Case resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseResourceType getType() { + return type; + } + + public void setType(CaseResourceType 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 CaseAssign + */ + @JsonAnySetter + public CaseAssign 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 CaseAssign object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseAssign caseAssign = (CaseAssign) o; + return Objects.equals(this.attributes, caseAssign.attributes) + && Objects.equals(this.type, caseAssign.type) + && Objects.equals(this.additionalProperties, caseAssign.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseAssign {\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/CaseAssignAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CaseAssignAttributes.java new file mode 100644 index 00000000000..597f2722801 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseAssignAttributes.java @@ -0,0 +1,143 @@ +/* + * 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; + +/** Case assign attributes */ +@JsonPropertyOrder({CaseAssignAttributes.JSON_PROPERTY_ASSIGNEE_ID}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseAssignAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ASSIGNEE_ID = "assignee_id"; + private String assigneeId; + + public CaseAssignAttributes() {} + + @JsonCreator + public CaseAssignAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ASSIGNEE_ID) String assigneeId) { + this.assigneeId = assigneeId; + } + + public CaseAssignAttributes assigneeId(String assigneeId) { + this.assigneeId = assigneeId; + return this; + } + + /** + * Assignee's UUID + * + * @return assigneeId + */ + @JsonProperty(JSON_PROPERTY_ASSIGNEE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAssigneeId() { + return assigneeId; + } + + public void setAssigneeId(String assigneeId) { + this.assigneeId = assigneeId; + } + + /** + * 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 CaseAssignAttributes + */ + @JsonAnySetter + public CaseAssignAttributes 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 CaseAssignAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseAssignAttributes caseAssignAttributes = (CaseAssignAttributes) o; + return Objects.equals(this.assigneeId, caseAssignAttributes.assigneeId) + && Objects.equals(this.additionalProperties, caseAssignAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(assigneeId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseAssignAttributes {\n"); + sb.append(" assigneeId: ").append(toIndentedString(assigneeId)).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/CaseAssignRequest.java b/src/main/java/com/datadog/api/client/v2/model/CaseAssignRequest.java new file mode 100644 index 00000000000..99d9b492605 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseAssignRequest.java @@ -0,0 +1,145 @@ +/* + * 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; + +/** Case assign request */ +@JsonPropertyOrder({CaseAssignRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseAssignRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CaseAssign data; + + public CaseAssignRequest() {} + + @JsonCreator + public CaseAssignRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CaseAssign data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CaseAssignRequest data(CaseAssign data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Case assign + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseAssign getData() { + return data; + } + + public void setData(CaseAssign 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 CaseAssignRequest + */ + @JsonAnySetter + public CaseAssignRequest 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 CaseAssignRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseAssignRequest caseAssignRequest = (CaseAssignRequest) o; + return Objects.equals(this.data, caseAssignRequest.data) + && Objects.equals(this.additionalProperties, caseAssignRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseAssignRequest {\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/CaseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CaseAttributes.java new file mode 100644 index 00000000000..6ae9dabbb94 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseAttributes.java @@ -0,0 +1,478 @@ +/* + * 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; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Case attributes */ +@JsonPropertyOrder({ + CaseAttributes.JSON_PROPERTY_ARCHIVED_AT, + CaseAttributes.JSON_PROPERTY_CLOSED_AT, + CaseAttributes.JSON_PROPERTY_CREATED_AT, + CaseAttributes.JSON_PROPERTY_DESCRIPTION, + CaseAttributes.JSON_PROPERTY_JIRA_ISSUE, + CaseAttributes.JSON_PROPERTY_KEY, + CaseAttributes.JSON_PROPERTY_MODIFIED_AT, + CaseAttributes.JSON_PROPERTY_PRIORITY, + CaseAttributes.JSON_PROPERTY_SERVICE_NOW_TICKET, + CaseAttributes.JSON_PROPERTY_STATUS, + CaseAttributes.JSON_PROPERTY_TITLE, + CaseAttributes.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseAttributes { + @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_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_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_JIRA_ISSUE = "jira_issue"; + private JsonNullable jiraIssue = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_KEY = "key"; + private String key; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private JsonNullable modifiedAt = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_PRIORITY = "priority"; + private CasePriority priority = CasePriority.NOT_DEFINED; + + public static final String JSON_PROPERTY_SERVICE_NOW_TICKET = "service_now_ticket"; + private JsonNullable serviceNowTicket = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_STATUS = "status"; + private CaseStatus status; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseType type; + + /** + * Timestamp of when the case 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; + } + + /** + * Timestamp of when the case 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 case was created + * + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public CaseAttributes description(String description) { + this.description = description; + return this; + } + + /** + * Description + * + * @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; + } + + /** + * Jira issue attached to case + * + * @return jiraIssue + */ + @jakarta.annotation.Nullable + @JsonIgnore + public JiraIssue getJiraIssue() { + + if (jiraIssue == null) { + jiraIssue = JsonNullable.undefined(); + } + return jiraIssue.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_JIRA_ISSUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getJiraIssue_JsonNullable() { + return jiraIssue; + } + + @JsonProperty(JSON_PROPERTY_JIRA_ISSUE) + private void setJiraIssue_JsonNullable(JsonNullable jiraIssue) { + this.jiraIssue = jiraIssue; + } + + public CaseAttributes key(String key) { + this.key = key; + return this; + } + + /** + * Key + * + * @return key + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + /** + * Timestamp of when the case was last modified + * + * @return modifiedAt + */ + @jakarta.annotation.Nullable + @JsonIgnore + public OffsetDateTime getModifiedAt() { + + if (modifiedAt == null) { + modifiedAt = JsonNullable.undefined(); + } + return modifiedAt.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getModifiedAt_JsonNullable() { + return modifiedAt; + } + + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + private void setModifiedAt_JsonNullable(JsonNullable modifiedAt) { + this.modifiedAt = modifiedAt; + } + + public CaseAttributes priority(CasePriority priority) { + this.priority = priority; + this.unparsed |= !priority.isValid(); + return this; + } + + /** + * Case priority + * + * @return priority + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIORITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CasePriority getPriority() { + return priority; + } + + public void setPriority(CasePriority priority) { + if (!priority.isValid()) { + this.unparsed = true; + } + this.priority = priority; + } + + /** + * ServiceNow ticket attached to case + * + * @return serviceNowTicket + */ + @jakarta.annotation.Nullable + @JsonIgnore + public ServiceNowTicket getServiceNowTicket() { + + if (serviceNowTicket == null) { + serviceNowTicket = JsonNullable.undefined(); + } + return serviceNowTicket.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_SERVICE_NOW_TICKET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getServiceNowTicket_JsonNullable() { + return serviceNowTicket; + } + + @JsonProperty(JSON_PROPERTY_SERVICE_NOW_TICKET) + private void setServiceNowTicket_JsonNullable(JsonNullable serviceNowTicket) { + this.serviceNowTicket = serviceNowTicket; + } + + public CaseAttributes status(CaseStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * Case status + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CaseStatus getStatus() { + return status; + } + + public void setStatus(CaseStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + public CaseAttributes title(String title) { + this.title = title; + return this; + } + + /** + * Title + * + * @return title + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public CaseAttributes type(CaseType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Case type + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CaseType getType() { + return type; + } + + public void setType(CaseType 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 CaseAttributes + */ + @JsonAnySetter + public CaseAttributes 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 CaseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseAttributes caseAttributes = (CaseAttributes) o; + return Objects.equals(this.archivedAt, caseAttributes.archivedAt) + && Objects.equals(this.closedAt, caseAttributes.closedAt) + && Objects.equals(this.createdAt, caseAttributes.createdAt) + && Objects.equals(this.description, caseAttributes.description) + && Objects.equals(this.jiraIssue, caseAttributes.jiraIssue) + && Objects.equals(this.key, caseAttributes.key) + && Objects.equals(this.modifiedAt, caseAttributes.modifiedAt) + && Objects.equals(this.priority, caseAttributes.priority) + && Objects.equals(this.serviceNowTicket, caseAttributes.serviceNowTicket) + && Objects.equals(this.status, caseAttributes.status) + && Objects.equals(this.title, caseAttributes.title) + && Objects.equals(this.type, caseAttributes.type) + && Objects.equals(this.additionalProperties, caseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + archivedAt, + closedAt, + createdAt, + description, + jiraIssue, + key, + modifiedAt, + priority, + serviceNowTicket, + status, + title, + type, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseAttributes {\n"); + sb.append(" archivedAt: ").append(toIndentedString(archivedAt)).append("\n"); + sb.append(" closedAt: ").append(toIndentedString(closedAt)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" jiraIssue: ").append(toIndentedString(jiraIssue)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); + sb.append(" serviceNowTicket: ").append(toIndentedString(serviceNowTicket)).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/CaseCreate.java b/src/main/java/com/datadog/api/client/v2/model/CaseCreate.java new file mode 100644 index 00000000000..44553e8f9cb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseCreate.java @@ -0,0 +1,209 @@ +/* + * 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; + +/** Case creation data */ +@JsonPropertyOrder({ + CaseCreate.JSON_PROPERTY_ATTRIBUTES, + CaseCreate.JSON_PROPERTY_RELATIONSHIPS, + CaseCreate.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseCreate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CaseCreateAttributes attributes; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private CaseCreateRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseResourceType type = CaseResourceType.CASE; + + public CaseCreate() {} + + @JsonCreator + public CaseCreate( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CaseCreateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CaseCreate attributes(CaseCreateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Case creation attributes + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseCreateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CaseCreateAttributes attributes) { + this.attributes = attributes; + } + + public CaseCreate relationships(CaseCreateRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships formed with the case on creation + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CaseCreateRelationships getRelationships() { + return relationships; + } + + public void setRelationships(CaseCreateRelationships relationships) { + this.relationships = relationships; + } + + public CaseCreate type(CaseResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Case resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseResourceType getType() { + return type; + } + + public void setType(CaseResourceType 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 CaseCreate + */ + @JsonAnySetter + public CaseCreate 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 CaseCreate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseCreate caseCreate = (CaseCreate) o; + return Objects.equals(this.attributes, caseCreate.attributes) + && Objects.equals(this.relationships, caseCreate.relationships) + && Objects.equals(this.type, caseCreate.type) + && Objects.equals(this.additionalProperties, caseCreate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseCreate {\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/CaseCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CaseCreateAttributes.java new file mode 100644 index 00000000000..ed22c97a248 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseCreateAttributes.java @@ -0,0 +1,236 @@ +/* + * 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; + +/** Case creation attributes */ +@JsonPropertyOrder({ + CaseCreateAttributes.JSON_PROPERTY_DESCRIPTION, + CaseCreateAttributes.JSON_PROPERTY_PRIORITY, + CaseCreateAttributes.JSON_PROPERTY_TITLE, + CaseCreateAttributes.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseCreateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_PRIORITY = "priority"; + private CasePriority priority = CasePriority.NOT_DEFINED; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseType type; + + public CaseCreateAttributes() {} + + @JsonCreator + public CaseCreateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_TITLE) String title, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseType type) { + this.title = title; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CaseCreateAttributes description(String description) { + this.description = description; + return this; + } + + /** + * Description + * + * @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 CaseCreateAttributes priority(CasePriority priority) { + this.priority = priority; + this.unparsed |= !priority.isValid(); + return this; + } + + /** + * Case priority + * + * @return priority + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIORITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CasePriority getPriority() { + return priority; + } + + public void setPriority(CasePriority priority) { + if (!priority.isValid()) { + this.unparsed = true; + } + this.priority = priority; + } + + public CaseCreateAttributes title(String title) { + this.title = title; + return this; + } + + /** + * Title + * + * @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 CaseCreateAttributes type(CaseType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Case type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseType getType() { + return type; + } + + public void setType(CaseType 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 CaseCreateAttributes + */ + @JsonAnySetter + public CaseCreateAttributes 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 CaseCreateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseCreateAttributes caseCreateAttributes = (CaseCreateAttributes) o; + return Objects.equals(this.description, caseCreateAttributes.description) + && Objects.equals(this.priority, caseCreateAttributes.priority) + && Objects.equals(this.title, caseCreateAttributes.title) + && Objects.equals(this.type, caseCreateAttributes.type) + && Objects.equals(this.additionalProperties, caseCreateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(description, priority, title, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseCreateAttributes {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" priority: ").append(toIndentedString(priority)).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/CaseCreateRelationships.java b/src/main/java/com/datadog/api/client/v2/model/CaseCreateRelationships.java new file mode 100644 index 00000000000..b71a42db6bb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseCreateRelationships.java @@ -0,0 +1,186 @@ +/* + * 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; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Relationships formed with the case on creation */ +@JsonPropertyOrder({ + CaseCreateRelationships.JSON_PROPERTY_ASSIGNEE, + CaseCreateRelationships.JSON_PROPERTY_PROJECT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseCreateRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ASSIGNEE = "assignee"; + private JsonNullable assignee = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_PROJECT = "project"; + private ProjectRelationship project; + + public CaseCreateRelationships() {} + + @JsonCreator + public CaseCreateRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_PROJECT) ProjectRelationship project) { + this.project = project; + this.unparsed |= project.unparsed; + } + + public CaseCreateRelationships assignee(NullableUserRelationship assignee) { + this.assignee = JsonNullable.of(assignee); + return this; + } + + /** + * Relationship to user. + * + * @return assignee + */ + @jakarta.annotation.Nullable + @JsonIgnore + public NullableUserRelationship getAssignee() { + return assignee.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ASSIGNEE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getAssignee_JsonNullable() { + return assignee; + } + + @JsonProperty(JSON_PROPERTY_ASSIGNEE) + public void setAssignee_JsonNullable(JsonNullable assignee) { + this.assignee = assignee; + } + + public void setAssignee(NullableUserRelationship assignee) { + this.assignee = JsonNullable.of(assignee); + } + + public CaseCreateRelationships project(ProjectRelationship project) { + this.project = project; + this.unparsed |= project.unparsed; + return this; + } + + /** + * Relationship to project + * + * @return project + */ + @JsonProperty(JSON_PROPERTY_PROJECT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProjectRelationship getProject() { + return project; + } + + public void setProject(ProjectRelationship project) { + this.project = project; + } + + /** + * 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 CaseCreateRelationships + */ + @JsonAnySetter + public CaseCreateRelationships 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 CaseCreateRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseCreateRelationships caseCreateRelationships = (CaseCreateRelationships) o; + return Objects.equals(this.assignee, caseCreateRelationships.assignee) + && Objects.equals(this.project, caseCreateRelationships.project) + && Objects.equals(this.additionalProperties, caseCreateRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(assignee, project, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseCreateRelationships {\n"); + sb.append(" assignee: ").append(toIndentedString(assignee)).append("\n"); + sb.append(" project: ").append(toIndentedString(project)).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/CaseCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/CaseCreateRequest.java new file mode 100644 index 00000000000..3be6b5d20af --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseCreateRequest.java @@ -0,0 +1,145 @@ +/* + * 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; + +/** Case create request */ +@JsonPropertyOrder({CaseCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CaseCreate data; + + public CaseCreateRequest() {} + + @JsonCreator + public CaseCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CaseCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CaseCreateRequest data(CaseCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Case creation data + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseCreate getData() { + return data; + } + + public void setData(CaseCreate 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 CaseCreateRequest + */ + @JsonAnySetter + public CaseCreateRequest 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 CaseCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseCreateRequest caseCreateRequest = (CaseCreateRequest) o; + return Objects.equals(this.data, caseCreateRequest.data) + && Objects.equals(this.additionalProperties, caseCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseCreateRequest {\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/CaseEmpty.java b/src/main/java/com/datadog/api/client/v2/model/CaseEmpty.java new file mode 100644 index 00000000000..0004b71d8c8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseEmpty.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; + +/** Case empty request data */ +@JsonPropertyOrder({CaseEmpty.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseEmpty { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseResourceType type = CaseResourceType.CASE; + + public CaseEmpty() {} + + @JsonCreator + public CaseEmpty( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CaseEmpty type(CaseResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Case resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseResourceType getType() { + return type; + } + + public void setType(CaseResourceType 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 CaseEmpty + */ + @JsonAnySetter + public CaseEmpty 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 CaseEmpty object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseEmpty caseEmpty = (CaseEmpty) o; + return Objects.equals(this.type, caseEmpty.type) + && Objects.equals(this.additionalProperties, caseEmpty.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseEmpty {\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/CaseEmptyRequest.java b/src/main/java/com/datadog/api/client/v2/model/CaseEmptyRequest.java new file mode 100644 index 00000000000..87308aacaf6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseEmptyRequest.java @@ -0,0 +1,145 @@ +/* + * 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; + +/** Case empty request */ +@JsonPropertyOrder({CaseEmptyRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseEmptyRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CaseEmpty data; + + public CaseEmptyRequest() {} + + @JsonCreator + public CaseEmptyRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CaseEmpty data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CaseEmptyRequest data(CaseEmpty data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Case empty request data + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseEmpty getData() { + return data; + } + + public void setData(CaseEmpty 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 CaseEmptyRequest + */ + @JsonAnySetter + public CaseEmptyRequest 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 CaseEmptyRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseEmptyRequest caseEmptyRequest = (CaseEmptyRequest) o; + return Objects.equals(this.data, caseEmptyRequest.data) + && Objects.equals(this.additionalProperties, caseEmptyRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseEmptyRequest {\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/CasePriority.java b/src/main/java/com/datadog/api/client/v2/model/CasePriority.java new file mode 100644 index 00000000000..efea847db86 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CasePriority.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; + +/** Case priority */ +@JsonSerialize(using = CasePriority.CasePrioritySerializer.class) +public class CasePriority extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("NOT_DEFINED", "P1", "P2", "P3", "P4", "P5")); + + public static final CasePriority NOT_DEFINED = new CasePriority("NOT_DEFINED"); + public static final CasePriority P1 = new CasePriority("P1"); + public static final CasePriority P2 = new CasePriority("P2"); + public static final CasePriority P3 = new CasePriority("P3"); + public static final CasePriority P4 = new CasePriority("P4"); + public static final CasePriority P5 = new CasePriority("P5"); + + CasePriority(String value) { + super(value, allowedValues); + } + + public static class CasePrioritySerializer extends StdSerializer { + public CasePrioritySerializer(Class t) { + super(t); + } + + public CasePrioritySerializer() { + this(null); + } + + @Override + public void serialize(CasePriority value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CasePriority fromValue(String value) { + return new CasePriority(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseRelationships.java b/src/main/java/com/datadog/api/client/v2/model/CaseRelationships.java new file mode 100644 index 00000000000..91ab81809c8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseRelationships.java @@ -0,0 +1,253 @@ +/* + * 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; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Resources related to a case */ +@JsonPropertyOrder({ + CaseRelationships.JSON_PROPERTY_ASSIGNEE, + CaseRelationships.JSON_PROPERTY_CREATED_BY, + CaseRelationships.JSON_PROPERTY_MODIFIED_BY, + CaseRelationships.JSON_PROPERTY_PROJECT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ASSIGNEE = "assignee"; + private JsonNullable assignee = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_CREATED_BY = "created_by"; + private JsonNullable createdBy = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_MODIFIED_BY = "modified_by"; + private JsonNullable modifiedBy = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_PROJECT = "project"; + private ProjectRelationship project; + + public CaseRelationships assignee(NullableUserRelationship assignee) { + this.assignee = JsonNullable.of(assignee); + return this; + } + + /** + * Relationship to user. + * + * @return assignee + */ + @jakarta.annotation.Nullable + @JsonIgnore + public NullableUserRelationship getAssignee() { + return assignee.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ASSIGNEE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getAssignee_JsonNullable() { + return assignee; + } + + @JsonProperty(JSON_PROPERTY_ASSIGNEE) + public void setAssignee_JsonNullable(JsonNullable assignee) { + this.assignee = assignee; + } + + public void setAssignee(NullableUserRelationship assignee) { + this.assignee = JsonNullable.of(assignee); + } + + public CaseRelationships createdBy(NullableUserRelationship createdBy) { + this.createdBy = JsonNullable.of(createdBy); + return this; + } + + /** + * Relationship to user. + * + * @return createdBy + */ + @jakarta.annotation.Nullable + @JsonIgnore + public NullableUserRelationship getCreatedBy() { + return createdBy.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getCreatedBy_JsonNullable() { + return createdBy; + } + + @JsonProperty(JSON_PROPERTY_CREATED_BY) + public void setCreatedBy_JsonNullable(JsonNullable createdBy) { + this.createdBy = createdBy; + } + + public void setCreatedBy(NullableUserRelationship createdBy) { + this.createdBy = JsonNullable.of(createdBy); + } + + public CaseRelationships modifiedBy(NullableUserRelationship modifiedBy) { + this.modifiedBy = JsonNullable.of(modifiedBy); + return this; + } + + /** + * Relationship to user. + * + * @return modifiedBy + */ + @jakarta.annotation.Nullable + @JsonIgnore + public NullableUserRelationship getModifiedBy() { + return modifiedBy.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_MODIFIED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getModifiedBy_JsonNullable() { + return modifiedBy; + } + + @JsonProperty(JSON_PROPERTY_MODIFIED_BY) + public void setModifiedBy_JsonNullable(JsonNullable modifiedBy) { + this.modifiedBy = modifiedBy; + } + + public void setModifiedBy(NullableUserRelationship modifiedBy) { + this.modifiedBy = JsonNullable.of(modifiedBy); + } + + public CaseRelationships project(ProjectRelationship project) { + this.project = project; + this.unparsed |= project.unparsed; + return this; + } + + /** + * Relationship to project + * + * @return project + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProjectRelationship getProject() { + return project; + } + + public void setProject(ProjectRelationship project) { + this.project = project; + } + + /** + * 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 CaseRelationships + */ + @JsonAnySetter + public CaseRelationships 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 CaseRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseRelationships caseRelationships = (CaseRelationships) o; + return Objects.equals(this.assignee, caseRelationships.assignee) + && Objects.equals(this.createdBy, caseRelationships.createdBy) + && Objects.equals(this.modifiedBy, caseRelationships.modifiedBy) + && Objects.equals(this.project, caseRelationships.project) + && Objects.equals(this.additionalProperties, caseRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(assignee, createdBy, modifiedBy, project, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseRelationships {\n"); + sb.append(" assignee: ").append(toIndentedString(assignee)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" modifiedBy: ").append(toIndentedString(modifiedBy)).append("\n"); + sb.append(" project: ").append(toIndentedString(project)).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/CaseResourceType.java b/src/main/java/com/datadog/api/client/v2/model/CaseResourceType.java new file mode 100644 index 00000000000..2be5169c955 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseResourceType.java @@ -0,0 +1,53 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 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; + +/** Case resource type */ +@JsonSerialize(using = CaseResourceType.CaseResourceTypeSerializer.class) +public class CaseResourceType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("case")); + + public static final CaseResourceType CASE = new CaseResourceType("case"); + + CaseResourceType(String value) { + super(value, allowedValues); + } + + public static class CaseResourceTypeSerializer extends StdSerializer { + public CaseResourceTypeSerializer(Class t) { + super(t); + } + + public CaseResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize(CaseResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CaseResourceType fromValue(String value) { + return new CaseResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseResponse.java b/src/main/java/com/datadog/api/client/v2/model/CaseResponse.java new file mode 100644 index 00000000000..8c6a83a9244 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseResponse.java @@ -0,0 +1,136 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Case response */ +@JsonPropertyOrder({CaseResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private Case data; + + public CaseResponse data(Case data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A case + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Case getData() { + return data; + } + + public void setData(Case 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 CaseResponse + */ + @JsonAnySetter + public CaseResponse 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 CaseResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseResponse caseResponse = (CaseResponse) o; + return Objects.equals(this.data, caseResponse.data) + && Objects.equals(this.additionalProperties, caseResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseResponse {\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/CaseSortableField.java b/src/main/java/com/datadog/api/client/v2/model/CaseSortableField.java new file mode 100644 index 00000000000..ab1484a4d3f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseSortableField.java @@ -0,0 +1,56 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +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; + +/** Case field that can be sorted on */ +@JsonSerialize(using = CaseSortableField.CaseSortableFieldSerializer.class) +public class CaseSortableField extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("created_at", "priority", "status")); + + public static final CaseSortableField CREATED_AT = new CaseSortableField("created_at"); + public static final CaseSortableField PRIORITY = new CaseSortableField("priority"); + public static final CaseSortableField STATUS = new CaseSortableField("status"); + + CaseSortableField(String value) { + super(value, allowedValues); + } + + public static class CaseSortableFieldSerializer extends StdSerializer { + public CaseSortableFieldSerializer(Class t) { + super(t); + } + + public CaseSortableFieldSerializer() { + this(null); + } + + @Override + public void serialize(CaseSortableField value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CaseSortableField fromValue(String value) { + return new CaseSortableField(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseStatus.java b/src/main/java/com/datadog/api/client/v2/model/CaseStatus.java new file mode 100644 index 00000000000..d00bf17f6a4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseStatus.java @@ -0,0 +1,56 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +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; + +/** Case status */ +@JsonSerialize(using = CaseStatus.CaseStatusSerializer.class) +public class CaseStatus extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("OPEN", "IN_PROGRESS", "CLOSED")); + + public static final CaseStatus OPEN = new CaseStatus("OPEN"); + public static final CaseStatus IN_PROGRESS = new CaseStatus("IN_PROGRESS"); + public static final CaseStatus CLOSED = new CaseStatus("CLOSED"); + + CaseStatus(String value) { + super(value, allowedValues); + } + + public static class CaseStatusSerializer extends StdSerializer { + public CaseStatusSerializer(Class t) { + super(t); + } + + public CaseStatusSerializer() { + this(null); + } + + @Override + public void serialize(CaseStatus value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CaseStatus fromValue(String value) { + return new CaseStatus(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseType.java b/src/main/java/com/datadog/api/client/v2/model/CaseType.java new file mode 100644 index 00000000000..9ab1e736a25 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseType.java @@ -0,0 +1,53 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 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; + +/** Case type */ +@JsonSerialize(using = CaseType.CaseTypeSerializer.class) +public class CaseType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("STANDARD")); + + public static final CaseType STANDARD = new CaseType("STANDARD"); + + CaseType(String value) { + super(value, allowedValues); + } + + public static class CaseTypeSerializer extends StdSerializer { + public CaseTypeSerializer(Class t) { + super(t); + } + + public CaseTypeSerializer() { + this(null); + } + + @Override + public void serialize(CaseType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CaseType fromValue(String value) { + return new CaseType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseUpdatePriority.java b/src/main/java/com/datadog/api/client/v2/model/CaseUpdatePriority.java new file mode 100644 index 00000000000..4dc39cc97f6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseUpdatePriority.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; + +/** Case priority status */ +@JsonPropertyOrder({ + CaseUpdatePriority.JSON_PROPERTY_ATTRIBUTES, + CaseUpdatePriority.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseUpdatePriority { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CaseUpdatePriorityAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseResourceType type = CaseResourceType.CASE; + + public CaseUpdatePriority() {} + + @JsonCreator + public CaseUpdatePriority( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CaseUpdatePriorityAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CaseUpdatePriority attributes(CaseUpdatePriorityAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Case update priority attributes + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseUpdatePriorityAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CaseUpdatePriorityAttributes attributes) { + this.attributes = attributes; + } + + public CaseUpdatePriority type(CaseResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Case resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseResourceType getType() { + return type; + } + + public void setType(CaseResourceType 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 CaseUpdatePriority + */ + @JsonAnySetter + public CaseUpdatePriority 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 CaseUpdatePriority object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseUpdatePriority caseUpdatePriority = (CaseUpdatePriority) o; + return Objects.equals(this.attributes, caseUpdatePriority.attributes) + && Objects.equals(this.type, caseUpdatePriority.type) + && Objects.equals(this.additionalProperties, caseUpdatePriority.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseUpdatePriority {\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/CaseUpdatePriorityAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CaseUpdatePriorityAttributes.java new file mode 100644 index 00000000000..3529b1a08d7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseUpdatePriorityAttributes.java @@ -0,0 +1,149 @@ +/* + * 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; + +/** Case update priority attributes */ +@JsonPropertyOrder({CaseUpdatePriorityAttributes.JSON_PROPERTY_PRIORITY}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseUpdatePriorityAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PRIORITY = "priority"; + private CasePriority priority = CasePriority.NOT_DEFINED; + + public CaseUpdatePriorityAttributes() {} + + @JsonCreator + public CaseUpdatePriorityAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_PRIORITY) CasePriority priority) { + this.priority = priority; + this.unparsed |= !priority.isValid(); + } + + public CaseUpdatePriorityAttributes priority(CasePriority priority) { + this.priority = priority; + this.unparsed |= !priority.isValid(); + return this; + } + + /** + * Case priority + * + * @return priority + */ + @JsonProperty(JSON_PROPERTY_PRIORITY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CasePriority getPriority() { + return priority; + } + + public void setPriority(CasePriority priority) { + if (!priority.isValid()) { + this.unparsed = true; + } + this.priority = priority; + } + + /** + * 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 CaseUpdatePriorityAttributes + */ + @JsonAnySetter + public CaseUpdatePriorityAttributes 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 CaseUpdatePriorityAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseUpdatePriorityAttributes caseUpdatePriorityAttributes = (CaseUpdatePriorityAttributes) o; + return Objects.equals(this.priority, caseUpdatePriorityAttributes.priority) + && Objects.equals( + this.additionalProperties, caseUpdatePriorityAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(priority, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseUpdatePriorityAttributes {\n"); + sb.append(" priority: ").append(toIndentedString(priority)).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/CaseUpdatePriorityRequest.java b/src/main/java/com/datadog/api/client/v2/model/CaseUpdatePriorityRequest.java new file mode 100644 index 00000000000..4c08511afc7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseUpdatePriorityRequest.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; + +/** Case update priority request */ +@JsonPropertyOrder({CaseUpdatePriorityRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseUpdatePriorityRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CaseUpdatePriority data; + + public CaseUpdatePriorityRequest() {} + + @JsonCreator + public CaseUpdatePriorityRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CaseUpdatePriority data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CaseUpdatePriorityRequest data(CaseUpdatePriority data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Case priority status + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseUpdatePriority getData() { + return data; + } + + public void setData(CaseUpdatePriority 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 CaseUpdatePriorityRequest + */ + @JsonAnySetter + public CaseUpdatePriorityRequest 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 CaseUpdatePriorityRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseUpdatePriorityRequest caseUpdatePriorityRequest = (CaseUpdatePriorityRequest) o; + return Objects.equals(this.data, caseUpdatePriorityRequest.data) + && Objects.equals( + this.additionalProperties, caseUpdatePriorityRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseUpdatePriorityRequest {\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/CaseUpdateStatus.java b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateStatus.java new file mode 100644 index 00000000000..c0bf06d5ff5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateStatus.java @@ -0,0 +1,178 @@ +/* + * 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; + +/** Case update status */ +@JsonPropertyOrder({CaseUpdateStatus.JSON_PROPERTY_ATTRIBUTES, CaseUpdateStatus.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseUpdateStatus { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CaseUpdateStatusAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseResourceType type = CaseResourceType.CASE; + + public CaseUpdateStatus() {} + + @JsonCreator + public CaseUpdateStatus( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CaseUpdateStatusAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CaseUpdateStatus attributes(CaseUpdateStatusAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Case update status attributes + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseUpdateStatusAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CaseUpdateStatusAttributes attributes) { + this.attributes = attributes; + } + + public CaseUpdateStatus type(CaseResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Case resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseResourceType getType() { + return type; + } + + public void setType(CaseResourceType 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 CaseUpdateStatus + */ + @JsonAnySetter + public CaseUpdateStatus 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 CaseUpdateStatus object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseUpdateStatus caseUpdateStatus = (CaseUpdateStatus) o; + return Objects.equals(this.attributes, caseUpdateStatus.attributes) + && Objects.equals(this.type, caseUpdateStatus.type) + && Objects.equals(this.additionalProperties, caseUpdateStatus.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseUpdateStatus {\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/CaseUpdateStatusAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateStatusAttributes.java new file mode 100644 index 00000000000..d234d1e171b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateStatusAttributes.java @@ -0,0 +1,149 @@ +/* + * 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; + +/** Case update status attributes */ +@JsonPropertyOrder({CaseUpdateStatusAttributes.JSON_PROPERTY_STATUS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseUpdateStatusAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_STATUS = "status"; + private CaseStatus status; + + public CaseUpdateStatusAttributes() {} + + @JsonCreator + public CaseUpdateStatusAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) CaseStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + } + + public CaseUpdateStatusAttributes status(CaseStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * Case status + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseStatus getStatus() { + return status; + } + + public void setStatus(CaseStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + /** + * 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 CaseUpdateStatusAttributes + */ + @JsonAnySetter + public CaseUpdateStatusAttributes 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 CaseUpdateStatusAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseUpdateStatusAttributes caseUpdateStatusAttributes = (CaseUpdateStatusAttributes) o; + return Objects.equals(this.status, caseUpdateStatusAttributes.status) + && Objects.equals( + this.additionalProperties, caseUpdateStatusAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseUpdateStatusAttributes {\n"); + sb.append(" status: ").append(toIndentedString(status)).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/CaseUpdateStatusRequest.java b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateStatusRequest.java new file mode 100644 index 00000000000..d89245639c3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateStatusRequest.java @@ -0,0 +1,145 @@ +/* + * 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; + +/** Case update status request */ +@JsonPropertyOrder({CaseUpdateStatusRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseUpdateStatusRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CaseUpdateStatus data; + + public CaseUpdateStatusRequest() {} + + @JsonCreator + public CaseUpdateStatusRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CaseUpdateStatus data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CaseUpdateStatusRequest data(CaseUpdateStatus data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Case update status + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseUpdateStatus getData() { + return data; + } + + public void setData(CaseUpdateStatus 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 CaseUpdateStatusRequest + */ + @JsonAnySetter + public CaseUpdateStatusRequest 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 CaseUpdateStatusRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseUpdateStatusRequest caseUpdateStatusRequest = (CaseUpdateStatusRequest) o; + return Objects.equals(this.data, caseUpdateStatusRequest.data) + && Objects.equals(this.additionalProperties, caseUpdateStatusRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseUpdateStatusRequest {\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/CasesResponse.java b/src/main/java/com/datadog/api/client/v2/model/CasesResponse.java new file mode 100644 index 00000000000..1e04984e876 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CasesResponse.java @@ -0,0 +1,176 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response with cases */ +@JsonPropertyOrder({CasesResponse.JSON_PROPERTY_DATA, CasesResponse.JSON_PROPERTY_META}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CasesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public static final String JSON_PROPERTY_META = "meta"; + private CasesResponseMeta meta; + + public CasesResponse data(List data) { + this.data = data; + for (Case item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CasesResponse addDataItem(Case dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Cases response data + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public CasesResponse meta(CasesResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Cases response metadata + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CasesResponseMeta getMeta() { + return meta; + } + + public void setMeta(CasesResponseMeta meta) { + this.meta = meta; + } + + /** + * 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 CasesResponse + */ + @JsonAnySetter + public CasesResponse 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 CasesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CasesResponse casesResponse = (CasesResponse) o; + return Objects.equals(this.data, casesResponse.data) + && Objects.equals(this.meta, casesResponse.meta) + && Objects.equals(this.additionalProperties, casesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CasesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).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/CasesResponseMeta.java b/src/main/java/com/datadog/api/client/v2/model/CasesResponseMeta.java new file mode 100644 index 00000000000..51ad11c5a0b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CasesResponseMeta.java @@ -0,0 +1,136 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Cases response metadata */ +@JsonPropertyOrder({CasesResponseMeta.JSON_PROPERTY_PAGE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CasesResponseMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PAGE = "page"; + private CasesResponseMetaPagination page; + + public CasesResponseMeta page(CasesResponseMetaPagination page) { + this.page = page; + this.unparsed |= page.unparsed; + return this; + } + + /** + * Pagination metadata + * + * @return page + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CasesResponseMetaPagination getPage() { + return page; + } + + public void setPage(CasesResponseMetaPagination page) { + this.page = page; + } + + /** + * 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 CasesResponseMeta + */ + @JsonAnySetter + public CasesResponseMeta 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 CasesResponseMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CasesResponseMeta casesResponseMeta = (CasesResponseMeta) o; + return Objects.equals(this.page, casesResponseMeta.page) + && Objects.equals(this.additionalProperties, casesResponseMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(page, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CasesResponseMeta {\n"); + sb.append(" page: ").append(toIndentedString(page)).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/CasesResponseMetaPagination.java b/src/main/java/com/datadog/api/client/v2/model/CasesResponseMetaPagination.java new file mode 100644 index 00000000000..cf47a93e415 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CasesResponseMetaPagination.java @@ -0,0 +1,192 @@ +/* + * 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; + +/** Pagination metadata */ +@JsonPropertyOrder({ + CasesResponseMetaPagination.JSON_PROPERTY_CURRENT, + CasesResponseMetaPagination.JSON_PROPERTY_SIZE, + CasesResponseMetaPagination.JSON_PROPERTY_TOTAL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CasesResponseMetaPagination { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CURRENT = "current"; + private Long current; + + public static final String JSON_PROPERTY_SIZE = "size"; + private Long size; + + public static final String JSON_PROPERTY_TOTAL = "total"; + private Long total; + + public CasesResponseMetaPagination current(Long current) { + this.current = current; + return this; + } + + /** + * Current page number + * + * @return current + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CURRENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCurrent() { + return current; + } + + public void setCurrent(Long current) { + this.current = current; + } + + public CasesResponseMetaPagination size(Long size) { + this.size = size; + return this; + } + + /** + * Number of cases in current page + * + * @return size + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSize() { + return size; + } + + public void setSize(Long size) { + this.size = size; + } + + public CasesResponseMetaPagination total(Long total) { + this.total = total; + return this; + } + + /** + * Total number of pages + * + * @return total + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTotal() { + return total; + } + + public void setTotal(Long total) { + this.total = total; + } + + /** + * 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 CasesResponseMetaPagination + */ + @JsonAnySetter + public CasesResponseMetaPagination 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 CasesResponseMetaPagination object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CasesResponseMetaPagination casesResponseMetaPagination = (CasesResponseMetaPagination) o; + return Objects.equals(this.current, casesResponseMetaPagination.current) + && Objects.equals(this.size, casesResponseMetaPagination.size) + && Objects.equals(this.total, casesResponseMetaPagination.total) + && Objects.equals( + this.additionalProperties, casesResponseMetaPagination.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(current, size, total, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CasesResponseMetaPagination {\n"); + sb.append(" current: ").append(toIndentedString(current)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).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/JiraIssue.java b/src/main/java/com/datadog/api/client/v2/model/JiraIssue.java new file mode 100644 index 00000000000..99596ab8aa0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/JiraIssue.java @@ -0,0 +1,153 @@ +/* + * 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; + +/** Jira issue attached to case */ +@JsonPropertyOrder({JiraIssue.JSON_PROPERTY_RESULT, JiraIssue.JSON_PROPERTY_STATUS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class JiraIssue { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_RESULT = "result"; + private JiraIssueResult result; + + public static final String JSON_PROPERTY_STATUS = "status"; + private Case3rdPartyTicketStatus status = Case3rdPartyTicketStatus.IN_PROGRESS; + + public JiraIssue result(JiraIssueResult result) { + this.result = result; + this.unparsed |= result.unparsed; + return this; + } + + /** + * Jira issue information + * + * @return result + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JiraIssueResult getResult() { + return result; + } + + public void setResult(JiraIssueResult result) { + this.result = result; + } + + /** + * Case status + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Case3rdPartyTicketStatus getStatus() { + return status; + } + + /** + * 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 JiraIssue + */ + @JsonAnySetter + public JiraIssue 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 JiraIssue object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JiraIssue jiraIssue = (JiraIssue) o; + return Objects.equals(this.result, jiraIssue.result) + && Objects.equals(this.status, jiraIssue.status) + && Objects.equals(this.additionalProperties, jiraIssue.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(result, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JiraIssue {\n"); + sb.append(" result: ").append(toIndentedString(result)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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/JiraIssueResult.java b/src/main/java/com/datadog/api/client/v2/model/JiraIssueResult.java new file mode 100644 index 00000000000..ecd341be81e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/JiraIssueResult.java @@ -0,0 +1,218 @@ +/* + * 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; + +/** Jira issue information */ +@JsonPropertyOrder({ + JiraIssueResult.JSON_PROPERTY_ISSUE_ID, + JiraIssueResult.JSON_PROPERTY_ISSUE_KEY, + JiraIssueResult.JSON_PROPERTY_ISSUE_URL, + JiraIssueResult.JSON_PROPERTY_PROJECT_KEY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class JiraIssueResult { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ISSUE_ID = "issue_id"; + private String issueId; + + public static final String JSON_PROPERTY_ISSUE_KEY = "issue_key"; + private String issueKey; + + public static final String JSON_PROPERTY_ISSUE_URL = "issue_url"; + private String issueUrl; + + public static final String JSON_PROPERTY_PROJECT_KEY = "project_key"; + private String projectKey; + + public JiraIssueResult issueId(String issueId) { + this.issueId = issueId; + return this; + } + + /** + * Jira issue ID + * + * @return issueId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ISSUE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIssueId() { + return issueId; + } + + public void setIssueId(String issueId) { + this.issueId = issueId; + } + + public JiraIssueResult issueKey(String issueKey) { + this.issueKey = issueKey; + return this; + } + + /** + * Jira issue key + * + * @return issueKey + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ISSUE_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIssueKey() { + return issueKey; + } + + public void setIssueKey(String issueKey) { + this.issueKey = issueKey; + } + + public JiraIssueResult issueUrl(String issueUrl) { + this.issueUrl = issueUrl; + return this; + } + + /** + * Jira issue URL + * + * @return issueUrl + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ISSUE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIssueUrl() { + return issueUrl; + } + + public void setIssueUrl(String issueUrl) { + this.issueUrl = issueUrl; + } + + public JiraIssueResult projectKey(String projectKey) { + this.projectKey = projectKey; + return this; + } + + /** + * Jira project key + * + * @return projectKey + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROJECT_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProjectKey() { + return projectKey; + } + + public void setProjectKey(String projectKey) { + this.projectKey = projectKey; + } + + /** + * 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 JiraIssueResult + */ + @JsonAnySetter + public JiraIssueResult 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 JiraIssueResult object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JiraIssueResult jiraIssueResult = (JiraIssueResult) o; + return Objects.equals(this.issueId, jiraIssueResult.issueId) + && Objects.equals(this.issueKey, jiraIssueResult.issueKey) + && Objects.equals(this.issueUrl, jiraIssueResult.issueUrl) + && Objects.equals(this.projectKey, jiraIssueResult.projectKey) + && Objects.equals(this.additionalProperties, jiraIssueResult.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(issueId, issueKey, issueUrl, projectKey, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JiraIssueResult {\n"); + sb.append(" issueId: ").append(toIndentedString(issueId)).append("\n"); + sb.append(" issueKey: ").append(toIndentedString(issueKey)).append("\n"); + sb.append(" issueUrl: ").append(toIndentedString(issueUrl)).append("\n"); + sb.append(" projectKey: ").append(toIndentedString(projectKey)).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/NullableUserRelationship.java b/src/main/java/com/datadog/api/client/v2/model/NullableUserRelationship.java new file mode 100644 index 00000000000..ce239da5a9d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/NullableUserRelationship.java @@ -0,0 +1,151 @@ +/* + * 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 user. */ +@JsonPropertyOrder({NullableUserRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class NullableUserRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private NullableUserRelationshipData data; + + public NullableUserRelationship() {} + + @JsonCreator + public NullableUserRelationship( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + NullableUserRelationshipData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + public NullableUserRelationship data(NullableUserRelationshipData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + return this; + } + + /** + * Relationship to user object. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public NullableUserRelationshipData getData() { + return data; + } + + public void setData(NullableUserRelationshipData 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 NullableUserRelationship + */ + @JsonAnySetter + public NullableUserRelationship 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 NullableUserRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NullableUserRelationship nullableUserRelationship = (NullableUserRelationship) o; + return Objects.equals(this.data, nullableUserRelationship.data) + && Objects.equals(this.additionalProperties, nullableUserRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NullableUserRelationship {\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/NullableUserRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/NullableUserRelationshipData.java new file mode 100644 index 00000000000..9201fef4272 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/NullableUserRelationshipData.java @@ -0,0 +1,179 @@ +/* + * 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 user object. */ +@JsonPropertyOrder({ + NullableUserRelationshipData.JSON_PROPERTY_ID, + NullableUserRelationshipData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class NullableUserRelationshipData { + @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 UserResourceType type = UserResourceType.USER; + + public NullableUserRelationshipData() {} + + @JsonCreator + public NullableUserRelationshipData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) UserResourceType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public NullableUserRelationshipData id(String id) { + this.id = id; + return this; + } + + /** + * A unique identifier that represents the user. + * + * @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 NullableUserRelationshipData type(UserResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * User resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UserResourceType getType() { + return type; + } + + public void setType(UserResourceType 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 NullableUserRelationshipData + */ + @JsonAnySetter + public NullableUserRelationshipData 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 NullableUserRelationshipData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NullableUserRelationshipData nullableUserRelationshipData = (NullableUserRelationshipData) o; + return Objects.equals(this.id, nullableUserRelationshipData.id) + && Objects.equals(this.type, nullableUserRelationshipData.type) + && Objects.equals( + this.additionalProperties, nullableUserRelationshipData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NullableUserRelationshipData {\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/Project.java b/src/main/java/com/datadog/api/client/v2/model/Project.java new file mode 100644 index 00000000000..b8548362459 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/Project.java @@ -0,0 +1,236 @@ +/* + * 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; + +/** A Project */ +@JsonPropertyOrder({ + Project.JSON_PROPERTY_ATTRIBUTES, + Project.JSON_PROPERTY_ID, + Project.JSON_PROPERTY_RELATIONSHIPS, + Project.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class Project { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ProjectAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private ProjectRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProjectResourceType type = ProjectResourceType.PROJECT; + + public Project() {} + + @JsonCreator + public Project( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) ProjectAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ProjectResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public Project attributes(ProjectAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Project attributes + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProjectAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ProjectAttributes attributes) { + this.attributes = attributes; + } + + public Project id(String id) { + this.id = id; + return this; + } + + /** + * The Project's 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 Project relationships(ProjectRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Project relationships + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProjectRelationships getRelationships() { + return relationships; + } + + public void setRelationships(ProjectRelationships relationships) { + this.relationships = relationships; + } + + public Project type(ProjectResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Project resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProjectResourceType getType() { + return type; + } + + public void setType(ProjectResourceType 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 Project + */ + @JsonAnySetter + public Project 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 Project object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Project project = (Project) o; + return Objects.equals(this.attributes, project.attributes) + && Objects.equals(this.id, project.id) + && Objects.equals(this.relationships, project.relationships) + && Objects.equals(this.type, project.type) + && Objects.equals(this.additionalProperties, project.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Project {\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/ProjectAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ProjectAttributes.java new file mode 100644 index 00000000000..1bf83a8e8ad --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectAttributes.java @@ -0,0 +1,161 @@ +/* + * 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; + +/** Project attributes */ +@JsonPropertyOrder({ProjectAttributes.JSON_PROPERTY_KEY, ProjectAttributes.JSON_PROPERTY_NAME}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProjectAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_KEY = "key"; + private String key; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public ProjectAttributes key(String key) { + this.key = key; + return this; + } + + /** + * The project's key + * + * @return key + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public ProjectAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Project's name + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ProjectAttributes + */ + @JsonAnySetter + public ProjectAttributes 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 ProjectAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectAttributes projectAttributes = (ProjectAttributes) o; + return Objects.equals(this.key, projectAttributes.key) + && Objects.equals(this.name, projectAttributes.name) + && Objects.equals(this.additionalProperties, projectAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(key, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectAttributes {\n"); + sb.append(" key: ").append(toIndentedString(key)).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/ProjectCreate.java b/src/main/java/com/datadog/api/client/v2/model/ProjectCreate.java new file mode 100644 index 00000000000..351ed30033f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectCreate.java @@ -0,0 +1,178 @@ +/* + * 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; + +/** Project create */ +@JsonPropertyOrder({ProjectCreate.JSON_PROPERTY_ATTRIBUTES, ProjectCreate.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProjectCreate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ProjectCreateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProjectResourceType type = ProjectResourceType.PROJECT; + + public ProjectCreate() {} + + @JsonCreator + public ProjectCreate( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ProjectCreateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ProjectResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProjectCreate attributes(ProjectCreateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Project creation attributes + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProjectCreateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ProjectCreateAttributes attributes) { + this.attributes = attributes; + } + + public ProjectCreate type(ProjectResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Project resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProjectResourceType getType() { + return type; + } + + public void setType(ProjectResourceType 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 ProjectCreate + */ + @JsonAnySetter + public ProjectCreate 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 ProjectCreate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectCreate projectCreate = (ProjectCreate) o; + return Objects.equals(this.attributes, projectCreate.attributes) + && Objects.equals(this.type, projectCreate.type) + && Objects.equals(this.additionalProperties, projectCreate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectCreate {\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/ProjectCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ProjectCreateAttributes.java new file mode 100644 index 00000000000..784ae91c209 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectCreateAttributes.java @@ -0,0 +1,173 @@ +/* + * 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; + +/** Project creation attributes */ +@JsonPropertyOrder({ + ProjectCreateAttributes.JSON_PROPERTY_KEY, + ProjectCreateAttributes.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProjectCreateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_KEY = "key"; + private String key; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public ProjectCreateAttributes() {} + + @JsonCreator + public ProjectCreateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_KEY) String key, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.key = key; + this.name = name; + } + + public ProjectCreateAttributes key(String key) { + this.key = key; + return this; + } + + /** + * Project's key. Cannot be "CASE" + * + * @return key + */ + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public ProjectCreateAttributes name(String name) { + this.name = name; + return this; + } + + /** + * name + * + * @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 ProjectCreateAttributes + */ + @JsonAnySetter + public ProjectCreateAttributes 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 ProjectCreateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectCreateAttributes projectCreateAttributes = (ProjectCreateAttributes) o; + return Objects.equals(this.key, projectCreateAttributes.key) + && Objects.equals(this.name, projectCreateAttributes.name) + && Objects.equals(this.additionalProperties, projectCreateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(key, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectCreateAttributes {\n"); + sb.append(" key: ").append(toIndentedString(key)).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/ProjectCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/ProjectCreateRequest.java new file mode 100644 index 00000000000..ee0f4083f54 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectCreateRequest.java @@ -0,0 +1,145 @@ +/* + * 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; + +/** Project create request */ +@JsonPropertyOrder({ProjectCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProjectCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ProjectCreate data; + + public ProjectCreateRequest() {} + + @JsonCreator + public ProjectCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) ProjectCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ProjectCreateRequest data(ProjectCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Project create + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProjectCreate getData() { + return data; + } + + public void setData(ProjectCreate 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 ProjectCreateRequest + */ + @JsonAnySetter + public ProjectCreateRequest 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 ProjectCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectCreateRequest projectCreateRequest = (ProjectCreateRequest) o; + return Objects.equals(this.data, projectCreateRequest.data) + && Objects.equals(this.additionalProperties, projectCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectCreateRequest {\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/ProjectRelationship.java b/src/main/java/com/datadog/api/client/v2/model/ProjectRelationship.java new file mode 100644 index 00000000000..5e15b94cca9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectRelationship.java @@ -0,0 +1,145 @@ +/* + * 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 project */ +@JsonPropertyOrder({ProjectRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProjectRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ProjectRelationshipData data; + + public ProjectRelationship() {} + + @JsonCreator + public ProjectRelationship( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) ProjectRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ProjectRelationship data(ProjectRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Relationship to project object + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProjectRelationshipData getData() { + return data; + } + + public void setData(ProjectRelationshipData 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 ProjectRelationship + */ + @JsonAnySetter + public ProjectRelationship 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 ProjectRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectRelationship projectRelationship = (ProjectRelationship) o; + return Objects.equals(this.data, projectRelationship.data) + && Objects.equals(this.additionalProperties, projectRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectRelationship {\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/ProjectRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/ProjectRelationshipData.java new file mode 100644 index 00000000000..24689a57ac6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectRelationshipData.java @@ -0,0 +1,178 @@ +/* + * 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 project object */ +@JsonPropertyOrder({ + ProjectRelationshipData.JSON_PROPERTY_ID, + ProjectRelationshipData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProjectRelationshipData { + @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 ProjectResourceType type = ProjectResourceType.PROJECT; + + public ProjectRelationshipData() {} + + @JsonCreator + public ProjectRelationshipData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ProjectResourceType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProjectRelationshipData id(String id) { + this.id = id; + return this; + } + + /** + * A unique identifier that represents the project + * + * @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 ProjectRelationshipData type(ProjectResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Project resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProjectResourceType getType() { + return type; + } + + public void setType(ProjectResourceType 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 ProjectRelationshipData + */ + @JsonAnySetter + public ProjectRelationshipData 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 ProjectRelationshipData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectRelationshipData projectRelationshipData = (ProjectRelationshipData) o; + return Objects.equals(this.id, projectRelationshipData.id) + && Objects.equals(this.type, projectRelationshipData.type) + && Objects.equals(this.additionalProperties, projectRelationshipData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectRelationshipData {\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/ProjectRelationships.java b/src/main/java/com/datadog/api/client/v2/model/ProjectRelationships.java new file mode 100644 index 00000000000..62384935967 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectRelationships.java @@ -0,0 +1,166 @@ +/* + * 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; + +/** Project relationships */ +@JsonPropertyOrder({ + ProjectRelationships.JSON_PROPERTY_MEMBER_TEAM, + ProjectRelationships.JSON_PROPERTY_MEMBER_USER +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProjectRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_MEMBER_TEAM = "member_team"; + private RelationshipToTeamLinks memberTeam; + + public static final String JSON_PROPERTY_MEMBER_USER = "member_user"; + private UsersRelationship memberUser; + + public ProjectRelationships memberTeam(RelationshipToTeamLinks memberTeam) { + this.memberTeam = memberTeam; + this.unparsed |= memberTeam.unparsed; + return this; + } + + /** + * Relationship between a team and a team link + * + * @return memberTeam + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MEMBER_TEAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationshipToTeamLinks getMemberTeam() { + return memberTeam; + } + + public void setMemberTeam(RelationshipToTeamLinks memberTeam) { + this.memberTeam = memberTeam; + } + + public ProjectRelationships memberUser(UsersRelationship memberUser) { + this.memberUser = memberUser; + this.unparsed |= memberUser.unparsed; + return this; + } + + /** + * Relationship to users. + * + * @return memberUser + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MEMBER_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UsersRelationship getMemberUser() { + return memberUser; + } + + public void setMemberUser(UsersRelationship memberUser) { + this.memberUser = memberUser; + } + + /** + * 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 ProjectRelationships + */ + @JsonAnySetter + public ProjectRelationships 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 ProjectRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectRelationships projectRelationships = (ProjectRelationships) o; + return Objects.equals(this.memberTeam, projectRelationships.memberTeam) + && Objects.equals(this.memberUser, projectRelationships.memberUser) + && Objects.equals(this.additionalProperties, projectRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(memberTeam, memberUser, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectRelationships {\n"); + sb.append(" memberTeam: ").append(toIndentedString(memberTeam)).append("\n"); + sb.append(" memberUser: ").append(toIndentedString(memberUser)).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/ProjectResourceType.java b/src/main/java/com/datadog/api/client/v2/model/ProjectResourceType.java new file mode 100644 index 00000000000..d97b1f1fb7a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectResourceType.java @@ -0,0 +1,54 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +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; + +/** Project resource type */ +@JsonSerialize(using = ProjectResourceType.ProjectResourceTypeSerializer.class) +public class ProjectResourceType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("project")); + + public static final ProjectResourceType PROJECT = new ProjectResourceType("project"); + + ProjectResourceType(String value) { + super(value, allowedValues); + } + + public static class ProjectResourceTypeSerializer extends StdSerializer { + public ProjectResourceTypeSerializer(Class t) { + super(t); + } + + public ProjectResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProjectResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProjectResourceType fromValue(String value) { + return new ProjectResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProjectResponse.java b/src/main/java/com/datadog/api/client/v2/model/ProjectResponse.java new file mode 100644 index 00000000000..3d79e915c27 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectResponse.java @@ -0,0 +1,136 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Project response */ +@JsonPropertyOrder({ProjectResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProjectResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private Project data; + + public ProjectResponse data(Project data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A Project + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Project getData() { + return data; + } + + public void setData(Project 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 ProjectResponse + */ + @JsonAnySetter + public ProjectResponse 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 ProjectResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectResponse projectResponse = (ProjectResponse) o; + return Objects.equals(this.data, projectResponse.data) + && Objects.equals(this.additionalProperties, projectResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectResponse {\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/ProjectsResponse.java b/src/main/java/com/datadog/api/client/v2/model/ProjectsResponse.java new file mode 100644 index 00000000000..bcc2223efd0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectsResponse.java @@ -0,0 +1,149 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response with projects */ +@JsonPropertyOrder({ProjectsResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProjectsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public ProjectsResponse data(List data) { + this.data = data; + for (Project item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ProjectsResponse addDataItem(Project dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Projects response data + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + 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 ProjectsResponse + */ + @JsonAnySetter + public ProjectsResponse 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 ProjectsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectsResponse projectsResponse = (ProjectsResponse) o; + return Objects.equals(this.data, projectsResponse.data) + && Objects.equals(this.additionalProperties, projectsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectsResponse {\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/ServiceNowTicket.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTicket.java new file mode 100644 index 00000000000..9ff967c5514 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTicket.java @@ -0,0 +1,153 @@ +/* + * 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; + +/** ServiceNow ticket attached to case */ +@JsonPropertyOrder({ServiceNowTicket.JSON_PROPERTY_RESULT, ServiceNowTicket.JSON_PROPERTY_STATUS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowTicket { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_RESULT = "result"; + private ServiceNowTicketResult result; + + public static final String JSON_PROPERTY_STATUS = "status"; + private Case3rdPartyTicketStatus status = Case3rdPartyTicketStatus.IN_PROGRESS; + + public ServiceNowTicket result(ServiceNowTicketResult result) { + this.result = result; + this.unparsed |= result.unparsed; + return this; + } + + /** + * ServiceNow ticket information + * + * @return result + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ServiceNowTicketResult getResult() { + return result; + } + + public void setResult(ServiceNowTicketResult result) { + this.result = result; + } + + /** + * Case status + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Case3rdPartyTicketStatus getStatus() { + return status; + } + + /** + * 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 ServiceNowTicket + */ + @JsonAnySetter + public ServiceNowTicket 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 ServiceNowTicket object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowTicket serviceNowTicket = (ServiceNowTicket) o; + return Objects.equals(this.result, serviceNowTicket.result) + && Objects.equals(this.status, serviceNowTicket.status) + && Objects.equals(this.additionalProperties, serviceNowTicket.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(result, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowTicket {\n"); + sb.append(" result: ").append(toIndentedString(result)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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/ServiceNowTicketResult.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTicketResult.java new file mode 100644 index 00000000000..c7775820247 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTicketResult.java @@ -0,0 +1,135 @@ +/* + * 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; + +/** ServiceNow ticket information */ +@JsonPropertyOrder({ServiceNowTicketResult.JSON_PROPERTY_SYS_TARGET_LINK}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowTicketResult { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_SYS_TARGET_LINK = "sys_target_link"; + private String sysTargetLink; + + public ServiceNowTicketResult sysTargetLink(String sysTargetLink) { + this.sysTargetLink = sysTargetLink; + return this; + } + + /** + * Link to the Incident created on ServiceNow + * + * @return sysTargetLink + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SYS_TARGET_LINK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSysTargetLink() { + return sysTargetLink; + } + + public void setSysTargetLink(String sysTargetLink) { + this.sysTargetLink = sysTargetLink; + } + + /** + * 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 ServiceNowTicketResult + */ + @JsonAnySetter + public ServiceNowTicketResult 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 ServiceNowTicketResult object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowTicketResult serviceNowTicketResult = (ServiceNowTicketResult) o; + return Objects.equals(this.sysTargetLink, serviceNowTicketResult.sysTargetLink) + && Objects.equals(this.additionalProperties, serviceNowTicketResult.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(sysTargetLink, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowTicketResult {\n"); + sb.append(" sysTargetLink: ").append(toIndentedString(sysTargetLink)).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/UserRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/UserRelationshipData.java new file mode 100644 index 00000000000..e488edb561c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UserRelationshipData.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; + +/** Relationship to user object. */ +@JsonPropertyOrder({UserRelationshipData.JSON_PROPERTY_ID, UserRelationshipData.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UserRelationshipData { + @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 UserResourceType type = UserResourceType.USER; + + public UserRelationshipData() {} + + @JsonCreator + public UserRelationshipData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) UserResourceType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public UserRelationshipData id(String id) { + this.id = id; + return this; + } + + /** + * A unique identifier that represents the user. + * + * @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 UserRelationshipData type(UserResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * User resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UserResourceType getType() { + return type; + } + + public void setType(UserResourceType 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 UserRelationshipData + */ + @JsonAnySetter + public UserRelationshipData 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 UserRelationshipData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserRelationshipData userRelationshipData = (UserRelationshipData) o; + return Objects.equals(this.id, userRelationshipData.id) + && Objects.equals(this.type, userRelationshipData.type) + && Objects.equals(this.additionalProperties, userRelationshipData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserRelationshipData {\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/UserResourceType.java b/src/main/java/com/datadog/api/client/v2/model/UserResourceType.java new file mode 100644 index 00000000000..c7da64fd5d5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UserResourceType.java @@ -0,0 +1,53 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 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; + +/** User resource type. */ +@JsonSerialize(using = UserResourceType.UserResourceTypeSerializer.class) +public class UserResourceType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("user")); + + public static final UserResourceType USER = new UserResourceType("user"); + + UserResourceType(String value) { + super(value, allowedValues); + } + + public static class UserResourceTypeSerializer extends StdSerializer { + public UserResourceTypeSerializer(Class t) { + super(t); + } + + public UserResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize(UserResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static UserResourceType fromValue(String value) { + return new UserResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UsersRelationship.java b/src/main/java/com/datadog/api/client/v2/model/UsersRelationship.java new file mode 100644 index 00000000000..5b8e9ed24c8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UsersRelationship.java @@ -0,0 +1,154 @@ +/* + * 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 users. */ +@JsonPropertyOrder({UsersRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UsersRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public UsersRelationship() {} + + @JsonCreator + public UsersRelationship( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public UsersRelationship data(List data) { + this.data = data; + for (UserRelationshipData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public UsersRelationship addDataItem(UserRelationshipData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Relationships to user objects. + * + * @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 UsersRelationship + */ + @JsonAnySetter + public UsersRelationship 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 UsersRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UsersRelationship usersRelationship = (UsersRelationship) o; + return Objects.equals(this.data, usersRelationship.data) + && Objects.equals(this.additionalProperties, usersRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UsersRelationship {\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/test/resources/cassettes/features/v1/Validate_API_key_returns_Forbidden_response.json b/src/test/resources/cassettes/features/v1/Validate_API_key_returns_Forbidden_response.json index 1489fb9e00e..907a2641363 100644 --- a/src/test/resources/cassettes/features/v1/Validate_API_key_returns_Forbidden_response.json +++ b/src/test/resources/cassettes/features/v1/Validate_API_key_returns_Forbidden_response.json @@ -23,6 +23,6 @@ "timeToLive": { "unlimited": true }, - "id": "3f83caea-c405-97df-c554-ee2d9f9e4f01" + "id": "3f83caea-c405-97df-c554-ee2d9f9e4f02" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Validate_API_key_returns_OK_response.json b/src/test/resources/cassettes/features/v1/Validate_API_key_returns_OK_response.json index 45e484f0b48..d03bf9ca97e 100644 --- a/src/test/resources/cassettes/features/v1/Validate_API_key_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v1/Validate_API_key_returns_OK_response.json @@ -23,6 +23,6 @@ "timeToLive": { "unlimited": true }, - "id": "3f83caea-c405-97df-c554-ee2d9f9e4f02" + "id": "3f83caea-c405-97df-c554-ee2d9f9e4f01" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Archive_case_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Archive_case_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..ef6c63cf9ee --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Archive_case_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2024-02-07T18:00:35.988Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Archive_case_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Archive_case_returns_Bad_Request_response.json new file mode 100644 index 00000000000..57c2f6aecda --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Archive_case_returns_Bad_Request_response.json @@ -0,0 +1,62 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"priority\":\"P4\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}},\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"1f205230-5ea9-444e-a5f9-48f93d6a2cde\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"created_at\":\"2024-02-07T18:00:36.54518451Z\",\"creation_source\":\"MANUAL\",\"description\":\"\",\"insights\":[],\"internal_id\":\"1f205230-5ea9-444e-a5f9-48f93d6a2cde\",\"key\":\"DDFC-2\",\"priority\":\"P4\",\"public_id\":\"62\",\"status\":\"OPEN\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0a6534d0-42f2-5075-64f8-7ab28f449a8e" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"type\":\"project\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases/1f205230-5ea9-444e-a5f9-48f93d6a2cde/archive", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"got type \\\"project\\\" expected one of \\\"case\\\"\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "2c0f4f45-8dc6-58df-fb53-fc17524fd2fd" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Archive_case_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Archive_case_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..6b42677b0f5 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Archive_case_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2024-02-07T13:09:07.949Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Archive_case_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Archive_case_returns_Not_Found_response.json new file mode 100644 index 00000000000..3d3f5f671a9 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Archive_case_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases/67d80aa3-36ff-44b9-a694-c501a7591737/archive", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"code\":\"resource_not_found\",\"title\":\"case not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "aad1f7d5-d833-b983-1b11-d9674f694a13" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Archive_case_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Archive_case_returns_OK_response.freeze new file mode 100644 index 00000000000..558899ce6da --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Archive_case_returns_OK_response.freeze @@ -0,0 +1 @@ +2024-02-07T18:00:36.901Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Archive_case_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Archive_case_returns_OK_response.json new file mode 100644 index 00000000000..e197debca4b --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Archive_case_returns_OK_response.json @@ -0,0 +1,62 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"priority\":\"P4\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}},\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"99e6e8cd-f115-4168-8814-30776007f44c\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"created_at\":\"2024-02-07T18:00:37.185776261Z\",\"creation_source\":\"MANUAL\",\"description\":\"\",\"insights\":[],\"internal_id\":\"99e6e8cd-f115-4168-8814-30776007f44c\",\"key\":\"DDFC-3\",\"priority\":\"P4\",\"public_id\":\"63\",\"status\":\"OPEN\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0a6534d0-42f2-5075-64f8-7ab28f449a93" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases/99e6e8cd-f115-4168-8814-30776007f44c/archive", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"99e6e8cd-f115-4168-8814-30776007f44c\",\"type\":\"case\",\"attributes\":{\"archived_at\":\"2024-02-07T18:00:37.47125606Z\",\"attributes\":{},\"created_at\":\"2024-02-07T18:00:37.185776Z\",\"creation_source\":\"MANUAL\",\"description\":\"\",\"insights\":[],\"internal_id\":\"99e6e8cd-f115-4168-8814-30776007f44c\",\"key\":\"DDFC-3\",\"priority\":\"P4\",\"public_id\":\"63\",\"status\":\"OPEN\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"modified_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "8a5e0b6d-99bb-a8c7-3455-cfaf3bd14fa2" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Assign_case_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Assign_case_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..9f1a33f2842 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Assign_case_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2024-02-12T13:25:55.665Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Assign_case_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Assign_case_returns_Bad_Request_response.json new file mode 100644 index 00000000000..d85348d9d3d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Assign_case_returns_Bad_Request_response.json @@ -0,0 +1,62 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"priority\":\"P4\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}},\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"4039be1a-5f87-4666-b986-a8396c0225c3\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"created_at\":\"2024-02-12T13:25:56.280897807Z\",\"creation_source\":\"MANUAL\",\"description\":\"\",\"insights\":[],\"internal_id\":\"4039be1a-5f87-4666-b986-a8396c0225c3\",\"key\":\"DDFC-17\",\"priority\":\"P4\",\"public_id\":\"77\",\"status\":\"OPEN\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0a6534d0-42f2-5075-64f8-7ab28f449a92" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"assignee_id\":\"invalid-uuid\"},\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases/4039be1a-5f87-4666-b986-a8396c0225c3/assign", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"code\":\"invalid_command\",\"title\":\"error when validating input command: 'assigneeid' field must be an uuid\",\"meta\":{\"entity\":\"assigneeid\",\"rule\":\"uuid\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "14525dd1-f986-8c8a-6c89-279b8b2e7c21" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Assign_case_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Assign_case_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..1f0ce04277c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Assign_case_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2024-02-07T13:09:08.433Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Assign_case_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Assign_case_returns_Not_Found_response.json new file mode 100644 index 00000000000..1db66a9c933 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Assign_case_returns_Not_Found_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Assign_case_returns_Not_Found_response-1707311348@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/users", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"users\",\"id\":\"14040f89-c5ba-11ee-87b5-f6892353f87d\",\"attributes\":{\"name\":null,\"handle\":\"test-assign_case_returns_not_found_response-1707311348@datadoghq.com\",\"created_at\":\"2024-02-07T13:09:08.546371+00:00\",\"modified_at\":\"2024-02-07T13:09:08.546371+00:00\",\"email\":\"test-assign_case_returns_not_found_response-1707311348@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/e0a6ed9703a1166a2c07bca15e37d0d6?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\"},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "1873797e-d953-ac5e-016a-7e24e4d69188" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"assignee_id\":\"14040f89-c5ba-11ee-87b5-f6892353f87d\"},\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases/67d80aa3-36ff-44b9-a694-c501a7591737/assign", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"code\":\"resource_not_found\",\"title\":\"case not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9018b92e-0bbe-dcd0-dc0b-9f6a749f7ce3" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/users/14040f89-c5ba-11ee-87b5-f6892353f87d", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a3c3af12-5456-ebfd-d381-8f81136e3a00" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Assign_case_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Assign_case_returns_OK_response.freeze new file mode 100644 index 00000000000..5b2d1f17d03 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Assign_case_returns_OK_response.freeze @@ -0,0 +1 @@ +2024-02-07T18:00:38.147Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Assign_case_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Assign_case_returns_OK_response.json new file mode 100644 index 00000000000..1474be84ebb --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Assign_case_returns_OK_response.json @@ -0,0 +1,113 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"priority\":\"P4\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}},\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"a0801fce-a045-4b66-ad78-effcd959fa4f\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"created_at\":\"2024-02-07T18:00:38.353039559Z\",\"creation_source\":\"MANUAL\",\"description\":\"\",\"insights\":[],\"internal_id\":\"a0801fce-a045-4b66-ad78-effcd959fa4f\",\"key\":\"DDFC-5\",\"priority\":\"P4\",\"public_id\":\"65\",\"status\":\"OPEN\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0a6534d0-42f2-5075-64f8-7ab28f449a99" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Assign_case_returns_OK_response-1707328838@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/users", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"users\",\"id\":\"cced7029-c5e2-11ee-ac63-c24751e8bab0\",\"attributes\":{\"name\":null,\"handle\":\"test-assign_case_returns_ok_response-1707328838@datadoghq.com\",\"created_at\":\"2024-02-07T18:00:38.645791+00:00\",\"modified_at\":\"2024-02-07T18:00:38.645791+00:00\",\"email\":\"test-assign_case_returns_ok_response-1707328838@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/dd4005a3eca9e7c6aed30c77d193bc37?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\"},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "cab62f98-b410-a5fa-7744-fb417093528b" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"assignee_id\":\"cced7029-c5e2-11ee-ac63-c24751e8bab0\"},\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases/a0801fce-a045-4b66-ad78-effcd959fa4f/assign", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"a0801fce-a045-4b66-ad78-effcd959fa4f\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"created_at\":\"2024-02-07T18:00:38.35304Z\",\"creation_source\":\"MANUAL\",\"description\":\"\",\"insights\":[],\"internal_id\":\"a0801fce-a045-4b66-ad78-effcd959fa4f\",\"key\":\"DDFC-5\",\"modified_at\":\"2024-02-07T18:00:39.010235Z\",\"priority\":\"P4\",\"public_id\":\"65\",\"status\":\"OPEN\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"assignee\":{\"data\":{\"id\":\"cced7029-c5e2-11ee-ac63-c24751e8bab0\",\"type\":\"user\"}},\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"modified_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}},{\"id\":\"cced7029-c5e2-11ee-ac63-c24751e8bab0\",\"type\":\"user\",\"attributes\":{\"email\":\"test-assign_case_returns_ok_response-1707328838@datadoghq.com\",\"handle\":\"test-assign_case_returns_ok_response-1707328838@datadoghq.com\",\"name\":\"\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7e6da293-a277-1b77-ea44-1ae9eb6f5a5e" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/users/cced7029-c5e2-11ee-ac63-c24751e8bab0", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "fe717567-adbe-91c8-b084-60c20fa5c5e9" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Scanning_Group_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Create_Scanning_Group_returns_OK_response.json index d4da02f53f6..0d01fe2f239 100644 --- a/src/test/resources/cassettes/features/v2/Create_Scanning_Group_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Create_Scanning_Group_returns_OK_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e7b" + "id": "01611a93-5e74-0630-3c51-f707c3b51e81" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Create_Scanning_Rule_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Create_Scanning_Rule_returns_Bad_Request_response.json index ec22aee3c0f..40cb9164dbf 100644 --- a/src/test/resources/cassettes/features/v2/Create_Scanning_Rule_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Create_Scanning_Rule_returns_Bad_Request_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e7a" + "id": "01611a93-5e74-0630-3c51-f707c3b51e7d" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15a" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15d" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Create_Scanning_Rule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Create_Scanning_Rule_returns_OK_response.json index 3cfbd1a7126..3240ae69a7c 100644 --- a/src/test/resources/cassettes/features/v2/Create_Scanning_Rule_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Create_Scanning_Rule_returns_OK_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e79" + "id": "01611a93-5e74-0630-3c51-f707c3b51e83" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed159" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed161" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Create_a_case_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_case_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..14b7cfa0a25 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_case_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2024-02-07T13:09:09.415Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_case_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Create_a_case_returns_Bad_Request_response.json new file mode 100644 index 00000000000..06ec1cdb1ea --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_case_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"priority\":\"NOT_DEFINED\",\"title\":\"Security breach investigation\",\"type\":\"STANDARD\"},\"relationships\":{\"assignee\":{\"data\":{\"id\":\"00000000-0000-0000-0000-000000000000\",\"type\":\"userx\"}},\"project\":{\"data\":{\"id\":\"e555e290-ed65-49bd-ae18-8acbfcf18db7\",\"type\":\"project\"}}},\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"got type \\\"userx\\\" expected one of \\\"user\\\"\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c53a0d91-6308-6fd6-b142-d95814505a59" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_case_returns_CREATED_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_case_returns_CREATED_response.freeze new file mode 100644 index 00000000000..1132edd29cf --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_case_returns_CREATED_response.freeze @@ -0,0 +1 @@ +2024-02-07T18:00:39.566Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_case_returns_CREATED_response.json b/src/test/resources/cassettes/features/v2/Create_a_case_returns_CREATED_response.json new file mode 100644 index 00000000000..3dec97b0fb1 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_case_returns_CREATED_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Create_a_case_returns_CREATED_response-1707328839@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/users", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"users\",\"id\":\"cda929dc-c5e2-11ee-883d-6ad03867f364\",\"attributes\":{\"name\":null,\"handle\":\"test-create_a_case_returns_created_response-1707328839@datadoghq.com\",\"created_at\":\"2024-02-07T18:00:39.876070+00:00\",\"modified_at\":\"2024-02-07T18:00:39.876070+00:00\",\"email\":\"test-create_a_case_returns_created_response-1707328839@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/e564f62a22caae2dd8e878a8d73c6328?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\"},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "36db4962-07ad-731f-d8d6-3ecdf39f6022" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"priority\":\"NOT_DEFINED\",\"title\":\"Security breach investigation in 3b9b6a6abdcf0b9b\",\"type\":\"STANDARD\"},\"relationships\":{\"assignee\":{\"data\":{\"id\":\"cda929dc-c5e2-11ee-883d-6ad03867f364\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}},\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"4045de8b-3808-4bb6-94c9-f55ced4811c7\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"created_at\":\"2024-02-07T18:00:40.197151067Z\",\"creation_source\":\"MANUAL\",\"description\":\"\",\"insights\":[],\"internal_id\":\"4045de8b-3808-4bb6-94c9-f55ced4811c7\",\"key\":\"DDFC-6\",\"priority\":\"NOT_DEFINED\",\"public_id\":\"66\",\"status\":\"OPEN\",\"title\":\"Security breach investigation in 3b9b6a6abdcf0b9b\",\"type\":\"STANDARD\"},\"relationships\":{\"assignee\":{\"data\":{\"id\":\"cda929dc-c5e2-11ee-883d-6ad03867f364\",\"type\":\"user\"}},\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}},{\"id\":\"cda929dc-c5e2-11ee-883d-6ad03867f364\",\"type\":\"user\",\"attributes\":{\"email\":\"test-create_a_case_returns_created_response-1707328839@datadoghq.com\",\"handle\":\"test-create_a_case_returns_created_response-1707328839@datadoghq.com\",\"name\":\"\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "dcf87674-5c60-25c6-0298-fd31cf40a6eb" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/users/cda929dc-c5e2-11ee-883d-6ad03867f364", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "36b3e412-5eb7-c7bc-9563-5e1f4e74d719" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_Scanning_Group_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Delete_Scanning_Group_returns_OK_response.json index baed961b56d..bd84fafc3cc 100644 --- a/src/test/resources/cassettes/features/v2/Delete_Scanning_Group_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_Scanning_Group_returns_OK_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e7f" + "id": "01611a93-5e74-0630-3c51-f707c3b51e82" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15d" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed160" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Delete_Scanning_Rule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Delete_Scanning_Rule_returns_OK_response.json index 50b12b87da9..d691749a546 100644 --- a/src/test/resources/cassettes/features/v2/Delete_Scanning_Rule_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_Scanning_Rule_returns_OK_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e78" + "id": "01611a93-5e74-0630-3c51-f707c3b51e7b" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed158" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15b" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Delete_a_RUM_application_returns_No_Content_response.json b/src/test/resources/cassettes/features/v2/Delete_a_RUM_application_returns_No_Content_response.json index 22c45d1ce03..4da418c20a8 100644 --- a/src/test/resources/cassettes/features/v2/Delete_a_RUM_application_returns_No_Content_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_a_RUM_application_returns_No_Content_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "74945625-c01a-a598-e538-65a53ceb0688" + "id": "74945625-c01a-a598-e538-65a53ceb0689" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Delete_a_retention_filter_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Delete_a_retention_filter_returns_OK_response.json index ac8bc143773..f4924fa1a3a 100644 --- a/src/test/resources/cassettes/features/v2/Delete_a_retention_filter_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_a_retention_filter_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "b2404278-8cc9-cba4-e3eb-03a7fdff0699" + "id": "b2404278-8cc9-cba4-e3eb-03a7fdff0697" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Get_a_RUM_application_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_a_RUM_application_returns_OK_response.json index 6eb177f1090..6c223ae84f6 100644 --- a/src/test/resources/cassettes/features/v2/Get_a_RUM_application_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Get_a_RUM_application_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "74945625-c01a-a598-e538-65a53ceb0689" + "id": "74945625-c01a-a598-e538-65a53ceb0687" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Get_a_given_APM_retention_filter_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_a_given_APM_retention_filter_returns_OK_response.json index 97cf0ae625f..4c6a0d5633a 100644 --- a/src/test/resources/cassettes/features/v2/Get_a_given_APM_retention_filter_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Get_a_given_APM_retention_filter_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "b2404278-8cc9-cba4-e3eb-03a7fdff069a" + "id": "b2404278-8cc9-cba4-e3eb-03a7fdff069d" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Get_all_rules_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_all_rules_returns_OK_response.json index 6e336f005de..e1d7d6dfa5f 100644 --- a/src/test/resources/cassettes/features/v2/Get_all_rules_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Get_all_rules_returns_OK_response.json @@ -23,6 +23,6 @@ "timeToLive": { "unlimited": true }, - "id": "7e2e839d-ac73-21dc-b480-36e366ae09d9" + "id": "7e2e839d-ac73-21dc-b480-36e366ae09da" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_the_details_of_a_case_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Get_the_details_of_a_case_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..3601a30777b --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_the_details_of_a_case_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2024-02-07T13:09:09.931Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_the_details_of_a_case_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Get_the_details_of_a_case_returns_Not_Found_response.json new file mode 100644 index 00000000000..8464b541169 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_the_details_of_a_case_returns_Not_Found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/cases/67d80aa3-36ff-44b9-a694-c501a7591737", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"code\":\"resource_not_found\",\"title\":\"case not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9c63e853-7a00-7b42-9e54-bbfd11806251" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_the_details_of_a_case_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_the_details_of_a_case_returns_OK_response.freeze new file mode 100644 index 00000000000..a1285495136 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_the_details_of_a_case_returns_OK_response.freeze @@ -0,0 +1 @@ +2024-02-07T18:00:40.743Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_the_details_of_a_case_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_the_details_of_a_case_returns_OK_response.json new file mode 100644 index 00000000000..7fa984903a5 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_the_details_of_a_case_returns_OK_response.json @@ -0,0 +1,58 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"priority\":\"P4\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}},\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"8fd1a1c3-3f55-4d6b-807f-ca70bc0e5749\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"created_at\":\"2024-02-07T18:00:41.007812312Z\",\"creation_source\":\"MANUAL\",\"description\":\"\",\"insights\":[],\"internal_id\":\"8fd1a1c3-3f55-4d6b-807f-ca70bc0e5749\",\"key\":\"DDFC-7\",\"priority\":\"P4\",\"public_id\":\"67\",\"status\":\"OPEN\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0a6534d0-42f2-5075-64f8-7ab28f449a8f" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/cases/8fd1a1c3-3f55-4d6b-807f-ca70bc0e5749", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"8fd1a1c3-3f55-4d6b-807f-ca70bc0e5749\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"created_at\":\"2024-02-07T18:00:41.007812Z\",\"creation_source\":\"MANUAL\",\"description\":\"\",\"insights\":[],\"internal_id\":\"8fd1a1c3-3f55-4d6b-807f-ca70bc0e5749\",\"key\":\"DDFC-7\",\"priority\":\"P4\",\"public_id\":\"67\",\"status\":\"OPEN\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "204e0ca3-57c0-d612-6f7b-5c5f14d218bc" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_Scanning_Groups_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_Scanning_Groups_returns_OK_response.json index ae02bc3a8a1..d2d78d0ea4d 100644 --- a/src/test/resources/cassettes/features/v2/List_Scanning_Groups_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/List_Scanning_Groups_returns_OK_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e7c" + "id": "01611a93-5e74-0630-3c51-f707c3b51e7f" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15b" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15f" }, { "httpRequest": { @@ -79,7 +79,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e7d" + "id": "01611a93-5e74-0630-3c51-f707c3b51e80" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/List_all_APM_retention_filters_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_all_APM_retention_filters_returns_OK_response.json index 2f35bb2913b..149499704f0 100644 --- a/src/test/resources/cassettes/features/v2/List_all_APM_retention_filters_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/List_all_APM_retention_filters_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "b2404278-8cc9-cba4-e3eb-03a7fdff0698" + "id": "b2404278-8cc9-cba4-e3eb-03a7fdff069c" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/List_all_rules_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_all_rules_returns_OK_response.json index 2cd151adcdb..80e2da9ecca 100644 --- a/src/test/resources/cassettes/features/v2/List_all_rules_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/List_all_rules_returns_OK_response.json @@ -23,6 +23,6 @@ "timeToLive": { "unlimited": true }, - "id": "7e2e839d-ac73-21dc-b480-36e366ae09da" + "id": "7e2e839d-ac73-21dc-b480-36e366ae09d9" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_all_the_RUM_applications_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_all_the_RUM_applications_returns_OK_response.json index 05b8c833489..091e1cbf573 100644 --- a/src/test/resources/cassettes/features/v2/List_all_the_RUM_applications_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/List_all_the_RUM_applications_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "74945625-c01a-a598-e538-65a53ceb0686" + "id": "74945625-c01a-a598-e538-65a53ceb0685" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/List_permissions_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_permissions_returns_OK_response.json index 7c020bbd2c5..7cb8db6b046 100644 --- a/src/test/resources/cassettes/features/v2/List_permissions_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/List_permissions_returns_OK_response.json @@ -23,6 +23,6 @@ "timeToLive": { "unlimited": true }, - "id": "ab2c08c1-60c7-9278-3246-d650bb89216e" + "id": "ab2c08c1-60c7-9278-3246-d650bb89216f" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Reorder_Groups_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Reorder_Groups_returns_Bad_Request_response.json index 74838959077..ffa6bb756ed 100644 --- a/src/test/resources/cassettes/features/v2/Reorder_Groups_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Reorder_Groups_returns_Bad_Request_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e82" + "id": "01611a93-5e74-0630-3c51-f707c3b51e7c" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed160" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15c" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Reorder_Groups_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Reorder_Groups_returns_OK_response.json index ceba876c75e..a2fa327f769 100644 --- a/src/test/resources/cassettes/features/v2/Reorder_Groups_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Reorder_Groups_returns_OK_response.json @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15c" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15e" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Revoke_permission_returns_Not_found_response.json b/src/test/resources/cassettes/features/v2/Revoke_permission_returns_Not_found_response.json index 3dff09f12da..7cd1af6e974 100644 --- a/src/test/resources/cassettes/features/v2/Revoke_permission_returns_Not_found_response.json +++ b/src/test/resources/cassettes/features/v2/Revoke_permission_returns_Not_found_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "ab2c08c1-60c7-9278-3246-d650bb892172" + "id": "ab2c08c1-60c7-9278-3246-d650bb892170" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Revoke_permission_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Revoke_permission_returns_OK_response.json index ef0345587d6..3d0ff2153be 100644 --- a/src/test/resources/cassettes/features/v2/Revoke_permission_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Revoke_permission_returns_OK_response.json @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "ab2c08c1-60c7-9278-3246-d650bb89216f" + "id": "ab2c08c1-60c7-9278-3246-d650bb892171" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Unarchive_case_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Unarchive_case_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..5d3fc771c20 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Unarchive_case_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2024-02-07T18:00:41.393Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Unarchive_case_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Unarchive_case_returns_Bad_Request_response.json new file mode 100644 index 00000000000..84138d6e409 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Unarchive_case_returns_Bad_Request_response.json @@ -0,0 +1,62 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"priority\":\"P4\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}},\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"91b52d3b-4d67-4b7f-ba4d-da67d8b46798\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"created_at\":\"2024-02-07T18:00:41.662578539Z\",\"creation_source\":\"MANUAL\",\"description\":\"\",\"insights\":[],\"internal_id\":\"91b52d3b-4d67-4b7f-ba4d-da67d8b46798\",\"key\":\"DDFC-8\",\"priority\":\"P4\",\"public_id\":\"68\",\"status\":\"OPEN\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0a6534d0-42f2-5075-64f8-7ab28f449a8d" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"type\":\"project\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases/91b52d3b-4d67-4b7f-ba4d-da67d8b46798/unarchive", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"got type \\\"project\\\" expected one of \\\"case\\\"\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "5b23316a-1fcd-0359-328a-dfcea4f169b7" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Unarchive_case_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Unarchive_case_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..df6e8d3aea0 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Unarchive_case_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2024-02-07T13:09:10.329Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Unarchive_case_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Unarchive_case_returns_Not_Found_response.json new file mode 100644 index 00000000000..3576a3eec50 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Unarchive_case_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases/67d80aa3-36ff-44b9-a694-c501a7591737/unarchive", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"code\":\"resource_not_found\",\"title\":\"case not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "29a32511-d4fa-5a96-ef86-da4143f604aa" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Unarchive_case_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Unarchive_case_returns_OK_response.freeze new file mode 100644 index 00000000000..c639a2463ee --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Unarchive_case_returns_OK_response.freeze @@ -0,0 +1 @@ +2024-02-07T18:00:42.027Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Unarchive_case_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Unarchive_case_returns_OK_response.json new file mode 100644 index 00000000000..29e93cf35f9 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Unarchive_case_returns_OK_response.json @@ -0,0 +1,62 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"priority\":\"P4\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}},\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"020e2ce7-9fe8-4273-81ae-1e5873fba9d3\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"created_at\":\"2024-02-07T18:00:42.286687881Z\",\"creation_source\":\"MANUAL\",\"description\":\"\",\"insights\":[],\"internal_id\":\"020e2ce7-9fe8-4273-81ae-1e5873fba9d3\",\"key\":\"DDFC-9\",\"priority\":\"P4\",\"public_id\":\"69\",\"status\":\"OPEN\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0a6534d0-42f2-5075-64f8-7ab28f449a91" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases/020e2ce7-9fe8-4273-81ae-1e5873fba9d3/unarchive", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"020e2ce7-9fe8-4273-81ae-1e5873fba9d3\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"created_at\":\"2024-02-07T18:00:42.286688Z\",\"creation_source\":\"MANUAL\",\"description\":\"\",\"insights\":[],\"internal_id\":\"020e2ce7-9fe8-4273-81ae-1e5873fba9d3\",\"key\":\"DDFC-9\",\"priority\":\"P4\",\"public_id\":\"69\",\"status\":\"OPEN\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b0b5632a-23eb-2bb3-7871-201d11f2f4ea" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Unassign_case_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Unassign_case_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..a7b2a9e33bf --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Unassign_case_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2024-02-07T18:00:42.637Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Unassign_case_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Unassign_case_returns_Bad_Request_response.json new file mode 100644 index 00000000000..c3f3a32c1c1 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Unassign_case_returns_Bad_Request_response.json @@ -0,0 +1,62 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"priority\":\"P4\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}},\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"8a6e4254-7429-4398-99c2-ba9363fb3f98\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"created_at\":\"2024-02-07T18:00:42.908434394Z\",\"creation_source\":\"MANUAL\",\"description\":\"\",\"insights\":[],\"internal_id\":\"8a6e4254-7429-4398-99c2-ba9363fb3f98\",\"key\":\"DDFC-10\",\"priority\":\"P4\",\"public_id\":\"70\",\"status\":\"OPEN\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0a6534d0-42f2-5075-64f8-7ab28f449a96" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"type\":\"project\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases/8a6e4254-7429-4398-99c2-ba9363fb3f98/unassign", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"got type \\\"project\\\" expected one of \\\"case\\\"\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b1fb0b97-98b0-316c-65c7-308eace539bb" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Unassign_case_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Unassign_case_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..fee1f808458 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Unassign_case_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2024-02-07T13:09:10.714Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Unassign_case_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Unassign_case_returns_Not_Found_response.json new file mode 100644 index 00000000000..621f40e242b --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Unassign_case_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases/67d80aa3-36ff-44b9-a694-c501a7591737/unassign", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"code\":\"resource_not_found\",\"title\":\"case not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b22c2067-ba11-bbaf-0f08-e4f705959fc4" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Unassign_case_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Unassign_case_returns_OK_response.freeze new file mode 100644 index 00000000000..0a5d0226a27 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Unassign_case_returns_OK_response.freeze @@ -0,0 +1 @@ +2024-02-07T18:00:43.176Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Unassign_case_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Unassign_case_returns_OK_response.json new file mode 100644 index 00000000000..5d6cce9baa5 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Unassign_case_returns_OK_response.json @@ -0,0 +1,62 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"priority\":\"P4\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}},\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"8c5de575-685c-4ac4-a78a-9774c4f2160b\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"created_at\":\"2024-02-07T18:00:43.427988311Z\",\"creation_source\":\"MANUAL\",\"description\":\"\",\"insights\":[],\"internal_id\":\"8c5de575-685c-4ac4-a78a-9774c4f2160b\",\"key\":\"DDFC-11\",\"priority\":\"P4\",\"public_id\":\"71\",\"status\":\"OPEN\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0a6534d0-42f2-5075-64f8-7ab28f449a97" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases/8c5de575-685c-4ac4-a78a-9774c4f2160b/unassign", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"8c5de575-685c-4ac4-a78a-9774c4f2160b\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"created_at\":\"2024-02-07T18:00:43.427988Z\",\"creation_source\":\"MANUAL\",\"description\":\"\",\"insights\":[],\"internal_id\":\"8c5de575-685c-4ac4-a78a-9774c4f2160b\",\"key\":\"DDFC-11\",\"priority\":\"P4\",\"public_id\":\"71\",\"status\":\"OPEN\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "2f95a0d5-20ae-92d5-f3e1-ac541bfe4bd0" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_Scanning_Group_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_Scanning_Group_returns_OK_response.json index b5b37b15e5f..03f59af1021 100644 --- a/src/test/resources/cassettes/features/v2/Update_Scanning_Group_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Update_Scanning_Group_returns_OK_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e81" + "id": "01611a93-5e74-0630-3c51-f707c3b51e78" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15f" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed158" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_Scanning_Rule_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_Scanning_Rule_returns_Bad_Request_response.json index ff221b17974..c68ccca3a71 100644 --- a/src/test/resources/cassettes/features/v2/Update_Scanning_Rule_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Update_Scanning_Rule_returns_Bad_Request_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e83" + "id": "01611a93-5e74-0630-3c51-f707c3b51e7a" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed161" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15a" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_Scanning_Rule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_Scanning_Rule_returns_OK_response.json index 20446e086d6..152209afc64 100644 --- a/src/test/resources/cassettes/features/v2/Update_Scanning_Rule_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Update_Scanning_Rule_returns_OK_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e80" + "id": "01611a93-5e74-0630-3c51-f707c3b51e79" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15e" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed159" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_a_RUM_application_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_a_RUM_application_returns_OK_response.json index d8d637f2962..e93acc76609 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_RUM_application_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Update_a_RUM_application_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "74945625-c01a-a598-e538-65a53ceb0687" + "id": "74945625-c01a-a598-e538-65a53ceb0688" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_a_RUM_application_returns_Unprocessable_Entity_response.json b/src/test/resources/cassettes/features/v2/Update_a_RUM_application_returns_Unprocessable_Entity_response.json index af7b4883977..8a61f2abca2 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_RUM_application_returns_Unprocessable_Entity_response.json +++ b/src/test/resources/cassettes/features/v2/Update_a_RUM_application_returns_Unprocessable_Entity_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "74945625-c01a-a598-e538-65a53ceb0685" + "id": "74945625-c01a-a598-e538-65a53ceb0686" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_a_retention_filter_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_a_retention_filter_returns_Bad_Request_response.json index 8ddaeee820e..af34ab432a4 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_retention_filter_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Update_a_retention_filter_returns_Bad_Request_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "b2404278-8cc9-cba4-e3eb-03a7fdff069b" + "id": "b2404278-8cc9-cba4-e3eb-03a7fdff0698" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_a_retention_filter_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Update_a_retention_filter_returns_Not_Found_response.json index 170166752c7..f8e2615c3f8 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_retention_filter_returns_Not_Found_response.json +++ b/src/test/resources/cassettes/features/v2/Update_a_retention_filter_returns_Not_Found_response.json @@ -27,6 +27,6 @@ "timeToLive": { "unlimited": true }, - "id": "ce266f9d-5f90-251e-805b-1fa5bbd62feb" + "id": "ce266f9d-5f90-251e-805b-1fa5bbd62fea" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_retention_filter_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_a_retention_filter_returns_OK_response.json index 14ea2ab34bd..5fed3161324 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_retention_filter_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Update_a_retention_filter_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "b2404278-8cc9-cba4-e3eb-03a7fdff069c" + "id": "b2404278-8cc9-cba4-e3eb-03a7fdff0699" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_a_retention_filters_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_a_retention_filters_returns_Bad_Request_response.json index 9e6921507b6..889d546c6ee 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_retention_filters_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Update_a_retention_filters_returns_Bad_Request_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "b2404278-8cc9-cba4-e3eb-03a7fdff0697" + "id": "b2404278-8cc9-cba4-e3eb-03a7fdff069b" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_a_retention_filters_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Update_a_retention_filters_returns_Not_Found_response.json index f8e2615c3f8..170166752c7 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_retention_filters_returns_Not_Found_response.json +++ b/src/test/resources/cassettes/features/v2/Update_a_retention_filters_returns_Not_Found_response.json @@ -27,6 +27,6 @@ "timeToLive": { "unlimited": true }, - "id": "ce266f9d-5f90-251e-805b-1fa5bbd62fea" + "id": "ce266f9d-5f90-251e-805b-1fa5bbd62feb" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_retention_filters_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_a_retention_filters_returns_OK_response.json index a41c541ef11..4dbd4d81382 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_retention_filters_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Update_a_retention_filters_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "b2404278-8cc9-cba4-e3eb-03a7fdff069d" + "id": "b2404278-8cc9-cba4-e3eb-03a7fdff069a" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_a_role_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_a_role_returns_Bad_Request_response.json index 1722bd3d627..a75c509829f 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_role_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Update_a_role_returns_Bad_Request_response.json @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "ab2c08c1-60c7-9278-3246-d650bb892170" + "id": "ab2c08c1-60c7-9278-3246-d650bb892172" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_a_role_returns_Bad_Role_ID_response.json b/src/test/resources/cassettes/features/v2/Update_a_role_returns_Bad_Role_ID_response.json index c116895ce32..3fa0fe3b8cb 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_role_returns_Bad_Role_ID_response.json +++ b/src/test/resources/cassettes/features/v2/Update_a_role_returns_Bad_Role_ID_response.json @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "ab2c08c1-60c7-9278-3246-d650bb892171" + "id": "ab2c08c1-60c7-9278-3246-d650bb89216d" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_a_role_returns_Not_found_response.json b/src/test/resources/cassettes/features/v2/Update_a_role_returns_Not_found_response.json index f5af311afeb..efc154b6994 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_role_returns_Not_found_response.json +++ b/src/test/resources/cassettes/features/v2/Update_a_role_returns_Not_found_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "ab2c08c1-60c7-9278-3246-d650bb89216d" + "id": "ab2c08c1-60c7-9278-3246-d650bb89216c" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_a_role_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_a_role_returns_OK_response.json index 3e8008f2657..69b6d8df1b2 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_role_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Update_a_role_returns_OK_response.json @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "ab2c08c1-60c7-9278-3246-d650bb89216c" + "id": "ab2c08c1-60c7-9278-3246-d650bb89216e" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_case_priority_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Update_case_priority_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..da678b9cae1 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_case_priority_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2024-02-07T18:00:43.807Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_case_priority_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_case_priority_returns_Bad_Request_response.json new file mode 100644 index 00000000000..9d67d745049 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_case_priority_returns_Bad_Request_response.json @@ -0,0 +1,62 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"priority\":\"P4\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}},\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"09077090-4370-4539-b9e5-445173f4fced\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"created_at\":\"2024-02-07T18:00:44.06773183Z\",\"creation_source\":\"MANUAL\",\"description\":\"\",\"insights\":[],\"internal_id\":\"09077090-4370-4539-b9e5-445173f4fced\",\"key\":\"DDFC-12\",\"priority\":\"P4\",\"public_id\":\"72\",\"status\":\"OPEN\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0a6534d0-42f2-5075-64f8-7ab28f449a94" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"priority\":\"P1234\"},\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases/09077090-4370-4539-b9e5-445173f4fced/priority", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"invalid priority P1234. Must be one of P3, P4, P5, NOT_DEFINED, P1, P2\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e2cc2f56-78c1-0d29-21fd-c3df2edc80aa" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_case_priority_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Update_case_priority_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..33edf5b4580 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_case_priority_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2024-02-07T13:09:11.084Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_case_priority_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Update_case_priority_returns_Not_Found_response.json new file mode 100644 index 00000000000..508fd877531 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_case_priority_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"priority\":\"P3\"},\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases/67d80aa3-36ff-44b9-a694-c501a7591737/priority", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"code\":\"resource_not_found\",\"title\":\"case not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "fdf36d1e-6b7e-f1f0-eaef-3e8b96c7a303" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_case_priority_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Update_case_priority_returns_OK_response.freeze new file mode 100644 index 00000000000..ac293b567ad --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_case_priority_returns_OK_response.freeze @@ -0,0 +1 @@ +2024-02-07T18:00:44.433Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_case_priority_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_case_priority_returns_OK_response.json new file mode 100644 index 00000000000..ab0d51da39a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_case_priority_returns_OK_response.json @@ -0,0 +1,62 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"priority\":\"P4\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}},\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"60fdb1eb-209a-4072-9db3-4d08a9c4180c\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"created_at\":\"2024-02-07T18:00:44.723781245Z\",\"creation_source\":\"MANUAL\",\"description\":\"\",\"insights\":[],\"internal_id\":\"60fdb1eb-209a-4072-9db3-4d08a9c4180c\",\"key\":\"DDFC-13\",\"priority\":\"P4\",\"public_id\":\"73\",\"status\":\"OPEN\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0a6534d0-42f2-5075-64f8-7ab28f449a90" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"priority\":\"P3\"},\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases/60fdb1eb-209a-4072-9db3-4d08a9c4180c/priority", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"60fdb1eb-209a-4072-9db3-4d08a9c4180c\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"created_at\":\"2024-02-07T18:00:44.723781Z\",\"creation_source\":\"MANUAL\",\"description\":\"\",\"insights\":[],\"internal_id\":\"60fdb1eb-209a-4072-9db3-4d08a9c4180c\",\"key\":\"DDFC-13\",\"modified_at\":\"2024-02-07T18:00:45.028076Z\",\"priority\":\"P3\",\"public_id\":\"73\",\"status\":\"OPEN\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"modified_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "10019189-077c-6bb2-5820-1d3153e262b7" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_case_status_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Update_case_status_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..8a9c88da383 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_case_status_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2024-02-07T18:00:45.069Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_case_status_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_case_status_returns_Bad_Request_response.json new file mode 100644 index 00000000000..816d6079991 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_case_status_returns_Bad_Request_response.json @@ -0,0 +1,62 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"priority\":\"P4\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}},\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"243feddb-69f8-4e22-988a-8ae954b643fa\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"created_at\":\"2024-02-07T18:00:45.265151303Z\",\"creation_source\":\"MANUAL\",\"description\":\"\",\"insights\":[],\"internal_id\":\"243feddb-69f8-4e22-988a-8ae954b643fa\",\"key\":\"DDFC-14\",\"priority\":\"P4\",\"public_id\":\"74\",\"status\":\"OPEN\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0a6534d0-42f2-5075-64f8-7ab28f449a95" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"status\":\"OPENED\"},\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases/243feddb-69f8-4e22-988a-8ae954b643fa/status", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"invalid status OPENED. Must be one of CLOSED, SUNKNOWN, OPEN, IN_PROGRESS\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c5f2d986-2127-f3dd-8520-055bb7d96b9e" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_case_status_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Update_case_status_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..52aa1297fc5 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_case_status_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2024-02-07T13:09:11.471Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_case_status_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Update_case_status_returns_Not_Found_response.json new file mode 100644 index 00000000000..0287c2feaa1 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_case_status_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"status\":\"OPEN\"},\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases/67d80aa3-36ff-44b9-a694-c501a7591737/status", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"code\":\"resource_not_found\",\"title\":\"case not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "eb9efabf-11d1-a48e-ae13-79e6ed33a2fc" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_case_status_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Update_case_status_returns_OK_response.freeze new file mode 100644 index 00000000000..2c362818582 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_case_status_returns_OK_response.freeze @@ -0,0 +1 @@ +2024-02-07T18:00:45.628Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_case_status_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_case_status_returns_OK_response.json new file mode 100644 index 00000000000..5013b0d27f4 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_case_status_returns_OK_response.json @@ -0,0 +1,62 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"priority\":\"P4\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}},\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"ceae478d-b504-4cb7-bad2-e8f8e5a0a77b\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"created_at\":\"2024-02-07T18:00:45.905784777Z\",\"creation_source\":\"MANUAL\",\"description\":\"\",\"insights\":[],\"internal_id\":\"ceae478d-b504-4cb7-bad2-e8f8e5a0a77b\",\"key\":\"DDFC-15\",\"priority\":\"P4\",\"public_id\":\"75\",\"status\":\"OPEN\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0a6534d0-42f2-5075-64f8-7ab28f449a98" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"status\":\"IN_PROGRESS\"},\"type\":\"case\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/cases/ceae478d-b504-4cb7-bad2-e8f8e5a0a77b/status", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"ceae478d-b504-4cb7-bad2-e8f8e5a0a77b\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"created_at\":\"2024-02-07T18:00:45.905785Z\",\"creation_source\":\"MANUAL\",\"description\":\"\",\"insights\":[],\"internal_id\":\"ceae478d-b504-4cb7-bad2-e8f8e5a0a77b\",\"key\":\"DDFC-15\",\"modified_at\":\"2024-02-07T18:00:46.22949Z\",\"priority\":\"P4\",\"public_id\":\"75\",\"status\":\"IN_PROGRESS\",\"title\":\"My new case\",\"type\":\"STANDARD\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"modified_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "2fa23473-52a0-ad7e-0155-a0f8fd387cf5" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/cases.feature b/src/test/resources/com/datadog/api/client/v2/api/cases.feature new file mode 100644 index 00000000000..5a0eca61555 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/cases.feature @@ -0,0 +1,241 @@ +@endpoint(cases) @endpoint(cases-v2) +Feature: Cases + View and manage cases within Datadog + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "Cases" API + + @team:DataDog/case-management + Scenario: Archive case returns "Bad Request" response + Given new "ArchiveCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"type": "project"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Archive case returns "Not Found" response + Given new "ArchiveCase" request + And request contains "case_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + And body with value {"data": {"type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/case-management + Scenario: Archive case returns "OK" response + Given new "ArchiveCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"type": "case"}} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/case-management + Scenario: Assign case returns "Bad Request" response + Given new "AssignCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"attributes": {"assignee_id": "invalid-uuid"}, "type": "case"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Assign case returns "Not Found" response + Given new "AssignCase" request + And there is a valid "user" in the system + And request contains "case_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + And body with value {"data": {"attributes": {"assignee_id": "{{user.data.id}}"}, "type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/case-management + Scenario: Assign case returns "OK" response + Given new "AssignCase" request + And there is a valid "case" in the system + And there is a valid "user" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"attributes": {"assignee_id": "{{user.data.id}}"}, "type": "case"}} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/case-management + Scenario: Create a case returns "Bad Request" response + Given new "CreateCase" request + And body with value {"data": {"attributes": {"priority": "NOT_DEFINED", "title": "Security breach investigation", "type": "STANDARD"}, "relationships": {"assignee": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "userx"}}, "project": {"data": {"id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "type": "project"}}}, "type": "case"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Create a case returns "CREATED" response + Given new "CreateCase" request + And there is a valid "user" in the system + And body with value {"data": {"attributes": {"priority": "NOT_DEFINED", "title": "Security breach investigation in {{ unique_hash }}", "type": "STANDARD"}, "relationships": {"assignee": {"data": {"id": "{{user.data.id}}", "type": "user"} }, "project": {"data": {"id": "d4bbe1af-f36e-42f1-87c1-493ca35c320e", "type": "project"}}}, "type": "case"}} + When the request is sent + Then the response status is 201 CREATED + And the response "data" has field "id" + And the response "data.attributes.title" is equal to "Security breach investigation in {{ unique_hash }}" + And the response "data.attributes.type" is equal to "STANDARD" + And the response "data.attributes.priority" is equal to "NOT_DEFINED" + + @generated @skip @team:DataDog/case-management + Scenario: Create a case returns "Not Found" response + Given new "CreateCase" request + And body with value {"data": {"attributes": {"priority": "NOT_DEFINED", "title": "Security breach investigation", "type": "STANDARD"}, "relationships": {"assignee": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "user"}}, "project": {"data": {"id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "type": "project"}}}, "type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @skip @team:DataDog/case-management + Scenario: Get the details of a case returns "Bad Request" response + Given new "GetCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Get the details of a case returns "Not Found" response + Given new "GetCase" request + And request contains "case_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/case-management + Scenario: Get the details of a case returns "OK" response + Given new "GetCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Search cases returns "Bad Request" response + Given new "SearchCases" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Search cases returns "Not Found" response + Given new "SearchCases" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Search cases returns "OK" response + Given new "SearchCases" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management @with-pagination + Scenario: Search cases returns "OK" response with pagination + Given new "SearchCases" request + When the request with pagination is sent + Then the response status is 200 OK + + @team:DataDog/case-management + Scenario: Unarchive case returns "Bad Request" response + Given new "UnarchiveCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"type": "project"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Unarchive case returns "Not Found" response + Given new "UnarchiveCase" request + And request contains "case_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + And body with value {"data": {"type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/case-management + Scenario: Unarchive case returns "OK" response + Given new "UnarchiveCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"type": "case"}} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/case-management + Scenario: Unassign case returns "Bad Request" response + Given new "UnassignCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"type": "project"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Unassign case returns "Not Found" response + Given new "UnassignCase" request + And request contains "case_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + And body with value {"data": {"type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/case-management + Scenario: Unassign case returns "OK" response + Given new "UnassignCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"type": "case"}} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/case-management + Scenario: Update case priority returns "Bad Request" response + Given new "UpdatePriority" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"attributes": {"priority": "P1234"}, "type": "case"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Update case priority returns "Not Found" response + Given new "UpdatePriority" request + And request contains "case_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + And body with value {"data": {"attributes": {"priority": "P3"}, "type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/case-management + Scenario: Update case priority returns "OK" response + Given new "UpdatePriority" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"attributes": {"priority": "P3"}, "type": "case"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.priority" is equal to "P3" + + @team:DataDog/case-management + Scenario: Update case status returns "Bad Request" response + Given new "UpdateStatus" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"attributes": {"status": "OPENED"}, "type": "case"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Update case status returns "Not Found" response + Given new "UpdateStatus" request + And request contains "case_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + And body with value {"data": {"attributes": {"status": "OPEN"}, "type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/case-management + Scenario: Update case status returns "OK" response + Given new "UpdateStatus" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"attributes": {"status": "IN_PROGRESS"}, "type": "case"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.status" is equal to "IN_PROGRESS" diff --git a/src/test/resources/com/datadog/api/client/v2/api/cases_projects.feature b/src/test/resources/com/datadog/api/client/v2/api/cases_projects.feature new file mode 100644 index 00000000000..1b3fe63e499 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/cases_projects.feature @@ -0,0 +1,82 @@ +@endpoint(cases-projects) @endpoint(cases-projects-v2) +Feature: Cases Projects + View and manage project within Case Management + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "CasesProjects" API + + @generated @skip @team:DataDog/case-management + Scenario: Create a project returns "Bad Request" response + Given new "CreateProject" request + And body with value {"data": {"attributes": {"key": "SEC", "name": "Security Investigation"}, "type": "project"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Create a project returns "CREATED" response + Given new "CreateProject" request + And body with value {"data": {"attributes": {"key": "SEC", "name": "Security Investigation"}, "type": "project"}} + When the request is sent + Then the response status is 201 CREATED + + @generated @skip @team:DataDog/case-management + Scenario: Create a project returns "Not Found" response + Given new "CreateProject" request + And body with value {"data": {"attributes": {"key": "SEC", "name": "Security Investigation"}, "type": "project"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Get all projects returns "Bad Request" response + Given new "GetProjects" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Get all projects returns "Not Found" response + Given new "GetProjects" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Get all projects returns "OK" response + Given new "GetProjects" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Get the details of a project returns "Bad Request" response + Given new "GetProject" request + And request contains "project_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 the details of a project returns "Not Found" response + Given new "GetProject" request + And request contains "project_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 the details of a project returns "OK" response + Given new "GetProject" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Remove a project returns "API error response" response + Given new "DeleteProject" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response + + @generated @skip @team:DataDog/case-management + Scenario: Remove a project returns "No Content" response + Given new "DeleteProject" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content diff --git a/src/test/resources/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json index da22a5fc35d..cbaee96cb71 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/given.json +++ b/src/test/resources/com/datadog/api/client/v2/api/given.json @@ -59,6 +59,19 @@ "tag": "AuthN Mappings", "operationId": "CreateAuthNMapping" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"title\": \"My new case\",\n \"type\": \"STANDARD\",\n \"priority\": \"P4\"\n },\n \"relationships\": {\n \"project\": {\n \"data\": {\n \"id\": \"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\n \"type\": \"project\"\n }\n }\n },\n \"type\": \"case\"\n }\n}" + } + ], + "source": "data", + "step": "there is a valid \"case\" in the system", + "key": "case", + "tag": "Cases", + "operationId": "CreateCase" + }, { "parameters": [ { diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 61d85e0fcad..1268756c9d2 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 @@ -220,6 +220,91 @@ "type": "idempotent" } }, + "SearchCases": { + "tag": "Cases", + "undo": { + "type": "safe" + } + }, + "CreateCase": { + "tag": "Cases", + "undo": { + "type": "safe" + } + }, + "GetProjects": { + "tag": "Cases Projects", + "undo": { + "type": "safe" + } + }, + "CreateProject": { + "tag": "Cases Projects", + "undo": { + "operationId": "DeleteProject", + "parameters": [ + { + "name": "project_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteProject": { + "tag": "Cases Projects", + "undo": { + "type": "idempotent" + } + }, + "GetProject": { + "tag": "Cases Projects", + "undo": { + "type": "safe" + } + }, + "GetCase": { + "tag": "Cases", + "undo": { + "type": "safe" + } + }, + "ArchiveCase": { + "tag": "Cases", + "undo": { + "type": "idempotent" + } + }, + "AssignCase": { + "tag": "Cases", + "undo": { + "type": "idempotent" + } + }, + "UpdatePriority": { + "tag": "Cases", + "undo": { + "type": "idempotent" + } + }, + "UpdateStatus": { + "tag": "Cases", + "undo": { + "type": "idempotent" + } + }, + "UnarchiveCase": { + "tag": "Cases", + "undo": { + "type": "idempotent" + } + }, + "UnassignCase": { + "tag": "Cases", + "undo": { + "type": "idempotent" + } + }, "CreateCIAppPipelineEvent": { "tag": "CI Visibility Pipelines", "undo": {