From 070f98d80b10c44a735b9fbaa910c0f2415013fc Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 15 Dec 2025 13:25:18 +0000 Subject: [PATCH] Regenerate client from commit 178a8e0 of spec repo --- .generator/schemas/v2/openapi.yaml | 217 ++++++----- .../v2/security-monitoring/CreateCases.java | 4 +- .../CreateCases_2385516013.java | 2 +- .../CreateCases_2798851680.java | 4 +- .../security-monitoring/CreateJiraIssues.java | 118 ++---- .../CreateJiraIssues_379590688.java | 95 ----- .../CreateJiraIssues_829823123.java | 104 ------ .../client/v2/api/SecurityMonitoringApi.java | 25 +- .../v2/model/AttachCaseRequestData.java | 2 +- .../v2/model/AttachJiraIssueRequestData.java | 29 +- .../AttachJiraIssueRequestDataAttributes.java | 2 +- .../client/v2/model/CaseInsightsItems.java | 7 +- .../v2/model/CaseManagementProjectData.java | 2 +- .../v2/model/CreateCaseRequestData.java | 29 +- .../CreateCaseRequestDataAttributes.java | 6 +- .../v2/model/CreateJiraIssueRequestArray.java | 46 +-- .../CreateJiraIssueRequestArrayIncluded.java | 352 ------------------ .../v2/model/CreateJiraIssueRequestData.java | 29 +- .../CreateJiraIssueRequestDataAttributes.java | 139 ++++++- ...eJiraIssueRequestDataAttributesFields.java | 143 ------- ...eateJiraIssueRequestDataRelationships.java | 72 ++-- ...JiraIssueRequestDataRelationshipsCase.java | 151 -------- ...IssueRequestDataRelationshipsCaseData.java | 183 --------- .../v2/model/DetachCaseRequestData.java | 31 +- .../v2/model/FindingCaseResponseData.java | 2 +- .../api/client/v2/model/FindingData.java | 2 +- .../api/client/v2/model/FindingJiraIssue.java | 4 +- .../v2/model/FindingJiraIssueResult.java | 8 +- ...ty_finding_returns_Created_response.freeze | 1 - ...rity_finding_returns_Created_response.json | 57 --- ...y_findings_returns_Created_response.freeze | 1 - ...ity_findings_returns_Created_response.json | 57 --- ...ndings_returns_Bad_Request_response.freeze | 1 - ...findings_returns_Bad_Request_response.json | 32 -- ...y_findings_returns_Created_response.freeze | 1 - ...ity_findings_returns_Created_response.json | 57 --- ...findings_returns_Not_Found_response.freeze | 1 - ...y_findings_returns_Not_Found_response.json | 32 -- ...ty_finding_returns_Created_response.freeze | 2 +- ...rity_finding_returns_Created_response.json | 10 +- ...y_findings_returns_Created_response.freeze | 2 +- ...ity_findings_returns_Created_response.json | 10 +- ...y_findings_returns_Created_response.freeze | 2 +- ...ity_findings_returns_Created_response.json | 10 +- .../client/v2/api/security_monitoring.feature | 88 +---- .../com/datadog/api/client/v2/api/undo.json | 4 +- 46 files changed, 397 insertions(+), 1779 deletions(-) delete mode 100644 examples/v2/security-monitoring/CreateJiraIssues_379590688.java delete mode 100644 examples/v2/security-monitoring/CreateJiraIssues_829823123.java delete mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestArrayIncluded.java delete mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataAttributesFields.java delete mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataRelationshipsCase.java delete mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataRelationshipsCaseData.java delete mode 100644 src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_finding_returns_Created_response.freeze delete mode 100644 src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_finding_returns_Created_response.json delete mode 100644 src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_findings_returns_Created_response.freeze delete mode 100644 src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_findings_returns_Created_response.json delete mode 100644 src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Bad_Request_response.freeze delete mode 100644 src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Bad_Request_response.json delete mode 100644 src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Created_response.freeze delete mode 100644 src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Created_response.json delete mode 100644 src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Not_Found_response.freeze delete mode 100644 src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Not_Found_response.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index eea8d903b4d..4969d8578dd 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -5295,7 +5295,7 @@ components: description: Data of the case to attach security findings to. properties: id: - description: The unique identifier of the case. + description: Unique identifier of the case. example: c1234567-89ab-cdef-0123-456789abcdef type: string relationships: @@ -5326,10 +5326,6 @@ components: properties: attributes: $ref: '#/components/schemas/AttachJiraIssueRequestDataAttributes' - id: - description: The unique identifier of the Jira issue attachment request. - example: j1234567-89ab-cdef-0123-456789abcdef - type: string relationships: $ref: '#/components/schemas/AttachJiraIssueRequestDataRelationships' type: @@ -5341,7 +5337,7 @@ components: description: Attributes of the Jira issue to attach security findings to. properties: jira_issue_url: - description: The URL of the Jira issue to attach security findings to. + description: URL of the Jira issue to attach security findings to. example: https://domain.atlassian.net/browse/PROJ-123 type: string required: @@ -5352,8 +5348,12 @@ components: properties: findings: $ref: '#/components/schemas/Findings' + description: Security findings to attach to the Jira issue. project: $ref: '#/components/schemas/CaseManagementProject' + description: Case management project with Jira integration configured. It + is used to attach security findings to the Jira issue. To configure the + integration, see [Bidirectional ticket syncing with Jira](https://docs.datadoghq.com/security/ticketing_integrations/#bidirectional-ticket-syncing-with-jira). required: - findings - project @@ -9125,17 +9125,17 @@ components: description: An insight of the case. properties: ref: - description: The reference of the insight. + description: Reference of the insight. example: /security/appsec/vm/library/vulnerability/dfa027f7c037b2f77159adc027fecb56?detection=static type: string resource_id: - description: The unique identifier of the resource. For example, the unique + description: Unique identifier of the resource. For example, the unique identifier of a security finding. example: ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw== type: string type: - description: The type of the resource. For example, the type of a security - finding is "SECURITY_FINDING". + description: Type of the resource. For example, the type of a security finding + is "SECURITY_FINDING". example: SECURITY_FINDING type: string type: object @@ -9150,7 +9150,7 @@ components: CaseManagementProjectData: properties: id: - description: The unique identifier of the case management project. + description: Unique identifier of the case management project. example: aeadc05e-98a8-11ec-ac2c-da7ad0900001 type: string type: @@ -12897,10 +12897,6 @@ components: properties: attributes: $ref: '#/components/schemas/CreateCaseRequestDataAttributes' - id: - description: The unique identifier of the case. - example: c1234567-89ab-cdef-0123-456789abcdef - type: string relationships: $ref: '#/components/schemas/CreateCaseRequestDataRelationships' type: @@ -12912,21 +12908,21 @@ components: description: Attributes of the case to create. properties: assignee_id: - description: The unique identifier of the user assigned to the case. + description: Unique identifier of the user assigned to the case. example: f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0 type: string description: - description: The description of the case. If not provided, the description - will be automatically generated. + description: Description of the case. If not provided, the description will + be automatically generated. example: A description of the case. type: string priority: $ref: '#/components/schemas/CasePriority' - description: The priority of the case. If not provided, the priority will - be automatically set to "NOT_DEFINED". + description: Priority of the case. If not provided, the priority will be + automatically set to "NOT_DEFINED". example: P4 title: - description: The title of the case. If not provided, the title will be automatically + description: Title of the case. If not provided, the title will be automatically generated. example: A title for the case. type: string @@ -12936,10 +12932,10 @@ components: properties: findings: $ref: '#/components/schemas/Findings' - description: Security findings of the case to create. + description: Security findings to create a case for. project: $ref: '#/components/schemas/CaseManagementProject' - description: Project of the case to create. + description: Case management project in which the case will be created. required: - findings - project @@ -13222,29 +13218,14 @@ components: items: $ref: '#/components/schemas/CreateJiraIssueRequestData' type: array - included: - items: - $ref: '#/components/schemas/CreateJiraIssueRequestArrayIncluded' - type: array required: - data type: object - CreateJiraIssueRequestArrayIncluded: - description: 'Attributes and relationships of the case linked to the Jira issue. - Should contain all of the following: case, project, and security findings.' - oneOf: - - $ref: '#/components/schemas/CreateCaseRequestData' - - $ref: '#/components/schemas/CaseManagementProjectData' - - $ref: '#/components/schemas/FindingData' CreateJiraIssueRequestData: description: Data of the Jira issue to create. properties: attributes: $ref: '#/components/schemas/CreateJiraIssueRequestDataAttributes' - id: - description: The unique identifier of the Jira issue creation request. - example: j1234567-89ab-cdef-0123-456789abcdef - type: string relationships: $ref: '#/components/schemas/CreateJiraIssueRequestDataRelationships' type: @@ -13255,48 +13236,51 @@ components: CreateJiraIssueRequestDataAttributes: description: Attributes of the Jira issue to create. properties: + assignee_id: + description: Unique identifier of the user assigned to the Jira issue. + example: f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0 + type: string + description: + description: Description of the Jira issue. If not provided, the description + will be automatically generated. + example: A description of the Jira issue. + type: string fields: - $ref: '#/components/schemas/CreateJiraIssueRequestDataAttributesFields' - type: object - CreateJiraIssueRequestDataAttributesFields: - description: Custom fields of the Jira issue to create. For the list of available - fields, see [Jira documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-createmeta-projectidorkey-issuetypes-issuetypeid-get). - properties: - fields: + additionalProperties: {} + description: Custom fields of the Jira issue to create. For the list of + available fields, see [Jira documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-createmeta-projectidorkey-issuetypes-issuetypeid-get). example: - customfield_10001: Value 1 - customfield_10002: - - Value 2 - - Value 3 + key1: value + key2: + - value + key3: + key4: value type: object + priority: + $ref: '#/components/schemas/CasePriority' + description: Priority of the Jira issue. If not provided, the priority will + be automatically set to "NOT_DEFINED". + example: P4 + title: + description: Title of the Jira issue. If not provided, the title will be + automatically generated. + example: A title for the Jira issue. + type: string type: object CreateJiraIssueRequestDataRelationships: description: Relationships of the Jira issue to create. properties: - case: - $ref: '#/components/schemas/CreateJiraIssueRequestDataRelationshipsCase' - required: - - case - type: object - CreateJiraIssueRequestDataRelationshipsCase: - description: Case linked to the Jira issue. - properties: - data: - $ref: '#/components/schemas/CreateJiraIssueRequestDataRelationshipsCaseData' - required: - - data - type: object - CreateJiraIssueRequestDataRelationshipsCaseData: - description: Case linked to the Jira issue. - properties: - id: - example: c1234567-89ab-cdef-0123-456789abcdef - type: string - type: - $ref: '#/components/schemas/CaseDataType' + findings: + $ref: '#/components/schemas/Findings' + description: Security findings to create a Jira issue for. + project: + $ref: '#/components/schemas/CaseManagementProject' + description: Case management project configured with the Jira integration. + It is used to create the Jira issue. To configure the Jira integration, + see [Bidirectional ticket syncing with Jira](https://docs.datadoghq.com/security/ticketing_integrations/#bidirectional-ticket-syncing-with-jira). required: - - type - - id + - findings + - project type: object CreateNotificationRuleParameters: description: Body of the notification rule create request. @@ -17407,10 +17391,6 @@ components: DetachCaseRequestData: description: Data for detaching security findings from their case. properties: - id: - description: The unique identifier of the detachment request. - example: f8b9e3b1-24ec-4413-8be5-1b12b98533c6 - type: string relationships: $ref: '#/components/schemas/DetachCaseRequestDataRelationships' type: @@ -21353,7 +21333,7 @@ components: attributes: $ref: '#/components/schemas/FindingCaseResponseDataAttributes' id: - description: The unique identifier of the case. + description: Unique identifier of the case. example: c1234567-89ab-cdef-0123-456789abcdef type: string relationships: @@ -21460,7 +21440,7 @@ components: FindingData: properties: id: - description: The unique identifier of the security finding. + description: Unique identifier of the security finding. example: ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw== type: string type: @@ -21523,15 +21503,15 @@ components: description: Jira issue associated with the case. properties: error_message: - description: The error message if the Jira issue creation failed. + description: Error message if the Jira issue creation failed. example: '{"errorMessages":["An error occured."],"errors":{}}' type: string result: $ref: '#/components/schemas/FindingJiraIssueResult' status: - description: The status of the Jira issue creation. Can be "COMPLETED" if - the Jira issue was created successfully, or "FAILED" if the Jira issue - creation failed. + description: Status of the Jira issue creation. Can be "COMPLETED" if the + Jira issue was created successfully, or "FAILED" if the Jira issue creation + failed. example: COMPLETED type: string type: object @@ -21539,19 +21519,19 @@ components: description: Result of the Jira issue creation. properties: account_id: - description: The account ID of the Jira issue. + description: Account ID of the Jira issue. example: 463a8631-680e-455c-bfd3-3ed04d326eb7 type: string issue_id: - description: The unique identifier of the Jira issue. + description: Unique identifier of the Jira issue. example: '2871276' type: string issue_key: - description: The key of the Jira issue. + description: Key of the Jira issue. example: PROJ-123 type: string issue_url: - description: The URL of the Jira issue. + description: URL of the Jira issue. example: https://domain.atlassian.net/browse/PROJ-123 type: string type: object @@ -79983,11 +79963,13 @@ paths: - security_monitoring_cws_agent_rules_read /api/v2/security/findings/cases: delete: - description: Detach security findings from their case. This operation dissociates - security findings from their associated cases without deleting the cases themselves. - You can detach security findings from multiple different cases in a single - request, with a limit of 50 security findings per request. Security findings - that are not currently attached to any case will be ignored. + description: 'Detach security findings from their case. + + This operation dissociates security findings from their associated cases without + deleting the cases themselves. You can detach security findings from multiple + different cases in a single request, with a limit of 50 security findings + per request. Security findings that are not currently attached to any case + will be ignored.' operationId: DetachCase requestBody: content: @@ -80018,10 +80000,12 @@ paths: - security_monitoring_findings_write - appsec_vm_write post: - description: Create cases for security findings. You can create up to 50 cases - per request and associate up to 50 security findings per case. Security findings - that are already attached to another case will be detached from their previous - case and attached to the newly created case. + description: 'Create cases for security findings. + + You can create up to 50 cases per request and associate up to 50 security + findings per case. Security findings that are already attached to another + case will be detached from their previous case and attached to the newly created + case.' operationId: CreateCases requestBody: content: @@ -80057,14 +80041,14 @@ paths: - appsec_vm_write /api/v2/security/findings/cases/{case_id}: patch: - description: Attach security findings to a case. You can attach up to 50 security - findings per case. Security findings that are already attached to another - case will be detached from their previous case and attached to the specified - case. + description: 'Attach security findings to a case. + + You can attach up to 50 security findings per case. Security findings that + are already attached to another case will be detached from their previous + case and attached to the specified case.' operationId: AttachCase parameters: - - description: The unique identifier of the case to attach security findings - to + - description: Unique identifier of the case to attach security findings to in: path name: case_id required: true @@ -80104,12 +80088,16 @@ paths: - appsec_vm_write /api/v2/security/findings/jira_issues: patch: - description: Attach security findings to a Jira issue by providing the Jira - issue URL. You can attach up to 50 security findings per Jira issue. If the - Jira issue is not linked to any case, this operation will create a case for - the security findings and link the Jira issue to the newly created case. Security - findings that are already attached to another Jira issue will be detached - from their previous Jira issue and attached to the specified Jira issue. + description: 'Attach security findings to a Jira issue by providing the Jira + issue URL. + + You can attach up to 50 security findings per Jira issue. If the Jira issue + is not linked to any case, this operation will create a case for the security + findings and link the Jira issue to the newly created case. To configure the + Jira integration, see [Bidirectional ticket syncing with Jira](https://docs.datadoghq.com/security/ticketing_integrations/#bidirectional-ticket-syncing-with-jira). + Security findings that are already attached to another Jira issue will be + detached from their previous Jira issue and attached to the specified Jira + issue.' operationId: AttachJiraIssue requestBody: content: @@ -80147,12 +80135,15 @@ paths: Please check the documentation regularly for updates.' post: - description: Create Jira issues for security findings. This operation creates - a case in Datadog and a Jira issue linked to that case for bidirectional sync - between Datadog and Jira. You can create up to 50 Jira issues per request - and associate up to 50 security findings per Jira issue. Security findings - that are already attached to another Jira issue will be detached from their - previous Jira issue and attached to the newly created Jira issue. + description: 'Create Jira issues for security findings. + + This operation creates a case in Datadog and a Jira issue linked to that case + for bidirectional sync between Datadog and Jira. To configure the Jira integration, + see [Bidirectional ticket syncing with Jira](https://docs.datadoghq.com/security/ticketing_integrations/#bidirectional-ticket-syncing-with-jira). + You can create up to 50 Jira issues per request and associate up to 50 security + findings per Jira issue. Security findings that are already attached to another + Jira issue will be detached from their previous Jira issue and attached to + the newly created Jira issue.' operationId: CreateJiraIssues requestBody: content: diff --git a/examples/v2/security-monitoring/CreateCases.java b/examples/v2/security-monitoring/CreateCases.java index 1d85e2724d9..97075198d9b 100644 --- a/examples/v2/security-monitoring/CreateCases.java +++ b/examples/v2/security-monitoring/CreateCases.java @@ -40,7 +40,7 @@ public static void main(String[] args) { Collections.singletonList( new FindingData() .id( - "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=") + "YjdhNDM3N2QyNTFjYmUwYTY3NDdhMTg0YTk2Yjg5MDl-ZjNmMzAwOTFkZDNhNGQzYzI0MzgxNTk4MjRjZmE2NzE=") .type(FindingDataType.FINDINGS)))) .project( new CaseManagementProject() @@ -62,7 +62,7 @@ public static void main(String[] args) { Collections.singletonList( new FindingData() .id( - "MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=") + "OGRlMDIwYzk4MjFmZTZiNTQwMzk2ZjUxNzg0MDc0NjR-MTk3Yjk4MDI4ZDQ4YzI2ZGZiMWJmMTNhNDEwZGZkYWI=") .type(FindingDataType.FINDINGS)))) .project( new CaseManagementProject() diff --git a/examples/v2/security-monitoring/CreateCases_2385516013.java b/examples/v2/security-monitoring/CreateCases_2385516013.java index bbca5c082f6..cc439bf1e09 100644 --- a/examples/v2/security-monitoring/CreateCases_2385516013.java +++ b/examples/v2/security-monitoring/CreateCases_2385516013.java @@ -39,7 +39,7 @@ public static void main(String[] args) { Collections.singletonList( new FindingData() .id( - "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=") + "YjdhNDM3N2QyNTFjYmUwYTY3NDdhMTg0YTk2Yjg5MDl-ZjNmMzAwOTFkZDNhNGQzYzI0MzgxNTk4MjRjZmE2NzE=") .type(FindingDataType.FINDINGS)))) .project( new CaseManagementProject() diff --git a/examples/v2/security-monitoring/CreateCases_2798851680.java b/examples/v2/security-monitoring/CreateCases_2798851680.java index 3c06a697e59..3c2dfd31709 100644 --- a/examples/v2/security-monitoring/CreateCases_2798851680.java +++ b/examples/v2/security-monitoring/CreateCases_2798851680.java @@ -40,11 +40,11 @@ public static void main(String[] args) { Arrays.asList( new FindingData() .id( - "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=") + "ZTd5LWNuYi1seWV-aS0wMjI2NGZjZjRmZWQ5ODMyMg==") .type(FindingDataType.FINDINGS), new FindingData() .id( - "MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=") + "c2FuLXhyaS1kZnN-aS0wODM3MjVhMTM2MDExNzNkOQ==") .type(FindingDataType.FINDINGS)))) .project( new CaseManagementProject() diff --git a/examples/v2/security-monitoring/CreateJiraIssues.java b/examples/v2/security-monitoring/CreateJiraIssues.java index 53dbdd74cb2..c01e95d5188 100644 --- a/examples/v2/security-monitoring/CreateJiraIssues.java +++ b/examples/v2/security-monitoring/CreateJiraIssues.java @@ -3,123 +3,61 @@ 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.CaseDataType; 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.CreateCaseRequestData; -import com.datadog.api.client.v2.model.CreateCaseRequestDataAttributes; -import com.datadog.api.client.v2.model.CreateCaseRequestDataRelationships; +import com.datadog.api.client.v2.model.CasePriority; import com.datadog.api.client.v2.model.CreateJiraIssueRequestArray; -import com.datadog.api.client.v2.model.CreateJiraIssueRequestArrayIncluded; import com.datadog.api.client.v2.model.CreateJiraIssueRequestData; import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataAttributes; import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataRelationships; -import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataRelationshipsCase; -import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataRelationshipsCaseData; 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.JiraIssuesDataType; -import java.util.Arrays; import java.util.Collections; +import java.util.Map; public class Example { public static void main(String[] args) { ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createJiraIssues", true); SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); CreateJiraIssueRequestArray body = new CreateJiraIssueRequestArray() .data( - Arrays.asList( + Collections.singletonList( new CreateJiraIssueRequestData() - .type(JiraIssuesDataType.JIRA_ISSUES) - .attributes(new CreateJiraIssueRequestDataAttributes()) + .attributes( + new CreateJiraIssueRequestDataAttributes() + .assigneeId("f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0") + .description("A description of the Jira issue.") + .fields( + Map.ofEntries( + Map.entry("key1", "value"), + Map.entry("key2", "['value']"), + Map.entry("key3", "{'key4': 'value'}"))) + .priority(CasePriority.NOT_DEFINED) + .title("A title for the Jira issue.")) .relationships( new CreateJiraIssueRequestDataRelationships() - ._case( - new CreateJiraIssueRequestDataRelationshipsCase() + .findings( + new Findings() .data( - new CreateJiraIssueRequestDataRelationshipsCaseData() - .type(CaseDataType.CASES) - .id("53e242c6-a7d6-46ad-9680-b8d14753f716")))), - new CreateJiraIssueRequestData() - .type(JiraIssuesDataType.JIRA_ISSUES) - .attributes(new CreateJiraIssueRequestDataAttributes()) - .relationships( - new CreateJiraIssueRequestDataRelationships() - ._case( - new CreateJiraIssueRequestDataRelationshipsCase() + Collections.singletonList( + new FindingData() + .id( + "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==") + .type(FindingDataType.FINDINGS)))) + .project( + new CaseManagementProject() .data( - new CreateJiraIssueRequestDataRelationshipsCaseData() - .type(CaseDataType.CASES) - .id("195772b2-1f53-41d2-b81e-48c8e6c21d33")))))) - .included( - Arrays.asList( - new CreateJiraIssueRequestArrayIncluded( - new CreateCaseRequestData() - .type(CaseDataType.CASES) - .attributes( - new CreateCaseRequestDataAttributes() - .title("A title") - .description("A description")) - .relationships( - new CreateCaseRequestDataRelationships() - .project( - new CaseManagementProject() - .data( - new CaseManagementProjectData() - .type(CaseManagementProjectDataType.PROJECTS) - .id("959a6f71-bac8-4027-b1d3-2264f569296f"))) - .findings( - new Findings() - .data( - Collections.singletonList( - new FindingData() - .type(FindingDataType.FINDINGS) - .id( - "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI="))))) - .id("53e242c6-a7d6-46ad-9680-b8d14753f716")), - new CreateJiraIssueRequestArrayIncluded( - new CreateCaseRequestData() - .type(CaseDataType.CASES) - .attributes( - new CreateCaseRequestDataAttributes() - .title("A title") - .description("A description")) - .relationships( - new CreateCaseRequestDataRelationships() - .project( - new CaseManagementProject() - .data( - new CaseManagementProjectData() - .type(CaseManagementProjectDataType.PROJECTS) - .id("959a6f71-bac8-4027-b1d3-2264f569296f"))) - .findings( - new Findings() - .data( - Collections.singletonList( - new FindingData() - .type(FindingDataType.FINDINGS) - .id( - "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM="))))) - .id("195772b2-1f53-41d2-b81e-48c8e6c21d33")), - new CreateJiraIssueRequestArrayIncluded( - new CaseManagementProjectData() - .type(CaseManagementProjectDataType.PROJECTS) - .id("959a6f71-bac8-4027-b1d3-2264f569296f")), - new CreateJiraIssueRequestArrayIncluded( - new FindingData() - .type(FindingDataType.FINDINGS) - .id( - "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=")), - new CreateJiraIssueRequestArrayIncluded( - new FindingData() - .type(FindingDataType.FINDINGS) - .id( - "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=")))); + new CaseManagementProjectData() + .id("aeadc05e-98a8-11ec-ac2c-da7ad0900001") + .type(CaseManagementProjectDataType.PROJECTS)))) + .type(JiraIssuesDataType.JIRA_ISSUES))); try { FindingCaseResponseArray result = apiInstance.createJiraIssues(body); diff --git a/examples/v2/security-monitoring/CreateJiraIssues_379590688.java b/examples/v2/security-monitoring/CreateJiraIssues_379590688.java deleted file mode 100644 index df6b9e51ef6..00000000000 --- a/examples/v2/security-monitoring/CreateJiraIssues_379590688.java +++ /dev/null @@ -1,95 +0,0 @@ -// Create Jira issue for security finding 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.CaseDataType; -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.CreateCaseRequestData; -import com.datadog.api.client.v2.model.CreateCaseRequestDataAttributes; -import com.datadog.api.client.v2.model.CreateCaseRequestDataRelationships; -import com.datadog.api.client.v2.model.CreateJiraIssueRequestArray; -import com.datadog.api.client.v2.model.CreateJiraIssueRequestArrayIncluded; -import com.datadog.api.client.v2.model.CreateJiraIssueRequestData; -import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataAttributes; -import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataRelationships; -import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataRelationshipsCase; -import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataRelationshipsCaseData; -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.JiraIssuesDataType; -import java.util.Arrays; -import java.util.Collections; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = ApiClient.getDefaultApiClient(); - SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); - - CreateJiraIssueRequestArray body = - new CreateJiraIssueRequestArray() - .data( - Collections.singletonList( - new CreateJiraIssueRequestData() - .type(JiraIssuesDataType.JIRA_ISSUES) - .attributes(new CreateJiraIssueRequestDataAttributes()) - .relationships( - new CreateJiraIssueRequestDataRelationships() - ._case( - new CreateJiraIssueRequestDataRelationshipsCase() - .data( - new CreateJiraIssueRequestDataRelationshipsCaseData() - .type(CaseDataType.CASES) - .id("6a773295-8729-4034-aada-53b64cbe02e7")))))) - .included( - Arrays.asList( - new CreateJiraIssueRequestArrayIncluded( - new CreateCaseRequestData() - .type(CaseDataType.CASES) - .attributes( - new CreateCaseRequestDataAttributes() - .title("A title") - .description("A description")) - .relationships( - new CreateCaseRequestDataRelationships() - .project( - new CaseManagementProject() - .data( - new CaseManagementProjectData() - .type(CaseManagementProjectDataType.PROJECTS) - .id("959a6f71-bac8-4027-b1d3-2264f569296f"))) - .findings( - new Findings() - .data( - Collections.singletonList( - new FindingData() - .type(FindingDataType.FINDINGS) - .id( - "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="))))) - .id("6a773295-8729-4034-aada-53b64cbe02e7")), - new CreateJiraIssueRequestArrayIncluded( - new CaseManagementProjectData() - .type(CaseManagementProjectDataType.PROJECTS) - .id("959a6f71-bac8-4027-b1d3-2264f569296f")), - new CreateJiraIssueRequestArrayIncluded( - new FindingData() - .type(FindingDataType.FINDINGS) - .id( - "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=")))); - - try { - FindingCaseResponseArray result = apiInstance.createJiraIssues(body); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling SecurityMonitoringApi#createJiraIssues"); - 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/CreateJiraIssues_829823123.java b/examples/v2/security-monitoring/CreateJiraIssues_829823123.java deleted file mode 100644 index ffa4b5f52cc..00000000000 --- a/examples/v2/security-monitoring/CreateJiraIssues_829823123.java +++ /dev/null @@ -1,104 +0,0 @@ -// Create Jira issue 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.CaseDataType; -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.CreateCaseRequestData; -import com.datadog.api.client.v2.model.CreateCaseRequestDataAttributes; -import com.datadog.api.client.v2.model.CreateCaseRequestDataRelationships; -import com.datadog.api.client.v2.model.CreateJiraIssueRequestArray; -import com.datadog.api.client.v2.model.CreateJiraIssueRequestArrayIncluded; -import com.datadog.api.client.v2.model.CreateJiraIssueRequestData; -import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataAttributes; -import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataRelationships; -import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataRelationshipsCase; -import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataRelationshipsCaseData; -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.JiraIssuesDataType; -import java.util.Arrays; -import java.util.Collections; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = ApiClient.getDefaultApiClient(); - SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); - - CreateJiraIssueRequestArray body = - new CreateJiraIssueRequestArray() - .data( - Collections.singletonList( - new CreateJiraIssueRequestData() - .type(JiraIssuesDataType.JIRA_ISSUES) - .attributes(new CreateJiraIssueRequestDataAttributes()) - .relationships( - new CreateJiraIssueRequestDataRelationships() - ._case( - new CreateJiraIssueRequestDataRelationshipsCase() - .data( - new CreateJiraIssueRequestDataRelationshipsCaseData() - .type(CaseDataType.CASES) - .id("e469ceda-957a-4557-a607-9ff25032e9ca")))))) - .included( - Arrays.asList( - new CreateJiraIssueRequestArrayIncluded( - new CreateCaseRequestData() - .type(CaseDataType.CASES) - .attributes( - new CreateCaseRequestDataAttributes() - .title("A title") - .description("A description")) - .relationships( - new CreateCaseRequestDataRelationships() - .project( - new CaseManagementProject() - .data( - new CaseManagementProjectData() - .type(CaseManagementProjectDataType.PROJECTS) - .id("959a6f71-bac8-4027-b1d3-2264f569296f"))) - .findings( - new Findings() - .data( - Arrays.asList( - new FindingData() - .type(FindingDataType.FINDINGS) - .id( - "MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="), - new FindingData() - .type(FindingDataType.FINDINGS) - .id( - "ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="))))) - .id("e469ceda-957a-4557-a607-9ff25032e9ca")), - new CreateJiraIssueRequestArrayIncluded( - new CaseManagementProjectData() - .type(CaseManagementProjectDataType.PROJECTS) - .id("959a6f71-bac8-4027-b1d3-2264f569296f")), - new CreateJiraIssueRequestArrayIncluded( - new FindingData() - .type(FindingDataType.FINDINGS) - .id( - "MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=")), - new CreateJiraIssueRequestArrayIncluded( - new FindingData() - .type(FindingDataType.FINDINGS) - .id( - "ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=")))); - - try { - FindingCaseResponseArray result = apiInstance.createJiraIssues(body); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling SecurityMonitoringApi#createJiraIssues"); - 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/v2/api/SecurityMonitoringApi.java b/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java index c261e96ae68..8dc4ef4a1d6 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 @@ -128,7 +128,7 @@ public void setApiClient(ApiClient apiClient) { * *

