diff --git a/.apigentools-info b/.apigentools-info index 1426a575dc..77ee0718c7 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:01.688361", - "spec_repo_commit": "46672359" + "regenerated": "2024-02-12 17:39:31.445533", + "spec_repo_commit": "3cda457d" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-02-06 15:45:01.704595", - "spec_repo_commit": "46672359" + "regenerated": "2024-02-12 17:39:31.467984", + "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 25c4b45133..4e26326131 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/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index a4bb4e32e5..35c89dcebd 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -29,6 +29,20 @@ authn\_mappings\_api :members: :show-inheritance: +cases\_api +---------- + +.. automodule:: datadog_api_client.v2.api.cases_api + :members: + :show-inheritance: + +cases\_projects\_api +-------------------- + +.. automodule:: datadog_api_client.v2.api.cases_projects_api + :members: + :show-inheritance: + ci\_visibility\_pipelines\_api ------------------------------ diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index f80df1d9df..e3c5dec84a 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -722,6 +722,202 @@ bulk\_mute\_findings\_response\_data :members: :show-inheritance: +case +---- + +.. automodule:: datadog_api_client.v2.model.case + :members: + :show-inheritance: + +case3rd\_party\_ticket\_status +------------------------------ + +.. automodule:: datadog_api_client.v2.model.case3rd_party_ticket_status + :members: + :show-inheritance: + +case\_assign +------------ + +.. automodule:: datadog_api_client.v2.model.case_assign + :members: + :show-inheritance: + +case\_assign\_attributes +------------------------ + +.. automodule:: datadog_api_client.v2.model.case_assign_attributes + :members: + :show-inheritance: + +case\_assign\_request +--------------------- + +.. automodule:: datadog_api_client.v2.model.case_assign_request + :members: + :show-inheritance: + +case\_attributes +---------------- + +.. automodule:: datadog_api_client.v2.model.case_attributes + :members: + :show-inheritance: + +case\_create +------------ + +.. automodule:: datadog_api_client.v2.model.case_create + :members: + :show-inheritance: + +case\_create\_attributes +------------------------ + +.. automodule:: datadog_api_client.v2.model.case_create_attributes + :members: + :show-inheritance: + +case\_create\_relationships +--------------------------- + +.. automodule:: datadog_api_client.v2.model.case_create_relationships + :members: + :show-inheritance: + +case\_create\_request +--------------------- + +.. automodule:: datadog_api_client.v2.model.case_create_request + :members: + :show-inheritance: + +case\_empty +----------- + +.. automodule:: datadog_api_client.v2.model.case_empty + :members: + :show-inheritance: + +case\_empty\_request +-------------------- + +.. automodule:: datadog_api_client.v2.model.case_empty_request + :members: + :show-inheritance: + +case\_priority +-------------- + +.. automodule:: datadog_api_client.v2.model.case_priority + :members: + :show-inheritance: + +case\_relationships +------------------- + +.. automodule:: datadog_api_client.v2.model.case_relationships + :members: + :show-inheritance: + +case\_resource\_type +-------------------- + +.. automodule:: datadog_api_client.v2.model.case_resource_type + :members: + :show-inheritance: + +case\_response +-------------- + +.. automodule:: datadog_api_client.v2.model.case_response + :members: + :show-inheritance: + +case\_sortable\_field +--------------------- + +.. automodule:: datadog_api_client.v2.model.case_sortable_field + :members: + :show-inheritance: + +case\_status +------------ + +.. automodule:: datadog_api_client.v2.model.case_status + :members: + :show-inheritance: + +case\_type +---------- + +.. automodule:: datadog_api_client.v2.model.case_type + :members: + :show-inheritance: + +case\_update\_priority +---------------------- + +.. automodule:: datadog_api_client.v2.model.case_update_priority + :members: + :show-inheritance: + +case\_update\_priority\_attributes +---------------------------------- + +.. automodule:: datadog_api_client.v2.model.case_update_priority_attributes + :members: + :show-inheritance: + +case\_update\_priority\_request +------------------------------- + +.. automodule:: datadog_api_client.v2.model.case_update_priority_request + :members: + :show-inheritance: + +case\_update\_status +-------------------- + +.. automodule:: datadog_api_client.v2.model.case_update_status + :members: + :show-inheritance: + +case\_update\_status\_attributes +-------------------------------- + +.. automodule:: datadog_api_client.v2.model.case_update_status_attributes + :members: + :show-inheritance: + +case\_update\_status\_request +----------------------------- + +.. automodule:: datadog_api_client.v2.model.case_update_status_request + :members: + :show-inheritance: + +cases\_response +--------------- + +.. automodule:: datadog_api_client.v2.model.cases_response + :members: + :show-inheritance: + +cases\_response\_meta +--------------------- + +.. automodule:: datadog_api_client.v2.model.cases_response_meta + :members: + :show-inheritance: + +cases\_response\_meta\_pagination +--------------------------------- + +.. automodule:: datadog_api_client.v2.model.cases_response_meta_pagination + :members: + :show-inheritance: + chargeback\_breakdown --------------------- @@ -3942,6 +4138,20 @@ jira\_integration\_metadata\_issues\_item :members: :show-inheritance: +jira\_issue +----------- + +.. automodule:: datadog_api_client.v2.model.jira_issue + :members: + :show-inheritance: + +jira\_issue\_result +------------------- + +.. automodule:: datadog_api_client.v2.model.jira_issue_result + :members: + :show-inheritance: + jsonapi\_error\_item -------------------- @@ -5209,6 +5419,20 @@ nullable\_relationship\_to\_user\_data :members: :show-inheritance: +nullable\_user\_relationship +---------------------------- + +.. automodule:: datadog_api_client.v2.model.nullable_user_relationship + :members: + :show-inheritance: + +nullable\_user\_relationship\_data +---------------------------------- + +.. automodule:: datadog_api_client.v2.model.nullable_user_relationship_data + :members: + :show-inheritance: + okta\_account ------------- @@ -5734,6 +5958,76 @@ process\_summary\_type :members: :show-inheritance: +project +------- + +.. automodule:: datadog_api_client.v2.model.project + :members: + :show-inheritance: + +project\_attributes +------------------- + +.. automodule:: datadog_api_client.v2.model.project_attributes + :members: + :show-inheritance: + +project\_create +--------------- + +.. automodule:: datadog_api_client.v2.model.project_create + :members: + :show-inheritance: + +project\_create\_attributes +--------------------------- + +.. automodule:: datadog_api_client.v2.model.project_create_attributes + :members: + :show-inheritance: + +project\_create\_request +------------------------ + +.. automodule:: datadog_api_client.v2.model.project_create_request + :members: + :show-inheritance: + +project\_relationship +--------------------- + +.. automodule:: datadog_api_client.v2.model.project_relationship + :members: + :show-inheritance: + +project\_relationship\_data +--------------------------- + +.. automodule:: datadog_api_client.v2.model.project_relationship_data + :members: + :show-inheritance: + +project\_relationships +---------------------- + +.. automodule:: datadog_api_client.v2.model.project_relationships + :members: + :show-inheritance: + +project\_resource\_type +----------------------- + +.. automodule:: datadog_api_client.v2.model.project_resource_type + :members: + :show-inheritance: + +project\_response +----------------- + +.. automodule:: datadog_api_client.v2.model.project_response + :members: + :show-inheritance: + projected\_cost --------------- @@ -5762,6 +6056,13 @@ projected\_cost\_type :members: :show-inheritance: +projects\_response +------------------ + +.. automodule:: datadog_api_client.v2.model.projects_response + :members: + :show-inheritance: + query\_formula -------------- @@ -8275,6 +8576,20 @@ service\_definitions\_list\_response :members: :show-inheritance: +service\_now\_ticket +-------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_ticket + :members: + :show-inheritance: + +service\_now\_ticket\_result +---------------------------- + +.. automodule:: datadog_api_client.v2.model.service_now_ticket_result + :members: + :show-inheritance: + slack\_integration\_metadata ---------------------------- @@ -9262,6 +9577,13 @@ user\_invitations\_type :members: :show-inheritance: +user\_relationship\_data +------------------------ + +.. automodule:: datadog_api_client.v2.model.user_relationship_data + :members: + :show-inheritance: + user\_relationships ------------------- @@ -9269,6 +9591,13 @@ user\_relationships :members: :show-inheritance: +user\_resource\_type +-------------------- + +.. automodule:: datadog_api_client.v2.model.user_resource_type + :members: + :show-inheritance: + user\_response -------------- @@ -9423,6 +9752,13 @@ user\_update\_request :members: :show-inheritance: +users\_relationship +------------------- + +.. automodule:: datadog_api_client.v2.model.users_relationship + :members: + :show-inheritance: + users\_response --------------- diff --git a/examples/v2/cases-projects/CreateProject.py b/examples/v2/cases-projects/CreateProject.py new file mode 100644 index 0000000000..141e530f98 --- /dev/null +++ b/examples/v2/cases-projects/CreateProject.py @@ -0,0 +1,27 @@ +""" +Create a project returns "CREATED" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cases_projects_api import CasesProjectsApi +from datadog_api_client.v2.model.project_create import ProjectCreate +from datadog_api_client.v2.model.project_create_attributes import ProjectCreateAttributes +from datadog_api_client.v2.model.project_create_request import ProjectCreateRequest +from datadog_api_client.v2.model.project_resource_type import ProjectResourceType + +body = ProjectCreateRequest( + data=ProjectCreate( + attributes=ProjectCreateAttributes( + key="SEC", + name="Security Investigation", + ), + type=ProjectResourceType.PROJECT, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CasesProjectsApi(api_client) + response = api_instance.create_project(body=body) + + print(response) diff --git a/examples/v2/cases-projects/DeleteProject.py b/examples/v2/cases-projects/DeleteProject.py new file mode 100644 index 0000000000..b0ea017bcf --- /dev/null +++ b/examples/v2/cases-projects/DeleteProject.py @@ -0,0 +1,13 @@ +""" +Remove a project returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cases_projects_api import CasesProjectsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CasesProjectsApi(api_client) + api_instance.delete_project( + project_id="project_id", + ) diff --git a/examples/v2/cases-projects/GetProject.py b/examples/v2/cases-projects/GetProject.py new file mode 100644 index 0000000000..877ae97b5d --- /dev/null +++ b/examples/v2/cases-projects/GetProject.py @@ -0,0 +1,15 @@ +""" +Get the details of a project returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cases_projects_api import CasesProjectsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CasesProjectsApi(api_client) + response = api_instance.get_project( + project_id="project_id", + ) + + print(response) diff --git a/examples/v2/cases-projects/GetProjects.py b/examples/v2/cases-projects/GetProjects.py new file mode 100644 index 0000000000..5f6784dbef --- /dev/null +++ b/examples/v2/cases-projects/GetProjects.py @@ -0,0 +1,13 @@ +""" +Get all projects returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cases_projects_api import CasesProjectsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CasesProjectsApi(api_client) + response = api_instance.get_projects() + + print(response) diff --git a/examples/v2/cases/ArchiveCase.py b/examples/v2/cases/ArchiveCase.py new file mode 100644 index 0000000000..ec678a4f55 --- /dev/null +++ b/examples/v2/cases/ArchiveCase.py @@ -0,0 +1,26 @@ +""" +Archive case returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cases_api import CasesApi +from datadog_api_client.v2.model.case_empty import CaseEmpty +from datadog_api_client.v2.model.case_empty_request import CaseEmptyRequest +from datadog_api_client.v2.model.case_resource_type import CaseResourceType + +# there is a valid "case" in the system +CASE_ID = environ["CASE_ID"] + +body = CaseEmptyRequest( + data=CaseEmpty( + type=CaseResourceType.CASE, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CasesApi(api_client) + response = api_instance.archive_case(case_id=CASE_ID, body=body) + + print(response) diff --git a/examples/v2/cases/AssignCase.py b/examples/v2/cases/AssignCase.py new file mode 100644 index 0000000000..9d07306eb6 --- /dev/null +++ b/examples/v2/cases/AssignCase.py @@ -0,0 +1,33 @@ +""" +Assign case returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cases_api import CasesApi +from datadog_api_client.v2.model.case_assign import CaseAssign +from datadog_api_client.v2.model.case_assign_attributes import CaseAssignAttributes +from datadog_api_client.v2.model.case_assign_request import CaseAssignRequest +from datadog_api_client.v2.model.case_resource_type import CaseResourceType + +# there is a valid "case" in the system +CASE_ID = environ["CASE_ID"] + +# there is a valid "user" in the system +USER_DATA_ID = environ["USER_DATA_ID"] + +body = CaseAssignRequest( + data=CaseAssign( + attributes=CaseAssignAttributes( + assignee_id=USER_DATA_ID, + ), + type=CaseResourceType.CASE, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CasesApi(api_client) + response = api_instance.assign_case(case_id=CASE_ID, body=body) + + print(response) diff --git a/examples/v2/cases/CreateCase.py b/examples/v2/cases/CreateCase.py new file mode 100644 index 0000000000..c77e38da2a --- /dev/null +++ b/examples/v2/cases/CreateCase.py @@ -0,0 +1,55 @@ +""" +Create a case returns "CREATED" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cases_api import CasesApi +from datadog_api_client.v2.model.case_create import CaseCreate +from datadog_api_client.v2.model.case_create_attributes import CaseCreateAttributes +from datadog_api_client.v2.model.case_create_relationships import CaseCreateRelationships +from datadog_api_client.v2.model.case_create_request import CaseCreateRequest +from datadog_api_client.v2.model.case_priority import CasePriority +from datadog_api_client.v2.model.case_resource_type import CaseResourceType +from datadog_api_client.v2.model.case_type import CaseType +from datadog_api_client.v2.model.nullable_user_relationship import NullableUserRelationship +from datadog_api_client.v2.model.nullable_user_relationship_data import NullableUserRelationshipData +from datadog_api_client.v2.model.project_relationship import ProjectRelationship +from datadog_api_client.v2.model.project_relationship_data import ProjectRelationshipData +from datadog_api_client.v2.model.project_resource_type import ProjectResourceType +from datadog_api_client.v2.model.user_resource_type import UserResourceType + +# there is a valid "user" in the system +USER_DATA_ID = environ["USER_DATA_ID"] + +body = CaseCreateRequest( + data=CaseCreate( + attributes=CaseCreateAttributes( + priority=CasePriority.NOT_DEFINED, + title="Security breach investigation in 3dcc5b2ebf9bfb8f", + type=CaseType.STANDARD, + ), + relationships=CaseCreateRelationships( + assignee=NullableUserRelationship( + data=NullableUserRelationshipData( + id=USER_DATA_ID, + type=UserResourceType.USER, + ), + ), + project=ProjectRelationship( + data=ProjectRelationshipData( + id="d4bbe1af-f36e-42f1-87c1-493ca35c320e", + type=ProjectResourceType.PROJECT, + ), + ), + ), + type=CaseResourceType.CASE, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CasesApi(api_client) + response = api_instance.create_case(body=body) + + print(response) diff --git a/examples/v2/cases/GetCase.py b/examples/v2/cases/GetCase.py new file mode 100644 index 0000000000..bbc245a3d7 --- /dev/null +++ b/examples/v2/cases/GetCase.py @@ -0,0 +1,19 @@ +""" +Get the details of a case returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cases_api import CasesApi + +# there is a valid "case" in the system +CASE_ID = environ["CASE_ID"] + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CasesApi(api_client) + response = api_instance.get_case( + case_id=CASE_ID, + ) + + print(response) diff --git a/examples/v2/cases/SearchCases.py b/examples/v2/cases/SearchCases.py new file mode 100644 index 0000000000..59d9358d09 --- /dev/null +++ b/examples/v2/cases/SearchCases.py @@ -0,0 +1,13 @@ +""" +Search cases returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cases_api import CasesApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CasesApi(api_client) + response = api_instance.search_cases() + + print(response) diff --git a/examples/v2/cases/SearchCases_3433960044.py b/examples/v2/cases/SearchCases_3433960044.py new file mode 100644 index 0000000000..bfb8c5969d --- /dev/null +++ b/examples/v2/cases/SearchCases_3433960044.py @@ -0,0 +1,13 @@ +""" +Search cases returns "OK" response with pagination +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cases_api import CasesApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CasesApi(api_client) + items = api_instance.search_cases_with_pagination() + for item in items: + print(item) diff --git a/examples/v2/cases/UnarchiveCase.py b/examples/v2/cases/UnarchiveCase.py new file mode 100644 index 0000000000..85e78ea6d5 --- /dev/null +++ b/examples/v2/cases/UnarchiveCase.py @@ -0,0 +1,26 @@ +""" +Unarchive case returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cases_api import CasesApi +from datadog_api_client.v2.model.case_empty import CaseEmpty +from datadog_api_client.v2.model.case_empty_request import CaseEmptyRequest +from datadog_api_client.v2.model.case_resource_type import CaseResourceType + +# there is a valid "case" in the system +CASE_ID = environ["CASE_ID"] + +body = CaseEmptyRequest( + data=CaseEmpty( + type=CaseResourceType.CASE, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CasesApi(api_client) + response = api_instance.unarchive_case(case_id=CASE_ID, body=body) + + print(response) diff --git a/examples/v2/cases/UnassignCase.py b/examples/v2/cases/UnassignCase.py new file mode 100644 index 0000000000..54bd1d89fd --- /dev/null +++ b/examples/v2/cases/UnassignCase.py @@ -0,0 +1,26 @@ +""" +Unassign case returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cases_api import CasesApi +from datadog_api_client.v2.model.case_empty import CaseEmpty +from datadog_api_client.v2.model.case_empty_request import CaseEmptyRequest +from datadog_api_client.v2.model.case_resource_type import CaseResourceType + +# there is a valid "case" in the system +CASE_ID = environ["CASE_ID"] + +body = CaseEmptyRequest( + data=CaseEmpty( + type=CaseResourceType.CASE, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CasesApi(api_client) + response = api_instance.unassign_case(case_id=CASE_ID, body=body) + + print(response) diff --git a/examples/v2/cases/UpdatePriority.py b/examples/v2/cases/UpdatePriority.py new file mode 100644 index 0000000000..80463ca761 --- /dev/null +++ b/examples/v2/cases/UpdatePriority.py @@ -0,0 +1,31 @@ +""" +Update case priority returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cases_api import CasesApi +from datadog_api_client.v2.model.case_priority import CasePriority +from datadog_api_client.v2.model.case_resource_type import CaseResourceType +from datadog_api_client.v2.model.case_update_priority import CaseUpdatePriority +from datadog_api_client.v2.model.case_update_priority_attributes import CaseUpdatePriorityAttributes +from datadog_api_client.v2.model.case_update_priority_request import CaseUpdatePriorityRequest + +# there is a valid "case" in the system +CASE_ID = environ["CASE_ID"] + +body = CaseUpdatePriorityRequest( + data=CaseUpdatePriority( + attributes=CaseUpdatePriorityAttributes( + priority=CasePriority.P3, + ), + type=CaseResourceType.CASE, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CasesApi(api_client) + response = api_instance.update_priority(case_id=CASE_ID, body=body) + + print(response) diff --git a/examples/v2/cases/UpdateStatus.py b/examples/v2/cases/UpdateStatus.py new file mode 100644 index 0000000000..51a90b4d55 --- /dev/null +++ b/examples/v2/cases/UpdateStatus.py @@ -0,0 +1,31 @@ +""" +Update case status returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cases_api import CasesApi +from datadog_api_client.v2.model.case_resource_type import CaseResourceType +from datadog_api_client.v2.model.case_status import CaseStatus +from datadog_api_client.v2.model.case_update_status import CaseUpdateStatus +from datadog_api_client.v2.model.case_update_status_attributes import CaseUpdateStatusAttributes +from datadog_api_client.v2.model.case_update_status_request import CaseUpdateStatusRequest + +# there is a valid "case" in the system +CASE_ID = environ["CASE_ID"] + +body = CaseUpdateStatusRequest( + data=CaseUpdateStatus( + attributes=CaseUpdateStatusAttributes( + status=CaseStatus.IN_PROGRESS, + ), + type=CaseResourceType.CASE, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CasesApi(api_client) + response = api_instance.update_status(case_id=CASE_ID, body=body) + + print(response) diff --git a/src/datadog_api_client/v2/api/cases_api.py b/src/datadog_api_client/v2/api/cases_api.py new file mode 100644 index 0000000000..448d48f48e --- /dev/null +++ b/src/datadog_api_client/v2/api/cases_api.py @@ -0,0 +1,541 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +import collections +from typing import Any, Dict, Union + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + set_attribute_from_path, + get_attribute_from_path, + UnsetType, + unset, +) +from datadog_api_client.v2.model.cases_response import CasesResponse +from datadog_api_client.v2.model.case_sortable_field import CaseSortableField +from datadog_api_client.v2.model.case import Case +from datadog_api_client.v2.model.case_response import CaseResponse +from datadog_api_client.v2.model.case_create_request import CaseCreateRequest +from datadog_api_client.v2.model.case_empty_request import CaseEmptyRequest +from datadog_api_client.v2.model.case_assign_request import CaseAssignRequest +from datadog_api_client.v2.model.case_update_priority_request import CaseUpdatePriorityRequest +from datadog_api_client.v2.model.case_update_status_request import CaseUpdateStatusRequest + + +class CasesApi: + """ + View and manage cases within Datadog + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._archive_case_endpoint = _Endpoint( + settings={ + "response_type": (CaseResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cases/{case_id}/archive", + "operation_id": "archive_case", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "case_id": { + "required": True, + "openapi_types": (str,), + "attribute": "case_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (CaseEmptyRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._assign_case_endpoint = _Endpoint( + settings={ + "response_type": (CaseResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cases/{case_id}/assign", + "operation_id": "assign_case", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "case_id": { + "required": True, + "openapi_types": (str,), + "attribute": "case_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (CaseAssignRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._create_case_endpoint = _Endpoint( + settings={ + "response_type": (CaseResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cases", + "operation_id": "create_case", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (CaseCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._get_case_endpoint = _Endpoint( + settings={ + "response_type": (CaseResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cases/{case_id}", + "operation_id": "get_case", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "case_id": { + "required": True, + "openapi_types": (str,), + "attribute": "case_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._search_cases_endpoint = _Endpoint( + settings={ + "response_type": (CasesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cases", + "operation_id": "search_cases", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "page_size": { + "openapi_types": (int,), + "attribute": "page[size]", + "location": "query", + }, + "page_offset": { + "openapi_types": (int,), + "attribute": "page[offset]", + "location": "query", + }, + "sort_field": { + "openapi_types": (CaseSortableField,), + "attribute": "sort[field]", + "location": "query", + }, + "filter": { + "openapi_types": (str,), + "attribute": "filter", + "location": "query", + }, + "sort_asc": { + "openapi_types": (bool,), + "attribute": "sort[asc]", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._unarchive_case_endpoint = _Endpoint( + settings={ + "response_type": (CaseResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cases/{case_id}/unarchive", + "operation_id": "unarchive_case", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "case_id": { + "required": True, + "openapi_types": (str,), + "attribute": "case_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (CaseEmptyRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._unassign_case_endpoint = _Endpoint( + settings={ + "response_type": (CaseResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cases/{case_id}/unassign", + "operation_id": "unassign_case", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "case_id": { + "required": True, + "openapi_types": (str,), + "attribute": "case_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (CaseEmptyRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._update_priority_endpoint = _Endpoint( + settings={ + "response_type": (CaseResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cases/{case_id}/priority", + "operation_id": "update_priority", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "case_id": { + "required": True, + "openapi_types": (str,), + "attribute": "case_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (CaseUpdatePriorityRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._update_status_endpoint = _Endpoint( + settings={ + "response_type": (CaseResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cases/{case_id}/status", + "operation_id": "update_status", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "case_id": { + "required": True, + "openapi_types": (str,), + "attribute": "case_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (CaseUpdateStatusRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def archive_case( + self, + case_id: str, + body: CaseEmptyRequest, + ) -> CaseResponse: + """Archive case. + + Archive case + + :param case_id: Case's UUID or key + :type case_id: str + :param body: Archive case payload + :type body: CaseEmptyRequest + :rtype: CaseResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["case_id"] = case_id + + kwargs["body"] = body + + return self._archive_case_endpoint.call_with_http_info(**kwargs) + + def assign_case( + self, + case_id: str, + body: CaseAssignRequest, + ) -> CaseResponse: + """Assign case. + + Assign case to a user + + :param case_id: Case's UUID or key + :type case_id: str + :param body: Assign case payload + :type body: CaseAssignRequest + :rtype: CaseResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["case_id"] = case_id + + kwargs["body"] = body + + return self._assign_case_endpoint.call_with_http_info(**kwargs) + + def create_case( + self, + body: CaseCreateRequest, + ) -> CaseResponse: + """Create a case. + + Create a Case + + :param body: Case payload + :type body: CaseCreateRequest + :rtype: CaseResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_case_endpoint.call_with_http_info(**kwargs) + + def get_case( + self, + case_id: str, + ) -> CaseResponse: + """Get the details of a case. + + Get the details of case by ``case_id`` + + :param case_id: Case's UUID or key + :type case_id: str + :rtype: CaseResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["case_id"] = case_id + + return self._get_case_endpoint.call_with_http_info(**kwargs) + + def search_cases( + self, + *, + page_size: Union[int, UnsetType] = unset, + page_offset: Union[int, UnsetType] = unset, + sort_field: Union[CaseSortableField, UnsetType] = unset, + filter: Union[str, UnsetType] = unset, + sort_asc: Union[bool, UnsetType] = unset, + ) -> CasesResponse: + """Search cases. + + Search cases. + + :param page_size: Size for a given page. The maximum allowed value is 100. + :type page_size: int, optional + :param page_offset: Specific offset to use as the beginning of the returned page. + :type page_offset: int, optional + :param sort_field: Specify which field to sort + :type sort_field: CaseSortableField, optional + :param filter: Search query + :type filter: str, optional + :param sort_asc: Specify if order is ascending or not + :type sort_asc: bool, optional + :rtype: CasesResponse + """ + kwargs: Dict[str, Any] = {} + if page_size is not unset: + kwargs["page_size"] = page_size + + if page_offset is not unset: + kwargs["page_offset"] = page_offset + + if sort_field is not unset: + kwargs["sort_field"] = sort_field + + if filter is not unset: + kwargs["filter"] = filter + + if sort_asc is not unset: + kwargs["sort_asc"] = sort_asc + + return self._search_cases_endpoint.call_with_http_info(**kwargs) + + def search_cases_with_pagination( + self, + *, + page_size: Union[int, UnsetType] = unset, + page_offset: Union[int, UnsetType] = unset, + sort_field: Union[CaseSortableField, UnsetType] = unset, + filter: Union[str, UnsetType] = unset, + sort_asc: Union[bool, UnsetType] = unset, + ) -> collections.abc.Iterable[Case]: + """Search cases. + + Provide a paginated version of :meth:`search_cases`, returning all items. + + :param page_size: Size for a given page. The maximum allowed value is 100. + :type page_size: int, optional + :param page_offset: Specific offset to use as the beginning of the returned page. + :type page_offset: int, optional + :param sort_field: Specify which field to sort + :type sort_field: CaseSortableField, optional + :param filter: Search query + :type filter: str, optional + :param sort_asc: Specify if order is ascending or not + :type sort_asc: bool, optional + + :return: A generator of paginated results. + :rtype: collections.abc.Iterable[Case] + """ + kwargs: Dict[str, Any] = {} + if page_size is not unset: + kwargs["page_size"] = page_size + + if page_offset is not unset: + kwargs["page_offset"] = page_offset + + if sort_field is not unset: + kwargs["sort_field"] = sort_field + + if filter is not unset: + kwargs["filter"] = filter + + if sort_asc is not unset: + kwargs["sort_asc"] = sort_asc + + local_page_size = get_attribute_from_path(kwargs, "page_size", 10) + endpoint = self._search_cases_endpoint + set_attribute_from_path(kwargs, "page_size", local_page_size, endpoint.params_map) + pagination = { + "limit_value": local_page_size, + "results_path": "data", + "page_offset_param": "page_offset", + "endpoint": endpoint, + "kwargs": kwargs, + } + return endpoint.call_with_http_info_paginated(pagination) + + def unarchive_case( + self, + case_id: str, + body: CaseEmptyRequest, + ) -> CaseResponse: + """Unarchive case. + + Unarchive case + + :param case_id: Case's UUID or key + :type case_id: str + :param body: Unarchive case payload + :type body: CaseEmptyRequest + :rtype: CaseResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["case_id"] = case_id + + kwargs["body"] = body + + return self._unarchive_case_endpoint.call_with_http_info(**kwargs) + + def unassign_case( + self, + case_id: str, + body: CaseEmptyRequest, + ) -> CaseResponse: + """Unassign case. + + Unassign case + + :param case_id: Case's UUID or key + :type case_id: str + :param body: Unassign case payload + :type body: CaseEmptyRequest + :rtype: CaseResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["case_id"] = case_id + + kwargs["body"] = body + + return self._unassign_case_endpoint.call_with_http_info(**kwargs) + + def update_priority( + self, + case_id: str, + body: CaseUpdatePriorityRequest, + ) -> CaseResponse: + """Update case priority. + + Update case priority + + :param case_id: Case's UUID or key + :type case_id: str + :param body: Case priority update payload + :type body: CaseUpdatePriorityRequest + :rtype: CaseResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["case_id"] = case_id + + kwargs["body"] = body + + return self._update_priority_endpoint.call_with_http_info(**kwargs) + + def update_status( + self, + case_id: str, + body: CaseUpdateStatusRequest, + ) -> CaseResponse: + """Update case status. + + Update case status + + :param case_id: Case's UUID or key + :type case_id: str + :param body: Case status update payload + :type body: CaseUpdateStatusRequest + :rtype: CaseResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["case_id"] = case_id + + kwargs["body"] = body + + return self._update_status_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/api/cases_projects_api.py b/src/datadog_api_client/v2/api/cases_projects_api.py new file mode 100644 index 0000000000..7179252bae --- /dev/null +++ b/src/datadog_api_client/v2/api/cases_projects_api.py @@ -0,0 +1,168 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.v2.model.projects_response import ProjectsResponse +from datadog_api_client.v2.model.project_response import ProjectResponse +from datadog_api_client.v2.model.project_create_request import ProjectCreateRequest + + +class CasesProjectsApi: + """ + View and manage project within Case Management + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._create_project_endpoint = _Endpoint( + settings={ + "response_type": (ProjectResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cases/projects", + "operation_id": "create_project", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (ProjectCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._delete_project_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cases/projects/{project_id}", + "operation_id": "delete_project", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "project_id": { + "required": True, + "openapi_types": (str,), + "attribute": "project_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._get_project_endpoint = _Endpoint( + settings={ + "response_type": (ProjectResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cases/projects/{project_id}", + "operation_id": "get_project", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "project_id": { + "required": True, + "openapi_types": (str,), + "attribute": "project_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._get_projects_endpoint = _Endpoint( + settings={ + "response_type": (ProjectsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cases/projects", + "operation_id": "get_projects", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + def create_project( + self, + body: ProjectCreateRequest, + ) -> ProjectResponse: + """Create a project. + + Create a project. + + :param body: Project payload + :type body: ProjectCreateRequest + :rtype: ProjectResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_project_endpoint.call_with_http_info(**kwargs) + + def delete_project( + self, + project_id: str, + ) -> None: + """Remove a project. + + Remove a project using the project's ``id``. + + :param project_id: Project UUID + :type project_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["project_id"] = project_id + + return self._delete_project_endpoint.call_with_http_info(**kwargs) + + def get_project( + self, + project_id: str, + ) -> ProjectResponse: + """Get the details of a project. + + Get the details of a project by ``project_id``. + + :param project_id: Project UUID + :type project_id: str + :rtype: ProjectResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["project_id"] = project_id + + return self._get_project_endpoint.call_with_http_info(**kwargs) + + def get_projects( + self, + ) -> ProjectsResponse: + """Get all projects. + + Get all projects. + + :rtype: ProjectsResponse + """ + kwargs: Dict[str, Any] = {} + return self._get_projects_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index f4f6c2f4d1..34fd16cef2 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -4,6 +4,8 @@ from datadog_api_client.v2.api.authn_mappings_api import AuthNMappingsApi from datadog_api_client.v2.api.ci_visibility_pipelines_api import CIVisibilityPipelinesApi from datadog_api_client.v2.api.ci_visibility_tests_api import CIVisibilityTestsApi +from datadog_api_client.v2.api.cases_api import CasesApi +from datadog_api_client.v2.api.cases_projects_api import CasesProjectsApi from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi from datadog_api_client.v2.api.cloud_workload_security_api import CloudWorkloadSecurityApi from datadog_api_client.v2.api.cloudflare_integration_api import CloudflareIntegrationApi @@ -54,6 +56,8 @@ "AuthNMappingsApi", "CIVisibilityPipelinesApi", "CIVisibilityTestsApi", + "CasesApi", + "CasesProjectsApi", "CloudCostManagementApi", "CloudWorkloadSecurityApi", "CloudflareIntegrationApi", diff --git a/src/datadog_api_client/v2/model/case.py b/src/datadog_api_client/v2/model/case.py new file mode 100644 index 0000000000..d30f5e05c1 --- /dev/null +++ b/src/datadog_api_client/v2/model/case.py @@ -0,0 +1,72 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_attributes import CaseAttributes + from datadog_api_client.v2.model.case_relationships import CaseRelationships + from datadog_api_client.v2.model.case_resource_type import CaseResourceType + + +class Case(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_attributes import CaseAttributes + from datadog_api_client.v2.model.case_relationships import CaseRelationships + from datadog_api_client.v2.model.case_resource_type import CaseResourceType + + return { + "attributes": (CaseAttributes,), + "id": (str,), + "relationships": (CaseRelationships,), + "type": (CaseResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: CaseAttributes, + id: str, + type: CaseResourceType, + relationships: Union[CaseRelationships, UnsetType] = unset, + **kwargs, + ): + """ + A case + + :param attributes: Case attributes + :type attributes: CaseAttributes + + :param id: Case's identifier + :type id: str + + :param relationships: Resources related to a case + :type relationships: CaseRelationships, optional + + :param type: Case resource type + :type type: CaseResourceType + """ + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/case3rd_party_ticket_status.py b/src/datadog_api_client/v2/model/case3rd_party_ticket_status.py new file mode 100644 index 0000000000..17d52625f4 --- /dev/null +++ b/src/datadog_api_client/v2/model/case3rd_party_ticket_status.py @@ -0,0 +1,41 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class Case3rdPartyTicketStatus(ModelSimple): + """ + Case status + + :param value: If omitted defaults to "IN_PROGRESS". Must be one of ["IN_PROGRESS", "COMPLETED", "FAILED"]. + :type value: str + """ + + allowed_values = { + "IN_PROGRESS", + "COMPLETED", + "FAILED", + } + IN_PROGRESS: ClassVar["Case3rdPartyTicketStatus"] + COMPLETED: ClassVar["Case3rdPartyTicketStatus"] + FAILED: ClassVar["Case3rdPartyTicketStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +Case3rdPartyTicketStatus.IN_PROGRESS = Case3rdPartyTicketStatus("IN_PROGRESS") +Case3rdPartyTicketStatus.COMPLETED = Case3rdPartyTicketStatus("COMPLETED") +Case3rdPartyTicketStatus.FAILED = Case3rdPartyTicketStatus("FAILED") diff --git a/src/datadog_api_client/v2/model/case_assign.py b/src/datadog_api_client/v2/model/case_assign.py new file mode 100644 index 0000000000..4ce2f164fc --- /dev/null +++ b/src/datadog_api_client/v2/model/case_assign.py @@ -0,0 +1,48 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_assign_attributes import CaseAssignAttributes + from datadog_api_client.v2.model.case_resource_type import CaseResourceType + + +class CaseAssign(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_assign_attributes import CaseAssignAttributes + from datadog_api_client.v2.model.case_resource_type import CaseResourceType + + return { + "attributes": (CaseAssignAttributes,), + "type": (CaseResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: CaseAssignAttributes, type: CaseResourceType, **kwargs): + """ + Case assign + + :param attributes: Case assign attributes + :type attributes: CaseAssignAttributes + + :param type: Case resource type + :type type: CaseResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/case_assign_attributes.py b/src/datadog_api_client/v2/model/case_assign_attributes.py new file mode 100644 index 0000000000..cf1de7c528 --- /dev/null +++ b/src/datadog_api_client/v2/model/case_assign_attributes.py @@ -0,0 +1,33 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class CaseAssignAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "assignee_id": (str,), + } + + attribute_map = { + "assignee_id": "assignee_id", + } + + def __init__(self_, assignee_id: str, **kwargs): + """ + Case assign attributes + + :param assignee_id: Assignee's UUID + :type assignee_id: str + """ + super().__init__(kwargs) + + self_.assignee_id = assignee_id diff --git a/src/datadog_api_client/v2/model/case_assign_request.py b/src/datadog_api_client/v2/model/case_assign_request.py new file mode 100644 index 0000000000..ed0d5314d5 --- /dev/null +++ b/src/datadog_api_client/v2/model/case_assign_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_assign import CaseAssign + + +class CaseAssignRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_assign import CaseAssign + + return { + "data": (CaseAssign,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: CaseAssign, **kwargs): + """ + Case assign request + + :param data: Case assign + :type data: CaseAssign + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/case_attributes.py b/src/datadog_api_client/v2/model/case_attributes.py new file mode 100644 index 0000000000..1b44497900 --- /dev/null +++ b/src/datadog_api_client/v2/model/case_attributes.py @@ -0,0 +1,152 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.jira_issue import JiraIssue + from datadog_api_client.v2.model.case_priority import CasePriority + from datadog_api_client.v2.model.service_now_ticket import ServiceNowTicket + from datadog_api_client.v2.model.case_status import CaseStatus + from datadog_api_client.v2.model.case_type import CaseType + + +class CaseAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.jira_issue import JiraIssue + from datadog_api_client.v2.model.case_priority import CasePriority + from datadog_api_client.v2.model.service_now_ticket import ServiceNowTicket + from datadog_api_client.v2.model.case_status import CaseStatus + from datadog_api_client.v2.model.case_type import CaseType + + return { + "archived_at": (datetime, none_type), + "closed_at": (datetime, none_type), + "created_at": (datetime,), + "description": (str,), + "jira_issue": (JiraIssue,), + "key": (str,), + "modified_at": (datetime, none_type), + "priority": (CasePriority,), + "service_now_ticket": (ServiceNowTicket,), + "status": (CaseStatus,), + "title": (str,), + "type": (CaseType,), + } + + attribute_map = { + "archived_at": "archived_at", + "closed_at": "closed_at", + "created_at": "created_at", + "description": "description", + "jira_issue": "jira_issue", + "key": "key", + "modified_at": "modified_at", + "priority": "priority", + "service_now_ticket": "service_now_ticket", + "status": "status", + "title": "title", + "type": "type", + } + read_only_vars = { + "archived_at", + "closed_at", + "created_at", + "jira_issue", + "modified_at", + "service_now_ticket", + } + + def __init__( + self_, + archived_at: Union[datetime, none_type, UnsetType] = unset, + closed_at: Union[datetime, none_type, UnsetType] = unset, + created_at: Union[datetime, UnsetType] = unset, + description: Union[str, UnsetType] = unset, + jira_issue: Union[JiraIssue, none_type, UnsetType] = unset, + key: Union[str, UnsetType] = unset, + modified_at: Union[datetime, none_type, UnsetType] = unset, + priority: Union[CasePriority, UnsetType] = unset, + service_now_ticket: Union[ServiceNowTicket, none_type, UnsetType] = unset, + status: Union[CaseStatus, UnsetType] = unset, + title: Union[str, UnsetType] = unset, + type: Union[CaseType, UnsetType] = unset, + **kwargs, + ): + """ + Case attributes + + :param archived_at: Timestamp of when the case was archived + :type archived_at: datetime, none_type, optional + + :param closed_at: Timestamp of when the case was closed + :type closed_at: datetime, none_type, optional + + :param created_at: Timestamp of when the case was created + :type created_at: datetime, optional + + :param description: Description + :type description: str, optional + + :param jira_issue: Jira issue attached to case + :type jira_issue: JiraIssue, none_type, optional + + :param key: Key + :type key: str, optional + + :param modified_at: Timestamp of when the case was last modified + :type modified_at: datetime, none_type, optional + + :param priority: Case priority + :type priority: CasePriority, optional + + :param service_now_ticket: ServiceNow ticket attached to case + :type service_now_ticket: ServiceNowTicket, none_type, optional + + :param status: Case status + :type status: CaseStatus, optional + + :param title: Title + :type title: str, optional + + :param type: Case type + :type type: CaseType, optional + """ + if archived_at is not unset: + kwargs["archived_at"] = archived_at + if closed_at is not unset: + kwargs["closed_at"] = closed_at + if created_at is not unset: + kwargs["created_at"] = created_at + if description is not unset: + kwargs["description"] = description + if jira_issue is not unset: + kwargs["jira_issue"] = jira_issue + if key is not unset: + kwargs["key"] = key + if modified_at is not unset: + kwargs["modified_at"] = modified_at + if priority is not unset: + kwargs["priority"] = priority + if service_now_ticket is not unset: + kwargs["service_now_ticket"] = service_now_ticket + if status is not unset: + kwargs["status"] = status + if title is not unset: + kwargs["title"] = title + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/case_create.py b/src/datadog_api_client/v2/model/case_create.py new file mode 100644 index 0000000000..9180d6c47b --- /dev/null +++ b/src/datadog_api_client/v2/model/case_create.py @@ -0,0 +1,65 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_create_attributes import CaseCreateAttributes + from datadog_api_client.v2.model.case_create_relationships import CaseCreateRelationships + from datadog_api_client.v2.model.case_resource_type import CaseResourceType + + +class CaseCreate(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_create_attributes import CaseCreateAttributes + from datadog_api_client.v2.model.case_create_relationships import CaseCreateRelationships + from datadog_api_client.v2.model.case_resource_type import CaseResourceType + + return { + "attributes": (CaseCreateAttributes,), + "relationships": (CaseCreateRelationships,), + "type": (CaseResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: CaseCreateAttributes, + type: CaseResourceType, + relationships: Union[CaseCreateRelationships, UnsetType] = unset, + **kwargs, + ): + """ + Case creation data + + :param attributes: Case creation attributes + :type attributes: CaseCreateAttributes + + :param relationships: Relationships formed with the case on creation + :type relationships: CaseCreateRelationships, optional + + :param type: Case resource type + :type type: CaseResourceType + """ + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/case_create_attributes.py b/src/datadog_api_client/v2/model/case_create_attributes.py new file mode 100644 index 0000000000..0f25494e39 --- /dev/null +++ b/src/datadog_api_client/v2/model/case_create_attributes.py @@ -0,0 +1,71 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_priority import CasePriority + from datadog_api_client.v2.model.case_type import CaseType + + +class CaseCreateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_priority import CasePriority + from datadog_api_client.v2.model.case_type import CaseType + + return { + "description": (str,), + "priority": (CasePriority,), + "title": (str,), + "type": (CaseType,), + } + + attribute_map = { + "description": "description", + "priority": "priority", + "title": "title", + "type": "type", + } + + def __init__( + self_, + title: str, + type: CaseType, + description: Union[str, UnsetType] = unset, + priority: Union[CasePriority, UnsetType] = unset, + **kwargs, + ): + """ + Case creation attributes + + :param description: Description + :type description: str, optional + + :param priority: Case priority + :type priority: CasePriority, optional + + :param title: Title + :type title: str + + :param type: Case type + :type type: CaseType + """ + if description is not unset: + kwargs["description"] = description + if priority is not unset: + kwargs["priority"] = priority + super().__init__(kwargs) + + self_.title = title + self_.type = type diff --git a/src/datadog_api_client/v2/model/case_create_relationships.py b/src/datadog_api_client/v2/model/case_create_relationships.py new file mode 100644 index 0000000000..455cc73e88 --- /dev/null +++ b/src/datadog_api_client/v2/model/case_create_relationships.py @@ -0,0 +1,57 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.nullable_user_relationship import NullableUserRelationship + from datadog_api_client.v2.model.project_relationship import ProjectRelationship + + +class CaseCreateRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.nullable_user_relationship import NullableUserRelationship + from datadog_api_client.v2.model.project_relationship import ProjectRelationship + + return { + "assignee": (NullableUserRelationship,), + "project": (ProjectRelationship,), + } + + attribute_map = { + "assignee": "assignee", + "project": "project", + } + + def __init__( + self_, + project: ProjectRelationship, + assignee: Union[NullableUserRelationship, none_type, UnsetType] = unset, + **kwargs, + ): + """ + Relationships formed with the case on creation + + :param assignee: Relationship to user. + :type assignee: NullableUserRelationship, none_type, optional + + :param project: Relationship to project + :type project: ProjectRelationship + """ + if assignee is not unset: + kwargs["assignee"] = assignee + super().__init__(kwargs) + + self_.project = project diff --git a/src/datadog_api_client/v2/model/case_create_request.py b/src/datadog_api_client/v2/model/case_create_request.py new file mode 100644 index 0000000000..e19398261b --- /dev/null +++ b/src/datadog_api_client/v2/model/case_create_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_create import CaseCreate + + +class CaseCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_create import CaseCreate + + return { + "data": (CaseCreate,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: CaseCreate, **kwargs): + """ + Case create request + + :param data: Case creation data + :type data: CaseCreate + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/case_empty.py b/src/datadog_api_client/v2/model/case_empty.py new file mode 100644 index 0000000000..d64381e252 --- /dev/null +++ b/src/datadog_api_client/v2/model/case_empty.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_resource_type import CaseResourceType + + +class CaseEmpty(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_resource_type import CaseResourceType + + return { + "type": (CaseResourceType,), + } + + attribute_map = { + "type": "type", + } + + def __init__(self_, type: CaseResourceType, **kwargs): + """ + Case empty request data + + :param type: Case resource type + :type type: CaseResourceType + """ + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/case_empty_request.py b/src/datadog_api_client/v2/model/case_empty_request.py new file mode 100644 index 0000000000..f57f825661 --- /dev/null +++ b/src/datadog_api_client/v2/model/case_empty_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_empty import CaseEmpty + + +class CaseEmptyRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_empty import CaseEmpty + + return { + "data": (CaseEmpty,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: CaseEmpty, **kwargs): + """ + Case empty request + + :param data: Case empty request data + :type data: CaseEmpty + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/case_priority.py b/src/datadog_api_client/v2/model/case_priority.py new file mode 100644 index 0000000000..f404c8175f --- /dev/null +++ b/src/datadog_api_client/v2/model/case_priority.py @@ -0,0 +1,50 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class CasePriority(ModelSimple): + """ + Case priority + + :param value: If omitted defaults to "NOT_DEFINED". Must be one of ["NOT_DEFINED", "P1", "P2", "P3", "P4", "P5"]. + :type value: str + """ + + allowed_values = { + "NOT_DEFINED", + "P1", + "P2", + "P3", + "P4", + "P5", + } + NOT_DEFINED: ClassVar["CasePriority"] + P1: ClassVar["CasePriority"] + P2: ClassVar["CasePriority"] + P3: ClassVar["CasePriority"] + P4: ClassVar["CasePriority"] + P5: ClassVar["CasePriority"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CasePriority.NOT_DEFINED = CasePriority("NOT_DEFINED") +CasePriority.P1 = CasePriority("P1") +CasePriority.P2 = CasePriority("P2") +CasePriority.P3 = CasePriority("P3") +CasePriority.P4 = CasePriority("P4") +CasePriority.P5 = CasePriority("P5") diff --git a/src/datadog_api_client/v2/model/case_relationships.py b/src/datadog_api_client/v2/model/case_relationships.py new file mode 100644 index 0000000000..63be74a232 --- /dev/null +++ b/src/datadog_api_client/v2/model/case_relationships.py @@ -0,0 +1,73 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.nullable_user_relationship import NullableUserRelationship + from datadog_api_client.v2.model.project_relationship import ProjectRelationship + + +class CaseRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.nullable_user_relationship import NullableUserRelationship + from datadog_api_client.v2.model.project_relationship import ProjectRelationship + + return { + "assignee": (NullableUserRelationship,), + "created_by": (NullableUserRelationship,), + "modified_by": (NullableUserRelationship,), + "project": (ProjectRelationship,), + } + + attribute_map = { + "assignee": "assignee", + "created_by": "created_by", + "modified_by": "modified_by", + "project": "project", + } + + def __init__( + self_, + assignee: Union[NullableUserRelationship, none_type, UnsetType] = unset, + created_by: Union[NullableUserRelationship, none_type, UnsetType] = unset, + modified_by: Union[NullableUserRelationship, none_type, UnsetType] = unset, + project: Union[ProjectRelationship, UnsetType] = unset, + **kwargs, + ): + """ + Resources related to a case + + :param assignee: Relationship to user. + :type assignee: NullableUserRelationship, none_type, optional + + :param created_by: Relationship to user. + :type created_by: NullableUserRelationship, none_type, optional + + :param modified_by: Relationship to user. + :type modified_by: NullableUserRelationship, none_type, optional + + :param project: Relationship to project + :type project: ProjectRelationship, optional + """ + if assignee is not unset: + kwargs["assignee"] = assignee + if created_by is not unset: + kwargs["created_by"] = created_by + if modified_by is not unset: + kwargs["modified_by"] = modified_by + if project is not unset: + kwargs["project"] = project + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/case_resource_type.py b/src/datadog_api_client/v2/model/case_resource_type.py new file mode 100644 index 0000000000..b62cd3881d --- /dev/null +++ b/src/datadog_api_client/v2/model/case_resource_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class CaseResourceType(ModelSimple): + """ + Case resource type + + :param value: If omitted defaults to "case". Must be one of ["case"]. + :type value: str + """ + + allowed_values = { + "case", + } + CASE: ClassVar["CaseResourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CaseResourceType.CASE = CaseResourceType("case") diff --git a/src/datadog_api_client/v2/model/case_response.py b/src/datadog_api_client/v2/model/case_response.py new file mode 100644 index 0000000000..c0a0c25b2c --- /dev/null +++ b/src/datadog_api_client/v2/model/case_response.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case import Case + + +class CaseResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case import Case + + return { + "data": (Case,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[Case, UnsetType] = unset, **kwargs): + """ + Case response + + :param data: A case + :type data: Case, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/case_sortable_field.py b/src/datadog_api_client/v2/model/case_sortable_field.py new file mode 100644 index 0000000000..c3a6834caf --- /dev/null +++ b/src/datadog_api_client/v2/model/case_sortable_field.py @@ -0,0 +1,41 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class CaseSortableField(ModelSimple): + """ + Case field that can be sorted on + + :param value: Must be one of ["created_at", "priority", "status"]. + :type value: str + """ + + allowed_values = { + "created_at", + "priority", + "status", + } + CREATED_AT: ClassVar["CaseSortableField"] + PRIORITY: ClassVar["CaseSortableField"] + STATUS: ClassVar["CaseSortableField"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CaseSortableField.CREATED_AT = CaseSortableField("created_at") +CaseSortableField.PRIORITY = CaseSortableField("priority") +CaseSortableField.STATUS = CaseSortableField("status") diff --git a/src/datadog_api_client/v2/model/case_status.py b/src/datadog_api_client/v2/model/case_status.py new file mode 100644 index 0000000000..307fd0076d --- /dev/null +++ b/src/datadog_api_client/v2/model/case_status.py @@ -0,0 +1,41 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class CaseStatus(ModelSimple): + """ + Case status + + :param value: Must be one of ["OPEN", "IN_PROGRESS", "CLOSED"]. + :type value: str + """ + + allowed_values = { + "OPEN", + "IN_PROGRESS", + "CLOSED", + } + OPEN: ClassVar["CaseStatus"] + IN_PROGRESS: ClassVar["CaseStatus"] + CLOSED: ClassVar["CaseStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CaseStatus.OPEN = CaseStatus("OPEN") +CaseStatus.IN_PROGRESS = CaseStatus("IN_PROGRESS") +CaseStatus.CLOSED = CaseStatus("CLOSED") diff --git a/src/datadog_api_client/v2/model/case_type.py b/src/datadog_api_client/v2/model/case_type.py new file mode 100644 index 0000000000..b135b1f3cb --- /dev/null +++ b/src/datadog_api_client/v2/model/case_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class CaseType(ModelSimple): + """ + Case type + + :param value: If omitted defaults to "STANDARD". Must be one of ["STANDARD"]. + :type value: str + """ + + allowed_values = { + "STANDARD", + } + STANDARD: ClassVar["CaseType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CaseType.STANDARD = CaseType("STANDARD") diff --git a/src/datadog_api_client/v2/model/case_update_priority.py b/src/datadog_api_client/v2/model/case_update_priority.py new file mode 100644 index 0000000000..72eb970a8b --- /dev/null +++ b/src/datadog_api_client/v2/model/case_update_priority.py @@ -0,0 +1,48 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_update_priority_attributes import CaseUpdatePriorityAttributes + from datadog_api_client.v2.model.case_resource_type import CaseResourceType + + +class CaseUpdatePriority(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_update_priority_attributes import CaseUpdatePriorityAttributes + from datadog_api_client.v2.model.case_resource_type import CaseResourceType + + return { + "attributes": (CaseUpdatePriorityAttributes,), + "type": (CaseResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: CaseUpdatePriorityAttributes, type: CaseResourceType, **kwargs): + """ + Case priority status + + :param attributes: Case update priority attributes + :type attributes: CaseUpdatePriorityAttributes + + :param type: Case resource type + :type type: CaseResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/case_update_priority_attributes.py b/src/datadog_api_client/v2/model/case_update_priority_attributes.py new file mode 100644 index 0000000000..10b6993c8b --- /dev/null +++ b/src/datadog_api_client/v2/model/case_update_priority_attributes.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_priority import CasePriority + + +class CaseUpdatePriorityAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_priority import CasePriority + + return { + "priority": (CasePriority,), + } + + attribute_map = { + "priority": "priority", + } + + def __init__(self_, priority: CasePriority, **kwargs): + """ + Case update priority attributes + + :param priority: Case priority + :type priority: CasePriority + """ + super().__init__(kwargs) + + self_.priority = priority diff --git a/src/datadog_api_client/v2/model/case_update_priority_request.py b/src/datadog_api_client/v2/model/case_update_priority_request.py new file mode 100644 index 0000000000..37f9ea9b1e --- /dev/null +++ b/src/datadog_api_client/v2/model/case_update_priority_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_update_priority import CaseUpdatePriority + + +class CaseUpdatePriorityRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_update_priority import CaseUpdatePriority + + return { + "data": (CaseUpdatePriority,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: CaseUpdatePriority, **kwargs): + """ + Case update priority request + + :param data: Case priority status + :type data: CaseUpdatePriority + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/case_update_status.py b/src/datadog_api_client/v2/model/case_update_status.py new file mode 100644 index 0000000000..af88875c2a --- /dev/null +++ b/src/datadog_api_client/v2/model/case_update_status.py @@ -0,0 +1,48 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_update_status_attributes import CaseUpdateStatusAttributes + from datadog_api_client.v2.model.case_resource_type import CaseResourceType + + +class CaseUpdateStatus(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_update_status_attributes import CaseUpdateStatusAttributes + from datadog_api_client.v2.model.case_resource_type import CaseResourceType + + return { + "attributes": (CaseUpdateStatusAttributes,), + "type": (CaseResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: CaseUpdateStatusAttributes, type: CaseResourceType, **kwargs): + """ + Case update status + + :param attributes: Case update status attributes + :type attributes: CaseUpdateStatusAttributes + + :param type: Case resource type + :type type: CaseResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/case_update_status_attributes.py b/src/datadog_api_client/v2/model/case_update_status_attributes.py new file mode 100644 index 0000000000..16c9faf288 --- /dev/null +++ b/src/datadog_api_client/v2/model/case_update_status_attributes.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_status import CaseStatus + + +class CaseUpdateStatusAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_status import CaseStatus + + return { + "status": (CaseStatus,), + } + + attribute_map = { + "status": "status", + } + + def __init__(self_, status: CaseStatus, **kwargs): + """ + Case update status attributes + + :param status: Case status + :type status: CaseStatus + """ + super().__init__(kwargs) + + self_.status = status diff --git a/src/datadog_api_client/v2/model/case_update_status_request.py b/src/datadog_api_client/v2/model/case_update_status_request.py new file mode 100644 index 0000000000..9d91670a32 --- /dev/null +++ b/src/datadog_api_client/v2/model/case_update_status_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_update_status import CaseUpdateStatus + + +class CaseUpdateStatusRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_update_status import CaseUpdateStatus + + return { + "data": (CaseUpdateStatus,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: CaseUpdateStatus, **kwargs): + """ + Case update status request + + :param data: Case update status + :type data: CaseUpdateStatus + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/cases_response.py b/src/datadog_api_client/v2/model/cases_response.py new file mode 100644 index 0000000000..5cf33cba0b --- /dev/null +++ b/src/datadog_api_client/v2/model/cases_response.py @@ -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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case import Case + from datadog_api_client.v2.model.cases_response_meta import CasesResponseMeta + + +class CasesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case import Case + from datadog_api_client.v2.model.cases_response_meta import CasesResponseMeta + + return { + "data": ([Case],), + "meta": (CasesResponseMeta,), + } + + attribute_map = { + "data": "data", + "meta": "meta", + } + + def __init__( + self_, data: Union[List[Case], UnsetType] = unset, meta: Union[CasesResponseMeta, UnsetType] = unset, **kwargs + ): + """ + Response with cases + + :param data: Cases response data + :type data: [Case], optional + + :param meta: Cases response metadata + :type meta: CasesResponseMeta, optional + """ + if data is not unset: + kwargs["data"] = data + if meta is not unset: + kwargs["meta"] = meta + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/cases_response_meta.py b/src/datadog_api_client/v2/model/cases_response_meta.py new file mode 100644 index 0000000000..50c2b7e896 --- /dev/null +++ b/src/datadog_api_client/v2/model/cases_response_meta.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.cases_response_meta_pagination import CasesResponseMetaPagination + + +class CasesResponseMeta(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.cases_response_meta_pagination import CasesResponseMetaPagination + + return { + "page": (CasesResponseMetaPagination,), + } + + attribute_map = { + "page": "page", + } + + def __init__(self_, page: Union[CasesResponseMetaPagination, UnsetType] = unset, **kwargs): + """ + Cases response metadata + + :param page: Pagination metadata + :type page: CasesResponseMetaPagination, optional + """ + if page is not unset: + kwargs["page"] = page + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/cases_response_meta_pagination.py b/src/datadog_api_client/v2/model/cases_response_meta_pagination.py new file mode 100644 index 0000000000..ad82f73dba --- /dev/null +++ b/src/datadog_api_client/v2/model/cases_response_meta_pagination.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class CasesResponseMetaPagination(ModelNormal): + @cached_property + def openapi_types(_): + return { + "current": (int,), + "size": (int,), + "total": (int,), + } + + attribute_map = { + "current": "current", + "size": "size", + "total": "total", + } + + def __init__( + self_, + current: Union[int, UnsetType] = unset, + size: Union[int, UnsetType] = unset, + total: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + Pagination metadata + + :param current: Current page number + :type current: int, optional + + :param size: Number of cases in current page + :type size: int, optional + + :param total: Total number of pages + :type total: int, optional + """ + if current is not unset: + kwargs["current"] = current + if size is not unset: + kwargs["size"] = size + if total is not unset: + kwargs["total"] = total + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/jira_issue.py b/src/datadog_api_client/v2/model/jira_issue.py new file mode 100644 index 0000000000..f5fc93b585 --- /dev/null +++ b/src/datadog_api_client/v2/model/jira_issue.py @@ -0,0 +1,61 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.jira_issue_result import JiraIssueResult + from datadog_api_client.v2.model.case3rd_party_ticket_status import Case3rdPartyTicketStatus + + +class JiraIssue(ModelNormal): + _nullable = True + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.jira_issue_result import JiraIssueResult + from datadog_api_client.v2.model.case3rd_party_ticket_status import Case3rdPartyTicketStatus + + return { + "result": (JiraIssueResult,), + "status": (Case3rdPartyTicketStatus,), + } + + attribute_map = { + "result": "result", + "status": "status", + } + read_only_vars = { + "status", + } + + def __init__( + self_, + result: Union[JiraIssueResult, UnsetType] = unset, + status: Union[Case3rdPartyTicketStatus, UnsetType] = unset, + **kwargs, + ): + """ + Jira issue attached to case + + :param result: Jira issue information + :type result: JiraIssueResult, optional + + :param status: Case status + :type status: Case3rdPartyTicketStatus, optional + """ + if result is not unset: + kwargs["result"] = result + if status is not unset: + kwargs["status"] = status + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/jira_issue_result.py b/src/datadog_api_client/v2/model/jira_issue_result.py new file mode 100644 index 0000000000..1bb8625546 --- /dev/null +++ b/src/datadog_api_client/v2/model/jira_issue_result.py @@ -0,0 +1,64 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class JiraIssueResult(ModelNormal): + @cached_property + def openapi_types(_): + return { + "issue_id": (str,), + "issue_key": (str,), + "issue_url": (str,), + "project_key": (str,), + } + + attribute_map = { + "issue_id": "issue_id", + "issue_key": "issue_key", + "issue_url": "issue_url", + "project_key": "project_key", + } + + def __init__( + self_, + issue_id: Union[str, UnsetType] = unset, + issue_key: Union[str, UnsetType] = unset, + issue_url: Union[str, UnsetType] = unset, + project_key: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Jira issue information + + :param issue_id: Jira issue ID + :type issue_id: str, optional + + :param issue_key: Jira issue key + :type issue_key: str, optional + + :param issue_url: Jira issue URL + :type issue_url: str, optional + + :param project_key: Jira project key + :type project_key: str, optional + """ + if issue_id is not unset: + kwargs["issue_id"] = issue_id + if issue_key is not unset: + kwargs["issue_key"] = issue_key + if issue_url is not unset: + kwargs["issue_url"] = issue_url + if project_key is not unset: + kwargs["project_key"] = project_key + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/nullable_user_relationship.py b/src/datadog_api_client/v2/model/nullable_user_relationship.py new file mode 100644 index 0000000000..b8ef69548f --- /dev/null +++ b/src/datadog_api_client/v2/model/nullable_user_relationship.py @@ -0,0 +1,43 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.nullable_user_relationship_data import NullableUserRelationshipData + + +class NullableUserRelationship(ModelNormal): + _nullable = True + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.nullable_user_relationship_data import NullableUserRelationshipData + + return { + "data": (NullableUserRelationshipData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[NullableUserRelationshipData, none_type], **kwargs): + """ + Relationship to user. + + :param data: Relationship to user object. + :type data: NullableUserRelationshipData, none_type + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/nullable_user_relationship_data.py b/src/datadog_api_client/v2/model/nullable_user_relationship_data.py new file mode 100644 index 0000000000..42df87a103 --- /dev/null +++ b/src/datadog_api_client/v2/model/nullable_user_relationship_data.py @@ -0,0 +1,48 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.user_resource_type import UserResourceType + + +class NullableUserRelationshipData(ModelNormal): + _nullable = True + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.user_resource_type import UserResourceType + + return { + "id": (str,), + "type": (UserResourceType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: UserResourceType, **kwargs): + """ + Relationship to user object. + + :param id: A unique identifier that represents the user. + :type id: str + + :param type: User resource type. + :type type: UserResourceType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/project.py b/src/datadog_api_client/v2/model/project.py new file mode 100644 index 0000000000..ac2d2d370a --- /dev/null +++ b/src/datadog_api_client/v2/model/project.py @@ -0,0 +1,72 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.project_attributes import ProjectAttributes + from datadog_api_client.v2.model.project_relationships import ProjectRelationships + from datadog_api_client.v2.model.project_resource_type import ProjectResourceType + + +class Project(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.project_attributes import ProjectAttributes + from datadog_api_client.v2.model.project_relationships import ProjectRelationships + from datadog_api_client.v2.model.project_resource_type import ProjectResourceType + + return { + "attributes": (ProjectAttributes,), + "id": (str,), + "relationships": (ProjectRelationships,), + "type": (ProjectResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: ProjectAttributes, + id: str, + type: ProjectResourceType, + relationships: Union[ProjectRelationships, UnsetType] = unset, + **kwargs, + ): + """ + A Project + + :param attributes: Project attributes + :type attributes: ProjectAttributes + + :param id: The Project's identifier + :type id: str + + :param relationships: Project relationships + :type relationships: ProjectRelationships, optional + + :param type: Project resource type + :type type: ProjectResourceType + """ + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/project_attributes.py b/src/datadog_api_client/v2/model/project_attributes.py new file mode 100644 index 0000000000..5ab7c79194 --- /dev/null +++ b/src/datadog_api_client/v2/model/project_attributes.py @@ -0,0 +1,43 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ProjectAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "key": (str,), + "name": (str,), + } + + attribute_map = { + "key": "key", + "name": "name", + } + + def __init__(self_, key: Union[str, UnsetType] = unset, name: Union[str, UnsetType] = unset, **kwargs): + """ + Project attributes + + :param key: The project's key + :type key: str, optional + + :param name: Project's name + :type name: str, optional + """ + if key is not unset: + kwargs["key"] = key + if name is not unset: + kwargs["name"] = name + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/project_create.py b/src/datadog_api_client/v2/model/project_create.py new file mode 100644 index 0000000000..bd4af042a1 --- /dev/null +++ b/src/datadog_api_client/v2/model/project_create.py @@ -0,0 +1,48 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.project_create_attributes import ProjectCreateAttributes + from datadog_api_client.v2.model.project_resource_type import ProjectResourceType + + +class ProjectCreate(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.project_create_attributes import ProjectCreateAttributes + from datadog_api_client.v2.model.project_resource_type import ProjectResourceType + + return { + "attributes": (ProjectCreateAttributes,), + "type": (ProjectResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: ProjectCreateAttributes, type: ProjectResourceType, **kwargs): + """ + Project create + + :param attributes: Project creation attributes + :type attributes: ProjectCreateAttributes + + :param type: Project resource type + :type type: ProjectResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/project_create_attributes.py b/src/datadog_api_client/v2/model/project_create_attributes.py new file mode 100644 index 0000000000..0ddc8e2567 --- /dev/null +++ b/src/datadog_api_client/v2/model/project_create_attributes.py @@ -0,0 +1,39 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class ProjectCreateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "key": (str,), + "name": (str,), + } + + attribute_map = { + "key": "key", + "name": "name", + } + + def __init__(self_, key: str, name: str, **kwargs): + """ + Project creation attributes + + :param key: Project's key. Cannot be "CASE" + :type key: str + + :param name: name + :type name: str + """ + super().__init__(kwargs) + + self_.key = key + self_.name = name diff --git a/src/datadog_api_client/v2/model/project_create_request.py b/src/datadog_api_client/v2/model/project_create_request.py new file mode 100644 index 0000000000..0aded0fa84 --- /dev/null +++ b/src/datadog_api_client/v2/model/project_create_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.project_create import ProjectCreate + + +class ProjectCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.project_create import ProjectCreate + + return { + "data": (ProjectCreate,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ProjectCreate, **kwargs): + """ + Project create request + + :param data: Project create + :type data: ProjectCreate + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/project_relationship.py b/src/datadog_api_client/v2/model/project_relationship.py new file mode 100644 index 0000000000..9697705fb3 --- /dev/null +++ b/src/datadog_api_client/v2/model/project_relationship.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.project_relationship_data import ProjectRelationshipData + + +class ProjectRelationship(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.project_relationship_data import ProjectRelationshipData + + return { + "data": (ProjectRelationshipData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ProjectRelationshipData, **kwargs): + """ + Relationship to project + + :param data: Relationship to project object + :type data: ProjectRelationshipData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/project_relationship_data.py b/src/datadog_api_client/v2/model/project_relationship_data.py new file mode 100644 index 0000000000..8af44c7b9a --- /dev/null +++ b/src/datadog_api_client/v2/model/project_relationship_data.py @@ -0,0 +1,46 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.project_resource_type import ProjectResourceType + + +class ProjectRelationshipData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.project_resource_type import ProjectResourceType + + return { + "id": (str,), + "type": (ProjectResourceType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: ProjectResourceType, **kwargs): + """ + Relationship to project object + + :param id: A unique identifier that represents the project + :type id: str + + :param type: Project resource type + :type type: ProjectResourceType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/project_relationships.py b/src/datadog_api_client/v2/model/project_relationships.py new file mode 100644 index 0000000000..9b8e496691 --- /dev/null +++ b/src/datadog_api_client/v2/model/project_relationships.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.relationship_to_team_links import RelationshipToTeamLinks + from datadog_api_client.v2.model.users_relationship import UsersRelationship + + +class ProjectRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.relationship_to_team_links import RelationshipToTeamLinks + from datadog_api_client.v2.model.users_relationship import UsersRelationship + + return { + "member_team": (RelationshipToTeamLinks,), + "member_user": (UsersRelationship,), + } + + attribute_map = { + "member_team": "member_team", + "member_user": "member_user", + } + + def __init__( + self_, + member_team: Union[RelationshipToTeamLinks, UnsetType] = unset, + member_user: Union[UsersRelationship, UnsetType] = unset, + **kwargs, + ): + """ + Project relationships + + :param member_team: Relationship between a team and a team link + :type member_team: RelationshipToTeamLinks, optional + + :param member_user: Relationship to users. + :type member_user: UsersRelationship, optional + """ + if member_team is not unset: + kwargs["member_team"] = member_team + if member_user is not unset: + kwargs["member_user"] = member_user + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/project_resource_type.py b/src/datadog_api_client/v2/model/project_resource_type.py new file mode 100644 index 0000000000..c3513efedf --- /dev/null +++ b/src/datadog_api_client/v2/model/project_resource_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ProjectResourceType(ModelSimple): + """ + Project resource type + + :param value: If omitted defaults to "project". Must be one of ["project"]. + :type value: str + """ + + allowed_values = { + "project", + } + PROJECT: ClassVar["ProjectResourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ProjectResourceType.PROJECT = ProjectResourceType("project") diff --git a/src/datadog_api_client/v2/model/project_response.py b/src/datadog_api_client/v2/model/project_response.py new file mode 100644 index 0000000000..96c6c7f1ce --- /dev/null +++ b/src/datadog_api_client/v2/model/project_response.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.project import Project + + +class ProjectResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.project import Project + + return { + "data": (Project,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[Project, UnsetType] = unset, **kwargs): + """ + Project response + + :param data: A Project + :type data: Project, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/projects_response.py b/src/datadog_api_client/v2/model/projects_response.py new file mode 100644 index 0000000000..0c1fc8793f --- /dev/null +++ b/src/datadog_api_client/v2/model/projects_response.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.project import Project + + +class ProjectsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.project import Project + + return { + "data": ([Project],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[List[Project], UnsetType] = unset, **kwargs): + """ + Response with projects + + :param data: Projects response data + :type data: [Project], optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/service_now_ticket.py b/src/datadog_api_client/v2/model/service_now_ticket.py new file mode 100644 index 0000000000..f7a507a29b --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_ticket.py @@ -0,0 +1,61 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.service_now_ticket_result import ServiceNowTicketResult + from datadog_api_client.v2.model.case3rd_party_ticket_status import Case3rdPartyTicketStatus + + +class ServiceNowTicket(ModelNormal): + _nullable = True + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_now_ticket_result import ServiceNowTicketResult + from datadog_api_client.v2.model.case3rd_party_ticket_status import Case3rdPartyTicketStatus + + return { + "result": (ServiceNowTicketResult,), + "status": (Case3rdPartyTicketStatus,), + } + + attribute_map = { + "result": "result", + "status": "status", + } + read_only_vars = { + "status", + } + + def __init__( + self_, + result: Union[ServiceNowTicketResult, UnsetType] = unset, + status: Union[Case3rdPartyTicketStatus, UnsetType] = unset, + **kwargs, + ): + """ + ServiceNow ticket attached to case + + :param result: ServiceNow ticket information + :type result: ServiceNowTicketResult, optional + + :param status: Case status + :type status: Case3rdPartyTicketStatus, optional + """ + if result is not unset: + kwargs["result"] = result + if status is not unset: + kwargs["status"] = status + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/service_now_ticket_result.py b/src/datadog_api_client/v2/model/service_now_ticket_result.py new file mode 100644 index 0000000000..a47e0e7214 --- /dev/null +++ b/src/datadog_api_client/v2/model/service_now_ticket_result.py @@ -0,0 +1,36 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ServiceNowTicketResult(ModelNormal): + @cached_property + def openapi_types(_): + return { + "sys_target_link": (str,), + } + + attribute_map = { + "sys_target_link": "sys_target_link", + } + + def __init__(self_, sys_target_link: Union[str, UnsetType] = unset, **kwargs): + """ + ServiceNow ticket information + + :param sys_target_link: Link to the Incident created on ServiceNow + :type sys_target_link: str, optional + """ + if sys_target_link is not unset: + kwargs["sys_target_link"] = sys_target_link + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/user_relationship_data.py b/src/datadog_api_client/v2/model/user_relationship_data.py new file mode 100644 index 0000000000..4e026301c9 --- /dev/null +++ b/src/datadog_api_client/v2/model/user_relationship_data.py @@ -0,0 +1,46 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.user_resource_type import UserResourceType + + +class UserRelationshipData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.user_resource_type import UserResourceType + + return { + "id": (str,), + "type": (UserResourceType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: UserResourceType, **kwargs): + """ + Relationship to user object. + + :param id: A unique identifier that represents the user. + :type id: str + + :param type: User resource type. + :type type: UserResourceType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/user_resource_type.py b/src/datadog_api_client/v2/model/user_resource_type.py new file mode 100644 index 0000000000..7b31fcb302 --- /dev/null +++ b/src/datadog_api_client/v2/model/user_resource_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class UserResourceType(ModelSimple): + """ + User resource type. + + :param value: If omitted defaults to "user". Must be one of ["user"]. + :type value: str + """ + + allowed_values = { + "user", + } + USER: ClassVar["UserResourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +UserResourceType.USER = UserResourceType("user") diff --git a/src/datadog_api_client/v2/model/users_relationship.py b/src/datadog_api_client/v2/model/users_relationship.py new file mode 100644 index 0000000000..792b03134c --- /dev/null +++ b/src/datadog_api_client/v2/model/users_relationship.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.user_relationship_data import UserRelationshipData + + +class UsersRelationship(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.user_relationship_data import UserRelationshipData + + return { + "data": ([UserRelationshipData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[UserRelationshipData], **kwargs): + """ + Relationship to users. + + :param data: Relationships to user objects. + :type data: [UserRelationshipData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 4895e97311..2e06926097 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -183,6 +183,34 @@ from datadog_api_client.v2.model.ci_app_tests_group_by import CIAppTestsGroupBy from datadog_api_client.v2.model.ci_app_tests_query_filter import CIAppTestsQueryFilter from datadog_api_client.v2.model.ci_app_warning import CIAppWarning +from datadog_api_client.v2.model.case import Case +from datadog_api_client.v2.model.case3rd_party_ticket_status import Case3rdPartyTicketStatus +from datadog_api_client.v2.model.case_assign import CaseAssign +from datadog_api_client.v2.model.case_assign_attributes import CaseAssignAttributes +from datadog_api_client.v2.model.case_assign_request import CaseAssignRequest +from datadog_api_client.v2.model.case_attributes import CaseAttributes +from datadog_api_client.v2.model.case_create import CaseCreate +from datadog_api_client.v2.model.case_create_attributes import CaseCreateAttributes +from datadog_api_client.v2.model.case_create_relationships import CaseCreateRelationships +from datadog_api_client.v2.model.case_create_request import CaseCreateRequest +from datadog_api_client.v2.model.case_empty import CaseEmpty +from datadog_api_client.v2.model.case_empty_request import CaseEmptyRequest +from datadog_api_client.v2.model.case_priority import CasePriority +from datadog_api_client.v2.model.case_relationships import CaseRelationships +from datadog_api_client.v2.model.case_resource_type import CaseResourceType +from datadog_api_client.v2.model.case_response import CaseResponse +from datadog_api_client.v2.model.case_sortable_field import CaseSortableField +from datadog_api_client.v2.model.case_status import CaseStatus +from datadog_api_client.v2.model.case_type import CaseType +from datadog_api_client.v2.model.case_update_priority import CaseUpdatePriority +from datadog_api_client.v2.model.case_update_priority_attributes import CaseUpdatePriorityAttributes +from datadog_api_client.v2.model.case_update_priority_request import CaseUpdatePriorityRequest +from datadog_api_client.v2.model.case_update_status import CaseUpdateStatus +from datadog_api_client.v2.model.case_update_status_attributes import CaseUpdateStatusAttributes +from datadog_api_client.v2.model.case_update_status_request import CaseUpdateStatusRequest +from datadog_api_client.v2.model.cases_response import CasesResponse +from datadog_api_client.v2.model.cases_response_meta import CasesResponseMeta +from datadog_api_client.v2.model.cases_response_meta_pagination import CasesResponseMetaPagination from datadog_api_client.v2.model.chargeback_breakdown import ChargebackBreakdown from datadog_api_client.v2.model.cloud_configuration_compliance_rule_options import ( CloudConfigurationComplianceRuleOptions, @@ -653,6 +681,8 @@ from datadog_api_client.v2.model.jsonapi_error_response import JSONAPIErrorResponse from datadog_api_client.v2.model.jira_integration_metadata import JiraIntegrationMetadata from datadog_api_client.v2.model.jira_integration_metadata_issues_item import JiraIntegrationMetadataIssuesItem +from datadog_api_client.v2.model.jira_issue import JiraIssue +from datadog_api_client.v2.model.jira_issue_result import JiraIssueResult from datadog_api_client.v2.model.list_application_keys_response import ListApplicationKeysResponse from datadog_api_client.v2.model.list_downtimes_response import ListDowntimesResponse from datadog_api_client.v2.model.list_findings_meta import ListFindingsMeta @@ -854,6 +884,8 @@ from datadog_api_client.v2.model.monthly_cost_attribution_response import MonthlyCostAttributionResponse from datadog_api_client.v2.model.nullable_relationship_to_user import NullableRelationshipToUser from datadog_api_client.v2.model.nullable_relationship_to_user_data import NullableRelationshipToUserData +from datadog_api_client.v2.model.nullable_user_relationship import NullableUserRelationship +from datadog_api_client.v2.model.nullable_user_relationship_data import NullableUserRelationshipData from datadog_api_client.v2.model.okta_account import OktaAccount from datadog_api_client.v2.model.okta_account_attributes import OktaAccountAttributes from datadog_api_client.v2.model.okta_account_request import OktaAccountRequest @@ -931,10 +963,21 @@ from datadog_api_client.v2.model.process_summary import ProcessSummary from datadog_api_client.v2.model.process_summary_attributes import ProcessSummaryAttributes from datadog_api_client.v2.model.process_summary_type import ProcessSummaryType +from datadog_api_client.v2.model.project import Project +from datadog_api_client.v2.model.project_attributes import ProjectAttributes +from datadog_api_client.v2.model.project_create import ProjectCreate +from datadog_api_client.v2.model.project_create_attributes import ProjectCreateAttributes +from datadog_api_client.v2.model.project_create_request import ProjectCreateRequest +from datadog_api_client.v2.model.project_relationship import ProjectRelationship +from datadog_api_client.v2.model.project_relationship_data import ProjectRelationshipData +from datadog_api_client.v2.model.project_relationships import ProjectRelationships +from datadog_api_client.v2.model.project_resource_type import ProjectResourceType +from datadog_api_client.v2.model.project_response import ProjectResponse from datadog_api_client.v2.model.projected_cost import ProjectedCost from datadog_api_client.v2.model.projected_cost_attributes import ProjectedCostAttributes from datadog_api_client.v2.model.projected_cost_response import ProjectedCostResponse from datadog_api_client.v2.model.projected_cost_type import ProjectedCostType +from datadog_api_client.v2.model.projects_response import ProjectsResponse from datadog_api_client.v2.model.query_formula import QueryFormula from datadog_api_client.v2.model.query_sort_order import QuerySortOrder from datadog_api_client.v2.model.rum_aggregate_bucket_value import RUMAggregateBucketValue @@ -1434,6 +1477,8 @@ from datadog_api_client.v2.model.service_definition_v2_version import ServiceDefinitionV2Version from datadog_api_client.v2.model.service_definitions_create_request import ServiceDefinitionsCreateRequest from datadog_api_client.v2.model.service_definitions_list_response import ServiceDefinitionsListResponse +from datadog_api_client.v2.model.service_now_ticket import ServiceNowTicket +from datadog_api_client.v2.model.service_now_ticket_result import ServiceNowTicketResult from datadog_api_client.v2.model.slack_integration_metadata import SlackIntegrationMetadata from datadog_api_client.v2.model.slack_integration_metadata_channel_item import SlackIntegrationMetadataChannelItem from datadog_api_client.v2.model.sort_direction import SortDirection @@ -1579,7 +1624,9 @@ from datadog_api_client.v2.model.user_invitations_request import UserInvitationsRequest from datadog_api_client.v2.model.user_invitations_response import UserInvitationsResponse from datadog_api_client.v2.model.user_invitations_type import UserInvitationsType +from datadog_api_client.v2.model.user_relationship_data import UserRelationshipData from datadog_api_client.v2.model.user_relationships import UserRelationships +from datadog_api_client.v2.model.user_resource_type import UserResourceType from datadog_api_client.v2.model.user_response import UserResponse from datadog_api_client.v2.model.user_response_included_item import UserResponseIncludedItem from datadog_api_client.v2.model.user_response_relationships import UserResponseRelationships @@ -1602,6 +1649,7 @@ from datadog_api_client.v2.model.user_update_attributes import UserUpdateAttributes from datadog_api_client.v2.model.user_update_data import UserUpdateData from datadog_api_client.v2.model.user_update_request import UserUpdateRequest +from datadog_api_client.v2.model.users_relationship import UsersRelationship from datadog_api_client.v2.model.users_response import UsersResponse from datadog_api_client.v2.model.users_type import UsersType from datadog_api_client.v2.model.widget_live_span import WidgetLiveSpan @@ -1780,6 +1828,34 @@ "CIAppTestsGroupBy", "CIAppTestsQueryFilter", "CIAppWarning", + "Case", + "Case3rdPartyTicketStatus", + "CaseAssign", + "CaseAssignAttributes", + "CaseAssignRequest", + "CaseAttributes", + "CaseCreate", + "CaseCreateAttributes", + "CaseCreateRelationships", + "CaseCreateRequest", + "CaseEmpty", + "CaseEmptyRequest", + "CasePriority", + "CaseRelationships", + "CaseResourceType", + "CaseResponse", + "CaseSortableField", + "CaseStatus", + "CaseType", + "CaseUpdatePriority", + "CaseUpdatePriorityAttributes", + "CaseUpdatePriorityRequest", + "CaseUpdateStatus", + "CaseUpdateStatusAttributes", + "CaseUpdateStatusRequest", + "CasesResponse", + "CasesResponseMeta", + "CasesResponseMetaPagination", "ChargebackBreakdown", "CloudConfigurationComplianceRuleOptions", "CloudConfigurationRegoRule", @@ -2172,6 +2248,8 @@ "JSONAPIErrorResponse", "JiraIntegrationMetadata", "JiraIntegrationMetadataIssuesItem", + "JiraIssue", + "JiraIssueResult", "ListApplicationKeysResponse", "ListDowntimesResponse", "ListFindingsMeta", @@ -2351,6 +2429,8 @@ "MonthlyCostAttributionResponse", "NullableRelationshipToUser", "NullableRelationshipToUserData", + "NullableUserRelationship", + "NullableUserRelationshipData", "OktaAccount", "OktaAccountAttributes", "OktaAccountRequest", @@ -2426,10 +2506,21 @@ "ProcessSummary", "ProcessSummaryAttributes", "ProcessSummaryType", + "Project", + "ProjectAttributes", + "ProjectCreate", + "ProjectCreateAttributes", + "ProjectCreateRequest", + "ProjectRelationship", + "ProjectRelationshipData", + "ProjectRelationships", + "ProjectResourceType", + "ProjectResponse", "ProjectedCost", "ProjectedCostAttributes", "ProjectedCostResponse", "ProjectedCostType", + "ProjectsResponse", "QueryFormula", "QuerySortOrder", "RUMAggregateBucketValue", @@ -2793,6 +2884,8 @@ "ServiceDefinitionV2Version", "ServiceDefinitionsCreateRequest", "ServiceDefinitionsListResponse", + "ServiceNowTicket", + "ServiceNowTicketResult", "SlackIntegrationMetadata", "SlackIntegrationMetadataChannelItem", "SortDirection", @@ -2934,7 +3027,9 @@ "UserInvitationsRequest", "UserInvitationsResponse", "UserInvitationsType", + "UserRelationshipData", "UserRelationships", + "UserResourceType", "UserResponse", "UserResponseIncludedItem", "UserResponseRelationships", @@ -2957,6 +3052,7 @@ "UserUpdateAttributes", "UserUpdateData", "UserUpdateRequest", + "UsersRelationship", "UsersResponse", "UsersType", "WidgetLiveSpan", diff --git a/tests/v2/cassettes/test_scenarios/test_archive_case_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_archive_case_returns_bad_request_response.frozen new file mode 100644 index 0000000000..ef6c63cf9e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_archive_case_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:35.988Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_archive_case_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_archive_case_returns_bad_request_response.yaml new file mode 100644 index 0000000000..99f8c709b1 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_archive_case_returns_bad_request_response.yaml @@ -0,0 +1,41 @@ +interactions: +- request: + body: '{"data":{"attributes":{"priority":"P4","title":"My new case","type":"STANDARD"},"relationships":{"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}},"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases + response: + body: + string: '{"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 + status: + code: 201 + message: Created +- request: + body: '{"data":{"type":"project"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/1f205230-5ea9-444e-a5f9-48f93d6a2cde/archive + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"got type + \"project\" expected one of \"case\""}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_archive_case_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_archive_case_returns_not_found_response.frozen new file mode 100644 index 0000000000..6b42677b0f --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_archive_case_returns_not_found_response.frozen @@ -0,0 +1 @@ +2024-02-07T13:09:07.949Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_archive_case_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_archive_case_returns_not_found_response.yaml new file mode 100644 index 0000000000..3ffea99df1 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_archive_case_returns_not_found_response.yaml @@ -0,0 +1,20 @@ +interactions: +- request: + body: '{"data":{"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/67d80aa3-36ff-44b9-a694-c501a7591737/archive + response: + body: + string: '{"errors":[{"code":"resource_not_found","title":"case not found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_archive_case_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_archive_case_returns_ok_response.frozen new file mode 100644 index 0000000000..558899ce6d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_archive_case_returns_ok_response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:36.901Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_archive_case_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_archive_case_returns_ok_response.yaml new file mode 100644 index 0000000000..7b940142fb --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_archive_case_returns_ok_response.yaml @@ -0,0 +1,42 @@ +interactions: +- request: + body: '{"data":{"attributes":{"priority":"P4","title":"My new case","type":"STANDARD"},"relationships":{"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}},"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases + response: + body: + string: '{"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 + status: + code: 201 + message: Created +- request: + body: '{"data":{"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/99e6e8cd-f115-4168-8814-30776007f44c/archive + response: + body: + string: '{"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 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_assign_case_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_assign_case_returns_bad_request_response.frozen new file mode 100644 index 0000000000..9f1a33f284 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_assign_case_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2024-02-12T13:25:55.665Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_assign_case_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_assign_case_returns_bad_request_response.yaml new file mode 100644 index 0000000000..42b6c01b94 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_assign_case_returns_bad_request_response.yaml @@ -0,0 +1,41 @@ +interactions: +- request: + body: '{"data":{"attributes":{"priority":"P4","title":"My new case","type":"STANDARD"},"relationships":{"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}},"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases + response: + body: + string: '{"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 + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"assignee_id":"invalid-uuid"},"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/4039be1a-5f87-4666-b986-a8396c0225c3/assign + response: + body: + string: '{"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 + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_assign_case_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_assign_case_returns_not_found_response.frozen new file mode 100644 index 0000000000..1f0ce04277 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_assign_case_returns_not_found_response.frozen @@ -0,0 +1 @@ +2024-02-07T13:09:08.433Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_assign_case_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_assign_case_returns_not_found_response.yaml new file mode 100644 index 0000000000..63a8ba7f61 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_assign_case_returns_not_found_response.yaml @@ -0,0 +1,56 @@ +interactions: +- request: + body: '{"data":{"attributes":{"email":"Test-Assign_case_returns_Not_Found_response-1707311348@datadoghq.com","title":"user + title"},"type":"users"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/users + response: + body: + string: '{"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"}}}}} + + ' + headers: + content-type: + - application/json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"assignee_id":"14040f89-c5ba-11ee-87b5-f6892353f87d"},"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/67d80aa3-36ff-44b9-a694-c501a7591737/assign + response: + body: + string: '{"errors":[{"code":"resource_not_found","title":"case not found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/users/14040f89-c5ba-11ee-87b5-f6892353f87d + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_assign_case_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_assign_case_returns_ok_response.frozen new file mode 100644 index 0000000000..5b2d1f17d0 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_assign_case_returns_ok_response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:38.147Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_assign_case_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_assign_case_returns_ok_response.yaml new file mode 100644 index 0000000000..2f73d247ca --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_assign_case_returns_ok_response.yaml @@ -0,0 +1,78 @@ +interactions: +- request: + body: '{"data":{"attributes":{"priority":"P4","title":"My new case","type":"STANDARD"},"relationships":{"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}},"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases + response: + body: + string: '{"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 + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"email":"Test-Assign_case_returns_OK_response-1707328838@datadoghq.com","title":"user + title"},"type":"users"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/users + response: + body: + string: '{"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"}}}}} + + ' + headers: + content-type: + - application/json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"assignee_id":"cced7029-c5e2-11ee-ac63-c24751e8bab0"},"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/a0801fce-a045-4b66-ad78-effcd959fa4f/assign + response: + body: + string: '{"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 + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/users/cced7029-c5e2-11ee-ac63-c24751e8bab0 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_case_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_a_case_returns_bad_request_response.frozen new file mode 100644 index 0000000000..14b7cfa0a2 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_case_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2024-02-07T13:09:09.415Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_case_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_a_case_returns_bad_request_response.yaml new file mode 100644 index 0000000000..a270cb0fe5 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_case_returns_bad_request_response.yaml @@ -0,0 +1,22 @@ +interactions: +- request: + body: '{"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: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"got type + \"userx\" expected one of \"user\""}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_case_returns_created_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_a_case_returns_created_response.frozen new file mode 100644 index 0000000000..1132edd29c --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_case_returns_created_response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:39.566Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_case_returns_created_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_a_case_returns_created_response.yaml new file mode 100644 index 0000000000..40e4cf2f4e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_case_returns_created_response.yaml @@ -0,0 +1,59 @@ +interactions: +- request: + body: '{"data":{"attributes":{"email":"Test-Create_a_case_returns_CREATED_response-1707328839@datadoghq.com","title":"user + title"},"type":"users"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/users + response: + body: + string: '{"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"}}}}} + + ' + headers: + content-type: + - application/json + status: + code: 201 + message: Created +- request: + body: '{"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: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases + response: + body: + string: '{"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 + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/users/cda929dc-c5e2-11ee-883d-6ad03867f364 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_the_details_of_a_case_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_the_details_of_a_case_returns_not_found_response.frozen new file mode 100644 index 0000000000..3601a30777 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_the_details_of_a_case_returns_not_found_response.frozen @@ -0,0 +1 @@ +2024-02-07T13:09:09.931Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_the_details_of_a_case_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_the_details_of_a_case_returns_not_found_response.yaml new file mode 100644 index 0000000000..d150ab9535 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_the_details_of_a_case_returns_not_found_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/cases/67d80aa3-36ff-44b9-a694-c501a7591737 + response: + body: + string: '{"errors":[{"code":"resource_not_found","title":"case not found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_the_details_of_a_case_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_the_details_of_a_case_returns_ok_response.frozen new file mode 100644 index 0000000000..a128549513 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_the_details_of_a_case_returns_ok_response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:40.743Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_the_details_of_a_case_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_the_details_of_a_case_returns_ok_response.yaml new file mode 100644 index 0000000000..70365ecbf1 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_the_details_of_a_case_returns_ok_response.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '{"data":{"attributes":{"priority":"P4","title":"My new case","type":"STANDARD"},"relationships":{"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}},"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases + response: + body: + string: '{"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 + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/cases/8fd1a1c3-3f55-4d6b-807f-ca70bc0e5749 + response: + body: + string: '{"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 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_unarchive_case_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_unarchive_case_returns_bad_request_response.frozen new file mode 100644 index 0000000000..5d3fc771c2 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unarchive_case_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:41.393Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_unarchive_case_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_unarchive_case_returns_bad_request_response.yaml new file mode 100644 index 0000000000..5b1aeb88df --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unarchive_case_returns_bad_request_response.yaml @@ -0,0 +1,41 @@ +interactions: +- request: + body: '{"data":{"attributes":{"priority":"P4","title":"My new case","type":"STANDARD"},"relationships":{"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}},"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases + response: + body: + string: '{"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 + status: + code: 201 + message: Created +- request: + body: '{"data":{"type":"project"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/91b52d3b-4d67-4b7f-ba4d-da67d8b46798/unarchive + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"got type + \"project\" expected one of \"case\""}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_unarchive_case_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_unarchive_case_returns_not_found_response.frozen new file mode 100644 index 0000000000..df6e8d3aea --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unarchive_case_returns_not_found_response.frozen @@ -0,0 +1 @@ +2024-02-07T13:09:10.329Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_unarchive_case_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_unarchive_case_returns_not_found_response.yaml new file mode 100644 index 0000000000..86fe137983 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unarchive_case_returns_not_found_response.yaml @@ -0,0 +1,20 @@ +interactions: +- request: + body: '{"data":{"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/67d80aa3-36ff-44b9-a694-c501a7591737/unarchive + response: + body: + string: '{"errors":[{"code":"resource_not_found","title":"case not found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_unarchive_case_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_unarchive_case_returns_ok_response.frozen new file mode 100644 index 0000000000..c639a2463e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unarchive_case_returns_ok_response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:42.027Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_unarchive_case_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_unarchive_case_returns_ok_response.yaml new file mode 100644 index 0000000000..9a9cef36ae --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unarchive_case_returns_ok_response.yaml @@ -0,0 +1,42 @@ +interactions: +- request: + body: '{"data":{"attributes":{"priority":"P4","title":"My new case","type":"STANDARD"},"relationships":{"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}},"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases + response: + body: + string: '{"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 + status: + code: 201 + message: Created +- request: + body: '{"data":{"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/020e2ce7-9fe8-4273-81ae-1e5873fba9d3/unarchive + response: + body: + string: '{"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 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_unassign_case_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_unassign_case_returns_bad_request_response.frozen new file mode 100644 index 0000000000..a7b2a9e33b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unassign_case_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:42.637Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_unassign_case_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_unassign_case_returns_bad_request_response.yaml new file mode 100644 index 0000000000..99c2a555c3 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unassign_case_returns_bad_request_response.yaml @@ -0,0 +1,41 @@ +interactions: +- request: + body: '{"data":{"attributes":{"priority":"P4","title":"My new case","type":"STANDARD"},"relationships":{"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}},"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases + response: + body: + string: '{"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 + status: + code: 201 + message: Created +- request: + body: '{"data":{"type":"project"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/8a6e4254-7429-4398-99c2-ba9363fb3f98/unassign + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"got type + \"project\" expected one of \"case\""}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_unassign_case_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_unassign_case_returns_not_found_response.frozen new file mode 100644 index 0000000000..fee1f80845 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unassign_case_returns_not_found_response.frozen @@ -0,0 +1 @@ +2024-02-07T13:09:10.714Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_unassign_case_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_unassign_case_returns_not_found_response.yaml new file mode 100644 index 0000000000..50bfa4a71f --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unassign_case_returns_not_found_response.yaml @@ -0,0 +1,20 @@ +interactions: +- request: + body: '{"data":{"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/67d80aa3-36ff-44b9-a694-c501a7591737/unassign + response: + body: + string: '{"errors":[{"code":"resource_not_found","title":"case not found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_unassign_case_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_unassign_case_returns_ok_response.frozen new file mode 100644 index 0000000000..0a5d0226a2 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unassign_case_returns_ok_response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:43.176Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_unassign_case_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_unassign_case_returns_ok_response.yaml new file mode 100644 index 0000000000..aafa4d4aba --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unassign_case_returns_ok_response.yaml @@ -0,0 +1,42 @@ +interactions: +- request: + body: '{"data":{"attributes":{"priority":"P4","title":"My new case","type":"STANDARD"},"relationships":{"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}},"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases + response: + body: + string: '{"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 + status: + code: 201 + message: Created +- request: + body: '{"data":{"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/8c5de575-685c-4ac4-a78a-9774c4f2160b/unassign + response: + body: + string: '{"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 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_case_priority_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_case_priority_returns_bad_request_response.frozen new file mode 100644 index 0000000000..da678b9cae --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_case_priority_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:43.807Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_case_priority_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_case_priority_returns_bad_request_response.yaml new file mode 100644 index 0000000000..4a150d22cc --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_case_priority_returns_bad_request_response.yaml @@ -0,0 +1,41 @@ +interactions: +- request: + body: '{"data":{"attributes":{"priority":"P4","title":"My new case","type":"STANDARD"},"relationships":{"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}},"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases + response: + body: + string: '{"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 + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"priority":"P1234"},"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/09077090-4370-4539-b9e5-445173f4fced/priority + response: + body: + string: '{"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 + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_case_priority_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_case_priority_returns_not_found_response.frozen new file mode 100644 index 0000000000..33edf5b458 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_case_priority_returns_not_found_response.frozen @@ -0,0 +1 @@ +2024-02-07T13:09:11.084Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_case_priority_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_case_priority_returns_not_found_response.yaml new file mode 100644 index 0000000000..978ae0f28b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_case_priority_returns_not_found_response.yaml @@ -0,0 +1,20 @@ +interactions: +- request: + body: '{"data":{"attributes":{"priority":"P3"},"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/67d80aa3-36ff-44b9-a694-c501a7591737/priority + response: + body: + string: '{"errors":[{"code":"resource_not_found","title":"case not found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_case_priority_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_case_priority_returns_ok_response.frozen new file mode 100644 index 0000000000..ac293b567a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_case_priority_returns_ok_response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:44.433Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_case_priority_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_case_priority_returns_ok_response.yaml new file mode 100644 index 0000000000..3310da364c --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_case_priority_returns_ok_response.yaml @@ -0,0 +1,42 @@ +interactions: +- request: + body: '{"data":{"attributes":{"priority":"P4","title":"My new case","type":"STANDARD"},"relationships":{"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}},"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases + response: + body: + string: '{"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 + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"priority":"P3"},"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/60fdb1eb-209a-4072-9db3-4d08a9c4180c/priority + response: + body: + string: '{"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 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_case_status_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_case_status_returns_bad_request_response.frozen new file mode 100644 index 0000000000..8a9c88da38 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_case_status_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:45.069Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_case_status_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_case_status_returns_bad_request_response.yaml new file mode 100644 index 0000000000..3774531e20 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_case_status_returns_bad_request_response.yaml @@ -0,0 +1,41 @@ +interactions: +- request: + body: '{"data":{"attributes":{"priority":"P4","title":"My new case","type":"STANDARD"},"relationships":{"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}},"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases + response: + body: + string: '{"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 + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"status":"OPENED"},"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/243feddb-69f8-4e22-988a-8ae954b643fa/status + response: + body: + string: '{"errors":[{"title":"Generic Error","detail":"invalid status OPENED. + Must be one of CLOSED, SUNKNOWN, OPEN, IN_PROGRESS"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_case_status_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_case_status_returns_not_found_response.frozen new file mode 100644 index 0000000000..52aa1297fc --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_case_status_returns_not_found_response.frozen @@ -0,0 +1 @@ +2024-02-07T13:09:11.471Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_case_status_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_case_status_returns_not_found_response.yaml new file mode 100644 index 0000000000..a16f0808f3 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_case_status_returns_not_found_response.yaml @@ -0,0 +1,20 @@ +interactions: +- request: + body: '{"data":{"attributes":{"status":"OPEN"},"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/67d80aa3-36ff-44b9-a694-c501a7591737/status + response: + body: + string: '{"errors":[{"code":"resource_not_found","title":"case not found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_case_status_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_case_status_returns_ok_response.frozen new file mode 100644 index 0000000000..2c36281858 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_case_status_returns_ok_response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:45.628Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_case_status_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_case_status_returns_ok_response.yaml new file mode 100644 index 0000000000..d429285c7d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_case_status_returns_ok_response.yaml @@ -0,0 +1,42 @@ +interactions: +- request: + body: '{"data":{"attributes":{"priority":"P4","title":"My new case","type":"STANDARD"},"relationships":{"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}},"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases + response: + body: + string: '{"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 + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"status":"IN_PROGRESS"},"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/ceae478d-b504-4cb7-bad2-e8f8e5a0a77b/status + response: + body: + string: '{"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 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/features/cases.feature b/tests/v2/features/cases.feature new file mode 100644 index 0000000000..5a0eca6155 --- /dev/null +++ b/tests/v2/features/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/tests/v2/features/cases_projects.feature b/tests/v2/features/cases_projects.feature new file mode 100644 index 0000000000..1b3fe63e49 --- /dev/null +++ b/tests/v2/features/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/tests/v2/features/given.json b/tests/v2/features/given.json index da22a5fc35..cbaee96cb7 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/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/tests/v2/features/undo.json b/tests/v2/features/undo.json index 61d85e0fca..1268756c9d 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/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": {