From 52fbc74674cd8ce34492a4cc73f3013313aa46f2 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 12:59:55 +0000 Subject: [PATCH] Case Management Public API documentation (#1708) Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 1050 +++++++++++++++++ ...e-case-returns-Bad-Request-response.frozen | 1 + ...hive-case-returns-Bad-Request-response.yml | 49 + ...ive-case-returns-Not-Found-response.frozen | 1 + ...rchive-case-returns-Not-Found-response.yml | 24 + .../Archive-case-returns-OK-response.frozen | 1 + .../Archive-case-returns-OK-response.yml | 50 + ...n-case-returns-Bad-Request-response.frozen | 1 + ...sign-case-returns-Bad-Request-response.yml | 49 + ...ign-case-returns-Not-Found-response.frozen | 1 + ...Assign-case-returns-Not-Found-response.yml | 66 ++ .../Assign-case-returns-OK-response.frozen | 1 + .../cases/Assign-case-returns-OK-response.yml | 92 ++ ...a-case-returns-Bad-Request-response.frozen | 1 + ...te-a-case-returns-Bad-Request-response.yml | 26 + ...ate-a-case-returns-CREATED-response.frozen | 1 + ...Create-a-case-returns-CREATED-response.yml | 69 ++ ...f-a-case-returns-Not-Found-response.frozen | 1 + ...s-of-a-case-returns-Not-Found-response.yml | 20 + ...tails-of-a-case-returns-OK-response.frozen | 1 + ...-details-of-a-case-returns-OK-response.yml | 46 + ...e-case-returns-Bad-Request-response.frozen | 1 + ...hive-case-returns-Bad-Request-response.yml | 49 + ...ive-case-returns-Not-Found-response.frozen | 1 + ...rchive-case-returns-Not-Found-response.yml | 24 + .../Unarchive-case-returns-OK-response.frozen | 1 + .../Unarchive-case-returns-OK-response.yml | 50 + ...n-case-returns-Bad-Request-response.frozen | 1 + ...sign-case-returns-Bad-Request-response.yml | 49 + ...ign-case-returns-Not-Found-response.frozen | 1 + ...assign-case-returns-Not-Found-response.yml | 24 + .../Unassign-case-returns-OK-response.frozen | 1 + .../Unassign-case-returns-OK-response.yml | 50 + ...iority-returns-Bad-Request-response.frozen | 1 + ...-priority-returns-Bad-Request-response.yml | 49 + ...priority-returns-Not-Found-response.frozen | 1 + ...se-priority-returns-Not-Found-response.yml | 24 + ...e-case-priority-returns-OK-response.frozen | 1 + ...date-case-priority-returns-OK-response.yml | 50 + ...status-returns-Bad-Request-response.frozen | 1 + ...se-status-returns-Bad-Request-response.yml | 49 + ...e-status-returns-Not-Found-response.frozen | 1 + ...case-status-returns-Not-Found-response.yml | 24 + ...ate-case-status-returns-OK-response.frozen | 1 + ...Update-case-status-returns-OK-response.yml | 50 + examples/v2/cases-projects/CreateProject.rb | 15 + examples/v2/cases-projects/DeleteProject.rb | 5 + examples/v2/cases-projects/GetProject.rb | 5 + examples/v2/cases-projects/GetProjects.rb | 5 + examples/v2/cases/ArchiveCase.rb | 14 + examples/v2/cases/AssignCase.rb | 20 + examples/v2/cases/CreateCase.rb | 33 + examples/v2/cases/GetCase.rb | 8 + examples/v2/cases/SearchCases.rb | 5 + examples/v2/cases/SearchCases_3433960044.rb | 5 + examples/v2/cases/UnarchiveCase.rb | 14 + examples/v2/cases/UnassignCase.rb | 14 + examples/v2/cases/UpdatePriority.rb | 17 + examples/v2/cases/UpdateStatus.rb | 17 + features/scenarios_model_mapping.rb | 46 + features/v2/cases.feature | 241 ++++ features/v2/cases_projects.feature | 82 ++ features/v2/given.json | 13 + features/v2/undo.json | 85 ++ lib/datadog_api_client/inflector.rb | 50 + lib/datadog_api_client/v2/api/cases_api.rb | 685 +++++++++++ .../v2/api/cases_projects_api.rb | 283 +++++ lib/datadog_api_client/v2/models/case.rb | 150 +++ .../v2/models/case3rd_party_ticket_status.rb | 28 + .../v2/models/case_assign.rb | 119 ++ .../v2/models/case_assign_attributes.rb | 98 ++ .../v2/models/case_assign_request.rb | 98 ++ .../v2/models/case_attributes.rb | 202 ++++ .../v2/models/case_create.rb | 129 ++ .../v2/models/case_create_attributes.rb | 139 +++ .../v2/models/case_create_relationships.rb | 116 ++ .../v2/models/case_create_request.rb | 98 ++ .../v2/models/case_empty.rb | 98 ++ .../v2/models/case_empty_request.rb | 98 ++ .../v2/models/case_priority.rb | 31 + .../v2/models/case_relationships.rb | 120 ++ .../v2/models/case_resource_type.rb | 26 + .../v2/models/case_response.rb | 80 ++ .../v2/models/case_sortable_field.rb | 28 + .../v2/models/case_status.rb | 28 + lib/datadog_api_client/v2/models/case_type.rb | 26 + .../v2/models/case_update_priority.rb | 119 ++ .../models/case_update_priority_attributes.rb | 98 ++ .../v2/models/case_update_priority_request.rb | 98 ++ .../v2/models/case_update_status.rb | 119 ++ .../models/case_update_status_attributes.rb | 98 ++ .../v2/models/case_update_status_request.rb | 98 ++ .../v2/models/cases_response.rb | 92 ++ .../v2/models/cases_response_meta.rb | 80 ++ .../models/cases_response_meta_pagination.rb | 100 ++ .../v2/models/jira_issue.rb | 90 ++ .../v2/models/jira_issue_result.rb | 110 ++ .../v2/models/nullable_user_relationship.rb | 88 ++ .../models/nullable_user_relationship_data.rb | 119 ++ lib/datadog_api_client/v2/models/project.rb | 150 +++ .../v2/models/project_attributes.rb | 90 ++ .../v2/models/project_create.rb | 119 ++ .../v2/models/project_create_attributes.rb | 119 ++ .../v2/models/project_create_request.rb | 98 ++ .../v2/models/project_relationship.rb | 98 ++ .../v2/models/project_relationship_data.rb | 119 ++ .../v2/models/project_relationships.rb | 90 ++ .../v2/models/project_resource_type.rb | 26 + .../v2/models/project_response.rb | 80 ++ .../v2/models/projects_response.rb | 82 ++ .../v2/models/service_now_ticket.rb | 90 ++ .../v2/models/service_now_ticket_result.rb | 80 ++ .../v2/models/user_relationship_data.rb | 119 ++ .../v2/models/user_resource_type.rb | 26 + .../v2/models/users_relationship.rb | 100 ++ 116 files changed, 8228 insertions(+), 4 deletions(-) create mode 100644 cassettes/features/v2/cases/Archive-case-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/cases/Archive-case-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/cases/Archive-case-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/cases/Archive-case-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/cases/Archive-case-returns-OK-response.frozen create mode 100644 cassettes/features/v2/cases/Archive-case-returns-OK-response.yml create mode 100644 cassettes/features/v2/cases/Assign-case-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/cases/Assign-case-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/cases/Assign-case-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/cases/Assign-case-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/cases/Assign-case-returns-OK-response.frozen create mode 100644 cassettes/features/v2/cases/Assign-case-returns-OK-response.yml create mode 100644 cassettes/features/v2/cases/Create-a-case-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/cases/Create-a-case-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/cases/Create-a-case-returns-CREATED-response.frozen create mode 100644 cassettes/features/v2/cases/Create-a-case-returns-CREATED-response.yml create mode 100644 cassettes/features/v2/cases/Get-the-details-of-a-case-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/cases/Get-the-details-of-a-case-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/cases/Get-the-details-of-a-case-returns-OK-response.frozen create mode 100644 cassettes/features/v2/cases/Get-the-details-of-a-case-returns-OK-response.yml create mode 100644 cassettes/features/v2/cases/Unarchive-case-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/cases/Unarchive-case-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/cases/Unarchive-case-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/cases/Unarchive-case-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/cases/Unarchive-case-returns-OK-response.frozen create mode 100644 cassettes/features/v2/cases/Unarchive-case-returns-OK-response.yml create mode 100644 cassettes/features/v2/cases/Unassign-case-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/cases/Unassign-case-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/cases/Unassign-case-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/cases/Unassign-case-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/cases/Unassign-case-returns-OK-response.frozen create mode 100644 cassettes/features/v2/cases/Unassign-case-returns-OK-response.yml create mode 100644 cassettes/features/v2/cases/Update-case-priority-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/cases/Update-case-priority-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/cases/Update-case-priority-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/cases/Update-case-priority-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/cases/Update-case-priority-returns-OK-response.frozen create mode 100644 cassettes/features/v2/cases/Update-case-priority-returns-OK-response.yml create mode 100644 cassettes/features/v2/cases/Update-case-status-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/cases/Update-case-status-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/cases/Update-case-status-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/cases/Update-case-status-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/cases/Update-case-status-returns-OK-response.frozen create mode 100644 cassettes/features/v2/cases/Update-case-status-returns-OK-response.yml create mode 100644 examples/v2/cases-projects/CreateProject.rb create mode 100644 examples/v2/cases-projects/DeleteProject.rb create mode 100644 examples/v2/cases-projects/GetProject.rb create mode 100644 examples/v2/cases-projects/GetProjects.rb create mode 100644 examples/v2/cases/ArchiveCase.rb create mode 100644 examples/v2/cases/AssignCase.rb create mode 100644 examples/v2/cases/CreateCase.rb create mode 100644 examples/v2/cases/GetCase.rb create mode 100644 examples/v2/cases/SearchCases.rb create mode 100644 examples/v2/cases/SearchCases_3433960044.rb create mode 100644 examples/v2/cases/UnarchiveCase.rb create mode 100644 examples/v2/cases/UnassignCase.rb create mode 100644 examples/v2/cases/UpdatePriority.rb create mode 100644 examples/v2/cases/UpdateStatus.rb create mode 100644 features/v2/cases.feature create mode 100644 features/v2/cases_projects.feature create mode 100644 lib/datadog_api_client/v2/api/cases_api.rb create mode 100644 lib/datadog_api_client/v2/api/cases_projects_api.rb create mode 100644 lib/datadog_api_client/v2/models/case.rb create mode 100644 lib/datadog_api_client/v2/models/case3rd_party_ticket_status.rb create mode 100644 lib/datadog_api_client/v2/models/case_assign.rb create mode 100644 lib/datadog_api_client/v2/models/case_assign_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/case_assign_request.rb create mode 100644 lib/datadog_api_client/v2/models/case_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/case_create.rb create mode 100644 lib/datadog_api_client/v2/models/case_create_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/case_create_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/case_create_request.rb create mode 100644 lib/datadog_api_client/v2/models/case_empty.rb create mode 100644 lib/datadog_api_client/v2/models/case_empty_request.rb create mode 100644 lib/datadog_api_client/v2/models/case_priority.rb create mode 100644 lib/datadog_api_client/v2/models/case_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/case_resource_type.rb create mode 100644 lib/datadog_api_client/v2/models/case_response.rb create mode 100644 lib/datadog_api_client/v2/models/case_sortable_field.rb create mode 100644 lib/datadog_api_client/v2/models/case_status.rb create mode 100644 lib/datadog_api_client/v2/models/case_type.rb create mode 100644 lib/datadog_api_client/v2/models/case_update_priority.rb create mode 100644 lib/datadog_api_client/v2/models/case_update_priority_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/case_update_priority_request.rb create mode 100644 lib/datadog_api_client/v2/models/case_update_status.rb create mode 100644 lib/datadog_api_client/v2/models/case_update_status_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/case_update_status_request.rb create mode 100644 lib/datadog_api_client/v2/models/cases_response.rb create mode 100644 lib/datadog_api_client/v2/models/cases_response_meta.rb create mode 100644 lib/datadog_api_client/v2/models/cases_response_meta_pagination.rb create mode 100644 lib/datadog_api_client/v2/models/jira_issue.rb create mode 100644 lib/datadog_api_client/v2/models/jira_issue_result.rb create mode 100644 lib/datadog_api_client/v2/models/nullable_user_relationship.rb create mode 100644 lib/datadog_api_client/v2/models/nullable_user_relationship_data.rb create mode 100644 lib/datadog_api_client/v2/models/project.rb create mode 100644 lib/datadog_api_client/v2/models/project_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/project_create.rb create mode 100644 lib/datadog_api_client/v2/models/project_create_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/project_create_request.rb create mode 100644 lib/datadog_api_client/v2/models/project_relationship.rb create mode 100644 lib/datadog_api_client/v2/models/project_relationship_data.rb create mode 100644 lib/datadog_api_client/v2/models/project_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/project_resource_type.rb create mode 100644 lib/datadog_api_client/v2/models/project_response.rb create mode 100644 lib/datadog_api_client/v2/models/projects_response.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_ticket.rb create mode 100644 lib/datadog_api_client/v2/models/service_now_ticket_result.rb create mode 100644 lib/datadog_api_client/v2/models/user_relationship_data.rb create mode 100644 lib/datadog_api_client/v2/models/user_resource_type.rb create mode 100644 lib/datadog_api_client/v2/models/users_relationship.rb diff --git a/.apigentools-info b/.apigentools-info index eff17b52d5bb..ec2b1d45f265 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:08.603113", - "spec_repo_commit": "46672359" + "regenerated": "2024-02-12 17:39:21.155933", + "spec_repo_commit": "3cda457d" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-02-06 15:45:08.619048", - "spec_repo_commit": "46672359" + "regenerated": "2024-02-12 17:39:21.172177", + "spec_repo_commit": "3cda457d" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 25c4b451339e..4e26326131d9 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -151,6 +151,21 @@ components: required: true schema: type: string + CaseIDPathParameter: + description: Case's UUID or key + example: f98a5a5b-e0ff-45d4-b2f5-afe6e74de504 + in: path + name: case_id + required: true + schema: + type: string + CaseSortableFieldParameter: + description: Specify which field to sort + in: query + name: sort[field] + required: false + schema: + $ref: '#/components/schemas/CaseSortableField' CloudAccountID: description: Cloud Account id. in: path @@ -381,6 +396,14 @@ components: example: 10 format: int64 type: integer + ProjectIDPathParameter: + description: Project UUID + example: e555e290-ed65-49bd-ae18-8acbfcf18db7 + in: path + name: project_id + required: true + schema: + type: string ResourceID: description: 'Identifier, formatted as `type:id`. Supported types: `connection`, `dashboard`, `notebook`, `security-rule`, `slo`.' @@ -3332,6 +3355,345 @@ components: from the other indexes type: string type: object + Case: + description: A case + properties: + attributes: + $ref: '#/components/schemas/CaseAttributes' + id: + description: Case's identifier + example: aeadc05e-98a8-11ec-ac2c-da7ad0900001 + type: string + relationships: + $ref: '#/components/schemas/CaseRelationships' + type: + $ref: '#/components/schemas/CaseResourceType' + required: + - id + - type + - attributes + type: object + Case3rdPartyTicketStatus: + default: IN_PROGRESS + description: Case status + enum: + - IN_PROGRESS + - COMPLETED + - FAILED + example: COMPLETED + readOnly: true + type: string + x-enum-varnames: + - IN_PROGRESS + - COMPLETED + - FAILED + CaseAssign: + description: Case assign + properties: + attributes: + $ref: '#/components/schemas/CaseAssignAttributes' + type: + $ref: '#/components/schemas/CaseResourceType' + required: + - attributes + - type + type: object + CaseAssignAttributes: + description: Case assign attributes + properties: + assignee_id: + description: Assignee's UUID + example: f98a5a5b-e0ff-45d4-b2f5-afe6e74de504 + type: string + required: + - assignee_id + type: object + CaseAssignRequest: + description: Case assign request + properties: + data: + $ref: '#/components/schemas/CaseAssign' + required: + - data + type: object + CaseAttributes: + description: Case attributes + properties: + archived_at: + description: Timestamp of when the case was archived + format: date-time + nullable: true + readOnly: true + type: string + closed_at: + description: Timestamp of when the case was closed + format: date-time + nullable: true + readOnly: true + type: string + created_at: + description: Timestamp of when the case was created + format: date-time + readOnly: true + type: string + description: + description: Description + type: string + jira_issue: + $ref: '#/components/schemas/JiraIssue' + key: + description: Key + example: CASEM-4523 + type: string + modified_at: + description: Timestamp of when the case was last modified + format: date-time + nullable: true + readOnly: true + type: string + priority: + $ref: '#/components/schemas/CasePriority' + service_now_ticket: + $ref: '#/components/schemas/ServiceNowTicket' + status: + $ref: '#/components/schemas/CaseStatus' + title: + description: Title + example: Memory leak investigation on API + type: string + type: + $ref: '#/components/schemas/CaseType' + type: object + CaseCreate: + description: Case creation data + properties: + attributes: + $ref: '#/components/schemas/CaseCreateAttributes' + relationships: + $ref: '#/components/schemas/CaseCreateRelationships' + type: + $ref: '#/components/schemas/CaseResourceType' + required: + - attributes + - type + type: object + CaseCreateAttributes: + description: Case creation attributes + properties: + description: + description: Description + type: string + priority: + $ref: '#/components/schemas/CasePriority' + title: + description: Title + example: Security breach investigation + type: string + type: + $ref: '#/components/schemas/CaseType' + required: + - title + - type + type: object + CaseCreateRelationships: + description: Relationships formed with the case on creation + properties: + assignee: + $ref: '#/components/schemas/NullableUserRelationship' + project: + $ref: '#/components/schemas/ProjectRelationship' + required: + - project + type: object + CaseCreateRequest: + description: Case create request + properties: + data: + $ref: '#/components/schemas/CaseCreate' + required: + - data + type: object + CaseEmpty: + description: Case empty request data + properties: + type: + $ref: '#/components/schemas/CaseResourceType' + required: + - type + type: object + CaseEmptyRequest: + description: Case empty request + properties: + data: + $ref: '#/components/schemas/CaseEmpty' + required: + - data + type: object + CasePriority: + default: NOT_DEFINED + description: Case priority + enum: + - NOT_DEFINED + - P1 + - P2 + - P3 + - P4 + - P5 + example: NOT_DEFINED + type: string + x-enum-varnames: + - NOT_DEFINED + - P1 + - P2 + - P3 + - P4 + - P5 + CaseRelationships: + description: Resources related to a case + properties: + assignee: + $ref: '#/components/schemas/NullableUserRelationship' + created_by: + $ref: '#/components/schemas/NullableUserRelationship' + modified_by: + $ref: '#/components/schemas/NullableUserRelationship' + project: + $ref: '#/components/schemas/ProjectRelationship' + type: object + CaseResourceType: + default: case + description: Case resource type + enum: + - case + example: case + type: string + x-enum-varnames: + - CASE + CaseResponse: + description: Case response + properties: + data: + $ref: '#/components/schemas/Case' + type: object + CaseSortableField: + description: Case field that can be sorted on + enum: + - created_at + - priority + - status + example: created_at + type: string + x-enum-varnames: + - CREATED_AT + - PRIORITY + - STATUS + CaseStatus: + description: Case status + enum: + - OPEN + - IN_PROGRESS + - CLOSED + example: OPEN + type: string + x-enum-varnames: + - OPEN + - IN_PROGRESS + - CLOSED + CaseType: + description: Case type + enum: + - STANDARD + example: STANDARD + type: string + x-enum-varnames: + - STANDARD + CaseUpdatePriority: + description: Case priority status + properties: + attributes: + $ref: '#/components/schemas/CaseUpdatePriorityAttributes' + type: + $ref: '#/components/schemas/CaseResourceType' + required: + - attributes + - type + type: object + CaseUpdatePriorityAttributes: + description: Case update priority attributes + properties: + priority: + $ref: '#/components/schemas/CasePriority' + required: + - priority + type: object + CaseUpdatePriorityRequest: + description: Case update priority request + properties: + data: + $ref: '#/components/schemas/CaseUpdatePriority' + required: + - data + type: object + CaseUpdateStatus: + description: Case update status + properties: + attributes: + $ref: '#/components/schemas/CaseUpdateStatusAttributes' + type: + $ref: '#/components/schemas/CaseResourceType' + required: + - attributes + - type + type: object + CaseUpdateStatusAttributes: + description: Case update status attributes + properties: + status: + $ref: '#/components/schemas/CaseStatus' + required: + - status + type: object + CaseUpdateStatusRequest: + description: Case update status request + properties: + data: + $ref: '#/components/schemas/CaseUpdateStatus' + required: + - data + type: object + CasesResponse: + description: Response with cases + properties: + data: + description: Cases response data + items: + $ref: '#/components/schemas/Case' + type: array + meta: + $ref: '#/components/schemas/CasesResponseMeta' + type: object + CasesResponseMeta: + description: Cases response metadata + properties: + page: + $ref: '#/components/schemas/CasesResponseMetaPagination' + type: object + CasesResponseMetaPagination: + description: Pagination metadata + properties: + current: + description: Current page number + format: int64 + type: integer + size: + description: Number of cases in current page + format: int64 + type: integer + total: + description: Total number of pages + format: int64 + type: integer + type: object ChargebackBreakdown: description: Charges breakdown. properties: @@ -9344,6 +9706,32 @@ components: - project_key - account type: object + JiraIssue: + description: Jira issue attached to case + nullable: true + properties: + result: + $ref: '#/components/schemas/JiraIssueResult' + status: + $ref: '#/components/schemas/Case3rdPartyTicketStatus' + readOnly: true + type: object + JiraIssueResult: + description: Jira issue information + properties: + issue_id: + description: Jira issue ID + type: string + issue_key: + description: Jira issue key + type: string + issue_url: + description: Jira issue URL + type: string + project_key: + description: Jira project key + type: string + type: object ListApplicationKeysResponse: description: Response for a list of application keys. properties: @@ -11943,6 +12331,29 @@ components: - id - type type: object + NullableUserRelationship: + description: Relationship to user. + nullable: true + properties: + data: + $ref: '#/components/schemas/NullableUserRelationshipData' + required: + - data + type: object + NullableUserRelationshipData: + description: Relationship to user object. + nullable: true + properties: + id: + description: A unique identifier that represents the user. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + $ref: '#/components/schemas/UserResourceType' + required: + - id + - type + type: object OktaAccount: description: Schema for an Okta account. properties: @@ -13075,6 +13486,113 @@ components: type: string x-enum-varnames: - PROCESS + Project: + description: A Project + properties: + attributes: + $ref: '#/components/schemas/ProjectAttributes' + id: + description: The Project's identifier + example: aeadc05e-98a8-11ec-ac2c-da7ad0900001 + type: string + relationships: + $ref: '#/components/schemas/ProjectRelationships' + type: + $ref: '#/components/schemas/ProjectResourceType' + required: + - id + - type + - attributes + type: object + ProjectAttributes: + description: Project attributes + properties: + key: + description: The project's key + example: CASEM + type: string + name: + description: Project's name + type: string + type: object + ProjectCreate: + description: Project create + properties: + attributes: + $ref: '#/components/schemas/ProjectCreateAttributes' + type: + $ref: '#/components/schemas/ProjectResourceType' + required: + - attributes + - type + type: object + ProjectCreateAttributes: + description: Project creation attributes + properties: + key: + description: Project's key. Cannot be "CASE" + example: SEC + type: string + name: + description: name + example: Security Investigation + type: string + required: + - name + - key + type: object + ProjectCreateRequest: + description: Project create request + properties: + data: + $ref: '#/components/schemas/ProjectCreate' + required: + - data + type: object + ProjectRelationship: + description: Relationship to project + properties: + data: + $ref: '#/components/schemas/ProjectRelationshipData' + required: + - data + type: object + ProjectRelationshipData: + description: Relationship to project object + properties: + id: + description: A unique identifier that represents the project + example: e555e290-ed65-49bd-ae18-8acbfcf18db7 + type: string + type: + $ref: '#/components/schemas/ProjectResourceType' + required: + - id + - type + type: object + ProjectRelationships: + description: Project relationships + properties: + member_team: + $ref: '#/components/schemas/RelationshipToTeamLinks' + member_user: + $ref: '#/components/schemas/UsersRelationship' + type: object + ProjectResourceType: + default: project + description: Project resource type + enum: + - project + example: project + type: string + x-enum-varnames: + - PROJECT + ProjectResponse: + description: Project response + properties: + data: + $ref: '#/components/schemas/Project' + type: object ProjectedCost: description: Projected Cost data. properties: @@ -13131,6 +13649,15 @@ components: type: string x-enum-varnames: - PROJECt_COST + ProjectsResponse: + description: Response with projects + properties: + data: + description: Projects response data + items: + $ref: '#/components/schemas/Project' + type: array + type: object QueryFormula: description: A formula for calculation based on one or more queries. properties: @@ -18614,6 +19141,23 @@ components: $ref: '#/components/schemas/ServiceDefinitionData' type: array type: object + ServiceNowTicket: + description: ServiceNow ticket attached to case + nullable: true + properties: + result: + $ref: '#/components/schemas/ServiceNowTicketResult' + status: + $ref: '#/components/schemas/Case3rdPartyTicketStatus' + readOnly: true + type: object + ServiceNowTicketResult: + description: ServiceNow ticket information + properties: + sys_target_link: + description: Link to the Incident created on ServiceNow + type: string + type: object SlackIntegrationMetadata: description: Incident integration metadata for the Slack integration. properties: @@ -20615,12 +21159,34 @@ components: type: string x-enum-varnames: - USER_INVITATIONS + UserRelationshipData: + description: Relationship to user object. + properties: + id: + description: A unique identifier that represents the user. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + $ref: '#/components/schemas/UserResourceType' + required: + - id + - type + type: object UserRelationships: description: Relationships of the user object. properties: roles: $ref: '#/components/schemas/RelationshipToRoles' type: object + UserResourceType: + default: user + description: User resource type. + enum: + - user + example: user + type: string + x-enum-varnames: + - USER UserResponse: description: Response containing information about a single user. properties: @@ -20857,6 +21423,18 @@ components: required: - data type: object + UsersRelationship: + description: Relationship to users. + properties: + data: + description: Relationships to user objects. + example: [] + items: + $ref: '#/components/schemas/UserRelationshipData' + type: array + required: + - data + type: object UsersResponse: description: Response containing information about multiple users. properties: @@ -20929,6 +21507,8 @@ components: apm_service_catalog_read: View service catalog and service definitions. apm_service_catalog_write: Add, modify, and delete service catalog definitions when those definitions are maintained by Datadog. + cases_read: Read all cases data. + cases_write: Create, update and delete cases data. ci_visibility_pipelines_write: Create CI Visibility pipeline spans using the API. ci_visibility_read: View CI Visibility. @@ -22117,6 +22697,472 @@ paths: - AuthN Mappings x-codegen-request-body-name: body x-permission: OR(USER_ACCESS_MANAGE) + /api/v2/cases: + get: + description: Search cases. + operationId: SearchCases + parameters: + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageOffset' + - $ref: '#/components/parameters/CaseSortableFieldParameter' + - description: Search query + in: query + name: filter + required: false + schema: + example: status:open (team:case-management OR team:event-management) + type: string + - description: Specify if order is ascending or not + in: query + name: sort[asc] + required: false + schema: + default: false + type: boolean + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CasesResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: Search cases + tags: + - Cases + x-pagination: + limitParam: page[size] + pageOffsetParam: page[offset] + resultsPath: data + post: + description: Create a Case + operationId: CreateCase + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CaseCreateRequest' + description: Case payload + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/CaseResponse' + description: CREATED + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Create a case + tags: + - Cases + /api/v2/cases/projects: + get: + description: Get all projects. + operationId: GetProjects + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectsResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: Get all projects + tags: + - Cases Projects + post: + description: Create a project. + operationId: CreateProject + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectCreateRequest' + description: Project payload + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectResponse' + description: CREATED + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Create a project + tags: + - Cases Projects + /api/v2/cases/projects/{project_id}: + delete: + description: Remove a project using the project's `id`. + operationId: DeleteProject + parameters: + - $ref: '#/components/parameters/ProjectIDPathParameter' + responses: + '204': + description: No Content + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Remove a project + tags: + - Cases Projects + get: + description: Get the details of a project by `project_id`. + operationId: GetProject + parameters: + - $ref: '#/components/parameters/ProjectIDPathParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: Get the details of a project + tags: + - Cases Projects + /api/v2/cases/{case_id}: + get: + description: Get the details of case by `case_id` + operationId: GetCase + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CaseResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: Get the details of a case + tags: + - Cases + /api/v2/cases/{case_id}/archive: + post: + description: Archive case + operationId: ArchiveCase + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CaseEmptyRequest' + description: Archive case payload + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CaseResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Archive case + tags: + - Cases + /api/v2/cases/{case_id}/assign: + post: + description: Assign case to a user + operationId: AssignCase + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CaseAssignRequest' + description: Assign case payload + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CaseResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Assign case + tags: + - Cases + /api/v2/cases/{case_id}/priority: + post: + description: Update case priority + operationId: UpdatePriority + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CaseUpdatePriorityRequest' + description: Case priority update payload + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CaseResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Update case priority + tags: + - Cases + /api/v2/cases/{case_id}/status: + post: + description: Update case status + operationId: UpdateStatus + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CaseUpdateStatusRequest' + description: Case status update payload + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CaseResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Update case status + tags: + - Cases + /api/v2/cases/{case_id}/unarchive: + post: + description: Unarchive case + operationId: UnarchiveCase + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CaseEmptyRequest' + description: Unarchive case payload + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CaseResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Unarchive case + tags: + - Cases + /api/v2/cases/{case_id}/unassign: + post: + description: Unassign case + operationId: UnassignCase + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CaseEmptyRequest' + description: Unassign case payload + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CaseResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Unassign case + tags: + - Cases /api/v2/ci/pipeline: post: description: 'Send your pipeline event to your Datadog platform over HTTP. For @@ -33463,6 +34509,10 @@ tags: [Test Visibility in Datadog page](https://docs.datadoghq.com/tests/) for more information. name: CI Visibility Tests +- description: View and manage cases within Datadog + name: Cases +- description: View and manage project within Case Management + name: Cases Projects - description: The Cloud Cost Management API allows you to set up, edit, and delete Cloud Cost Management accounts for AWS and Azure. See the [Cloud Cost Management page](https://docs.datadoghq.com/cloud_cost_management/) for more information. diff --git a/cassettes/features/v2/cases/Archive-case-returns-Bad-Request-response.frozen b/cassettes/features/v2/cases/Archive-case-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..ef6c63cf9ee5 --- /dev/null +++ b/cassettes/features/v2/cases/Archive-case-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:35.988Z \ No newline at end of file diff --git a/cassettes/features/v2/cases/Archive-case-returns-Bad-Request-response.yml b/cassettes/features/v2/cases/Archive-case-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..1e11df9c1dc1 --- /dev/null +++ b/cassettes/features/v2/cases/Archive-case-returns-Bad-Request-response.yml @@ -0,0 +1,49 @@ +http_interactions: +- recorded_at: Wed, 07 Feb 2024 18:00:35 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"data":{"id":"1f205230-5ea9-444e-a5f9-48f93d6a2cde","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:36.54518451Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"1f205230-5ea9-444e-a5f9-48f93d6a2cde","key":"DDFC-2","priority":"P4","public_id":"62","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 07 Feb 2024 18:00:35 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"type":"project"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/1f205230-5ea9-444e-a5f9-48f93d6a2cde/archive + response: + body: + encoding: UTF-8 + 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 +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cases/Archive-case-returns-Not-Found-response.frozen b/cassettes/features/v2/cases/Archive-case-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..6b42677b0f5b --- /dev/null +++ b/cassettes/features/v2/cases/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/cassettes/features/v2/cases/Archive-case-returns-Not-Found-response.yml b/cassettes/features/v2/cases/Archive-case-returns-Not-Found-response.yml new file mode 100644 index 000000000000..e721b71a86e0 --- /dev/null +++ b/cassettes/features/v2/cases/Archive-case-returns-Not-Found-response.yml @@ -0,0 +1,24 @@ +http_interactions: +- recorded_at: Wed, 07 Feb 2024 13:09:07 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"errors":[{"code":"resource_not_found","title":"case not found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cases/Archive-case-returns-OK-response.frozen b/cassettes/features/v2/cases/Archive-case-returns-OK-response.frozen new file mode 100644 index 000000000000..558899ce6daa --- /dev/null +++ b/cassettes/features/v2/cases/Archive-case-returns-OK-response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:36.901Z \ No newline at end of file diff --git a/cassettes/features/v2/cases/Archive-case-returns-OK-response.yml b/cassettes/features/v2/cases/Archive-case-returns-OK-response.yml new file mode 100644 index 000000000000..b90df12b6afc --- /dev/null +++ b/cassettes/features/v2/cases/Archive-case-returns-OK-response.yml @@ -0,0 +1,50 @@ +http_interactions: +- recorded_at: Wed, 07 Feb 2024 18:00:36 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"data":{"id":"99e6e8cd-f115-4168-8814-30776007f44c","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:37.185776261Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"99e6e8cd-f115-4168-8814-30776007f44c","key":"DDFC-3","priority":"P4","public_id":"63","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 07 Feb 2024 18:00:36 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"type":"case"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/99e6e8cd-f115-4168-8814-30776007f44c/archive + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"99e6e8cd-f115-4168-8814-30776007f44c","type":"case","attributes":{"archived_at":"2024-02-07T18:00:37.47125606Z","attributes":{},"created_at":"2024-02-07T18:00:37.185776Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"99e6e8cd-f115-4168-8814-30776007f44c","key":"DDFC-3","priority":"P4","public_id":"63","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"modified_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cases/Assign-case-returns-Bad-Request-response.frozen b/cassettes/features/v2/cases/Assign-case-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..9f1a33f2842e --- /dev/null +++ b/cassettes/features/v2/cases/Assign-case-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2024-02-12T13:25:55.665Z \ No newline at end of file diff --git a/cassettes/features/v2/cases/Assign-case-returns-Bad-Request-response.yml b/cassettes/features/v2/cases/Assign-case-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..870b9ad85e24 --- /dev/null +++ b/cassettes/features/v2/cases/Assign-case-returns-Bad-Request-response.yml @@ -0,0 +1,49 @@ +http_interactions: +- recorded_at: Mon, 12 Feb 2024 13:25:55 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"data":{"id":"4039be1a-5f87-4666-b986-a8396c0225c3","type":"case","attributes":{"attributes":{},"created_at":"2024-02-12T13:25:56.280897807Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"4039be1a-5f87-4666-b986-a8396c0225c3","key":"DDFC-17","priority":"P4","public_id":"77","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 12 Feb 2024 13:25:55 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"assignee_id":"invalid-uuid"},"type":"case"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/4039be1a-5f87-4666-b986-a8396c0225c3/assign + response: + body: + encoding: UTF-8 + 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 +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cases/Assign-case-returns-Not-Found-response.frozen b/cassettes/features/v2/cases/Assign-case-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..1f0ce04277c2 --- /dev/null +++ b/cassettes/features/v2/cases/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/cassettes/features/v2/cases/Assign-case-returns-Not-Found-response.yml b/cassettes/features/v2/cases/Assign-case-returns-Not-Found-response.yml new file mode 100644 index 000000000000..5f99c8f42c06 --- /dev/null +++ b/cassettes/features/v2/cases/Assign-case-returns-Not-Found-response.yml @@ -0,0 +1,66 @@ +http_interactions: +- recorded_at: Wed, 07 Feb 2024 13:09:08 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Wed, 07 Feb 2024 13:09:08 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"errors":[{"code":"resource_not_found","title":"case not found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +- recorded_at: Wed, 07 Feb 2024 13:09:08 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/users/14040f89-c5ba-11ee-87b5-f6892353f87d + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cases/Assign-case-returns-OK-response.frozen b/cassettes/features/v2/cases/Assign-case-returns-OK-response.frozen new file mode 100644 index 000000000000..5b2d1f17d03a --- /dev/null +++ b/cassettes/features/v2/cases/Assign-case-returns-OK-response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:38.147Z \ No newline at end of file diff --git a/cassettes/features/v2/cases/Assign-case-returns-OK-response.yml b/cassettes/features/v2/cases/Assign-case-returns-OK-response.yml new file mode 100644 index 000000000000..3c208b4bd365 --- /dev/null +++ b/cassettes/features/v2/cases/Assign-case-returns-OK-response.yml @@ -0,0 +1,92 @@ +http_interactions: +- recorded_at: Wed, 07 Feb 2024 18:00:38 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"data":{"id":"a0801fce-a045-4b66-ad78-effcd959fa4f","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:38.353039559Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"a0801fce-a045-4b66-ad78-effcd959fa4f","key":"DDFC-5","priority":"P4","public_id":"65","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 07 Feb 2024 18:00:38 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"email":"Test-Assign_case_returns_OK_response-1707328838@datadoghq.com","title":"user + title"},"type":"users"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/users + response: + body: + encoding: UTF-8 + string: '{"data":{"type":"users","id":"cced7029-c5e2-11ee-ac63-c24751e8bab0","attributes":{"name":null,"handle":"test-assign_case_returns_ok_response-1707328838@datadoghq.com","created_at":"2024-02-07T18:00:38.645791+00:00","modified_at":"2024-02-07T18:00:38.645791+00:00","email":"test-assign_case_returns_ok_response-1707328838@datadoghq.com","icon":"https://secure.gravatar.com/avatar/dd4005a3eca9e7c6aed30c77d193bc37?s=48&d=retro","title":"user + title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} + + ' + headers: + Content-Type: + - application/json + status: + code: 201 + message: Created +- recorded_at: Wed, 07 Feb 2024 18:00:38 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"assignee_id":"cced7029-c5e2-11ee-ac63-c24751e8bab0"},"type":"case"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/a0801fce-a045-4b66-ad78-effcd959fa4f/assign + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"a0801fce-a045-4b66-ad78-effcd959fa4f","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:38.35304Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"a0801fce-a045-4b66-ad78-effcd959fa4f","key":"DDFC-5","modified_at":"2024-02-07T18:00:39.010235Z","priority":"P4","public_id":"65","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"assignee":{"data":{"id":"cced7029-c5e2-11ee-ac63-c24751e8bab0","type":"user"}},"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"modified_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"}},{"id":"cced7029-c5e2-11ee-ac63-c24751e8bab0","type":"user","attributes":{"email":"test-assign_case_returns_ok_response-1707328838@datadoghq.com","handle":"test-assign_case_returns_ok_response-1707328838@datadoghq.com","name":""}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Wed, 07 Feb 2024 18:00:38 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/users/cced7029-c5e2-11ee-ac63-c24751e8bab0 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cases/Create-a-case-returns-Bad-Request-response.frozen b/cassettes/features/v2/cases/Create-a-case-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..14b7cfa0a250 --- /dev/null +++ b/cassettes/features/v2/cases/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/cassettes/features/v2/cases/Create-a-case-returns-Bad-Request-response.yml b/cassettes/features/v2/cases/Create-a-case-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..c357c15f1e94 --- /dev/null +++ b/cassettes/features/v2/cases/Create-a-case-returns-Bad-Request-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Wed, 07 Feb 2024 13:09:09 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cases/Create-a-case-returns-CREATED-response.frozen b/cassettes/features/v2/cases/Create-a-case-returns-CREATED-response.frozen new file mode 100644 index 000000000000..1132edd29cfa --- /dev/null +++ b/cassettes/features/v2/cases/Create-a-case-returns-CREATED-response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:39.566Z \ No newline at end of file diff --git a/cassettes/features/v2/cases/Create-a-case-returns-CREATED-response.yml b/cassettes/features/v2/cases/Create-a-case-returns-CREATED-response.yml new file mode 100644 index 000000000000..2e2a999fb578 --- /dev/null +++ b/cassettes/features/v2/cases/Create-a-case-returns-CREATED-response.yml @@ -0,0 +1,69 @@ +http_interactions: +- recorded_at: Wed, 07 Feb 2024 18:00:39 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"email":"Test-Create_a_case_returns_CREATED_response-1707328839@datadoghq.com","title":"user + title"},"type":"users"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/users + response: + body: + encoding: UTF-8 + string: '{"data":{"type":"users","id":"cda929dc-c5e2-11ee-883d-6ad03867f364","attributes":{"name":null,"handle":"test-create_a_case_returns_created_response-1707328839@datadoghq.com","created_at":"2024-02-07T18:00:39.876070+00:00","modified_at":"2024-02-07T18:00:39.876070+00:00","email":"test-create_a_case_returns_created_response-1707328839@datadoghq.com","icon":"https://secure.gravatar.com/avatar/e564f62a22caae2dd8e878a8d73c6328?s=48&d=retro","title":"user + title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} + + ' + headers: + Content-Type: + - application/json + status: + code: 201 + message: Created +- recorded_at: Wed, 07 Feb 2024 18:00:39 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"priority":"NOT_DEFINED","title":"Security breach + investigation in 3b9b6a6abdcf0b9b","type":"STANDARD"},"relationships":{"assignee":{"data":{"id":"cda929dc-c5e2-11ee-883d-6ad03867f364","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}},"type":"case"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"4045de8b-3808-4bb6-94c9-f55ced4811c7","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:40.197151067Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"4045de8b-3808-4bb6-94c9-f55ced4811c7","key":"DDFC-6","priority":"NOT_DEFINED","public_id":"66","status":"OPEN","title":"Security + breach investigation in 3b9b6a6abdcf0b9b","type":"STANDARD"},"relationships":{"assignee":{"data":{"id":"cda929dc-c5e2-11ee-883d-6ad03867f364","type":"user"}},"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"}},{"id":"cda929dc-c5e2-11ee-883d-6ad03867f364","type":"user","attributes":{"email":"test-create_a_case_returns_created_response-1707328839@datadoghq.com","handle":"test-create_a_case_returns_created_response-1707328839@datadoghq.com","name":""}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 07 Feb 2024 18:00:39 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/users/cda929dc-c5e2-11ee-883d-6ad03867f364 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cases/Get-the-details-of-a-case-returns-Not-Found-response.frozen b/cassettes/features/v2/cases/Get-the-details-of-a-case-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..3601a30777ba --- /dev/null +++ b/cassettes/features/v2/cases/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/cassettes/features/v2/cases/Get-the-details-of-a-case-returns-Not-Found-response.yml b/cassettes/features/v2/cases/Get-the-details-of-a-case-returns-Not-Found-response.yml new file mode 100644 index 000000000000..961f3f5fdf89 --- /dev/null +++ b/cassettes/features/v2/cases/Get-the-details-of-a-case-returns-Not-Found-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Wed, 07 Feb 2024 13:09:09 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/cases/67d80aa3-36ff-44b9-a694-c501a7591737 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"code":"resource_not_found","title":"case not found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cases/Get-the-details-of-a-case-returns-OK-response.frozen b/cassettes/features/v2/cases/Get-the-details-of-a-case-returns-OK-response.frozen new file mode 100644 index 000000000000..a12854951361 --- /dev/null +++ b/cassettes/features/v2/cases/Get-the-details-of-a-case-returns-OK-response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:40.743Z \ No newline at end of file diff --git a/cassettes/features/v2/cases/Get-the-details-of-a-case-returns-OK-response.yml b/cassettes/features/v2/cases/Get-the-details-of-a-case-returns-OK-response.yml new file mode 100644 index 000000000000..8ac9b3b999e6 --- /dev/null +++ b/cassettes/features/v2/cases/Get-the-details-of-a-case-returns-OK-response.yml @@ -0,0 +1,46 @@ +http_interactions: +- recorded_at: Wed, 07 Feb 2024 18:00:40 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"data":{"id":"8fd1a1c3-3f55-4d6b-807f-ca70bc0e5749","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:41.007812312Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"8fd1a1c3-3f55-4d6b-807f-ca70bc0e5749","key":"DDFC-7","priority":"P4","public_id":"67","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 07 Feb 2024 18:00:40 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/cases/8fd1a1c3-3f55-4d6b-807f-ca70bc0e5749 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"8fd1a1c3-3f55-4d6b-807f-ca70bc0e5749","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:41.007812Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"8fd1a1c3-3f55-4d6b-807f-ca70bc0e5749","key":"DDFC-7","priority":"P4","public_id":"67","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cases/Unarchive-case-returns-Bad-Request-response.frozen b/cassettes/features/v2/cases/Unarchive-case-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..5d3fc771c200 --- /dev/null +++ b/cassettes/features/v2/cases/Unarchive-case-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:41.393Z \ No newline at end of file diff --git a/cassettes/features/v2/cases/Unarchive-case-returns-Bad-Request-response.yml b/cassettes/features/v2/cases/Unarchive-case-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..f4f7fe934c01 --- /dev/null +++ b/cassettes/features/v2/cases/Unarchive-case-returns-Bad-Request-response.yml @@ -0,0 +1,49 @@ +http_interactions: +- recorded_at: Wed, 07 Feb 2024 18:00:41 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"data":{"id":"91b52d3b-4d67-4b7f-ba4d-da67d8b46798","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:41.662578539Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"91b52d3b-4d67-4b7f-ba4d-da67d8b46798","key":"DDFC-8","priority":"P4","public_id":"68","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 07 Feb 2024 18:00:41 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"type":"project"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/91b52d3b-4d67-4b7f-ba4d-da67d8b46798/unarchive + response: + body: + encoding: UTF-8 + 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 +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cases/Unarchive-case-returns-Not-Found-response.frozen b/cassettes/features/v2/cases/Unarchive-case-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..df6e8d3aea05 --- /dev/null +++ b/cassettes/features/v2/cases/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/cassettes/features/v2/cases/Unarchive-case-returns-Not-Found-response.yml b/cassettes/features/v2/cases/Unarchive-case-returns-Not-Found-response.yml new file mode 100644 index 000000000000..3267333cd768 --- /dev/null +++ b/cassettes/features/v2/cases/Unarchive-case-returns-Not-Found-response.yml @@ -0,0 +1,24 @@ +http_interactions: +- recorded_at: Wed, 07 Feb 2024 13:09:10 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"errors":[{"code":"resource_not_found","title":"case not found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cases/Unarchive-case-returns-OK-response.frozen b/cassettes/features/v2/cases/Unarchive-case-returns-OK-response.frozen new file mode 100644 index 000000000000..c639a2463ee5 --- /dev/null +++ b/cassettes/features/v2/cases/Unarchive-case-returns-OK-response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:42.027Z \ No newline at end of file diff --git a/cassettes/features/v2/cases/Unarchive-case-returns-OK-response.yml b/cassettes/features/v2/cases/Unarchive-case-returns-OK-response.yml new file mode 100644 index 000000000000..64acd5b94657 --- /dev/null +++ b/cassettes/features/v2/cases/Unarchive-case-returns-OK-response.yml @@ -0,0 +1,50 @@ +http_interactions: +- recorded_at: Wed, 07 Feb 2024 18:00:42 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"data":{"id":"020e2ce7-9fe8-4273-81ae-1e5873fba9d3","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:42.286687881Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"020e2ce7-9fe8-4273-81ae-1e5873fba9d3","key":"DDFC-9","priority":"P4","public_id":"69","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 07 Feb 2024 18:00:42 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"type":"case"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/020e2ce7-9fe8-4273-81ae-1e5873fba9d3/unarchive + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"020e2ce7-9fe8-4273-81ae-1e5873fba9d3","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:42.286688Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"020e2ce7-9fe8-4273-81ae-1e5873fba9d3","key":"DDFC-9","priority":"P4","public_id":"69","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cases/Unassign-case-returns-Bad-Request-response.frozen b/cassettes/features/v2/cases/Unassign-case-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..a7b2a9e33bff --- /dev/null +++ b/cassettes/features/v2/cases/Unassign-case-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:42.637Z \ No newline at end of file diff --git a/cassettes/features/v2/cases/Unassign-case-returns-Bad-Request-response.yml b/cassettes/features/v2/cases/Unassign-case-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..adcf0e7b6c79 --- /dev/null +++ b/cassettes/features/v2/cases/Unassign-case-returns-Bad-Request-response.yml @@ -0,0 +1,49 @@ +http_interactions: +- recorded_at: Wed, 07 Feb 2024 18:00:42 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"data":{"id":"8a6e4254-7429-4398-99c2-ba9363fb3f98","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:42.908434394Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"8a6e4254-7429-4398-99c2-ba9363fb3f98","key":"DDFC-10","priority":"P4","public_id":"70","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 07 Feb 2024 18:00:42 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"type":"project"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/8a6e4254-7429-4398-99c2-ba9363fb3f98/unassign + response: + body: + encoding: UTF-8 + 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 +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cases/Unassign-case-returns-Not-Found-response.frozen b/cassettes/features/v2/cases/Unassign-case-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..fee1f808458f --- /dev/null +++ b/cassettes/features/v2/cases/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/cassettes/features/v2/cases/Unassign-case-returns-Not-Found-response.yml b/cassettes/features/v2/cases/Unassign-case-returns-Not-Found-response.yml new file mode 100644 index 000000000000..5cdf5d846e3e --- /dev/null +++ b/cassettes/features/v2/cases/Unassign-case-returns-Not-Found-response.yml @@ -0,0 +1,24 @@ +http_interactions: +- recorded_at: Wed, 07 Feb 2024 13:09:10 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"errors":[{"code":"resource_not_found","title":"case not found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cases/Unassign-case-returns-OK-response.frozen b/cassettes/features/v2/cases/Unassign-case-returns-OK-response.frozen new file mode 100644 index 000000000000..0a5d0226a277 --- /dev/null +++ b/cassettes/features/v2/cases/Unassign-case-returns-OK-response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:43.176Z \ No newline at end of file diff --git a/cassettes/features/v2/cases/Unassign-case-returns-OK-response.yml b/cassettes/features/v2/cases/Unassign-case-returns-OK-response.yml new file mode 100644 index 000000000000..4992fafbddcf --- /dev/null +++ b/cassettes/features/v2/cases/Unassign-case-returns-OK-response.yml @@ -0,0 +1,50 @@ +http_interactions: +- recorded_at: Wed, 07 Feb 2024 18:00:43 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"data":{"id":"8c5de575-685c-4ac4-a78a-9774c4f2160b","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:43.427988311Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"8c5de575-685c-4ac4-a78a-9774c4f2160b","key":"DDFC-11","priority":"P4","public_id":"71","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 07 Feb 2024 18:00:43 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"type":"case"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/8c5de575-685c-4ac4-a78a-9774c4f2160b/unassign + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"8c5de575-685c-4ac4-a78a-9774c4f2160b","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:43.427988Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"8c5de575-685c-4ac4-a78a-9774c4f2160b","key":"DDFC-11","priority":"P4","public_id":"71","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cases/Update-case-priority-returns-Bad-Request-response.frozen b/cassettes/features/v2/cases/Update-case-priority-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..da678b9cae11 --- /dev/null +++ b/cassettes/features/v2/cases/Update-case-priority-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:43.807Z \ No newline at end of file diff --git a/cassettes/features/v2/cases/Update-case-priority-returns-Bad-Request-response.yml b/cassettes/features/v2/cases/Update-case-priority-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..73ad87738996 --- /dev/null +++ b/cassettes/features/v2/cases/Update-case-priority-returns-Bad-Request-response.yml @@ -0,0 +1,49 @@ +http_interactions: +- recorded_at: Wed, 07 Feb 2024 18:00:43 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"data":{"id":"09077090-4370-4539-b9e5-445173f4fced","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:44.06773183Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"09077090-4370-4539-b9e5-445173f4fced","key":"DDFC-12","priority":"P4","public_id":"72","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 07 Feb 2024 18:00:43 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"priority":"P1234"},"type":"case"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/09077090-4370-4539-b9e5-445173f4fced/priority + response: + body: + encoding: UTF-8 + string: '{"errors":[{"title":"Generic Error","detail":"invalid priority P1234. + Must be one of P3, P4, P5, NOT_DEFINED, P1, P2"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cases/Update-case-priority-returns-Not-Found-response.frozen b/cassettes/features/v2/cases/Update-case-priority-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..33edf5b45804 --- /dev/null +++ b/cassettes/features/v2/cases/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/cassettes/features/v2/cases/Update-case-priority-returns-Not-Found-response.yml b/cassettes/features/v2/cases/Update-case-priority-returns-Not-Found-response.yml new file mode 100644 index 000000000000..53db6339e746 --- /dev/null +++ b/cassettes/features/v2/cases/Update-case-priority-returns-Not-Found-response.yml @@ -0,0 +1,24 @@ +http_interactions: +- recorded_at: Wed, 07 Feb 2024 13:09:11 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"errors":[{"code":"resource_not_found","title":"case not found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cases/Update-case-priority-returns-OK-response.frozen b/cassettes/features/v2/cases/Update-case-priority-returns-OK-response.frozen new file mode 100644 index 000000000000..ac293b567add --- /dev/null +++ b/cassettes/features/v2/cases/Update-case-priority-returns-OK-response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:44.433Z \ No newline at end of file diff --git a/cassettes/features/v2/cases/Update-case-priority-returns-OK-response.yml b/cassettes/features/v2/cases/Update-case-priority-returns-OK-response.yml new file mode 100644 index 000000000000..d41a2995e4c1 --- /dev/null +++ b/cassettes/features/v2/cases/Update-case-priority-returns-OK-response.yml @@ -0,0 +1,50 @@ +http_interactions: +- recorded_at: Wed, 07 Feb 2024 18:00:44 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"data":{"id":"60fdb1eb-209a-4072-9db3-4d08a9c4180c","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:44.723781245Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"60fdb1eb-209a-4072-9db3-4d08a9c4180c","key":"DDFC-13","priority":"P4","public_id":"73","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 07 Feb 2024 18:00:44 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"priority":"P3"},"type":"case"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/60fdb1eb-209a-4072-9db3-4d08a9c4180c/priority + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"60fdb1eb-209a-4072-9db3-4d08a9c4180c","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:44.723781Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"60fdb1eb-209a-4072-9db3-4d08a9c4180c","key":"DDFC-13","modified_at":"2024-02-07T18:00:45.028076Z","priority":"P3","public_id":"73","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"modified_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cases/Update-case-status-returns-Bad-Request-response.frozen b/cassettes/features/v2/cases/Update-case-status-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..8a9c88da3835 --- /dev/null +++ b/cassettes/features/v2/cases/Update-case-status-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:45.069Z \ No newline at end of file diff --git a/cassettes/features/v2/cases/Update-case-status-returns-Bad-Request-response.yml b/cassettes/features/v2/cases/Update-case-status-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..ed41ab362817 --- /dev/null +++ b/cassettes/features/v2/cases/Update-case-status-returns-Bad-Request-response.yml @@ -0,0 +1,49 @@ +http_interactions: +- recorded_at: Wed, 07 Feb 2024 18:00:45 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"data":{"id":"243feddb-69f8-4e22-988a-8ae954b643fa","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:45.265151303Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"243feddb-69f8-4e22-988a-8ae954b643fa","key":"DDFC-14","priority":"P4","public_id":"74","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 07 Feb 2024 18:00:45 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"status":"OPENED"},"type":"case"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/243feddb-69f8-4e22-988a-8ae954b643fa/status + response: + body: + encoding: UTF-8 + 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 +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cases/Update-case-status-returns-Not-Found-response.frozen b/cassettes/features/v2/cases/Update-case-status-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..52aa1297fc55 --- /dev/null +++ b/cassettes/features/v2/cases/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/cassettes/features/v2/cases/Update-case-status-returns-Not-Found-response.yml b/cassettes/features/v2/cases/Update-case-status-returns-Not-Found-response.yml new file mode 100644 index 000000000000..edee3ed0578c --- /dev/null +++ b/cassettes/features/v2/cases/Update-case-status-returns-Not-Found-response.yml @@ -0,0 +1,24 @@ +http_interactions: +- recorded_at: Wed, 07 Feb 2024 13:09:11 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"errors":[{"code":"resource_not_found","title":"case not found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cases/Update-case-status-returns-OK-response.frozen b/cassettes/features/v2/cases/Update-case-status-returns-OK-response.frozen new file mode 100644 index 000000000000..2c3628185823 --- /dev/null +++ b/cassettes/features/v2/cases/Update-case-status-returns-OK-response.frozen @@ -0,0 +1 @@ +2024-02-07T18:00:45.628Z \ No newline at end of file diff --git a/cassettes/features/v2/cases/Update-case-status-returns-OK-response.yml b/cassettes/features/v2/cases/Update-case-status-returns-OK-response.yml new file mode 100644 index 000000000000..7c13103c4100 --- /dev/null +++ b/cassettes/features/v2/cases/Update-case-status-returns-OK-response.yml @@ -0,0 +1,50 @@ +http_interactions: +- recorded_at: Wed, 07 Feb 2024 18:00:45 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"data":{"id":"ceae478d-b504-4cb7-bad2-e8f8e5a0a77b","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:45.905784777Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"ceae478d-b504-4cb7-bad2-e8f8e5a0a77b","key":"DDFC-15","priority":"P4","public_id":"75","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 07 Feb 2024 18:00:45 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"status":"IN_PROGRESS"},"type":"case"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/cases/ceae478d-b504-4cb7-bad2-e8f8e5a0a77b/status + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"ceae478d-b504-4cb7-bad2-e8f8e5a0a77b","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:45.905785Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"ceae478d-b504-4cb7-bad2-e8f8e5a0a77b","key":"DDFC-15","modified_at":"2024-02-07T18:00:46.22949Z","priority":"P4","public_id":"75","status":"IN_PROGRESS","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"modified_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v2/cases-projects/CreateProject.rb b/examples/v2/cases-projects/CreateProject.rb new file mode 100644 index 000000000000..b7ae0132f595 --- /dev/null +++ b/examples/v2/cases-projects/CreateProject.rb @@ -0,0 +1,15 @@ +# Create a project returns "CREATED" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CasesProjectsAPI.new + +body = DatadogAPIClient::V2::ProjectCreateRequest.new({ + data: DatadogAPIClient::V2::ProjectCreate.new({ + attributes: DatadogAPIClient::V2::ProjectCreateAttributes.new({ + key: "SEC", + name: "Security Investigation", + }), + type: DatadogAPIClient::V2::ProjectResourceType::PROJECT, + }), +}) +p api_instance.create_project(body) diff --git a/examples/v2/cases-projects/DeleteProject.rb b/examples/v2/cases-projects/DeleteProject.rb new file mode 100644 index 000000000000..9b61ff96d53f --- /dev/null +++ b/examples/v2/cases-projects/DeleteProject.rb @@ -0,0 +1,5 @@ +# Remove a project returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CasesProjectsAPI.new +api_instance.delete_project("project_id") diff --git a/examples/v2/cases-projects/GetProject.rb b/examples/v2/cases-projects/GetProject.rb new file mode 100644 index 000000000000..68fe893ea7fc --- /dev/null +++ b/examples/v2/cases-projects/GetProject.rb @@ -0,0 +1,5 @@ +# Get the details of a project returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CasesProjectsAPI.new +p api_instance.get_project("project_id") diff --git a/examples/v2/cases-projects/GetProjects.rb b/examples/v2/cases-projects/GetProjects.rb new file mode 100644 index 000000000000..b2ca99fd2d58 --- /dev/null +++ b/examples/v2/cases-projects/GetProjects.rb @@ -0,0 +1,5 @@ +# Get all projects returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CasesProjectsAPI.new +p api_instance.get_projects() diff --git a/examples/v2/cases/ArchiveCase.rb b/examples/v2/cases/ArchiveCase.rb new file mode 100644 index 000000000000..c5b5ec5f3d14 --- /dev/null +++ b/examples/v2/cases/ArchiveCase.rb @@ -0,0 +1,14 @@ +# Archive case returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CasesAPI.new + +# there is a valid "case" in the system +CASE_ID = ENV["CASE_ID"] + +body = DatadogAPIClient::V2::CaseEmptyRequest.new({ + data: DatadogAPIClient::V2::CaseEmpty.new({ + type: DatadogAPIClient::V2::CaseResourceType::CASE, + }), +}) +p api_instance.archive_case(CASE_ID, body) diff --git a/examples/v2/cases/AssignCase.rb b/examples/v2/cases/AssignCase.rb new file mode 100644 index 000000000000..24eab2cbe3e5 --- /dev/null +++ b/examples/v2/cases/AssignCase.rb @@ -0,0 +1,20 @@ +# Assign case returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CasesAPI.new + +# there is a valid "case" in the system +CASE_ID = ENV["CASE_ID"] + +# there is a valid "user" in the system +USER_DATA_ID = ENV["USER_DATA_ID"] + +body = DatadogAPIClient::V2::CaseAssignRequest.new({ + data: DatadogAPIClient::V2::CaseAssign.new({ + attributes: DatadogAPIClient::V2::CaseAssignAttributes.new({ + assignee_id: USER_DATA_ID, + }), + type: DatadogAPIClient::V2::CaseResourceType::CASE, + }), +}) +p api_instance.assign_case(CASE_ID, body) diff --git a/examples/v2/cases/CreateCase.rb b/examples/v2/cases/CreateCase.rb new file mode 100644 index 000000000000..e130774f4f89 --- /dev/null +++ b/examples/v2/cases/CreateCase.rb @@ -0,0 +1,33 @@ +# Create a case returns "CREATED" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CasesAPI.new + +# there is a valid "user" in the system +USER_DATA_ID = ENV["USER_DATA_ID"] + +body = DatadogAPIClient::V2::CaseCreateRequest.new({ + data: DatadogAPIClient::V2::CaseCreate.new({ + attributes: DatadogAPIClient::V2::CaseCreateAttributes.new({ + priority: DatadogAPIClient::V2::CasePriority::NOT_DEFINED, + title: "Security breach investigation in 3dcc5b2ebf9bfb8f", + type: DatadogAPIClient::V2::CaseType::STANDARD, + }), + relationships: DatadogAPIClient::V2::CaseCreateRelationships.new({ + assignee: DatadogAPIClient::V2::NullableUserRelationship.new({ + data: DatadogAPIClient::V2::NullableUserRelationshipData.new({ + id: USER_DATA_ID, + type: DatadogAPIClient::V2::UserResourceType::USER, + }), + }), + project: DatadogAPIClient::V2::ProjectRelationship.new({ + data: DatadogAPIClient::V2::ProjectRelationshipData.new({ + id: "d4bbe1af-f36e-42f1-87c1-493ca35c320e", + type: DatadogAPIClient::V2::ProjectResourceType::PROJECT, + }), + }), + }), + type: DatadogAPIClient::V2::CaseResourceType::CASE, + }), +}) +p api_instance.create_case(body) diff --git a/examples/v2/cases/GetCase.rb b/examples/v2/cases/GetCase.rb new file mode 100644 index 000000000000..145725e5a5ef --- /dev/null +++ b/examples/v2/cases/GetCase.rb @@ -0,0 +1,8 @@ +# Get the details of a case returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CasesAPI.new + +# there is a valid "case" in the system +CASE_ID = ENV["CASE_ID"] +p api_instance.get_case(CASE_ID) diff --git a/examples/v2/cases/SearchCases.rb b/examples/v2/cases/SearchCases.rb new file mode 100644 index 000000000000..91e4b3c448dd --- /dev/null +++ b/examples/v2/cases/SearchCases.rb @@ -0,0 +1,5 @@ +# Search cases returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CasesAPI.new +p api_instance.search_cases() diff --git a/examples/v2/cases/SearchCases_3433960044.rb b/examples/v2/cases/SearchCases_3433960044.rb new file mode 100644 index 000000000000..b24f7ed8a063 --- /dev/null +++ b/examples/v2/cases/SearchCases_3433960044.rb @@ -0,0 +1,5 @@ +# Search cases returns "OK" response with pagination + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CasesAPI.new +api_instance.search_cases_with_pagination() { |item| puts item } diff --git a/examples/v2/cases/UnarchiveCase.rb b/examples/v2/cases/UnarchiveCase.rb new file mode 100644 index 000000000000..6cc51e5f2703 --- /dev/null +++ b/examples/v2/cases/UnarchiveCase.rb @@ -0,0 +1,14 @@ +# Unarchive case returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CasesAPI.new + +# there is a valid "case" in the system +CASE_ID = ENV["CASE_ID"] + +body = DatadogAPIClient::V2::CaseEmptyRequest.new({ + data: DatadogAPIClient::V2::CaseEmpty.new({ + type: DatadogAPIClient::V2::CaseResourceType::CASE, + }), +}) +p api_instance.unarchive_case(CASE_ID, body) diff --git a/examples/v2/cases/UnassignCase.rb b/examples/v2/cases/UnassignCase.rb new file mode 100644 index 000000000000..ade628a2c79e --- /dev/null +++ b/examples/v2/cases/UnassignCase.rb @@ -0,0 +1,14 @@ +# Unassign case returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CasesAPI.new + +# there is a valid "case" in the system +CASE_ID = ENV["CASE_ID"] + +body = DatadogAPIClient::V2::CaseEmptyRequest.new({ + data: DatadogAPIClient::V2::CaseEmpty.new({ + type: DatadogAPIClient::V2::CaseResourceType::CASE, + }), +}) +p api_instance.unassign_case(CASE_ID, body) diff --git a/examples/v2/cases/UpdatePriority.rb b/examples/v2/cases/UpdatePriority.rb new file mode 100644 index 000000000000..65577e20503e --- /dev/null +++ b/examples/v2/cases/UpdatePriority.rb @@ -0,0 +1,17 @@ +# Update case priority returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CasesAPI.new + +# there is a valid "case" in the system +CASE_ID = ENV["CASE_ID"] + +body = DatadogAPIClient::V2::CaseUpdatePriorityRequest.new({ + data: DatadogAPIClient::V2::CaseUpdatePriority.new({ + attributes: DatadogAPIClient::V2::CaseUpdatePriorityAttributes.new({ + priority: DatadogAPIClient::V2::CasePriority::P3, + }), + type: DatadogAPIClient::V2::CaseResourceType::CASE, + }), +}) +p api_instance.update_priority(CASE_ID, body) diff --git a/examples/v2/cases/UpdateStatus.rb b/examples/v2/cases/UpdateStatus.rb new file mode 100644 index 000000000000..55ee11d1e837 --- /dev/null +++ b/examples/v2/cases/UpdateStatus.rb @@ -0,0 +1,17 @@ +# Update case status returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CasesAPI.new + +# there is a valid "case" in the system +CASE_ID = ENV["CASE_ID"] + +body = DatadogAPIClient::V2::CaseUpdateStatusRequest.new({ + data: DatadogAPIClient::V2::CaseUpdateStatus.new({ + attributes: DatadogAPIClient::V2::CaseUpdateStatusAttributes.new({ + status: DatadogAPIClient::V2::CaseStatus::IN_PROGRESS, + }), + type: DatadogAPIClient::V2::CaseResourceType::CASE, + }), +}) +p api_instance.update_status(CASE_ID, body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 329f786d5359..00fe8b603710 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -963,6 +963,52 @@ "authn_mapping_id" => "String", "body" => "AuthNMappingUpdateRequest", }, + "v2.SearchCases" => { + "page_size" => "Integer", + "page_offset" => "Integer", + "sort_field" => "CaseSortableField", + "filter" => "String", + "sort_asc" => "Boolean", + }, + "v2.CreateCase" => { + "body" => "CaseCreateRequest", + }, + "v2.GetCase" => { + "case_id" => "String", + }, + "v2.ArchiveCase" => { + "case_id" => "String", + "body" => "CaseEmptyRequest", + }, + "v2.AssignCase" => { + "case_id" => "String", + "body" => "CaseAssignRequest", + }, + "v2.UpdatePriority" => { + "case_id" => "String", + "body" => "CaseUpdatePriorityRequest", + }, + "v2.UpdateStatus" => { + "case_id" => "String", + "body" => "CaseUpdateStatusRequest", + }, + "v2.UnarchiveCase" => { + "case_id" => "String", + "body" => "CaseEmptyRequest", + }, + "v2.UnassignCase" => { + "case_id" => "String", + "body" => "CaseEmptyRequest", + }, + "v2.CreateProject" => { + "body" => "ProjectCreateRequest", + }, + "v2.DeleteProject" => { + "project_id" => "String", + }, + "v2.GetProject" => { + "project_id" => "String", + }, "v2.CreateCIAppPipelineEvent" => { "body" => "CIAppCreatePipelineEventRequest", }, diff --git a/features/v2/cases.feature b/features/v2/cases.feature new file mode 100644 index 000000000000..5a0eca615554 --- /dev/null +++ b/features/v2/cases.feature @@ -0,0 +1,241 @@ +@endpoint(cases) @endpoint(cases-v2) +Feature: Cases + View and manage cases within Datadog + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "Cases" API + + @team:DataDog/case-management + Scenario: Archive case returns "Bad Request" response + Given new "ArchiveCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"type": "project"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Archive case returns "Not Found" response + Given new "ArchiveCase" request + And request contains "case_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + And body with value {"data": {"type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/case-management + Scenario: Archive case returns "OK" response + Given new "ArchiveCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"type": "case"}} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/case-management + Scenario: Assign case returns "Bad Request" response + Given new "AssignCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"attributes": {"assignee_id": "invalid-uuid"}, "type": "case"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Assign case returns "Not Found" response + Given new "AssignCase" request + And there is a valid "user" in the system + And request contains "case_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + And body with value {"data": {"attributes": {"assignee_id": "{{user.data.id}}"}, "type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/case-management + Scenario: Assign case returns "OK" response + Given new "AssignCase" request + And there is a valid "case" in the system + And there is a valid "user" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"attributes": {"assignee_id": "{{user.data.id}}"}, "type": "case"}} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/case-management + Scenario: Create a case returns "Bad Request" response + Given new "CreateCase" request + And body with value {"data": {"attributes": {"priority": "NOT_DEFINED", "title": "Security breach investigation", "type": "STANDARD"}, "relationships": {"assignee": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "userx"}}, "project": {"data": {"id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "type": "project"}}}, "type": "case"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Create a case returns "CREATED" response + Given new "CreateCase" request + And there is a valid "user" in the system + And body with value {"data": {"attributes": {"priority": "NOT_DEFINED", "title": "Security breach investigation in {{ unique_hash }}", "type": "STANDARD"}, "relationships": {"assignee": {"data": {"id": "{{user.data.id}}", "type": "user"} }, "project": {"data": {"id": "d4bbe1af-f36e-42f1-87c1-493ca35c320e", "type": "project"}}}, "type": "case"}} + When the request is sent + Then the response status is 201 CREATED + And the response "data" has field "id" + And the response "data.attributes.title" is equal to "Security breach investigation in {{ unique_hash }}" + And the response "data.attributes.type" is equal to "STANDARD" + And the response "data.attributes.priority" is equal to "NOT_DEFINED" + + @generated @skip @team:DataDog/case-management + Scenario: Create a case returns "Not Found" response + Given new "CreateCase" request + And body with value {"data": {"attributes": {"priority": "NOT_DEFINED", "title": "Security breach investigation", "type": "STANDARD"}, "relationships": {"assignee": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "user"}}, "project": {"data": {"id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "type": "project"}}}, "type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @skip @team:DataDog/case-management + Scenario: Get the details of a case returns "Bad Request" response + Given new "GetCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Get the details of a case returns "Not Found" response + Given new "GetCase" request + And request contains "case_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/case-management + Scenario: Get the details of a case returns "OK" response + Given new "GetCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Search cases returns "Bad Request" response + Given new "SearchCases" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Search cases returns "Not Found" response + Given new "SearchCases" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Search cases returns "OK" response + Given new "SearchCases" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management @with-pagination + Scenario: Search cases returns "OK" response with pagination + Given new "SearchCases" request + When the request with pagination is sent + Then the response status is 200 OK + + @team:DataDog/case-management + Scenario: Unarchive case returns "Bad Request" response + Given new "UnarchiveCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"type": "project"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Unarchive case returns "Not Found" response + Given new "UnarchiveCase" request + And request contains "case_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + And body with value {"data": {"type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/case-management + Scenario: Unarchive case returns "OK" response + Given new "UnarchiveCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"type": "case"}} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/case-management + Scenario: Unassign case returns "Bad Request" response + Given new "UnassignCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"type": "project"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Unassign case returns "Not Found" response + Given new "UnassignCase" request + And request contains "case_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + And body with value {"data": {"type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/case-management + Scenario: Unassign case returns "OK" response + Given new "UnassignCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"type": "case"}} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/case-management + Scenario: Update case priority returns "Bad Request" response + Given new "UpdatePriority" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"attributes": {"priority": "P1234"}, "type": "case"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Update case priority returns "Not Found" response + Given new "UpdatePriority" request + And request contains "case_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + And body with value {"data": {"attributes": {"priority": "P3"}, "type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/case-management + Scenario: Update case priority returns "OK" response + Given new "UpdatePriority" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"attributes": {"priority": "P3"}, "type": "case"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.priority" is equal to "P3" + + @team:DataDog/case-management + Scenario: Update case status returns "Bad Request" response + Given new "UpdateStatus" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"attributes": {"status": "OPENED"}, "type": "case"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Update case status returns "Not Found" response + Given new "UpdateStatus" request + And request contains "case_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + And body with value {"data": {"attributes": {"status": "OPEN"}, "type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/case-management + Scenario: Update case status returns "OK" response + Given new "UpdateStatus" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"attributes": {"status": "IN_PROGRESS"}, "type": "case"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.status" is equal to "IN_PROGRESS" diff --git a/features/v2/cases_projects.feature b/features/v2/cases_projects.feature new file mode 100644 index 000000000000..1b3fe63e4995 --- /dev/null +++ b/features/v2/cases_projects.feature @@ -0,0 +1,82 @@ +@endpoint(cases-projects) @endpoint(cases-projects-v2) +Feature: Cases Projects + View and manage project within Case Management + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "CasesProjects" API + + @generated @skip @team:DataDog/case-management + Scenario: Create a project returns "Bad Request" response + Given new "CreateProject" request + And body with value {"data": {"attributes": {"key": "SEC", "name": "Security Investigation"}, "type": "project"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Create a project returns "CREATED" response + Given new "CreateProject" request + And body with value {"data": {"attributes": {"key": "SEC", "name": "Security Investigation"}, "type": "project"}} + When the request is sent + Then the response status is 201 CREATED + + @generated @skip @team:DataDog/case-management + Scenario: Create a project returns "Not Found" response + Given new "CreateProject" request + And body with value {"data": {"attributes": {"key": "SEC", "name": "Security Investigation"}, "type": "project"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Get all projects returns "Bad Request" response + Given new "GetProjects" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Get all projects returns "Not Found" response + Given new "GetProjects" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Get all projects returns "OK" response + Given new "GetProjects" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Get the details of a project returns "Bad Request" response + Given new "GetProject" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Get the details of a project returns "Not Found" response + Given new "GetProject" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Get the details of a project returns "OK" response + Given new "GetProject" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Remove a project returns "API error response" response + Given new "DeleteProject" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response + + @generated @skip @team:DataDog/case-management + Scenario: Remove a project returns "No Content" response + Given new "DeleteProject" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content diff --git a/features/v2/given.json b/features/v2/given.json index da22a5fc35d6..cbaee96cb71b 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -59,6 +59,19 @@ "tag": "AuthN Mappings", "operationId": "CreateAuthNMapping" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"title\": \"My new case\",\n \"type\": \"STANDARD\",\n \"priority\": \"P4\"\n },\n \"relationships\": {\n \"project\": {\n \"data\": {\n \"id\": \"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\n \"type\": \"project\"\n }\n }\n },\n \"type\": \"case\"\n }\n}" + } + ], + "source": "data", + "step": "there is a valid \"case\" in the system", + "key": "case", + "tag": "Cases", + "operationId": "CreateCase" + }, { "parameters": [ { diff --git a/features/v2/undo.json b/features/v2/undo.json index 61d85e0fcad2..1268756c9d25 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -220,6 +220,91 @@ "type": "idempotent" } }, + "SearchCases": { + "tag": "Cases", + "undo": { + "type": "safe" + } + }, + "CreateCase": { + "tag": "Cases", + "undo": { + "type": "safe" + } + }, + "GetProjects": { + "tag": "Cases Projects", + "undo": { + "type": "safe" + } + }, + "CreateProject": { + "tag": "Cases Projects", + "undo": { + "operationId": "DeleteProject", + "parameters": [ + { + "name": "project_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteProject": { + "tag": "Cases Projects", + "undo": { + "type": "idempotent" + } + }, + "GetProject": { + "tag": "Cases Projects", + "undo": { + "type": "safe" + } + }, + "GetCase": { + "tag": "Cases", + "undo": { + "type": "safe" + } + }, + "ArchiveCase": { + "tag": "Cases", + "undo": { + "type": "idempotent" + } + }, + "AssignCase": { + "tag": "Cases", + "undo": { + "type": "idempotent" + } + }, + "UpdatePriority": { + "tag": "Cases", + "undo": { + "type": "idempotent" + } + }, + "UpdateStatus": { + "tag": "Cases", + "undo": { + "type": "idempotent" + } + }, + "UnarchiveCase": { + "tag": "Cases", + "undo": { + "type": "idempotent" + } + }, + "UnassignCase": { + "tag": "Cases", + "undo": { + "type": "idempotent" + } + }, "CreateCIAppPipelineEvent": { "tag": "CI Visibility Pipelines", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index c0387771661e..7ef1112a4d59 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -953,6 +953,34 @@ def overrides "v2.bulk_mute_findings_request_properties" => "BulkMuteFindingsRequestProperties", "v2.bulk_mute_findings_response" => "BulkMuteFindingsResponse", "v2.bulk_mute_findings_response_data" => "BulkMuteFindingsResponseData", + "v2.case" => "Case", + "v2.case3rd_party_ticket_status" => "Case3rdPartyTicketStatus", + "v2.case_assign" => "CaseAssign", + "v2.case_assign_attributes" => "CaseAssignAttributes", + "v2.case_assign_request" => "CaseAssignRequest", + "v2.case_attributes" => "CaseAttributes", + "v2.case_create" => "CaseCreate", + "v2.case_create_attributes" => "CaseCreateAttributes", + "v2.case_create_relationships" => "CaseCreateRelationships", + "v2.case_create_request" => "CaseCreateRequest", + "v2.case_empty" => "CaseEmpty", + "v2.case_empty_request" => "CaseEmptyRequest", + "v2.case_priority" => "CasePriority", + "v2.case_relationships" => "CaseRelationships", + "v2.case_resource_type" => "CaseResourceType", + "v2.case_response" => "CaseResponse", + "v2.case_sortable_field" => "CaseSortableField", + "v2.cases_response" => "CasesResponse", + "v2.cases_response_meta" => "CasesResponseMeta", + "v2.cases_response_meta_pagination" => "CasesResponseMetaPagination", + "v2.case_status" => "CaseStatus", + "v2.case_type" => "CaseType", + "v2.case_update_priority" => "CaseUpdatePriority", + "v2.case_update_priority_attributes" => "CaseUpdatePriorityAttributes", + "v2.case_update_priority_request" => "CaseUpdatePriorityRequest", + "v2.case_update_status" => "CaseUpdateStatus", + "v2.case_update_status_attributes" => "CaseUpdateStatusAttributes", + "v2.case_update_status_request" => "CaseUpdateStatusRequest", "v2.chargeback_breakdown" => "ChargebackBreakdown", "v2.ci_app_aggregate_bucket_value" => "CIAppAggregateBucketValue", "v2.ci_app_aggregate_bucket_value_timeseries_point" => "CIAppAggregateBucketValueTimeseriesPoint", @@ -1405,6 +1433,8 @@ def overrides "v2.ip_allowlist_update_request" => "IPAllowlistUpdateRequest", "v2.jira_integration_metadata" => "JiraIntegrationMetadata", "v2.jira_integration_metadata_issues_item" => "JiraIntegrationMetadataIssuesItem", + "v2.jira_issue" => "JiraIssue", + "v2.jira_issue_result" => "JiraIssueResult", "v2.jsonapi_error_item" => "JSONAPIErrorItem", "v2.jsonapi_error_response" => "JSONAPIErrorResponse", "v2.list_application_keys_response" => "ListApplicationKeysResponse", @@ -1581,6 +1611,8 @@ def overrides "v2.monthly_cost_attribution_response" => "MonthlyCostAttributionResponse", "v2.nullable_relationship_to_user" => "NullableRelationshipToUser", "v2.nullable_relationship_to_user_data" => "NullableRelationshipToUserData", + "v2.nullable_user_relationship" => "NullableUserRelationship", + "v2.nullable_user_relationship_data" => "NullableUserRelationshipData", "v2.okta_account" => "OktaAccount", "v2.okta_account_attributes" => "OktaAccountAttributes", "v2.okta_account_request" => "OktaAccountRequest", @@ -1656,10 +1688,21 @@ def overrides "v2.process_summary" => "ProcessSummary", "v2.process_summary_attributes" => "ProcessSummaryAttributes", "v2.process_summary_type" => "ProcessSummaryType", + "v2.project" => "Project", + "v2.project_attributes" => "ProjectAttributes", + "v2.project_create" => "ProjectCreate", + "v2.project_create_attributes" => "ProjectCreateAttributes", + "v2.project_create_request" => "ProjectCreateRequest", "v2.projected_cost" => "ProjectedCost", "v2.projected_cost_attributes" => "ProjectedCostAttributes", "v2.projected_cost_response" => "ProjectedCostResponse", "v2.projected_cost_type" => "ProjectedCostType", + "v2.project_relationship" => "ProjectRelationship", + "v2.project_relationship_data" => "ProjectRelationshipData", + "v2.project_relationships" => "ProjectRelationships", + "v2.project_resource_type" => "ProjectResourceType", + "v2.project_response" => "ProjectResponse", + "v2.projects_response" => "ProjectsResponse", "v2.query_formula" => "QueryFormula", "v2.query_sort_order" => "QuerySortOrder", "v2.relationship_to_incident_attachment" => "RelationshipToIncidentAttachment", @@ -2018,6 +2061,8 @@ def overrides "v2.service_definition_v2_slack" => "ServiceDefinitionV2Slack", "v2.service_definition_v2_slack_type" => "ServiceDefinitionV2SlackType", "v2.service_definition_v2_version" => "ServiceDefinitionV2Version", + "v2.service_now_ticket" => "ServiceNowTicket", + "v2.service_now_ticket_result" => "ServiceNowTicketResult", "v2.slack_integration_metadata" => "SlackIntegrationMetadata", "v2.slack_integration_metadata_channel_item" => "SlackIntegrationMetadataChannelItem", "v2.sort_direction" => "SortDirection", @@ -2152,10 +2197,13 @@ def overrides "v2.user_invitations_request" => "UserInvitationsRequest", "v2.user_invitations_response" => "UserInvitationsResponse", "v2.user_invitations_type" => "UserInvitationsType", + "v2.user_relationship_data" => "UserRelationshipData", "v2.user_relationships" => "UserRelationships", + "v2.user_resource_type" => "UserResourceType", "v2.user_response" => "UserResponse", "v2.user_response_included_item" => "UserResponseIncludedItem", "v2.user_response_relationships" => "UserResponseRelationships", + "v2.users_relationship" => "UsersRelationship", "v2.users_response" => "UsersResponse", "v2.users_type" => "UsersType", "v2.user_team" => "UserTeam", @@ -2214,6 +2262,8 @@ def overrides "v2.apm_retention_filters_api" => "APMRetentionFiltersAPI", "v2.audit_api" => "AuditAPI", "v2.authn_mappings_api" => "AuthNMappingsAPI", + "v2.cases_api" => "CasesAPI", + "v2.cases_projects_api" => "CasesProjectsAPI", "v2.ci_visibility_pipelines_api" => "CIVisibilityPipelinesAPI", "v2.ci_visibility_tests_api" => "CIVisibilityTestsAPI", "v2.cloud_cost_management_api" => "CloudCostManagementAPI", diff --git a/lib/datadog_api_client/v2/api/cases_api.rb b/lib/datadog_api_client/v2/api/cases_api.rb new file mode 100644 index 000000000000..4af2f678cc2c --- /dev/null +++ b/lib/datadog_api_client/v2/api/cases_api.rb @@ -0,0 +1,685 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class CasesAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Archive case. + # + # @see #archive_case_with_http_info + def archive_case(case_id, body, opts = {}) + data, _status_code, _headers = archive_case_with_http_info(case_id, body, opts) + data + end + + # Archive case. + # + # Archive case + # + # @param case_id [String] Case's UUID or key + # @param body [CaseEmptyRequest] Archive case payload + # @param opts [Hash] the optional parameters + # @return [Array<(CaseResponse, Integer, Hash)>] CaseResponse data, response status code and response headers + def archive_case_with_http_info(case_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CasesAPI.archive_case ...' + end + # verify the required parameter 'case_id' is set + if @api_client.config.client_side_validation && case_id.nil? + fail ArgumentError, "Missing the required parameter 'case_id' when calling CasesAPI.archive_case" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CasesAPI.archive_case" + end + # resource path + local_var_path = '/api/v2/cases/{case_id}/archive'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'CaseResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :archive_case, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CasesAPI#archive_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Assign case. + # + # @see #assign_case_with_http_info + def assign_case(case_id, body, opts = {}) + data, _status_code, _headers = assign_case_with_http_info(case_id, body, opts) + data + end + + # Assign case. + # + # Assign case to a user + # + # @param case_id [String] Case's UUID or key + # @param body [CaseAssignRequest] Assign case payload + # @param opts [Hash] the optional parameters + # @return [Array<(CaseResponse, Integer, Hash)>] CaseResponse data, response status code and response headers + def assign_case_with_http_info(case_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CasesAPI.assign_case ...' + end + # verify the required parameter 'case_id' is set + if @api_client.config.client_side_validation && case_id.nil? + fail ArgumentError, "Missing the required parameter 'case_id' when calling CasesAPI.assign_case" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CasesAPI.assign_case" + end + # resource path + local_var_path = '/api/v2/cases/{case_id}/assign'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'CaseResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :assign_case, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CasesAPI#assign_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create a case. + # + # @see #create_case_with_http_info + def create_case(body, opts = {}) + data, _status_code, _headers = create_case_with_http_info(body, opts) + data + end + + # Create a case. + # + # Create a Case + # + # @param body [CaseCreateRequest] Case payload + # @param opts [Hash] the optional parameters + # @return [Array<(CaseResponse, Integer, Hash)>] CaseResponse data, response status code and response headers + def create_case_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CasesAPI.create_case ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CasesAPI.create_case" + end + # resource path + local_var_path = '/api/v2/cases' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'CaseResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_case, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CasesAPI#create_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get the details of a case. + # + # @see #get_case_with_http_info + def get_case(case_id, opts = {}) + data, _status_code, _headers = get_case_with_http_info(case_id, opts) + data + end + + # Get the details of a case. + # + # Get the details of case by `case_id` + # + # @param case_id [String] Case's UUID or key + # @param opts [Hash] the optional parameters + # @return [Array<(CaseResponse, Integer, Hash)>] CaseResponse data, response status code and response headers + def get_case_with_http_info(case_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CasesAPI.get_case ...' + end + # verify the required parameter 'case_id' is set + if @api_client.config.client_side_validation && case_id.nil? + fail ArgumentError, "Missing the required parameter 'case_id' when calling CasesAPI.get_case" + end + # resource path + local_var_path = '/api/v2/cases/{case_id}'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'CaseResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_case, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CasesAPI#get_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Search cases. + # + # @see #search_cases_with_http_info + def search_cases(opts = {}) + data, _status_code, _headers = search_cases_with_http_info(opts) + data + end + + # Search cases. + # + # Search cases. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. + # @option opts [Integer] :page_offset Specific offset to use as the beginning of the returned page. + # @option opts [CaseSortableField] :sort_field Specify which field to sort + # @option opts [String] :filter Search query + # @option opts [Boolean] :sort_asc Specify if order is ascending or not + # @return [Array<(CasesResponse, Integer, Hash)>] CasesResponse data, response status code and response headers + def search_cases_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CasesAPI.search_cases ...' + end + allowable_values = ['created_at', 'priority', 'status'] + if @api_client.config.client_side_validation && opts[:'sort_field'] && !allowable_values.include?(opts[:'sort_field']) + fail ArgumentError, "invalid value for \"sort_field\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/v2/cases' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[offset]'] = opts[:'page_offset'] if !opts[:'page_offset'].nil? + query_params[:'sort[field]'] = opts[:'sort_field'] if !opts[:'sort_field'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'sort[asc]'] = opts[:'sort_asc'] if !opts[:'sort_asc'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'CasesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :search_cases, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CasesAPI#search_cases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Search cases. + # + # Provide a paginated version of {#search_cases}, returning all items. + # + # To use it you need to use a block: search_cases_with_pagination { |item| p item } + # + # @yield [Case] Paginated items + def search_cases_with_pagination(opts = {}) + api_version = "V2" + page_size = @api_client.get_attribute_from_path(opts, "page_size", 10) + @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size) + while true do + response = search_cases(opts) + @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } + if @api_client.get_attribute_from_path(response, "data").length < page_size + break + end + @api_client.set_attribute_from_path(api_version, opts, "page_offset", Integer, @api_client.get_attribute_from_path(opts, "page_offset", 0) + page_size) + end + end + + # Unarchive case. + # + # @see #unarchive_case_with_http_info + def unarchive_case(case_id, body, opts = {}) + data, _status_code, _headers = unarchive_case_with_http_info(case_id, body, opts) + data + end + + # Unarchive case. + # + # Unarchive case + # + # @param case_id [String] Case's UUID or key + # @param body [CaseEmptyRequest] Unarchive case payload + # @param opts [Hash] the optional parameters + # @return [Array<(CaseResponse, Integer, Hash)>] CaseResponse data, response status code and response headers + def unarchive_case_with_http_info(case_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CasesAPI.unarchive_case ...' + end + # verify the required parameter 'case_id' is set + if @api_client.config.client_side_validation && case_id.nil? + fail ArgumentError, "Missing the required parameter 'case_id' when calling CasesAPI.unarchive_case" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CasesAPI.unarchive_case" + end + # resource path + local_var_path = '/api/v2/cases/{case_id}/unarchive'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'CaseResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :unarchive_case, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CasesAPI#unarchive_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Unassign case. + # + # @see #unassign_case_with_http_info + def unassign_case(case_id, body, opts = {}) + data, _status_code, _headers = unassign_case_with_http_info(case_id, body, opts) + data + end + + # Unassign case. + # + # Unassign case + # + # @param case_id [String] Case's UUID or key + # @param body [CaseEmptyRequest] Unassign case payload + # @param opts [Hash] the optional parameters + # @return [Array<(CaseResponse, Integer, Hash)>] CaseResponse data, response status code and response headers + def unassign_case_with_http_info(case_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CasesAPI.unassign_case ...' + end + # verify the required parameter 'case_id' is set + if @api_client.config.client_side_validation && case_id.nil? + fail ArgumentError, "Missing the required parameter 'case_id' when calling CasesAPI.unassign_case" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CasesAPI.unassign_case" + end + # resource path + local_var_path = '/api/v2/cases/{case_id}/unassign'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'CaseResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :unassign_case, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CasesAPI#unassign_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update case priority. + # + # @see #update_priority_with_http_info + def update_priority(case_id, body, opts = {}) + data, _status_code, _headers = update_priority_with_http_info(case_id, body, opts) + data + end + + # Update case priority. + # + # Update case priority + # + # @param case_id [String] Case's UUID or key + # @param body [CaseUpdatePriorityRequest] Case priority update payload + # @param opts [Hash] the optional parameters + # @return [Array<(CaseResponse, Integer, Hash)>] CaseResponse data, response status code and response headers + def update_priority_with_http_info(case_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CasesAPI.update_priority ...' + end + # verify the required parameter 'case_id' is set + if @api_client.config.client_side_validation && case_id.nil? + fail ArgumentError, "Missing the required parameter 'case_id' when calling CasesAPI.update_priority" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CasesAPI.update_priority" + end + # resource path + local_var_path = '/api/v2/cases/{case_id}/priority'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'CaseResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_priority, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CasesAPI#update_priority\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update case status. + # + # @see #update_status_with_http_info + def update_status(case_id, body, opts = {}) + data, _status_code, _headers = update_status_with_http_info(case_id, body, opts) + data + end + + # Update case status. + # + # Update case status + # + # @param case_id [String] Case's UUID or key + # @param body [CaseUpdateStatusRequest] Case status update payload + # @param opts [Hash] the optional parameters + # @return [Array<(CaseResponse, Integer, Hash)>] CaseResponse data, response status code and response headers + def update_status_with_http_info(case_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CasesAPI.update_status ...' + end + # verify the required parameter 'case_id' is set + if @api_client.config.client_side_validation && case_id.nil? + fail ArgumentError, "Missing the required parameter 'case_id' when calling CasesAPI.update_status" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CasesAPI.update_status" + end + # resource path + local_var_path = '/api/v2/cases/{case_id}/status'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'CaseResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_status, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CasesAPI#update_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/api/cases_projects_api.rb b/lib/datadog_api_client/v2/api/cases_projects_api.rb new file mode 100644 index 000000000000..767f536a5736 --- /dev/null +++ b/lib/datadog_api_client/v2/api/cases_projects_api.rb @@ -0,0 +1,283 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class CasesProjectsAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Create a project. + # + # @see #create_project_with_http_info + def create_project(body, opts = {}) + data, _status_code, _headers = create_project_with_http_info(body, opts) + data + end + + # Create a project. + # + # Create a project. + # + # @param body [ProjectCreateRequest] Project payload + # @param opts [Hash] the optional parameters + # @return [Array<(ProjectResponse, Integer, Hash)>] ProjectResponse data, response status code and response headers + def create_project_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CasesProjectsAPI.create_project ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CasesProjectsAPI.create_project" + end + # resource path + local_var_path = '/api/v2/cases/projects' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'ProjectResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_project, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CasesProjectsAPI#create_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Remove a project. + # + # @see #delete_project_with_http_info + def delete_project(project_id, opts = {}) + delete_project_with_http_info(project_id, opts) + nil + end + + # Remove a project. + # + # Remove a project using the project's `id`. + # + # @param project_id [String] Project UUID + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_project_with_http_info(project_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CasesProjectsAPI.delete_project ...' + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling CasesProjectsAPI.delete_project" + end + # resource path + local_var_path = '/api/v2/cases/projects/{project_id}'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_project, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CasesProjectsAPI#delete_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get the details of a project. + # + # @see #get_project_with_http_info + def get_project(project_id, opts = {}) + data, _status_code, _headers = get_project_with_http_info(project_id, opts) + data + end + + # Get the details of a project. + # + # Get the details of a project by `project_id`. + # + # @param project_id [String] Project UUID + # @param opts [Hash] the optional parameters + # @return [Array<(ProjectResponse, Integer, Hash)>] ProjectResponse data, response status code and response headers + def get_project_with_http_info(project_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CasesProjectsAPI.get_project ...' + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling CasesProjectsAPI.get_project" + end + # resource path + local_var_path = '/api/v2/cases/projects/{project_id}'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ProjectResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_project, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CasesProjectsAPI#get_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get all projects. + # + # @see #get_projects_with_http_info + def get_projects(opts = {}) + data, _status_code, _headers = get_projects_with_http_info(opts) + data + end + + # Get all projects. + # + # Get all projects. + # + # @param opts [Hash] the optional parameters + # @return [Array<(ProjectsResponse, Integer, Hash)>] ProjectsResponse data, response status code and response headers + def get_projects_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CasesProjectsAPI.get_projects ...' + end + # resource path + local_var_path = '/api/v2/cases/projects' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ProjectsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_projects, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CasesProjectsAPI#get_projects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/models/case.rb b/lib/datadog_api_client/v2/models/case.rb new file mode 100644 index 000000000000..d3366e12bb6a --- /dev/null +++ b/lib/datadog_api_client/v2/models/case.rb @@ -0,0 +1,150 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A case + class Case + include BaseGenericModel + + # Case attributes + attr_reader :attributes + + # Case's identifier + attr_reader :id + + # Resources related to a case + attr_accessor :relationships + + # Case resource type + attr_reader :type + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'CaseAttributes', + :'id' => :'String', + :'relationships' => :'CaseRelationships', + :'type' => :'CaseResourceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::Case` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::Case`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/case3rd_party_ticket_status.rb b/lib/datadog_api_client/v2/models/case3rd_party_ticket_status.rb new file mode 100644 index 000000000000..7c44caff8577 --- /dev/null +++ b/lib/datadog_api_client/v2/models/case3rd_party_ticket_status.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case status + class Case3rdPartyTicketStatus + include BaseEnumModel + + IN_PROGRESS = "IN_PROGRESS".freeze + COMPLETED = "COMPLETED".freeze + FAILED = "FAILED".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/case_assign.rb b/lib/datadog_api_client/v2/models/case_assign.rb new file mode 100644 index 000000000000..12bd1dfae1a8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_assign.rb @@ -0,0 +1,119 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case assign + class CaseAssign + include BaseGenericModel + + # Case assign attributes + attr_reader :attributes + + # Case resource type + attr_reader :type + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'CaseAssignAttributes', + :'type' => :'CaseResourceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CaseAssign` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CaseAssign`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/case_assign_attributes.rb b/lib/datadog_api_client/v2/models/case_assign_attributes.rb new file mode 100644 index 000000000000..42c81d43ada3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_assign_attributes.rb @@ -0,0 +1,98 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case assign attributes + class CaseAssignAttributes + include BaseGenericModel + + # Assignee's UUID + attr_reader :assignee_id + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'assignee_id' => :'assignee_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'assignee_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CaseAssignAttributes` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CaseAssignAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'assignee_id') + self.assignee_id = attributes[:'assignee_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @assignee_id.nil? + true + end + + # Custom attribute writer method with validation + # @param assignee_id [Object] Object to be assigned + # @!visibility private + def assignee_id=(assignee_id) + if assignee_id.nil? + fail ArgumentError, 'invalid value for "assignee_id", assignee_id cannot be nil.' + end + @assignee_id = assignee_id + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + assignee_id == o.assignee_id + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [assignee_id].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/case_assign_request.rb b/lib/datadog_api_client/v2/models/case_assign_request.rb new file mode 100644 index 000000000000..3fe164b52f6a --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_assign_request.rb @@ -0,0 +1,98 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case assign request + class CaseAssignRequest + include BaseGenericModel + + # Case assign + attr_reader :data + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'CaseAssign' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CaseAssignRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CaseAssignRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/case_attributes.rb b/lib/datadog_api_client/v2/models/case_attributes.rb new file mode 100644 index 000000000000..e65a3d6702d3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_attributes.rb @@ -0,0 +1,202 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case attributes + class CaseAttributes + include BaseGenericModel + + # Timestamp of when the case was archived + attr_accessor :archived_at + + # Timestamp of when the case was closed + attr_accessor :closed_at + + # Timestamp of when the case was created + attr_accessor :created_at + + # Description + attr_accessor :description + + # Jira issue attached to case + attr_accessor :jira_issue + + # Key + attr_accessor :key + + # Timestamp of when the case was last modified + attr_accessor :modified_at + + # Case priority + attr_accessor :priority + + # ServiceNow ticket attached to case + attr_accessor :service_now_ticket + + # Case status + attr_accessor :status + + # Title + attr_accessor :title + + # Case type + attr_accessor :type + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'archived_at' => :'Time', + :'closed_at' => :'Time', + :'created_at' => :'Time', + :'description' => :'String', + :'jira_issue' => :'JiraIssue', + :'key' => :'String', + :'modified_at' => :'Time', + :'priority' => :'CasePriority', + :'service_now_ticket' => :'ServiceNowTicket', + :'status' => :'CaseStatus', + :'title' => :'String', + :'type' => :'CaseType' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'archived_at', + :'closed_at', + :'jira_issue', + :'modified_at', + :'service_now_ticket', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CaseAttributes` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CaseAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'archived_at') + self.archived_at = attributes[:'archived_at'] + end + + if attributes.key?(:'closed_at') + self.closed_at = attributes[:'closed_at'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'jira_issue') + self.jira_issue = attributes[:'jira_issue'] + end + + if attributes.key?(:'key') + self.key = attributes[:'key'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + end + + if attributes.key?(:'service_now_ticket') + self.service_now_ticket = attributes[:'service_now_ticket'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + archived_at == o.archived_at && + closed_at == o.closed_at && + created_at == o.created_at && + description == o.description && + jira_issue == o.jira_issue && + key == o.key && + modified_at == o.modified_at && + priority == o.priority && + service_now_ticket == o.service_now_ticket && + status == o.status && + title == o.title && + type == o.type + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [archived_at, closed_at, created_at, description, jira_issue, key, modified_at, priority, service_now_ticket, status, title, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/case_create.rb b/lib/datadog_api_client/v2/models/case_create.rb new file mode 100644 index 000000000000..8edabe745def --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_create.rb @@ -0,0 +1,129 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case creation data + class CaseCreate + include BaseGenericModel + + # Case creation attributes + attr_reader :attributes + + # Relationships formed with the case on creation + attr_accessor :relationships + + # Case resource type + attr_reader :type + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'CaseCreateAttributes', + :'relationships' => :'CaseCreateRelationships', + :'type' => :'CaseResourceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CaseCreate` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CaseCreate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + relationships == o.relationships && + type == o.type + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, relationships, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/case_create_attributes.rb b/lib/datadog_api_client/v2/models/case_create_attributes.rb new file mode 100644 index 000000000000..393d63dcb20e --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_create_attributes.rb @@ -0,0 +1,139 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case creation attributes + class CaseCreateAttributes + include BaseGenericModel + + # Description + attr_accessor :description + + # Case priority + attr_accessor :priority + + # Title + attr_reader :title + + # Case type + attr_reader :type + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'priority' => :'priority', + :'title' => :'title', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'priority' => :'CasePriority', + :'title' => :'String', + :'type' => :'CaseType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CaseCreateAttributes` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CaseCreateAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @title.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param title [Object] Object to be assigned + # @!visibility private + def title=(title) + if title.nil? + fail ArgumentError, 'invalid value for "title", title cannot be nil.' + end + @title = title + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + priority == o.priority && + title == o.title && + type == o.type + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, priority, title, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/case_create_relationships.rb b/lib/datadog_api_client/v2/models/case_create_relationships.rb new file mode 100644 index 000000000000..abda206ac604 --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_create_relationships.rb @@ -0,0 +1,116 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships formed with the case on creation + class CaseCreateRelationships + include BaseGenericModel + + # Relationship to user. + attr_accessor :assignee + + # Relationship to project + attr_reader :project + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'assignee' => :'assignee', + :'project' => :'project' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'assignee' => :'NullableUserRelationship', + :'project' => :'ProjectRelationship' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'assignee', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CaseCreateRelationships` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CaseCreateRelationships`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'assignee') + self.assignee = attributes[:'assignee'] + end + + if attributes.key?(:'project') + self.project = attributes[:'project'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @project.nil? + true + end + + # Custom attribute writer method with validation + # @param project [Object] Object to be assigned + # @!visibility private + def project=(project) + if project.nil? + fail ArgumentError, 'invalid value for "project", project cannot be nil.' + end + @project = project + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + assignee == o.assignee && + project == o.project + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [assignee, project].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/case_create_request.rb b/lib/datadog_api_client/v2/models/case_create_request.rb new file mode 100644 index 000000000000..495b0296089e --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_create_request.rb @@ -0,0 +1,98 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case create request + class CaseCreateRequest + include BaseGenericModel + + # Case creation data + attr_reader :data + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'CaseCreate' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CaseCreateRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CaseCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/case_empty.rb b/lib/datadog_api_client/v2/models/case_empty.rb new file mode 100644 index 000000000000..2e6c006ddef2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_empty.rb @@ -0,0 +1,98 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case empty request data + class CaseEmpty + include BaseGenericModel + + # Case resource type + attr_reader :type + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'type' => :'CaseResourceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CaseEmpty` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CaseEmpty`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/case_empty_request.rb b/lib/datadog_api_client/v2/models/case_empty_request.rb new file mode 100644 index 000000000000..b96376e6f99d --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_empty_request.rb @@ -0,0 +1,98 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case empty request + class CaseEmptyRequest + include BaseGenericModel + + # Case empty request data + attr_reader :data + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'CaseEmpty' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CaseEmptyRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CaseEmptyRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/case_priority.rb b/lib/datadog_api_client/v2/models/case_priority.rb new file mode 100644 index 000000000000..8a15f856786d --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_priority.rb @@ -0,0 +1,31 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case priority + class CasePriority + include BaseEnumModel + + NOT_DEFINED = "NOT_DEFINED".freeze + P1 = "P1".freeze + P2 = "P2".freeze + P3 = "P3".freeze + P4 = "P4".freeze + P5 = "P5".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/case_relationships.rb b/lib/datadog_api_client/v2/models/case_relationships.rb new file mode 100644 index 000000000000..a5bacb560f80 --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_relationships.rb @@ -0,0 +1,120 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Resources related to a case + class CaseRelationships + include BaseGenericModel + + # Relationship to user. + attr_accessor :assignee + + # Relationship to user. + attr_accessor :created_by + + # Relationship to user. + attr_accessor :modified_by + + # Relationship to project + attr_accessor :project + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'assignee' => :'assignee', + :'created_by' => :'created_by', + :'modified_by' => :'modified_by', + :'project' => :'project' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'assignee' => :'NullableUserRelationship', + :'created_by' => :'NullableUserRelationship', + :'modified_by' => :'NullableUserRelationship', + :'project' => :'ProjectRelationship' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'assignee', + :'created_by', + :'modified_by', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CaseRelationships` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CaseRelationships`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'assignee') + self.assignee = attributes[:'assignee'] + end + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'modified_by') + self.modified_by = attributes[:'modified_by'] + end + + if attributes.key?(:'project') + self.project = attributes[:'project'] + end + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + assignee == o.assignee && + created_by == o.created_by && + modified_by == o.modified_by && + project == o.project + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [assignee, created_by, modified_by, project].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/case_resource_type.rb b/lib/datadog_api_client/v2/models/case_resource_type.rb new file mode 100644 index 000000000000..967786b108fa --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_resource_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case resource type + class CaseResourceType + include BaseEnumModel + + CASE = "case".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/case_response.rb b/lib/datadog_api_client/v2/models/case_response.rb new file mode 100644 index 000000000000..e83ffcf71b05 --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_response.rb @@ -0,0 +1,80 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case response + class CaseResponse + include BaseGenericModel + + # A case + attr_accessor :data + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Case' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CaseResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CaseResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/case_sortable_field.rb b/lib/datadog_api_client/v2/models/case_sortable_field.rb new file mode 100644 index 000000000000..98d7ef6859de --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_sortable_field.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case field that can be sorted on + class CaseSortableField + include BaseEnumModel + + CREATED_AT = "created_at".freeze + PRIORITY = "priority".freeze + STATUS = "status".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/case_status.rb b/lib/datadog_api_client/v2/models/case_status.rb new file mode 100644 index 000000000000..ebbe55a6c3b6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_status.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case status + class CaseStatus + include BaseEnumModel + + OPEN = "OPEN".freeze + IN_PROGRESS = "IN_PROGRESS".freeze + CLOSED = "CLOSED".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/case_type.rb b/lib/datadog_api_client/v2/models/case_type.rb new file mode 100644 index 000000000000..d015a34b7d46 --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case type + class CaseType + include BaseEnumModel + + STANDARD = "STANDARD".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/case_update_priority.rb b/lib/datadog_api_client/v2/models/case_update_priority.rb new file mode 100644 index 000000000000..9cde453c6e6b --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_update_priority.rb @@ -0,0 +1,119 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case priority status + class CaseUpdatePriority + include BaseGenericModel + + # Case update priority attributes + attr_reader :attributes + + # Case resource type + attr_reader :type + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'CaseUpdatePriorityAttributes', + :'type' => :'CaseResourceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CaseUpdatePriority` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CaseUpdatePriority`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/case_update_priority_attributes.rb b/lib/datadog_api_client/v2/models/case_update_priority_attributes.rb new file mode 100644 index 000000000000..f6fef912a8c8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_update_priority_attributes.rb @@ -0,0 +1,98 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case update priority attributes + class CaseUpdatePriorityAttributes + include BaseGenericModel + + # Case priority + attr_reader :priority + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'priority' => :'priority' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'priority' => :'CasePriority' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CaseUpdatePriorityAttributes` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CaseUpdatePriorityAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @priority.nil? + true + end + + # Custom attribute writer method with validation + # @param priority [Object] Object to be assigned + # @!visibility private + def priority=(priority) + if priority.nil? + fail ArgumentError, 'invalid value for "priority", priority cannot be nil.' + end + @priority = priority + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + priority == o.priority + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [priority].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/case_update_priority_request.rb b/lib/datadog_api_client/v2/models/case_update_priority_request.rb new file mode 100644 index 000000000000..552d33f7b5d5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_update_priority_request.rb @@ -0,0 +1,98 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case update priority request + class CaseUpdatePriorityRequest + include BaseGenericModel + + # Case priority status + attr_reader :data + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'CaseUpdatePriority' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CaseUpdatePriorityRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CaseUpdatePriorityRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/case_update_status.rb b/lib/datadog_api_client/v2/models/case_update_status.rb new file mode 100644 index 000000000000..df8e2a94de3c --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_update_status.rb @@ -0,0 +1,119 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case update status + class CaseUpdateStatus + include BaseGenericModel + + # Case update status attributes + attr_reader :attributes + + # Case resource type + attr_reader :type + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'CaseUpdateStatusAttributes', + :'type' => :'CaseResourceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CaseUpdateStatus` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CaseUpdateStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/case_update_status_attributes.rb b/lib/datadog_api_client/v2/models/case_update_status_attributes.rb new file mode 100644 index 000000000000..26c79058fd87 --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_update_status_attributes.rb @@ -0,0 +1,98 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case update status attributes + class CaseUpdateStatusAttributes + include BaseGenericModel + + # Case status + attr_reader :status + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'status' => :'CaseStatus' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CaseUpdateStatusAttributes` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CaseUpdateStatusAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @status.nil? + true + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + status == o.status + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [status].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/case_update_status_request.rb b/lib/datadog_api_client/v2/models/case_update_status_request.rb new file mode 100644 index 000000000000..baf36077c75a --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_update_status_request.rb @@ -0,0 +1,98 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case update status request + class CaseUpdateStatusRequest + include BaseGenericModel + + # Case update status + attr_reader :data + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'CaseUpdateStatus' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CaseUpdateStatusRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CaseUpdateStatusRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/cases_response.rb b/lib/datadog_api_client/v2/models/cases_response.rb new file mode 100644 index 000000000000..94f9c0dfbe5f --- /dev/null +++ b/lib/datadog_api_client/v2/models/cases_response.rb @@ -0,0 +1,92 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with cases + class CasesResponse + include BaseGenericModel + + # Cases response data + attr_accessor :data + + # Cases response metadata + attr_accessor :meta + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'CasesResponseMeta' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CasesResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CasesResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/cases_response_meta.rb b/lib/datadog_api_client/v2/models/cases_response_meta.rb new file mode 100644 index 000000000000..81e9b4bc51ea --- /dev/null +++ b/lib/datadog_api_client/v2/models/cases_response_meta.rb @@ -0,0 +1,80 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Cases response metadata + class CasesResponseMeta + include BaseGenericModel + + # Pagination metadata + attr_accessor :page + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'page' => :'page' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'page' => :'CasesResponseMetaPagination' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CasesResponseMeta` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CasesResponseMeta`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'page') + self.page = attributes[:'page'] + end + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + page == o.page + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [page].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/cases_response_meta_pagination.rb b/lib/datadog_api_client/v2/models/cases_response_meta_pagination.rb new file mode 100644 index 000000000000..d02c834fda7e --- /dev/null +++ b/lib/datadog_api_client/v2/models/cases_response_meta_pagination.rb @@ -0,0 +1,100 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Pagination metadata + class CasesResponseMetaPagination + include BaseGenericModel + + # Current page number + attr_accessor :current + + # Number of cases in current page + attr_accessor :size + + # Total number of pages + attr_accessor :total + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'current' => :'current', + :'size' => :'size', + :'total' => :'total' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'current' => :'Integer', + :'size' => :'Integer', + :'total' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CasesResponseMetaPagination` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CasesResponseMetaPagination`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'current') + self.current = attributes[:'current'] + end + + if attributes.key?(:'size') + self.size = attributes[:'size'] + end + + if attributes.key?(:'total') + self.total = attributes[:'total'] + end + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + current == o.current && + size == o.size && + total == o.total + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [current, size, total].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/jira_issue.rb b/lib/datadog_api_client/v2/models/jira_issue.rb new file mode 100644 index 000000000000..6c16cb6a3f3e --- /dev/null +++ b/lib/datadog_api_client/v2/models/jira_issue.rb @@ -0,0 +1,90 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Jira issue attached to case + class JiraIssue + include BaseGenericModel + + # Jira issue information + attr_accessor :result + + # Case status + attr_accessor :status + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'result' => :'result', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'result' => :'JiraIssueResult', + :'status' => :'Case3rdPartyTicketStatus' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::JiraIssue` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::JiraIssue`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'result') + self.result = attributes[:'result'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + result == o.result && + status == o.status + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [result, status].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/jira_issue_result.rb b/lib/datadog_api_client/v2/models/jira_issue_result.rb new file mode 100644 index 000000000000..ef3a1c245a86 --- /dev/null +++ b/lib/datadog_api_client/v2/models/jira_issue_result.rb @@ -0,0 +1,110 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Jira issue information + class JiraIssueResult + include BaseGenericModel + + # Jira issue ID + attr_accessor :issue_id + + # Jira issue key + attr_accessor :issue_key + + # Jira issue URL + attr_accessor :issue_url + + # Jira project key + attr_accessor :project_key + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'issue_id' => :'issue_id', + :'issue_key' => :'issue_key', + :'issue_url' => :'issue_url', + :'project_key' => :'project_key' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'issue_id' => :'String', + :'issue_key' => :'String', + :'issue_url' => :'String', + :'project_key' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::JiraIssueResult` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::JiraIssueResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'issue_id') + self.issue_id = attributes[:'issue_id'] + end + + if attributes.key?(:'issue_key') + self.issue_key = attributes[:'issue_key'] + end + + if attributes.key?(:'issue_url') + self.issue_url = attributes[:'issue_url'] + end + + if attributes.key?(:'project_key') + self.project_key = attributes[:'project_key'] + end + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + issue_id == o.issue_id && + issue_key == o.issue_key && + issue_url == o.issue_url && + project_key == o.project_key + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [issue_id, issue_key, issue_url, project_key].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/nullable_user_relationship.rb b/lib/datadog_api_client/v2/models/nullable_user_relationship.rb new file mode 100644 index 000000000000..f1cfffa58227 --- /dev/null +++ b/lib/datadog_api_client/v2/models/nullable_user_relationship.rb @@ -0,0 +1,88 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship to user. + class NullableUserRelationship + include BaseGenericModel + + # Relationship to user object. + attr_accessor :data + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'NullableUserRelationshipData' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'data', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::NullableUserRelationship` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::NullableUserRelationship`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/nullable_user_relationship_data.rb b/lib/datadog_api_client/v2/models/nullable_user_relationship_data.rb new file mode 100644 index 000000000000..e69e8cfd1472 --- /dev/null +++ b/lib/datadog_api_client/v2/models/nullable_user_relationship_data.rb @@ -0,0 +1,119 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship to user object. + class NullableUserRelationshipData + include BaseGenericModel + + # A unique identifier that represents the user. + attr_reader :id + + # User resource type. + attr_reader :type + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'UserResourceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::NullableUserRelationshipData` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::NullableUserRelationshipData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/project.rb b/lib/datadog_api_client/v2/models/project.rb new file mode 100644 index 000000000000..72bf895273d0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/project.rb @@ -0,0 +1,150 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A Project + class Project + include BaseGenericModel + + # Project attributes + attr_reader :attributes + + # The Project's identifier + attr_reader :id + + # Project relationships + attr_accessor :relationships + + # Project resource type + attr_reader :type + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ProjectAttributes', + :'id' => :'String', + :'relationships' => :'ProjectRelationships', + :'type' => :'ProjectResourceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::Project` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::Project`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/project_attributes.rb b/lib/datadog_api_client/v2/models/project_attributes.rb new file mode 100644 index 000000000000..b72a7cb852de --- /dev/null +++ b/lib/datadog_api_client/v2/models/project_attributes.rb @@ -0,0 +1,90 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Project attributes + class ProjectAttributes + include BaseGenericModel + + # The project's key + attr_accessor :key + + # Project's name + attr_accessor :name + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'key' => :'key', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'key' => :'String', + :'name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProjectAttributes` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::ProjectAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'key') + self.key = attributes[:'key'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + key == o.key && + name == o.name + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [key, name].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/project_create.rb b/lib/datadog_api_client/v2/models/project_create.rb new file mode 100644 index 000000000000..a65457e47b95 --- /dev/null +++ b/lib/datadog_api_client/v2/models/project_create.rb @@ -0,0 +1,119 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Project create + class ProjectCreate + include BaseGenericModel + + # Project creation attributes + attr_reader :attributes + + # Project resource type + attr_reader :type + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ProjectCreateAttributes', + :'type' => :'ProjectResourceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProjectCreate` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::ProjectCreate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/project_create_attributes.rb b/lib/datadog_api_client/v2/models/project_create_attributes.rb new file mode 100644 index 000000000000..e09b498c32e4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/project_create_attributes.rb @@ -0,0 +1,119 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Project creation attributes + class ProjectCreateAttributes + include BaseGenericModel + + # Project's key. Cannot be "CASE" + attr_reader :key + + # name + attr_reader :name + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'key' => :'key', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'key' => :'String', + :'name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProjectCreateAttributes` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::ProjectCreateAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'key') + self.key = attributes[:'key'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @key.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param key [Object] Object to be assigned + # @!visibility private + def key=(key) + if key.nil? + fail ArgumentError, 'invalid value for "key", key cannot be nil.' + end + @key = key + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + key == o.key && + name == o.name + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [key, name].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/project_create_request.rb b/lib/datadog_api_client/v2/models/project_create_request.rb new file mode 100644 index 000000000000..76f6bee87fcd --- /dev/null +++ b/lib/datadog_api_client/v2/models/project_create_request.rb @@ -0,0 +1,98 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Project create request + class ProjectCreateRequest + include BaseGenericModel + + # Project create + attr_reader :data + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ProjectCreate' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProjectCreateRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::ProjectCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/project_relationship.rb b/lib/datadog_api_client/v2/models/project_relationship.rb new file mode 100644 index 000000000000..5330d3b53cdb --- /dev/null +++ b/lib/datadog_api_client/v2/models/project_relationship.rb @@ -0,0 +1,98 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship to project + class ProjectRelationship + include BaseGenericModel + + # Relationship to project object + attr_reader :data + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ProjectRelationshipData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProjectRelationship` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::ProjectRelationship`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/project_relationship_data.rb b/lib/datadog_api_client/v2/models/project_relationship_data.rb new file mode 100644 index 000000000000..f6ed14822567 --- /dev/null +++ b/lib/datadog_api_client/v2/models/project_relationship_data.rb @@ -0,0 +1,119 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship to project object + class ProjectRelationshipData + include BaseGenericModel + + # A unique identifier that represents the project + attr_reader :id + + # Project resource type + attr_reader :type + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'ProjectResourceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProjectRelationshipData` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::ProjectRelationshipData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/project_relationships.rb b/lib/datadog_api_client/v2/models/project_relationships.rb new file mode 100644 index 000000000000..74dc7ddc09bb --- /dev/null +++ b/lib/datadog_api_client/v2/models/project_relationships.rb @@ -0,0 +1,90 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Project relationships + class ProjectRelationships + include BaseGenericModel + + # Relationship between a team and a team link + attr_accessor :member_team + + # Relationship to users. + attr_accessor :member_user + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'member_team' => :'member_team', + :'member_user' => :'member_user' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'member_team' => :'RelationshipToTeamLinks', + :'member_user' => :'UsersRelationship' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProjectRelationships` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::ProjectRelationships`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'member_team') + self.member_team = attributes[:'member_team'] + end + + if attributes.key?(:'member_user') + self.member_user = attributes[:'member_user'] + end + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + member_team == o.member_team && + member_user == o.member_user + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [member_team, member_user].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/project_resource_type.rb b/lib/datadog_api_client/v2/models/project_resource_type.rb new file mode 100644 index 000000000000..aefce12d059d --- /dev/null +++ b/lib/datadog_api_client/v2/models/project_resource_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Project resource type + class ProjectResourceType + include BaseEnumModel + + PROJECT = "project".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/project_response.rb b/lib/datadog_api_client/v2/models/project_response.rb new file mode 100644 index 000000000000..f59cc54805de --- /dev/null +++ b/lib/datadog_api_client/v2/models/project_response.rb @@ -0,0 +1,80 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Project response + class ProjectResponse + include BaseGenericModel + + # A Project + attr_accessor :data + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Project' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProjectResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::ProjectResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/projects_response.rb b/lib/datadog_api_client/v2/models/projects_response.rb new file mode 100644 index 000000000000..f6bb1ee0539e --- /dev/null +++ b/lib/datadog_api_client/v2/models/projects_response.rb @@ -0,0 +1,82 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with projects + class ProjectsResponse + include BaseGenericModel + + # Projects response data + attr_accessor :data + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProjectsResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::ProjectsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_ticket.rb b/lib/datadog_api_client/v2/models/service_now_ticket.rb new file mode 100644 index 000000000000..b6cef1a4e26f --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_ticket.rb @@ -0,0 +1,90 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # ServiceNow ticket attached to case + class ServiceNowTicket + include BaseGenericModel + + # ServiceNow ticket information + attr_accessor :result + + # Case status + attr_accessor :status + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'result' => :'result', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'result' => :'ServiceNowTicketResult', + :'status' => :'Case3rdPartyTicketStatus' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceNowTicket` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::ServiceNowTicket`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'result') + self.result = attributes[:'result'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + result == o.result && + status == o.status + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [result, status].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_now_ticket_result.rb b/lib/datadog_api_client/v2/models/service_now_ticket_result.rb new file mode 100644 index 000000000000..d59d9b9941ea --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_now_ticket_result.rb @@ -0,0 +1,80 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # ServiceNow ticket information + class ServiceNowTicketResult + include BaseGenericModel + + # Link to the Incident created on ServiceNow + attr_accessor :sys_target_link + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'sys_target_link' => :'sys_target_link' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'sys_target_link' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceNowTicketResult` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::ServiceNowTicketResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'sys_target_link') + self.sys_target_link = attributes[:'sys_target_link'] + end + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + sys_target_link == o.sys_target_link + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [sys_target_link].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/user_relationship_data.rb b/lib/datadog_api_client/v2/models/user_relationship_data.rb new file mode 100644 index 000000000000..86ea0cd21af3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_relationship_data.rb @@ -0,0 +1,119 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship to user object. + class UserRelationshipData + include BaseGenericModel + + # A unique identifier that represents the user. + attr_reader :id + + # User resource type. + attr_reader :type + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'UserResourceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UserRelationshipData` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::UserRelationshipData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/user_resource_type.rb b/lib/datadog_api_client/v2/models/user_resource_type.rb new file mode 100644 index 000000000000..037b131b7568 --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_resource_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # User resource type. + class UserResourceType + include BaseEnumModel + + USER = "user".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/users_relationship.rb b/lib/datadog_api_client/v2/models/users_relationship.rb new file mode 100644 index 000000000000..e2258ebd7dbc --- /dev/null +++ b/lib/datadog_api_client/v2/models/users_relationship.rb @@ -0,0 +1,100 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship to users. + class UsersRelationship + include BaseGenericModel + + # Relationships to user objects. + attr_reader :data + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UsersRelationship` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::UsersRelationship`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end