See {@link #attachCaseWithHttpInfo}. * - * @param caseId The unique identifier of the case to attach security findings to (required) + * @param caseId Unique identifier of the case to attach security findings to (required) * @param body (required) * @return FindingCaseResponse * @throws ApiException if fails to make API call @@ -142,7 +142,7 @@ public FindingCaseResponse attachCase(String caseId, AttachCaseRequest body) thr * *

See {@link #attachCaseWithHttpInfoAsync}. * - * @param caseId The unique identifier of the case to attach security findings to (required) + * @param caseId Unique identifier of the case to attach security findings to (required) * @param body (required) * @return CompletableFuture<FindingCaseResponse> */ @@ -160,7 +160,7 @@ public CompletableFuture attachCaseAsync( * Security findings that are already attached to another case will be detached from their * previous case and attached to the specified case. * - * @param caseId The unique identifier of the case to attach security findings to (required) + * @param caseId Unique identifier of the case to attach security findings to (required) * @param body (required) * @return ApiResponse<FindingCaseResponse> * @throws ApiException if fails to make API call @@ -220,7 +220,7 @@ public ApiResponse attachCaseWithHttpInfo( * *

See {@link #attachCaseWithHttpInfo}. * - * @param caseId The unique identifier of the case to attach security findings to (required) + * @param caseId Unique identifier of the case to attach security findings to (required) * @param body (required) * @return CompletableFuture<ApiResponse<FindingCaseResponse>> */ @@ -310,8 +310,10 @@ public CompletableFuture attachJiraIssueAsync(AttachJiraIss * Attach security findings to a Jira issue by providing the Jira issue URL. You can attach up to * 50 security findings per Jira issue. If the Jira issue is not linked to any case, this * operation will create a case for the security findings and link the Jira issue to the newly - * created case. Security findings that are already attached to another Jira issue will be - * detached from their previous Jira issue and attached to the specified Jira issue. + * created case. To configure the Jira integration, see Bidirectional + * ticket syncing with Jira. Security findings that are already attached to another Jira issue + * will be detached from their previous Jira issue and attached to the specified Jira issue. * * @param body (required) * @return ApiResponse<FindingCaseResponse> @@ -1333,10 +1335,13 @@ public CompletableFuture createJiraIssuesAsync( /** * Create Jira issues for security findings. This operation creates a case in Datadog and a Jira - * issue linked to that case for bidirectional sync between Datadog and Jira. You can create up to - * 50 Jira issues per request and associate up to 50 security findings per Jira issue. Security - * findings that are already attached to another Jira issue will be detached from their previous - * Jira issue and attached to the newly created Jira issue. + * issue linked to that case for bidirectional sync between Datadog and Jira. To configure the + * Jira integration, see Bidirectional + * ticket syncing with Jira. You can create up to 50 Jira issues per request and associate up + * to 50 security findings per Jira issue. Security findings that are already attached to another + * Jira issue will be detached from their previous Jira issue and attached to the newly created + * Jira issue. * * @param body (required) * @return ApiResponse<FindingCaseResponseArray> diff --git a/src/main/java/com/datadog/api/client/v2/model/AttachCaseRequestData.java b/src/main/java/com/datadog/api/client/v2/model/AttachCaseRequestData.java index a1ef2258de0..77cca47792c 100644 --- a/src/main/java/com/datadog/api/client/v2/model/AttachCaseRequestData.java +++ b/src/main/java/com/datadog/api/client/v2/model/AttachCaseRequestData.java @@ -53,7 +53,7 @@ public AttachCaseRequestData id(String id) { } /** - * The unique identifier of the case. + * Unique identifier of the case. * * @return id */ diff --git a/src/main/java/com/datadog/api/client/v2/model/AttachJiraIssueRequestData.java b/src/main/java/com/datadog/api/client/v2/model/AttachJiraIssueRequestData.java index 3656fafca81..541494914f0 100644 --- a/src/main/java/com/datadog/api/client/v2/model/AttachJiraIssueRequestData.java +++ b/src/main/java/com/datadog/api/client/v2/model/AttachJiraIssueRequestData.java @@ -20,7 +20,6 @@ /** Data of the Jira issue to attach security findings to. */ @JsonPropertyOrder({ AttachJiraIssueRequestData.JSON_PROPERTY_ATTRIBUTES, - AttachJiraIssueRequestData.JSON_PROPERTY_ID, AttachJiraIssueRequestData.JSON_PROPERTY_RELATIONSHIPS, AttachJiraIssueRequestData.JSON_PROPERTY_TYPE }) @@ -31,9 +30,6 @@ public class AttachJiraIssueRequestData { public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; private AttachJiraIssueRequestDataAttributes attributes; - public static final String JSON_PROPERTY_ID = "id"; - private String id; - public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; private AttachJiraIssueRequestDataRelationships relationships; @@ -71,27 +67,6 @@ public void setAttributes(AttachJiraIssueRequestDataAttributes attributes) { this.attributes = attributes; } - public AttachJiraIssueRequestData id(String id) { - this.id = id; - return this; - } - - /** - * The unique identifier of the Jira issue attachment 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 AttachJiraIssueRequestData relationships( AttachJiraIssueRequestDataRelationships relationships) { this.relationships = relationships; @@ -196,7 +171,6 @@ public boolean equals(Object o) { } AttachJiraIssueRequestData attachJiraIssueRequestData = (AttachJiraIssueRequestData) o; return Objects.equals(this.attributes, attachJiraIssueRequestData.attributes) - && Objects.equals(this.id, attachJiraIssueRequestData.id) && Objects.equals(this.relationships, attachJiraIssueRequestData.relationships) && Objects.equals(this.type, attachJiraIssueRequestData.type) && Objects.equals( @@ -205,7 +179,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(attributes, id, relationships, type, additionalProperties); + return Objects.hash(attributes, relationships, type, additionalProperties); } @Override @@ -213,7 +187,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AttachJiraIssueRequestData {\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: ") diff --git a/src/main/java/com/datadog/api/client/v2/model/AttachJiraIssueRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AttachJiraIssueRequestDataAttributes.java index eb1b027c265..1e537a5c694 100644 --- a/src/main/java/com/datadog/api/client/v2/model/AttachJiraIssueRequestDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/AttachJiraIssueRequestDataAttributes.java @@ -40,7 +40,7 @@ public AttachJiraIssueRequestDataAttributes jiraIssueUrl(String jiraIssueUrl) { } /** - * The URL of the Jira issue to attach security findings to. + * URL of the Jira issue to attach security findings to. * * @return jiraIssueUrl */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseInsightsItems.java b/src/main/java/com/datadog/api/client/v2/model/CaseInsightsItems.java index 5862079f5d7..ac4016bcd77 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CaseInsightsItems.java +++ b/src/main/java/com/datadog/api/client/v2/model/CaseInsightsItems.java @@ -41,7 +41,7 @@ public CaseInsightsItems ref(String ref) { } /** - * The reference of the insight. + * Reference of the insight. * * @return ref */ @@ -62,8 +62,7 @@ public CaseInsightsItems resourceId(String resourceId) { } /** - * The unique identifier of the resource. For example, the unique identifier of a security - * finding. + * Unique identifier of the resource. For example, the unique identifier of a security finding. * * @return resourceId */ @@ -84,7 +83,7 @@ public CaseInsightsItems type(String type) { } /** - * The type of the resource. For example, the type of a security finding is "SECURITY_FINDING". + * Type of the resource. For example, the type of a security finding is "SECURITY_FINDING". * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseManagementProjectData.java b/src/main/java/com/datadog/api/client/v2/model/CaseManagementProjectData.java index c3022188b1c..21c6d4e0664 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CaseManagementProjectData.java +++ b/src/main/java/com/datadog/api/client/v2/model/CaseManagementProjectData.java @@ -50,7 +50,7 @@ public CaseManagementProjectData id(String id) { } /** - * The unique identifier of the case management project. + * Unique identifier of the case management project. * * @return id */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateCaseRequestData.java b/src/main/java/com/datadog/api/client/v2/model/CreateCaseRequestData.java index 2895492d618..9a32ac163ad 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CreateCaseRequestData.java +++ b/src/main/java/com/datadog/api/client/v2/model/CreateCaseRequestData.java @@ -20,7 +20,6 @@ /** Data of the case to create. */ @JsonPropertyOrder({ CreateCaseRequestData.JSON_PROPERTY_ATTRIBUTES, - CreateCaseRequestData.JSON_PROPERTY_ID, CreateCaseRequestData.JSON_PROPERTY_RELATIONSHIPS, CreateCaseRequestData.JSON_PROPERTY_TYPE }) @@ -31,9 +30,6 @@ public class CreateCaseRequestData { public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; private CreateCaseRequestDataAttributes attributes; - public static final String JSON_PROPERTY_ID = "id"; - private String id; - public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; private CreateCaseRequestDataRelationships relationships; @@ -71,27 +67,6 @@ public void setAttributes(CreateCaseRequestDataAttributes attributes) { this.attributes = attributes; } - public CreateCaseRequestData id(String id) { - this.id = id; - return this; - } - - /** - * The unique identifier of the case. - * - * @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 CreateCaseRequestData relationships(CreateCaseRequestDataRelationships relationships) { this.relationships = relationships; this.unparsed |= relationships.unparsed; @@ -195,7 +170,6 @@ public boolean equals(Object o) { } CreateCaseRequestData createCaseRequestData = (CreateCaseRequestData) o; return Objects.equals(this.attributes, createCaseRequestData.attributes) - && Objects.equals(this.id, createCaseRequestData.id) && Objects.equals(this.relationships, createCaseRequestData.relationships) && Objects.equals(this.type, createCaseRequestData.type) && Objects.equals(this.additionalProperties, createCaseRequestData.additionalProperties); @@ -203,7 +177,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(attributes, id, relationships, type, additionalProperties); + return Objects.hash(attributes, relationships, type, additionalProperties); } @Override @@ -211,7 +185,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateCaseRequestData {\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: ") diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateCaseRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateCaseRequestDataAttributes.java index 06d5c96adff..05ba285b553 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CreateCaseRequestDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/CreateCaseRequestDataAttributes.java @@ -45,7 +45,7 @@ public CreateCaseRequestDataAttributes assigneeId(String assigneeId) { } /** - * The unique identifier of the user assigned to the case. + * Unique identifier of the user assigned to the case. * * @return assigneeId */ @@ -66,7 +66,7 @@ public CreateCaseRequestDataAttributes description(String description) { } /** - * The description of the case. If not provided, the description will be automatically generated. + * Description of the case. If not provided, the description will be automatically generated. * * @return description */ @@ -112,7 +112,7 @@ public CreateCaseRequestDataAttributes title(String title) { } /** - * The title of the case. If not provided, the title will be automatically generated. + * Title of the case. If not provided, the title will be automatically generated. * * @return title */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestArray.java b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestArray.java index 67aab168087..3a5752591bf 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestArray.java +++ b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestArray.java @@ -20,10 +20,7 @@ import java.util.Objects; /** List of requests to create Jira issues for security findings. */ -@JsonPropertyOrder({ - CreateJiraIssueRequestArray.JSON_PROPERTY_DATA, - CreateJiraIssueRequestArray.JSON_PROPERTY_INCLUDED -}) +@JsonPropertyOrder({CreateJiraIssueRequestArray.JSON_PROPERTY_DATA}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class CreateJiraIssueRequestArray { @@ -31,9 +28,6 @@ public class CreateJiraIssueRequestArray { public static final String JSON_PROPERTY_DATA = "data"; private List data = new ArrayList<>(); - public static final String JSON_PROPERTY_INCLUDED = "included"; - private List included = null; - public CreateJiraIssueRequestArray() {} @JsonCreator @@ -72,40 +66,6 @@ public void setData(List data) { this.data = data; } - public CreateJiraIssueRequestArray included(List included) { - this.included = included; - for (CreateJiraIssueRequestArrayIncluded item : included) { - this.unparsed |= item.unparsed; - } - return this; - } - - public CreateJiraIssueRequestArray addIncludedItem( - CreateJiraIssueRequestArrayIncluded includedItem) { - if (this.included == null) { - this.included = new ArrayList<>(); - } - this.included.add(includedItem); - this.unparsed |= includedItem.unparsed; - return this; - } - - /** - * Getincluded - * - * @return included - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_INCLUDED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getIncluded() { - return included; - } - - public void setIncluded(List included) { - this.included = included; - } - /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -163,14 +123,13 @@ public boolean equals(Object o) { } CreateJiraIssueRequestArray createJiraIssueRequestArray = (CreateJiraIssueRequestArray) o; return Objects.equals(this.data, createJiraIssueRequestArray.data) - && Objects.equals(this.included, createJiraIssueRequestArray.included) && Objects.equals( this.additionalProperties, createJiraIssueRequestArray.additionalProperties); } @Override public int hashCode() { - return Objects.hash(data, included, additionalProperties); + return Objects.hash(data, additionalProperties); } @Override @@ -178,7 +137,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateJiraIssueRequestArray {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append(" included: ").append(toIndentedString(included)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestArrayIncluded.java b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestArrayIncluded.java deleted file mode 100644 index 560f748d275..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestArrayIncluded.java +++ /dev/null @@ -1,352 +0,0 @@ -/* - * 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.AbstractOpenApiSchema; -import com.datadog.api.client.JSON; -import com.datadog.api.client.UnparsedObject; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.MapperFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; -import jakarta.ws.rs.core.GenericType; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -@JsonDeserialize( - using = - CreateJiraIssueRequestArrayIncluded.CreateJiraIssueRequestArrayIncludedDeserializer.class) -@JsonSerialize( - using = CreateJiraIssueRequestArrayIncluded.CreateJiraIssueRequestArrayIncludedSerializer.class) -public class CreateJiraIssueRequestArrayIncluded extends AbstractOpenApiSchema { - private static final Logger log = - Logger.getLogger(CreateJiraIssueRequestArrayIncluded.class.getName()); - - @JsonIgnore public boolean unparsed = false; - - public static class CreateJiraIssueRequestArrayIncludedSerializer - extends StdSerializer { - public CreateJiraIssueRequestArrayIncludedSerializer( - Class t) { - super(t); - } - - public CreateJiraIssueRequestArrayIncludedSerializer() { - this(null); - } - - @Override - public void serialize( - CreateJiraIssueRequestArrayIncluded value, JsonGenerator jgen, SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.getActualInstance()); - } - } - - public static class CreateJiraIssueRequestArrayIncludedDeserializer - extends StdDeserializer { - public CreateJiraIssueRequestArrayIncludedDeserializer() { - this(CreateJiraIssueRequestArrayIncluded.class); - } - - public CreateJiraIssueRequestArrayIncludedDeserializer(Class vc) { - super(vc); - } - - @Override - public CreateJiraIssueRequestArrayIncluded deserialize( - JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { - JsonNode tree = jp.readValueAsTree(); - Object deserialized = null; - Object tmp = null; - boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); - int match = 0; - JsonToken token = tree.traverse(jp.getCodec()).nextToken(); - // deserialize CreateCaseRequestData - try { - boolean attemptParsing = true; - // ensure that we respect type coercion as set on the client ObjectMapper - if (CreateCaseRequestData.class.equals(Integer.class) - || CreateCaseRequestData.class.equals(Long.class) - || CreateCaseRequestData.class.equals(Float.class) - || CreateCaseRequestData.class.equals(Double.class) - || CreateCaseRequestData.class.equals(Boolean.class) - || CreateCaseRequestData.class.equals(String.class)) { - attemptParsing = typeCoercion; - if (!attemptParsing) { - attemptParsing |= - ((CreateCaseRequestData.class.equals(Integer.class) - || CreateCaseRequestData.class.equals(Long.class)) - && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= - ((CreateCaseRequestData.class.equals(Float.class) - || CreateCaseRequestData.class.equals(Double.class)) - && (token == JsonToken.VALUE_NUMBER_FLOAT - || token == JsonToken.VALUE_NUMBER_INT)); - attemptParsing |= - (CreateCaseRequestData.class.equals(Boolean.class) - && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= - (CreateCaseRequestData.class.equals(String.class) - && token == JsonToken.VALUE_STRING); - } - } - if (attemptParsing) { - tmp = tree.traverse(jp.getCodec()).readValueAs(CreateCaseRequestData.class); - // TODO: there is no validation against JSON schema constraints - // (min, max, enum, pattern...), this does not perform a strict JSON - // validation, which means the 'match' count may be higher than it should be. - if (!((CreateCaseRequestData) tmp).unparsed) { - deserialized = tmp; - match++; - } - log.log(Level.FINER, "Input data matches schema 'CreateCaseRequestData'"); - } - } catch (Exception e) { - // deserialization failed, continue - log.log(Level.FINER, "Input data does not match schema 'CreateCaseRequestData'", e); - } - - // deserialize CaseManagementProjectData - try { - boolean attemptParsing = true; - // ensure that we respect type coercion as set on the client ObjectMapper - if (CaseManagementProjectData.class.equals(Integer.class) - || CaseManagementProjectData.class.equals(Long.class) - || CaseManagementProjectData.class.equals(Float.class) - || CaseManagementProjectData.class.equals(Double.class) - || CaseManagementProjectData.class.equals(Boolean.class) - || CaseManagementProjectData.class.equals(String.class)) { - attemptParsing = typeCoercion; - if (!attemptParsing) { - attemptParsing |= - ((CaseManagementProjectData.class.equals(Integer.class) - || CaseManagementProjectData.class.equals(Long.class)) - && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= - ((CaseManagementProjectData.class.equals(Float.class) - || CaseManagementProjectData.class.equals(Double.class)) - && (token == JsonToken.VALUE_NUMBER_FLOAT - || token == JsonToken.VALUE_NUMBER_INT)); - attemptParsing |= - (CaseManagementProjectData.class.equals(Boolean.class) - && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= - (CaseManagementProjectData.class.equals(String.class) - && token == JsonToken.VALUE_STRING); - } - } - if (attemptParsing) { - tmp = tree.traverse(jp.getCodec()).readValueAs(CaseManagementProjectData.class); - // TODO: there is no validation against JSON schema constraints - // (min, max, enum, pattern...), this does not perform a strict JSON - // validation, which means the 'match' count may be higher than it should be. - if (!((CaseManagementProjectData) tmp).unparsed) { - deserialized = tmp; - match++; - } - log.log(Level.FINER, "Input data matches schema 'CaseManagementProjectData'"); - } - } catch (Exception e) { - // deserialization failed, continue - log.log(Level.FINER, "Input data does not match schema 'CaseManagementProjectData'", e); - } - - // deserialize FindingData - try { - boolean attemptParsing = true; - // ensure that we respect type coercion as set on the client ObjectMapper - if (FindingData.class.equals(Integer.class) - || FindingData.class.equals(Long.class) - || FindingData.class.equals(Float.class) - || FindingData.class.equals(Double.class) - || FindingData.class.equals(Boolean.class) - || FindingData.class.equals(String.class)) { - attemptParsing = typeCoercion; - if (!attemptParsing) { - attemptParsing |= - ((FindingData.class.equals(Integer.class) || FindingData.class.equals(Long.class)) - && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= - ((FindingData.class.equals(Float.class) || FindingData.class.equals(Double.class)) - && (token == JsonToken.VALUE_NUMBER_FLOAT - || token == JsonToken.VALUE_NUMBER_INT)); - attemptParsing |= - (FindingData.class.equals(Boolean.class) - && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= - (FindingData.class.equals(String.class) && token == JsonToken.VALUE_STRING); - } - } - if (attemptParsing) { - tmp = tree.traverse(jp.getCodec()).readValueAs(FindingData.class); - // TODO: there is no validation against JSON schema constraints - // (min, max, enum, pattern...), this does not perform a strict JSON - // validation, which means the 'match' count may be higher than it should be. - if (!((FindingData) tmp).unparsed) { - deserialized = tmp; - match++; - } - log.log(Level.FINER, "Input data matches schema 'FindingData'"); - } - } catch (Exception e) { - // deserialization failed, continue - log.log(Level.FINER, "Input data does not match schema 'FindingData'", e); - } - - CreateJiraIssueRequestArrayIncluded ret = new CreateJiraIssueRequestArrayIncluded(); - if (match == 1) { - ret.setActualInstance(deserialized); - } else { - Map res = - new ObjectMapper() - .readValue( - tree.traverse(jp.getCodec()).readValueAsTree().toString(), - new TypeReference>() {}); - ret.setActualInstance(new UnparsedObject(res)); - } - return ret; - } - - /** Handle deserialization of the 'null' value. */ - @Override - public CreateJiraIssueRequestArrayIncluded getNullValue(DeserializationContext ctxt) - throws JsonMappingException { - throw new JsonMappingException( - ctxt.getParser(), "CreateJiraIssueRequestArrayIncluded cannot be null"); - } - } - - // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); - - public CreateJiraIssueRequestArrayIncluded() { - super("oneOf", Boolean.FALSE); - } - - public CreateJiraIssueRequestArrayIncluded(CreateCaseRequestData o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public CreateJiraIssueRequestArrayIncluded(CaseManagementProjectData o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public CreateJiraIssueRequestArrayIncluded(FindingData o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("CreateCaseRequestData", new GenericType() {}); - schemas.put("CaseManagementProjectData", new GenericType() {}); - schemas.put("FindingData", new GenericType() {}); - JSON.registerDescendants( - CreateJiraIssueRequestArrayIncluded.class, Collections.unmodifiableMap(schemas)); - } - - @Override - public Map getSchemas() { - return CreateJiraIssueRequestArrayIncluded.schemas; - } - - /** - * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: CreateCaseRequestData, CaseManagementProjectData, FindingData - * - *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a - * composed schema (allOf, anyOf, oneOf). - */ - @Override - public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(CreateCaseRequestData.class, instance, new HashSet>())) { - super.setActualInstance(instance); - return; - } - if (JSON.isInstanceOf(CaseManagementProjectData.class, instance, new HashSet>())) { - super.setActualInstance(instance); - return; - } - if (JSON.isInstanceOf(FindingData.class, instance, new HashSet>())) { - super.setActualInstance(instance); - return; - } - - if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { - super.setActualInstance(instance); - return; - } - throw new RuntimeException( - "Invalid instance type. Must be CreateCaseRequestData, CaseManagementProjectData," - + " FindingData"); - } - - /** - * Get the actual instance, which can be the following: CreateCaseRequestData, - * CaseManagementProjectData, FindingData - * - * @return The actual instance (CreateCaseRequestData, CaseManagementProjectData, FindingData) - */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `CreateCaseRequestData`. If the actual instance is not - * `CreateCaseRequestData`, the ClassCastException will be thrown. - * - * @return The actual instance of `CreateCaseRequestData` - * @throws ClassCastException if the instance is not `CreateCaseRequestData` - */ - public CreateCaseRequestData getCreateCaseRequestData() throws ClassCastException { - return (CreateCaseRequestData) super.getActualInstance(); - } - - /** - * Get the actual instance of `CaseManagementProjectData`. If the actual instance is not - * `CaseManagementProjectData`, the ClassCastException will be thrown. - * - * @return The actual instance of `CaseManagementProjectData` - * @throws ClassCastException if the instance is not `CaseManagementProjectData` - */ - public CaseManagementProjectData getCaseManagementProjectData() throws ClassCastException { - return (CaseManagementProjectData) super.getActualInstance(); - } - - /** - * Get the actual instance of `FindingData`. If the actual instance is not `FindingData`, the - * ClassCastException will be thrown. - * - * @return The actual instance of `FindingData` - * @throws ClassCastException if the instance is not `FindingData` - */ - public FindingData getFindingData() throws ClassCastException { - return (FindingData) super.getActualInstance(); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestData.java b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestData.java index 35922b30390..820674b9dcc 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestData.java +++ b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestData.java @@ -20,7 +20,6 @@ /** Data of the Jira issue to create. */ @JsonPropertyOrder({ CreateJiraIssueRequestData.JSON_PROPERTY_ATTRIBUTES, - CreateJiraIssueRequestData.JSON_PROPERTY_ID, CreateJiraIssueRequestData.JSON_PROPERTY_RELATIONSHIPS, CreateJiraIssueRequestData.JSON_PROPERTY_TYPE }) @@ -31,9 +30,6 @@ public class CreateJiraIssueRequestData { public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; private CreateJiraIssueRequestDataAttributes attributes; - public static final String JSON_PROPERTY_ID = "id"; - private String id; - public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; private CreateJiraIssueRequestDataRelationships relationships; @@ -71,27 +67,6 @@ public void setAttributes(CreateJiraIssueRequestDataAttributes attributes) { this.attributes = attributes; } - public CreateJiraIssueRequestData id(String id) { - this.id = id; - return this; - } - - /** - * The unique identifier of the Jira issue creation 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 CreateJiraIssueRequestData relationships( CreateJiraIssueRequestDataRelationships relationships) { this.relationships = relationships; @@ -196,7 +171,6 @@ public boolean equals(Object o) { } CreateJiraIssueRequestData createJiraIssueRequestData = (CreateJiraIssueRequestData) o; return Objects.equals(this.attributes, createJiraIssueRequestData.attributes) - && Objects.equals(this.id, createJiraIssueRequestData.id) && Objects.equals(this.relationships, createJiraIssueRequestData.relationships) && Objects.equals(this.type, createJiraIssueRequestData.type) && Objects.equals( @@ -205,7 +179,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(attributes, id, relationships, type, additionalProperties); + return Objects.hash(attributes, relationships, type, additionalProperties); } @Override @@ -213,7 +187,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateJiraIssueRequestData {\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: ") diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataAttributes.java index 1407bc55a0b..ffe6da3985b 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataAttributes.java @@ -17,18 +17,85 @@ import java.util.Objects; /** Attributes of the Jira issue to create. */ -@JsonPropertyOrder({CreateJiraIssueRequestDataAttributes.JSON_PROPERTY_FIELDS}) +@JsonPropertyOrder({ + CreateJiraIssueRequestDataAttributes.JSON_PROPERTY_ASSIGNEE_ID, + CreateJiraIssueRequestDataAttributes.JSON_PROPERTY_DESCRIPTION, + CreateJiraIssueRequestDataAttributes.JSON_PROPERTY_FIELDS, + CreateJiraIssueRequestDataAttributes.JSON_PROPERTY_PRIORITY, + CreateJiraIssueRequestDataAttributes.JSON_PROPERTY_TITLE +}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class CreateJiraIssueRequestDataAttributes { @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_FIELDS = "fields"; - private CreateJiraIssueRequestDataAttributesFields fields; + private Map fields = null; + + 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 CreateJiraIssueRequestDataAttributes fields( - CreateJiraIssueRequestDataAttributesFields fields) { + public CreateJiraIssueRequestDataAttributes assigneeId(String assigneeId) { + this.assigneeId = assigneeId; + return this; + } + + /** + * Unique identifier of the user assigned to the Jira issue. + * + * @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 CreateJiraIssueRequestDataAttributes description(String description) { + this.description = description; + return this; + } + + /** + * Description of the Jira issue. 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 CreateJiraIssueRequestDataAttributes fields(Map fields) { this.fields = fields; - this.unparsed |= fields.unparsed; + return this; + } + + public CreateJiraIssueRequestDataAttributes putFieldsItem(String key, Object fieldsItem) { + if (this.fields == null) { + this.fields = new HashMap<>(); + } + this.fields.put(key, fieldsItem); return this; } @@ -42,14 +109,60 @@ public CreateJiraIssueRequestDataAttributes fields( @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public CreateJiraIssueRequestDataAttributesFields getFields() { + public Map getFields() { return fields; } - public void setFields(CreateJiraIssueRequestDataAttributesFields fields) { + public void setFields(Map fields) { this.fields = fields; } + public CreateJiraIssueRequestDataAttributes 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 CreateJiraIssueRequestDataAttributes title(String title) { + this.title = title; + return this; + } + + /** + * Title of the Jira issue. 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. @@ -107,21 +220,29 @@ public boolean equals(Object o) { } CreateJiraIssueRequestDataAttributes createJiraIssueRequestDataAttributes = (CreateJiraIssueRequestDataAttributes) o; - return Objects.equals(this.fields, createJiraIssueRequestDataAttributes.fields) + return Objects.equals(this.assigneeId, createJiraIssueRequestDataAttributes.assigneeId) + && Objects.equals(this.description, createJiraIssueRequestDataAttributes.description) + && Objects.equals(this.fields, createJiraIssueRequestDataAttributes.fields) + && Objects.equals(this.priority, createJiraIssueRequestDataAttributes.priority) + && Objects.equals(this.title, createJiraIssueRequestDataAttributes.title) && Objects.equals( this.additionalProperties, createJiraIssueRequestDataAttributes.additionalProperties); } @Override public int hashCode() { - return Objects.hash(fields, additionalProperties); + return Objects.hash(assigneeId, description, fields, priority, title, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateJiraIssueRequestDataAttributes {\n"); + sb.append(" assigneeId: ").append(toIndentedString(assigneeId)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" fields: ").append(toIndentedString(fields)).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"); diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataAttributesFields.java b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataAttributesFields.java deleted file mode 100644 index f8422c156b7..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataAttributesFields.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * 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; - -/** - * Custom fields of the Jira issue to create. For the list of available fields, see Jira - * documentation. - */ -@JsonPropertyOrder({CreateJiraIssueRequestDataAttributesFields.JSON_PROPERTY_FIELDS}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class CreateJiraIssueRequestDataAttributesFields { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_FIELDS = "fields"; - private Object fields; - - public CreateJiraIssueRequestDataAttributesFields fields(Object fields) { - this.fields = fields; - return this; - } - - /** - * Getfields - * - * @return fields - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Object getFields() { - return fields; - } - - public void setFields(Object fields) { - this.fields = fields; - } - - /** - * 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 CreateJiraIssueRequestDataAttributesFields - */ - @JsonAnySetter - public CreateJiraIssueRequestDataAttributesFields 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 CreateJiraIssueRequestDataAttributesFields object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateJiraIssueRequestDataAttributesFields createJiraIssueRequestDataAttributesFields = - (CreateJiraIssueRequestDataAttributesFields) o; - return Objects.equals(this.fields, createJiraIssueRequestDataAttributesFields.fields) - && Objects.equals( - this.additionalProperties, - createJiraIssueRequestDataAttributesFields.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(fields, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateJiraIssueRequestDataAttributesFields {\n"); - sb.append(" fields: ").append(toIndentedString(fields)).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/CreateJiraIssueRequestDataRelationships.java b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataRelationships.java index 83289c82801..b9150152e0e 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataRelationships.java +++ b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataRelationships.java @@ -18,44 +18,72 @@ import java.util.Objects; /** Relationships of the Jira issue to create. */ -@JsonPropertyOrder({CreateJiraIssueRequestDataRelationships.JSON_PROPERTY_CASE}) +@JsonPropertyOrder({ + CreateJiraIssueRequestDataRelationships.JSON_PROPERTY_FINDINGS, + CreateJiraIssueRequestDataRelationships.JSON_PROPERTY_PROJECT +}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class CreateJiraIssueRequestDataRelationships { @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_CASE = "case"; - private CreateJiraIssueRequestDataRelationshipsCase _case; + public static final String JSON_PROPERTY_FINDINGS = "findings"; + private Findings findings; + + public static final String JSON_PROPERTY_PROJECT = "project"; + private CaseManagementProject project; public CreateJiraIssueRequestDataRelationships() {} @JsonCreator public CreateJiraIssueRequestDataRelationships( - @JsonProperty(required = true, value = JSON_PROPERTY_CASE) - CreateJiraIssueRequestDataRelationshipsCase _case) { - this._case = _case; - this.unparsed |= _case.unparsed; + @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 CreateJiraIssueRequestDataRelationships 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 CreateJiraIssueRequestDataRelationships _case( - CreateJiraIssueRequestDataRelationshipsCase _case) { - this._case = _case; - this.unparsed |= _case.unparsed; + public CreateJiraIssueRequestDataRelationships project(CaseManagementProject project) { + this.project = project; + this.unparsed |= project.unparsed; return this; } /** - * Case linked to the Jira issue. + * Case management project. * - * @return _case + * @return project */ - @JsonProperty(JSON_PROPERTY_CASE) + @JsonProperty(JSON_PROPERTY_PROJECT) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public CreateJiraIssueRequestDataRelationshipsCase getCase() { - return _case; + public CaseManagementProject getProject() { + return project; } - public void setCase(CreateJiraIssueRequestDataRelationshipsCase _case) { - this._case = _case; + public void setProject(CaseManagementProject project) { + this.project = project; } /** @@ -115,7 +143,8 @@ public boolean equals(Object o) { } CreateJiraIssueRequestDataRelationships createJiraIssueRequestDataRelationships = (CreateJiraIssueRequestDataRelationships) o; - return Objects.equals(this._case, createJiraIssueRequestDataRelationships._case) + return Objects.equals(this.findings, createJiraIssueRequestDataRelationships.findings) + && Objects.equals(this.project, createJiraIssueRequestDataRelationships.project) && Objects.equals( this.additionalProperties, createJiraIssueRequestDataRelationships.additionalProperties); @@ -123,14 +152,15 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(_case, additionalProperties); + return Objects.hash(findings, project, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateJiraIssueRequestDataRelationships {\n"); - sb.append(" _case: ").append(toIndentedString(_case)).append("\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"); diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataRelationshipsCase.java b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataRelationshipsCase.java deleted file mode 100644 index 16be0370780..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataRelationshipsCase.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * 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; - -/** Case linked to the Jira issue. */ -@JsonPropertyOrder({CreateJiraIssueRequestDataRelationshipsCase.JSON_PROPERTY_DATA}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class CreateJiraIssueRequestDataRelationshipsCase { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_DATA = "data"; - private CreateJiraIssueRequestDataRelationshipsCaseData data; - - public CreateJiraIssueRequestDataRelationshipsCase() {} - - @JsonCreator - public CreateJiraIssueRequestDataRelationshipsCase( - @JsonProperty(required = true, value = JSON_PROPERTY_DATA) - CreateJiraIssueRequestDataRelationshipsCaseData data) { - this.data = data; - this.unparsed |= data.unparsed; - } - - public CreateJiraIssueRequestDataRelationshipsCase data( - CreateJiraIssueRequestDataRelationshipsCaseData data) { - this.data = data; - this.unparsed |= data.unparsed; - return this; - } - - /** - * Case linked to the Jira issue. - * - * @return data - */ - @JsonProperty(JSON_PROPERTY_DATA) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public CreateJiraIssueRequestDataRelationshipsCaseData getData() { - return data; - } - - public void setData(CreateJiraIssueRequestDataRelationshipsCaseData 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 CreateJiraIssueRequestDataRelationshipsCase - */ - @JsonAnySetter - public CreateJiraIssueRequestDataRelationshipsCase 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 CreateJiraIssueRequestDataRelationshipsCase object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateJiraIssueRequestDataRelationshipsCase createJiraIssueRequestDataRelationshipsCase = - (CreateJiraIssueRequestDataRelationshipsCase) o; - return Objects.equals(this.data, createJiraIssueRequestDataRelationshipsCase.data) - && Objects.equals( - this.additionalProperties, - createJiraIssueRequestDataRelationshipsCase.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(data, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateJiraIssueRequestDataRelationshipsCase {\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/CreateJiraIssueRequestDataRelationshipsCaseData.java b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataRelationshipsCaseData.java deleted file mode 100644 index 7f7952c51d2..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataRelationshipsCaseData.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * 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; - -/** Case linked to the Jira issue. */ -@JsonPropertyOrder({ - CreateJiraIssueRequestDataRelationshipsCaseData.JSON_PROPERTY_ID, - CreateJiraIssueRequestDataRelationshipsCaseData.JSON_PROPERTY_TYPE -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class CreateJiraIssueRequestDataRelationshipsCaseData { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_ID = "id"; - private String id; - - public static final String JSON_PROPERTY_TYPE = "type"; - private CaseDataType type = CaseDataType.CASES; - - public CreateJiraIssueRequestDataRelationshipsCaseData() {} - - @JsonCreator - public CreateJiraIssueRequestDataRelationshipsCaseData( - @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, - @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseDataType type) { - this.id = id; - this.type = type; - this.unparsed |= !type.isValid(); - } - - public CreateJiraIssueRequestDataRelationshipsCaseData id(String id) { - this.id = id; - return this; - } - - /** - * Getid - * - * @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 CreateJiraIssueRequestDataRelationshipsCaseData type(CaseDataType type) { - this.type = type; - this.unparsed |= !type.isValid(); - return this; - } - - /** - * Cases resource type. - * - * @return type - */ - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public CaseDataType getType() { - return type; - } - - public void setType(CaseDataType 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 CreateJiraIssueRequestDataRelationshipsCaseData - */ - @JsonAnySetter - public CreateJiraIssueRequestDataRelationshipsCaseData 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 CreateJiraIssueRequestDataRelationshipsCaseData object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateJiraIssueRequestDataRelationshipsCaseData - createJiraIssueRequestDataRelationshipsCaseData = - (CreateJiraIssueRequestDataRelationshipsCaseData) o; - return Objects.equals(this.id, createJiraIssueRequestDataRelationshipsCaseData.id) - && Objects.equals(this.type, createJiraIssueRequestDataRelationshipsCaseData.type) - && Objects.equals( - this.additionalProperties, - createJiraIssueRequestDataRelationshipsCaseData.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(id, type, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateJiraIssueRequestDataRelationshipsCaseData {\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/DetachCaseRequestData.java b/src/main/java/com/datadog/api/client/v2/model/DetachCaseRequestData.java index 3e19945471e..90906378915 100644 --- a/src/main/java/com/datadog/api/client/v2/model/DetachCaseRequestData.java +++ b/src/main/java/com/datadog/api/client/v2/model/DetachCaseRequestData.java @@ -19,7 +19,6 @@ /** Data for detaching security findings from their case. */ @JsonPropertyOrder({ - DetachCaseRequestData.JSON_PROPERTY_ID, DetachCaseRequestData.JSON_PROPERTY_RELATIONSHIPS, DetachCaseRequestData.JSON_PROPERTY_TYPE }) @@ -27,9 +26,6 @@ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class DetachCaseRequestData { @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_ID = "id"; - private String id; - public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; private DetachCaseRequestDataRelationships relationships; @@ -45,27 +41,6 @@ public DetachCaseRequestData( this.unparsed |= !type.isValid(); } - public DetachCaseRequestData id(String id) { - this.id = id; - return this; - } - - /** - * The unique identifier of the detachment 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 DetachCaseRequestData relationships(DetachCaseRequestDataRelationships relationships) { this.relationships = relationships; this.unparsed |= relationships.unparsed; @@ -168,22 +143,20 @@ public boolean equals(Object o) { return false; } DetachCaseRequestData detachCaseRequestData = (DetachCaseRequestData) o; - return Objects.equals(this.id, detachCaseRequestData.id) - && Objects.equals(this.relationships, detachCaseRequestData.relationships) + return Objects.equals(this.relationships, detachCaseRequestData.relationships) && Objects.equals(this.type, detachCaseRequestData.type) && Objects.equals(this.additionalProperties, detachCaseRequestData.additionalProperties); } @Override public int hashCode() { - return Objects.hash(id, relationships, type, additionalProperties); + return Objects.hash(relationships, type, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class DetachCaseRequestData {\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: ") diff --git a/src/main/java/com/datadog/api/client/v2/model/FindingCaseResponseData.java b/src/main/java/com/datadog/api/client/v2/model/FindingCaseResponseData.java index e9ed5ee868f..7fbbcd59c07 100644 --- a/src/main/java/com/datadog/api/client/v2/model/FindingCaseResponseData.java +++ b/src/main/java/com/datadog/api/client/v2/model/FindingCaseResponseData.java @@ -77,7 +77,7 @@ public FindingCaseResponseData id(String id) { } /** - * The unique identifier of the case. + * Unique identifier of the case. * * @return id */ diff --git a/src/main/java/com/datadog/api/client/v2/model/FindingData.java b/src/main/java/com/datadog/api/client/v2/model/FindingData.java index 5055d62f8e2..ec28e12bda0 100644 --- a/src/main/java/com/datadog/api/client/v2/model/FindingData.java +++ b/src/main/java/com/datadog/api/client/v2/model/FindingData.java @@ -46,7 +46,7 @@ public FindingData id(String id) { } /** - * The unique identifier of the security finding. + * Unique identifier of the security finding. * * @return id */ diff --git a/src/main/java/com/datadog/api/client/v2/model/FindingJiraIssue.java b/src/main/java/com/datadog/api/client/v2/model/FindingJiraIssue.java index a5e14f2af0a..9297ca57949 100644 --- a/src/main/java/com/datadog/api/client/v2/model/FindingJiraIssue.java +++ b/src/main/java/com/datadog/api/client/v2/model/FindingJiraIssue.java @@ -41,7 +41,7 @@ public FindingJiraIssue errorMessage(String errorMessage) { } /** - * The error message if the Jira issue creation failed. + * Error message if the Jira issue creation failed. * * @return errorMessage */ @@ -84,7 +84,7 @@ public FindingJiraIssue status(String status) { } /** - * The status of the Jira issue creation. Can be "COMPLETED" if the Jira issue was created + * Status of the Jira issue creation. Can be "COMPLETED" if the Jira issue was created * successfully, or "FAILED" if the Jira issue creation failed. * * @return status diff --git a/src/main/java/com/datadog/api/client/v2/model/FindingJiraIssueResult.java b/src/main/java/com/datadog/api/client/v2/model/FindingJiraIssueResult.java index 6728168b297..c5b170bc0f5 100644 --- a/src/main/java/com/datadog/api/client/v2/model/FindingJiraIssueResult.java +++ b/src/main/java/com/datadog/api/client/v2/model/FindingJiraIssueResult.java @@ -45,7 +45,7 @@ public FindingJiraIssueResult accountId(String accountId) { } /** - * The account ID of the Jira issue. + * Account ID of the Jira issue. * * @return accountId */ @@ -66,7 +66,7 @@ public FindingJiraIssueResult issueId(String issueId) { } /** - * The unique identifier of the Jira issue. + * Unique identifier of the Jira issue. * * @return issueId */ @@ -87,7 +87,7 @@ public FindingJiraIssueResult issueKey(String issueKey) { } /** - * The key of the Jira issue. + * Key of the Jira issue. * * @return issueKey */ @@ -108,7 +108,7 @@ public FindingJiraIssueResult issueUrl(String issueUrl) { } /** - * The URL of the Jira issue. + * URL of the Jira issue. * * @return issueUrl */ diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_finding_returns_Created_response.freeze b/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_finding_returns_Created_response.freeze deleted file mode 100644 index 6c188712b92..00000000000 --- a/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_finding_returns_Created_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2025-11-19T17:01:11.179Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_finding_returns_Created_response.json b/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_finding_returns_Created_response.json deleted file mode 100644 index a1c306f1804..00000000000 --- a/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_finding_returns_Created_response.json +++ /dev/null @@ -1,57 +0,0 @@ -[ - { - "httpRequest": { - "body": { - "type": "JSON", - "json": "{\"data\":[{\"attributes\":{},\"relationships\":{\"case\":{\"data\":{\"id\":\"6a773295-8729-4034-aada-53b64cbe02e7\",\"type\":\"cases\"}}},\"type\":\"jira_issues\"}],\"included\":[{\"attributes\":{\"description\":\"A description\",\"title\":\"A title\"},\"id\":\"6a773295-8729-4034-aada-53b64cbe02e7\",\"relationships\":{\"findings\":{\"data\":[{\"id\":\"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=\",\"type\":\"findings\"}]},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}},\"type\":\"cases\"},{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"},{\"id\":\"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=\",\"type\":\"findings\"}]}" - }, - "headers": {}, - "method": "POST", - "path": "/api/v2/security/findings/jira_issues", - "keepAlive": false, - "secure": true - }, - "httpResponse": { - "body": "{\"data\":[{\"id\":\"6a773295-8729-4034-aada-53b64cbe02e7\",\"type\":\"cases\",\"attributes\":{\"created_at\":\"2025-11-19T17:01:15.21452Z\",\"creation_source\":\"CS_SECURITY_FINDING\",\"description\":\"A description\",\"insights\":[{\"type\":\"SECURITY_FINDING\",\"ref\":\"/security/appsec/vm/library/vulnerability/dfa027f7c037b2f77159adc027fecb56?detection=static\",\"resource_id\":\"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=\"}],\"jira_issue\":{\"status\":\"COMPLETED\",\"result\":{\"issue_id\":\"2402037\",\"issue_key\":\"CSMSEC-105473\",\"issue_url\":\"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105473\",\"account_id\":\"fdcffa62-24ab-4914-a195-a22bdc607030\"}},\"key\":\"CSMINV-461\",\"modified_at\":\"2025-11-19T17:01:16.621974Z\",\"priority\":\"NOT_DEFINED\",\"status\":\"OPEN\",\"status_group\":\"SG_OPEN\",\"status_name\":\"Open\",\"title\":\"A title\",\"type\":\"SECURITY\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"dc09afab-6ae7-11ef-92b1-828dac1b0195\",\"type\":\"users\"}},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}}}]}", - "headers": { - "Content-Type": [ - "application/vnd.api+json" - ] - }, - "statusCode": 201, - "reasonPhrase": "Created" - }, - "times": { - "remainingTimes": 1 - }, - "timeToLive": { - "unlimited": true - }, - "id": "47444157-4365-2eb0-ec06-5e907eaf5d81" - }, - { - "httpRequest": { - "body": { - "type": "JSON", - "json": "{\"data\":{\"id\":\"6a773295-8729-4034-aada-53b64cbe02e7\",\"relationships\":{\"findings\":{\"data\":[{\"id\":\"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=\",\"type\":\"findings\"}]}},\"type\":\"cases\"}}" - }, - "headers": {}, - "method": "DELETE", - "path": "/api/v2/security/findings/cases", - "keepAlive": false, - "secure": true - }, - "httpResponse": { - "headers": {}, - "statusCode": 204, - "reasonPhrase": "No Content" - }, - "times": { - "remainingTimes": 1 - }, - "timeToLive": { - "unlimited": true - }, - "id": "d3dbab4a-5423-6df3-6069-407af8cb9daf" - } -] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_findings_returns_Created_response.freeze b/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_findings_returns_Created_response.freeze deleted file mode 100644 index 8bb7a59bf99..00000000000 --- a/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_findings_returns_Created_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2025-11-21T14:49:30.001Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_findings_returns_Created_response.json b/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_findings_returns_Created_response.json deleted file mode 100644 index 020af1e90dc..00000000000 --- a/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_findings_returns_Created_response.json +++ /dev/null @@ -1,57 +0,0 @@ -[ - { - "httpRequest": { - "body": { - "type": "JSON", - "json": "{\"data\":[{\"attributes\":{},\"relationships\":{\"case\":{\"data\":{\"id\":\"e469ceda-957a-4557-a607-9ff25032e9ca\",\"type\":\"cases\"}}},\"type\":\"jira_issues\"}],\"included\":[{\"attributes\":{\"description\":\"A description\",\"title\":\"A title\"},\"id\":\"e469ceda-957a-4557-a607-9ff25032e9ca\",\"relationships\":{\"findings\":{\"data\":[{\"id\":\"MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=\",\"type\":\"findings\"},{\"id\":\"ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=\",\"type\":\"findings\"}]},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}},\"type\":\"cases\"},{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"},{\"id\":\"MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=\",\"type\":\"findings\"},{\"id\":\"ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=\",\"type\":\"findings\"}]}" - }, - "headers": {}, - "method": "POST", - "path": "/api/v2/security/findings/jira_issues", - "keepAlive": false, - "secure": true - }, - "httpResponse": { - "body": "{\"data\":[{\"id\":\"e469ceda-957a-4557-a607-9ff25032e9ca\",\"type\":\"cases\",\"attributes\":{\"created_at\":\"2025-11-21T14:49:32.034826Z\",\"creation_source\":\"CS_SECURITY_FINDING\",\"description\":\"A description\",\"insights\":[{\"type\":\"SECURITY_FINDING\",\"ref\":\"/security/appsec/vm/library/vulnerability/f16db9b7fa42c8a047777b354d6ccfe7?detection=static\",\"resource_id\":\"ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=\"},{\"type\":\"SECURITY_FINDING\",\"ref\":\"/security/appsec/vm/library/vulnerability/3510289f2aa284ab44f86b66e1f64cc7?detection=static\",\"resource_id\":\"MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=\"}],\"jira_issue\":{\"status\":\"COMPLETED\",\"result\":{\"issue_id\":\"2407744\",\"issue_key\":\"CSMSEC-105481\",\"issue_url\":\"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105481\",\"account_id\":\"fdcffa62-24ab-4914-a195-a22bdc607030\"}},\"key\":\"CSMINV-468\",\"modified_at\":\"2025-11-21T14:49:33.306003Z\",\"priority\":\"NOT_DEFINED\",\"status\":\"OPEN\",\"status_group\":\"SG_OPEN\",\"status_name\":\"Open\",\"title\":\"A title\",\"type\":\"SECURITY\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"dc09afab-6ae7-11ef-92b1-828dac1b0195\",\"type\":\"users\"}},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}}}]}", - "headers": { - "Content-Type": [ - "application/vnd.api+json" - ] - }, - "statusCode": 201, - "reasonPhrase": "Created" - }, - "times": { - "remainingTimes": 1 - }, - "timeToLive": { - "unlimited": true - }, - "id": "40dc36d3-aff0-7a0e-d962-e4dbbff80b14" - }, - { - "httpRequest": { - "body": { - "type": "JSON", - "json": "{\"data\":{\"id\":\"e469ceda-957a-4557-a607-9ff25032e9ca\",\"relationships\":{\"findings\":{\"data\":[{\"id\":\"ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=\",\"type\":\"findings\"}]}},\"type\":\"cases\"}}" - }, - "headers": {}, - "method": "DELETE", - "path": "/api/v2/security/findings/cases", - "keepAlive": false, - "secure": true - }, - "httpResponse": { - "headers": {}, - "statusCode": 204, - "reasonPhrase": "No Content" - }, - "times": { - "remainingTimes": 1 - }, - "timeToLive": { - "unlimited": true - }, - "id": "878b8060-40e9-b7da-0c6b-8c2abe8f6bc7" - } -] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Bad_Request_response.freeze deleted file mode 100644 index ff98ffb1a13..00000000000 --- a/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Bad_Request_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2025-11-20T12:01:47.295Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Bad_Request_response.json deleted file mode 100644 index e3454666b2f..00000000000 --- a/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Bad_Request_response.json +++ /dev/null @@ -1,32 +0,0 @@ -[ - { - "httpRequest": { - "body": { - "type": "JSON", - "json": "{\"data\":[{\"attributes\":{},\"relationships\":{\"case\":{\"data\":{\"id\":\"a7c38bab-ae98-4113-878c-c98799f914c2\",\"type\":\"cases\"}}},\"type\":\"jira_issues\"}],\"included\":[{\"id\":\"a7c38bab-ae98-4113-878c-c98799f914c2\",\"relationships\":{\"findings\":{\"data\":[]},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}},\"type\":\"cases\"},{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}]}" - }, - "headers": {}, - "method": "POST", - "path": "/api/v2/security/findings/jira_issues", - "keepAlive": false, - "secure": true - }, - "httpResponse": { - "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"no finding provided\"}]}", - "headers": { - "Content-Type": [ - "application/vnd.api+json" - ] - }, - "statusCode": 400, - "reasonPhrase": "Bad Request" - }, - "times": { - "remainingTimes": 1 - }, - "timeToLive": { - "unlimited": true - }, - "id": "dfc86e15-f290-8c6c-3271-24698d3f3a50" - } -] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Created_response.freeze b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Created_response.freeze deleted file mode 100644 index e5b6d0d76b3..00000000000 --- a/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Created_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2025-11-20T15:32:21.828Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Created_response.json b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Created_response.json deleted file mode 100644 index 0975be3a03b..00000000000 --- a/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Created_response.json +++ /dev/null @@ -1,57 +0,0 @@ -[ - { - "httpRequest": { - "body": { - "type": "JSON", - "json": "{\"data\":[{\"attributes\":{},\"relationships\":{\"case\":{\"data\":{\"id\":\"53e242c6-a7d6-46ad-9680-b8d14753f716\",\"type\":\"cases\"}}},\"type\":\"jira_issues\"},{\"attributes\":{},\"relationships\":{\"case\":{\"data\":{\"id\":\"195772b2-1f53-41d2-b81e-48c8e6c21d33\",\"type\":\"cases\"}}},\"type\":\"jira_issues\"}],\"included\":[{\"attributes\":{\"description\":\"A description\",\"title\":\"A title\"},\"id\":\"53e242c6-a7d6-46ad-9680-b8d14753f716\",\"relationships\":{\"findings\":{\"data\":[{\"id\":\"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=\",\"type\":\"findings\"}]},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}},\"type\":\"cases\"},{\"attributes\":{\"description\":\"A description\",\"title\":\"A title\"},\"id\":\"195772b2-1f53-41d2-b81e-48c8e6c21d33\",\"relationships\":{\"findings\":{\"data\":[{\"id\":\"MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=\",\"type\":\"findings\"}]},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}},\"type\":\"cases\"},{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"},{\"id\":\"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=\",\"type\":\"findings\"},{\"id\":\"MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=\",\"type\":\"findings\"}]}" - }, - "headers": {}, - "method": "POST", - "path": "/api/v2/security/findings/jira_issues", - "keepAlive": false, - "secure": true - }, - "httpResponse": { - "body": "{\"data\":[{\"id\":\"53e242c6-a7d6-46ad-9680-b8d14753f716\",\"type\":\"cases\",\"attributes\":{\"created_at\":\"2025-11-20T15:32:23.777159Z\",\"creation_source\":\"CS_SECURITY_FINDING\",\"description\":\"A description\",\"insights\":[{\"type\":\"SECURITY_FINDING\",\"ref\":\"/security/appsec/vm/library/vulnerability/94762d2f0123331575cd81095e450f09?detection=static\",\"resource_id\":\"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=\"}],\"jira_issue\":{\"status\":\"COMPLETED\",\"result\":{\"issue_id\":\"2404837\",\"issue_key\":\"CSMSEC-105480\",\"issue_url\":\"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105480\",\"account_id\":\"fdcffa62-24ab-4914-a195-a22bdc607030\"}},\"key\":\"CSMINV-467\",\"modified_at\":\"2025-11-20T15:32:25.088199Z\",\"priority\":\"NOT_DEFINED\",\"status\":\"OPEN\",\"status_group\":\"SG_OPEN\",\"status_name\":\"Open\",\"title\":\"A title\",\"type\":\"SECURITY\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"dc09afab-6ae7-11ef-92b1-828dac1b0195\",\"type\":\"users\"}},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}}},{\"id\":\"195772b2-1f53-41d2-b81e-48c8e6c21d33\",\"type\":\"cases\",\"attributes\":{\"created_at\":\"2025-11-20T15:32:23.776904Z\",\"creation_source\":\"CS_SECURITY_FINDING\",\"description\":\"A description\",\"insights\":[{\"type\":\"SECURITY_FINDING\",\"ref\":\"/security/appsec/vm/library/vulnerability/13c7ffac3021be5d1bd4c5e07b575fca?detection=static\",\"resource_id\":\"MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=\"}],\"jira_issue\":{\"status\":\"COMPLETED\",\"result\":{\"issue_id\":\"2404836\",\"issue_key\":\"CSMSEC-105479\",\"issue_url\":\"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105479\",\"account_id\":\"fdcffa62-24ab-4914-a195-a22bdc607030\"}},\"key\":\"CSMINV-466\",\"modified_at\":\"2025-11-20T15:32:24.96456Z\",\"priority\":\"NOT_DEFINED\",\"status\":\"OPEN\",\"status_group\":\"SG_OPEN\",\"status_name\":\"Open\",\"title\":\"A title\",\"type\":\"SECURITY\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"dc09afab-6ae7-11ef-92b1-828dac1b0195\",\"type\":\"users\"}},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}}}]}", - "headers": { - "Content-Type": [ - "application/vnd.api+json" - ] - }, - "statusCode": 201, - "reasonPhrase": "Created" - }, - "times": { - "remainingTimes": 1 - }, - "timeToLive": { - "unlimited": true - }, - "id": "81f0f437-1280-de2c-7d8d-05c23337939e" - }, - { - "httpRequest": { - "body": { - "type": "JSON", - "json": "{\"data\":{\"id\":\"53e242c6-a7d6-46ad-9680-b8d14753f716\",\"relationships\":{\"findings\":{\"data\":[{\"id\":\"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=\",\"type\":\"findings\"}]}},\"type\":\"cases\"}}" - }, - "headers": {}, - "method": "DELETE", - "path": "/api/v2/security/findings/cases", - "keepAlive": false, - "secure": true - }, - "httpResponse": { - "headers": {}, - "statusCode": 204, - "reasonPhrase": "No Content" - }, - "times": { - "remainingTimes": 1 - }, - "timeToLive": { - "unlimited": true - }, - "id": "d15df31a-8725-9941-0c46-5c4c28433655" - } -] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Not_Found_response.freeze deleted file mode 100644 index f0ed0dd3f18..00000000000 --- a/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Not_Found_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2025-11-20T15:42:51.100Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Not_Found_response.json deleted file mode 100644 index 96b5e74ceb8..00000000000 --- a/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Not_Found_response.json +++ /dev/null @@ -1,32 +0,0 @@ -[ - { - "httpRequest": { - "body": { - "type": "JSON", - "json": "{\"data\":[{\"attributes\":{},\"relationships\":{\"case\":{\"data\":{\"id\":\"6ed1d7c2-e1a3-4369-b92b-a38d3cc75cf3\",\"type\":\"cases\"}}},\"type\":\"jira_issues\"}],\"included\":[{\"attributes\":{\"description\":\"A description\",\"title\":\"A title\"},\"id\":\"6ed1d7c2-e1a3-4369-b92b-a38d3cc75cf3\",\"relationships\":{\"findings\":{\"data\":[{\"id\":\"YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM=\",\"type\":\"findings\"}]},\"project\":{\"data\":{\"id\":\"00000000-0000-0000-0000-000000000000\",\"type\":\"projects\"}}},\"type\":\"cases\"},{\"id\":\"00000000-0000-0000-0000-000000000000\",\"type\":\"projects\"},{\"id\":\"YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM=\",\"type\":\"findings\"}]}" - }, - "headers": {}, - "method": "POST", - "path": "/api/v2/security/findings/jira_issues", - "keepAlive": false, - "secure": true - }, - "httpResponse": { - "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"project not found\"}]}", - "headers": { - "Content-Type": [ - "application/vnd.api+json" - ] - }, - "statusCode": 404, - "reasonPhrase": "Not Found" - }, - "times": { - "remainingTimes": 1 - }, - "timeToLive": { - "unlimited": true - }, - "id": "f21ac686-77c1-ddb9-4c05-8bfdcaa7c533" - } -] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_case_for_security_finding_returns_Created_response.freeze b/src/test/resources/cassettes/features/v2/Create_case_for_security_finding_returns_Created_response.freeze index a6ccca66ab5..d2ad4b4dd73 100644 --- a/src/test/resources/cassettes/features/v2/Create_case_for_security_finding_returns_Created_response.freeze +++ b/src/test/resources/cassettes/features/v2/Create_case_for_security_finding_returns_Created_response.freeze @@ -1 +1 @@ -2025-11-19T13:45:48.321Z \ No newline at end of file +2025-12-12T14:46:23.960Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_case_for_security_finding_returns_Created_response.json b/src/test/resources/cassettes/features/v2/Create_case_for_security_finding_returns_Created_response.json index 737ed5af083..7eed52fb390 100644 --- a/src/test/resources/cassettes/features/v2/Create_case_for_security_finding_returns_Created_response.json +++ b/src/test/resources/cassettes/features/v2/Create_case_for_security_finding_returns_Created_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":[{\"attributes\":{\"description\":\"A description\",\"title\":\"A title\"},\"relationships\":{\"findings\":{\"data\":[{\"id\":\"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=\",\"type\":\"findings\"}]},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}},\"type\":\"cases\"}]}" + "json": "{\"data\":[{\"attributes\":{\"description\":\"A description\",\"title\":\"A title\"},\"relationships\":{\"findings\":{\"data\":[{\"id\":\"YjdhNDM3N2QyNTFjYmUwYTY3NDdhMTg0YTk2Yjg5MDl-ZjNmMzAwOTFkZDNhNGQzYzI0MzgxNTk4MjRjZmE2NzE=\",\"type\":\"findings\"}]},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}},\"type\":\"cases\"}]}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":[{\"id\":\"639c5df7-2352-4fc6-9d39-7dc8bdb8af14\",\"type\":\"cases\",\"attributes\":{\"created_at\":\"2025-11-19T13:45:50.295906Z\",\"creation_source\":\"CS_SECURITY_FINDING\",\"description\":\"A description\",\"insights\":[{\"type\":\"SECURITY_FINDING\",\"ref\":\"/security/appsec/vm/library/vulnerability/dfa027f7c037b2f77159adc027fecb56?detection=static\",\"resource_id\":\"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=\"}],\"key\":\"CSMINV-454\",\"priority\":\"NOT_DEFINED\",\"status\":\"OPEN\",\"status_group\":\"SG_OPEN\",\"status_name\":\"Open\",\"title\":\"A title\",\"type\":\"SECURITY\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"dc09afab-6ae7-11ef-92b1-828dac1b0195\",\"type\":\"users\"}},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}}}]}", + "body": "{\"data\":[{\"id\":\"42905bad-351b-4c81-94c1-f3374e861f23\",\"type\":\"cases\",\"attributes\":{\"created_at\":\"2025-12-12T14:46:27.55028Z\",\"creation_source\":\"CS_SECURITY_FINDING\",\"description\":\"A description\",\"insights\":[{\"type\":\"SECURITY_FINDING\",\"ref\":\"/security/csm/vm?vulnerability=b7a4377d251cbe0a6747a184a96b8909\",\"resource_id\":\"YjdhNDM3N2QyNTFjYmUwYTY3NDdhMTg0YTk2Yjg5MDl-ZjNmMzAwOTFkZDNhNGQzYzI0MzgxNTk4MjRjZmE2NzE=\"}],\"key\":\"CSMINV-506\",\"priority\":\"NOT_DEFINED\",\"status\":\"OPEN\",\"status_group\":\"SG_OPEN\",\"status_name\":\"Open\",\"title\":\"A title\",\"type\":\"SECURITY\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"dc09afab-6ae7-11ef-92b1-828dac1b0195\",\"type\":\"users\"}},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}}}]}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -27,13 +27,13 @@ "timeToLive": { "unlimited": true }, - "id": "51c4e4e0-9193-1377-9424-e52cd6a52681" + "id": "d61f51f3-f62b-0eb2-cc4d-2f16015831b5" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"id\":\"639c5df7-2352-4fc6-9d39-7dc8bdb8af14\",\"relationships\":{\"findings\":{\"data\":[{\"id\":\"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=\",\"type\":\"findings\"}]}},\"type\":\"cases\"}}" + "json": "{\"data\":{\"relationships\":{\"findings\":{\"data\":[{\"id\":\"YjdhNDM3N2QyNTFjYmUwYTY3NDdhMTg0YTk2Yjg5MDl-ZjNmMzAwOTFkZDNhNGQzYzI0MzgxNTk4MjRjZmE2NzE=\",\"type\":\"findings\"}]}},\"type\":\"cases\"}}" }, "headers": {}, "method": "DELETE", @@ -52,6 +52,6 @@ "timeToLive": { "unlimited": true }, - "id": "c7a2f33b-82d7-3106-eebc-42a4877be392" + "id": "4e58c44b-f265-fde4-198b-af61fd50c0a7" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_case_for_security_findings_returns_Created_response.freeze b/src/test/resources/cassettes/features/v2/Create_case_for_security_findings_returns_Created_response.freeze index 11d711428d3..5f043761a30 100644 --- a/src/test/resources/cassettes/features/v2/Create_case_for_security_findings_returns_Created_response.freeze +++ b/src/test/resources/cassettes/features/v2/Create_case_for_security_findings_returns_Created_response.freeze @@ -1 +1 @@ -2025-11-19T13:46:07.661Z \ No newline at end of file +2025-12-12T14:49:04.977Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_case_for_security_findings_returns_Created_response.json b/src/test/resources/cassettes/features/v2/Create_case_for_security_findings_returns_Created_response.json index ae21eae372f..cfb9ed293a9 100644 --- a/src/test/resources/cassettes/features/v2/Create_case_for_security_findings_returns_Created_response.json +++ b/src/test/resources/cassettes/features/v2/Create_case_for_security_findings_returns_Created_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":[{\"attributes\":{\"description\":\"A description\",\"title\":\"A title\"},\"relationships\":{\"findings\":{\"data\":[{\"id\":\"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=\",\"type\":\"findings\"},{\"id\":\"MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=\",\"type\":\"findings\"}]},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}},\"type\":\"cases\"}]}" + "json": "{\"data\":[{\"attributes\":{\"description\":\"A description\",\"title\":\"A title\"},\"relationships\":{\"findings\":{\"data\":[{\"id\":\"ZTd5LWNuYi1seWV-aS0wMjI2NGZjZjRmZWQ5ODMyMg==\",\"type\":\"findings\"},{\"id\":\"c2FuLXhyaS1kZnN-aS0wODM3MjVhMTM2MDExNzNkOQ==\",\"type\":\"findings\"}]},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}},\"type\":\"cases\"}]}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":[{\"id\":\"2c1ac0c4-e8cf-4699-8781-09077b10d2a0\",\"type\":\"cases\",\"attributes\":{\"created_at\":\"2025-11-19T13:46:09.874194Z\",\"creation_source\":\"CS_SECURITY_FINDING\",\"description\":\"A description\",\"insights\":[{\"type\":\"SECURITY_FINDING\",\"ref\":\"/security/appsec/vm/library/vulnerability/36d53183f8fefbbc2208878f3d2011f0?detection=static\",\"resource_id\":\"MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=\"},{\"type\":\"SECURITY_FINDING\",\"ref\":\"/security/appsec/vm/library/vulnerability/dfa027f7c037b2f77159adc027fecb56?detection=static\",\"resource_id\":\"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=\"}],\"key\":\"CSMINV-455\",\"priority\":\"NOT_DEFINED\",\"status\":\"OPEN\",\"status_group\":\"SG_OPEN\",\"status_name\":\"Open\",\"title\":\"A title\",\"type\":\"SECURITY\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"dc09afab-6ae7-11ef-92b1-828dac1b0195\",\"type\":\"users\"}},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}}}]}", + "body": "{\"data\":[{\"id\":\"6e5599c0-181f-4066-a44d-056bedafd639\",\"type\":\"cases\",\"attributes\":{\"created_at\":\"2025-12-12T14:49:06.574693Z\",\"creation_source\":\"CS_SECURITY_FINDING\",\"description\":\"A description\",\"insights\":[{\"type\":\"SECURITY_FINDING\",\"ref\":\"/security/compliance?panels=cpfinding%7Cevent%7CruleId%3Ae7y-cnb-lye%7CresourceId%3Ai-02264fcf4fed98322\\u0026query=%40finding_id%3AZTd5LWNuYi1seWV-aS0wMjI2NGZjZjRmZWQ5ODMyMg%3D%3D\",\"resource_id\":\"ZTd5LWNuYi1seWV-aS0wMjI2NGZjZjRmZWQ5ODMyMg==\"},{\"type\":\"SECURITY_FINDING\",\"ref\":\"/security/compliance?panels=cpfinding%7Cevent%7CruleId%3Asan-xri-dfs%7CresourceId%3Ai-083725a13601173d9\\u0026query=%40finding_id%3Ac2FuLXhyaS1kZnN-aS0wODM3MjVhMTM2MDExNzNkOQ%3D%3D\",\"resource_id\":\"c2FuLXhyaS1kZnN-aS0wODM3MjVhMTM2MDExNzNkOQ==\"}],\"key\":\"CSMINV-509\",\"priority\":\"NOT_DEFINED\",\"status\":\"OPEN\",\"status_group\":\"SG_OPEN\",\"status_name\":\"Open\",\"title\":\"A title\",\"type\":\"SECURITY\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"dc09afab-6ae7-11ef-92b1-828dac1b0195\",\"type\":\"users\"}},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}}}]}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -27,13 +27,13 @@ "timeToLive": { "unlimited": true }, - "id": "d04ffa36-418b-582f-47ed-5b22a0b60827" + "id": "73b6d808-e35a-8d8f-ed79-8076a97f5329" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"id\":\"2c1ac0c4-e8cf-4699-8781-09077b10d2a0\",\"relationships\":{\"findings\":{\"data\":[{\"id\":\"MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=\",\"type\":\"findings\"}]}},\"type\":\"cases\"}}" + "json": "{\"data\":{\"relationships\":{\"findings\":{\"data\":[{\"id\":\"ZTd5LWNuYi1seWV-aS0wMjI2NGZjZjRmZWQ5ODMyMg==\",\"type\":\"findings\"}]}},\"type\":\"cases\"}}" }, "headers": {}, "method": "DELETE", @@ -52,6 +52,6 @@ "timeToLive": { "unlimited": true }, - "id": "c198d524-9355-a9d4-7ab2-13b40ab22dc1" + "id": "5528679e-61b2-527f-967c-5a82bded9768" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Created_response.freeze b/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Created_response.freeze index d1e05ac25c0..19c30957a6a 100644 --- a/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Created_response.freeze +++ b/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Created_response.freeze @@ -1 +1 @@ -2025-11-19T13:54:20.603Z \ No newline at end of file +2025-12-12T14:47:03.612Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Created_response.json b/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Created_response.json index 22b106488b6..7b6e009c016 100644 --- a/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Created_response.json +++ b/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Created_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":[{\"attributes\":{\"description\":\"A description\",\"title\":\"A title\"},\"relationships\":{\"findings\":{\"data\":[{\"id\":\"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=\",\"type\":\"findings\"}]},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}},\"type\":\"cases\"},{\"attributes\":{\"description\":\"A description\",\"title\":\"A title\"},\"relationships\":{\"findings\":{\"data\":[{\"id\":\"MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=\",\"type\":\"findings\"}]},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}},\"type\":\"cases\"}]}" + "json": "{\"data\":[{\"attributes\":{\"description\":\"A description\",\"title\":\"A title\"},\"relationships\":{\"findings\":{\"data\":[{\"id\":\"YjdhNDM3N2QyNTFjYmUwYTY3NDdhMTg0YTk2Yjg5MDl-ZjNmMzAwOTFkZDNhNGQzYzI0MzgxNTk4MjRjZmE2NzE=\",\"type\":\"findings\"}]},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}},\"type\":\"cases\"},{\"attributes\":{\"description\":\"A description\",\"title\":\"A title\"},\"relationships\":{\"findings\":{\"data\":[{\"id\":\"OGRlMDIwYzk4MjFmZTZiNTQwMzk2ZjUxNzg0MDc0NjR-MTk3Yjk4MDI4ZDQ4YzI2ZGZiMWJmMTNhNDEwZGZkYWI=\",\"type\":\"findings\"}]},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}},\"type\":\"cases\"}]}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":[{\"id\":\"7d16945b-baf8-411e-ab2a-20fe43af1ea3\",\"type\":\"cases\",\"attributes\":{\"created_at\":\"2025-11-19T13:54:23.634063Z\",\"creation_source\":\"CS_SECURITY_FINDING\",\"description\":\"A description\",\"insights\":[{\"type\":\"SECURITY_FINDING\",\"ref\":\"/security/appsec/vm/library/vulnerability/dfa027f7c037b2f77159adc027fecb56?detection=static\",\"resource_id\":\"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=\"}],\"key\":\"CSMINV-459\",\"priority\":\"NOT_DEFINED\",\"status\":\"OPEN\",\"status_group\":\"SG_OPEN\",\"status_name\":\"Open\",\"title\":\"A title\",\"type\":\"SECURITY\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"dc09afab-6ae7-11ef-92b1-828dac1b0195\",\"type\":\"users\"}},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}}},{\"id\":\"601cab78-ef04-4bdf-901a-55533afbde0b\",\"type\":\"cases\",\"attributes\":{\"created_at\":\"2025-11-19T13:54:23.634552Z\",\"creation_source\":\"CS_SECURITY_FINDING\",\"description\":\"A description\",\"insights\":[{\"type\":\"SECURITY_FINDING\",\"ref\":\"/security/appsec/vm/library/vulnerability/36d53183f8fefbbc2208878f3d2011f0?detection=static\",\"resource_id\":\"MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=\"}],\"key\":\"CSMINV-458\",\"priority\":\"NOT_DEFINED\",\"status\":\"OPEN\",\"status_group\":\"SG_OPEN\",\"status_name\":\"Open\",\"title\":\"A title\",\"type\":\"SECURITY\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"dc09afab-6ae7-11ef-92b1-828dac1b0195\",\"type\":\"users\"}},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}}}]}", + "body": "{\"data\":[{\"id\":\"a12c9894-ba42-408e-b4bf-b8944ca203c1\",\"type\":\"cases\",\"attributes\":{\"created_at\":\"2025-12-12T14:47:06.96093Z\",\"creation_source\":\"CS_SECURITY_FINDING\",\"description\":\"A description\",\"insights\":[{\"type\":\"SECURITY_FINDING\",\"ref\":\"/security/csm/vm?vulnerability=b7a4377d251cbe0a6747a184a96b8909\",\"resource_id\":\"YjdhNDM3N2QyNTFjYmUwYTY3NDdhMTg0YTk2Yjg5MDl-ZjNmMzAwOTFkZDNhNGQzYzI0MzgxNTk4MjRjZmE2NzE=\"}],\"key\":\"CSMINV-508\",\"priority\":\"NOT_DEFINED\",\"status\":\"OPEN\",\"status_group\":\"SG_OPEN\",\"status_name\":\"Open\",\"title\":\"A title\",\"type\":\"SECURITY\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"dc09afab-6ae7-11ef-92b1-828dac1b0195\",\"type\":\"users\"}},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}}},{\"id\":\"72589c11-2e4c-4592-8ab6-dcdddd176236\",\"type\":\"cases\",\"attributes\":{\"created_at\":\"2025-12-12T14:47:06.960652Z\",\"creation_source\":\"CS_SECURITY_FINDING\",\"description\":\"A description\",\"insights\":[{\"type\":\"SECURITY_FINDING\",\"ref\":\"/security/csm/vm?vulnerability=8de020c9821fe6b540396f5178407464\",\"resource_id\":\"OGRlMDIwYzk4MjFmZTZiNTQwMzk2ZjUxNzg0MDc0NjR-MTk3Yjk4MDI4ZDQ4YzI2ZGZiMWJmMTNhNDEwZGZkYWI=\"}],\"key\":\"CSMINV-507\",\"priority\":\"NOT_DEFINED\",\"status\":\"OPEN\",\"status_group\":\"SG_OPEN\",\"status_name\":\"Open\",\"title\":\"A title\",\"type\":\"SECURITY\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"dc09afab-6ae7-11ef-92b1-828dac1b0195\",\"type\":\"users\"}},\"project\":{\"data\":{\"id\":\"959a6f71-bac8-4027-b1d3-2264f569296f\",\"type\":\"projects\"}}}}]}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -27,13 +27,13 @@ "timeToLive": { "unlimited": true }, - "id": "196e43ee-c698-68cc-f6de-26033389542a" + "id": "2ee61709-bf4b-51dc-e57a-5d8ba042dcb5" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"id\":\"7d16945b-baf8-411e-ab2a-20fe43af1ea3\",\"relationships\":{\"findings\":{\"data\":[{\"id\":\"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=\",\"type\":\"findings\"}]}},\"type\":\"cases\"}}" + "json": "{\"data\":{\"relationships\":{\"findings\":{\"data\":[{\"id\":\"YjdhNDM3N2QyNTFjYmUwYTY3NDdhMTg0YTk2Yjg5MDl-ZjNmMzAwOTFkZDNhNGQzYzI0MzgxNTk4MjRjZmE2NzE=\",\"type\":\"findings\"}]}},\"type\":\"cases\"}}" }, "headers": {}, "method": "DELETE", @@ -52,6 +52,6 @@ "timeToLive": { "unlimited": true }, - "id": "11dbbde4-62ff-4a35-79f4-e6a53babed00" + "id": "4e58c44b-f265-fde4-198b-af61fd50c0a6" } ] \ No newline at end of file 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 7dc352a7a4e..b6d8bf921cb 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 @@ -258,75 +258,27 @@ Feature: Security Monitoring Then the response status is 200 OK And the response "terraformContent" is equal to "resource \"datadog_security_monitoring_rule\" \"_{{ unique_hash }}\" {\n\tname = \"_{{ unique_hash }}\"\n\tenabled = true\n\tquery {\n\t\tquery = \"@test:true\"\n\t\tgroup_by_fields = []\n\t\thas_optional_group_by_fields = false\n\t\tdistinct_fields = []\n\t\taggregation = \"count\"\n\t\tname = \"\"\n\t\tdata_source = \"logs\"\n\t}\n\toptions {\n\t\tkeep_alive = 3600\n\t\tmax_signal_duration = 86400\n\t\tdetection_method = \"threshold\"\n\t\tevaluation_window = 900\n\t}\n\tcase {\n\t\tname = \"\"\n\t\tstatus = \"info\"\n\t\tnotifications = []\n\t\tcondition = \"a > 0\"\n\t}\n\tmessage = \"Test rule\"\n\ttags = []\n\thas_extended_title = false\n\ttype = \"log_detection\"\n}\n" - @skip @team:DataDog/k9-investigation - Scenario: Create Jira issue for security finding returns "Created" response - Given new "CreateJiraIssues" request - And body with value {"data": [{"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "6a773295-8729-4034-aada-53b64cbe02e7"}}}}], "included": [{"type": "cases", "attributes": {"title": "A title", "description": "A description"}, "relationships": {"project": {"data": {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data": [{"type": "findings", "id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}]}}, "id": "6a773295-8729-4034-aada-53b64cbe02e7"}, {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}, {"type": "findings", "id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}]} - When the request is sent - Then the response status is 201 Created - And the response "data" has length 1 - And the response "data[0]" has field "id" - And the response "data[0].attributes.title" is equal to "A title" - And the response "data[0].attributes.description" is equal to "A description" - And the response "data[0].attributes.type" is equal to "SECURITY" - And the response "data[0].attributes.insights" has length 1 - And the response "data[0].attributes.insights[0].resource_id" is equal to "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" - And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" - And the response "data[0].attributes.jira_issue.status" is equal to "COMPLETED" - - @skip @team:DataDog/k9-investigation - Scenario: Create Jira issue for security findings returns "Created" response - Given new "CreateJiraIssues" request - And body with value {"data": [{"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "e469ceda-957a-4557-a607-9ff25032e9ca"}}}}], "included": [{"type": "cases", "attributes": {"title": "A title", "description": "A description"}, "relationships": {"project": {"data": {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data": [{"type": "findings", "id": "MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}, {"type": "findings", "id": "ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}]}}, "id": "e469ceda-957a-4557-a607-9ff25032e9ca"}, {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}, {"type": "findings", "id": "MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}, {"type": "findings", "id": "ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}]} - When the request is sent - Then the response status is 201 Created - And the response "data" has length 1 - And the response "data[0]" has field "id" - And the response "data[0].attributes.title" is equal to "A title" - And the response "data[0].attributes.description" is equal to "A description" - And the response "data[0].attributes.type" is equal to "SECURITY" - And the response "data[0].attributes.insights" has length 2 - And the response "data[0].attributes.insights[1].resource_id" is equal to "MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=" - And the response "data[0].attributes.insights[1].type" is equal to "SECURITY_FINDING" - And the response "data[0].attributes.insights[0].resource_id" is equal to "ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=" - And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" - And the response "data[0].attributes.jira_issue.status" is equal to "COMPLETED" - - @skip @team:DataDog/k9-investigation + @generated @skip @team:DataDog/k9-investigation Scenario: Create Jira issues for security findings returns "Bad Request" response - Given new "CreateJiraIssues" request - And body with value {"data": [{"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "a7c38bab-ae98-4113-878c-c98799f914c2"}}}}], "included": [{"type": "cases", "relationships": {"project": {"data": {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data": []}}, "id": "a7c38bab-ae98-4113-878c-c98799f914c2"}, {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}]} + Given operation "CreateJiraIssues" enabled + And new "CreateJiraIssues" request + And body with value {"data": [{"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", "description": "A description of the Jira issue.", "fields": {"key1": "value", "key2": ["value"], "key3": {"key4": "value"}}, "priority": "NOT_DEFINED", "title": "A title for the Jira issue."}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "jira_issues"}]} When the request is sent Then the response status is 400 Bad Request - @skip @team:DataDog/k9-investigation + @generated @skip @team:DataDog/k9-investigation Scenario: Create Jira issues for security findings returns "Created" response - Given new "CreateJiraIssues" request - And body with value {"data": [{"type": "jira_issues", "attributes":{}, "relationships": {"case": {"data": {"type": "cases", "id":"53e242c6-a7d6-46ad-9680-b8d14753f716"}}}}, {"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "195772b2-1f53-41d2-b81e-48c8e6c21d33"}}}}], "included":[{"type":"cases", "attributes":{"title":"A title", "description":"A description"}, "relationships":{"project":{"data":{"type":"projects", "id":"959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data": [{"type": "findings", "id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI="}]}}, "id": "53e242c6-a7d6-46ad-9680-b8d14753f716"}, {"type": "cases", "attributes": {"title": "A title", "description": "A description"}, "relationships": {"project": {"data": {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data":[{"type": "findings", "id": "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM="}]}}, "id": "195772b2-1f53-41d2-b81e-48c8e6c21d33"}, {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}, {"type": "findings", "id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI="}, {"type": "findings", "id": "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM="}]} + Given operation "CreateJiraIssues" enabled + And new "CreateJiraIssues" request + And body with value {"data": [{"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", "description": "A description of the Jira issue.", "fields": {"key1": "value", "key2": ["value"], "key3": {"key4": "value"}}, "priority": "NOT_DEFINED", "title": "A title for the Jira issue."}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "jira_issues"}]} When the request is sent Then the response status is 201 Created - And the response "data" has length 2 - And the response "data[0]" has field "id" - And the response "data[0].attributes.title" is equal to "A title" - And the response "data[0].attributes.description" is equal to "A description" - And the response "data[0].attributes.type" is equal to "SECURITY" - And the response "data[0].attributes.insights" has length 1 - And the response "data[0].attributes.insights[0].resource_id" is equal to "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=" - And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" - And the response "data[0].attributes.jira_issue.status" is equal to "COMPLETED" - And the response "data[1]" has field "id" - And the response "data[1].attributes.title" is equal to "A title" - And the response "data[1].attributes.description" is equal to "A description" - And the response "data[1].attributes.type" is equal to "SECURITY" - And the response "data[1].attributes.insights" has length 1 - And the response "data[1].attributes.insights[0].resource_id" is equal to "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=" - And the response "data[1].attributes.insights[0].type" is equal to "SECURITY_FINDING" - And the response "data[1].attributes.jira_issue.status" is equal to "COMPLETED" - @skip @team:DataDog/k9-investigation + @generated @skip @team:DataDog/k9-investigation Scenario: Create Jira issues for security findings returns "Not Found" response - Given new "CreateJiraIssues" request - And body with value {"data": [{"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "6ed1d7c2-e1a3-4369-b92b-a38d3cc75cf3"}}}}], "included": [{"type": "cases", "attributes": {"title": "A title", "description": "A description"}, "relationships": {"project": {"data": {"type": "projects", "id": "00000000-0000-0000-0000-000000000000"}}, "findings": {"data": [{"type": "findings", "id": "YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM="}]}}, "id": "6ed1d7c2-e1a3-4369-b92b-a38d3cc75cf3"}, {"type": "projects", "id": "00000000-0000-0000-0000-000000000000"}, {"type": "findings", "id": "YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM="}]} + Given operation "CreateJiraIssues" enabled + And new "CreateJiraIssues" request + And body with value {"data": [{"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", "description": "A description of the Jira issue.", "fields": {"key1": "value", "key2": ["value"], "key3": {"key4": "value"}}, "priority": "NOT_DEFINED", "title": "A title for the Jira issue."}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "jira_issues"}]} When the request is sent Then the response status is 404 Not Found @@ -557,7 +509,7 @@ Feature: Security Monitoring @team:DataDog/k9-investigation Scenario: Create case for security finding returns "Created" response Given new "CreateCases" request - And body with value {"data": [{"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "cases"}]} + And body with value {"data": [{"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "YjdhNDM3N2QyNTFjYmUwYTY3NDdhMTg0YTk2Yjg5MDl-ZjNmMzAwOTFkZDNhNGQzYzI0MzgxNTk4MjRjZmE2NzE=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "cases"}]} When the request is sent Then the response status is 201 Created And the response "data" has length 1 @@ -566,13 +518,13 @@ Feature: Security Monitoring And the response "data[0].attributes.description" is equal to "A description" And the response "data[0].attributes.type" is equal to "SECURITY" And the response "data[0].attributes.insights" has length 1 - And the response "data[0].attributes.insights[0].resource_id" is equal to "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" + And the response "data[0].attributes.insights[0].resource_id" is equal to "YjdhNDM3N2QyNTFjYmUwYTY3NDdhMTg0YTk2Yjg5MDl-ZjNmMzAwOTFkZDNhNGQzYzI0MzgxNTk4MjRjZmE2NzE=" And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" @team:DataDog/k9-investigation Scenario: Create case for security findings returns "Created" response Given new "CreateCases" request - And body with value {"data": [{"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}, {"id": "MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "cases"}]} + And body with value {"data": [{"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "ZTd5LWNuYi1seWV-aS0wMjI2NGZjZjRmZWQ5ODMyMg==", "type": "findings"}, {"id": "c2FuLXhyaS1kZnN-aS0wODM3MjVhMTM2MDExNzNkOQ==", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "cases"}]} When the request is sent Then the response status is 201 Created And the response "data" has length 1 @@ -581,9 +533,9 @@ Feature: Security Monitoring And the response "data[0].attributes.description" is equal to "A description" And the response "data[0].attributes.type" is equal to "SECURITY" And the response "data[0].attributes.insights" has length 2 - And the response "data[0].attributes.insights[1].resource_id" is equal to "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" + And the response "data[0].attributes.insights[1].resource_id" is equal to "c2FuLXhyaS1kZnN-aS0wODM3MjVhMTM2MDExNzNkOQ==" And the response "data[0].attributes.insights[1].type" is equal to "SECURITY_FINDING" - And the response "data[0].attributes.insights[0].resource_id" is equal to "MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=" + And the response "data[0].attributes.insights[0].resource_id" is equal to "ZTd5LWNuYi1seWV-aS0wMjI2NGZjZjRmZWQ5ODMyMg==" And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" @team:DataDog/k9-investigation @@ -596,7 +548,7 @@ Feature: Security Monitoring @team:DataDog/k9-investigation Scenario: Create cases for security findings returns "Created" response Given new "CreateCases" request - And body with value {"data": [{"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "cases"}, {"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "cases"}]} + And body with value {"data": [{"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "YjdhNDM3N2QyNTFjYmUwYTY3NDdhMTg0YTk2Yjg5MDl-ZjNmMzAwOTFkZDNhNGQzYzI0MzgxNTk4MjRjZmE2NzE=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "cases"}, {"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "OGRlMDIwYzk4MjFmZTZiNTQwMzk2ZjUxNzg0MDc0NjR-MTk3Yjk4MDI4ZDQ4YzI2ZGZiMWJmMTNhNDEwZGZkYWI=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "cases"}]} When the request is sent Then the response status is 201 Created And the response "data" has length 2 @@ -605,14 +557,14 @@ Feature: Security Monitoring And the response "data[0].attributes.description" is equal to "A description" And the response "data[0].attributes.type" is equal to "SECURITY" And the response "data[0].attributes.insights" has length 1 - And the response "data[0].attributes.insights[0].resource_id" is equal to "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" + And the response "data[0].attributes.insights[0].resource_id" is equal to "YjdhNDM3N2QyNTFjYmUwYTY3NDdhMTg0YTk2Yjg5MDl-ZjNmMzAwOTFkZDNhNGQzYzI0MzgxNTk4MjRjZmE2NzE=" And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" And the response "data[1]" has field "id" And the response "data[1].attributes.title" is equal to "A title" And the response "data[1].attributes.description" is equal to "A description" And the response "data[1].attributes.type" is equal to "SECURITY" And the response "data[1].attributes.insights" has length 1 - And the response "data[1].attributes.insights[0].resource_id" is equal to "MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=" + And the response "data[1].attributes.insights[0].resource_id" is equal to "OGRlMDIwYzk4MjFmZTZiNTQwMzk2ZjUxNzg0MDc0NjR-MTk3Yjk4MDI4ZDQ4YzI2ZGZiMWJmMTNhNDEwZGZkYWI=" And the response "data[1].attributes.insights[0].type" is equal to "SECURITY_FINDING" @team:DataDog/k9-investigation 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 396d5238362..4d590026bd7 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 @@ -3715,7 +3715,7 @@ "parameters": [ { "name": "body", - "template": "{\n \"data\": {\n \"type\": \"cases\",\n \"id\": \"{{data[0].id}}\",\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}" + "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" @@ -3740,7 +3740,7 @@ "parameters": [ { "name": "body", - "template": "{\n \"data\": {\n \"type\": \"cases\",\n \"id\": \"{{data[0].id}}\",\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}" + "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"