diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 147e01bf6b9..dd99f81d892 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -28876,6 +28876,27 @@ components: x-enum-varnames: - USERS - ATTACHMENTS + IncidentRelationshipData: + description: Incident relationship data + properties: + id: + description: Incident identifier + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + $ref: '#/components/schemas/IncidentResourceType' + required: + - type + - id + type: object + IncidentResourceType: + description: Incident resource type + enum: + - incidents + example: incidents + type: string + x-enum-varnames: + - INCIDENTS IncidentRespondersType: description: The incident responders type. enum: @@ -31569,6 +31590,87 @@ components: $ref: '#/components/schemas/Case3rdPartyTicketStatus' readOnly: true type: object + JiraIssueCreateAttributes: + description: Jira issue creation attributes + properties: + fields: + additionalProperties: {} + description: Additional Jira fields + example: {} + type: object + issue_type_id: + description: Jira issue type ID + example: '10001' + type: string + jira_account_id: + description: Jira account ID + example: '1234' + type: string + project_id: + description: Jira project ID + example: '5678' + type: string + required: + - jira_account_id + - project_id + - issue_type_id + type: object + JiraIssueCreateData: + description: Jira issue creation data + properties: + attributes: + $ref: '#/components/schemas/JiraIssueCreateAttributes' + type: + $ref: '#/components/schemas/JiraIssueResourceType' + required: + - type + - attributes + type: object + JiraIssueCreateRequest: + description: Jira issue creation request + properties: + data: + $ref: '#/components/schemas/JiraIssueCreateData' + required: + - data + type: object + JiraIssueLinkAttributes: + description: Jira issue link attributes + properties: + jira_issue_url: + description: URL of the Jira issue + example: https://jira.example.com/browse/PROJ-123 + type: string + required: + - jira_issue_url + type: object + JiraIssueLinkData: + description: Jira issue link data + properties: + attributes: + $ref: '#/components/schemas/JiraIssueLinkAttributes' + type: + $ref: '#/components/schemas/JiraIssueResourceType' + required: + - type + - attributes + type: object + JiraIssueLinkRequest: + description: Jira issue link request + properties: + data: + $ref: '#/components/schemas/JiraIssueLinkData' + required: + - data + type: object + JiraIssueResourceType: + description: Jira issue resource type + enum: + - issues + example: issues + type: string + x-enum-varnames: + - ISSUES JiraIssueResult: description: Jira issue information properties: @@ -36989,6 +37091,30 @@ components: meta: $ref: '#/components/schemas/MonthlyCostAttributionMeta' type: object + NotebookCreateData: + description: Notebook creation data + properties: + type: + $ref: '#/components/schemas/NotebookResourceType' + required: + - type + type: object + NotebookCreateRequest: + description: Notebook creation request + properties: + data: + $ref: '#/components/schemas/NotebookCreateData' + required: + - data + type: object + NotebookResourceType: + description: Notebook resource type + enum: + - notebook + example: notebook + type: string + x-enum-varnames: + - NOTEBOOK NotebookTriggerWrapper: description: Schema for a Notebook-based trigger. properties: @@ -46606,6 +46732,14 @@ components: - id - type type: object + RelationshipToIncidentRequest: + description: Relationship to incident request + properties: + data: + $ref: '#/components/schemas/IncidentRelationshipData' + required: + - data + type: object RelationshipToIncidentResponderData: description: Relationship to impact object. properties: @@ -56613,6 +56747,47 @@ components: $ref: '#/components/schemas/Case3rdPartyTicketStatus' readOnly: true type: object + ServiceNowTicketCreateAttributes: + description: ServiceNow ticket creation attributes + properties: + assignment_group: + description: ServiceNow assignment group + example: IT Support + type: string + instance_name: + description: ServiceNow instance name + example: my-instance + type: string + required: + - instance_name + type: object + ServiceNowTicketCreateData: + description: ServiceNow ticket creation data + properties: + attributes: + $ref: '#/components/schemas/ServiceNowTicketCreateAttributes' + type: + $ref: '#/components/schemas/ServiceNowTicketResourceType' + required: + - type + - attributes + type: object + ServiceNowTicketCreateRequest: + description: ServiceNow ticket creation request + properties: + data: + $ref: '#/components/schemas/ServiceNowTicketCreateData' + required: + - data + type: object + ServiceNowTicketResourceType: + description: ServiceNow ticket resource type + enum: + - tickets + example: tickets + type: string + x-enum-varnames: + - TICKETS ServiceNowTicketResult: description: ServiceNow ticket information properties: @@ -70074,6 +70249,382 @@ paths: summary: Update case priority tags: - Case Management + /api/v2/cases/{case_id}/relationships/incidents: + post: + description: Link an incident to a case + operationId: LinkIncident + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RelationshipToIncidentRequest' + description: Incident link request + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/CaseResponse' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Link incident to case + tags: + - Case Management + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/cases/{case_id}/relationships/jira_issues: + delete: + description: Remove the link between a Jira issue and a case + operationId: UnlinkJiraIssue + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Remove Jira issue link from case + tags: + - Case Management + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + patch: + description: Link an existing Jira issue to a case + operationId: LinkJiraIssueToCase + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/JiraIssueLinkRequest' + description: Jira issue link request + required: true + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Conflict + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Link existing Jira issue to case + tags: + - Case Management + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Create a new Jira issue and link it to a case + operationId: CreateCaseJiraIssue + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/JiraIssueCreateRequest' + description: Jira issue creation request + required: true + responses: + '202': + description: Accepted + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Create Jira issue for case + tags: + - Case Management + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/cases/{case_id}/relationships/notebook: + post: + description: Create a new investigation notebook and link it to a case + operationId: CreateCaseNotebook + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NotebookCreateRequest' + description: Notebook creation request + required: true + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Create investigation notebook for case + tags: + - Case Management + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/cases/{case_id}/relationships/project: + patch: + description: Update the project associated with a case + operationId: MoveCaseToProject + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectRelationship' + description: Project update request + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CaseResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Update case project + tags: + - Case Management + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/cases/{case_id}/relationships/servicenow_tickets: + post: + description: Create a new ServiceNow incident ticket and link it to a case + operationId: CreateCaseServiceNowTicket + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceNowTicketCreateRequest' + description: ServiceNow ticket creation request + required: true + responses: + '202': + description: Accepted + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Create ServiceNow ticket for case + tags: + - Case Management + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/cases/{case_id}/status: post: description: Update case status diff --git a/examples/v2/case-management/CreateCaseJiraIssue.java b/examples/v2/case-management/CreateCaseJiraIssue.java new file mode 100644 index 00000000000..bf7d1c30d91 --- /dev/null +++ b/examples/v2/case-management/CreateCaseJiraIssue.java @@ -0,0 +1,40 @@ +// Create Jira issue for case returns "Accepted" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CaseManagementApi; +import com.datadog.api.client.v2.model.JiraIssueCreateAttributes; +import com.datadog.api.client.v2.model.JiraIssueCreateData; +import com.datadog.api.client.v2.model.JiraIssueCreateRequest; +import com.datadog.api.client.v2.model.JiraIssueResourceType; +import java.util.Map; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createCaseJiraIssue", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + JiraIssueCreateRequest body = + new JiraIssueCreateRequest() + .data( + new JiraIssueCreateData() + .attributes( + new JiraIssueCreateAttributes() + .fields(Map.ofEntries()) + .issueTypeId("10001") + .jiraAccountId("1234") + .projectId("5678")) + .type(JiraIssueResourceType.ISSUES)); + + try { + apiInstance.createCaseJiraIssue("f98a5a5b-e0ff-45d4-b2f5-afe6e74de504", body); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#createCaseJiraIssue"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/CreateCaseNotebook.java b/examples/v2/case-management/CreateCaseNotebook.java new file mode 100644 index 00000000000..694c812116e --- /dev/null +++ b/examples/v2/case-management/CreateCaseNotebook.java @@ -0,0 +1,30 @@ +// Create investigation notebook for case returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CaseManagementApi; +import com.datadog.api.client.v2.model.NotebookCreateData; +import com.datadog.api.client.v2.model.NotebookCreateRequest; +import com.datadog.api.client.v2.model.NotebookResourceType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createCaseNotebook", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + NotebookCreateRequest body = + new NotebookCreateRequest() + .data(new NotebookCreateData().type(NotebookResourceType.NOTEBOOK)); + + try { + apiInstance.createCaseNotebook("f98a5a5b-e0ff-45d4-b2f5-afe6e74de504", body); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#createCaseNotebook"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/CreateCaseServiceNowTicket.java b/examples/v2/case-management/CreateCaseServiceNowTicket.java new file mode 100644 index 00000000000..905163f0c32 --- /dev/null +++ b/examples/v2/case-management/CreateCaseServiceNowTicket.java @@ -0,0 +1,37 @@ +// Create ServiceNow ticket for case returns "Accepted" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CaseManagementApi; +import com.datadog.api.client.v2.model.ServiceNowTicketCreateAttributes; +import com.datadog.api.client.v2.model.ServiceNowTicketCreateData; +import com.datadog.api.client.v2.model.ServiceNowTicketCreateRequest; +import com.datadog.api.client.v2.model.ServiceNowTicketResourceType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createCaseServiceNowTicket", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + ServiceNowTicketCreateRequest body = + new ServiceNowTicketCreateRequest() + .data( + new ServiceNowTicketCreateData() + .attributes( + new ServiceNowTicketCreateAttributes() + .assignmentGroup("IT Support") + .instanceName("my-instance")) + .type(ServiceNowTicketResourceType.TICKETS)); + + try { + apiInstance.createCaseServiceNowTicket("f98a5a5b-e0ff-45d4-b2f5-afe6e74de504", body); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#createCaseServiceNowTicket"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/LinkIncident.java b/examples/v2/case-management/LinkIncident.java new file mode 100644 index 00000000000..3e50c4ed999 --- /dev/null +++ b/examples/v2/case-management/LinkIncident.java @@ -0,0 +1,35 @@ +// Link incident to case returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CaseManagementApi; +import com.datadog.api.client.v2.model.CaseResponse; +import com.datadog.api.client.v2.model.IncidentRelationshipData; +import com.datadog.api.client.v2.model.IncidentResourceType; +import com.datadog.api.client.v2.model.RelationshipToIncidentRequest; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.linkIncident", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + RelationshipToIncidentRequest body = + new RelationshipToIncidentRequest() + .data( + new IncidentRelationshipData() + .id("00000000-0000-0000-0000-000000000000") + .type(IncidentResourceType.INCIDENTS)); + + try { + CaseResponse result = apiInstance.linkIncident("f98a5a5b-e0ff-45d4-b2f5-afe6e74de504", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#linkIncident"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/LinkJiraIssueToCase.java b/examples/v2/case-management/LinkJiraIssueToCase.java new file mode 100644 index 00000000000..5f543fe8262 --- /dev/null +++ b/examples/v2/case-management/LinkJiraIssueToCase.java @@ -0,0 +1,36 @@ +// Link existing Jira issue to case returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CaseManagementApi; +import com.datadog.api.client.v2.model.JiraIssueLinkAttributes; +import com.datadog.api.client.v2.model.JiraIssueLinkData; +import com.datadog.api.client.v2.model.JiraIssueLinkRequest; +import com.datadog.api.client.v2.model.JiraIssueResourceType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.linkJiraIssueToCase", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + JiraIssueLinkRequest body = + new JiraIssueLinkRequest() + .data( + new JiraIssueLinkData() + .attributes( + new JiraIssueLinkAttributes() + .jiraIssueUrl("https://jira.example.com/browse/PROJ-123")) + .type(JiraIssueResourceType.ISSUES)); + + try { + apiInstance.linkJiraIssueToCase("f98a5a5b-e0ff-45d4-b2f5-afe6e74de504", body); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#linkJiraIssueToCase"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/MoveCaseToProject.java b/examples/v2/case-management/MoveCaseToProject.java new file mode 100644 index 00000000000..007cc613800 --- /dev/null +++ b/examples/v2/case-management/MoveCaseToProject.java @@ -0,0 +1,36 @@ +// Update case project returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CaseManagementApi; +import com.datadog.api.client.v2.model.CaseResponse; +import com.datadog.api.client.v2.model.ProjectRelationship; +import com.datadog.api.client.v2.model.ProjectRelationshipData; +import com.datadog.api.client.v2.model.ProjectResourceType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.moveCaseToProject", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + ProjectRelationship body = + new ProjectRelationship() + .data( + new ProjectRelationshipData() + .id("e555e290-ed65-49bd-ae18-8acbfcf18db7") + .type(ProjectResourceType.PROJECT)); + + try { + CaseResponse result = + apiInstance.moveCaseToProject("f98a5a5b-e0ff-45d4-b2f5-afe6e74de504", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#moveCaseToProject"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/UnlinkJiraIssue.java b/examples/v2/case-management/UnlinkJiraIssue.java new file mode 100644 index 00000000000..73f8d021ca6 --- /dev/null +++ b/examples/v2/case-management/UnlinkJiraIssue.java @@ -0,0 +1,23 @@ +// Remove Jira issue link from case returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CaseManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.unlinkJiraIssue", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + apiInstance.unlinkJiraIssue("f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#unlinkJiraIssue"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index e18ff8356b4..aa40957ac77 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -775,6 +775,13 @@ public class ApiClient { put("v2.getOpenAPI", false); put("v2.listAPIs", false); put("v2.updateOpenAPI", false); + put("v2.createCaseJiraIssue", false); + put("v2.createCaseNotebook", false); + put("v2.createCaseServiceNowTicket", false); + put("v2.linkIncident", false); + put("v2.linkJiraIssueToCase", false); + put("v2.moveCaseToProject", false); + put("v2.unlinkJiraIssue", false); put("v2.cancelThreatHuntingJob", false); put("v2.convertJobResultToSignal", false); put("v2.deleteThreatHuntingJob", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/CaseManagementApi.java b/src/main/java/com/datadog/api/client/v2/api/CaseManagementApi.java index 5143d6939ab..704783d578f 100644 --- a/src/main/java/com/datadog/api/client/v2/api/CaseManagementApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/CaseManagementApi.java @@ -19,9 +19,15 @@ import com.datadog.api.client.v2.model.CaseUpdateStatusRequest; import com.datadog.api.client.v2.model.CaseUpdateTitleRequest; import com.datadog.api.client.v2.model.CasesResponse; +import com.datadog.api.client.v2.model.JiraIssueCreateRequest; +import com.datadog.api.client.v2.model.JiraIssueLinkRequest; +import com.datadog.api.client.v2.model.NotebookCreateRequest; import com.datadog.api.client.v2.model.ProjectCreateRequest; +import com.datadog.api.client.v2.model.ProjectRelationship; import com.datadog.api.client.v2.model.ProjectResponse; import com.datadog.api.client.v2.model.ProjectsResponse; +import com.datadog.api.client.v2.model.RelationshipToIncidentRequest; +import com.datadog.api.client.v2.model.ServiceNowTicketCreateRequest; import com.datadog.api.client.v2.model.TimelineResponse; import jakarta.ws.rs.client.Invocation; import jakarta.ws.rs.core.GenericType; @@ -657,28 +663,30 @@ public CompletableFuture> createCaseWithHttpInfoAsync( } /** - * Create a project. + * Create Jira issue for case. * - *

