From 974d4cdca1bdee9b74f8f32286b09a71c09bf463 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 9 Dec 2025 16:20:14 +0000 Subject: [PATCH] Regenerate client from commit 8997847 of spec repo --- .generator/schemas/v2/openapi.yaml | 6 ++++ .../com/datadog/api/client/ApiClient.java | 2 ++ .../client/v2/api/SecurityMonitoringApi.java | 34 +++++++++++++++++++ .../client/v2/api/security_monitoring.feature | 18 +++++----- 4 files changed, 51 insertions(+), 9 deletions(-) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index dad178ca22d..7760d58c049 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -79838,6 +79838,9 @@ paths: permissions: - security_monitoring_findings_write - appsec_vm_write + x-unstable: '**Note**: This endpoint is in beta and is subject to change. + + 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 @@ -79878,6 +79881,9 @@ paths: permissions: - security_monitoring_findings_write - appsec_vm_write + x-unstable: '**Note**: This endpoint is in beta and is subject to change. + + Please check the documentation regularly for updates.' /api/v2/security/sboms: get: description: 'Get a list of assets SBOMs for an organization. diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 5131c7ae601..ce819d646f5 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -706,8 +706,10 @@ public class ApiClient { put("v2.getOpenAPI", false); put("v2.listAPIs", false); put("v2.updateOpenAPI", false); + put("v2.attachJiraIssue", false); put("v2.cancelThreatHuntingJob", false); put("v2.convertJobResultToSignal", false); + put("v2.createJiraIssues", false); put("v2.deleteThreatHuntingJob", false); put("v2.getFinding", false); put("v2.getRuleVersionHistory", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java b/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java index 50115900a58..c261e96ae68 100644 --- a/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java @@ -328,6 +328,13 @@ public CompletableFuture attachJiraIssueAsync(AttachJiraIss */ public ApiResponse attachJiraIssueWithHttpInfo(AttachJiraIssueRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "attachJiraIssue"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } Object localVarPostBody = body; // verify the required parameter 'body' is set @@ -370,6 +377,16 @@ public ApiResponse attachJiraIssueWithHttpInfo(AttachJiraIs */ public CompletableFuture> attachJiraIssueWithHttpInfoAsync( AttachJiraIssueRequest body) { + // Check if unstable operation is enabled + String operationId = "attachJiraIssue"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = body; // verify the required parameter 'body' is set @@ -1336,6 +1353,13 @@ public CompletableFuture createJiraIssuesAsync( */ public ApiResponse createJiraIssuesWithHttpInfo( CreateJiraIssueRequestArray body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "createJiraIssues"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } Object localVarPostBody = body; // verify the required parameter 'body' is set @@ -1378,6 +1402,16 @@ public ApiResponse createJiraIssuesWithHttpInfo( */ public CompletableFuture> createJiraIssuesWithHttpInfoAsync( CreateJiraIssueRequestArray body) { + // Check if unstable operation is enabled + String operationId = "createJiraIssues"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = body; // verify the required parameter 'body' is set diff --git a/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature b/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature index 5599d509afc..7dc352a7a4e 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature @@ -9,7 +9,7 @@ Feature: Security Monitoring And a valid "appKeyAuth" key in the system And an instance of "SecurityMonitoring" API - @team:DataDog/k9-investigation + @skip @team:DataDog/k9-investigation Scenario: Attach security finding to a Jira issue returns "OK" response Given new "AttachJiraIssue" request And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": [{"id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} @@ -30,21 +30,21 @@ Feature: Security Monitoring And the response "data.attributes.status_group" is equal to "SG_OPEN" And the response "data.attributes.insights" has item with field "resource_id" with value "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" - @team:DataDog/k9-investigation + @skip @team:DataDog/k9-investigation Scenario: Attach security findings to a Jira issue returns "Bad Request" response Given new "AttachJiraIssue" request And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": []}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} When the request is sent Then the response status is 400 Bad Request - @team:DataDog/k9-investigation + @skip @team:DataDog/k9-investigation Scenario: Attach security findings to a Jira issue returns "Not Found" response Given new "AttachJiraIssue" request And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": [{"id": "wrong-finding-id", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} When the request is sent Then the response status is 404 Not Found - @team:DataDog/k9-investigation + @skip @team:DataDog/k9-investigation Scenario: Attach security findings to a Jira issue returns "OK" response Given new "AttachJiraIssue" request And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": [{"id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", "type": "findings"}, {"id": "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} @@ -258,7 +258,7 @@ 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" - @team:DataDog/k9-investigation + @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="}]} @@ -274,7 +274,7 @@ Feature: Security Monitoring 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" - @team:DataDog/k9-investigation + @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="}]} @@ -292,14 +292,14 @@ Feature: Security Monitoring 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" - @team:DataDog/k9-investigation + @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"}]} When the request is sent Then the response status is 400 Bad Request - @team:DataDog/k9-investigation + @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="}]} @@ -323,7 +323,7 @@ Feature: Security Monitoring 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" - @team:DataDog/k9-investigation + @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="}]}