From 61628ece03abbfbe2421cdaf64f0dcb466c59c39 Mon Sep 17 00:00:00 2001 From: David Tapiador Date: Tue, 2 Jun 2026 16:37:52 +0200 Subject: [PATCH 1/2] Fix LogsArchivesApiTest failures for new lookup/partitioning attributes Add lookup_attributes and partitioning_attributes (empty arrays) to all archive response fixtures to match real backend behavior. Also configure the test ObjectMapper with NON_NULL inclusion so the WireMock request stub does not expect null fields that the API client correctly omits. Co-Authored-By: Claude Sonnet 4.6 --- .../datadog/api/client/v2/api/LogsArchivesApiTest.java | 9 ++------- .../v2/api/logs_archives_fixtures/azure/out/create.json | 2 +- .../v2/api/logs_archives_fixtures/gcs/out/create.json | 2 +- .../v2/api/logs_archives_fixtures/s3/out/create.json | 2 +- .../v2/api/logs_archives_fixtures/s3/out/getall.json | 2 +- .../v2/api/logs_archives_fixtures/s3/out/getbyid.json | 2 +- .../v2/api/logs_archives_fixtures/s3/out/update.json | 2 +- 7 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/test/java/com/datadog/api/client/v2/api/LogsArchivesApiTest.java b/src/test/java/com/datadog/api/client/v2/api/LogsArchivesApiTest.java index 6cff3c53770..26deb3b9f5c 100644 --- a/src/test/java/com/datadog/api/client/v2/api/LogsArchivesApiTest.java +++ b/src/test/java/com/datadog/api/client/v2/api/LogsArchivesApiTest.java @@ -44,24 +44,19 @@ import com.datadog.api.client.v2.model.LogsArchiveOrderDefinition; import com.datadog.api.client.v2.model.LogsArchives; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; import java.util.Arrays; import java.util.List; import org.junit.BeforeClass; import org.junit.Test; -import org.openapitools.jackson.nullable.JsonNullableModule; /** API tests for LogsArchivesApi */ public class LogsArchivesApiTest extends V2APITest { public static final String ARCHIVE_ID = "FOObar"; private static LogsArchivesApi api; - - // ObjectMapper instance configure to not fail when encountering unknown properties - private static ObjectMapper objectMapper = - new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + private static ObjectMapper objectMapper; private final String fixturePrefix = "client/v2/api/logs_archives_fixtures"; private final String apiUriForArchives = "/api/v2/logs/config/archives"; @@ -75,7 +70,7 @@ public String getTracingEndpoint() { @BeforeClass public static void initApi() { api = new LogsArchivesApi(generalApiUnitTestClient); - objectMapper.registerModule(new JsonNullableModule()); + objectMapper = generalApiUnitTestClient.getJSON().getMapper(); } /** diff --git a/src/test/resources/com/datadog/api/client/v2/api/logs_archives_fixtures/azure/out/create.json b/src/test/resources/com/datadog/api/client/v2/api/logs_archives_fixtures/azure/out/create.json index e79f6365c41..485ba02a904 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/logs_archives_fixtures/azure/out/create.json +++ b/src/test/resources/com/datadog/api/client/v2/api/logs_archives_fixtures/azure/out/create.json @@ -1 +1 @@ -{"data":{"attributes":{"destination":{"container":"my-container","integration":{"client_id":"aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa","tenant_id":"aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"},"path":"/path/blou","region":"my-region","storage_account":"storageAccount","type":"azure"},"name":"datadog-api-client-go Tests Archive","query":"service:toto", "rehydration_tags": ["team:intake", "team:app"], "include_tags": true},"id":"XVlBzgbaiC","type":"archives"}} +{"data": {"attributes": {"destination": {"container": "my-container", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "path": "/path/blou", "region": "my-region", "storage_account": "storageAccount", "type": "azure"}, "name": "datadog-api-client-go Tests Archive", "query": "service:toto", "rehydration_tags": ["team:intake", "team:app"], "include_tags": true, "lookup_attributes": [], "partitioning_attributes": []}, "id": "XVlBzgbaiC", "type": "archives"}} \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/logs_archives_fixtures/gcs/out/create.json b/src/test/resources/com/datadog/api/client/v2/api/logs_archives_fixtures/gcs/out/create.json index 72503048b5f..6acb992384e 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/logs_archives_fixtures/gcs/out/create.json +++ b/src/test/resources/com/datadog/api/client/v2/api/logs_archives_fixtures/gcs/out/create.json @@ -1 +1 @@ -{"data":{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"client_email":"email@email.com","project_id":"aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"},"path":"/path/blou","type":"gcs"},"name":"datadog-api-client-go Tests Archive","query":"service:toto", "rehydration_tags": ["team:intake", "team:app"], "include_tags": true},"id":"XVlBzgbaiC","type":"archives"}} +{"data": {"attributes": {"destination": {"bucket": "dd-logs-test-datadog-api-client-go", "integration": {"client_email": "email@email.com", "project_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "path": "/path/blou", "type": "gcs"}, "name": "datadog-api-client-go Tests Archive", "query": "service:toto", "rehydration_tags": ["team:intake", "team:app"], "include_tags": true, "lookup_attributes": [], "partitioning_attributes": []}, "id": "XVlBzgbaiC", "type": "archives"}} \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/logs_archives_fixtures/s3/out/create.json b/src/test/resources/com/datadog/api/client/v2/api/logs_archives_fixtures/s3/out/create.json index 59af2e90e72..885ea4ba549 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/logs_archives_fixtures/s3/out/create.json +++ b/src/test/resources/com/datadog/api/client/v2/api/logs_archives_fixtures/s3/out/create.json @@ -1 +1 @@ -{"data":{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"account_id":"711111111111","role_name":"DatadogGoClientTestIntegrationRole"},"path":"/path/blou","type":"s3"},"name":"datadog-api-client-go Tests Archive","query":"service:toto", "rehydration_tags": ["team:intake", "team:app"], "include_tags": true},"id":"FOObar","type":"archives"}} +{"data": {"attributes": {"destination": {"bucket": "dd-logs-test-datadog-api-client-go", "integration": {"account_id": "711111111111", "role_name": "DatadogGoClientTestIntegrationRole"}, "path": "/path/blou", "type": "s3"}, "name": "datadog-api-client-go Tests Archive", "query": "service:toto", "rehydration_tags": ["team:intake", "team:app"], "include_tags": true, "lookup_attributes": [], "partitioning_attributes": []}, "id": "FOObar", "type": "archives"}} \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/logs_archives_fixtures/s3/out/getall.json b/src/test/resources/com/datadog/api/client/v2/api/logs_archives_fixtures/s3/out/getall.json index 10efbe3e86a..2bff26e7384 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/logs_archives_fixtures/s3/out/getall.json +++ b/src/test/resources/com/datadog/api/client/v2/api/logs_archives_fixtures/s3/out/getall.json @@ -1 +1 @@ -{"data":[{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"account_id":"711111111111","role_name":"DatadogGoClientTestIntegrationRole"},"path":"/path/blou","type":"s3"},"name":"datadog-api-client-go Tests Archive","query":"source:tata", "rehydration_tags": ["team:intake", "team:app"], "include_tags": true},"id":"FOObar","type":"archives"}]} +{"data": [{"attributes": {"destination": {"bucket": "dd-logs-test-datadog-api-client-go", "integration": {"account_id": "711111111111", "role_name": "DatadogGoClientTestIntegrationRole"}, "path": "/path/blou", "type": "s3"}, "name": "datadog-api-client-go Tests Archive", "query": "source:tata", "rehydration_tags": ["team:intake", "team:app"], "include_tags": true, "lookup_attributes": [], "partitioning_attributes": []}, "id": "FOObar", "type": "archives"}]} \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/logs_archives_fixtures/s3/out/getbyid.json b/src/test/resources/com/datadog/api/client/v2/api/logs_archives_fixtures/s3/out/getbyid.json index 8167048b343..ad4d0dc5432 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/logs_archives_fixtures/s3/out/getbyid.json +++ b/src/test/resources/com/datadog/api/client/v2/api/logs_archives_fixtures/s3/out/getbyid.json @@ -1 +1 @@ -{"data":{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"account_id":"711111111111","role_name":"DatadogGoClientTestIntegrationRole"},"path":"/path/blou","type":"s3"},"name":"datadog-api-client-go Tests Archive","query":"source:tata", "rehydration_tags": ["team:intake", "team:app"], "include_tags": true},"id":"FOObar","type":"archives"}} +{"data": {"attributes": {"destination": {"bucket": "dd-logs-test-datadog-api-client-go", "integration": {"account_id": "711111111111", "role_name": "DatadogGoClientTestIntegrationRole"}, "path": "/path/blou", "type": "s3"}, "name": "datadog-api-client-go Tests Archive", "query": "source:tata", "rehydration_tags": ["team:intake", "team:app"], "include_tags": true, "lookup_attributes": [], "partitioning_attributes": []}, "id": "FOObar", "type": "archives"}} \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/logs_archives_fixtures/s3/out/update.json b/src/test/resources/com/datadog/api/client/v2/api/logs_archives_fixtures/s3/out/update.json index 5154396e237..5c293121dcb 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/logs_archives_fixtures/s3/out/update.json +++ b/src/test/resources/com/datadog/api/client/v2/api/logs_archives_fixtures/s3/out/update.json @@ -1 +1 @@ -{"data":{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"account_id":"711111111111","role_name":"DatadogGoClientTestIntegrationRole"},"path":"/path/toto","type":"s3"},"name":"datadog-api-client-go Tests Archive","query":"service:toto"},"id":"FOObar","type":"archives"}} +{"data": {"attributes": {"destination": {"bucket": "dd-logs-test-datadog-api-client-go", "integration": {"account_id": "711111111111", "role_name": "DatadogGoClientTestIntegrationRole"}, "path": "/path/toto", "type": "s3"}, "name": "datadog-api-client-go Tests Archive", "query": "service:toto", "lookup_attributes": [], "partitioning_attributes": []}, "id": "FOObar", "type": "archives"}} \ No newline at end of file From ae8b67fb7f786a57cca95bbe8637e3926b191759 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 3 Jun 2026 06:03:47 +0000 Subject: [PATCH 2/2] Regenerate client from commit e9e9518 of spec repo --- .generator/schemas/v2/openapi.yaml | 518 +++++++++++++++++- .../v2/logs-archives/CreateLogsArchive.java | 2 + .../v2/logs-archives/UpdateLogsArchive.java | 2 + .../AttachServiceNowTicket.java | 62 +++ .../CreateServiceNowTickets.java | 67 +++ .../UpdateFindingsAssignee.java | 53 ++ .../com/datadog/api/client/ApiClient.java | 3 + .../datadog/api/client/v2/api/MetricsApi.java | 7 +- .../client/v2/api/SecurityMonitoringApi.java | 466 ++++++++++++++++ .../api/client/v2/model/AssigneeDataType.java | 53 ++ .../api/client/v2/model/AssigneeRequest.java | 145 +++++ .../client/v2/model/AssigneeRequestData.java | 236 ++++++++ .../model/AssigneeRequestDataAttributes.java | 137 +++++ .../AssigneeRequestDataRelationships.java | 147 +++++ .../api/client/v2/model/AssigneeResponse.java | 172 ++++++ .../client/v2/model/AssigneeResponseData.java | 209 +++++++ .../model/AssigneeResponseDataAttributes.java | 138 +++++ .../client/v2/model/AssigneeResponseMeta.java | 191 +++++++ .../api/client/v2/model/AssignmentResult.java | 229 ++++++++ .../model/AttachServiceNowTicketRequest.java | 147 +++++ .../AttachServiceNowTicketRequestData.java | 216 ++++++++ ...ServiceNowTicketRequestDataAttributes.java | 156 ++++++ ...viceNowTicketRequestDataRelationships.java | 181 ++++++ .../CreateServiceNowTicketRequestArray.java | 158 ++++++ .../CreateServiceNowTicketRequestData.java | 213 +++++++ ...ServiceNowTicketRequestDataAttributes.java | 227 ++++++++ ...viceNowTicketRequestDataRelationships.java | 181 ++++++ .../FindingCaseResponseDataAttributes.java | 30 + .../v2/model/FindingServiceNowTicket.java | 166 ++++++ .../model/FindingServiceNowTicketResult.java | 274 +++++++++ .../v2/model/LogsArchiveAttributes.java | 75 +++ .../LogsArchiveCreateRequestAttributes.java | 79 +++ .../v2/model/ServiceNowTicketsDataType.java | 57 ++ .../datadog/api/client/v1/api/hosts.feature | 20 +- .../datadog/api/client/v1/api/tags.feature | 20 +- .../api/client/v2/api/logs_archives.feature | 10 +- .../client/v2/api/security_monitoring.feature | 72 +++ .../com/datadog/api/client/v2/api/undo.json | 25 + 38 files changed, 5112 insertions(+), 32 deletions(-) create mode 100644 examples/v2/security-monitoring/AttachServiceNowTicket.java create mode 100644 examples/v2/security-monitoring/CreateServiceNowTickets.java create mode 100644 examples/v2/security-monitoring/UpdateFindingsAssignee.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AssigneeDataType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AssigneeRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AssigneeRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AssigneeRequestDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AssigneeRequestDataRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AssigneeResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AssigneeResponseData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AssigneeResponseDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AssigneeResponseMeta.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AssignmentResult.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AttachServiceNowTicketRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AttachServiceNowTicketRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AttachServiceNowTicketRequestDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AttachServiceNowTicketRequestDataRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateServiceNowTicketRequestArray.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateServiceNowTicketRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateServiceNowTicketRequestDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateServiceNowTicketRequestDataRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FindingServiceNowTicket.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FindingServiceNowTicketResult.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ServiceNowTicketsDataType.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a02697caa79..8dda8d3344a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -9976,6 +9976,131 @@ components: description: The product code for which the seats were assigned. type: string type: object + AssigneeDataType: + default: assignee + description: Assignee resource type. + enum: + - assignee + example: assignee + type: string + x-enum-varnames: + - ASSIGNEE + AssigneeRequest: + description: Request to assign or unassign security findings. + properties: + data: + $ref: "#/components/schemas/AssigneeRequestData" + required: + - data + type: object + AssigneeRequestData: + description: Data of the assignee request. + properties: + attributes: + $ref: "#/components/schemas/AssigneeRequestDataAttributes" + id: + description: Unique identifier of the assignee request. + example: "00000000-0000-0000-0000-000000000001" + type: string + relationships: + $ref: "#/components/schemas/AssigneeRequestDataRelationships" + type: + $ref: "#/components/schemas/AssigneeDataType" + required: + - relationships + - type + type: object + AssigneeRequestDataAttributes: + description: Attributes of the assignee request. + properties: + assignee_id: + description: Unique identifier of the Datadog user to assign the security findings to. If this field is not provided, the security findings are unassigned. + example: "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0" + type: string + type: object + AssigneeRequestDataRelationships: + description: Relationships of the assignee request. + properties: + findings: + $ref: "#/components/schemas/Findings" + description: Security findings to assign or unassign. + required: + - findings + type: object + AssigneeResponse: + description: Response for the assign or unassign request. + properties: + data: + $ref: "#/components/schemas/AssigneeResponseData" + meta: + $ref: "#/components/schemas/AssigneeResponseMeta" + required: + - data + type: object + AssigneeResponseData: + description: Data of the assignee response. + properties: + attributes: + $ref: "#/components/schemas/AssigneeResponseDataAttributes" + id: + description: Unique identifier of the assignee request. + example: "00000000-0000-0000-0000-000000000001" + type: string + type: + $ref: "#/components/schemas/AssigneeDataType" + required: + - id + - type + - attributes + type: object + AssigneeResponseDataAttributes: + description: Attributes of the assignee response. + properties: + assignee_id: + description: Unique identifier of the Datadog user assigned to the security findings. Omitted when the findings were unassigned. + example: "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0" + type: string + type: object + AssigneeResponseMeta: + description: Per-finding warnings and failures produced while processing the bulk assignee request. + properties: + failures: + description: Findings that could not be assigned or unassigned. + items: + $ref: "#/components/schemas/AssignmentResult" + type: array + warnings: + description: Findings for which the assignment succeeded but a non-critical error occurred during processing. + items: + $ref: "#/components/schemas/AssignmentResult" + type: array + type: object + AssignmentResult: + description: Per-finding outcome of an assign or unassign operation. + properties: + detail: + description: Human-readable explanation of the outcome. + example: "failed to update finding assignee" + type: string + finding_id: + description: Unique identifier of the security finding. + example: "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==" + type: string + status: + description: HTTP-like status code describing the outcome for this finding. + example: 500 + format: int32 + type: integer + title: + description: Short label describing the outcome for this finding. + example: "Internal Server Error" + type: string + required: + - finding_id + - status + - title + - detail + type: object AttachCaseRequest: description: Request for attaching security findings to a case. properties: @@ -10047,6 +10172,51 @@ components: - findings - project type: object + AttachServiceNowTicketRequest: + description: Request for attaching security findings to a ServiceNow ticket. + properties: + data: + $ref: "#/components/schemas/AttachServiceNowTicketRequestData" + required: + - data + type: object + AttachServiceNowTicketRequestData: + description: Data of the ServiceNow ticket to attach security findings to. + properties: + attributes: + $ref: "#/components/schemas/AttachServiceNowTicketRequestDataAttributes" + relationships: + $ref: "#/components/schemas/AttachServiceNowTicketRequestDataRelationships" + type: + $ref: "#/components/schemas/ServiceNowTicketsDataType" + required: + - attributes + - relationships + - type + type: object + AttachServiceNowTicketRequestDataAttributes: + description: Attributes of the ServiceNow ticket to attach security findings to. + properties: + servicenow_ticket_url: + description: URL of the ServiceNow incident to attach security findings to. Must be a service-now.com URL pointing to an incident record. + example: "https://example.service-now.com/now/nav/ui/classic/params/target/incident.do?sys_id=abcdef0123456789abcdef0123456789" + type: string + required: + - servicenow_ticket_url + type: object + AttachServiceNowTicketRequestDataRelationships: + description: Relationships of the ServiceNow ticket to attach security findings to. + properties: + findings: + $ref: "#/components/schemas/Findings" + description: Security findings to attach to the ServiceNow ticket. + project: + $ref: "#/components/schemas/CaseManagementProject" + description: Case management project with the ServiceNow integration configured. It is used to attach security findings to the ServiceNow ticket. + required: + - findings + - project + type: object Attachment: description: An attachment response containing the attachment data and related objects. properties: @@ -23548,6 +23718,63 @@ components: type: string x-enum-varnames: - CREATE_RULESET + CreateServiceNowTicketRequestArray: + description: List of requests to create ServiceNow tickets for security findings. + properties: + data: + description: Array of ServiceNow ticket creation request data objects. + items: + $ref: "#/components/schemas/CreateServiceNowTicketRequestData" + type: array + required: + - data + type: object + CreateServiceNowTicketRequestData: + description: Data of the ServiceNow ticket to create. + properties: + attributes: + $ref: "#/components/schemas/CreateServiceNowTicketRequestDataAttributes" + relationships: + $ref: "#/components/schemas/CreateServiceNowTicketRequestDataRelationships" + type: + $ref: "#/components/schemas/ServiceNowTicketsDataType" + required: + - relationships + - type + type: object + CreateServiceNowTicketRequestDataAttributes: + description: Attributes of the ServiceNow ticket to create. + properties: + assignee_id: + description: Unique identifier of the Datadog user assigned to the case backing the ServiceNow ticket. + example: "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0" + type: string + description: + description: Description of the ServiceNow ticket. If not provided, the description will be automatically generated. + example: "A description of the ServiceNow ticket." + type: string + priority: + $ref: "#/components/schemas/CasePriority" + description: Datadog case priority mapped to the ServiceNow ticket priority. If not provided, the priority will be automatically set to "NOT_DEFINED". + example: "P4" + title: + description: Title of the ServiceNow ticket. If not provided, the title will be automatically generated. + example: "A title for the ServiceNow ticket." + type: string + type: object + CreateServiceNowTicketRequestDataRelationships: + description: Relationships of the ServiceNow ticket to create. + properties: + findings: + $ref: "#/components/schemas/Findings" + description: Security findings to create a ServiceNow ticket for. + project: + $ref: "#/components/schemas/CaseManagementProject" + description: Case management project configured with the ServiceNow integration. It is used to create the ServiceNow ticket. + required: + - findings + - project + type: object CreateStatusPageRequest: description: Request object for creating a status page. example: @@ -33981,6 +34208,9 @@ components: description: Priority of the case. example: "P4" type: string + servicenow_ticket: + $ref: "#/components/schemas/FindingServiceNowTicket" + description: ServiceNow ticket associated with the case. status: description: Status of the case. example: "OPEN" @@ -34170,6 +34400,44 @@ components: example: Soft delete is enabled for Azure Storage type: string type: object + FindingServiceNowTicket: + description: ServiceNow ticket associated with the case. + properties: + result: + $ref: "#/components/schemas/FindingServiceNowTicketResult" + status: + description: Status of the ServiceNow ticket operation. Can be "COMPLETED" if successful, or "FAILED" if the operation failed. + example: "COMPLETED" + type: string + type: object + FindingServiceNowTicketResult: + description: Result of the ServiceNow ticket creation or attachment. + properties: + instance_name: + description: ServiceNow instance name extracted from the ticket URL. + example: "example" + type: string + sys_id: + description: Unique identifier of the ServiceNow incident record. + example: "abcdef0123456789abcdef0123456789" + type: string + sys_target_link: + description: Direct link to the ServiceNow incident record. + example: "https://example.service-now.com/incident.do?sys_id=abcdef0123456789abcdef0123456789" + type: string + sys_target_sys_id: + description: Unique identifier of the target ServiceNow record. + example: "abcdef0123456789abcdef0123456789" + type: string + table_name: + description: ServiceNow table containing the incident record. + example: "incident" + type: string + url: + description: URL of the ServiceNow incident record. + example: "https://example.service-now.com/now/nav/ui/classic/params/target/incident.do?sys_id=abcdef0123456789abcdef0123456789" + type: string + type: object FindingStatus: description: The status of the finding. enum: @@ -51361,10 +51629,24 @@ components: If it is set to "false", the tags will be deleted when the logs are sent to the archive. example: false type: boolean + lookup_attributes: + description: An array of attributes to use as lookup keys for the archive. + example: ["trace_id", "user_id"] + items: + description: A lookup attribute name. + type: string + type: array name: description: The archive name. example: Nginx Archive type: string + partitioning_attributes: + description: An array of attributes to use as partition keys for the archive. The attribute used most frequently for querying should be first. + example: ["service", "status"] + items: + description: A partition attribute name. + type: string + type: array query: description: The archive query/filter. Logs matching this query are included in the archive. example: source:nginx @@ -51420,10 +51702,24 @@ components: If it is set to "false", the tags will be deleted when the logs are sent to the archive. example: false type: boolean + lookup_attributes: + description: An array of attributes to use as lookup keys for the archive. + example: ["trace_id", "user_id"] + items: + description: A lookup attribute name. + type: string + type: array name: description: The archive name. example: Nginx Archive type: string + partitioning_attributes: + description: An array of attributes to use as partition keys for the archive. The attribute used most frequently for querying should be first. + example: ["service", "status"] + items: + description: A partition attribute name. + type: string + type: array query: description: The archive query/filter. Logs matching this query are included in the archive. example: source:nginx @@ -83298,6 +83594,15 @@ components: description: Link to the Incident created on ServiceNow type: string type: object + ServiceNowTicketsDataType: + default: servicenow_tickets + description: ServiceNow tickets resource type. + enum: + - servicenow_tickets + example: servicenow_tickets + type: string + x-enum-varnames: + - SERVICENOW_TICKETS ServiceNowUserAttributes: description: Attributes of a ServiceNow user properties: @@ -137855,9 +138160,9 @@ paths: /api/v2/metrics/{metric_name}/volumes: get: description: |- - View hourly average metric volumes for the given metric name over the look back period. - - Custom metrics generated in-app from other products will return `null` for ingested volumes. + View hourly average cardinality for the given metric name over the look back period. + For Metric Name Pricing customers, view total point volume for the given metric name + over the look back period. operationId: ListVolumesByMetricName parameters: - $ref: "#/components/parameters/MetricName" @@ -153408,6 +153713,69 @@ paths: permissions: - security_monitoring_findings_read - appsec_vm_read + /api/v2/security/findings/assignee: + patch: + description: >- + Assign or unassign security findings. + + You can assign up to 100 security findings per request. Set `assignee_id` to the unique identifier of the Datadog user you want to assign the findings to. Omit `assignee_id` (or set it to `null`) to unassign the findings. Per-finding warnings and failures are returned in the response `meta` object. + operationId: UpdateFindingsAssignee + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + assignee_id: "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0" + id: "00000000-0000-0000-0000-000000000001" + relationships: + findings: + data: + - id: "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==" + type: "findings" + type: "assignee" + schema: + $ref: "#/components/schemas/AssigneeRequest" + required: true + responses: + "202": + content: + application/json: + examples: + default: + value: + data: + attributes: + assignee_id: "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0" + id: "00000000-0000-0000-0000-000000000001" + type: "assignee" + schema: + $ref: "#/components/schemas/AssigneeResponse" + description: Accepted + "400": + $ref: "#/components/responses/BadRequestResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Assign or unassign security findings + tags: + - "Security Monitoring" + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - security_monitoring_findings_write + - appsec_vm_write + 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/security/findings/cases: delete: description: >- @@ -153875,6 +154243,150 @@ paths: permissions: - security_monitoring_findings_read - appsec_vm_read + /api/v2/security/findings/servicenow_tickets: + patch: + description: >- + Attach security findings to a ServiceNow ticket by providing the ServiceNow ticket URL. + + You can attach up to 50 security findings per ServiceNow ticket. If the ServiceNow ticket is not linked to any case, this operation will create a case for the security findings and link the ServiceNow ticket to the newly created case. Security findings that are already attached to another ServiceNow ticket will be detached from their previous ServiceNow ticket and attached to the specified ServiceNow ticket. + operationId: AttachServiceNowTicket + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + servicenow_ticket_url: https://example.service-now.com/now/nav/ui/classic/params/target/incident.do?sys_id=abcdef0123456789abcdef0123456789 + relationships: + findings: + data: + - id: ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw== + type: findings + project: + data: + id: aeadc05e-98a8-11ec-ac2c-da7ad0900001 + type: projects + type: servicenow_tickets + schema: + $ref: "#/components/schemas/AttachServiceNowTicketRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00+00:00" + description: A description of the ServiceNow ticket. + modified_at: "2024-01-01T00:00:00+00:00" + priority: P4 + status: OPEN + title: A title for the ServiceNow ticket. + id: 00000000-0000-0000-0000-000000000006 + type: cases + schema: + $ref: "#/components/schemas/FindingCaseResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Attach security findings to a ServiceNow ticket + tags: + - "Security Monitoring" + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - security_monitoring_findings_write + - appsec_vm_write + 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 ServiceNow tickets for security findings. + + This operation creates a case in Datadog and a ServiceNow ticket linked to that case for bidirectional sync between Datadog and ServiceNow. You can create up to 50 ServiceNow tickets per request and associate up to 50 security findings per ServiceNow ticket. Security findings that are already attached to another ServiceNow ticket will be detached from their previous ServiceNow ticket and attached to the newly created ServiceNow ticket. + operationId: CreateServiceNowTickets + requestBody: + content: + application/json: + examples: + default: + value: + data: + - attributes: + assignee_id: f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0 + description: A description of the ServiceNow ticket. + priority: NOT_DEFINED + title: A title for the ServiceNow ticket. + relationships: + findings: + data: + - id: ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw== + type: findings + project: + data: + id: aeadc05e-98a8-11ec-ac2c-da7ad0900001 + type: projects + type: servicenow_tickets + schema: + $ref: "#/components/schemas/CreateServiceNowTicketRequestArray" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created_at: "2024-01-01T00:00:00+00:00" + description: A description of the ServiceNow ticket. + modified_at: "2024-01-01T00:00:00+00:00" + priority: P4 + status: OPEN + title: A title for the ServiceNow ticket. + id: 00000000-0000-0000-0000-000000000005 + type: cases + schema: + $ref: "#/components/schemas/FindingCaseResponseArray" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Create ServiceNow tickets for security findings + tags: + - "Security Monitoring" + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - security_monitoring_findings_write + - appsec_vm_write + 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/security/sboms: get: description: |- diff --git a/examples/v2/logs-archives/CreateLogsArchive.java b/examples/v2/logs-archives/CreateLogsArchive.java index 0da27b9690c..45351b7b8a3 100644 --- a/examples/v2/logs-archives/CreateLogsArchive.java +++ b/examples/v2/logs-archives/CreateLogsArchive.java @@ -37,7 +37,9 @@ public static void main(String[] args) { .storageAccount("account-name") .type(LogsArchiveDestinationAzureType.AZURE))) .includeTags(false) + .lookupAttributes(Arrays.asList("trace_id", "user_id")) .name("Nginx Archive") + .partitioningAttributes(Arrays.asList("service", "status")) .query("source:nginx") .rehydrationMaxScanSizeInGb(100L) .rehydrationTags(Arrays.asList("team:intake", "team:app"))) diff --git a/examples/v2/logs-archives/UpdateLogsArchive.java b/examples/v2/logs-archives/UpdateLogsArchive.java index 9e00f697e00..81da74b352c 100644 --- a/examples/v2/logs-archives/UpdateLogsArchive.java +++ b/examples/v2/logs-archives/UpdateLogsArchive.java @@ -37,7 +37,9 @@ public static void main(String[] args) { .storageAccount("account-name") .type(LogsArchiveDestinationAzureType.AZURE))) .includeTags(false) + .lookupAttributes(Arrays.asList("trace_id", "user_id")) .name("Nginx Archive") + .partitioningAttributes(Arrays.asList("service", "status")) .query("source:nginx") .rehydrationMaxScanSizeInGb(100L) .rehydrationTags(Arrays.asList("team:intake", "team:app"))) diff --git a/examples/v2/security-monitoring/AttachServiceNowTicket.java b/examples/v2/security-monitoring/AttachServiceNowTicket.java new file mode 100644 index 00000000000..132bbc36da9 --- /dev/null +++ b/examples/v2/security-monitoring/AttachServiceNowTicket.java @@ -0,0 +1,62 @@ +// Attach security findings to a ServiceNow ticket returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.AttachServiceNowTicketRequest; +import com.datadog.api.client.v2.model.AttachServiceNowTicketRequestData; +import com.datadog.api.client.v2.model.AttachServiceNowTicketRequestDataAttributes; +import com.datadog.api.client.v2.model.AttachServiceNowTicketRequestDataRelationships; +import com.datadog.api.client.v2.model.CaseManagementProject; +import com.datadog.api.client.v2.model.CaseManagementProjectData; +import com.datadog.api.client.v2.model.CaseManagementProjectDataType; +import com.datadog.api.client.v2.model.FindingCaseResponse; +import com.datadog.api.client.v2.model.FindingData; +import com.datadog.api.client.v2.model.FindingDataType; +import com.datadog.api.client.v2.model.Findings; +import com.datadog.api.client.v2.model.ServiceNowTicketsDataType; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.attachServiceNowTicket", true); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + AttachServiceNowTicketRequest body = + new AttachServiceNowTicketRequest() + .data( + new AttachServiceNowTicketRequestData() + .attributes( + new AttachServiceNowTicketRequestDataAttributes() + .servicenowTicketUrl( + "https://example.service-now.com/now/nav/ui/classic/params/target/incident.do?sys_id=abcdef0123456789abcdef0123456789")) + .relationships( + new AttachServiceNowTicketRequestDataRelationships() + .findings( + new Findings() + .data( + Collections.singletonList( + new FindingData() + .id("ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==") + .type(FindingDataType.FINDINGS)))) + .project( + new CaseManagementProject() + .data( + new CaseManagementProjectData() + .id("aeadc05e-98a8-11ec-ac2c-da7ad0900001") + .type(CaseManagementProjectDataType.PROJECTS)))) + .type(ServiceNowTicketsDataType.SERVICENOW_TICKETS)); + + try { + FindingCaseResponse result = apiInstance.attachServiceNowTicket(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#attachServiceNowTicket"); + 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/security-monitoring/CreateServiceNowTickets.java b/examples/v2/security-monitoring/CreateServiceNowTickets.java new file mode 100644 index 00000000000..8554e9ef525 --- /dev/null +++ b/examples/v2/security-monitoring/CreateServiceNowTickets.java @@ -0,0 +1,67 @@ +// Create ServiceNow tickets for security findings returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.CaseManagementProject; +import com.datadog.api.client.v2.model.CaseManagementProjectData; +import com.datadog.api.client.v2.model.CaseManagementProjectDataType; +import com.datadog.api.client.v2.model.CasePriority; +import com.datadog.api.client.v2.model.CreateServiceNowTicketRequestArray; +import com.datadog.api.client.v2.model.CreateServiceNowTicketRequestData; +import com.datadog.api.client.v2.model.CreateServiceNowTicketRequestDataAttributes; +import com.datadog.api.client.v2.model.CreateServiceNowTicketRequestDataRelationships; +import com.datadog.api.client.v2.model.FindingCaseResponseArray; +import com.datadog.api.client.v2.model.FindingData; +import com.datadog.api.client.v2.model.FindingDataType; +import com.datadog.api.client.v2.model.Findings; +import com.datadog.api.client.v2.model.ServiceNowTicketsDataType; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createServiceNowTickets", true); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + CreateServiceNowTicketRequestArray body = + new CreateServiceNowTicketRequestArray() + .data( + Collections.singletonList( + new CreateServiceNowTicketRequestData() + .attributes( + new CreateServiceNowTicketRequestDataAttributes() + .assigneeId("f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0") + .description("A description of the ServiceNow ticket.") + .priority(CasePriority.NOT_DEFINED) + .title("A title for the ServiceNow ticket.")) + .relationships( + new CreateServiceNowTicketRequestDataRelationships() + .findings( + new Findings() + .data( + Collections.singletonList( + new FindingData() + .id( + "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==") + .type(FindingDataType.FINDINGS)))) + .project( + new CaseManagementProject() + .data( + new CaseManagementProjectData() + .id("aeadc05e-98a8-11ec-ac2c-da7ad0900001") + .type(CaseManagementProjectDataType.PROJECTS)))) + .type(ServiceNowTicketsDataType.SERVICENOW_TICKETS))); + + try { + FindingCaseResponseArray result = apiInstance.createServiceNowTickets(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#createServiceNowTickets"); + 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/security-monitoring/UpdateFindingsAssignee.java b/examples/v2/security-monitoring/UpdateFindingsAssignee.java new file mode 100644 index 00000000000..53aed0cd08c --- /dev/null +++ b/examples/v2/security-monitoring/UpdateFindingsAssignee.java @@ -0,0 +1,53 @@ +// Assign or unassign security findings returns "Accepted" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.AssigneeDataType; +import com.datadog.api.client.v2.model.AssigneeRequest; +import com.datadog.api.client.v2.model.AssigneeRequestData; +import com.datadog.api.client.v2.model.AssigneeRequestDataAttributes; +import com.datadog.api.client.v2.model.AssigneeRequestDataRelationships; +import com.datadog.api.client.v2.model.AssigneeResponse; +import com.datadog.api.client.v2.model.FindingData; +import com.datadog.api.client.v2.model.FindingDataType; +import com.datadog.api.client.v2.model.Findings; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateFindingsAssignee", true); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + AssigneeRequest body = + new AssigneeRequest() + .data( + new AssigneeRequestData() + .attributes( + new AssigneeRequestDataAttributes() + .assigneeId("f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0")) + .id("00000000-0000-0000-0000-000000000001") + .relationships( + new AssigneeRequestDataRelationships() + .findings( + new Findings() + .data( + Collections.singletonList( + new FindingData() + .id("ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==") + .type(FindingDataType.FINDINGS))))) + .type(AssigneeDataType.ASSIGNEE)); + + try { + AssigneeResponse result = apiInstance.updateFindingsAssignee(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#updateFindingsAssignee"); + 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 5a6f55591da..0dd1f292e28 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -891,6 +891,7 @@ public class ApiClient { put("v2.getAWSCloudAuthPersonaMapping", false); put("v2.listAWSCloudAuthPersonaMappings", false); put("v2.activateContentPack", false); + put("v2.attachServiceNowTicket", false); put("v2.batchGetSecurityMonitoringDatasetDependencies", false); put("v2.bulkCreateSampleLogGenerationSubscriptions", false); put("v2.bulkExportSecurityMonitoringTerraformResources", false); @@ -900,6 +901,7 @@ public class ApiClient { put("v2.createSampleLogGenerationSubscription", false); put("v2.createSecurityMonitoringDataset", false); put("v2.createSecurityMonitoringIntegrationConfig", false); + put("v2.createServiceNowTickets", false); put("v2.createStaticAnalysisAst", false); put("v2.createStaticAnalysisServerAnalysis", false); put("v2.deactivateContentPack", false); @@ -941,6 +943,7 @@ public class ApiClient { put("v2.muteFindings", false); put("v2.runHistoricalJob", false); put("v2.searchSecurityMonitoringHistsignals", false); + put("v2.updateFindingsAssignee", false); put("v2.updateSecurityMonitoringDataset", false); put("v2.updateSecurityMonitoringIntegrationConfig", false); put("v2.validateSecurityMonitoringIntegrationConfig", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/MetricsApi.java b/src/main/java/com/datadog/api/client/v2/api/MetricsApi.java index c29ba43a380..20f6afe30cf 100644 --- a/src/main/java/com/datadog/api/client/v2/api/MetricsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/MetricsApi.java @@ -2402,10 +2402,9 @@ public CompletableFuture listVolumesByMetricNameAsync( } /** - * View hourly average metric volumes for the given metric name over the look back period. - * - *

Custom metrics generated in-app from other products will return null for - * ingested volumes. + * View hourly average cardinality for the given metric name over the look back period. For Metric + * Name Pricing customers, view total point volume for the given metric name over the look back + * period. * * @param metricName The name of the metric. (required) * @param parameters Optional parameters for the request. diff --git a/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java b/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java index 9eb3a34faf6..bcb269b2137 100644 --- a/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java @@ -8,8 +8,11 @@ import com.datadog.api.client.v2.model.AnalysisRequest; import com.datadog.api.client.v2.model.AnalysisResponse; import com.datadog.api.client.v2.model.AssetType; +import com.datadog.api.client.v2.model.AssigneeRequest; +import com.datadog.api.client.v2.model.AssigneeResponse; import com.datadog.api.client.v2.model.AttachCaseRequest; import com.datadog.api.client.v2.model.AttachJiraIssueRequest; +import com.datadog.api.client.v2.model.AttachServiceNowTicketRequest; import com.datadog.api.client.v2.model.BulkMuteFindingsRequest; import com.datadog.api.client.v2.model.BulkMuteFindingsResponse; import com.datadog.api.client.v2.model.CloudAssetType; @@ -19,6 +22,7 @@ import com.datadog.api.client.v2.model.CreateCustomFrameworkResponse; import com.datadog.api.client.v2.model.CreateJiraIssueRequestArray; import com.datadog.api.client.v2.model.CreateNotificationRuleParameters; +import com.datadog.api.client.v2.model.CreateServiceNowTicketRequestArray; import com.datadog.api.client.v2.model.DefaultRulesetsPerLanguageResponse; import com.datadog.api.client.v2.model.DeleteCustomFrameworkResponse; import com.datadog.api.client.v2.model.DetachCaseRequest; @@ -641,6 +645,161 @@ public CompletableFuture> attachJiraIssueWithHt new GenericType() {}); } + /** + * Attach security findings to a ServiceNow ticket. + * + *

See {@link #attachServiceNowTicketWithHttpInfo}. + * + * @param body (required) + * @return FindingCaseResponse + * @throws ApiException if fails to make API call + */ + public FindingCaseResponse attachServiceNowTicket(AttachServiceNowTicketRequest body) + throws ApiException { + return attachServiceNowTicketWithHttpInfo(body).getData(); + } + + /** + * Attach security findings to a ServiceNow ticket. + * + *

See {@link #attachServiceNowTicketWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<FindingCaseResponse> + */ + public CompletableFuture attachServiceNowTicketAsync( + AttachServiceNowTicketRequest body) { + return attachServiceNowTicketWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Attach security findings to a ServiceNow ticket by providing the ServiceNow ticket URL. You can + * attach up to 50 security findings per ServiceNow ticket. If the ServiceNow ticket is not linked + * to any case, this operation will create a case for the security findings and link the + * ServiceNow ticket to the newly created case. Security findings that are already attached to + * another ServiceNow ticket will be detached from their previous ServiceNow ticket and attached + * to the specified ServiceNow ticket. + * + * @param body (required) + * @return ApiResponse<FindingCaseResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse attachServiceNowTicketWithHttpInfo( + AttachServiceNowTicketRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "attachServiceNowTicket"; + 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 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling attachServiceNowTicket"); + } + // create path and map variables + String localVarPath = "/api/v2/security/findings/servicenow_tickets"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.attachServiceNowTicket", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Attach security findings to a ServiceNow ticket. + * + *

See {@link #attachServiceNowTicketWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<FindingCaseResponse>> + */ + public CompletableFuture> + attachServiceNowTicketWithHttpInfoAsync(AttachServiceNowTicketRequest body) { + // Check if unstable operation is enabled + String operationId = "attachServiceNowTicket"; + 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 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling attachServiceNowTicket")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/security/findings/servicenow_tickets"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.attachServiceNowTicket", + 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( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Get dataset dependencies. * @@ -4281,6 +4440,161 @@ public SecurityMonitoringSuppressionResponse createSecurityMonitoringSuppression new GenericType() {}); } + /** + * Create ServiceNow tickets for security findings. + * + *

See {@link #createServiceNowTicketsWithHttpInfo}. + * + * @param body (required) + * @return FindingCaseResponseArray + * @throws ApiException if fails to make API call + */ + public FindingCaseResponseArray createServiceNowTickets(CreateServiceNowTicketRequestArray body) + throws ApiException { + return createServiceNowTicketsWithHttpInfo(body).getData(); + } + + /** + * Create ServiceNow tickets for security findings. + * + *

See {@link #createServiceNowTicketsWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<FindingCaseResponseArray> + */ + public CompletableFuture createServiceNowTicketsAsync( + CreateServiceNowTicketRequestArray body) { + return createServiceNowTicketsWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create ServiceNow tickets for security findings. This operation creates a case in Datadog and a + * ServiceNow ticket linked to that case for bidirectional sync between Datadog and ServiceNow. + * You can create up to 50 ServiceNow tickets per request and associate up to 50 security findings + * per ServiceNow ticket. Security findings that are already attached to another ServiceNow ticket + * will be detached from their previous ServiceNow ticket and attached to the newly created + * ServiceNow ticket. + * + * @param body (required) + * @return ApiResponse<FindingCaseResponseArray> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse createServiceNowTicketsWithHttpInfo( + CreateServiceNowTicketRequestArray body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "createServiceNowTickets"; + 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 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createServiceNowTickets"); + } + // create path and map variables + String localVarPath = "/api/v2/security/findings/servicenow_tickets"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.createServiceNowTickets", + 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 ServiceNow tickets for security findings. + * + *

See {@link #createServiceNowTicketsWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<FindingCaseResponseArray>> + */ + public CompletableFuture> + createServiceNowTicketsWithHttpInfoAsync(CreateServiceNowTicketRequestArray body) { + // Check if unstable operation is enabled + String operationId = "createServiceNowTickets"; + 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 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createServiceNowTickets")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/security/findings/servicenow_tickets"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.createServiceNowTickets", + 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() {}); + } + /** * Create a new signal-based notification rule. * @@ -21812,6 +22126,158 @@ public ApiResponse updateCustomFrameworkWithHttpI new GenericType() {}); } + /** + * Assign or unassign security findings. + * + *

See {@link #updateFindingsAssigneeWithHttpInfo}. + * + * @param body (required) + * @return AssigneeResponse + * @throws ApiException if fails to make API call + */ + public AssigneeResponse updateFindingsAssignee(AssigneeRequest body) throws ApiException { + return updateFindingsAssigneeWithHttpInfo(body).getData(); + } + + /** + * Assign or unassign security findings. + * + *

See {@link #updateFindingsAssigneeWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<AssigneeResponse> + */ + public CompletableFuture updateFindingsAssigneeAsync(AssigneeRequest body) { + return updateFindingsAssigneeWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Assign or unassign security findings. You can assign up to 100 security findings per request. + * Set assignee_id to the unique identifier of the Datadog user you want to assign + * the findings to. Omit assignee_id (or set it to null) to unassign the + * findings. Per-finding warnings and failures are returned in the response meta + * object. + * + * @param body (required) + * @return ApiResponse<AssigneeResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
202 Accepted -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updateFindingsAssigneeWithHttpInfo(AssigneeRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateFindingsAssignee"; + 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 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateFindingsAssignee"); + } + // create path and map variables + String localVarPath = "/api/v2/security/findings/assignee"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.updateFindingsAssignee", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Assign or unassign security findings. + * + *

See {@link #updateFindingsAssigneeWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<AssigneeResponse>> + */ + public CompletableFuture> updateFindingsAssigneeWithHttpInfoAsync( + AssigneeRequest body) { + // Check if unstable operation is enabled + String operationId = "updateFindingsAssignee"; + 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 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateFindingsAssignee")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/security/findings/assignee"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.updateFindingsAssignee", + 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( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Update resource filters. * diff --git a/src/main/java/com/datadog/api/client/v2/model/AssigneeDataType.java b/src/main/java/com/datadog/api/client/v2/model/AssigneeDataType.java new file mode 100644 index 00000000000..1ca65ec7dd7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AssigneeDataType.java @@ -0,0 +1,53 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Assignee resource type. */ +@JsonSerialize(using = AssigneeDataType.AssigneeDataTypeSerializer.class) +public class AssigneeDataType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("assignee")); + + public static final AssigneeDataType ASSIGNEE = new AssigneeDataType("assignee"); + + AssigneeDataType(String value) { + super(value, allowedValues); + } + + public static class AssigneeDataTypeSerializer extends StdSerializer { + public AssigneeDataTypeSerializer(Class t) { + super(t); + } + + public AssigneeDataTypeSerializer() { + this(null); + } + + @Override + public void serialize(AssigneeDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static AssigneeDataType fromValue(String value) { + return new AssigneeDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AssigneeRequest.java b/src/main/java/com/datadog/api/client/v2/model/AssigneeRequest.java new file mode 100644 index 00000000000..8c47fb08e31 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AssigneeRequest.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; + +/** Request to assign or unassign security findings. */ +@JsonPropertyOrder({AssigneeRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AssigneeRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private AssigneeRequestData data; + + public AssigneeRequest() {} + + @JsonCreator + public AssigneeRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) AssigneeRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public AssigneeRequest data(AssigneeRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data of the assignee request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AssigneeRequestData getData() { + return data; + } + + public void setData(AssigneeRequestData 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 AssigneeRequest + */ + @JsonAnySetter + public AssigneeRequest 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 AssigneeRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssigneeRequest assigneeRequest = (AssigneeRequest) o; + return Objects.equals(this.data, assigneeRequest.data) + && Objects.equals(this.additionalProperties, assigneeRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssigneeRequest {\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/AssigneeRequestData.java b/src/main/java/com/datadog/api/client/v2/model/AssigneeRequestData.java new file mode 100644 index 00000000000..4e66b5edfa2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AssigneeRequestData.java @@ -0,0 +1,236 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data of the assignee request. */ +@JsonPropertyOrder({ + AssigneeRequestData.JSON_PROPERTY_ATTRIBUTES, + AssigneeRequestData.JSON_PROPERTY_ID, + AssigneeRequestData.JSON_PROPERTY_RELATIONSHIPS, + AssigneeRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AssigneeRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private AssigneeRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private AssigneeRequestDataRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AssigneeDataType type = AssigneeDataType.ASSIGNEE; + + public AssigneeRequestData() {} + + @JsonCreator + public AssigneeRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_RELATIONSHIPS) + AssigneeRequestDataRelationships relationships, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) AssigneeDataType type) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public AssigneeRequestData attributes(AssigneeRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the assignee request. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AssigneeRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(AssigneeRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public AssigneeRequestData id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier of the assignee request. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AssigneeRequestData relationships(AssigneeRequestDataRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships of the assignee request. + * + * @return relationships + */ + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AssigneeRequestDataRelationships getRelationships() { + return relationships; + } + + public void setRelationships(AssigneeRequestDataRelationships relationships) { + this.relationships = relationships; + } + + public AssigneeRequestData type(AssigneeDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Assignee resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AssigneeDataType getType() { + return type; + } + + public void setType(AssigneeDataType 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 AssigneeRequestData + */ + @JsonAnySetter + public AssigneeRequestData 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 AssigneeRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssigneeRequestData assigneeRequestData = (AssigneeRequestData) o; + return Objects.equals(this.attributes, assigneeRequestData.attributes) + && Objects.equals(this.id, assigneeRequestData.id) + && Objects.equals(this.relationships, assigneeRequestData.relationships) + && Objects.equals(this.type, assigneeRequestData.type) + && Objects.equals(this.additionalProperties, assigneeRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssigneeRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AssigneeRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AssigneeRequestDataAttributes.java new file mode 100644 index 00000000000..ca8c96ba564 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AssigneeRequestDataAttributes.java @@ -0,0 +1,137 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of the assignee request. */ +@JsonPropertyOrder({AssigneeRequestDataAttributes.JSON_PROPERTY_ASSIGNEE_ID}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AssigneeRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ASSIGNEE_ID = "assignee_id"; + private String assigneeId; + + public AssigneeRequestDataAttributes assigneeId(String assigneeId) { + this.assigneeId = assigneeId; + return this; + } + + /** + * Unique identifier of the Datadog user to assign the security findings to. If this field is not + * provided, the security findings are unassigned. + * + * @return assigneeId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ASSIGNEE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAssigneeId() { + return assigneeId; + } + + public void setAssigneeId(String assigneeId) { + this.assigneeId = assigneeId; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AssigneeRequestDataAttributes + */ + @JsonAnySetter + public AssigneeRequestDataAttributes 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 AssigneeRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssigneeRequestDataAttributes assigneeRequestDataAttributes = (AssigneeRequestDataAttributes) o; + return Objects.equals(this.assigneeId, assigneeRequestDataAttributes.assigneeId) + && Objects.equals( + this.additionalProperties, assigneeRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(assigneeId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssigneeRequestDataAttributes {\n"); + sb.append(" assigneeId: ").append(toIndentedString(assigneeId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AssigneeRequestDataRelationships.java b/src/main/java/com/datadog/api/client/v2/model/AssigneeRequestDataRelationships.java new file mode 100644 index 00000000000..80b9e382c54 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AssigneeRequestDataRelationships.java @@ -0,0 +1,147 @@ +/* + * 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; + +/** Relationships of the assignee request. */ +@JsonPropertyOrder({AssigneeRequestDataRelationships.JSON_PROPERTY_FINDINGS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AssigneeRequestDataRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FINDINGS = "findings"; + private Findings findings; + + public AssigneeRequestDataRelationships() {} + + @JsonCreator + public AssigneeRequestDataRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_FINDINGS) Findings findings) { + this.findings = findings; + this.unparsed |= findings.unparsed; + } + + public AssigneeRequestDataRelationships findings(Findings findings) { + this.findings = findings; + this.unparsed |= findings.unparsed; + return this; + } + + /** + * A list of security findings. + * + * @return findings + */ + @JsonProperty(JSON_PROPERTY_FINDINGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Findings getFindings() { + return findings; + } + + public void setFindings(Findings findings) { + this.findings = findings; + } + + /** + * 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 AssigneeRequestDataRelationships + */ + @JsonAnySetter + public AssigneeRequestDataRelationships 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 AssigneeRequestDataRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssigneeRequestDataRelationships assigneeRequestDataRelationships = + (AssigneeRequestDataRelationships) o; + return Objects.equals(this.findings, assigneeRequestDataRelationships.findings) + && Objects.equals( + this.additionalProperties, assigneeRequestDataRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(findings, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssigneeRequestDataRelationships {\n"); + sb.append(" findings: ").append(toIndentedString(findings)).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/AssigneeResponse.java b/src/main/java/com/datadog/api/client/v2/model/AssigneeResponse.java new file mode 100644 index 00000000000..1d7d40a021e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AssigneeResponse.java @@ -0,0 +1,172 @@ +/* + * 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; + +/** Response for the assign or unassign request. */ +@JsonPropertyOrder({AssigneeResponse.JSON_PROPERTY_DATA, AssigneeResponse.JSON_PROPERTY_META}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AssigneeResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private AssigneeResponseData data; + + public static final String JSON_PROPERTY_META = "meta"; + private AssigneeResponseMeta meta; + + public AssigneeResponse() {} + + @JsonCreator + public AssigneeResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) AssigneeResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public AssigneeResponse data(AssigneeResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data of the assignee response. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AssigneeResponseData getData() { + return data; + } + + public void setData(AssigneeResponseData data) { + this.data = data; + } + + public AssigneeResponse meta(AssigneeResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Per-finding warnings and failures produced while processing the bulk assignee request. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AssigneeResponseMeta getMeta() { + return meta; + } + + public void setMeta(AssigneeResponseMeta meta) { + this.meta = meta; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AssigneeResponse + */ + @JsonAnySetter + public AssigneeResponse 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 AssigneeResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssigneeResponse assigneeResponse = (AssigneeResponse) o; + return Objects.equals(this.data, assigneeResponse.data) + && Objects.equals(this.meta, assigneeResponse.meta) + && Objects.equals(this.additionalProperties, assigneeResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssigneeResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AssigneeResponseData.java b/src/main/java/com/datadog/api/client/v2/model/AssigneeResponseData.java new file mode 100644 index 00000000000..e08b9bf7911 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AssigneeResponseData.java @@ -0,0 +1,209 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data of the assignee response. */ +@JsonPropertyOrder({ + AssigneeResponseData.JSON_PROPERTY_ATTRIBUTES, + AssigneeResponseData.JSON_PROPERTY_ID, + AssigneeResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AssigneeResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private AssigneeResponseDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AssigneeDataType type = AssigneeDataType.ASSIGNEE; + + public AssigneeResponseData() {} + + @JsonCreator + public AssigneeResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + AssigneeResponseDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) AssigneeDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public AssigneeResponseData attributes(AssigneeResponseDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the assignee response. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AssigneeResponseDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(AssigneeResponseDataAttributes attributes) { + this.attributes = attributes; + } + + public AssigneeResponseData id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier of the assignee request. + * + * @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 AssigneeResponseData type(AssigneeDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Assignee resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AssigneeDataType getType() { + return type; + } + + public void setType(AssigneeDataType 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 AssigneeResponseData + */ + @JsonAnySetter + public AssigneeResponseData 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 AssigneeResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssigneeResponseData assigneeResponseData = (AssigneeResponseData) o; + return Objects.equals(this.attributes, assigneeResponseData.attributes) + && Objects.equals(this.id, assigneeResponseData.id) + && Objects.equals(this.type, assigneeResponseData.type) + && Objects.equals(this.additionalProperties, assigneeResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssigneeResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\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/AssigneeResponseDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AssigneeResponseDataAttributes.java new file mode 100644 index 00000000000..85763ebff7d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AssigneeResponseDataAttributes.java @@ -0,0 +1,138 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of the assignee response. */ +@JsonPropertyOrder({AssigneeResponseDataAttributes.JSON_PROPERTY_ASSIGNEE_ID}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AssigneeResponseDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ASSIGNEE_ID = "assignee_id"; + private String assigneeId; + + public AssigneeResponseDataAttributes assigneeId(String assigneeId) { + this.assigneeId = assigneeId; + return this; + } + + /** + * Unique identifier of the Datadog user assigned to the security findings. Omitted when the + * findings were unassigned. + * + * @return assigneeId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ASSIGNEE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAssigneeId() { + return assigneeId; + } + + public void setAssigneeId(String assigneeId) { + this.assigneeId = assigneeId; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AssigneeResponseDataAttributes + */ + @JsonAnySetter + public AssigneeResponseDataAttributes 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 AssigneeResponseDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssigneeResponseDataAttributes assigneeResponseDataAttributes = + (AssigneeResponseDataAttributes) o; + return Objects.equals(this.assigneeId, assigneeResponseDataAttributes.assigneeId) + && Objects.equals( + this.additionalProperties, assigneeResponseDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(assigneeId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssigneeResponseDataAttributes {\n"); + sb.append(" assigneeId: ").append(toIndentedString(assigneeId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AssigneeResponseMeta.java b/src/main/java/com/datadog/api/client/v2/model/AssigneeResponseMeta.java new file mode 100644 index 00000000000..f94ee77ab88 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AssigneeResponseMeta.java @@ -0,0 +1,191 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Per-finding warnings and failures produced while processing the bulk assignee request. */ +@JsonPropertyOrder({ + AssigneeResponseMeta.JSON_PROPERTY_FAILURES, + AssigneeResponseMeta.JSON_PROPERTY_WARNINGS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AssigneeResponseMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FAILURES = "failures"; + private List failures = null; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private List warnings = null; + + public AssigneeResponseMeta failures(List failures) { + this.failures = failures; + for (AssignmentResult item : failures) { + this.unparsed |= item.unparsed; + } + return this; + } + + public AssigneeResponseMeta addFailuresItem(AssignmentResult failuresItem) { + if (this.failures == null) { + this.failures = new ArrayList<>(); + } + this.failures.add(failuresItem); + this.unparsed |= failuresItem.unparsed; + return this; + } + + /** + * Findings that could not be assigned or unassigned. + * + * @return failures + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FAILURES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFailures() { + return failures; + } + + public void setFailures(List failures) { + this.failures = failures; + } + + public AssigneeResponseMeta warnings(List warnings) { + this.warnings = warnings; + for (AssignmentResult item : warnings) { + this.unparsed |= item.unparsed; + } + return this; + } + + public AssigneeResponseMeta addWarningsItem(AssignmentResult warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + this.unparsed |= warningsItem.unparsed; + return this; + } + + /** + * Findings for which the assignment succeeded but a non-critical error occurred during + * processing. + * + * @return warnings + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** + * 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 AssigneeResponseMeta + */ + @JsonAnySetter + public AssigneeResponseMeta 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 AssigneeResponseMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssigneeResponseMeta assigneeResponseMeta = (AssigneeResponseMeta) o; + return Objects.equals(this.failures, assigneeResponseMeta.failures) + && Objects.equals(this.warnings, assigneeResponseMeta.warnings) + && Objects.equals(this.additionalProperties, assigneeResponseMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(failures, warnings, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssigneeResponseMeta {\n"); + sb.append(" failures: ").append(toIndentedString(failures)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).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/AssignmentResult.java b/src/main/java/com/datadog/api/client/v2/model/AssignmentResult.java new file mode 100644 index 00000000000..7ca11446453 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AssignmentResult.java @@ -0,0 +1,229 @@ +/* + * 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; + +/** Per-finding outcome of an assign or unassign operation. */ +@JsonPropertyOrder({ + AssignmentResult.JSON_PROPERTY_DETAIL, + AssignmentResult.JSON_PROPERTY_FINDING_ID, + AssignmentResult.JSON_PROPERTY_STATUS, + AssignmentResult.JSON_PROPERTY_TITLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AssignmentResult { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DETAIL = "detail"; + private String detail; + + public static final String JSON_PROPERTY_FINDING_ID = "finding_id"; + private String findingId; + + public static final String JSON_PROPERTY_STATUS = "status"; + private Integer status; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public AssignmentResult() {} + + @JsonCreator + public AssignmentResult( + @JsonProperty(required = true, value = JSON_PROPERTY_DETAIL) String detail, + @JsonProperty(required = true, value = JSON_PROPERTY_FINDING_ID) String findingId, + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) Integer status, + @JsonProperty(required = true, value = JSON_PROPERTY_TITLE) String title) { + this.detail = detail; + this.findingId = findingId; + this.status = status; + this.title = title; + } + + public AssignmentResult detail(String detail) { + this.detail = detail; + return this; + } + + /** + * Human-readable explanation of the outcome. + * + * @return detail + */ + @JsonProperty(JSON_PROPERTY_DETAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDetail() { + return detail; + } + + public void setDetail(String detail) { + this.detail = detail; + } + + public AssignmentResult findingId(String findingId) { + this.findingId = findingId; + return this; + } + + /** + * Unique identifier of the security finding. + * + * @return findingId + */ + @JsonProperty(JSON_PROPERTY_FINDING_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFindingId() { + return findingId; + } + + public void setFindingId(String findingId) { + this.findingId = findingId; + } + + public AssignmentResult status(Integer status) { + this.status = status; + return this; + } + + /** + * HTTP-like status code describing the outcome for this finding. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public AssignmentResult title(String title) { + this.title = title; + return this; + } + + /** + * Short label describing the outcome for this finding. + * + * @return title + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + /** + * 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 AssignmentResult + */ + @JsonAnySetter + public AssignmentResult 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 AssignmentResult object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssignmentResult assignmentResult = (AssignmentResult) o; + return Objects.equals(this.detail, assignmentResult.detail) + && Objects.equals(this.findingId, assignmentResult.findingId) + && Objects.equals(this.status, assignmentResult.status) + && Objects.equals(this.title, assignmentResult.title) + && Objects.equals(this.additionalProperties, assignmentResult.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(detail, findingId, status, title, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssignmentResult {\n"); + sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); + sb.append(" findingId: ").append(toIndentedString(findingId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).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/AttachServiceNowTicketRequest.java b/src/main/java/com/datadog/api/client/v2/model/AttachServiceNowTicketRequest.java new file mode 100644 index 00000000000..add3104d9b7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AttachServiceNowTicketRequest.java @@ -0,0 +1,147 @@ +/* + * 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; + +/** Request for attaching security findings to a ServiceNow ticket. */ +@JsonPropertyOrder({AttachServiceNowTicketRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AttachServiceNowTicketRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private AttachServiceNowTicketRequestData data; + + public AttachServiceNowTicketRequest() {} + + @JsonCreator + public AttachServiceNowTicketRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + AttachServiceNowTicketRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public AttachServiceNowTicketRequest data(AttachServiceNowTicketRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data of the ServiceNow ticket to attach security findings to. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AttachServiceNowTicketRequestData getData() { + return data; + } + + public void setData(AttachServiceNowTicketRequestData 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 AttachServiceNowTicketRequest + */ + @JsonAnySetter + public AttachServiceNowTicketRequest 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 AttachServiceNowTicketRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AttachServiceNowTicketRequest attachServiceNowTicketRequest = (AttachServiceNowTicketRequest) o; + return Objects.equals(this.data, attachServiceNowTicketRequest.data) + && Objects.equals( + this.additionalProperties, attachServiceNowTicketRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AttachServiceNowTicketRequest {\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/AttachServiceNowTicketRequestData.java b/src/main/java/com/datadog/api/client/v2/model/AttachServiceNowTicketRequestData.java new file mode 100644 index 00000000000..213398db35a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AttachServiceNowTicketRequestData.java @@ -0,0 +1,216 @@ +/* + * 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; + +/** Data of the ServiceNow ticket to attach security findings to. */ +@JsonPropertyOrder({ + AttachServiceNowTicketRequestData.JSON_PROPERTY_ATTRIBUTES, + AttachServiceNowTicketRequestData.JSON_PROPERTY_RELATIONSHIPS, + AttachServiceNowTicketRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AttachServiceNowTicketRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private AttachServiceNowTicketRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private AttachServiceNowTicketRequestDataRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ServiceNowTicketsDataType type = ServiceNowTicketsDataType.SERVICENOW_TICKETS; + + public AttachServiceNowTicketRequestData() {} + + @JsonCreator + public AttachServiceNowTicketRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + AttachServiceNowTicketRequestDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_RELATIONSHIPS) + AttachServiceNowTicketRequestDataRelationships relationships, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ServiceNowTicketsDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public AttachServiceNowTicketRequestData attributes( + AttachServiceNowTicketRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the ServiceNow ticket to attach security findings to. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AttachServiceNowTicketRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(AttachServiceNowTicketRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public AttachServiceNowTicketRequestData relationships( + AttachServiceNowTicketRequestDataRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships of the ServiceNow ticket to attach security findings to. + * + * @return relationships + */ + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AttachServiceNowTicketRequestDataRelationships getRelationships() { + return relationships; + } + + public void setRelationships(AttachServiceNowTicketRequestDataRelationships relationships) { + this.relationships = relationships; + } + + public AttachServiceNowTicketRequestData type(ServiceNowTicketsDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * ServiceNow tickets resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceNowTicketsDataType getType() { + return type; + } + + public void setType(ServiceNowTicketsDataType 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 AttachServiceNowTicketRequestData + */ + @JsonAnySetter + public AttachServiceNowTicketRequestData 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 AttachServiceNowTicketRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AttachServiceNowTicketRequestData attachServiceNowTicketRequestData = + (AttachServiceNowTicketRequestData) o; + return Objects.equals(this.attributes, attachServiceNowTicketRequestData.attributes) + && Objects.equals(this.relationships, attachServiceNowTicketRequestData.relationships) + && Objects.equals(this.type, attachServiceNowTicketRequestData.type) + && Objects.equals( + this.additionalProperties, attachServiceNowTicketRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AttachServiceNowTicketRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AttachServiceNowTicketRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AttachServiceNowTicketRequestDataAttributes.java new file mode 100644 index 00000000000..71880d245d3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AttachServiceNowTicketRequestDataAttributes.java @@ -0,0 +1,156 @@ +/* + * 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; + +/** Attributes of the ServiceNow ticket to attach security findings to. */ +@JsonPropertyOrder({ + AttachServiceNowTicketRequestDataAttributes.JSON_PROPERTY_SERVICENOW_TICKET_URL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AttachServiceNowTicketRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_SERVICENOW_TICKET_URL = "servicenow_ticket_url"; + private String servicenowTicketUrl; + + public AttachServiceNowTicketRequestDataAttributes() {} + + @JsonCreator + public AttachServiceNowTicketRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_SERVICENOW_TICKET_URL) + String servicenowTicketUrl) { + this.servicenowTicketUrl = servicenowTicketUrl; + } + + public AttachServiceNowTicketRequestDataAttributes servicenowTicketUrl( + String servicenowTicketUrl) { + this.servicenowTicketUrl = servicenowTicketUrl; + return this; + } + + /** + * URL of the ServiceNow incident to attach security findings to. Must be a service-now.com URL + * pointing to an incident record. + * + * @return servicenowTicketUrl + */ + @JsonProperty(JSON_PROPERTY_SERVICENOW_TICKET_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getServicenowTicketUrl() { + return servicenowTicketUrl; + } + + public void setServicenowTicketUrl(String servicenowTicketUrl) { + this.servicenowTicketUrl = servicenowTicketUrl; + } + + /** + * 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 AttachServiceNowTicketRequestDataAttributes + */ + @JsonAnySetter + public AttachServiceNowTicketRequestDataAttributes 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 AttachServiceNowTicketRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AttachServiceNowTicketRequestDataAttributes attachServiceNowTicketRequestDataAttributes = + (AttachServiceNowTicketRequestDataAttributes) o; + return Objects.equals( + this.servicenowTicketUrl, + attachServiceNowTicketRequestDataAttributes.servicenowTicketUrl) + && Objects.equals( + this.additionalProperties, + attachServiceNowTicketRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(servicenowTicketUrl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AttachServiceNowTicketRequestDataAttributes {\n"); + sb.append(" servicenowTicketUrl: ") + .append(toIndentedString(servicenowTicketUrl)) + .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/AttachServiceNowTicketRequestDataRelationships.java b/src/main/java/com/datadog/api/client/v2/model/AttachServiceNowTicketRequestDataRelationships.java new file mode 100644 index 00000000000..9ebec80349e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AttachServiceNowTicketRequestDataRelationships.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; + +/** Relationships of the ServiceNow ticket to attach security findings to. */ +@JsonPropertyOrder({ + AttachServiceNowTicketRequestDataRelationships.JSON_PROPERTY_FINDINGS, + AttachServiceNowTicketRequestDataRelationships.JSON_PROPERTY_PROJECT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AttachServiceNowTicketRequestDataRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FINDINGS = "findings"; + private Findings findings; + + public static final String JSON_PROPERTY_PROJECT = "project"; + private CaseManagementProject project; + + public AttachServiceNowTicketRequestDataRelationships() {} + + @JsonCreator + public AttachServiceNowTicketRequestDataRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_FINDINGS) Findings findings, + @JsonProperty(required = true, value = JSON_PROPERTY_PROJECT) CaseManagementProject project) { + this.findings = findings; + this.unparsed |= findings.unparsed; + this.project = project; + this.unparsed |= project.unparsed; + } + + public AttachServiceNowTicketRequestDataRelationships findings(Findings findings) { + this.findings = findings; + this.unparsed |= findings.unparsed; + return this; + } + + /** + * A list of security findings. + * + * @return findings + */ + @JsonProperty(JSON_PROPERTY_FINDINGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Findings getFindings() { + return findings; + } + + public void setFindings(Findings findings) { + this.findings = findings; + } + + public AttachServiceNowTicketRequestDataRelationships project(CaseManagementProject project) { + this.project = project; + this.unparsed |= project.unparsed; + return this; + } + + /** + * Case management project. + * + * @return project + */ + @JsonProperty(JSON_PROPERTY_PROJECT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseManagementProject getProject() { + return project; + } + + public void setProject(CaseManagementProject project) { + this.project = project; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AttachServiceNowTicketRequestDataRelationships + */ + @JsonAnySetter + public AttachServiceNowTicketRequestDataRelationships 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 AttachServiceNowTicketRequestDataRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AttachServiceNowTicketRequestDataRelationships attachServiceNowTicketRequestDataRelationships = + (AttachServiceNowTicketRequestDataRelationships) o; + return Objects.equals(this.findings, attachServiceNowTicketRequestDataRelationships.findings) + && Objects.equals(this.project, attachServiceNowTicketRequestDataRelationships.project) + && Objects.equals( + this.additionalProperties, + attachServiceNowTicketRequestDataRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(findings, project, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AttachServiceNowTicketRequestDataRelationships {\n"); + sb.append(" findings: ").append(toIndentedString(findings)).append("\n"); + sb.append(" project: ").append(toIndentedString(project)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateServiceNowTicketRequestArray.java b/src/main/java/com/datadog/api/client/v2/model/CreateServiceNowTicketRequestArray.java new file mode 100644 index 00000000000..c597eabbd10 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateServiceNowTicketRequestArray.java @@ -0,0 +1,158 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** List of requests to create ServiceNow tickets for security findings. */ +@JsonPropertyOrder({CreateServiceNowTicketRequestArray.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateServiceNowTicketRequestArray { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public CreateServiceNowTicketRequestArray() {} + + @JsonCreator + public CreateServiceNowTicketRequestArray( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + } + + public CreateServiceNowTicketRequestArray data(List data) { + this.data = data; + for (CreateServiceNowTicketRequestData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CreateServiceNowTicketRequestArray addDataItem( + CreateServiceNowTicketRequestData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of ServiceNow ticket creation request data objects. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateServiceNowTicketRequestArray + */ + @JsonAnySetter + public CreateServiceNowTicketRequestArray 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 CreateServiceNowTicketRequestArray object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateServiceNowTicketRequestArray createServiceNowTicketRequestArray = + (CreateServiceNowTicketRequestArray) o; + return Objects.equals(this.data, createServiceNowTicketRequestArray.data) + && Objects.equals( + this.additionalProperties, createServiceNowTicketRequestArray.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateServiceNowTicketRequestArray {\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/CreateServiceNowTicketRequestData.java b/src/main/java/com/datadog/api/client/v2/model/CreateServiceNowTicketRequestData.java new file mode 100644 index 00000000000..c43a0842c19 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateServiceNowTicketRequestData.java @@ -0,0 +1,213 @@ +/* + * 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; + +/** Data of the ServiceNow ticket to create. */ +@JsonPropertyOrder({ + CreateServiceNowTicketRequestData.JSON_PROPERTY_ATTRIBUTES, + CreateServiceNowTicketRequestData.JSON_PROPERTY_RELATIONSHIPS, + CreateServiceNowTicketRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateServiceNowTicketRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CreateServiceNowTicketRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private CreateServiceNowTicketRequestDataRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ServiceNowTicketsDataType type = ServiceNowTicketsDataType.SERVICENOW_TICKETS; + + public CreateServiceNowTicketRequestData() {} + + @JsonCreator + public CreateServiceNowTicketRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_RELATIONSHIPS) + CreateServiceNowTicketRequestDataRelationships relationships, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ServiceNowTicketsDataType type) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CreateServiceNowTicketRequestData attributes( + CreateServiceNowTicketRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the ServiceNow ticket to create. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateServiceNowTicketRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CreateServiceNowTicketRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public CreateServiceNowTicketRequestData relationships( + CreateServiceNowTicketRequestDataRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships of the ServiceNow ticket to create. + * + * @return relationships + */ + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CreateServiceNowTicketRequestDataRelationships getRelationships() { + return relationships; + } + + public void setRelationships(CreateServiceNowTicketRequestDataRelationships relationships) { + this.relationships = relationships; + } + + public CreateServiceNowTicketRequestData type(ServiceNowTicketsDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * ServiceNow tickets resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceNowTicketsDataType getType() { + return type; + } + + public void setType(ServiceNowTicketsDataType 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 CreateServiceNowTicketRequestData + */ + @JsonAnySetter + public CreateServiceNowTicketRequestData 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 CreateServiceNowTicketRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateServiceNowTicketRequestData createServiceNowTicketRequestData = + (CreateServiceNowTicketRequestData) o; + return Objects.equals(this.attributes, createServiceNowTicketRequestData.attributes) + && Objects.equals(this.relationships, createServiceNowTicketRequestData.relationships) + && Objects.equals(this.type, createServiceNowTicketRequestData.type) + && Objects.equals( + this.additionalProperties, createServiceNowTicketRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateServiceNowTicketRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateServiceNowTicketRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateServiceNowTicketRequestDataAttributes.java new file mode 100644 index 00000000000..afbe61173a8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateServiceNowTicketRequestDataAttributes.java @@ -0,0 +1,227 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of the ServiceNow ticket to create. */ +@JsonPropertyOrder({ + CreateServiceNowTicketRequestDataAttributes.JSON_PROPERTY_ASSIGNEE_ID, + CreateServiceNowTicketRequestDataAttributes.JSON_PROPERTY_DESCRIPTION, + CreateServiceNowTicketRequestDataAttributes.JSON_PROPERTY_PRIORITY, + CreateServiceNowTicketRequestDataAttributes.JSON_PROPERTY_TITLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateServiceNowTicketRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ASSIGNEE_ID = "assignee_id"; + private String assigneeId; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_PRIORITY = "priority"; + private CasePriority priority = CasePriority.NOT_DEFINED; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public CreateServiceNowTicketRequestDataAttributes assigneeId(String assigneeId) { + this.assigneeId = assigneeId; + return this; + } + + /** + * Unique identifier of the Datadog user assigned to the case backing the ServiceNow ticket. + * + * @return assigneeId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ASSIGNEE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAssigneeId() { + return assigneeId; + } + + public void setAssigneeId(String assigneeId) { + this.assigneeId = assigneeId; + } + + public CreateServiceNowTicketRequestDataAttributes description(String description) { + this.description = description; + return this; + } + + /** + * Description of the ServiceNow ticket. If not provided, the description will be automatically + * generated. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public CreateServiceNowTicketRequestDataAttributes priority(CasePriority priority) { + this.priority = priority; + this.unparsed |= !priority.isValid(); + return this; + } + + /** + * Case priority + * + * @return priority + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIORITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CasePriority getPriority() { + return priority; + } + + public void setPriority(CasePriority priority) { + if (!priority.isValid()) { + this.unparsed = true; + } + this.priority = priority; + } + + public CreateServiceNowTicketRequestDataAttributes title(String title) { + this.title = title; + return this; + } + + /** + * Title of the ServiceNow ticket. If not provided, the title will be automatically generated. + * + * @return title + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + /** + * 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 CreateServiceNowTicketRequestDataAttributes + */ + @JsonAnySetter + public CreateServiceNowTicketRequestDataAttributes 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 CreateServiceNowTicketRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateServiceNowTicketRequestDataAttributes createServiceNowTicketRequestDataAttributes = + (CreateServiceNowTicketRequestDataAttributes) o; + return Objects.equals(this.assigneeId, createServiceNowTicketRequestDataAttributes.assigneeId) + && Objects.equals(this.description, createServiceNowTicketRequestDataAttributes.description) + && Objects.equals(this.priority, createServiceNowTicketRequestDataAttributes.priority) + && Objects.equals(this.title, createServiceNowTicketRequestDataAttributes.title) + && Objects.equals( + this.additionalProperties, + createServiceNowTicketRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(assigneeId, description, priority, title, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateServiceNowTicketRequestDataAttributes {\n"); + sb.append(" assigneeId: ").append(toIndentedString(assigneeId)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" 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/CreateServiceNowTicketRequestDataRelationships.java b/src/main/java/com/datadog/api/client/v2/model/CreateServiceNowTicketRequestDataRelationships.java new file mode 100644 index 00000000000..1f6cde84c21 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateServiceNowTicketRequestDataRelationships.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; + +/** Relationships of the ServiceNow ticket to create. */ +@JsonPropertyOrder({ + CreateServiceNowTicketRequestDataRelationships.JSON_PROPERTY_FINDINGS, + CreateServiceNowTicketRequestDataRelationships.JSON_PROPERTY_PROJECT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateServiceNowTicketRequestDataRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FINDINGS = "findings"; + private Findings findings; + + public static final String JSON_PROPERTY_PROJECT = "project"; + private CaseManagementProject project; + + public CreateServiceNowTicketRequestDataRelationships() {} + + @JsonCreator + public CreateServiceNowTicketRequestDataRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_FINDINGS) Findings findings, + @JsonProperty(required = true, value = JSON_PROPERTY_PROJECT) CaseManagementProject project) { + this.findings = findings; + this.unparsed |= findings.unparsed; + this.project = project; + this.unparsed |= project.unparsed; + } + + public CreateServiceNowTicketRequestDataRelationships findings(Findings findings) { + this.findings = findings; + this.unparsed |= findings.unparsed; + return this; + } + + /** + * A list of security findings. + * + * @return findings + */ + @JsonProperty(JSON_PROPERTY_FINDINGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Findings getFindings() { + return findings; + } + + public void setFindings(Findings findings) { + this.findings = findings; + } + + public CreateServiceNowTicketRequestDataRelationships project(CaseManagementProject project) { + this.project = project; + this.unparsed |= project.unparsed; + return this; + } + + /** + * Case management project. + * + * @return project + */ + @JsonProperty(JSON_PROPERTY_PROJECT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseManagementProject getProject() { + return project; + } + + public void setProject(CaseManagementProject project) { + this.project = project; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateServiceNowTicketRequestDataRelationships + */ + @JsonAnySetter + public CreateServiceNowTicketRequestDataRelationships 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 CreateServiceNowTicketRequestDataRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateServiceNowTicketRequestDataRelationships createServiceNowTicketRequestDataRelationships = + (CreateServiceNowTicketRequestDataRelationships) o; + return Objects.equals(this.findings, createServiceNowTicketRequestDataRelationships.findings) + && Objects.equals(this.project, createServiceNowTicketRequestDataRelationships.project) + && Objects.equals( + this.additionalProperties, + createServiceNowTicketRequestDataRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(findings, project, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateServiceNowTicketRequestDataRelationships {\n"); + sb.append(" findings: ").append(toIndentedString(findings)).append("\n"); + sb.append(" project: ").append(toIndentedString(project)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FindingCaseResponseDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/FindingCaseResponseDataAttributes.java index 382e8c72168..69b175861dc 100644 --- a/src/main/java/com/datadog/api/client/v2/model/FindingCaseResponseDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/FindingCaseResponseDataAttributes.java @@ -34,6 +34,7 @@ FindingCaseResponseDataAttributes.JSON_PROPERTY_KEY, FindingCaseResponseDataAttributes.JSON_PROPERTY_MODIFIED_AT, FindingCaseResponseDataAttributes.JSON_PROPERTY_PRIORITY, + FindingCaseResponseDataAttributes.JSON_PROPERTY_SERVICENOW_TICKET, FindingCaseResponseDataAttributes.JSON_PROPERTY_STATUS, FindingCaseResponseDataAttributes.JSON_PROPERTY_STATUS_GROUP, FindingCaseResponseDataAttributes.JSON_PROPERTY_STATUS_NAME, @@ -83,6 +84,9 @@ public class FindingCaseResponseDataAttributes { public static final String JSON_PROPERTY_PRIORITY = "priority"; private String priority; + public static final String JSON_PROPERTY_SERVICENOW_TICKET = "servicenow_ticket"; + private FindingServiceNowTicket servicenowTicket; + public static final String JSON_PROPERTY_STATUS = "status"; private String status; @@ -394,6 +398,29 @@ public void setPriority(String priority) { this.priority = priority; } + public FindingCaseResponseDataAttributes servicenowTicket( + FindingServiceNowTicket servicenowTicket) { + this.servicenowTicket = servicenowTicket; + this.unparsed |= servicenowTicket.unparsed; + return this; + } + + /** + * ServiceNow ticket associated with the case. + * + * @return servicenowTicket + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SERVICENOW_TICKET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FindingServiceNowTicket getServicenowTicket() { + return servicenowTicket; + } + + public void setServicenowTicket(FindingServiceNowTicket servicenowTicket) { + this.servicenowTicket = servicenowTicket; + } + public FindingCaseResponseDataAttributes status(String status) { this.status = status; return this; @@ -569,6 +596,7 @@ public boolean equals(Object o) { && Objects.equals(this.key, findingCaseResponseDataAttributes.key) && Objects.equals(this.modifiedAt, findingCaseResponseDataAttributes.modifiedAt) && Objects.equals(this.priority, findingCaseResponseDataAttributes.priority) + && Objects.equals(this.servicenowTicket, findingCaseResponseDataAttributes.servicenowTicket) && Objects.equals(this.status, findingCaseResponseDataAttributes.status) && Objects.equals(this.statusGroup, findingCaseResponseDataAttributes.statusGroup) && Objects.equals(this.statusName, findingCaseResponseDataAttributes.statusName) @@ -594,6 +622,7 @@ public int hashCode() { key, modifiedAt, priority, + servicenowTicket, status, statusGroup, statusName, @@ -619,6 +648,7 @@ public String toString() { sb.append(" key: ").append(toIndentedString(key)).append("\n"); sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); + sb.append(" servicenowTicket: ").append(toIndentedString(servicenowTicket)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" statusGroup: ").append(toIndentedString(statusGroup)).append("\n"); sb.append(" statusName: ").append(toIndentedString(statusName)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/FindingServiceNowTicket.java b/src/main/java/com/datadog/api/client/v2/model/FindingServiceNowTicket.java new file mode 100644 index 00000000000..d87cebe2703 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FindingServiceNowTicket.java @@ -0,0 +1,166 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** ServiceNow ticket associated with the case. */ +@JsonPropertyOrder({ + FindingServiceNowTicket.JSON_PROPERTY_RESULT, + FindingServiceNowTicket.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FindingServiceNowTicket { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_RESULT = "result"; + private FindingServiceNowTicketResult result; + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public FindingServiceNowTicket result(FindingServiceNowTicketResult result) { + this.result = result; + this.unparsed |= result.unparsed; + return this; + } + + /** + * Result of the ServiceNow ticket creation or attachment. + * + * @return result + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FindingServiceNowTicketResult getResult() { + return result; + } + + public void setResult(FindingServiceNowTicketResult result) { + this.result = result; + } + + public FindingServiceNowTicket status(String status) { + this.status = status; + return this; + } + + /** + * Status of the ServiceNow ticket operation. Can be "COMPLETED" if successful, or "FAILED" if the + * operation failed. + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FindingServiceNowTicket + */ + @JsonAnySetter + public FindingServiceNowTicket 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 FindingServiceNowTicket object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FindingServiceNowTicket findingServiceNowTicket = (FindingServiceNowTicket) o; + return Objects.equals(this.result, findingServiceNowTicket.result) + && Objects.equals(this.status, findingServiceNowTicket.status) + && Objects.equals(this.additionalProperties, findingServiceNowTicket.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(result, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FindingServiceNowTicket {\n"); + sb.append(" result: ").append(toIndentedString(result)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FindingServiceNowTicketResult.java b/src/main/java/com/datadog/api/client/v2/model/FindingServiceNowTicketResult.java new file mode 100644 index 00000000000..483dbd066bb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FindingServiceNowTicketResult.java @@ -0,0 +1,274 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Result of the ServiceNow ticket creation or attachment. */ +@JsonPropertyOrder({ + FindingServiceNowTicketResult.JSON_PROPERTY_INSTANCE_NAME, + FindingServiceNowTicketResult.JSON_PROPERTY_SYS_ID, + FindingServiceNowTicketResult.JSON_PROPERTY_SYS_TARGET_LINK, + FindingServiceNowTicketResult.JSON_PROPERTY_SYS_TARGET_SYS_ID, + FindingServiceNowTicketResult.JSON_PROPERTY_TABLE_NAME, + FindingServiceNowTicketResult.JSON_PROPERTY_URL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FindingServiceNowTicketResult { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_INSTANCE_NAME = "instance_name"; + private String instanceName; + + public static final String JSON_PROPERTY_SYS_ID = "sys_id"; + private String sysId; + + public static final String JSON_PROPERTY_SYS_TARGET_LINK = "sys_target_link"; + private String sysTargetLink; + + public static final String JSON_PROPERTY_SYS_TARGET_SYS_ID = "sys_target_sys_id"; + private String sysTargetSysId; + + public static final String JSON_PROPERTY_TABLE_NAME = "table_name"; + private String tableName; + + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public FindingServiceNowTicketResult instanceName(String instanceName) { + this.instanceName = instanceName; + return this; + } + + /** + * ServiceNow instance name extracted from the ticket URL. + * + * @return instanceName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INSTANCE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getInstanceName() { + return instanceName; + } + + public void setInstanceName(String instanceName) { + this.instanceName = instanceName; + } + + public FindingServiceNowTicketResult sysId(String sysId) { + this.sysId = sysId; + return this; + } + + /** + * Unique identifier of the ServiceNow incident record. + * + * @return sysId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SYS_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSysId() { + return sysId; + } + + public void setSysId(String sysId) { + this.sysId = sysId; + } + + public FindingServiceNowTicketResult sysTargetLink(String sysTargetLink) { + this.sysTargetLink = sysTargetLink; + return this; + } + + /** + * Direct link to the ServiceNow incident record. + * + * @return sysTargetLink + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SYS_TARGET_LINK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSysTargetLink() { + return sysTargetLink; + } + + public void setSysTargetLink(String sysTargetLink) { + this.sysTargetLink = sysTargetLink; + } + + public FindingServiceNowTicketResult sysTargetSysId(String sysTargetSysId) { + this.sysTargetSysId = sysTargetSysId; + return this; + } + + /** + * Unique identifier of the target ServiceNow record. + * + * @return sysTargetSysId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SYS_TARGET_SYS_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSysTargetSysId() { + return sysTargetSysId; + } + + public void setSysTargetSysId(String sysTargetSysId) { + this.sysTargetSysId = sysTargetSysId; + } + + public FindingServiceNowTicketResult tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * ServiceNow table containing the incident record. + * + * @return tableName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TABLE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public FindingServiceNowTicketResult url(String url) { + this.url = url; + return this; + } + + /** + * URL of the ServiceNow incident record. + * + * @return url + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + /** + * 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 FindingServiceNowTicketResult + */ + @JsonAnySetter + public FindingServiceNowTicketResult 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 FindingServiceNowTicketResult object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FindingServiceNowTicketResult findingServiceNowTicketResult = (FindingServiceNowTicketResult) o; + return Objects.equals(this.instanceName, findingServiceNowTicketResult.instanceName) + && Objects.equals(this.sysId, findingServiceNowTicketResult.sysId) + && Objects.equals(this.sysTargetLink, findingServiceNowTicketResult.sysTargetLink) + && Objects.equals(this.sysTargetSysId, findingServiceNowTicketResult.sysTargetSysId) + && Objects.equals(this.tableName, findingServiceNowTicketResult.tableName) + && Objects.equals(this.url, findingServiceNowTicketResult.url) + && Objects.equals( + this.additionalProperties, findingServiceNowTicketResult.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + instanceName, sysId, sysTargetLink, sysTargetSysId, tableName, url, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FindingServiceNowTicketResult {\n"); + sb.append(" instanceName: ").append(toIndentedString(instanceName)).append("\n"); + sb.append(" sysId: ").append(toIndentedString(sysId)).append("\n"); + sb.append(" sysTargetLink: ").append(toIndentedString(sysTargetLink)).append("\n"); + sb.append(" sysTargetSysId: ").append(toIndentedString(sysTargetSysId)).append("\n"); + sb.append(" tableName: ").append(toIndentedString(tableName)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).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/LogsArchiveAttributes.java b/src/main/java/com/datadog/api/client/v2/model/LogsArchiveAttributes.java index f17c5ecef85..62bab9e112f 100644 --- a/src/main/java/com/datadog/api/client/v2/model/LogsArchiveAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/LogsArchiveAttributes.java @@ -25,7 +25,9 @@ LogsArchiveAttributes.JSON_PROPERTY_COMPRESSION_METHOD, LogsArchiveAttributes.JSON_PROPERTY_DESTINATION, LogsArchiveAttributes.JSON_PROPERTY_INCLUDE_TAGS, + LogsArchiveAttributes.JSON_PROPERTY_LOOKUP_ATTRIBUTES, LogsArchiveAttributes.JSON_PROPERTY_NAME, + LogsArchiveAttributes.JSON_PROPERTY_PARTITIONING_ATTRIBUTES, LogsArchiveAttributes.JSON_PROPERTY_QUERY, LogsArchiveAttributes.JSON_PROPERTY_REHYDRATION_MAX_SCAN_SIZE_IN_GB, LogsArchiveAttributes.JSON_PROPERTY_REHYDRATION_TAGS, @@ -45,9 +47,15 @@ public class LogsArchiveAttributes { public static final String JSON_PROPERTY_INCLUDE_TAGS = "include_tags"; private Boolean includeTags = false; + public static final String JSON_PROPERTY_LOOKUP_ATTRIBUTES = "lookup_attributes"; + private List lookupAttributes = null; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + public static final String JSON_PROPERTY_PARTITIONING_ATTRIBUTES = "partitioning_attributes"; + private List partitioningAttributes = null; + public static final String JSON_PROPERTY_QUERY = "query"; private String query; @@ -149,6 +157,35 @@ public void setIncludeTags(Boolean includeTags) { this.includeTags = includeTags; } + public LogsArchiveAttributes lookupAttributes(List lookupAttributes) { + this.lookupAttributes = lookupAttributes; + return this; + } + + public LogsArchiveAttributes addLookupAttributesItem(String lookupAttributesItem) { + if (this.lookupAttributes == null) { + this.lookupAttributes = new ArrayList<>(); + } + this.lookupAttributes.add(lookupAttributesItem); + return this; + } + + /** + * An array of attributes to use as lookup keys for the archive. + * + * @return lookupAttributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOOKUP_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLookupAttributes() { + return lookupAttributes; + } + + public void setLookupAttributes(List lookupAttributes) { + this.lookupAttributes = lookupAttributes; + } + public LogsArchiveAttributes name(String name) { this.name = name; return this; @@ -169,6 +206,36 @@ public void setName(String name) { this.name = name; } + public LogsArchiveAttributes partitioningAttributes(List partitioningAttributes) { + this.partitioningAttributes = partitioningAttributes; + return this; + } + + public LogsArchiveAttributes addPartitioningAttributesItem(String partitioningAttributesItem) { + if (this.partitioningAttributes == null) { + this.partitioningAttributes = new ArrayList<>(); + } + this.partitioningAttributes.add(partitioningAttributesItem); + return this; + } + + /** + * An array of attributes to use as partition keys for the archive. The attribute used most + * frequently for querying should be first. + * + * @return partitioningAttributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PARTITIONING_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPartitioningAttributes() { + return partitioningAttributes; + } + + public void setPartitioningAttributes(List partitioningAttributes) { + this.partitioningAttributes = partitioningAttributes; + } + public LogsArchiveAttributes query(String query) { this.query = query; return this; @@ -334,7 +401,9 @@ public boolean equals(Object o) { return Objects.equals(this.compressionMethod, logsArchiveAttributes.compressionMethod) && Objects.equals(this.destination, logsArchiveAttributes.destination) && Objects.equals(this.includeTags, logsArchiveAttributes.includeTags) + && Objects.equals(this.lookupAttributes, logsArchiveAttributes.lookupAttributes) && Objects.equals(this.name, logsArchiveAttributes.name) + && Objects.equals(this.partitioningAttributes, logsArchiveAttributes.partitioningAttributes) && Objects.equals(this.query, logsArchiveAttributes.query) && Objects.equals( this.rehydrationMaxScanSizeInGb, logsArchiveAttributes.rehydrationMaxScanSizeInGb) @@ -349,7 +418,9 @@ public int hashCode() { compressionMethod, destination, includeTags, + lookupAttributes, name, + partitioningAttributes, query, rehydrationMaxScanSizeInGb, rehydrationTags, @@ -364,7 +435,11 @@ public String toString() { sb.append(" compressionMethod: ").append(toIndentedString(compressionMethod)).append("\n"); sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); sb.append(" includeTags: ").append(toIndentedString(includeTags)).append("\n"); + sb.append(" lookupAttributes: ").append(toIndentedString(lookupAttributes)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" partitioningAttributes: ") + .append(toIndentedString(partitioningAttributes)) + .append("\n"); sb.append(" query: ").append(toIndentedString(query)).append("\n"); sb.append(" rehydrationMaxScanSizeInGb: ") .append(toIndentedString(rehydrationMaxScanSizeInGb)) diff --git a/src/main/java/com/datadog/api/client/v2/model/LogsArchiveCreateRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/LogsArchiveCreateRequestAttributes.java index 852225135df..ca70028d18a 100644 --- a/src/main/java/com/datadog/api/client/v2/model/LogsArchiveCreateRequestAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/LogsArchiveCreateRequestAttributes.java @@ -25,7 +25,9 @@ LogsArchiveCreateRequestAttributes.JSON_PROPERTY_COMPRESSION_METHOD, LogsArchiveCreateRequestAttributes.JSON_PROPERTY_DESTINATION, LogsArchiveCreateRequestAttributes.JSON_PROPERTY_INCLUDE_TAGS, + LogsArchiveCreateRequestAttributes.JSON_PROPERTY_LOOKUP_ATTRIBUTES, LogsArchiveCreateRequestAttributes.JSON_PROPERTY_NAME, + LogsArchiveCreateRequestAttributes.JSON_PROPERTY_PARTITIONING_ATTRIBUTES, LogsArchiveCreateRequestAttributes.JSON_PROPERTY_QUERY, LogsArchiveCreateRequestAttributes.JSON_PROPERTY_REHYDRATION_MAX_SCAN_SIZE_IN_GB, LogsArchiveCreateRequestAttributes.JSON_PROPERTY_REHYDRATION_TAGS @@ -44,9 +46,15 @@ public class LogsArchiveCreateRequestAttributes { public static final String JSON_PROPERTY_INCLUDE_TAGS = "include_tags"; private Boolean includeTags = false; + public static final String JSON_PROPERTY_LOOKUP_ATTRIBUTES = "lookup_attributes"; + private List lookupAttributes = null; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + public static final String JSON_PROPERTY_PARTITIONING_ATTRIBUTES = "partitioning_attributes"; + private List partitioningAttributes = null; + public static final String JSON_PROPERTY_QUERY = "query"; private String query; @@ -141,6 +149,35 @@ public void setIncludeTags(Boolean includeTags) { this.includeTags = includeTags; } + public LogsArchiveCreateRequestAttributes lookupAttributes(List lookupAttributes) { + this.lookupAttributes = lookupAttributes; + return this; + } + + public LogsArchiveCreateRequestAttributes addLookupAttributesItem(String lookupAttributesItem) { + if (this.lookupAttributes == null) { + this.lookupAttributes = new ArrayList<>(); + } + this.lookupAttributes.add(lookupAttributesItem); + return this; + } + + /** + * An array of attributes to use as lookup keys for the archive. + * + * @return lookupAttributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOOKUP_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLookupAttributes() { + return lookupAttributes; + } + + public void setLookupAttributes(List lookupAttributes) { + this.lookupAttributes = lookupAttributes; + } + public LogsArchiveCreateRequestAttributes name(String name) { this.name = name; return this; @@ -161,6 +198,38 @@ public void setName(String name) { this.name = name; } + public LogsArchiveCreateRequestAttributes partitioningAttributes( + List partitioningAttributes) { + this.partitioningAttributes = partitioningAttributes; + return this; + } + + public LogsArchiveCreateRequestAttributes addPartitioningAttributesItem( + String partitioningAttributesItem) { + if (this.partitioningAttributes == null) { + this.partitioningAttributes = new ArrayList<>(); + } + this.partitioningAttributes.add(partitioningAttributesItem); + return this; + } + + /** + * An array of attributes to use as partition keys for the archive. The attribute used most + * frequently for querying should be first. + * + * @return partitioningAttributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PARTITIONING_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPartitioningAttributes() { + return partitioningAttributes; + } + + public void setPartitioningAttributes(List partitioningAttributes) { + this.partitioningAttributes = partitioningAttributes; + } + public LogsArchiveCreateRequestAttributes query(String query) { this.query = query; return this; @@ -304,7 +373,11 @@ public boolean equals(Object o) { this.compressionMethod, logsArchiveCreateRequestAttributes.compressionMethod) && Objects.equals(this.destination, logsArchiveCreateRequestAttributes.destination) && Objects.equals(this.includeTags, logsArchiveCreateRequestAttributes.includeTags) + && Objects.equals( + this.lookupAttributes, logsArchiveCreateRequestAttributes.lookupAttributes) && Objects.equals(this.name, logsArchiveCreateRequestAttributes.name) + && Objects.equals( + this.partitioningAttributes, logsArchiveCreateRequestAttributes.partitioningAttributes) && Objects.equals(this.query, logsArchiveCreateRequestAttributes.query) && Objects.equals( this.rehydrationMaxScanSizeInGb, @@ -320,7 +393,9 @@ public int hashCode() { compressionMethod, destination, includeTags, + lookupAttributes, name, + partitioningAttributes, query, rehydrationMaxScanSizeInGb, rehydrationTags, @@ -334,7 +409,11 @@ public String toString() { sb.append(" compressionMethod: ").append(toIndentedString(compressionMethod)).append("\n"); sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); sb.append(" includeTags: ").append(toIndentedString(includeTags)).append("\n"); + sb.append(" lookupAttributes: ").append(toIndentedString(lookupAttributes)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" partitioningAttributes: ") + .append(toIndentedString(partitioningAttributes)) + .append("\n"); sb.append(" query: ").append(toIndentedString(query)).append("\n"); sb.append(" rehydrationMaxScanSizeInGb: ") .append(toIndentedString(rehydrationMaxScanSizeInGb)) diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceNowTicketsDataType.java b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTicketsDataType.java new file mode 100644 index 00000000000..747561684d7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceNowTicketsDataType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +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 tickets resource type. */ +@JsonSerialize(using = ServiceNowTicketsDataType.ServiceNowTicketsDataTypeSerializer.class) +public class ServiceNowTicketsDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("servicenow_tickets")); + + public static final ServiceNowTicketsDataType SERVICENOW_TICKETS = + new ServiceNowTicketsDataType("servicenow_tickets"); + + ServiceNowTicketsDataType(String value) { + super(value, allowedValues); + } + + public static class ServiceNowTicketsDataTypeSerializer + extends StdSerializer { + public ServiceNowTicketsDataTypeSerializer(Class t) { + super(t); + } + + public ServiceNowTicketsDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ServiceNowTicketsDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ServiceNowTicketsDataType fromValue(String value) { + return new ServiceNowTicketsDataType(value); + } +} diff --git a/src/test/resources/com/datadog/api/client/v1/api/hosts.feature b/src/test/resources/com/datadog/api/client/v1/api/hosts.feature index 7ed533f7b20..56257ab1844 100644 --- a/src/test/resources/com/datadog/api/client/v1/api/hosts.feature +++ b/src/test/resources/com/datadog/api/client/v1/api/hosts.feature @@ -9,20 +9,20 @@ Feature: Hosts And a valid "appKeyAuth" key in the system And an instance of "Hosts" API - @generated @skip @team:DataDog/core-index + @generated @skip @team:DataDog/redapl-hosts Scenario: Get all hosts for your organization returns "Invalid Parameter Error" response Given new "ListHosts" request When the request is sent Then the response status is 400 Invalid Parameter Error - @integration-only @team:DataDog/core-index + @integration-only @team:DataDog/redapl-hosts Scenario: Get all hosts for your organization returns "OK" response Given new "ListHosts" request And request contains "filter" parameter with value "env:ci" When the request is sent Then the response status is 200 OK - @replay-only @team:DataDog/core-index + @replay-only @team:DataDog/redapl-hosts Scenario: Get all hosts with metadata deserializes successfully Given new "ListHosts" request And request contains "include_hosts_metadata" parameter with value true @@ -35,26 +35,26 @@ Feature: Hosts And the response "host_list[0].meta.agent_checks[0]" is equal to ["ntp","ntp","ntp:d884b5186b651429","OK","",""] And the response "host_list[0].meta.gohai" is equal to "{\"cpu\":{\"cache_size\":\"8192 KB\",\"cpu_cores\":\"1\",\"cpu_logical_processors\":\"1\",\"family\":\"6\",\"mhz\":\"2711.998\",\"model\":\"142\",\"model_name\":\"Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz\",\"stepping\":\"10\",\"vendor_id\":\"GenuineIntel\"},\"filesystem\":[{\"kb_size\":\"3966892\",\"mounted_on\":\"/dev\",\"name\":\"udev\"},{\"kb_size\":\"797396\",\"mounted_on\":\"/run\",\"name\":\"tmpfs\"},{\"kb_size\":\"64800356\",\"mounted_on\":\"/\",\"name\":\"/dev/mapper/vagrant--vg-root\"},{\"kb_size\":\"3986968\",\"mounted_on\":\"/dev/shm\",\"name\":\"tmpfs\"},{\"kb_size\":\"5120\",\"mounted_on\":\"/run/lock\",\"name\":\"tmpfs\"},{\"kb_size\":\"3986968\",\"mounted_on\":\"/sys/fs/cgroup\",\"name\":\"tmpfs\"},{\"kb_size\":\"488245288\",\"mounted_on\":\"/vagrant\",\"name\":\"/vagrant\"},{\"kb_size\":\"797392\",\"mounted_on\":\"/run/user/1000\",\"name\":\"tmpfs\"}],\"memory\":{\"swap_total\":\"1003516kB\",\"total\":\"7973940kB\"},\"network\":{\"interfaces\":[{\"ipv4\":\"10.0.2.15\",\"ipv4-network\":\"10.0.2.0/24\",\"ipv6\":\"fe80::a00:27ff:fec2:be11\",\"ipv6-network\":\"fe80::/64\",\"macaddress\":\"08:00:27:c2:be:11\",\"name\":\"eth0\"},{\"ipv4\":\"192.168.122.1\",\"ipv4-network\":\"192.168.122.0/24\",\"macaddress\":\"52:54:00:6f:1c:bf\",\"name\":\"virbr0\"}],\"ipaddress\":\"10.0.2.15\",\"ipaddressv6\":\"fe80::a00:27ff:fec2:be11\",\"macaddress\":\"08:00:27:c2:be:11\"},\"platform\":{\"GOOARCH\":\"amd64\",\"GOOS\":\"linux\",\"goV\":\"1.16.7\",\"hardware_platform\":\"x86_64\",\"hostname\":\"vagrant\",\"kernel_name\":\"Linux\",\"kernel_release\":\"4.15.0-29-generic\",\"kernel_version\":\"#31-Ubuntu SMP Tue Jul 17 15:39:52 UTC 2018\",\"machine\":\"x86_64\",\"os\":\"GNU/Linux\",\"processor\":\"x86_64\",\"pythonV\":\"2.7.15rc1\"}}" - @skip-validation @team:DataDog/core-index + @skip-validation @team:DataDog/redapl-hosts Scenario: Get all hosts with metadata for your organization returns "OK" response Given new "ListHosts" request And request contains "include_hosts_metadata" parameter with value true When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/core-index + @generated @skip @team:DataDog/redapl-hosts Scenario: Get the total number of active hosts returns "Invalid Parameter Error" response Given new "GetHostTotals" request When the request is sent Then the response status is 400 Invalid Parameter Error - @generated @skip @team:DataDog/core-index + @generated @skip @team:DataDog/redapl-hosts Scenario: Get the total number of active hosts returns "OK" response Given new "GetHostTotals" request When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/core-index + @generated @skip @team:DataDog/redapl-hosts Scenario: Mute a host returns "Invalid Parameter Error" response Given new "MuteHost" request And request contains "host_name" parameter from "REPLACE.ME" @@ -62,7 +62,7 @@ Feature: Hosts When the request is sent Then the response status is 400 Invalid Parameter Error - @generated @skip @team:DataDog/core-index + @generated @skip @team:DataDog/redapl-hosts Scenario: Mute a host returns "OK" response Given new "MuteHost" request And request contains "host_name" parameter from "REPLACE.ME" @@ -70,14 +70,14 @@ Feature: Hosts When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/core-index + @generated @skip @team:DataDog/redapl-hosts Scenario: Unmute a host returns "Invalid Parameter Error" response Given new "UnmuteHost" request And request contains "host_name" parameter from "REPLACE.ME" When the request is sent Then the response status is 400 Invalid Parameter Error - @generated @skip @team:DataDog/core-index + @generated @skip @team:DataDog/redapl-hosts Scenario: Unmute a host returns "OK" response Given new "UnmuteHost" request And request contains "host_name" parameter from "REPLACE.ME" diff --git a/src/test/resources/com/datadog/api/client/v1/api/tags.feature b/src/test/resources/com/datadog/api/client/v1/api/tags.feature index d6557ca1882..f0e8881a275 100644 --- a/src/test/resources/com/datadog/api/client/v1/api/tags.feature +++ b/src/test/resources/com/datadog/api/client/v1/api/tags.feature @@ -17,7 +17,7 @@ Feature: Tags And a valid "appKeyAuth" key in the system And an instance of "Tags" API - @generated @skip @team:DataDog/core-index + @generated @skip @team:DataDog/redapl-hosts Scenario: Add tags to a host returns "Created" response Given new "CreateHostTags" request And request contains "host_name" parameter from "REPLACE.ME" @@ -25,7 +25,7 @@ Feature: Tags When the request is sent Then the response status is 201 Created - @generated @skip @team:DataDog/core-index + @generated @skip @team:DataDog/redapl-hosts Scenario: Add tags to a host returns "Not Found" response Given new "CreateHostTags" request And request contains "host_name" parameter from "REPLACE.ME" @@ -33,47 +33,47 @@ Feature: Tags When the request is sent Then the response status is 404 Not Found - @generated @skip @team:DataDog/core-index + @generated @skip @team:DataDog/redapl-hosts Scenario: Get All Host Tags returns "Not Found" response Given new "ListHostTags" request When the request is sent Then the response status is 404 Not Found - @generated @skip @team:DataDog/core-index + @generated @skip @team:DataDog/redapl-hosts Scenario: Get All Host Tags returns "OK" response Given new "ListHostTags" request When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/core-index + @generated @skip @team:DataDog/redapl-hosts Scenario: Get Host Tags returns "Not Found" response Given new "GetHostTags" request And request contains "host_name" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found - @generated @skip @team:DataDog/core-index + @generated @skip @team:DataDog/redapl-hosts Scenario: Get Host Tags returns "OK" response Given new "GetHostTags" request And request contains "host_name" parameter from "REPLACE.ME" When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/core-index + @generated @skip @team:DataDog/redapl-hosts Scenario: Remove host tags returns "Not Found" response Given new "DeleteHostTags" request And request contains "host_name" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found - @generated @skip @team:DataDog/core-index + @generated @skip @team:DataDog/redapl-hosts Scenario: Remove host tags returns "OK" response Given new "DeleteHostTags" request And request contains "host_name" parameter from "REPLACE.ME" When the request is sent Then the response status is 204 OK - @generated @skip @team:DataDog/core-index + @generated @skip @team:DataDog/redapl-hosts Scenario: Update host tags returns "Not Found" response Given new "UpdateHostTags" request And request contains "host_name" parameter from "REPLACE.ME" @@ -81,7 +81,7 @@ Feature: Tags When the request is sent Then the response status is 404 Not Found - @generated @skip @team:DataDog/core-index + @generated @skip @team:DataDog/redapl-hosts Scenario: Update host tags returns "OK" response Given new "UpdateHostTags" request And request contains "host_name" parameter from "REPLACE.ME" diff --git a/src/test/resources/com/datadog/api/client/v2/api/logs_archives.feature b/src/test/resources/com/datadog/api/client/v2/api/logs_archives.feature index 4b58769df54..752be13634f 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/logs_archives.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/logs_archives.feature @@ -12,14 +12,14 @@ Feature: Logs Archives @generated @skip @team:DataDog/logs-backend @team:DataDog/logs-forwarding Scenario: Create an archive returns "Bad Request" response Given new "CreateLogsArchive" request - And body with value {"data": {"attributes": {"compression_method": "GZIP", "destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "name": "Nginx Archive", "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} + And body with value {"data": {"attributes": {"compression_method": "GZIP", "destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "lookup_attributes": ["trace_id", "user_id"], "name": "Nginx Archive", "partitioning_attributes": ["service", "status"], "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/logs-backend @team:DataDog/logs-forwarding Scenario: Create an archive returns "OK" response Given new "CreateLogsArchive" request - And body with value {"data": {"attributes": {"compression_method": "GZIP", "destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "name": "Nginx Archive", "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} + And body with value {"data": {"attributes": {"compression_method": "GZIP", "destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "lookup_attributes": ["trace_id", "user_id"], "name": "Nginx Archive", "partitioning_attributes": ["service", "status"], "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} When the request is sent Then the response status is 200 OK @@ -150,7 +150,7 @@ Feature: Logs Archives Scenario: Update an archive returns "Bad Request" response Given new "UpdateLogsArchive" request And request contains "archive_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"compression_method": "GZIP", "destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "name": "Nginx Archive", "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} + And body with value {"data": {"attributes": {"compression_method": "GZIP", "destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "lookup_attributes": ["trace_id", "user_id"], "name": "Nginx Archive", "partitioning_attributes": ["service", "status"], "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} When the request is sent Then the response status is 400 Bad Request @@ -158,7 +158,7 @@ Feature: Logs Archives Scenario: Update an archive returns "Not found" response Given new "UpdateLogsArchive" request And request contains "archive_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"compression_method": "GZIP", "destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "name": "Nginx Archive", "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} + And body with value {"data": {"attributes": {"compression_method": "GZIP", "destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "lookup_attributes": ["trace_id", "user_id"], "name": "Nginx Archive", "partitioning_attributes": ["service", "status"], "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} When the request is sent Then the response status is 404 Not found @@ -166,7 +166,7 @@ Feature: Logs Archives Scenario: Update an archive returns "OK" response Given new "UpdateLogsArchive" request And request contains "archive_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"compression_method": "GZIP", "destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "name": "Nginx Archive", "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} + And body with value {"data": {"attributes": {"compression_method": "GZIP", "destination": {"container": "container-name", "integration": {"client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"}, "storage_account": "account-name", "type": "azure"}, "include_tags": false, "lookup_attributes": ["trace_id", "user_id"], "name": "Nginx Archive", "partitioning_attributes": ["service", "status"], "query": "source:nginx", "rehydration_max_scan_size_in_gb": 100, "rehydration_tags": ["team:intake", "team:app"]}, "type": "archives"}} When the request is sent Then the response status is 200 OK diff --git a/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature b/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature index d23634826e6..bae8918780e 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature @@ -41,6 +41,30 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-investigation + Scenario: Assign or unassign security findings returns "Accepted" response + Given operation "UpdateFindingsAssignee" enabled + And new "UpdateFindingsAssignee" request + And body with value {"data": {"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0"}, "id": "00000000-0000-0000-0000-000000000001", "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}}, "type": "assignee"}} + When the request is sent + Then the response status is 202 Accepted + + @generated @skip @team:DataDog/k9-investigation + Scenario: Assign or unassign security findings returns "Bad Request" response + Given operation "UpdateFindingsAssignee" enabled + And new "UpdateFindingsAssignee" request + And body with value {"data": {"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0"}, "id": "00000000-0000-0000-0000-000000000001", "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}}, "type": "assignee"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-investigation + Scenario: Assign or unassign security findings returns "Not Found" response + Given operation "UpdateFindingsAssignee" enabled + And new "UpdateFindingsAssignee" request + And body with value {"data": {"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0"}, "id": "00000000-0000-0000-0000-000000000001", "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}}, "type": "assignee"}} + When the request is sent + Then the response status is 404 Not Found + @team:DataDog/k9-investigation Scenario: Attach security finding to a Jira issue returns "OK" response Given new "AttachJiraIssue" request @@ -87,6 +111,30 @@ Feature: Security Monitoring And the response "data.attributes.insights" has item with field "resource_id" with value "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=" And the response "data.attributes.jira_issue.result.issue_url" is equal to "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476" + @generated @skip @team:DataDog/k9-investigation + Scenario: Attach security findings to a ServiceNow ticket returns "Bad Request" response + Given operation "AttachServiceNowTicket" enabled + And new "AttachServiceNowTicket" request + And body with value {"data": {"attributes": {"servicenow_ticket_url": "https://example.service-now.com/now/nav/ui/classic/params/target/incident.do?sys_id=abcdef0123456789abcdef0123456789"}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "servicenow_tickets"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-investigation + Scenario: Attach security findings to a ServiceNow ticket returns "Not Found" response + Given operation "AttachServiceNowTicket" enabled + And new "AttachServiceNowTicket" request + And body with value {"data": {"attributes": {"servicenow_ticket_url": "https://example.service-now.com/now/nav/ui/classic/params/target/incident.do?sys_id=abcdef0123456789abcdef0123456789"}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "servicenow_tickets"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-investigation + Scenario: Attach security findings to a ServiceNow ticket returns "OK" response + Given operation "AttachServiceNowTicket" enabled + And new "AttachServiceNowTicket" request + And body with value {"data": {"attributes": {"servicenow_ticket_url": "https://example.service-now.com/now/nav/ui/classic/params/target/incident.do?sys_id=abcdef0123456789abcdef0123456789"}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "servicenow_tickets"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/k9-investigation Scenario: Attach security findings to a case returns "Bad Request" response Given new "AttachCase" request @@ -482,6 +530,30 @@ Feature: Security Monitoring When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/k9-investigation + Scenario: Create ServiceNow tickets for security findings returns "Bad Request" response + Given operation "CreateServiceNowTickets" enabled + And new "CreateServiceNowTickets" request + And body with value {"data": [{"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", "description": "A description of the ServiceNow ticket.", "priority": "NOT_DEFINED", "title": "A title for the ServiceNow ticket."}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "servicenow_tickets"}]} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-investigation + Scenario: Create ServiceNow tickets for security findings returns "Created" response + Given operation "CreateServiceNowTickets" enabled + And new "CreateServiceNowTickets" request + And body with value {"data": [{"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", "description": "A description of the ServiceNow ticket.", "priority": "NOT_DEFINED", "title": "A title for the ServiceNow ticket."}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "servicenow_tickets"}]} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/k9-investigation + Scenario: Create ServiceNow tickets for security findings returns "Not Found" response + Given operation "CreateServiceNowTickets" enabled + And new "CreateServiceNowTickets" request + And body with value {"data": [{"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", "description": "A description of the ServiceNow ticket.", "priority": "NOT_DEFINED", "title": "A title for the ServiceNow ticket."}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "servicenow_tickets"}]} + When the request is sent + Then the response status is 404 Not Found + @skip-validation @team:DataDog/k9-cloud-siem Scenario: Create a cloud_configuration rule returns "OK" response Given new "CreateSecurityMonitoringRule" 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 07db45886a9..f60cf1a2f73 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 @@ -6414,6 +6414,12 @@ "type": "safe" } }, + "UpdateFindingsAssignee": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, "DetachCase": { "tag": "Security Monitoring", "undo": { @@ -6470,6 +6476,25 @@ "type": "safe" } }, + "AttachServiceNowTicket": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "CreateServiceNowTickets": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DetachCase", + "parameters": [ + { + "name": "body", + "template": "{\n \"data\": {\n \"type\": \"cases\",\n \"relationships\": {\n \"findings\": {\n \"data\": [\n {\n \"type\": \"findings\",\n \"id\": \"{{data[0].attributes.insights[0].resource_id}}\"\n }\n ]\n }\n }\n }\n}" + } + ], + "type": "unsafe" + } + }, "ListAssetsSBOMs": { "tag": "Security Monitoring", "undo": {