See {@link #createProjectWithHttpInfo}. + *

See {@link #createCaseJiraIssueWithHttpInfo}. * - * @param body Project payload (required) - * @return ProjectResponse + * @param caseId Case's UUID or key (required) + * @param body Jira issue creation request (required) * @throws ApiException if fails to make API call */ - public ProjectResponse createProject(ProjectCreateRequest body) throws ApiException { - return createProjectWithHttpInfo(body).getData(); + public void createCaseJiraIssue(String caseId, JiraIssueCreateRequest body) throws ApiException { + createCaseJiraIssueWithHttpInfo(caseId, body); } /** - * Create a project. + * Create Jira issue for case. * - *

See {@link #createProjectWithHttpInfoAsync}. + *

See {@link #createCaseJiraIssueWithHttpInfoAsync}. * - * @param body Project payload (required) - * @return CompletableFuture<ProjectResponse> + * @param caseId Case's UUID or key (required) + * @param body Jira issue creation request (required) + * @return CompletableFuture */ - public CompletableFuture createProjectAsync(ProjectCreateRequest body) { - return createProjectWithHttpInfoAsync(body) + public CompletableFuture createCaseJiraIssueAsync( + String caseId, JiraIssueCreateRequest body) { + return createCaseJiraIssueWithHttpInfoAsync(caseId, body) .thenApply( response -> { return response.getData(); @@ -686,16 +694,17 @@ public CompletableFuture createProjectAsync(ProjectCreateReques } /** - * Create a project. + * Create a new Jira issue and link it to a case * - * @param body Project payload (required) - * @return ApiResponse<ProjectResponse> + * @param caseId Case's UUID or key (required) + * @param body Jira issue creation request (required) + * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * * @@ -703,28 +712,43 @@ public CompletableFuture createProjectAsync(ProjectCreateReques * *
Response details
Status Code Description Response Headers
201 CREATED -
202 Accepted -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
*/ - public ApiResponse createProjectWithHttpInfo(ProjectCreateRequest body) - throws ApiException { + public ApiResponse createCaseJiraIssueWithHttpInfo( + String caseId, JiraIssueCreateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "createCaseJiraIssue"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } Object localVarPostBody = body; + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling createCaseJiraIssue"); + } + // verify the required parameter 'body' is set if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling createProject"); + 400, "Missing the required parameter 'body' when calling createCaseJiraIssue"); } // create path and map variables - String localVarPath = "/api/v2/cases/projects"; + String localVarPath = + "/api/v2/cases/{case_id}/relationships/jira_issues" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.createProject", + "v2.CaseManagementApi.createCaseJiraIssue", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, + new String[] {"*/*"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( "POST", @@ -734,31 +758,53 @@ public ApiResponse createProjectWithHttpInfo(ProjectCreateReque localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Create a project. + * Create Jira issue for case. * - *

See {@link #createProjectWithHttpInfo}. + *

See {@link #createCaseJiraIssueWithHttpInfo}. * - * @param body Project payload (required) - * @return CompletableFuture<ApiResponse<ProjectResponse>> + * @param caseId Case's UUID or key (required) + * @param body Jira issue creation request (required) + * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> createProjectWithHttpInfoAsync( - ProjectCreateRequest body) { + public CompletableFuture> createCaseJiraIssueWithHttpInfoAsync( + String caseId, JiraIssueCreateRequest body) { + // Check if unstable operation is enabled + String operationId = "createCaseJiraIssue"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = body; + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'caseId' when calling createCaseJiraIssue")); + return result; + } + // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'body' when calling createProject")); + 400, "Missing the required parameter 'body' when calling createCaseJiraIssue")); return result; } // create path and map variables - String localVarPath = "/api/v2/cases/projects"; + String localVarPath = + "/api/v2/cases/{case_id}/relationships/jira_issues" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); @@ -766,15 +812,15 @@ public CompletableFuture> createProjectWithHttpInfo try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.createProject", + "v2.CaseManagementApi.createCaseJiraIssue", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, + new String[] {"*/*"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -786,33 +832,34 @@ public CompletableFuture> createProjectWithHttpInfo localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Delete case comment. + * Create investigation notebook for case. * - *

See {@link #deleteCaseCommentWithHttpInfo}. + *

See {@link #createCaseNotebookWithHttpInfo}. * * @param caseId Case's UUID or key (required) - * @param cellId Timeline cell's UUID (required) + * @param body Notebook creation request (required) * @throws ApiException if fails to make API call */ - public void deleteCaseComment(String caseId, String cellId) throws ApiException { - deleteCaseCommentWithHttpInfo(caseId, cellId); + public void createCaseNotebook(String caseId, NotebookCreateRequest body) throws ApiException { + createCaseNotebookWithHttpInfo(caseId, body); } /** - * Delete case comment. + * Create investigation notebook for case. * - *

See {@link #deleteCaseCommentWithHttpInfoAsync}. + *

See {@link #createCaseNotebookWithHttpInfoAsync}. * * @param caseId Case's UUID or key (required) - * @param cellId Timeline cell's UUID (required) + * @param body Notebook creation request (required) * @return CompletableFuture */ - public CompletableFuture deleteCaseCommentAsync(String caseId, String cellId) { - return deleteCaseCommentWithHttpInfoAsync(caseId, cellId) + public CompletableFuture createCaseNotebookAsync( + String caseId, NotebookCreateRequest body) { + return createCaseNotebookWithHttpInfoAsync(caseId, body) .thenApply( response -> { return response.getData(); @@ -820,10 +867,10 @@ public CompletableFuture deleteCaseCommentAsync(String caseId, String cell } /** - * Delete case comment + * Create a new investigation notebook and link it to a case * * @param caseId Case's UUID or key (required) - * @param cellId Timeline cell's UUID (required) + * @param body Notebook creation request (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details @@ -838,43 +885,49 @@ public CompletableFuture deleteCaseCommentAsync(String caseId, String cell * 429 Too many requests - * */ - public ApiResponse deleteCaseCommentWithHttpInfo(String caseId, String cellId) + public ApiResponse createCaseNotebookWithHttpInfo(String caseId, NotebookCreateRequest body) throws ApiException { - Object localVarPostBody = null; + // Check if unstable operation is enabled + String operationId = "createCaseNotebook"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; // verify the required parameter 'caseId' is set if (caseId == null) { throw new ApiException( - 400, "Missing the required parameter 'caseId' when calling deleteCaseComment"); + 400, "Missing the required parameter 'caseId' when calling createCaseNotebook"); } - // verify the required parameter 'cellId' is set - if (cellId == null) { + // verify the required parameter 'body' is set + if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'cellId' when calling deleteCaseComment"); + 400, "Missing the required parameter 'body' when calling createCaseNotebook"); } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/comment/{cell_id}" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) - .replaceAll("\\{" + "cell_id" + "\\}", apiClient.escapeString(cellId.toString())); + "/api/v2/cases/{case_id}/relationships/notebook" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.deleteCaseComment", + "v2.CaseManagementApi.createCaseNotebook", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "DELETE", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, @@ -882,40 +935,49 @@ public ApiResponse deleteCaseCommentWithHttpInfo(String caseId, String cel } /** - * Delete case comment. + * Create investigation notebook for case. * - *

See {@link #deleteCaseCommentWithHttpInfo}. + *

See {@link #createCaseNotebookWithHttpInfo}. * * @param caseId Case's UUID or key (required) - * @param cellId Timeline cell's UUID (required) + * @param body Notebook creation request (required) * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> deleteCaseCommentWithHttpInfoAsync( - String caseId, String cellId) { - Object localVarPostBody = null; + public CompletableFuture> createCaseNotebookWithHttpInfoAsync( + String caseId, NotebookCreateRequest body) { + // Check if unstable operation is enabled + String operationId = "createCaseNotebook"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; // verify the required parameter 'caseId' is set if (caseId == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'caseId' when calling deleteCaseComment")); + 400, "Missing the required parameter 'caseId' when calling createCaseNotebook")); return result; } - // verify the required parameter 'cellId' is set - if (cellId == null) { + // verify the required parameter 'body' is set + if (body == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'cellId' when calling deleteCaseComment")); + 400, "Missing the required parameter 'body' when calling createCaseNotebook")); return result; } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/comment/{cell_id}" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) - .replaceAll("\\{" + "cell_id" + "\\}", apiClient.escapeString(cellId.toString())); + "/api/v2/cases/{case_id}/relationships/notebook" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); @@ -923,23 +985,23 @@ public CompletableFuture> deleteCaseCommentWithHttpInfoAsync( try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.deleteCaseComment", + "v2.CaseManagementApi.createCaseNotebook", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "DELETE", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, @@ -947,32 +1009,31 @@ public CompletableFuture> deleteCaseCommentWithHttpInfoAsync( } /** - * Delete custom attribute from case. + * Create ServiceNow ticket for case. * - *

See {@link #deleteCaseCustomAttributeWithHttpInfo}. + *

See {@link #createCaseServiceNowTicketWithHttpInfo}. * * @param caseId Case's UUID or key (required) - * @param customAttributeKey Case Custom attribute's key (required) - * @return CaseResponse + * @param body ServiceNow ticket creation request (required) * @throws ApiException if fails to make API call */ - public CaseResponse deleteCaseCustomAttribute(String caseId, String customAttributeKey) + public void createCaseServiceNowTicket(String caseId, ServiceNowTicketCreateRequest body) throws ApiException { - return deleteCaseCustomAttributeWithHttpInfo(caseId, customAttributeKey).getData(); + createCaseServiceNowTicketWithHttpInfo(caseId, body); } /** - * Delete custom attribute from case. + * Create ServiceNow ticket for case. * - *

See {@link #deleteCaseCustomAttributeWithHttpInfoAsync}. + *

See {@link #createCaseServiceNowTicketWithHttpInfoAsync}. * * @param caseId Case's UUID or key (required) - * @param customAttributeKey Case Custom attribute's key (required) - * @return CompletableFuture<CaseResponse> + * @param body ServiceNow ticket creation request (required) + * @return CompletableFuture */ - public CompletableFuture deleteCaseCustomAttributeAsync( - String caseId, String customAttributeKey) { - return deleteCaseCustomAttributeWithHttpInfoAsync(caseId, customAttributeKey) + public CompletableFuture createCaseServiceNowTicketAsync( + String caseId, ServiceNowTicketCreateRequest body) { + return createCaseServiceNowTicketWithHttpInfoAsync(caseId, body) .thenApply( response -> { return response.getData(); @@ -980,110 +1041,119 @@ public CompletableFuture deleteCaseCustomAttributeAsync( } /** - * Delete custom attribute from case + * Create a new ServiceNow incident ticket and link it to a case * * @param caseId Case's UUID or key (required) - * @param customAttributeKey Case Custom attribute's key (required) - * @return ApiResponse<CaseResponse> + * @param body ServiceNow ticket creation request (required) + * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * + * * * * * *
Response details
Status Code Description Response Headers
200 OK -
202 Accepted -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse deleteCaseCustomAttributeWithHttpInfo( - String caseId, String customAttributeKey) throws ApiException { - Object localVarPostBody = null; + public ApiResponse createCaseServiceNowTicketWithHttpInfo( + String caseId, ServiceNowTicketCreateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "createCaseServiceNowTicket"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; // verify the required parameter 'caseId' is set if (caseId == null) { throw new ApiException( - 400, "Missing the required parameter 'caseId' when calling deleteCaseCustomAttribute"); + 400, "Missing the required parameter 'caseId' when calling createCaseServiceNowTicket"); } - // verify the required parameter 'customAttributeKey' is set - if (customAttributeKey == null) { + // verify the required parameter 'body' is set + if (body == null) { throw new ApiException( - 400, - "Missing the required parameter 'customAttributeKey' when calling" - + " deleteCaseCustomAttribute"); + 400, "Missing the required parameter 'body' when calling createCaseServiceNowTicket"); } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) - .replaceAll( - "\\{" + "custom_attribute_key" + "\\}", - apiClient.escapeString(customAttributeKey.toString())); + "/api/v2/cases/{case_id}/relationships/servicenow_tickets" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.deleteCaseCustomAttribute", + "v2.CaseManagementApi.createCaseServiceNowTicket", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, + new String[] {"*/*"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "DELETE", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Delete custom attribute from case. + * Create ServiceNow ticket for case. * - *

See {@link #deleteCaseCustomAttributeWithHttpInfo}. + *

See {@link #createCaseServiceNowTicketWithHttpInfo}. * * @param caseId Case's UUID or key (required) - * @param customAttributeKey Case Custom attribute's key (required) - * @return CompletableFuture<ApiResponse<CaseResponse>> + * @param body ServiceNow ticket creation request (required) + * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> deleteCaseCustomAttributeWithHttpInfoAsync( - String caseId, String customAttributeKey) { - Object localVarPostBody = null; + public CompletableFuture> createCaseServiceNowTicketWithHttpInfoAsync( + String caseId, ServiceNowTicketCreateRequest body) { + // Check if unstable operation is enabled + String operationId = "createCaseServiceNowTicket"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; // verify the required parameter 'caseId' is set if (caseId == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'caseId' when calling deleteCaseCustomAttribute")); + "Missing the required parameter 'caseId' when calling createCaseServiceNowTicket")); return result; } - // verify the required parameter 'customAttributeKey' is set - if (customAttributeKey == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'customAttributeKey' when calling" - + " deleteCaseCustomAttribute")); + "Missing the required parameter 'body' when calling createCaseServiceNowTicket")); return result; } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) - .replaceAll( - "\\{" + "custom_attribute_key" + "\\}", - apiClient.escapeString(customAttributeKey.toString())); + "/api/v2/cases/{case_id}/relationships/servicenow_tickets" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); @@ -1091,51 +1161,52 @@ public CompletableFuture> deleteCaseCustomAttributeWit try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.deleteCaseCustomAttribute", + "v2.CaseManagementApi.createCaseServiceNowTicket", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, + new String[] {"*/*"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "DELETE", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Remove a project. + * Create a project. * - *

See {@link #deleteProjectWithHttpInfo}. + *

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

See {@link #deleteProjectWithHttpInfoAsync}. + *

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

See {@link #createProjectWithHttpInfo}. + * + * @param body Project payload (required) + * @return CompletableFuture<ApiResponse<ProjectResponse>> + */ + public CompletableFuture> createProjectWithHttpInfoAsync( + ProjectCreateRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createProject")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/cases/projects"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.createProject", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Delete case comment. + * + *

See {@link #deleteCaseCommentWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param cellId Timeline cell's UUID (required) + * @throws ApiException if fails to make API call + */ + public void deleteCaseComment(String caseId, String cellId) throws ApiException { + deleteCaseCommentWithHttpInfo(caseId, cellId); + } + + /** + * Delete case comment. + * + *

See {@link #deleteCaseCommentWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @param cellId Timeline cell's UUID (required) + * @return CompletableFuture + */ + public CompletableFuture deleteCaseCommentAsync(String caseId, String cellId) { + return deleteCaseCommentWithHttpInfoAsync(caseId, cellId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete case comment + * + * @param caseId Case's UUID or key (required) + * @param cellId Timeline cell's UUID (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteCaseCommentWithHttpInfo(String caseId, String cellId) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling deleteCaseComment"); + } + + // verify the required parameter 'cellId' is set + if (cellId == null) { + throw new ApiException( + 400, "Missing the required parameter 'cellId' when calling deleteCaseComment"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/comment/{cell_id}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) + .replaceAll("\\{" + "cell_id" + "\\}", apiClient.escapeString(cellId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.deleteCaseComment", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete case comment. + * + *

See {@link #deleteCaseCommentWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param cellId Timeline cell's UUID (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteCaseCommentWithHttpInfoAsync( + String caseId, String cellId) { + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'caseId' when calling deleteCaseComment")); + return result; + } + + // verify the required parameter 'cellId' is set + if (cellId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'cellId' when calling deleteCaseComment")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/comment/{cell_id}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) + .replaceAll("\\{" + "cell_id" + "\\}", apiClient.escapeString(cellId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.deleteCaseComment", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete custom attribute from case. + * + *

See {@link #deleteCaseCustomAttributeWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param customAttributeKey Case Custom attribute's key (required) + * @return CaseResponse + * @throws ApiException if fails to make API call + */ + public CaseResponse deleteCaseCustomAttribute(String caseId, String customAttributeKey) + throws ApiException { + return deleteCaseCustomAttributeWithHttpInfo(caseId, customAttributeKey).getData(); + } + + /** + * Delete custom attribute from case. + * + *

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

See {@link #deleteCaseCustomAttributeWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param customAttributeKey Case Custom attribute's key (required) + * @return CompletableFuture<ApiResponse<CaseResponse>> + */ + public CompletableFuture> deleteCaseCustomAttributeWithHttpInfoAsync( + String caseId, String customAttributeKey) { + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'caseId' when calling deleteCaseCustomAttribute")); + return result; + } + + // verify the required parameter 'customAttributeKey' is set + if (customAttributeKey == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'customAttributeKey' when calling" + + " deleteCaseCustomAttribute")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) + .replaceAll( + "\\{" + "custom_attribute_key" + "\\}", + apiClient.escapeString(customAttributeKey.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.deleteCaseCustomAttribute", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Remove a project. + * + *

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

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

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

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

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

See {@link #getCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @return CompletableFuture<ApiResponse<CaseResponse>> + */ + public CompletableFuture> getCaseWithHttpInfoAsync(String caseId) { + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'caseId' when calling getCase")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.getCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get the details of a project. + * + *

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

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

See {@link #deleteProjectWithHttpInfo}. + *

See {@link #getProjectWithHttpInfo}. * * @param projectId Project UUID (required) - * @return CompletableFuture<ApiResponse<Void>> + * @return CompletableFuture<ApiResponse<ProjectResponse>> */ - public CompletableFuture> deleteProjectWithHttpInfoAsync(String projectId) { + public CompletableFuture> getProjectWithHttpInfoAsync( + String projectId) { Object localVarPostBody = null; // verify the required parameter 'projectId' is set if (projectId == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'projectId' when calling deleteProject")); + 400, "Missing the required parameter 'projectId' when calling getProject")); return result; } // create path and map variables @@ -1223,52 +2020,168 @@ public CompletableFuture> deleteProjectWithHttpInfoAsync(Strin try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.deleteProject", + "v2.CaseManagementApi.getProject", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"*/*"}, + new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "DELETE", + "GET", builder, localVarHeaderParams, new String[] {}, localVarPostBody, new HashMap(), false, - null); + new GenericType() {}); } /** - * Get the details of a case. + * Get all projects. * - *

See {@link #getCaseWithHttpInfo}. + *

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

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

See {@link #getProjectsWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<ProjectsResponse>> + */ + public CompletableFuture> getProjectsWithHttpInfoAsync() { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/cases/projects"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.getProjects", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Link incident to case. + * + *

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

See {@link #getCaseWithHttpInfoAsync}. + *

See {@link #linkIncidentWithHttpInfoAsync}. * * @param caseId Case's UUID or key (required) + * @param body Incident link request (required) * @return CompletableFuture<CaseResponse> */ - public CompletableFuture getCaseAsync(String caseId) { - return getCaseWithHttpInfoAsync(caseId) + public CompletableFuture linkIncidentAsync( + String caseId, RelationshipToIncidentRequest body) { + return linkIncidentWithHttpInfoAsync(caseId, body) .thenApply( response -> { return response.getData(); @@ -1276,16 +2189,17 @@ public CompletableFuture getCaseAsync(String caseId) { } /** - * Get the details of case by case_id + * Link an incident to a case * * @param caseId Case's UUID or key (required) + * @param body Incident link request (required) * @return ApiResponse<CaseResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * * @@ -1293,23 +2207,38 @@ public CompletableFuture getCaseAsync(String caseId) { * *
Response details
Status Code Description Response Headers
200 OK -
201 Created -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
*/ - public ApiResponse getCaseWithHttpInfo(String caseId) throws ApiException { - Object localVarPostBody = null; + public ApiResponse linkIncidentWithHttpInfo( + String caseId, RelationshipToIncidentRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "linkIncident"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; // verify the required parameter 'caseId' is set if (caseId == null) { - throw new ApiException(400, "Missing the required parameter 'caseId' when calling getCase"); + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling linkIncident"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling linkIncident"); } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}" + "/api/v2/cases/{case_id}/relationships/incidents" .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.getCase", + "v2.CaseManagementApi.linkIncident", localVarPath, new ArrayList(), localVarHeaderParams, @@ -1317,10 +2246,10 @@ public ApiResponse getCaseWithHttpInfo(String caseId) throws ApiEx new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "GET", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, @@ -1328,26 +2257,47 @@ public ApiResponse getCaseWithHttpInfo(String caseId) throws ApiEx } /** - * Get the details of a case. + * Link incident to case. * - *

See {@link #getCaseWithHttpInfo}. + *

See {@link #linkIncidentWithHttpInfo}. * * @param caseId Case's UUID or key (required) + * @param body Incident link request (required) * @return CompletableFuture<ApiResponse<CaseResponse>> */ - public CompletableFuture> getCaseWithHttpInfoAsync(String caseId) { - Object localVarPostBody = null; + public CompletableFuture> linkIncidentWithHttpInfoAsync( + String caseId, RelationshipToIncidentRequest body) { + // Check if unstable operation is enabled + String operationId = "linkIncident"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; // verify the required parameter 'caseId' is set if (caseId == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException(400, "Missing the required parameter 'caseId' when calling getCase")); + new ApiException( + 400, "Missing the required parameter 'caseId' when calling linkIncident")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'body' when calling linkIncident")); return result; } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}" + "/api/v2/cases/{case_id}/relationships/incidents" .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); @@ -1356,7 +2306,7 @@ public CompletableFuture> getCaseWithHttpInfoAsync(Str try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.getCase", + "v2.CaseManagementApi.linkIncident", localVarPath, new ArrayList(), localVarHeaderParams, @@ -1369,10 +2319,10 @@ public CompletableFuture> getCaseWithHttpInfoAsync(Str return result; } return apiClient.invokeAPIAsync( - "GET", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, @@ -1380,28 +2330,30 @@ public CompletableFuture> getCaseWithHttpInfoAsync(Str } /** - * Get the details of a project. + * Link existing Jira issue to case. * - *

See {@link #getProjectWithHttpInfo}. + *

See {@link #linkJiraIssueToCaseWithHttpInfo}. * - * @param projectId Project UUID (required) - * @return ProjectResponse + * @param caseId Case's UUID or key (required) + * @param body Jira issue link request (required) * @throws ApiException if fails to make API call */ - public ProjectResponse getProject(String projectId) throws ApiException { - return getProjectWithHttpInfo(projectId).getData(); + public void linkJiraIssueToCase(String caseId, JiraIssueLinkRequest body) throws ApiException { + linkJiraIssueToCaseWithHttpInfo(caseId, body); } /** - * Get the details of a project. + * Link existing Jira issue to case. * - *

See {@link #getProjectWithHttpInfoAsync}. + *

See {@link #linkJiraIssueToCaseWithHttpInfoAsync}. * - * @param projectId Project UUID (required) - * @return CompletableFuture<ProjectResponse> + * @param caseId Case's UUID or key (required) + * @param body Jira issue link request (required) + * @return CompletableFuture */ - public CompletableFuture getProjectAsync(String projectId) { - return getProjectWithHttpInfoAsync(projectId) + public CompletableFuture linkJiraIssueToCaseAsync( + String caseId, JiraIssueLinkRequest body) { + return linkJiraIssueToCaseWithHttpInfoAsync(caseId, body) .thenApply( response -> { return response.getData(); @@ -1409,82 +2361,118 @@ public CompletableFuture getProjectAsync(String projectId) { } /** - * Get the details of a project by project_id. + * Link an existing Jira issue to a case * - * @param projectId Project UUID (required) - * @return ApiResponse<ProjectResponse> + * @param caseId Case's UUID or key (required) + * @param body Jira issue link request (required) + * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * * * + * * *
Response details
Status Code Description Response Headers
200 OK -
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
409 Conflict -
429 Too many requests -
*/ - public ApiResponse getProjectWithHttpInfo(String projectId) throws ApiException { - Object localVarPostBody = null; + public ApiResponse linkJiraIssueToCaseWithHttpInfo(String caseId, JiraIssueLinkRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "linkJiraIssueToCase"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'caseId' is set + if (caseId == null) { throw new ApiException( - 400, "Missing the required parameter 'projectId' when calling getProject"); + 400, "Missing the required parameter 'caseId' when calling linkJiraIssueToCase"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling linkJiraIssueToCase"); } // create path and map variables String localVarPath = - "/api/v2/cases/projects/{project_id}" - .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + "/api/v2/cases/{case_id}/relationships/jira_issues" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.getProject", + "v2.CaseManagementApi.linkJiraIssueToCase", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, + new String[] {"*/*"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "GET", + "PATCH", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Get the details of a project. + * Link existing Jira issue to case. * - *

See {@link #getProjectWithHttpInfo}. + *

See {@link #linkJiraIssueToCaseWithHttpInfo}. * - * @param projectId Project UUID (required) - * @return CompletableFuture<ApiResponse<ProjectResponse>> + * @param caseId Case's UUID or key (required) + * @param body Jira issue link request (required) + * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> getProjectWithHttpInfoAsync( - String projectId) { - Object localVarPostBody = null; + public CompletableFuture> linkJiraIssueToCaseWithHttpInfoAsync( + String caseId, JiraIssueLinkRequest body) { + // Check if unstable operation is enabled + String operationId = "linkJiraIssueToCase"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; - // verify the required parameter 'projectId' is set - if (projectId == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'projectId' when calling getProject")); + 400, "Missing the required parameter 'caseId' when calling linkJiraIssueToCase")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling linkJiraIssueToCase")); return result; } // create path and map variables String localVarPath = - "/api/v2/cases/projects/{project_id}" - .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + "/api/v2/cases/{case_id}/relationships/jira_issues" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); @@ -1492,50 +2480,56 @@ public CompletableFuture> getProjectWithHttpInfoAsy try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.getProject", + "v2.CaseManagementApi.linkJiraIssueToCase", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, + new String[] {"*/*"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "GET", + "PATCH", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Get all projects. + * Update case project. * - *

See {@link #getProjectsWithHttpInfo}. + *

See {@link #moveCaseToProjectWithHttpInfo}. * - * @return ProjectsResponse + * @param caseId Case's UUID or key (required) + * @param body Project update request (required) + * @return CaseResponse * @throws ApiException if fails to make API call */ - public ProjectsResponse getProjects() throws ApiException { - return getProjectsWithHttpInfo().getData(); + public CaseResponse moveCaseToProject(String caseId, ProjectRelationship body) + throws ApiException { + return moveCaseToProjectWithHttpInfo(caseId, body).getData(); } /** - * Get all projects. + * Update case project. * - *

See {@link #getProjectsWithHttpInfoAsync}. + *

See {@link #moveCaseToProjectWithHttpInfoAsync}. * - * @return CompletableFuture<ProjectsResponse> + * @param caseId Case's UUID or key (required) + * @param body Project update request (required) + * @return CompletableFuture<CaseResponse> */ - public CompletableFuture getProjectsAsync() { - return getProjectsWithHttpInfoAsync() + public CompletableFuture moveCaseToProjectAsync( + String caseId, ProjectRelationship body) { + return moveCaseToProjectWithHttpInfoAsync(caseId, body) .thenApply( response -> { return response.getData(); @@ -1543,9 +2537,11 @@ public CompletableFuture getProjectsAsync() { } /** - * Get all projects. + * Update the project associated with a case * - * @return ApiResponse<ProjectsResponse> + * @param caseId Case's UUID or key (required) + * @param body Project update request (required) + * @return ApiResponse<CaseResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -1559,16 +2555,38 @@ public CompletableFuture getProjectsAsync() { * *
429 Too many requests -
*/ - public ApiResponse getProjectsWithHttpInfo() throws ApiException { - Object localVarPostBody = null; + public ApiResponse moveCaseToProjectWithHttpInfo( + String caseId, ProjectRelationship body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "moveCaseToProject"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling moveCaseToProject"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling moveCaseToProject"); + } // create path and map variables - String localVarPath = "/api/v2/cases/projects"; + String localVarPath = + "/api/v2/cases/{case_id}/relationships/project" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.getProjects", + "v2.CaseManagementApi.moveCaseToProject", localVarPath, new ArrayList(), localVarHeaderParams, @@ -1576,27 +2594,60 @@ public ApiResponse getProjectsWithHttpInfo() throws ApiExcepti new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "GET", + "PATCH", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get all projects. + * Update case project. * - *

See {@link #getProjectsWithHttpInfo}. + *

See {@link #moveCaseToProjectWithHttpInfo}. * - * @return CompletableFuture<ApiResponse<ProjectsResponse>> + * @param caseId Case's UUID or key (required) + * @param body Project update request (required) + * @return CompletableFuture<ApiResponse<CaseResponse>> */ - public CompletableFuture> getProjectsWithHttpInfoAsync() { - Object localVarPostBody = null; + public CompletableFuture> moveCaseToProjectWithHttpInfoAsync( + String caseId, ProjectRelationship body) { + // Check if unstable operation is enabled + String operationId = "moveCaseToProject"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'caseId' when calling moveCaseToProject")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling moveCaseToProject")); + return result; + } // create path and map variables - String localVarPath = "/api/v2/cases/projects"; + String localVarPath = + "/api/v2/cases/{case_id}/relationships/project" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); @@ -1604,7 +2655,7 @@ public CompletableFuture> getProjectsWithHttpInfoA try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.getProjects", + "v2.CaseManagementApi.moveCaseToProject", localVarPath, new ArrayList(), localVarHeaderParams, @@ -1612,19 +2663,19 @@ public CompletableFuture> getProjectsWithHttpInfoA new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "GET", + "PATCH", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** Manage optional parameters to searchCases. */ @@ -2226,6 +3277,157 @@ public CompletableFuture> unassignCaseWithHttpInfoAsyn new GenericType() {}); } + /** + * Remove Jira issue link from case. + * + *

See {@link #unlinkJiraIssueWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @throws ApiException if fails to make API call + */ + public void unlinkJiraIssue(String caseId) throws ApiException { + unlinkJiraIssueWithHttpInfo(caseId); + } + + /** + * Remove Jira issue link from case. + * + *

See {@link #unlinkJiraIssueWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @return CompletableFuture + */ + public CompletableFuture unlinkJiraIssueAsync(String caseId) { + return unlinkJiraIssueWithHttpInfoAsync(caseId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Remove the link between a Jira issue and a case + * + * @param caseId Case's UUID or key (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse unlinkJiraIssueWithHttpInfo(String caseId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "unlinkJiraIssue"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling unlinkJiraIssue"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/relationships/jira_issues" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.unlinkJiraIssue", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Remove Jira issue link from case. + * + *

See {@link #unlinkJiraIssueWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> unlinkJiraIssueWithHttpInfoAsync(String caseId) { + // Check if unstable operation is enabled + String operationId = "unlinkJiraIssue"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'caseId' when calling unlinkJiraIssue")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/relationships/jira_issues" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.unlinkJiraIssue", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + /** * Update case attributes. * diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/IncidentRelationshipData.java new file mode 100644 index 00000000000..a4c0a549fbc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentRelationshipData.java @@ -0,0 +1,178 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Incident relationship data */ +@JsonPropertyOrder({ + IncidentRelationshipData.JSON_PROPERTY_ID, + IncidentRelationshipData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentRelationshipData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IncidentResourceType type; + + public IncidentRelationshipData() {} + + @JsonCreator + public IncidentRelationshipData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) IncidentResourceType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IncidentRelationshipData id(String id) { + this.id = id; + return this; + } + + /** + * Incident identifier + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public IncidentRelationshipData type(IncidentResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Incident resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentResourceType getType() { + return type; + } + + public void setType(IncidentResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IncidentRelationshipData + */ + @JsonAnySetter + public IncidentRelationshipData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IncidentRelationshipData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentRelationshipData incidentRelationshipData = (IncidentRelationshipData) o; + return Objects.equals(this.id, incidentRelationshipData.id) + && Objects.equals(this.type, incidentRelationshipData.type) + && Objects.equals(this.additionalProperties, incidentRelationshipData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentRelationshipData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentResourceType.java b/src/main/java/com/datadog/api/client/v2/model/IncidentResourceType.java new file mode 100644 index 00000000000..8356f2b049d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentResourceType.java @@ -0,0 +1,54 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Incident resource type */ +@JsonSerialize(using = IncidentResourceType.IncidentResourceTypeSerializer.class) +public class IncidentResourceType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("incidents")); + + public static final IncidentResourceType INCIDENTS = new IncidentResourceType("incidents"); + + IncidentResourceType(String value) { + super(value, allowedValues); + } + + public static class IncidentResourceTypeSerializer extends StdSerializer { + public IncidentResourceTypeSerializer(Class t) { + super(t); + } + + public IncidentResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + IncidentResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IncidentResourceType fromValue(String value) { + return new IncidentResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/JiraIssueCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/JiraIssueCreateAttributes.java new file mode 100644 index 00000000000..8e41df1568e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/JiraIssueCreateAttributes.java @@ -0,0 +1,237 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Jira issue creation attributes */ +@JsonPropertyOrder({ + JiraIssueCreateAttributes.JSON_PROPERTY_FIELDS, + JiraIssueCreateAttributes.JSON_PROPERTY_ISSUE_TYPE_ID, + JiraIssueCreateAttributes.JSON_PROPERTY_JIRA_ACCOUNT_ID, + JiraIssueCreateAttributes.JSON_PROPERTY_PROJECT_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class JiraIssueCreateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FIELDS = "fields"; + private Map fields = null; + + public static final String JSON_PROPERTY_ISSUE_TYPE_ID = "issue_type_id"; + private String issueTypeId; + + public static final String JSON_PROPERTY_JIRA_ACCOUNT_ID = "jira_account_id"; + private String jiraAccountId; + + public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; + private String projectId; + + public JiraIssueCreateAttributes() {} + + @JsonCreator + public JiraIssueCreateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ISSUE_TYPE_ID) String issueTypeId, + @JsonProperty(required = true, value = JSON_PROPERTY_JIRA_ACCOUNT_ID) String jiraAccountId, + @JsonProperty(required = true, value = JSON_PROPERTY_PROJECT_ID) String projectId) { + this.issueTypeId = issueTypeId; + this.jiraAccountId = jiraAccountId; + this.projectId = projectId; + } + + public JiraIssueCreateAttributes fields(Map fields) { + this.fields = fields; + return this; + } + + public JiraIssueCreateAttributes putFieldsItem(String key, Object fieldsItem) { + if (this.fields == null) { + this.fields = new HashMap<>(); + } + this.fields.put(key, fieldsItem); + return this; + } + + /** + * Additional Jira fields + * + * @return fields + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getFields() { + return fields; + } + + public void setFields(Map fields) { + this.fields = fields; + } + + public JiraIssueCreateAttributes issueTypeId(String issueTypeId) { + this.issueTypeId = issueTypeId; + return this; + } + + /** + * Jira issue type ID + * + * @return issueTypeId + */ + @JsonProperty(JSON_PROPERTY_ISSUE_TYPE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getIssueTypeId() { + return issueTypeId; + } + + public void setIssueTypeId(String issueTypeId) { + this.issueTypeId = issueTypeId; + } + + public JiraIssueCreateAttributes jiraAccountId(String jiraAccountId) { + this.jiraAccountId = jiraAccountId; + return this; + } + + /** + * Jira account ID + * + * @return jiraAccountId + */ + @JsonProperty(JSON_PROPERTY_JIRA_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getJiraAccountId() { + return jiraAccountId; + } + + public void setJiraAccountId(String jiraAccountId) { + this.jiraAccountId = jiraAccountId; + } + + public JiraIssueCreateAttributes projectId(String projectId) { + this.projectId = projectId; + return this; + } + + /** + * Jira project ID + * + * @return projectId + */ + @JsonProperty(JSON_PROPERTY_PROJECT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return JiraIssueCreateAttributes + */ + @JsonAnySetter + public JiraIssueCreateAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this JiraIssueCreateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JiraIssueCreateAttributes jiraIssueCreateAttributes = (JiraIssueCreateAttributes) o; + return Objects.equals(this.fields, jiraIssueCreateAttributes.fields) + && Objects.equals(this.issueTypeId, jiraIssueCreateAttributes.issueTypeId) + && Objects.equals(this.jiraAccountId, jiraIssueCreateAttributes.jiraAccountId) + && Objects.equals(this.projectId, jiraIssueCreateAttributes.projectId) + && Objects.equals( + this.additionalProperties, jiraIssueCreateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(fields, issueTypeId, jiraAccountId, projectId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JiraIssueCreateAttributes {\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); + sb.append(" issueTypeId: ").append(toIndentedString(issueTypeId)).append("\n"); + sb.append(" jiraAccountId: ").append(toIndentedString(jiraAccountId)).append("\n"); + sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/JiraIssueCreateData.java b/src/main/java/com/datadog/api/client/v2/model/JiraIssueCreateData.java new file mode 100644 index 00000000000..157bafb7a3c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/JiraIssueCreateData.java @@ -0,0 +1,181 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Jira issue creation data */ +@JsonPropertyOrder({ + JiraIssueCreateData.JSON_PROPERTY_ATTRIBUTES, + JiraIssueCreateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class JiraIssueCreateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private JiraIssueCreateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private JiraIssueResourceType type; + + public JiraIssueCreateData() {} + + @JsonCreator + public JiraIssueCreateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + JiraIssueCreateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) JiraIssueResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public JiraIssueCreateData attributes(JiraIssueCreateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Jira issue creation attributes + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public JiraIssueCreateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(JiraIssueCreateAttributes attributes) { + this.attributes = attributes; + } + + public JiraIssueCreateData type(JiraIssueResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Jira issue resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public JiraIssueResourceType getType() { + return type; + } + + public void setType(JiraIssueResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return JiraIssueCreateData + */ + @JsonAnySetter + public JiraIssueCreateData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this JiraIssueCreateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JiraIssueCreateData jiraIssueCreateData = (JiraIssueCreateData) o; + return Objects.equals(this.attributes, jiraIssueCreateData.attributes) + && Objects.equals(this.type, jiraIssueCreateData.type) + && Objects.equals(this.additionalProperties, jiraIssueCreateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JiraIssueCreateData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/JiraIssueCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/JiraIssueCreateRequest.java new file mode 100644 index 00000000000..e183ea4f5c3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/JiraIssueCreateRequest.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Jira issue creation request */ +@JsonPropertyOrder({JiraIssueCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class JiraIssueCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private JiraIssueCreateData data; + + public JiraIssueCreateRequest() {} + + @JsonCreator + public JiraIssueCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) JiraIssueCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public JiraIssueCreateRequest data(JiraIssueCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Jira issue creation data + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public JiraIssueCreateData getData() { + return data; + } + + public void setData(JiraIssueCreateData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return JiraIssueCreateRequest + */ + @JsonAnySetter + public JiraIssueCreateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this JiraIssueCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JiraIssueCreateRequest jiraIssueCreateRequest = (JiraIssueCreateRequest) o; + return Objects.equals(this.data, jiraIssueCreateRequest.data) + && Objects.equals(this.additionalProperties, jiraIssueCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JiraIssueCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/JiraIssueLinkAttributes.java b/src/main/java/com/datadog/api/client/v2/model/JiraIssueLinkAttributes.java new file mode 100644 index 00000000000..b2e9378093e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/JiraIssueLinkAttributes.java @@ -0,0 +1,143 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Jira issue link attributes */ +@JsonPropertyOrder({JiraIssueLinkAttributes.JSON_PROPERTY_JIRA_ISSUE_URL}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class JiraIssueLinkAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_JIRA_ISSUE_URL = "jira_issue_url"; + private String jiraIssueUrl; + + public JiraIssueLinkAttributes() {} + + @JsonCreator + public JiraIssueLinkAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_JIRA_ISSUE_URL) String jiraIssueUrl) { + this.jiraIssueUrl = jiraIssueUrl; + } + + public JiraIssueLinkAttributes jiraIssueUrl(String jiraIssueUrl) { + this.jiraIssueUrl = jiraIssueUrl; + return this; + } + + /** + * URL of the Jira issue + * + * @return jiraIssueUrl + */ + @JsonProperty(JSON_PROPERTY_JIRA_ISSUE_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getJiraIssueUrl() { + return jiraIssueUrl; + } + + public void setJiraIssueUrl(String jiraIssueUrl) { + this.jiraIssueUrl = jiraIssueUrl; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return JiraIssueLinkAttributes + */ + @JsonAnySetter + public JiraIssueLinkAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this JiraIssueLinkAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JiraIssueLinkAttributes jiraIssueLinkAttributes = (JiraIssueLinkAttributes) o; + return Objects.equals(this.jiraIssueUrl, jiraIssueLinkAttributes.jiraIssueUrl) + && Objects.equals(this.additionalProperties, jiraIssueLinkAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(jiraIssueUrl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JiraIssueLinkAttributes {\n"); + sb.append(" jiraIssueUrl: ").append(toIndentedString(jiraIssueUrl)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/JiraIssueLinkData.java b/src/main/java/com/datadog/api/client/v2/model/JiraIssueLinkData.java new file mode 100644 index 00000000000..1a301b90cfd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/JiraIssueLinkData.java @@ -0,0 +1,181 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Jira issue link data */ +@JsonPropertyOrder({ + JiraIssueLinkData.JSON_PROPERTY_ATTRIBUTES, + JiraIssueLinkData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class JiraIssueLinkData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private JiraIssueLinkAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private JiraIssueResourceType type; + + public JiraIssueLinkData() {} + + @JsonCreator + public JiraIssueLinkData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + JiraIssueLinkAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) JiraIssueResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public JiraIssueLinkData attributes(JiraIssueLinkAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Jira issue link attributes + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public JiraIssueLinkAttributes getAttributes() { + return attributes; + } + + public void setAttributes(JiraIssueLinkAttributes attributes) { + this.attributes = attributes; + } + + public JiraIssueLinkData type(JiraIssueResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Jira issue resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public JiraIssueResourceType getType() { + return type; + } + + public void setType(JiraIssueResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return JiraIssueLinkData + */ + @JsonAnySetter + public JiraIssueLinkData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this JiraIssueLinkData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JiraIssueLinkData jiraIssueLinkData = (JiraIssueLinkData) o; + return Objects.equals(this.attributes, jiraIssueLinkData.attributes) + && Objects.equals(this.type, jiraIssueLinkData.type) + && Objects.equals(this.additionalProperties, jiraIssueLinkData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JiraIssueLinkData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/JiraIssueLinkRequest.java b/src/main/java/com/datadog/api/client/v2/model/JiraIssueLinkRequest.java new file mode 100644 index 00000000000..1dd7a37bc08 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/JiraIssueLinkRequest.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Jira issue link request */ +@JsonPropertyOrder({JiraIssueLinkRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class JiraIssueLinkRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private JiraIssueLinkData data; + + public JiraIssueLinkRequest() {} + + @JsonCreator + public JiraIssueLinkRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) JiraIssueLinkData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public JiraIssueLinkRequest data(JiraIssueLinkData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Jira issue link data + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public JiraIssueLinkData getData() { + return data; + } + + public void setData(JiraIssueLinkData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return JiraIssueLinkRequest + */ + @JsonAnySetter + public JiraIssueLinkRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this JiraIssueLinkRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JiraIssueLinkRequest jiraIssueLinkRequest = (JiraIssueLinkRequest) o; + return Objects.equals(this.data, jiraIssueLinkRequest.data) + && Objects.equals(this.additionalProperties, jiraIssueLinkRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JiraIssueLinkRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/JiraIssueResourceType.java b/src/main/java/com/datadog/api/client/v2/model/JiraIssueResourceType.java new file mode 100644 index 00000000000..6174c484552 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/JiraIssueResourceType.java @@ -0,0 +1,54 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Jira issue resource type */ +@JsonSerialize(using = JiraIssueResourceType.JiraIssueResourceTypeSerializer.class) +public class JiraIssueResourceType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("issues")); + + public static final JiraIssueResourceType ISSUES = new JiraIssueResourceType("issues"); + + JiraIssueResourceType(String value) { + super(value, allowedValues); + } + + public static class JiraIssueResourceTypeSerializer extends StdSerializer { + public JiraIssueResourceTypeSerializer(Class t) { + super(t); + } + + public JiraIssueResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + JiraIssueResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static JiraIssueResourceType fromValue(String value) { + return new JiraIssueResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/NotebookCreateData.java b/src/main/java/com/datadog/api/client/v2/model/NotebookCreateData.java new file mode 100644 index 00000000000..f8e5c26be77 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/NotebookCreateData.java @@ -0,0 +1,148 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Notebook creation data */ +@JsonPropertyOrder({NotebookCreateData.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class NotebookCreateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TYPE = "type"; + private NotebookResourceType type; + + public NotebookCreateData() {} + + @JsonCreator + public NotebookCreateData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) NotebookResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public NotebookCreateData type(NotebookResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Notebook resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public NotebookResourceType getType() { + return type; + } + + public void setType(NotebookResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return NotebookCreateData + */ + @JsonAnySetter + public NotebookCreateData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this NotebookCreateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotebookCreateData notebookCreateData = (NotebookCreateData) o; + return Objects.equals(this.type, notebookCreateData.type) + && Objects.equals(this.additionalProperties, notebookCreateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotebookCreateData {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/NotebookCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/NotebookCreateRequest.java new file mode 100644 index 00000000000..88e47e585c3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/NotebookCreateRequest.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Notebook creation request */ +@JsonPropertyOrder({NotebookCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class NotebookCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private NotebookCreateData data; + + public NotebookCreateRequest() {} + + @JsonCreator + public NotebookCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) NotebookCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public NotebookCreateRequest data(NotebookCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Notebook creation data + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public NotebookCreateData getData() { + return data; + } + + public void setData(NotebookCreateData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return NotebookCreateRequest + */ + @JsonAnySetter + public NotebookCreateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this NotebookCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotebookCreateRequest notebookCreateRequest = (NotebookCreateRequest) o; + return Objects.equals(this.data, notebookCreateRequest.data) + && Objects.equals(this.additionalProperties, notebookCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotebookCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/NotebookResourceType.java b/src/main/java/com/datadog/api/client/v2/model/NotebookResourceType.java new file mode 100644 index 00000000000..3ae3cbb3da8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/NotebookResourceType.java @@ -0,0 +1,54 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Notebook resource type */ +@JsonSerialize(using = NotebookResourceType.NotebookResourceTypeSerializer.class) +public class NotebookResourceType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("notebook")); + + public static final NotebookResourceType NOTEBOOK = new NotebookResourceType("notebook"); + + NotebookResourceType(String value) { + super(value, allowedValues); + } + + public static class NotebookResourceTypeSerializer extends StdSerializer { + public NotebookResourceTypeSerializer(Class t) { + super(t); + } + + public NotebookResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + NotebookResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static NotebookResourceType fromValue(String value) { + return new NotebookResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RelationshipToIncidentRequest.java b/src/main/java/com/datadog/api/client/v2/model/RelationshipToIncidentRequest.java new file mode 100644 index 00000000000..b8ce86cfa22 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RelationshipToIncidentRequest.java @@ -0,0 +1,146 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationship to incident request */ +@JsonPropertyOrder({RelationshipToIncidentRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RelationshipToIncidentRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private IncidentRelationshipData data; + + public RelationshipToIncidentRequest() {} + + @JsonCreator + public RelationshipToIncidentRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) IncidentRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public RelationshipToIncidentRequest data(IncidentRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Incident relationship data + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentRelationshipData getData() { + return data; + } + + public void setData(IncidentRelationshipData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RelationshipToIncidentRequest + */ + @JsonAnySetter + public RelationshipToIncidentRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RelationshipToIncidentRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelationshipToIncidentRequest relationshipToIncidentRequest = (RelationshipToIncidentRequest) o; + return Objects.equals(this.data, relationshipToIncidentRequest.data) + && Objects.equals( + this.additionalProperties, relationshipToIncidentRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelationshipToIncidentRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowTicketCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTicketCreateAttributes.java new file mode 100644 index 00000000000..2e70c9de2ad --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTicketCreateAttributes.java @@ -0,0 +1,174 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** ServiceNow ticket creation attributes */ +@JsonPropertyOrder({ + ServiceNowTicketCreateAttributes.JSON_PROPERTY_ASSIGNMENT_GROUP, + ServiceNowTicketCreateAttributes.JSON_PROPERTY_INSTANCE_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowTicketCreateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ASSIGNMENT_GROUP = "assignment_group"; + private String assignmentGroup; + + public static final String JSON_PROPERTY_INSTANCE_NAME = "instance_name"; + private String instanceName; + + public ServiceNowTicketCreateAttributes() {} + + @JsonCreator + public ServiceNowTicketCreateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_INSTANCE_NAME) String instanceName) { + this.instanceName = instanceName; + } + + public ServiceNowTicketCreateAttributes assignmentGroup(String assignmentGroup) { + this.assignmentGroup = assignmentGroup; + return this; + } + + /** + * ServiceNow assignment group + * + * @return assignmentGroup + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ASSIGNMENT_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAssignmentGroup() { + return assignmentGroup; + } + + public void setAssignmentGroup(String assignmentGroup) { + this.assignmentGroup = assignmentGroup; + } + + public ServiceNowTicketCreateAttributes instanceName(String instanceName) { + this.instanceName = instanceName; + return this; + } + + /** + * ServiceNow instance name + * + * @return instanceName + */ + @JsonProperty(JSON_PROPERTY_INSTANCE_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getInstanceName() { + return instanceName; + } + + public void setInstanceName(String instanceName) { + this.instanceName = instanceName; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ServiceNowTicketCreateAttributes + */ + @JsonAnySetter + public ServiceNowTicketCreateAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ServiceNowTicketCreateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowTicketCreateAttributes serviceNowTicketCreateAttributes = + (ServiceNowTicketCreateAttributes) o; + return Objects.equals(this.assignmentGroup, serviceNowTicketCreateAttributes.assignmentGroup) + && Objects.equals(this.instanceName, serviceNowTicketCreateAttributes.instanceName) + && Objects.equals( + this.additionalProperties, serviceNowTicketCreateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(assignmentGroup, instanceName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowTicketCreateAttributes {\n"); + sb.append(" assignmentGroup: ").append(toIndentedString(assignmentGroup)).append("\n"); + sb.append(" instanceName: ").append(toIndentedString(instanceName)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowTicketCreateData.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTicketCreateData.java new file mode 100644 index 00000000000..24ca772cb57 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTicketCreateData.java @@ -0,0 +1,183 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** ServiceNow ticket creation data */ +@JsonPropertyOrder({ + ServiceNowTicketCreateData.JSON_PROPERTY_ATTRIBUTES, + ServiceNowTicketCreateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowTicketCreateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ServiceNowTicketCreateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ServiceNowTicketResourceType type; + + public ServiceNowTicketCreateData() {} + + @JsonCreator + public ServiceNowTicketCreateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ServiceNowTicketCreateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ServiceNowTicketResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ServiceNowTicketCreateData attributes(ServiceNowTicketCreateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * ServiceNow ticket creation attributes + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceNowTicketCreateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ServiceNowTicketCreateAttributes attributes) { + this.attributes = attributes; + } + + public ServiceNowTicketCreateData type(ServiceNowTicketResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * ServiceNow ticket resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceNowTicketResourceType getType() { + return type; + } + + public void setType(ServiceNowTicketResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ServiceNowTicketCreateData + */ + @JsonAnySetter + public ServiceNowTicketCreateData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ServiceNowTicketCreateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowTicketCreateData serviceNowTicketCreateData = (ServiceNowTicketCreateData) o; + return Objects.equals(this.attributes, serviceNowTicketCreateData.attributes) + && Objects.equals(this.type, serviceNowTicketCreateData.type) + && Objects.equals( + this.additionalProperties, serviceNowTicketCreateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowTicketCreateData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowTicketCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTicketCreateRequest.java new file mode 100644 index 00000000000..aa6ccafa6f0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTicketCreateRequest.java @@ -0,0 +1,146 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** ServiceNow ticket creation request */ +@JsonPropertyOrder({ServiceNowTicketCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceNowTicketCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ServiceNowTicketCreateData data; + + public ServiceNowTicketCreateRequest() {} + + @JsonCreator + public ServiceNowTicketCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) ServiceNowTicketCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ServiceNowTicketCreateRequest data(ServiceNowTicketCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * ServiceNow ticket creation data + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceNowTicketCreateData getData() { + return data; + } + + public void setData(ServiceNowTicketCreateData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ServiceNowTicketCreateRequest + */ + @JsonAnySetter + public ServiceNowTicketCreateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ServiceNowTicketCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceNowTicketCreateRequest serviceNowTicketCreateRequest = (ServiceNowTicketCreateRequest) o; + return Objects.equals(this.data, serviceNowTicketCreateRequest.data) + && Objects.equals( + this.additionalProperties, serviceNowTicketCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNowTicketCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowTicketResourceType.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTicketResourceType.java new file mode 100644 index 00000000000..091d62b7813 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTicketResourceType.java @@ -0,0 +1,56 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** ServiceNow ticket resource type */ +@JsonSerialize(using = ServiceNowTicketResourceType.ServiceNowTicketResourceTypeSerializer.class) +public class ServiceNowTicketResourceType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("tickets")); + + public static final ServiceNowTicketResourceType TICKETS = + new ServiceNowTicketResourceType("tickets"); + + ServiceNowTicketResourceType(String value) { + super(value, allowedValues); + } + + public static class ServiceNowTicketResourceTypeSerializer + extends StdSerializer { + public ServiceNowTicketResourceTypeSerializer(Class t) { + super(t); + } + + public ServiceNowTicketResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ServiceNowTicketResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ServiceNowTicketResourceType fromValue(String value) { + return new ServiceNowTicketResourceType(value); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/case_management.feature b/src/test/resources/com/datadog/api/client/v2/api/case_management.feature index 2f239155671..6dd08c4110e 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/case_management.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/case_management.feature @@ -90,6 +90,60 @@ Feature: Case Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/case-management + Scenario: Create Jira issue for case returns "Accepted" response + Given operation "CreateCaseJiraIssue" enabled + And new "CreateCaseJiraIssue" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"fields": {}, "issue_type_id": "10001", "jira_account_id": "1234", "project_id": "5678"}, "type": "issues"}} + When the request is sent + Then the response status is 202 Accepted + + @generated @skip @team:DataDog/case-management + Scenario: Create Jira issue for case returns "Bad Request" response + Given operation "CreateCaseJiraIssue" enabled + And new "CreateCaseJiraIssue" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"fields": {}, "issue_type_id": "10001", "jira_account_id": "1234", "project_id": "5678"}, "type": "issues"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Create Jira issue for case returns "Not Found" response + Given operation "CreateCaseJiraIssue" enabled + And new "CreateCaseJiraIssue" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"fields": {}, "issue_type_id": "10001", "jira_account_id": "1234", "project_id": "5678"}, "type": "issues"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Create ServiceNow ticket for case returns "Accepted" response + Given operation "CreateCaseServiceNowTicket" enabled + And new "CreateCaseServiceNowTicket" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"assignment_group": "IT Support", "instance_name": "my-instance"}, "type": "tickets"}} + When the request is sent + Then the response status is 202 Accepted + + @generated @skip @team:DataDog/case-management + Scenario: Create ServiceNow ticket for case returns "Bad Request" response + Given operation "CreateCaseServiceNowTicket" enabled + And new "CreateCaseServiceNowTicket" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"assignment_group": "IT Support", "instance_name": "my-instance"}, "type": "tickets"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Create ServiceNow ticket for case returns "Not Found" response + Given operation "CreateCaseServiceNowTicket" enabled + And new "CreateCaseServiceNowTicket" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"assignment_group": "IT Support", "instance_name": "my-instance"}, "type": "tickets"}} + When the request is sent + Then the response status is 404 Not Found + @team:DataDog/case-management Scenario: Create a case returns "Bad Request" response Given new "CreateCase" request @@ -137,6 +191,33 @@ Feature: Case Management When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/case-management + Scenario: Create investigation notebook for case returns "Bad Request" response + Given operation "CreateCaseNotebook" enabled + And new "CreateCaseNotebook" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"type": "notebook"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Create investigation notebook for case returns "No Content" response + Given operation "CreateCaseNotebook" enabled + And new "CreateCaseNotebook" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"type": "notebook"}} + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/case-management + Scenario: Create investigation notebook for case returns "Not Found" response + Given operation "CreateCaseNotebook" enabled + And new "CreateCaseNotebook" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"type": "notebook"}} + When the request is sent + Then the response status is 404 Not Found + @skip @team:DataDog/case-management Scenario: Delete case comment returns "Bad Request" response Given new "DeleteCaseComment" request @@ -247,6 +328,93 @@ Feature: Case Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/case-management + Scenario: Link existing Jira issue to case returns "Bad Request" response + Given operation "LinkJiraIssueToCase" enabled + And new "LinkJiraIssueToCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"jira_issue_url": "https://jira.example.com/browse/PROJ-123"}, "type": "issues"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Link existing Jira issue to case returns "Conflict" response + Given operation "LinkJiraIssueToCase" enabled + And new "LinkJiraIssueToCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"jira_issue_url": "https://jira.example.com/browse/PROJ-123"}, "type": "issues"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/case-management + Scenario: Link existing Jira issue to case returns "No Content" response + Given operation "LinkJiraIssueToCase" enabled + And new "LinkJiraIssueToCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"jira_issue_url": "https://jira.example.com/browse/PROJ-123"}, "type": "issues"}} + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/case-management + Scenario: Link existing Jira issue to case returns "Not Found" response + Given operation "LinkJiraIssueToCase" enabled + And new "LinkJiraIssueToCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"jira_issue_url": "https://jira.example.com/browse/PROJ-123"}, "type": "issues"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Link incident to case returns "Bad Request" response + Given operation "LinkIncident" enabled + And new "LinkIncident" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "incidents"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Link incident to case returns "Created" response + Given operation "LinkIncident" enabled + And new "LinkIncident" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "incidents"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/case-management + Scenario: Link incident to case returns "Not Found" response + Given operation "LinkIncident" enabled + And new "LinkIncident" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "incidents"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Remove Jira issue link from case returns "Bad Request" response + Given operation "UnlinkJiraIssue" enabled + And new "UnlinkJiraIssue" request + And request contains "case_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: Remove Jira issue link from case returns "No Content" response + Given operation "UnlinkJiraIssue" enabled + And new "UnlinkJiraIssue" request + And request contains "case_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/case-management + Scenario: Remove Jira issue link from case returns "Not Found" response + Given operation "UnlinkJiraIssue" enabled + And new "UnlinkJiraIssue" request + And request contains "case_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: Remove a project returns "API error response" response Given new "DeleteProject" request @@ -450,6 +618,33 @@ Feature: Case Management Then the response status is 200 OK And the response "data.attributes.priority" is equal to "P3" + @generated @skip @team:DataDog/case-management + Scenario: Update case project returns "Bad Request" response + Given operation "MoveCaseToProject" enabled + And new "MoveCaseToProject" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "type": "project"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Update case project returns "Not Found" response + Given operation "MoveCaseToProject" enabled + And new "MoveCaseToProject" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "type": "project"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Update case project returns "OK" response + Given operation "MoveCaseToProject" enabled + And new "MoveCaseToProject" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "type": "project"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/case-management Scenario: Update case status returns "Bad Request" response Given new "UpdateStatus" request diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 5a347bddf11..e379db67562 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -795,6 +795,56 @@ "type": "idempotent" } }, + "LinkIncident": { + "tag": "Case Management", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, + "UnlinkJiraIssue": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "LinkJiraIssueToCase": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "CreateCaseJiraIssue": { + "tag": "Case Management", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, + "CreateCaseNotebook": { + "tag": "Case Management", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, + "MoveCaseToProject": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "CreateCaseServiceNowTicket": { + "tag": "Case Management", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, "UpdateStatus": { "tag": "Case Management", "undo": {