Skip to content

Commit 974d4cd

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 8997847 of spec repo
1 parent 1f858fd commit 974d4cd

File tree

4 files changed

+51
-9
lines changed

4 files changed

+51
-9
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79838,6 +79838,9 @@ paths:
7983879838
permissions:
7983979839
- security_monitoring_findings_write
7984079840
- appsec_vm_write
79841+
x-unstable: '**Note**: This endpoint is in beta and is subject to change.
79842+
79843+
Please check the documentation regularly for updates.'
7984179844
post:
7984279845
description: Create Jira issues for security findings. This operation creates
7984379846
a case in Datadog and a Jira issue linked to that case for bidirectional sync
@@ -79878,6 +79881,9 @@ paths:
7987879881
permissions:
7987979882
- security_monitoring_findings_write
7988079883
- appsec_vm_write
79884+
x-unstable: '**Note**: This endpoint is in beta and is subject to change.
79885+
79886+
Please check the documentation regularly for updates.'
7988179887
/api/v2/security/sboms:
7988279888
get:
7988379889
description: 'Get a list of assets SBOMs for an organization.

src/main/java/com/datadog/api/client/ApiClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,8 +706,10 @@ public class ApiClient {
706706
put("v2.getOpenAPI", false);
707707
put("v2.listAPIs", false);
708708
put("v2.updateOpenAPI", false);
709+
put("v2.attachJiraIssue", false);
709710
put("v2.cancelThreatHuntingJob", false);
710711
put("v2.convertJobResultToSignal", false);
712+
put("v2.createJiraIssues", false);
711713
put("v2.deleteThreatHuntingJob", false);
712714
put("v2.getFinding", false);
713715
put("v2.getRuleVersionHistory", false);

src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,13 @@ public CompletableFuture<FindingCaseResponse> attachJiraIssueAsync(AttachJiraIss
328328
*/
329329
public ApiResponse<FindingCaseResponse> attachJiraIssueWithHttpInfo(AttachJiraIssueRequest body)
330330
throws ApiException {
331+
// Check if unstable operation is enabled
332+
String operationId = "attachJiraIssue";
333+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
334+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
335+
} else {
336+
throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
337+
}
331338
Object localVarPostBody = body;
332339

333340
// verify the required parameter 'body' is set
@@ -370,6 +377,16 @@ public ApiResponse<FindingCaseResponse> attachJiraIssueWithHttpInfo(AttachJiraIs
370377
*/
371378
public CompletableFuture<ApiResponse<FindingCaseResponse>> attachJiraIssueWithHttpInfoAsync(
372379
AttachJiraIssueRequest body) {
380+
// Check if unstable operation is enabled
381+
String operationId = "attachJiraIssue";
382+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
383+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
384+
} else {
385+
CompletableFuture<ApiResponse<FindingCaseResponse>> result = new CompletableFuture<>();
386+
result.completeExceptionally(
387+
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
388+
return result;
389+
}
373390
Object localVarPostBody = body;
374391

375392
// verify the required parameter 'body' is set
@@ -1336,6 +1353,13 @@ public CompletableFuture<FindingCaseResponseArray> createJiraIssuesAsync(
13361353
*/
13371354
public ApiResponse<FindingCaseResponseArray> createJiraIssuesWithHttpInfo(
13381355
CreateJiraIssueRequestArray body) throws ApiException {
1356+
// Check if unstable operation is enabled
1357+
String operationId = "createJiraIssues";
1358+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
1359+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
1360+
} else {
1361+
throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
1362+
}
13391363
Object localVarPostBody = body;
13401364

13411365
// verify the required parameter 'body' is set
@@ -1378,6 +1402,16 @@ public ApiResponse<FindingCaseResponseArray> createJiraIssuesWithHttpInfo(
13781402
*/
13791403
public CompletableFuture<ApiResponse<FindingCaseResponseArray>> createJiraIssuesWithHttpInfoAsync(
13801404
CreateJiraIssueRequestArray body) {
1405+
// Check if unstable operation is enabled
1406+
String operationId = "createJiraIssues";
1407+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
1408+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
1409+
} else {
1410+
CompletableFuture<ApiResponse<FindingCaseResponseArray>> result = new CompletableFuture<>();
1411+
result.completeExceptionally(
1412+
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
1413+
return result;
1414+
}
13811415
Object localVarPostBody = body;
13821416

13831417
// verify the required parameter 'body' is set

src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Feature: Security Monitoring
99
And a valid "appKeyAuth" key in the system
1010
And an instance of "SecurityMonitoring" API
1111

12-
@team:DataDog/k9-investigation
12+
@skip @team:DataDog/k9-investigation
1313
Scenario: Attach security finding to a Jira issue returns "OK" response
1414
Given new "AttachJiraIssue" request
1515
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
3030
And the response "data.attributes.status_group" is equal to "SG_OPEN"
3131
And the response "data.attributes.insights" has item with field "resource_id" with value "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="
3232

33-
@team:DataDog/k9-investigation
33+
@skip @team:DataDog/k9-investigation
3434
Scenario: Attach security findings to a Jira issue returns "Bad Request" response
3535
Given new "AttachJiraIssue" request
3636
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"}}
3737
When the request is sent
3838
Then the response status is 400 Bad Request
3939

40-
@team:DataDog/k9-investigation
40+
@skip @team:DataDog/k9-investigation
4141
Scenario: Attach security findings to a Jira issue returns "Not Found" response
4242
Given new "AttachJiraIssue" request
4343
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"}}
4444
When the request is sent
4545
Then the response status is 404 Not Found
4646

47-
@team:DataDog/k9-investigation
47+
@skip @team:DataDog/k9-investigation
4848
Scenario: Attach security findings to a Jira issue returns "OK" response
4949
Given new "AttachJiraIssue" request
5050
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
258258
Then the response status is 200 OK
259259
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"
260260

261-
@team:DataDog/k9-investigation
261+
@skip @team:DataDog/k9-investigation
262262
Scenario: Create Jira issue for security finding returns "Created" response
263263
Given new "CreateJiraIssues" request
264264
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
274274
And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING"
275275
And the response "data[0].attributes.jira_issue.status" is equal to "COMPLETED"
276276

277-
@team:DataDog/k9-investigation
277+
@skip @team:DataDog/k9-investigation
278278
Scenario: Create Jira issue for security findings returns "Created" response
279279
Given new "CreateJiraIssues" request
280280
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
292292
And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING"
293293
And the response "data[0].attributes.jira_issue.status" is equal to "COMPLETED"
294294

295-
@team:DataDog/k9-investigation
295+
@skip @team:DataDog/k9-investigation
296296
Scenario: Create Jira issues for security findings returns "Bad Request" response
297297
Given new "CreateJiraIssues" request
298298
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"}]}
299299
When the request is sent
300300
Then the response status is 400 Bad Request
301301

302-
@team:DataDog/k9-investigation
302+
@skip @team:DataDog/k9-investigation
303303
Scenario: Create Jira issues for security findings returns "Created" response
304304
Given new "CreateJiraIssues" request
305305
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
323323
And the response "data[1].attributes.insights[0].type" is equal to "SECURITY_FINDING"
324324
And the response "data[1].attributes.jira_issue.status" is equal to "COMPLETED"
325325

326-
@team:DataDog/k9-investigation
326+
@skip @team:DataDog/k9-investigation
327327
Scenario: Create Jira issues for security findings returns "Not Found" response
328328
Given new "CreateJiraIssues" request
329329
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="}]}

0 commit comments

Comments
 (0)