Skip to content

Commit 4aa1ffa

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit eec3803 of spec repo (#3425)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent baefbfc commit 4aa1ffa

32 files changed

Lines changed: 3604 additions & 1 deletion

.generator/schemas/v2/openapi.yaml

Lines changed: 484 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Attach security findings to a ServiceNow ticket returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.attach_service_now_ticket".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
8+
9+
body = DatadogAPIClient::V2::AttachServiceNowTicketRequest.new({
10+
data: DatadogAPIClient::V2::AttachServiceNowTicketRequestData.new({
11+
attributes: DatadogAPIClient::V2::AttachServiceNowTicketRequestDataAttributes.new({
12+
servicenow_ticket_url: "https://example.service-now.com/now/nav/ui/classic/params/target/incident.do?sys_id=abcdef0123456789abcdef0123456789",
13+
}),
14+
relationships: DatadogAPIClient::V2::AttachServiceNowTicketRequestDataRelationships.new({
15+
findings: DatadogAPIClient::V2::Findings.new({
16+
data: [
17+
DatadogAPIClient::V2::FindingData.new({
18+
id: "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==",
19+
type: DatadogAPIClient::V2::FindingDataType::FINDINGS,
20+
}),
21+
],
22+
}),
23+
project: DatadogAPIClient::V2::CaseManagementProject.new({
24+
data: DatadogAPIClient::V2::CaseManagementProjectData.new({
25+
id: "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
26+
type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS,
27+
}),
28+
}),
29+
}),
30+
type: DatadogAPIClient::V2::ServiceNowTicketsDataType::SERVICENOW_TICKETS,
31+
}),
32+
})
33+
p api_instance.attach_service_now_ticket(body)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Create ServiceNow tickets for security findings returns "Created" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.create_service_now_tickets".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
8+
9+
body = DatadogAPIClient::V2::CreateServiceNowTicketRequestArray.new({
10+
data: [
11+
DatadogAPIClient::V2::CreateServiceNowTicketRequestData.new({
12+
attributes: DatadogAPIClient::V2::CreateServiceNowTicketRequestDataAttributes.new({
13+
assignee_id: "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0",
14+
description: "A description of the ServiceNow ticket.",
15+
priority: DatadogAPIClient::V2::CasePriority::NOT_DEFINED,
16+
title: "A title for the ServiceNow ticket.",
17+
}),
18+
relationships: DatadogAPIClient::V2::CreateServiceNowTicketRequestDataRelationships.new({
19+
findings: DatadogAPIClient::V2::Findings.new({
20+
data: [
21+
DatadogAPIClient::V2::FindingData.new({
22+
id: "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==",
23+
type: DatadogAPIClient::V2::FindingDataType::FINDINGS,
24+
}),
25+
],
26+
}),
27+
project: DatadogAPIClient::V2::CaseManagementProject.new({
28+
data: DatadogAPIClient::V2::CaseManagementProjectData.new({
29+
id: "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
30+
type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS,
31+
}),
32+
}),
33+
}),
34+
type: DatadogAPIClient::V2::ServiceNowTicketsDataType::SERVICENOW_TICKETS,
35+
}),
36+
],
37+
})
38+
p api_instance.create_service_now_tickets(body)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Assign or unassign security findings returns "Accepted" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.update_findings_assignee".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
8+
9+
body = DatadogAPIClient::V2::AssigneeRequest.new({
10+
data: DatadogAPIClient::V2::AssigneeRequestData.new({
11+
attributes: DatadogAPIClient::V2::AssigneeRequestDataAttributes.new({
12+
assignee_id: "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0",
13+
}),
14+
id: "00000000-0000-0000-0000-000000000001",
15+
relationships: DatadogAPIClient::V2::AssigneeRequestDataRelationships.new({
16+
findings: DatadogAPIClient::V2::Findings.new({
17+
data: [
18+
DatadogAPIClient::V2::FindingData.new({
19+
id: "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==",
20+
type: DatadogAPIClient::V2::FindingDataType::FINDINGS,
21+
}),
22+
],
23+
}),
24+
}),
25+
type: DatadogAPIClient::V2::AssigneeDataType::ASSIGNEE,
26+
}),
27+
})
28+
p api_instance.update_findings_assignee(body)

features/scenarios_model_mapping.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2008,6 +2008,9 @@
20082008
"page_limit" => "Integer",
20092009
"sort" => "SecurityFindingsSort",
20102010
},
2011+
"v2.UpdateFindingsAssignee" => {
2012+
"body" => "AssigneeRequest",
2013+
},
20112014
"v2.DetachCase" => {
20122015
"body" => "DetachCaseRequest",
20132016
},
@@ -2030,6 +2033,12 @@
20302033
"v2.SearchSecurityFindings" => {
20312034
"body" => "SecurityFindingsSearchRequest",
20322035
},
2036+
"v2.AttachServiceNowTicket" => {
2037+
"body" => "AttachServiceNowTicketRequest",
2038+
},
2039+
"v2.CreateServiceNowTickets" => {
2040+
"body" => "CreateServiceNowTicketRequestArray",
2041+
},
20332042
"v2.ListAssetsSBOMs" => {
20342043
"page_token" => "String",
20352044
"page_number" => "Integer",

features/v2/security_monitoring.feature

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,30 @@ Feature: Security Monitoring
4141
When the request is sent
4242
Then the response status is 200 OK
4343

44+
@generated @skip @team:DataDog/k9-investigation
45+
Scenario: Assign or unassign security findings returns "Accepted" response
46+
Given operation "UpdateFindingsAssignee" enabled
47+
And new "UpdateFindingsAssignee" request
48+
And body with value {"data": {"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0"}, "id": "00000000-0000-0000-0000-000000000001", "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}}, "type": "assignee"}}
49+
When the request is sent
50+
Then the response status is 202 Accepted
51+
52+
@generated @skip @team:DataDog/k9-investigation
53+
Scenario: Assign or unassign security findings returns "Bad Request" response
54+
Given operation "UpdateFindingsAssignee" enabled
55+
And new "UpdateFindingsAssignee" request
56+
And body with value {"data": {"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0"}, "id": "00000000-0000-0000-0000-000000000001", "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}}, "type": "assignee"}}
57+
When the request is sent
58+
Then the response status is 400 Bad Request
59+
60+
@generated @skip @team:DataDog/k9-investigation
61+
Scenario: Assign or unassign security findings returns "Not Found" response
62+
Given operation "UpdateFindingsAssignee" enabled
63+
And new "UpdateFindingsAssignee" request
64+
And body with value {"data": {"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0"}, "id": "00000000-0000-0000-0000-000000000001", "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}}, "type": "assignee"}}
65+
When the request is sent
66+
Then the response status is 404 Not Found
67+
4468
@team:DataDog/k9-investigation
4569
Scenario: Attach security finding to a Jira issue returns "OK" response
4670
Given new "AttachJiraIssue" request
@@ -87,6 +111,30 @@ Feature: Security Monitoring
87111
And the response "data.attributes.insights" has item with field "resource_id" with value "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM="
88112
And the response "data.attributes.jira_issue.result.issue_url" is equal to "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"
89113

114+
@generated @skip @team:DataDog/k9-investigation
115+
Scenario: Attach security findings to a ServiceNow ticket returns "Bad Request" response
116+
Given operation "AttachServiceNowTicket" enabled
117+
And new "AttachServiceNowTicket" request
118+
And body with value {"data": {"attributes": {"servicenow_ticket_url": "https://example.service-now.com/now/nav/ui/classic/params/target/incident.do?sys_id=abcdef0123456789abcdef0123456789"}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "servicenow_tickets"}}
119+
When the request is sent
120+
Then the response status is 400 Bad Request
121+
122+
@generated @skip @team:DataDog/k9-investigation
123+
Scenario: Attach security findings to a ServiceNow ticket returns "Not Found" response
124+
Given operation "AttachServiceNowTicket" enabled
125+
And new "AttachServiceNowTicket" request
126+
And body with value {"data": {"attributes": {"servicenow_ticket_url": "https://example.service-now.com/now/nav/ui/classic/params/target/incident.do?sys_id=abcdef0123456789abcdef0123456789"}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "servicenow_tickets"}}
127+
When the request is sent
128+
Then the response status is 404 Not Found
129+
130+
@generated @skip @team:DataDog/k9-investigation
131+
Scenario: Attach security findings to a ServiceNow ticket returns "OK" response
132+
Given operation "AttachServiceNowTicket" enabled
133+
And new "AttachServiceNowTicket" request
134+
And body with value {"data": {"attributes": {"servicenow_ticket_url": "https://example.service-now.com/now/nav/ui/classic/params/target/incident.do?sys_id=abcdef0123456789abcdef0123456789"}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "servicenow_tickets"}}
135+
When the request is sent
136+
Then the response status is 200 OK
137+
90138
@team:DataDog/k9-investigation
91139
Scenario: Attach security findings to a case returns "Bad Request" response
92140
Given new "AttachCase" request
@@ -482,6 +530,30 @@ Feature: Security Monitoring
482530
When the request is sent
483531
Then the response status is 404 Not Found
484532

533+
@generated @skip @team:DataDog/k9-investigation
534+
Scenario: Create ServiceNow tickets for security findings returns "Bad Request" response
535+
Given operation "CreateServiceNowTickets" enabled
536+
And new "CreateServiceNowTickets" request
537+
And body with value {"data": [{"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", "description": "A description of the ServiceNow ticket.", "priority": "NOT_DEFINED", "title": "A title for the ServiceNow ticket."}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "servicenow_tickets"}]}
538+
When the request is sent
539+
Then the response status is 400 Bad Request
540+
541+
@generated @skip @team:DataDog/k9-investigation
542+
Scenario: Create ServiceNow tickets for security findings returns "Created" response
543+
Given operation "CreateServiceNowTickets" enabled
544+
And new "CreateServiceNowTickets" request
545+
And body with value {"data": [{"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", "description": "A description of the ServiceNow ticket.", "priority": "NOT_DEFINED", "title": "A title for the ServiceNow ticket."}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "servicenow_tickets"}]}
546+
When the request is sent
547+
Then the response status is 201 Created
548+
549+
@generated @skip @team:DataDog/k9-investigation
550+
Scenario: Create ServiceNow tickets for security findings returns "Not Found" response
551+
Given operation "CreateServiceNowTickets" enabled
552+
And new "CreateServiceNowTickets" request
553+
And body with value {"data": [{"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", "description": "A description of the ServiceNow ticket.", "priority": "NOT_DEFINED", "title": "A title for the ServiceNow ticket."}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "servicenow_tickets"}]}
554+
When the request is sent
555+
Then the response status is 404 Not Found
556+
485557
@skip-validation @team:DataDog/k9-cloud-siem
486558
Scenario: Create a cloud_configuration rule returns "OK" response
487559
Given new "CreateSecurityMonitoringRule" request

features/v2/undo.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6414,6 +6414,12 @@
64146414
"type": "safe"
64156415
}
64166416
},
6417+
"UpdateFindingsAssignee": {
6418+
"tag": "Security Monitoring",
6419+
"undo": {
6420+
"type": "idempotent"
6421+
}
6422+
},
64176423
"DetachCase": {
64186424
"tag": "Security Monitoring",
64196425
"undo": {
@@ -6470,6 +6476,25 @@
64706476
"type": "safe"
64716477
}
64726478
},
6479+
"AttachServiceNowTicket": {
6480+
"tag": "Security Monitoring",
6481+
"undo": {
6482+
"type": "idempotent"
6483+
}
6484+
},
6485+
"CreateServiceNowTickets": {
6486+
"tag": "Security Monitoring",
6487+
"undo": {
6488+
"operationId": "DetachCase",
6489+
"parameters": [
6490+
{
6491+
"name": "body",
6492+
"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}"
6493+
}
6494+
],
6495+
"type": "unsafe"
6496+
}
6497+
},
64736498
"ListAssetsSBOMs": {
64746499
"tag": "Security Monitoring",
64756500
"undo": {

lib/datadog_api_client/configuration.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ def initialize
325325
"v2.get_aws_cloud_auth_persona_mapping": false,
326326
"v2.list_aws_cloud_auth_persona_mappings": false,
327327
"v2.activate_content_pack": false,
328+
"v2.attach_service_now_ticket": false,
328329
"v2.batch_get_security_monitoring_dataset_dependencies": false,
329330
"v2.bulk_create_sample_log_generation_subscriptions": false,
330331
"v2.bulk_export_security_monitoring_terraform_resources": false,
@@ -334,6 +335,7 @@ def initialize
334335
"v2.create_sample_log_generation_subscription": false,
335336
"v2.create_security_monitoring_dataset": false,
336337
"v2.create_security_monitoring_integration_config": false,
338+
"v2.create_service_now_tickets": false,
337339
"v2.create_static_analysis_ast": false,
338340
"v2.create_static_analysis_server_analysis": false,
339341
"v2.deactivate_content_pack": false,
@@ -375,6 +377,7 @@ def initialize
375377
"v2.mute_findings": false,
376378
"v2.run_historical_job": false,
377379
"v2.search_security_monitoring_histsignals": false,
380+
"v2.update_findings_assignee": false,
378381
"v2.update_security_monitoring_dataset": false,
379382
"v2.update_security_monitoring_integration_config": false,
380383
"v2.validate_security_monitoring_integration_config": false,

lib/datadog_api_client/inflector.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,6 +1474,16 @@ def overrides
14741474
"v2.asset_risks" => "AssetRisks",
14751475
"v2.asset_type" => "AssetType",
14761476
"v2.asset_version" => "AssetVersion",
1477+
"v2.assignee_data_type" => "AssigneeDataType",
1478+
"v2.assignee_request" => "AssigneeRequest",
1479+
"v2.assignee_request_data" => "AssigneeRequestData",
1480+
"v2.assignee_request_data_attributes" => "AssigneeRequestDataAttributes",
1481+
"v2.assignee_request_data_relationships" => "AssigneeRequestDataRelationships",
1482+
"v2.assignee_response" => "AssigneeResponse",
1483+
"v2.assignee_response_data" => "AssigneeResponseData",
1484+
"v2.assignee_response_data_attributes" => "AssigneeResponseDataAttributes",
1485+
"v2.assignee_response_meta" => "AssigneeResponseMeta",
1486+
"v2.assignment_result" => "AssignmentResult",
14771487
"v2.assign_seats_user_request" => "AssignSeatsUserRequest",
14781488
"v2.assign_seats_user_request_data" => "AssignSeatsUserRequestData",
14791489
"v2.assign_seats_user_request_data_attributes" => "AssignSeatsUserRequestDataAttributes",
@@ -1495,6 +1505,10 @@ def overrides
14951505
"v2.attachment_data_attributes_attachment_type" => "AttachmentDataAttributesAttachmentType",
14961506
"v2.attachment_data_relationships" => "AttachmentDataRelationships",
14971507
"v2.attachment_included" => "AttachmentIncluded",
1508+
"v2.attach_service_now_ticket_request" => "AttachServiceNowTicketRequest",
1509+
"v2.attach_service_now_ticket_request_data" => "AttachServiceNowTicketRequestData",
1510+
"v2.attach_service_now_ticket_request_data_attributes" => "AttachServiceNowTicketRequestDataAttributes",
1511+
"v2.attach_service_now_ticket_request_data_relationships" => "AttachServiceNowTicketRequestDataRelationships",
14981512
"v2.audit_logs_event" => "AuditLogsEvent",
14991513
"v2.audit_logs_event_attributes" => "AuditLogsEventAttributes",
15001514
"v2.audit_logs_events_response" => "AuditLogsEventsResponse",
@@ -2433,6 +2447,10 @@ def overrides
24332447
"v2.create_ruleset_request_data_attributes_rules_items_reference_table" => "CreateRulesetRequestDataAttributesRulesItemsReferenceTable",
24342448
"v2.create_ruleset_request_data_attributes_rules_items_reference_table_field_pairs_items" => "CreateRulesetRequestDataAttributesRulesItemsReferenceTableFieldPairsItems",
24352449
"v2.create_ruleset_request_data_type" => "CreateRulesetRequestDataType",
2450+
"v2.create_service_now_ticket_request_array" => "CreateServiceNowTicketRequestArray",
2451+
"v2.create_service_now_ticket_request_data" => "CreateServiceNowTicketRequestData",
2452+
"v2.create_service_now_ticket_request_data_attributes" => "CreateServiceNowTicketRequestDataAttributes",
2453+
"v2.create_service_now_ticket_request_data_relationships" => "CreateServiceNowTicketRequestDataRelationships",
24362454
"v2.create_status_page_request" => "CreateStatusPageRequest",
24372455
"v2.create_status_page_request_data" => "CreateStatusPageRequestData",
24382456
"v2.create_status_page_request_data_attributes" => "CreateStatusPageRequestDataAttributes",
@@ -3090,6 +3108,8 @@ def overrides
30903108
"v2.finding_mute_reason" => "FindingMuteReason",
30913109
"v2.finding_rule" => "FindingRule",
30923110
"v2.findings" => "Findings",
3111+
"v2.finding_service_now_ticket" => "FindingServiceNowTicket",
3112+
"v2.finding_service_now_ticket_result" => "FindingServiceNowTicketResult",
30933113
"v2.finding_status" => "FindingStatus",
30943114
"v2.finding_type" => "FindingType",
30953115
"v2.finding_vulnerability_type" => "FindingVulnerabilityType",
@@ -6241,6 +6261,7 @@ def overrides
62416261
"v2.service_now_ticket_create_request" => "ServiceNowTicketCreateRequest",
62426262
"v2.service_now_ticket_resource_type" => "ServiceNowTicketResourceType",
62436263
"v2.service_now_ticket_result" => "ServiceNowTicketResult",
6264+
"v2.service_now_tickets_data_type" => "ServiceNowTicketsDataType",
62446265
"v2.service_now_user_attributes" => "ServiceNowUserAttributes",
62456266
"v2.service_now_user_data" => "ServiceNowUserData",
62466267
"v2.service_now_users_response" => "ServiceNowUsersResponse",

0 commit comments

Comments
 (0)