From 0559cf1c97c3d4315567d69db1c9db929adec7ad Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 15 Dec 2025 13:23:58 +0000 Subject: [PATCH] Regenerate client from commit 178a8e0 of spec repo --- .generator/schemas/v2/openapi.yaml | 217 +++++++++--------- docs/datadog_api_client.v2.model.rst | 28 --- .../v2/security-monitoring/CreateCases.py | 4 +- .../CreateCases_2385516013.py | 2 +- .../CreateCases_2798851680.py | 4 +- .../security-monitoring/CreateJiraIssues.py | 90 +------- .../CreateJiraIssues_379590688.py | 87 ------- .../CreateJiraIssues_829823123.py | 95 -------- .../v2/api/security_monitoring_api.py | 17 +- .../v2/model/attach_case_request_data.py | 2 +- .../model/attach_jira_issue_request_data.py | 8 - ...tach_jira_issue_request_data_attributes.py | 2 +- .../v2/model/case_insights_items.py | 6 +- .../v2/model/case_management_project_data.py | 2 +- .../v2/model/create_case_request_data.py | 8 - .../create_case_request_data_attributes.py | 6 +- .../model/create_jira_issue_request_array.py | 32 +-- ...reate_jira_issue_request_array_included.py | 51 ---- .../model/create_jira_issue_request_data.py | 8 - ...eate_jira_issue_request_data_attributes.py | 71 +++++- ...ra_issue_request_data_attributes_fields.py | 36 --- ...e_jira_issue_request_data_relationships.py | 28 ++- ...a_issue_request_data_relationships_case.py | 44 ---- ...ue_request_data_relationships_case_data.py | 46 ---- .../v2/model/detach_case_request_data.py | 13 +- .../v2/model/finding_case_response_data.py | 2 +- .../v2/model/finding_data.py | 2 +- .../v2/model/finding_jira_issue.py | 4 +- .../v2/model/finding_jira_issue_result.py | 8 +- src/datadog_api_client/v2/models/__init__.py | 14 -- ...ty_finding_returns_created_response.frozen | 2 +- ...rity_finding_returns_created_response.yaml | 8 +- ...y_findings_returns_created_response.frozen | 2 +- ...ity_findings_returns_created_response.yaml | 8 +- ...y_findings_returns_created_response.frozen | 2 +- ...ity_findings_returns_created_response.yaml | 14 +- ...ty_finding_returns_created_response.frozen | 1 - ...rity_finding_returns_created_response.yaml | 39 ---- ...y_findings_returns_created_response.frozen | 1 - ...ity_findings_returns_created_response.yaml | 39 ---- ...ndings_returns_bad_request_response.frozen | 1 - ...findings_returns_bad_request_response.yaml | 21 -- ...y_findings_returns_created_response.frozen | 1 - ...ity_findings_returns_created_response.yaml | 42 ---- ...findings_returns_not_found_response.frozen | 1 - ...y_findings_returns_not_found_response.yaml | 22 -- tests/v2/features/security_monitoring.feature | 88 ++----- tests/v2/features/undo.json | 4 +- 48 files changed, 268 insertions(+), 965 deletions(-) delete mode 100644 examples/v2/security-monitoring/CreateJiraIssues_379590688.py delete mode 100644 examples/v2/security-monitoring/CreateJiraIssues_829823123.py delete mode 100644 src/datadog_api_client/v2/model/create_jira_issue_request_array_included.py delete mode 100644 src/datadog_api_client/v2/model/create_jira_issue_request_data_attributes_fields.py delete mode 100644 src/datadog_api_client/v2/model/create_jira_issue_request_data_relationships_case.py delete mode 100644 src/datadog_api_client/v2/model/create_jira_issue_request_data_relationships_case_data.py delete mode 100644 tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_finding_returns_created_response.frozen delete mode 100644 tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_finding_returns_created_response.yaml delete mode 100644 tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_findings_returns_created_response.frozen delete mode 100644 tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_findings_returns_created_response.yaml delete mode 100644 tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_bad_request_response.frozen delete mode 100644 tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_bad_request_response.yaml delete mode 100644 tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_created_response.frozen delete mode 100644 tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_created_response.yaml delete mode 100644 tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_not_found_response.frozen delete mode 100644 tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_not_found_response.yaml diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index eea8d903b4..4969d8578d 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/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index f4e5a82376..b691e08711 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -5289,13 +5289,6 @@ datadog\_api\_client.v2.model.create\_jira\_issue\_request\_array module :members: :show-inheritance: -datadog\_api\_client.v2.model.create\_jira\_issue\_request\_array\_included module ----------------------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.create_jira_issue_request_array_included - :members: - :show-inheritance: - datadog\_api\_client.v2.model.create\_jira\_issue\_request\_data module ----------------------------------------------------------------------- @@ -5310,13 +5303,6 @@ datadog\_api\_client.v2.model.create\_jira\_issue\_request\_data\_attributes mod :members: :show-inheritance: -datadog\_api\_client.v2.model.create\_jira\_issue\_request\_data\_attributes\_fields module -------------------------------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.create_jira_issue_request_data_attributes_fields - :members: - :show-inheritance: - datadog\_api\_client.v2.model.create\_jira\_issue\_request\_data\_relationships module -------------------------------------------------------------------------------------- @@ -5324,20 +5310,6 @@ datadog\_api\_client.v2.model.create\_jira\_issue\_request\_data\_relationships :members: :show-inheritance: -datadog\_api\_client.v2.model.create\_jira\_issue\_request\_data\_relationships\_case module --------------------------------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.create\_jira\_issue\_request\_data\_relationships\_case\_data module --------------------------------------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case_data - :members: - :show-inheritance: - datadog\_api\_client.v2.model.create\_notification\_rule\_parameters module --------------------------------------------------------------------------- diff --git a/examples/v2/security-monitoring/CreateCases.py b/examples/v2/security-monitoring/CreateCases.py index cc6c0dfc6f..b6788e3741 100644 --- a/examples/v2/security-monitoring/CreateCases.py +++ b/examples/v2/security-monitoring/CreateCases.py @@ -27,7 +27,7 @@ findings=Findings( data=[ FindingData( - id="ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", + id="YjdhNDM3N2QyNTFjYmUwYTY3NDdhMTg0YTk2Yjg5MDl-ZjNmMzAwOTFkZDNhNGQzYzI0MzgxNTk4MjRjZmE2NzE=", type=FindingDataType.FINDINGS, ), ], @@ -50,7 +50,7 @@ findings=Findings( data=[ FindingData( - id="MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=", + id="OGRlMDIwYzk4MjFmZTZiNTQwMzk2ZjUxNzg0MDc0NjR-MTk3Yjk4MDI4ZDQ4YzI2ZGZiMWJmMTNhNDEwZGZkYWI=", type=FindingDataType.FINDINGS, ), ], diff --git a/examples/v2/security-monitoring/CreateCases_2385516013.py b/examples/v2/security-monitoring/CreateCases_2385516013.py index 5fe89194f9..0f58a22bc9 100644 --- a/examples/v2/security-monitoring/CreateCases_2385516013.py +++ b/examples/v2/security-monitoring/CreateCases_2385516013.py @@ -27,7 +27,7 @@ findings=Findings( data=[ FindingData( - id="ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", + id="YjdhNDM3N2QyNTFjYmUwYTY3NDdhMTg0YTk2Yjg5MDl-ZjNmMzAwOTFkZDNhNGQzYzI0MzgxNTk4MjRjZmE2NzE=", type=FindingDataType.FINDINGS, ), ], diff --git a/examples/v2/security-monitoring/CreateCases_2798851680.py b/examples/v2/security-monitoring/CreateCases_2798851680.py index 7192ad73aa..6be0f22969 100644 --- a/examples/v2/security-monitoring/CreateCases_2798851680.py +++ b/examples/v2/security-monitoring/CreateCases_2798851680.py @@ -27,11 +27,11 @@ findings=Findings( data=[ FindingData( - id="ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", + id="ZTd5LWNuYi1seWV-aS0wMjI2NGZjZjRmZWQ5ODMyMg==", type=FindingDataType.FINDINGS, ), FindingData( - id="MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=", + id="c2FuLXhyaS1kZnN-aS0wODM3MjVhMTM2MDExNzNkOQ==", type=FindingDataType.FINDINGS, ), ], diff --git a/examples/v2/security-monitoring/CreateJiraIssues.py b/examples/v2/security-monitoring/CreateJiraIssues.py index 31b056ca34..e4529c66c5 100644 --- a/examples/v2/security-monitoring/CreateJiraIssues.py +++ b/examples/v2/security-monitoring/CreateJiraIssues.py @@ -4,25 +4,16 @@ from datadog_api_client import ApiClient, Configuration from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi -from datadog_api_client.v2.model.case_data_type import CaseDataType from datadog_api_client.v2.model.case_management_project import CaseManagementProject from datadog_api_client.v2.model.case_management_project_data import CaseManagementProjectData from datadog_api_client.v2.model.case_management_project_data_type import CaseManagementProjectDataType -from datadog_api_client.v2.model.create_case_request_data import CreateCaseRequestData -from datadog_api_client.v2.model.create_case_request_data_attributes import CreateCaseRequestDataAttributes -from datadog_api_client.v2.model.create_case_request_data_relationships import CreateCaseRequestDataRelationships +from datadog_api_client.v2.model.case_priority import CasePriority from datadog_api_client.v2.model.create_jira_issue_request_array import CreateJiraIssueRequestArray from datadog_api_client.v2.model.create_jira_issue_request_data import CreateJiraIssueRequestData from datadog_api_client.v2.model.create_jira_issue_request_data_attributes import CreateJiraIssueRequestDataAttributes from datadog_api_client.v2.model.create_jira_issue_request_data_relationships import ( CreateJiraIssueRequestDataRelationships, ) -from datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case import ( - CreateJiraIssueRequestDataRelationshipsCase, -) -from datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case_data import ( - CreateJiraIssueRequestDataRelationshipsCaseData, -) from datadog_api_client.v2.model.finding_data import FindingData from datadog_api_client.v2.model.finding_data_type import FindingDataType from datadog_api_client.v2.model.findings import Findings @@ -31,95 +22,36 @@ body = CreateJiraIssueRequestArray( data=[ CreateJiraIssueRequestData( - type=JiraIssuesDataType.JIRA_ISSUES, - attributes=CreateJiraIssueRequestDataAttributes(), - relationships=CreateJiraIssueRequestDataRelationships( - case=CreateJiraIssueRequestDataRelationshipsCase( - data=CreateJiraIssueRequestDataRelationshipsCaseData( - type=CaseDataType.CASES, - id="53e242c6-a7d6-46ad-9680-b8d14753f716", - ), - ), + attributes=CreateJiraIssueRequestDataAttributes( + assignee_id="f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", + description="A description of the Jira issue.", + fields=dict([("key1", "value"), ("key2", "['value']"), ("key3", "{'key4': 'value'}")]), + priority=CasePriority.NOT_DEFINED, + title="A title for the Jira issue.", ), - ), - CreateJiraIssueRequestData( - type=JiraIssuesDataType.JIRA_ISSUES, - attributes=CreateJiraIssueRequestDataAttributes(), relationships=CreateJiraIssueRequestDataRelationships( - case=CreateJiraIssueRequestDataRelationshipsCase( - data=CreateJiraIssueRequestDataRelationshipsCaseData( - type=CaseDataType.CASES, - id="195772b2-1f53-41d2-b81e-48c8e6c21d33", - ), - ), - ), - ), - ], - included=[ - CreateCaseRequestData( - type=CaseDataType.CASES, - attributes=CreateCaseRequestDataAttributes( - title="A title", - description="A description", - ), - relationships=CreateCaseRequestDataRelationships( - project=CaseManagementProject( - data=CaseManagementProjectData( - type=CaseManagementProjectDataType.PROJECTS, - id="959a6f71-bac8-4027-b1d3-2264f569296f", - ), - ), findings=Findings( data=[ FindingData( + id="ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", type=FindingDataType.FINDINGS, - id="OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", ), ], ), - ), - id="53e242c6-a7d6-46ad-9680-b8d14753f716", - ), - CreateCaseRequestData( - type=CaseDataType.CASES, - attributes=CreateCaseRequestDataAttributes( - title="A title", - description="A description", - ), - relationships=CreateCaseRequestDataRelationships( project=CaseManagementProject( data=CaseManagementProjectData( + id="aeadc05e-98a8-11ec-ac2c-da7ad0900001", type=CaseManagementProjectDataType.PROJECTS, - id="959a6f71-bac8-4027-b1d3-2264f569296f", ), ), - findings=Findings( - data=[ - FindingData( - type=FindingDataType.FINDINGS, - id="MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=", - ), - ], - ), ), - id="195772b2-1f53-41d2-b81e-48c8e6c21d33", - ), - CaseManagementProjectData( - type=CaseManagementProjectDataType.PROJECTS, - id="959a6f71-bac8-4027-b1d3-2264f569296f", - ), - FindingData( - type=FindingDataType.FINDINGS, - id="OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", - ), - FindingData( - type=FindingDataType.FINDINGS, - id="MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=", + type=JiraIssuesDataType.JIRA_ISSUES, ), ], ) configuration = Configuration() +configuration.unstable_operations["create_jira_issues"] = True with ApiClient(configuration) as api_client: api_instance = SecurityMonitoringApi(api_client) response = api_instance.create_jira_issues(body=body) diff --git a/examples/v2/security-monitoring/CreateJiraIssues_379590688.py b/examples/v2/security-monitoring/CreateJiraIssues_379590688.py deleted file mode 100644 index 82debd188e..0000000000 --- a/examples/v2/security-monitoring/CreateJiraIssues_379590688.py +++ /dev/null @@ -1,87 +0,0 @@ -""" -Create Jira issue for security finding returns "Created" response -""" - -from datadog_api_client import ApiClient, Configuration -from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi -from datadog_api_client.v2.model.case_data_type import CaseDataType -from datadog_api_client.v2.model.case_management_project import CaseManagementProject -from datadog_api_client.v2.model.case_management_project_data import CaseManagementProjectData -from datadog_api_client.v2.model.case_management_project_data_type import CaseManagementProjectDataType -from datadog_api_client.v2.model.create_case_request_data import CreateCaseRequestData -from datadog_api_client.v2.model.create_case_request_data_attributes import CreateCaseRequestDataAttributes -from datadog_api_client.v2.model.create_case_request_data_relationships import CreateCaseRequestDataRelationships -from datadog_api_client.v2.model.create_jira_issue_request_array import CreateJiraIssueRequestArray -from datadog_api_client.v2.model.create_jira_issue_request_data import CreateJiraIssueRequestData -from datadog_api_client.v2.model.create_jira_issue_request_data_attributes import CreateJiraIssueRequestDataAttributes -from datadog_api_client.v2.model.create_jira_issue_request_data_relationships import ( - CreateJiraIssueRequestDataRelationships, -) -from datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case import ( - CreateJiraIssueRequestDataRelationshipsCase, -) -from datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case_data import ( - CreateJiraIssueRequestDataRelationshipsCaseData, -) -from datadog_api_client.v2.model.finding_data import FindingData -from datadog_api_client.v2.model.finding_data_type import FindingDataType -from datadog_api_client.v2.model.findings import Findings -from datadog_api_client.v2.model.jira_issues_data_type import JiraIssuesDataType - -body = CreateJiraIssueRequestArray( - data=[ - CreateJiraIssueRequestData( - type=JiraIssuesDataType.JIRA_ISSUES, - attributes=CreateJiraIssueRequestDataAttributes(), - relationships=CreateJiraIssueRequestDataRelationships( - case=CreateJiraIssueRequestDataRelationshipsCase( - data=CreateJiraIssueRequestDataRelationshipsCaseData( - type=CaseDataType.CASES, - id="6a773295-8729-4034-aada-53b64cbe02e7", - ), - ), - ), - ), - ], - included=[ - CreateCaseRequestData( - type=CaseDataType.CASES, - attributes=CreateCaseRequestDataAttributes( - title="A title", - description="A description", - ), - relationships=CreateCaseRequestDataRelationships( - project=CaseManagementProject( - data=CaseManagementProjectData( - type=CaseManagementProjectDataType.PROJECTS, - id="959a6f71-bac8-4027-b1d3-2264f569296f", - ), - ), - findings=Findings( - data=[ - FindingData( - type=FindingDataType.FINDINGS, - id="ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", - ), - ], - ), - ), - id="6a773295-8729-4034-aada-53b64cbe02e7", - ), - CaseManagementProjectData( - type=CaseManagementProjectDataType.PROJECTS, - id="959a6f71-bac8-4027-b1d3-2264f569296f", - ), - FindingData( - type=FindingDataType.FINDINGS, - id="ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", - ), - ], -) - -configuration = Configuration() -with ApiClient(configuration) as api_client: - api_instance = SecurityMonitoringApi(api_client) - response = api_instance.create_jira_issues(body=body) - - print(response) diff --git a/examples/v2/security-monitoring/CreateJiraIssues_829823123.py b/examples/v2/security-monitoring/CreateJiraIssues_829823123.py deleted file mode 100644 index 5c5b32c8c3..0000000000 --- a/examples/v2/security-monitoring/CreateJiraIssues_829823123.py +++ /dev/null @@ -1,95 +0,0 @@ -""" -Create Jira issue for security findings returns "Created" response -""" - -from datadog_api_client import ApiClient, Configuration -from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi -from datadog_api_client.v2.model.case_data_type import CaseDataType -from datadog_api_client.v2.model.case_management_project import CaseManagementProject -from datadog_api_client.v2.model.case_management_project_data import CaseManagementProjectData -from datadog_api_client.v2.model.case_management_project_data_type import CaseManagementProjectDataType -from datadog_api_client.v2.model.create_case_request_data import CreateCaseRequestData -from datadog_api_client.v2.model.create_case_request_data_attributes import CreateCaseRequestDataAttributes -from datadog_api_client.v2.model.create_case_request_data_relationships import CreateCaseRequestDataRelationships -from datadog_api_client.v2.model.create_jira_issue_request_array import CreateJiraIssueRequestArray -from datadog_api_client.v2.model.create_jira_issue_request_data import CreateJiraIssueRequestData -from datadog_api_client.v2.model.create_jira_issue_request_data_attributes import CreateJiraIssueRequestDataAttributes -from datadog_api_client.v2.model.create_jira_issue_request_data_relationships import ( - CreateJiraIssueRequestDataRelationships, -) -from datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case import ( - CreateJiraIssueRequestDataRelationshipsCase, -) -from datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case_data import ( - CreateJiraIssueRequestDataRelationshipsCaseData, -) -from datadog_api_client.v2.model.finding_data import FindingData -from datadog_api_client.v2.model.finding_data_type import FindingDataType -from datadog_api_client.v2.model.findings import Findings -from datadog_api_client.v2.model.jira_issues_data_type import JiraIssuesDataType - -body = CreateJiraIssueRequestArray( - data=[ - CreateJiraIssueRequestData( - type=JiraIssuesDataType.JIRA_ISSUES, - attributes=CreateJiraIssueRequestDataAttributes(), - relationships=CreateJiraIssueRequestDataRelationships( - case=CreateJiraIssueRequestDataRelationshipsCase( - data=CreateJiraIssueRequestDataRelationshipsCaseData( - type=CaseDataType.CASES, - id="e469ceda-957a-4557-a607-9ff25032e9ca", - ), - ), - ), - ), - ], - included=[ - CreateCaseRequestData( - type=CaseDataType.CASES, - attributes=CreateCaseRequestDataAttributes( - title="A title", - description="A description", - ), - relationships=CreateCaseRequestDataRelationships( - project=CaseManagementProject( - data=CaseManagementProjectData( - type=CaseManagementProjectDataType.PROJECTS, - id="959a6f71-bac8-4027-b1d3-2264f569296f", - ), - ), - findings=Findings( - data=[ - FindingData( - type=FindingDataType.FINDINGS, - id="MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=", - ), - FindingData( - type=FindingDataType.FINDINGS, - id="ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=", - ), - ], - ), - ), - id="e469ceda-957a-4557-a607-9ff25032e9ca", - ), - CaseManagementProjectData( - type=CaseManagementProjectDataType.PROJECTS, - id="959a6f71-bac8-4027-b1d3-2264f569296f", - ), - FindingData( - type=FindingDataType.FINDINGS, - id="MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=", - ), - FindingData( - type=FindingDataType.FINDINGS, - id="ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=", - ), - ], -) - -configuration = Configuration() -with ApiClient(configuration) as api_client: - api_instance = SecurityMonitoringApi(api_client) - response = api_instance.create_jira_issues(body=body) - - print(response) diff --git a/src/datadog_api_client/v2/api/security_monitoring_api.py b/src/datadog_api_client/v2/api/security_monitoring_api.py index 9d41c494e1..dd1ee91776 100644 --- a/src/datadog_api_client/v2/api/security_monitoring_api.py +++ b/src/datadog_api_client/v2/api/security_monitoring_api.py @@ -2313,9 +2313,10 @@ def attach_case( ) -> FindingCaseResponse: """Attach security findings to a case. - 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. + 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. - :param case_id: The unique identifier of the case to attach security findings to + :param case_id: Unique identifier of the case to attach security findings to :type case_id: str :type body: AttachCaseRequest :rtype: FindingCaseResponse @@ -2333,7 +2334,8 @@ def attach_jira_issue( ) -> FindingCaseResponse: """Attach security findings to a Jira issue. - 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. + 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 `_. 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. :type body: AttachJiraIssueRequest :rtype: FindingCaseResponse @@ -2433,7 +2435,8 @@ def create_cases( ) -> FindingCaseResponseArray: """Create cases for security findings. - 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. + 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. :type body: CreateCaseRequestArray :rtype: FindingCaseResponseArray @@ -2465,7 +2468,8 @@ def create_jira_issues( ) -> FindingCaseResponseArray: """Create Jira issues for security findings. - 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. + 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 `_. 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. :type body: CreateJiraIssueRequestArray :rtype: FindingCaseResponseArray @@ -2699,7 +2703,8 @@ def detach_case( ) -> None: """Detach security findings from their case. - 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. + 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. :type body: DetachCaseRequest :rtype: None diff --git a/src/datadog_api_client/v2/model/attach_case_request_data.py b/src/datadog_api_client/v2/model/attach_case_request_data.py index 1446e902b9..f987ee216a 100644 --- a/src/datadog_api_client/v2/model/attach_case_request_data.py +++ b/src/datadog_api_client/v2/model/attach_case_request_data.py @@ -48,7 +48,7 @@ def __init__( """ Data of the case to attach security findings to. - :param id: The unique identifier of the case. + :param id: Unique identifier of the case. :type id: str :param relationships: Relationships of the case to attach security findings to. diff --git a/src/datadog_api_client/v2/model/attach_jira_issue_request_data.py b/src/datadog_api_client/v2/model/attach_jira_issue_request_data.py index ac6ff71046..e418c5103e 100644 --- a/src/datadog_api_client/v2/model/attach_jira_issue_request_data.py +++ b/src/datadog_api_client/v2/model/attach_jira_issue_request_data.py @@ -36,14 +36,12 @@ def openapi_types(_): return { "attributes": (AttachJiraIssueRequestDataAttributes,), - "id": (str,), "relationships": (AttachJiraIssueRequestDataRelationships,), "type": (JiraIssuesDataType,), } attribute_map = { "attributes": "attributes", - "id": "id", "relationships": "relationships", "type": "type", } @@ -52,7 +50,6 @@ def __init__( self_, type: JiraIssuesDataType, attributes: Union[AttachJiraIssueRequestDataAttributes, UnsetType] = unset, - id: Union[str, UnsetType] = unset, relationships: Union[AttachJiraIssueRequestDataRelationships, UnsetType] = unset, **kwargs, ): @@ -62,9 +59,6 @@ def __init__( :param attributes: Attributes of the Jira issue to attach security findings to. :type attributes: AttachJiraIssueRequestDataAttributes, optional - :param id: The unique identifier of the Jira issue attachment request. - :type id: str, optional - :param relationships: Relationships of the Jira issue to attach security findings to. :type relationships: AttachJiraIssueRequestDataRelationships, optional @@ -73,8 +67,6 @@ def __init__( """ if attributes is not unset: kwargs["attributes"] = attributes - if id is not unset: - kwargs["id"] = id if relationships is not unset: kwargs["relationships"] = relationships super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/attach_jira_issue_request_data_attributes.py b/src/datadog_api_client/v2/model/attach_jira_issue_request_data_attributes.py index 44a1b72414..d5bd0683cb 100644 --- a/src/datadog_api_client/v2/model/attach_jira_issue_request_data_attributes.py +++ b/src/datadog_api_client/v2/model/attach_jira_issue_request_data_attributes.py @@ -25,7 +25,7 @@ def __init__(self_, jira_issue_url: str, **kwargs): """ Attributes of the Jira issue to attach security findings to. - :param jira_issue_url: The URL of the Jira issue to attach security findings to. + :param jira_issue_url: URL of the Jira issue to attach security findings to. :type jira_issue_url: str """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/case_insights_items.py b/src/datadog_api_client/v2/model/case_insights_items.py index efa61b85be..b25bd79f49 100644 --- a/src/datadog_api_client/v2/model/case_insights_items.py +++ b/src/datadog_api_client/v2/model/case_insights_items.py @@ -38,13 +38,13 @@ def __init__( """ An insight of the case. - :param ref: The reference of the insight. + :param ref: Reference of the insight. :type ref: str, optional - :param resource_id: The unique identifier of the resource. For example, the unique identifier of a security finding. + :param resource_id: Unique identifier of the resource. For example, the unique identifier of a security finding. :type resource_id: str, optional - :param type: The type of the resource. For example, the type of a security finding is "SECURITY_FINDING". + :param type: Type of the resource. For example, the type of a security finding is "SECURITY_FINDING". :type type: str, optional """ if ref is not unset: diff --git a/src/datadog_api_client/v2/model/case_management_project_data.py b/src/datadog_api_client/v2/model/case_management_project_data.py index b80ada112f..b43c704699 100644 --- a/src/datadog_api_client/v2/model/case_management_project_data.py +++ b/src/datadog_api_client/v2/model/case_management_project_data.py @@ -34,7 +34,7 @@ def __init__(self_, id: str, type: CaseManagementProjectDataType, **kwargs): """ - :param id: The unique identifier of the case management project. + :param id: Unique identifier of the case management project. :type id: str :param type: Projects resource type. diff --git a/src/datadog_api_client/v2/model/create_case_request_data.py b/src/datadog_api_client/v2/model/create_case_request_data.py index cbf51ae126..54d67a13ec 100644 --- a/src/datadog_api_client/v2/model/create_case_request_data.py +++ b/src/datadog_api_client/v2/model/create_case_request_data.py @@ -30,14 +30,12 @@ def openapi_types(_): return { "attributes": (CreateCaseRequestDataAttributes,), - "id": (str,), "relationships": (CreateCaseRequestDataRelationships,), "type": (CaseDataType,), } attribute_map = { "attributes": "attributes", - "id": "id", "relationships": "relationships", "type": "type", } @@ -46,7 +44,6 @@ def __init__( self_, type: CaseDataType, attributes: Union[CreateCaseRequestDataAttributes, UnsetType] = unset, - id: Union[str, UnsetType] = unset, relationships: Union[CreateCaseRequestDataRelationships, UnsetType] = unset, **kwargs, ): @@ -56,9 +53,6 @@ def __init__( :param attributes: Attributes of the case to create. :type attributes: CreateCaseRequestDataAttributes, optional - :param id: The unique identifier of the case. - :type id: str, optional - :param relationships: Relationships of the case to create. :type relationships: CreateCaseRequestDataRelationships, optional @@ -67,8 +61,6 @@ def __init__( """ if attributes is not unset: kwargs["attributes"] = attributes - if id is not unset: - kwargs["id"] = id if relationships is not unset: kwargs["relationships"] = relationships super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/create_case_request_data_attributes.py b/src/datadog_api_client/v2/model/create_case_request_data_attributes.py index 5ffd1b9301..6dea8bf76b 100644 --- a/src/datadog_api_client/v2/model/create_case_request_data_attributes.py +++ b/src/datadog_api_client/v2/model/create_case_request_data_attributes.py @@ -47,16 +47,16 @@ def __init__( """ Attributes of the case to create. - :param assignee_id: The unique identifier of the user assigned to the case. + :param assignee_id: Unique identifier of the user assigned to the case. :type assignee_id: str, optional - :param description: The description of the case. If not provided, the description will be automatically generated. + :param description: Description of the case. If not provided, the description will be automatically generated. :type description: str, optional :param priority: Case priority :type priority: CasePriority, optional - :param title: The title of the case. If not provided, the title will be automatically generated. + :param title: Title of the case. If not provided, the title will be automatically generated. :type title: str, optional """ if assignee_id is not unset: diff --git a/src/datadog_api_client/v2/model/create_jira_issue_request_array.py b/src/datadog_api_client/v2/model/create_jira_issue_request_array.py index 89cfabdeca..03b3f9106c 100644 --- a/src/datadog_api_client/v2/model/create_jira_issue_request_array.py +++ b/src/datadog_api_client/v2/model/create_jira_issue_request_array.py @@ -3,66 +3,38 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import List, Union, TYPE_CHECKING +from typing import List, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, cached_property, - unset, - UnsetType, ) if TYPE_CHECKING: from datadog_api_client.v2.model.create_jira_issue_request_data import CreateJiraIssueRequestData - from datadog_api_client.v2.model.create_jira_issue_request_array_included import CreateJiraIssueRequestArrayIncluded - from datadog_api_client.v2.model.create_case_request_data import CreateCaseRequestData - from datadog_api_client.v2.model.case_management_project_data import CaseManagementProjectData - from datadog_api_client.v2.model.finding_data import FindingData class CreateJiraIssueRequestArray(ModelNormal): @cached_property def openapi_types(_): from datadog_api_client.v2.model.create_jira_issue_request_data import CreateJiraIssueRequestData - from datadog_api_client.v2.model.create_jira_issue_request_array_included import ( - CreateJiraIssueRequestArrayIncluded, - ) return { "data": ([CreateJiraIssueRequestData],), - "included": ([CreateJiraIssueRequestArrayIncluded],), } attribute_map = { "data": "data", - "included": "included", } - def __init__( - self_, - data: List[CreateJiraIssueRequestData], - included: Union[ - List[ - Union[ - CreateJiraIssueRequestArrayIncluded, CreateCaseRequestData, CaseManagementProjectData, FindingData - ] - ], - UnsetType, - ] = unset, - **kwargs, - ): + def __init__(self_, data: List[CreateJiraIssueRequestData], **kwargs): """ List of requests to create Jira issues for security findings. :param data: :type data: [CreateJiraIssueRequestData] - - :param included: - :type included: [CreateJiraIssueRequestArrayIncluded], optional """ - if included is not unset: - kwargs["included"] = included super().__init__(kwargs) self_.data = data diff --git a/src/datadog_api_client/v2/model/create_jira_issue_request_array_included.py b/src/datadog_api_client/v2/model/create_jira_issue_request_array_included.py deleted file mode 100644 index 12e06baeb6..0000000000 --- a/src/datadog_api_client/v2/model/create_jira_issue_request_array_included.py +++ /dev/null @@ -1,51 +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. -from __future__ import annotations - - -from datadog_api_client.model_utils import ( - ModelComposed, - cached_property, -) - - -class CreateJiraIssueRequestArrayIncluded(ModelComposed): - def __init__(self, **kwargs): - """ - Attributes and relationships of the case linked to the Jira issue. Should contain all of the following: case, project, and security findings. - - :param attributes: Attributes of the case to create. - :type attributes: CreateCaseRequestDataAttributes, optional - - :param id: The unique identifier of the case. - :type id: str, optional - - :param relationships: Relationships of the case to create. - :type relationships: CreateCaseRequestDataRelationships, optional - - :param type: Cases resource type. - :type type: CaseDataType - """ - super().__init__(kwargs) - - @cached_property - def _composed_schemas(_): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - from datadog_api_client.v2.model.create_case_request_data import CreateCaseRequestData - from datadog_api_client.v2.model.case_management_project_data import CaseManagementProjectData - from datadog_api_client.v2.model.finding_data import FindingData - - return { - "oneOf": [ - CreateCaseRequestData, - CaseManagementProjectData, - FindingData, - ], - } diff --git a/src/datadog_api_client/v2/model/create_jira_issue_request_data.py b/src/datadog_api_client/v2/model/create_jira_issue_request_data.py index 99584d8424..c66626f847 100644 --- a/src/datadog_api_client/v2/model/create_jira_issue_request_data.py +++ b/src/datadog_api_client/v2/model/create_jira_issue_request_data.py @@ -36,14 +36,12 @@ def openapi_types(_): return { "attributes": (CreateJiraIssueRequestDataAttributes,), - "id": (str,), "relationships": (CreateJiraIssueRequestDataRelationships,), "type": (JiraIssuesDataType,), } attribute_map = { "attributes": "attributes", - "id": "id", "relationships": "relationships", "type": "type", } @@ -52,7 +50,6 @@ def __init__( self_, type: JiraIssuesDataType, attributes: Union[CreateJiraIssueRequestDataAttributes, UnsetType] = unset, - id: Union[str, UnsetType] = unset, relationships: Union[CreateJiraIssueRequestDataRelationships, UnsetType] = unset, **kwargs, ): @@ -62,9 +59,6 @@ def __init__( :param attributes: Attributes of the Jira issue to create. :type attributes: CreateJiraIssueRequestDataAttributes, optional - :param id: The unique identifier of the Jira issue creation request. - :type id: str, optional - :param relationships: Relationships of the Jira issue to create. :type relationships: CreateJiraIssueRequestDataRelationships, optional @@ -73,8 +67,6 @@ def __init__( """ if attributes is not unset: kwargs["attributes"] = attributes - if id is not unset: - kwargs["id"] = id if relationships is not unset: kwargs["relationships"] = relationships super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/create_jira_issue_request_data_attributes.py b/src/datadog_api_client/v2/model/create_jira_issue_request_data_attributes.py index e97d8371b3..58571e8fbf 100644 --- a/src/datadog_api_client/v2/model/create_jira_issue_request_data_attributes.py +++ b/src/datadog_api_client/v2/model/create_jira_issue_request_data_attributes.py @@ -3,44 +3,95 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import Union, TYPE_CHECKING +from typing import Any, Dict, Union, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, cached_property, + date, + datetime, + none_type, unset, UnsetType, + UUID, ) if TYPE_CHECKING: - from datadog_api_client.v2.model.create_jira_issue_request_data_attributes_fields import ( - CreateJiraIssueRequestDataAttributesFields, - ) + from datadog_api_client.v2.model.case_priority import CasePriority class CreateJiraIssueRequestDataAttributes(ModelNormal): @cached_property def openapi_types(_): - from datadog_api_client.v2.model.create_jira_issue_request_data_attributes_fields import ( - CreateJiraIssueRequestDataAttributesFields, - ) + from datadog_api_client.v2.model.case_priority import CasePriority return { - "fields": (CreateJiraIssueRequestDataAttributesFields,), + "assignee_id": (str,), + "description": (str,), + "fields": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + ), + "priority": (CasePriority,), + "title": (str,), } attribute_map = { + "assignee_id": "assignee_id", + "description": "description", "fields": "fields", + "priority": "priority", + "title": "title", } - def __init__(self_, fields: Union[CreateJiraIssueRequestDataAttributesFields, UnsetType] = unset, **kwargs): + def __init__( + self_, + assignee_id: Union[str, UnsetType] = unset, + description: Union[str, UnsetType] = unset, + fields: Union[Dict[str, Any], UnsetType] = unset, + priority: Union[CasePriority, UnsetType] = unset, + title: Union[str, UnsetType] = unset, + **kwargs, + ): """ Attributes of the Jira issue to create. + :param assignee_id: Unique identifier of the user assigned to the Jira issue. + :type assignee_id: str, optional + + :param description: Description of the Jira issue. If not provided, the description will be automatically generated. + :type description: str, optional + :param fields: Custom fields of the Jira issue to create. For the list of available fields, see `Jira documentation `_. - :type fields: CreateJiraIssueRequestDataAttributesFields, optional + :type fields: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, optional + + :param priority: Case priority + :type priority: CasePriority, optional + + :param title: Title of the Jira issue. If not provided, the title will be automatically generated. + :type title: str, optional """ + if assignee_id is not unset: + kwargs["assignee_id"] = assignee_id + if description is not unset: + kwargs["description"] = description if fields is not unset: kwargs["fields"] = fields + if priority is not unset: + kwargs["priority"] = priority + if title is not unset: + kwargs["title"] = title super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/create_jira_issue_request_data_attributes_fields.py b/src/datadog_api_client/v2/model/create_jira_issue_request_data_attributes_fields.py deleted file mode 100644 index 5a9b0f038e..0000000000 --- a/src/datadog_api_client/v2/model/create_jira_issue_request_data_attributes_fields.py +++ /dev/null @@ -1,36 +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. -from __future__ import annotations - -from typing import Union - -from datadog_api_client.model_utils import ( - ModelNormal, - cached_property, - unset, - UnsetType, -) - - -class CreateJiraIssueRequestDataAttributesFields(ModelNormal): - @cached_property - def openapi_types(_): - return { - "fields": (dict,), - } - - attribute_map = { - "fields": "fields", - } - - def __init__(self_, fields: Union[dict, UnsetType] = unset, **kwargs): - """ - Custom fields of the Jira issue to create. For the list of available fields, see `Jira documentation `_. - - :param fields: - :type fields: dict, optional - """ - if fields is not unset: - kwargs["fields"] = fields - super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/create_jira_issue_request_data_relationships.py b/src/datadog_api_client/v2/model/create_jira_issue_request_data_relationships.py index 62dfb4b7ac..887dcd5afd 100644 --- a/src/datadog_api_client/v2/model/create_jira_issue_request_data_relationships.py +++ b/src/datadog_api_client/v2/model/create_jira_issue_request_data_relationships.py @@ -12,33 +12,37 @@ if TYPE_CHECKING: - from datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case import ( - CreateJiraIssueRequestDataRelationshipsCase, - ) + from datadog_api_client.v2.model.findings import Findings + from datadog_api_client.v2.model.case_management_project import CaseManagementProject class CreateJiraIssueRequestDataRelationships(ModelNormal): @cached_property def openapi_types(_): - from datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case import ( - CreateJiraIssueRequestDataRelationshipsCase, - ) + from datadog_api_client.v2.model.findings import Findings + from datadog_api_client.v2.model.case_management_project import CaseManagementProject return { - "case": (CreateJiraIssueRequestDataRelationshipsCase,), + "findings": (Findings,), + "project": (CaseManagementProject,), } attribute_map = { - "case": "case", + "findings": "findings", + "project": "project", } - def __init__(self_, case: CreateJiraIssueRequestDataRelationshipsCase, **kwargs): + def __init__(self_, findings: Findings, project: CaseManagementProject, **kwargs): """ Relationships of the Jira issue to create. - :param case: Case linked to the Jira issue. - :type case: CreateJiraIssueRequestDataRelationshipsCase + :param findings: A list of security findings. + :type findings: Findings + + :param project: Case management project. + :type project: CaseManagementProject """ super().__init__(kwargs) - self_.case = case + self_.findings = findings + self_.project = project diff --git a/src/datadog_api_client/v2/model/create_jira_issue_request_data_relationships_case.py b/src/datadog_api_client/v2/model/create_jira_issue_request_data_relationships_case.py deleted file mode 100644 index 9ebdf312df..0000000000 --- a/src/datadog_api_client/v2/model/create_jira_issue_request_data_relationships_case.py +++ /dev/null @@ -1,44 +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. -from __future__ import annotations - -from typing import TYPE_CHECKING - -from datadog_api_client.model_utils import ( - ModelNormal, - cached_property, -) - - -if TYPE_CHECKING: - from datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case_data import ( - CreateJiraIssueRequestDataRelationshipsCaseData, - ) - - -class CreateJiraIssueRequestDataRelationshipsCase(ModelNormal): - @cached_property - def openapi_types(_): - from datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case_data import ( - CreateJiraIssueRequestDataRelationshipsCaseData, - ) - - return { - "data": (CreateJiraIssueRequestDataRelationshipsCaseData,), - } - - attribute_map = { - "data": "data", - } - - def __init__(self_, data: CreateJiraIssueRequestDataRelationshipsCaseData, **kwargs): - """ - Case linked to the Jira issue. - - :param data: Case linked to the Jira issue. - :type data: CreateJiraIssueRequestDataRelationshipsCaseData - """ - super().__init__(kwargs) - - self_.data = data diff --git a/src/datadog_api_client/v2/model/create_jira_issue_request_data_relationships_case_data.py b/src/datadog_api_client/v2/model/create_jira_issue_request_data_relationships_case_data.py deleted file mode 100644 index 0c2dda89e1..0000000000 --- a/src/datadog_api_client/v2/model/create_jira_issue_request_data_relationships_case_data.py +++ /dev/null @@ -1,46 +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. -from __future__ import annotations - -from typing import TYPE_CHECKING - -from datadog_api_client.model_utils import ( - ModelNormal, - cached_property, -) - - -if TYPE_CHECKING: - from datadog_api_client.v2.model.case_data_type import CaseDataType - - -class CreateJiraIssueRequestDataRelationshipsCaseData(ModelNormal): - @cached_property - def openapi_types(_): - from datadog_api_client.v2.model.case_data_type import CaseDataType - - return { - "id": (str,), - "type": (CaseDataType,), - } - - attribute_map = { - "id": "id", - "type": "type", - } - - def __init__(self_, id: str, type: CaseDataType, **kwargs): - """ - Case linked to the Jira issue. - - :param id: - :type id: str - - :param type: Cases resource type. - :type type: CaseDataType - """ - super().__init__(kwargs) - - self_.id = id - self_.type = type diff --git a/src/datadog_api_client/v2/model/detach_case_request_data.py b/src/datadog_api_client/v2/model/detach_case_request_data.py index 6db8f3111e..84244c5782 100644 --- a/src/datadog_api_client/v2/model/detach_case_request_data.py +++ b/src/datadog_api_client/v2/model/detach_case_request_data.py @@ -27,38 +27,27 @@ def openapi_types(_): from datadog_api_client.v2.model.case_data_type import CaseDataType return { - "id": (str,), "relationships": (DetachCaseRequestDataRelationships,), "type": (CaseDataType,), } attribute_map = { - "id": "id", "relationships": "relationships", "type": "type", } def __init__( - self_, - type: CaseDataType, - id: Union[str, UnsetType] = unset, - relationships: Union[DetachCaseRequestDataRelationships, UnsetType] = unset, - **kwargs, + self_, type: CaseDataType, relationships: Union[DetachCaseRequestDataRelationships, UnsetType] = unset, **kwargs ): """ Data for detaching security findings from their case. - :param id: The unique identifier of the detachment request. - :type id: str, optional - :param relationships: Relationships detaching security findings from their case. :type relationships: DetachCaseRequestDataRelationships, optional :param type: Cases resource type. :type type: CaseDataType """ - if id is not unset: - kwargs["id"] = id if relationships is not unset: kwargs["relationships"] = relationships super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/finding_case_response_data.py b/src/datadog_api_client/v2/model/finding_case_response_data.py index 63a25ed372..f04b0b4f29 100644 --- a/src/datadog_api_client/v2/model/finding_case_response_data.py +++ b/src/datadog_api_client/v2/model/finding_case_response_data.py @@ -58,7 +58,7 @@ def __init__( :param attributes: Attributes of the case. :type attributes: FindingCaseResponseDataAttributes, optional - :param id: The unique identifier of the case. + :param id: Unique identifier of the case. :type id: str, optional :param relationships: Relationships of the case. diff --git a/src/datadog_api_client/v2/model/finding_data.py b/src/datadog_api_client/v2/model/finding_data.py index 67fa9785bd..d3852173ba 100644 --- a/src/datadog_api_client/v2/model/finding_data.py +++ b/src/datadog_api_client/v2/model/finding_data.py @@ -34,7 +34,7 @@ def __init__(self_, id: str, type: FindingDataType, **kwargs): """ - :param id: The unique identifier of the security finding. + :param id: Unique identifier of the security finding. :type id: str :param type: Security findings resource type. diff --git a/src/datadog_api_client/v2/model/finding_jira_issue.py b/src/datadog_api_client/v2/model/finding_jira_issue.py index ad45387130..f9ffdaaf15 100644 --- a/src/datadog_api_client/v2/model/finding_jira_issue.py +++ b/src/datadog_api_client/v2/model/finding_jira_issue.py @@ -44,13 +44,13 @@ def __init__( """ Jira issue associated with the case. - :param error_message: The error message if the Jira issue creation failed. + :param error_message: Error message if the Jira issue creation failed. :type error_message: str, optional :param result: Result of the Jira issue creation. :type result: FindingJiraIssueResult, optional - :param status: 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. + :param status: Status of the Jira issue creation. Can be "COMPLETED" if the Jira issue was created successfully, or "FAILED" if the Jira issue creation failed. :type status: str, optional """ if error_message is not unset: diff --git a/src/datadog_api_client/v2/model/finding_jira_issue_result.py b/src/datadog_api_client/v2/model/finding_jira_issue_result.py index 5863deceab..08194b26a4 100644 --- a/src/datadog_api_client/v2/model/finding_jira_issue_result.py +++ b/src/datadog_api_client/v2/model/finding_jira_issue_result.py @@ -41,16 +41,16 @@ def __init__( """ Result of the Jira issue creation. - :param account_id: The account ID of the Jira issue. + :param account_id: Account ID of the Jira issue. :type account_id: str, optional - :param issue_id: The unique identifier of the Jira issue. + :param issue_id: Unique identifier of the Jira issue. :type issue_id: str, optional - :param issue_key: The key of the Jira issue. + :param issue_key: Key of the Jira issue. :type issue_key: str, optional - :param issue_url: The URL of the Jira issue. + :param issue_url: URL of the Jira issue. :type issue_url: str, optional """ if account_id is not unset: diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 12010e1bd8..78b89c4d97 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -1006,21 +1006,11 @@ CreateIncidentNotificationTemplateRequest, ) from datadog_api_client.v2.model.create_jira_issue_request_array import CreateJiraIssueRequestArray -from datadog_api_client.v2.model.create_jira_issue_request_array_included import CreateJiraIssueRequestArrayIncluded from datadog_api_client.v2.model.create_jira_issue_request_data import CreateJiraIssueRequestData from datadog_api_client.v2.model.create_jira_issue_request_data_attributes import CreateJiraIssueRequestDataAttributes -from datadog_api_client.v2.model.create_jira_issue_request_data_attributes_fields import ( - CreateJiraIssueRequestDataAttributesFields, -) from datadog_api_client.v2.model.create_jira_issue_request_data_relationships import ( CreateJiraIssueRequestDataRelationships, ) -from datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case import ( - CreateJiraIssueRequestDataRelationshipsCase, -) -from datadog_api_client.v2.model.create_jira_issue_request_data_relationships_case_data import ( - CreateJiraIssueRequestDataRelationshipsCaseData, -) from datadog_api_client.v2.model.create_notification_rule_parameters import CreateNotificationRuleParameters from datadog_api_client.v2.model.create_notification_rule_parameters_data import CreateNotificationRuleParametersData from datadog_api_client.v2.model.create_notification_rule_parameters_data_attributes import ( @@ -5837,13 +5827,9 @@ "CreateIncidentNotificationRuleRequest", "CreateIncidentNotificationTemplateRequest", "CreateJiraIssueRequestArray", - "CreateJiraIssueRequestArrayIncluded", "CreateJiraIssueRequestData", "CreateJiraIssueRequestDataAttributes", - "CreateJiraIssueRequestDataAttributesFields", "CreateJiraIssueRequestDataRelationships", - "CreateJiraIssueRequestDataRelationshipsCase", - "CreateJiraIssueRequestDataRelationshipsCaseData", "CreateNotificationRuleParameters", "CreateNotificationRuleParametersData", "CreateNotificationRuleParametersDataAttributes", diff --git a/tests/v2/cassettes/test_scenarios/test_create_case_for_security_finding_returns_created_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_case_for_security_finding_returns_created_response.frozen index a6ccca66ab..d2ad4b4dd7 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_case_for_security_finding_returns_created_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_create_case_for_security_finding_returns_created_response.frozen @@ -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/tests/v2/cassettes/test_scenarios/test_create_case_for_security_finding_returns_created_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_case_for_security_finding_returns_created_response.yaml index e842738d1d..f5280ff78d 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_case_for_security_finding_returns_created_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_create_case_for_security_finding_returns_created_response.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"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"}]}' + body: '{"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: accept: - application/json @@ -10,8 +10,8 @@ interactions: uri: https://api.datadoghq.com/api/v2/security/findings/cases response: body: - string: '{"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 + string: '{"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: @@ -20,7 +20,7 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"id":"639c5df7-2352-4fc6-9d39-7dc8bdb8af14","relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]}},"type":"cases"}}' + body: '{"data":{"relationships":{"findings":{"data":[{"id":"YjdhNDM3N2QyNTFjYmUwYTY3NDdhMTg0YTk2Yjg5MDl-ZjNmMzAwOTFkZDNhNGQzYzI0MzgxNTk4MjRjZmE2NzE=","type":"findings"}]}},"type":"cases"}}' headers: accept: - '*/*' diff --git a/tests/v2/cassettes/test_scenarios/test_create_case_for_security_findings_returns_created_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_case_for_security_findings_returns_created_response.frozen index 11d711428d..5f043761a3 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_case_for_security_findings_returns_created_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_create_case_for_security_findings_returns_created_response.frozen @@ -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/tests/v2/cassettes/test_scenarios/test_create_case_for_security_findings_returns_created_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_case_for_security_findings_returns_created_response.yaml index 47f9ec9fcf..01c1d8e4c3 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_case_for_security_findings_returns_created_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_create_case_for_security_findings_returns_created_response.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"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"}]}' + body: '{"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: accept: - application/json @@ -10,8 +10,8 @@ interactions: uri: https://api.datadoghq.com/api/v2/security/findings/cases response: body: - string: '{"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 + string: '{"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: @@ -20,7 +20,7 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"id":"2c1ac0c4-e8cf-4699-8781-09077b10d2a0","relationships":{"findings":{"data":[{"id":"MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=","type":"findings"}]}},"type":"cases"}}' + body: '{"data":{"relationships":{"findings":{"data":[{"id":"ZTd5LWNuYi1seWV-aS0wMjI2NGZjZjRmZWQ5ODMyMg==","type":"findings"}]}},"type":"cases"}}' headers: accept: - '*/*' diff --git a/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_created_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_created_response.frozen index d1e05ac25c..19c30957a6 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_created_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_created_response.frozen @@ -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/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_created_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_created_response.yaml index 2f40126da2..e99bddc348 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_created_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_create_cases_for_security_findings_returns_created_response.yaml @@ -1,7 +1,7 @@ interactions: - request: - body: '{"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"}]}' + body: '{"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: accept: - application/json @@ -11,10 +11,10 @@ interactions: uri: https://api.datadoghq.com/api/v2/security/findings/cases response: body: - string: '{"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 + string: '{"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: @@ -23,7 +23,7 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"id":"7d16945b-baf8-411e-ab2a-20fe43af1ea3","relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]}},"type":"cases"}}' + body: '{"data":{"relationships":{"findings":{"data":[{"id":"YjdhNDM3N2QyNTFjYmUwYTY3NDdhMTg0YTk2Yjg5MDl-ZjNmMzAwOTFkZDNhNGQzYzI0MzgxNTk4MjRjZmE2NzE=","type":"findings"}]}},"type":"cases"}}' headers: accept: - '*/*' diff --git a/tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_finding_returns_created_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_finding_returns_created_response.frozen deleted file mode 100644 index 6c188712b9..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_finding_returns_created_response.frozen +++ /dev/null @@ -1 +0,0 @@ -2025-11-19T17:01:11.179Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_finding_returns_created_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_finding_returns_created_response.yaml deleted file mode 100644 index 181bef684e..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_finding_returns_created_response.yaml +++ /dev/null @@ -1,39 +0,0 @@ -interactions: -- request: - body: '{"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: - accept: - - application/json - content-type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues - response: - body: - string: '{"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 - status: - code: 201 - message: Created -- request: - body: '{"data":{"id":"6a773295-8729-4034-aada-53b64cbe02e7","relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]}},"type":"cases"}}' - headers: - accept: - - '*/*' - content-type: - - application/json - method: DELETE - uri: https://api.datadoghq.com/api/v2/security/findings/cases - response: - body: - string: '' - headers: {} - status: - code: 204 - message: No Content -version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_findings_returns_created_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_findings_returns_created_response.frozen deleted file mode 100644 index 8bb7a59bf9..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_findings_returns_created_response.frozen +++ /dev/null @@ -1 +0,0 @@ -2025-11-21T14:49:30.001Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_findings_returns_created_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_findings_returns_created_response.yaml deleted file mode 100644 index 96e75527fd..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_create_jira_issue_for_security_findings_returns_created_response.yaml +++ /dev/null @@ -1,39 +0,0 @@ -interactions: -- request: - body: '{"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: - accept: - - application/json - content-type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues - response: - body: - string: '{"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 - status: - code: 201 - message: Created -- request: - body: '{"data":{"id":"e469ceda-957a-4557-a607-9ff25032e9ca","relationships":{"findings":{"data":[{"id":"ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=","type":"findings"}]}},"type":"cases"}}' - headers: - accept: - - '*/*' - content-type: - - application/json - method: DELETE - uri: https://api.datadoghq.com/api/v2/security/findings/cases - response: - body: - string: '' - headers: {} - status: - code: 204 - message: No Content -version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_bad_request_response.frozen deleted file mode 100644 index ff98ffb1a1..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_bad_request_response.frozen +++ /dev/null @@ -1 +0,0 @@ -2025-11-20T12:01:47.295Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_bad_request_response.yaml deleted file mode 100644 index ca89455f91..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_bad_request_response.yaml +++ /dev/null @@ -1,21 +0,0 @@ -interactions: -- request: - body: '{"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: - accept: - - application/json - content-type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues - response: - body: - string: '{"errors":[{"status":"400","title":"Bad Request","detail":"no finding - provided"}]}' - headers: - content-type: - - application/vnd.api+json - status: - code: 400 - message: Bad Request -version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_created_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_created_response.frozen deleted file mode 100644 index e5b6d0d76b..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_created_response.frozen +++ /dev/null @@ -1 +0,0 @@ -2025-11-20T15:32:21.828Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_created_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_created_response.yaml deleted file mode 100644 index 4c55ad86cd..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_created_response.yaml +++ /dev/null @@ -1,42 +0,0 @@ -interactions: -- request: - body: '{"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: - accept: - - application/json - content-type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues - response: - body: - string: '{"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 - status: - code: 201 - message: Created -- request: - body: '{"data":{"id":"53e242c6-a7d6-46ad-9680-b8d14753f716","relationships":{"findings":{"data":[{"id":"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=","type":"findings"}]}},"type":"cases"}}' - headers: - accept: - - '*/*' - content-type: - - application/json - method: DELETE - uri: https://api.datadoghq.com/api/v2/security/findings/cases - response: - body: - string: '' - headers: {} - status: - code: 204 - message: No Content -version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_not_found_response.frozen deleted file mode 100644 index f0ed0dd3f1..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_not_found_response.frozen +++ /dev/null @@ -1 +0,0 @@ -2025-11-20T15:42:51.100Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_not_found_response.yaml deleted file mode 100644 index 48aa98ce11..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_create_jira_issues_for_security_findings_returns_not_found_response.yaml +++ /dev/null @@ -1,22 +0,0 @@ -interactions: -- request: - body: '{"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: - accept: - - application/json - content-type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues - response: - body: - string: '{"errors":[{"status":"404","title":"Not Found","detail":"project not - found"}]}' - headers: - content-type: - - application/vnd.api+json - status: - code: 404 - message: Not Found -version: 1 diff --git a/tests/v2/features/security_monitoring.feature b/tests/v2/features/security_monitoring.feature index 7dc352a7a4..b6d8bf921c 100644 --- a/tests/v2/features/security_monitoring.feature +++ b/tests/v2/features/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/tests/v2/features/undo.json b/tests/v2/features/undo.json index 396d523836..4d590026bd 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/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"