diff --git a/.apigentools-info b/.apigentools-info index 1426a575dc..bdb98e2bfb 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-07 13:34:36.051237", + "spec_repo_commit": "4feeb587" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-02-06 15:45:01.704595", - "spec_repo_commit": "46672359" + "regenerated": "2024-02-07 13:34:36.098934", + "spec_repo_commit": "4feeb587" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 25c4b45133..63ac310c66 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -151,6 +151,14 @@ 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 CloudAccountID: description: Cloud Account id. in: path @@ -381,6 +389,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 +3348,334 @@ 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 create + 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' + 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 + nullable: true + 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 + CaseStatus: + default: OPEN + description: Case status + enum: + - OPEN + - IN_PROGRESS + - CLOSED + example: OPEN + type: string + x-enum-varnames: + - OPEN + - IN_PROGRESS + - CLOSED + CaseType: + default: STANDARD + 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 +9688,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 +12313,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 +13468,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/RelationshipToUsers' + 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 +13631,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 +19123,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: @@ -20621,6 +21147,15 @@ components: 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: @@ -20929,6 +21464,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 +22654,452 @@ 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' + - description: Search query + in: query + name: filter + required: false + schema: + example: status:open (team:case-management OR team:event-management) + type: string + - description: Specify which field to sort + in: query + name: sort[field] + required: false + schema: + default: created_at + 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: Get a list of 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: + - 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: + - Projects + /api/v2/cases/projects/{project_id}: + 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: + - 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 +34446,8 @@ 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: 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. @@ -33633,6 +34618,8 @@ tags: name: Powerpack - description: The processes API allows you to query processes data for your organization. name: Processes +- description: View and manage project within Case Management. + name: Projects - description: Search or aggregate your RUM events over HTTP. name: RUM - description: 'A restriction policy defines the access control rules for a resource, diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index a4bb4e32e5..5d6139a090 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -29,6 +29,13 @@ authn\_mappings\_api :members: :show-inheritance: +cases\_api +---------- + +.. automodule:: datadog_api_client.v2.api.cases_api + :members: + :show-inheritance: + ci\_visibility\_pipelines\_api ------------------------------ @@ -232,6 +239,13 @@ processes\_api :members: :show-inheritance: +projects\_api +------------- + +.. automodule:: datadog_api_client.v2.api.projects_api + :members: + :show-inheritance: + restriction\_policies\_api -------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index f80df1d9df..6f06cf69de 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -722,6 +722,195 @@ 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\_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 +4131,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 +5412,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 +5951,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 +6049,13 @@ projected\_cost\_type :members: :show-inheritance: +projects\_response +------------------ + +.. automodule:: datadog_api_client.v2.model.projects_response + :members: + :show-inheritance: + query\_formula -------------- @@ -8275,6 +8569,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 ---------------------------- @@ -9269,6 +9577,13 @@ user\_relationships :members: :show-inheritance: +user\_resource\_type +-------------------- + +.. automodule:: datadog_api_client.v2.model.user_resource_type + :members: + :show-inheritance: + user\_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..6eefcc74d9 --- /dev/null +++ b/examples/v2/cases/CreateCase.py @@ -0,0 +1,58 @@ +""" +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"] + +# there is a valid "project" in the system +PROJECT_ID = environ["PROJECT_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=PROJECT_ID, + 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..2a1e53f81d --- /dev/null +++ b/examples/v2/cases/SearchCases.py @@ -0,0 +1,13 @@ +""" +Get a list of 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_1069159560.py b/examples/v2/cases/SearchCases_1069159560.py new file mode 100644 index 0000000000..29c637a01e --- /dev/null +++ b/examples/v2/cases/SearchCases_1069159560.py @@ -0,0 +1,13 @@ +""" +Get a list of 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/examples/v2/projects/CreateProject.py b/examples/v2/projects/CreateProject.py new file mode 100644 index 0000000000..29b6c6b1dd --- /dev/null +++ b/examples/v2/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.projects_api import ProjectsApi +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 = ProjectsApi(api_client) + response = api_instance.create_project(body=body) + + print(response) diff --git a/examples/v2/projects/GetProject.py b/examples/v2/projects/GetProject.py new file mode 100644 index 0000000000..20417a1e8c --- /dev/null +++ b/examples/v2/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.projects_api import ProjectsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ProjectsApi(api_client) + response = api_instance.get_project( + project_id="project_id", + ) + + print(response) diff --git a/examples/v2/projects/GetProjects.py b/examples/v2/projects/GetProjects.py new file mode 100644 index 0000000000..35cb02e0a7 --- /dev/null +++ b/examples/v2/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.projects_api import ProjectsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ProjectsApi(api_client) + response = api_instance.get_projects() + + 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..f3740ed3b0 --- /dev/null +++ b/src/datadog_api_client/v2/api/cases_api.py @@ -0,0 +1,540 @@ +# 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 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", + }, + "filter": { + "openapi_types": (str,), + "attribute": "filter", + "location": "query", + }, + "sort_field": { + "openapi_types": (str,), + "attribute": "sort[field]", + "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, + filter: Union[str, UnsetType] = unset, + sort_field: Union[str, UnsetType] = unset, + sort_asc: Union[bool, UnsetType] = unset, + ) -> CasesResponse: + """Get a list of 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 filter: Search query + :type filter: str, optional + :param sort_field: Specify which field to sort + :type sort_field: 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 filter is not unset: + kwargs["filter"] = filter + + if sort_field is not unset: + kwargs["sort_field"] = sort_field + + 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, + filter: Union[str, UnsetType] = unset, + sort_field: Union[str, UnsetType] = unset, + sort_asc: Union[bool, UnsetType] = unset, + ) -> collections.abc.Iterable[Case]: + """Get a list of 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 filter: Search query + :type filter: str, optional + :param sort_field: Specify which field to sort + :type sort_field: 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 filter is not unset: + kwargs["filter"] = filter + + if sort_field is not unset: + kwargs["sort_field"] = sort_field + + 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/projects_api.py b/src/datadog_api_client/v2/api/projects_api.py new file mode 100644 index 0000000000..305ae1eb39 --- /dev/null +++ b/src/datadog_api_client/v2/api/projects_api.py @@ -0,0 +1,128 @@ +# 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 ProjectsApi: + """ + 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._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 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..8831fe836e 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -4,6 +4,7 @@ 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.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 @@ -31,6 +32,7 @@ from datadog_api_client.v2.api.organizations_api import OrganizationsApi from datadog_api_client.v2.api.powerpack_api import PowerpackApi from datadog_api_client.v2.api.processes_api import ProcessesApi +from datadog_api_client.v2.api.projects_api import ProjectsApi from datadog_api_client.v2.api.rum_api import RUMApi from datadog_api_client.v2.api.restriction_policies_api import RestrictionPoliciesApi from datadog_api_client.v2.api.roles_api import RolesApi @@ -54,6 +56,7 @@ "AuthNMappingsApi", "CIVisibilityPipelinesApi", "CIVisibilityTestsApi", + "CasesApi", "CloudCostManagementApi", "CloudWorkloadSecurityApi", "CloudflareIntegrationApi", @@ -81,6 +84,7 @@ "OrganizationsApi", "PowerpackApi", "ProcessesApi", + "ProjectsApi", "RUMApi", "RestrictionPoliciesApi", "RolesApi", 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..f4536276da --- /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, none_type, 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, none_type, 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..22577ab92f --- /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 create + + :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..0a62fb038c --- /dev/null +++ b/src/datadog_api_client/v2/model/case_create_attributes.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, + none_type, + 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, none_type, UnsetType] = unset, + **kwargs, + ): + """ + Case creation attributes + + :param description: description + :type description: str, optional + + :param priority: Case priority + :type priority: CasePriority, none_type, 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..81fa1ff960 --- /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_, + assignee: Union[NullableUserRelationship, none_type, UnsetType] = unset, + project: Union[ProjectRelationship, 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, optional + """ + if assignee is not unset: + kwargs["assignee"] = assignee + if project is not unset: + kwargs["project"] = project + super().__init__(kwargs) 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..e612054217 --- /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 create + :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..96ba15f875 --- /dev/null +++ b/src/datadog_api_client/v2/model/case_priority.py @@ -0,0 +1,52 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from 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"] + + _nullable = True + + @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_status.py b/src/datadog_api_client/v2/model/case_status.py new file mode 100644 index 0000000000..b43e71281c --- /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: If omitted defaults to "OPEN". 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..58c1592bc7 --- /dev/null +++ b/src/datadog_api_client/v2/model/case_update_priority_attributes.py @@ -0,0 +1,41 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.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: Union[CasePriority, none_type], **kwargs): + """ + Case update priority attributes + + :param priority: Case priority + :type priority: CasePriority, none_type + """ + 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..8a92bd27f0 --- /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.relationship_to_users import RelationshipToUsers + + +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.relationship_to_users import RelationshipToUsers + + return { + "member_team": (RelationshipToTeamLinks,), + "member_user": (RelationshipToUsers,), + } + + attribute_map = { + "member_team": "member_team", + "member_user": "member_user", + } + + def __init__( + self_, + member_team: Union[RelationshipToTeamLinks, UnsetType] = unset, + member_user: Union[RelationshipToUsers, 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: RelationshipToUsers, 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_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/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 4895e97311..11de85765e 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -183,6 +183,33 @@ 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_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 +680,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 +883,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 +962,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 +1476,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 @@ -1580,6 +1624,7 @@ 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_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 @@ -1780,6 +1825,33 @@ "CIAppTestsGroupBy", "CIAppTestsQueryFilter", "CIAppWarning", + "Case", + "Case3rdPartyTicketStatus", + "CaseAssign", + "CaseAssignAttributes", + "CaseAssignRequest", + "CaseAttributes", + "CaseCreate", + "CaseCreateAttributes", + "CaseCreateRelationships", + "CaseCreateRequest", + "CaseEmpty", + "CaseEmptyRequest", + "CasePriority", + "CaseRelationships", + "CaseResourceType", + "CaseResponse", + "CaseStatus", + "CaseType", + "CaseUpdatePriority", + "CaseUpdatePriorityAttributes", + "CaseUpdatePriorityRequest", + "CaseUpdateStatus", + "CaseUpdateStatusAttributes", + "CaseUpdateStatusRequest", + "CasesResponse", + "CasesResponseMeta", + "CasesResponseMetaPagination", "ChargebackBreakdown", "CloudConfigurationComplianceRuleOptions", "CloudConfigurationRegoRule", @@ -2172,6 +2244,8 @@ "JSONAPIErrorResponse", "JiraIntegrationMetadata", "JiraIntegrationMetadataIssuesItem", + "JiraIssue", + "JiraIssueResult", "ListApplicationKeysResponse", "ListDowntimesResponse", "ListFindingsMeta", @@ -2351,6 +2425,8 @@ "MonthlyCostAttributionResponse", "NullableRelationshipToUser", "NullableRelationshipToUserData", + "NullableUserRelationship", + "NullableUserRelationshipData", "OktaAccount", "OktaAccountAttributes", "OktaAccountRequest", @@ -2426,10 +2502,21 @@ "ProcessSummary", "ProcessSummaryAttributes", "ProcessSummaryType", + "Project", + "ProjectAttributes", + "ProjectCreate", + "ProjectCreateAttributes", + "ProjectCreateRequest", + "ProjectRelationship", + "ProjectRelationshipData", + "ProjectRelationships", + "ProjectResourceType", + "ProjectResponse", "ProjectedCost", "ProjectedCostAttributes", "ProjectedCostResponse", "ProjectedCostType", + "ProjectsResponse", "QueryFormula", "QuerySortOrder", "RUMAggregateBucketValue", @@ -2793,6 +2880,8 @@ "ServiceDefinitionV2Version", "ServiceDefinitionsCreateRequest", "ServiceDefinitionsListResponse", + "ServiceNowTicket", + "ServiceNowTicketResult", "SlackIntegrationMetadata", "SlackIntegrationMetadataChannelItem", "SortDirection", @@ -2935,6 +3024,7 @@ "UserInvitationsResponse", "UserInvitationsType", "UserRelationships", + "UserResourceType", "UserResponse", "UserResponseIncludedItem", "UserResponseRelationships", 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..aafe98bc0a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_archive_case_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2024-02-07T13:09:07.143Z \ 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..2e7e87b10b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_archive_case_returns_bad_request_response.yaml @@ -0,0 +1,61 @@ +interactions: +- request: + body: '{"data":{"attributes":{"key":"EBBCAAD","name":"Security Investigation - + e9041bb591c95aad"},"type":"project"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/projects + response: + body: + string: '{"data":{"id":"d837ad1d-a4c2-4079-8232-44e1aaf25a20","type":"project","attributes":{"handle":"","key":"EBBCAAD","name":"Security + Investigation - e9041bb591c95aad","settings":{}},"relationships":{"member_user":{"data":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"priority":"P4","title":"My new case","type":"STANDARD"},"relationships":{"project":{"data":{"id":"d837ad1d-a4c2-4079-8232-44e1aaf25a20","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":"34","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T13:09:07.855423089Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"2831b4c8-c9ca-44bc-a592-95647430c91d","key":"EBBCAAD-1","priority":"P4","public_id":"34","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d837ad1d-a4c2-4079-8232-44e1aaf25a20","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/34/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..bb9bac7a77 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_archive_case_returns_ok_response.frozen @@ -0,0 +1 @@ +2024-02-07T13:09:08.013Z \ 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..a0df803f40 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_archive_case_returns_ok_response.yaml @@ -0,0 +1,62 @@ +interactions: +- request: + body: '{"data":{"attributes":{"key":"BADCDA","name":"Security Investigation - + 56384bad2cd355a2"},"type":"project"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/projects + response: + body: + string: '{"data":{"id":"362099c5-76aa-4f95-98ce-d74d94a6a268","type":"project","attributes":{"handle":"","key":"BADCDA","name":"Security + Investigation - 56384bad2cd355a2","settings":{}},"relationships":{"member_user":{"data":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"priority":"P4","title":"My new case","type":"STANDARD"},"relationships":{"project":{"data":{"id":"362099c5-76aa-4f95-98ce-d74d94a6a268","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":"35","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T13:09:08.128127965Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"d82e5a6e-2b29-4b50-8ce5-4583806297aa","key":"BADCDA-1","priority":"P4","public_id":"35","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"362099c5-76aa-4f95-98ce-d74d94a6a268","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/35/archive + response: + body: + string: '{"data":{"id":"35","type":"case","attributes":{"archived_at":"2024-02-07T13:09:08.212033948Z","attributes":{},"created_at":"2024-02-07T13:09:08.128128Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"d82e5a6e-2b29-4b50-8ce5-4583806297aa","key":"BADCDA-1","priority":"P4","public_id":"35","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":"362099c5-76aa-4f95-98ce-d74d94a6a268","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..abd6fd367a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_assign_case_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2024-02-07T13:09:08.232Z \ 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..c3c79d9569 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_assign_case_returns_bad_request_response.yaml @@ -0,0 +1,61 @@ +interactions: +- request: + body: '{"data":{"attributes":{"key":"EDCEBEFC","name":"Security Investigation + - e7dcebe66fc70310"},"type":"project"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/projects + response: + body: + string: '{"data":{"id":"2c6249c2-76d6-4cf3-aac9-d6cacea957ef","type":"project","attributes":{"handle":"","key":"EDCEBEFC","name":"Security + Investigation - e7dcebe66fc70310","settings":{}},"relationships":{"member_user":{"data":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"priority":"P4","title":"My new case","type":"STANDARD"},"relationships":{"project":{"data":{"id":"2c6249c2-76d6-4cf3-aac9-d6cacea957ef","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":"36","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T13:09:08.354070423Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"6f08f3d6-8583-49b9-952f-7a9a5d3e793b","key":"EDCEBEFC-1","priority":"P4","public_id":"36","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"2c6249c2-76d6-4cf3-aac9-d6cacea957ef","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":{"assign":"invalid-uuid"},"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/36/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..85b6aa03ad --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_assign_case_returns_ok_response.frozen @@ -0,0 +1 @@ +2024-02-07T13:09:08.858Z \ 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..2ea8c308f1 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_assign_case_returns_ok_response.yaml @@ -0,0 +1,98 @@ +interactions: +- request: + body: '{"data":{"attributes":{"key":"DBEDDDBF","name":"Security Investigation + - 25d2be4d7d0dbf87"},"type":"project"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/projects + response: + body: + string: '{"data":{"id":"2ec620b0-fe3e-482d-b0da-02f2dfb116ec","type":"project","attributes":{"handle":"","key":"DBEDDDBF","name":"Security + Investigation - 25d2be4d7d0dbf87","settings":{}},"relationships":{"member_user":{"data":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"priority":"P4","title":"My new case","type":"STANDARD"},"relationships":{"project":{"data":{"id":"2ec620b0-fe3e-482d-b0da-02f2dfb116ec","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":"37","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T13:09:08.957880084Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"4f4f862c-ad90-4c40-bf81-1f5d03d98fe2","key":"DBEDDDBF-1","priority":"P4","public_id":"37","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"2ec620b0-fe3e-482d-b0da-02f2dfb116ec","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-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":"14545789-c5ba-11ee-8473-a6f1c8b4cdf7","attributes":{"name":null,"handle":"test-assign_case_returns_ok_response-1707311348@datadoghq.com","created_at":"2024-02-07T13:09:09.072505+00:00","modified_at":"2024-02-07T13:09:09.072505+00:00","email":"test-assign_case_returns_ok_response-1707311348@datadoghq.com","icon":"https://secure.gravatar.com/avatar/2e7e16f20104a929ea8ba071de8acd78?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":"14545789-c5ba-11ee-8473-a6f1c8b4cdf7"},"type":"case"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/37/assign + response: + body: + string: '{"data":{"id":"37","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T13:09:08.95788Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"4f4f862c-ad90-4c40-bf81-1f5d03d98fe2","key":"DBEDDDBF-1","modified_at":"2024-02-07T13:09:09.160381Z","priority":"P4","public_id":"37","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"assignee":{"data":{"id":"14545789-c5ba-11ee-8473-a6f1c8b4cdf7","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":"2ec620b0-fe3e-482d-b0da-02f2dfb116ec","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":"14545789-c5ba-11ee-8473-a6f1c8b4cdf7","type":"user","attributes":{"email":"test-assign_case_returns_ok_response-1707311348@datadoghq.com","handle":"test-assign_case_returns_ok_response-1707311348@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/14545789-c5ba-11ee-8473-a6f1c8b4cdf7 + 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..ae4d5721fd --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_case_returns_created_response.frozen @@ -0,0 +1 @@ +2024-02-07T13:09:09.476Z \ 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..5722bbf164 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_case_returns_created_response.yaml @@ -0,0 +1,78 @@ +interactions: +- request: + body: '{"data":{"attributes":{"key":"FDEAA","name":"Security Investigation - fd266322420e8aa7"},"type":"project"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/projects + response: + body: + string: '{"data":{"id":"343d2b53-ddf5-440d-92b0-f3040d18f319","type":"project","attributes":{"handle":"","key":"FDEAA","name":"Security + Investigation - fd266322420e8aa7","settings":{}},"relationships":{"member_user":{"data":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"email":"Test-Create_a_case_returns_CREATED_response-1707311349@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":"14a8d4b6-c5ba-11ee-a8f1-c611f3a03311","attributes":{"name":null,"handle":"test-create_a_case_returns_created_response-1707311349@datadoghq.com","created_at":"2024-02-07T13:09:09.626210+00:00","modified_at":"2024-02-07T13:09:09.626210+00:00","email":"test-create_a_case_returns_created_response-1707311349@datadoghq.com","icon":"https://secure.gravatar.com/avatar/b3861cd7ad369a68d33b973a4e6bb792?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 fd266322420e8aa7","type":"STANDARD"},"relationships":{"assignee":{"data":{"id":"14a8d4b6-c5ba-11ee-a8f1-c611f3a03311","type":"user"}},"project":{"data":{"id":"343d2b53-ddf5-440d-92b0-f3040d18f319","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":"38","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T13:09:09.703300735Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"de85e449-31d0-4d1e-9240-32ef794fbcb7","key":"FDEAA-1","priority":"NOT_DEFINED","public_id":"38","status":"OPEN","title":"Security + breach investigation in fd266322420e8aa7","type":"STANDARD"},"relationships":{"assignee":{"data":{"id":"14a8d4b6-c5ba-11ee-a8f1-c611f3a03311","type":"user"}},"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"343d2b53-ddf5-440d-92b0-f3040d18f319","type":"project"}}}},"included":[{"id":"14a8d4b6-c5ba-11ee-a8f1-c611f3a03311","type":"user","attributes":{"email":"test-create_a_case_returns_created_response-1707311349@datadoghq.com","handle":"test-create_a_case_returns_created_response-1707311349@datadoghq.com","name":""}},{"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: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/users/14a8d4b6-c5ba-11ee-a8f1-c611f3a03311 + 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..8f176226c2 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_the_details_of_a_case_returns_ok_response.frozen @@ -0,0 +1 @@ +2024-02-07T13:09:09.992Z \ 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..2b8b05c0c1 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_the_details_of_a_case_returns_ok_response.yaml @@ -0,0 +1,60 @@ +interactions: +- request: + body: '{"data":{"attributes":{"key":"CDBBBCDE","name":"Security Investigation + - c0dbb4b318c89de3"},"type":"project"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/projects + response: + body: + string: '{"data":{"id":"ccd520b8-158a-4ba0-a1af-b9c22f6a42b6","type":"project","attributes":{"handle":"","key":"CDBBBCDE","name":"Security + Investigation - c0dbb4b318c89de3","settings":{}},"relationships":{"member_user":{"data":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"priority":"P4","title":"My new case","type":"STANDARD"},"relationships":{"project":{"data":{"id":"ccd520b8-158a-4ba0-a1af-b9c22f6a42b6","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":"39","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T13:09:10.078455675Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"906e6c97-7315-4994-9f17-58c7e9e36815","key":"CDBBBCDE-1","priority":"P4","public_id":"39","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"ccd520b8-158a-4ba0-a1af-b9c22f6a42b6","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/39 + response: + body: + string: '{"data":{"id":"39","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T13:09:10.078456Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"906e6c97-7315-4994-9f17-58c7e9e36815","key":"CDBBBCDE-1","priority":"P4","public_id":"39","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"ccd520b8-158a-4ba0-a1af-b9c22f6a42b6","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..4d80fc91cf --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unarchive_case_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2024-02-07T13:09:10.165Z \ 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..12d9fb6d82 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unarchive_case_returns_bad_request_response.yaml @@ -0,0 +1,61 @@ +interactions: +- request: + body: '{"data":{"attributes":{"key":"DCACCCBC","name":"Security Investigation + - d41c4a16879cccbc"},"type":"project"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/projects + response: + body: + string: '{"data":{"id":"4e474d23-cbfc-4114-9dbe-3df2ac7d7661","type":"project","attributes":{"handle":"","key":"DCACCCBC","name":"Security + Investigation - d41c4a16879cccbc","settings":{}},"relationships":{"member_user":{"data":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"priority":"P4","title":"My new case","type":"STANDARD"},"relationships":{"project":{"data":{"id":"4e474d23-cbfc-4114-9dbe-3df2ac7d7661","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":"40","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T13:09:10.259360762Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"a59f0ae0-da76-4a53-b7ea-9ccc28c60408","key":"DCACCCBC-1","priority":"P4","public_id":"40","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"4e474d23-cbfc-4114-9dbe-3df2ac7d7661","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/40/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..659c390e23 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unarchive_case_returns_ok_response.frozen @@ -0,0 +1 @@ +2024-02-07T13:09:10.378Z \ 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..647e38916a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unarchive_case_returns_ok_response.yaml @@ -0,0 +1,62 @@ +interactions: +- request: + body: '{"data":{"attributes":{"key":"DEEDEDDE","name":"Security Investigation + - d18e44e7d5ed8de2"},"type":"project"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/projects + response: + body: + string: '{"data":{"id":"06545987-ba10-44cc-adbf-67d1b39eb49b","type":"project","attributes":{"handle":"","key":"DEEDEDDE","name":"Security + Investigation - d18e44e7d5ed8de2","settings":{}},"relationships":{"member_user":{"data":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"priority":"P4","title":"My new case","type":"STANDARD"},"relationships":{"project":{"data":{"id":"06545987-ba10-44cc-adbf-67d1b39eb49b","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":"41","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T13:09:10.475755047Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"714fe202-97fa-463e-ac9c-1443724108c8","key":"DEEDEDDE-1","priority":"P4","public_id":"41","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"06545987-ba10-44cc-adbf-67d1b39eb49b","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/41/unarchive + response: + body: + string: '{"data":{"id":"41","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T13:09:10.475755Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"714fe202-97fa-463e-ac9c-1443724108c8","key":"DEEDEDDE-1","priority":"P4","public_id":"41","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"06545987-ba10-44cc-adbf-67d1b39eb49b","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..7d5ed858f2 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unassign_case_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2024-02-07T13:09:10.544Z \ 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..a6e773dabb --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unassign_case_returns_bad_request_response.yaml @@ -0,0 +1,61 @@ +interactions: +- request: + body: '{"data":{"attributes":{"key":"CCECFADFD","name":"Security Investigation + - 1cc7444ecfadf9db"},"type":"project"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/projects + response: + body: + string: '{"data":{"id":"1af01782-e6dd-442a-b7e7-e37517a75203","type":"project","attributes":{"handle":"","key":"CCECFADFD","name":"Security + Investigation - 1cc7444ecfadf9db","settings":{}},"relationships":{"member_user":{"data":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"priority":"P4","title":"My new case","type":"STANDARD"},"relationships":{"project":{"data":{"id":"1af01782-e6dd-442a-b7e7-e37517a75203","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":"42","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T13:09:10.631391113Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"d9e9d49c-a226-45e2-8f1b-7996ba501fd0","key":"CCECFADFD-1","priority":"P4","public_id":"42","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"1af01782-e6dd-442a-b7e7-e37517a75203","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/42/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..6b8bdf18de --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unassign_case_returns_ok_response.frozen @@ -0,0 +1 @@ +2024-02-07T13:09:10.766Z \ 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..2b7cea532c --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unassign_case_returns_ok_response.yaml @@ -0,0 +1,62 @@ +interactions: +- request: + body: '{"data":{"attributes":{"key":"DFBCAFC","name":"Security Investigation - + d6617fb31c3afc35"},"type":"project"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/projects + response: + body: + string: '{"data":{"id":"ccf336da-bea0-4d58-9be3-1d371bfb5537","type":"project","attributes":{"handle":"","key":"DFBCAFC","name":"Security + Investigation - d6617fb31c3afc35","settings":{}},"relationships":{"member_user":{"data":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"priority":"P4","title":"My new case","type":"STANDARD"},"relationships":{"project":{"data":{"id":"ccf336da-bea0-4d58-9be3-1d371bfb5537","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":"43","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T13:09:10.867140761Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"7b74e805-76df-4fdd-8739-39e0ff99eeb6","key":"DFBCAFC-1","priority":"P4","public_id":"43","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"ccf336da-bea0-4d58-9be3-1d371bfb5537","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/43/unassign + response: + body: + string: '{"data":{"id":"43","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T13:09:10.867141Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"7b74e805-76df-4fdd-8739-39e0ff99eeb6","key":"DFBCAFC-1","priority":"P4","public_id":"43","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"ccf336da-bea0-4d58-9be3-1d371bfb5537","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..ef6aa2064f --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_case_priority_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2024-02-07T13:09:10.936Z \ 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..2a1a336c7d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_case_priority_returns_bad_request_response.yaml @@ -0,0 +1,61 @@ +interactions: +- request: + body: '{"data":{"attributes":{"key":"ACDBEAE","name":"Security Investigation - + 5a04cdb32e97a07e"},"type":"project"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/projects + response: + body: + string: '{"data":{"id":"ad80d2f1-b93f-46c1-9285-cfd79e3f279d","type":"project","attributes":{"handle":"","key":"ACDBEAE","name":"Security + Investigation - 5a04cdb32e97a07e","settings":{}},"relationships":{"member_user":{"data":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"priority":"P4","title":"My new case","type":"STANDARD"},"relationships":{"project":{"data":{"id":"ad80d2f1-b93f-46c1-9285-cfd79e3f279d","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":"44","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T13:09:11.023159543Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"9df0e2e2-df42-46e3-8d4f-f785b5a2ae0e","key":"ACDBEAE-1","priority":"P4","public_id":"44","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"ad80d2f1-b93f-46c1-9285-cfd79e3f279d","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/44/priority + response: + body: + string: '{"errors":[{"title":"Generic Error","detail":"invalid priority P1234. + Must be one of P1, P2, P3, P4, P5, NOT_DEFINED"}]}' + 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..15e1ff8dd1 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_case_priority_returns_ok_response.frozen @@ -0,0 +1 @@ +2024-02-07T13:09:11.138Z \ 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..6411cb7547 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_case_priority_returns_ok_response.yaml @@ -0,0 +1,61 @@ +interactions: +- request: + body: '{"data":{"attributes":{"key":"DDFC","name":"Security Investigation - 05965dd41f8486c7"},"type":"project"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/projects + response: + body: + string: '{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project","attributes":{"handle":"","key":"DDFC","name":"Security + Investigation - 05965dd41f8486c7","settings":{}},"relationships":{"member_user":{"data":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- 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":"45","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T13:09:11.245798922Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"10df98b3-d351-4d30-9ac9-dc0ba5aa2518","key":"DDFC-1","priority":"P4","public_id":"45","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/45/priority + response: + body: + string: '{"data":{"id":"45","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T13:09:11.245799Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"10df98b3-d351-4d30-9ac9-dc0ba5aa2518","key":"DDFC-1","modified_at":"2024-02-07T13:09:11.293876Z","priority":"P3","public_id":"45","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..3285e65a1e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_case_status_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2024-02-07T13:09:11.307Z \ 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..4b60f6ba0d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_case_status_returns_bad_request_response.yaml @@ -0,0 +1,60 @@ +interactions: +- request: + body: '{"data":{"attributes":{"key":"ADBD","name":"Security Investigation - 9a89db9d37841080"},"type":"project"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/projects + response: + body: + string: '{"data":{"id":"72e2d9b4-d98a-4152-bf1f-4bb04ab98292","type":"project","attributes":{"handle":"","key":"ADBD","name":"Security + Investigation - 9a89db9d37841080","settings":{}},"relationships":{"member_user":{"data":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"priority":"P4","title":"My new case","type":"STANDARD"},"relationships":{"project":{"data":{"id":"72e2d9b4-d98a-4152-bf1f-4bb04ab98292","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":"46","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T13:09:11.41211677Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"3faf88f7-c52b-4ef9-b531-86652a6cee63","key":"ADBD-1","priority":"P4","public_id":"46","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"72e2d9b4-d98a-4152-bf1f-4bb04ab98292","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/46/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..bbb5422ade --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_case_status_returns_ok_response.frozen @@ -0,0 +1 @@ +2024-02-07T13:09:11.519Z \ 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..01fb2a2a95 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_case_status_returns_ok_response.yaml @@ -0,0 +1,61 @@ +interactions: +- request: + body: '{"data":{"attributes":{"key":"BABEF","name":"Security Investigation - 394b5871ab5024ef"},"type":"project"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/projects + response: + body: + string: '{"data":{"id":"072e1c08-22cf-4b95-9012-11e533fe5ef6","type":"project","attributes":{"handle":"","key":"BABEF","name":"Security + Investigation - 394b5871ab5024ef","settings":{}},"relationships":{"member_user":{"data":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"priority":"P4","title":"My new case","type":"STANDARD"},"relationships":{"project":{"data":{"id":"072e1c08-22cf-4b95-9012-11e533fe5ef6","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":"47","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T13:09:11.78649954Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"2ce164c4-8576-4359-afa1-3b7f7c4d4f13","key":"BABEF-1","priority":"P4","public_id":"47","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"072e1c08-22cf-4b95-9012-11e533fe5ef6","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/47/status + response: + body: + string: '{"data":{"id":"47","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T13:09:11.7865Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"2ce164c4-8576-4359-afa1-3b7f7c4d4f13","key":"BABEF-1","modified_at":"2024-02-07T13:09:11.84991Z","priority":"P4","public_id":"47","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":"072e1c08-22cf-4b95-9012-11e533fe5ef6","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..a79f840908 --- /dev/null +++ b/tests/v2/features/cases.feature @@ -0,0 +1,256 @@ +@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 "project" in the system + 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 "project" in the system + 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 "project" in the system + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"attributes": {"assign": "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 "project" in the system + 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 "project" in the system + 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": "{{project.id}}", "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 + + @generated @skip @team:DataDog/case-management + Scenario: Get a list of 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: Get a list of 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: Get a list of 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: Get a list of cases returns "OK" response with pagination + Given new "SearchCases" request + When the request with pagination is sent + Then the response status is 200 OK + + @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 "project" in the system + 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 "project" in the system + 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 + + @team:DataDog/case-management + Scenario: Unarchive case returns "Bad Request" response + Given new "UnarchiveCase" request + And there is a valid "project" in the system + 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 "project" in the system + 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 "project" in the system + 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 "project" in the system + 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 "project" in the system + 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 "project" in the system + 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 "project" in the system + 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 "project" in the system + 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/given.json b/tests/v2/features/given.json index da22a5fc35..4f44a93e4d 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/given.json @@ -59,6 +59,32 @@ "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\": \"{{project.id}}\",\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": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"project\",\n \"attributes\": {\n \"name\": \"Security Investigation - {{ unique_hash }}\",\n \"key\": \"{{ unique_project_key }}\"\n }\n }\n}" + } + ], + "source": "data", + "step": "there is a valid \"project\" in the system", + "key": "project", + "tag": "Projects", + "operationId": "CreateProject" + }, { "parameters": [ { diff --git a/tests/v2/features/projects.feature b/tests/v2/features/projects.feature new file mode 100644 index 0000000000..fea85882d9 --- /dev/null +++ b/tests/v2/features/projects.feature @@ -0,0 +1,68 @@ +@endpoint(projects) @endpoint(projects-v2) +Feature: 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 "Projects" 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 diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 61d85e0fca..1dcefdd201 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -220,6 +220,82 @@ "type": "idempotent" } }, + "SearchCases": { + "tag": "Cases", + "undo": { + "type": "safe" + } + }, + "CreateCase": { + "tag": "Cases", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, + "GetProjects": { + "tag": "Projects", + "undo": { + "type": "safe" + } + }, + "CreateProject": { + "tag": "Projects", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, + "GetProject": { + "tag": "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": {