Skip to content

Commit 67f8cb6

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit cfbf5cd of spec repo
1 parent 8631953 commit 67f8cb6

File tree

7 files changed

+87
-8
lines changed

7 files changed

+87
-8
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46982,6 +46982,14 @@ components:
4698246982
the queries to search signals in the signal explorer.
4698346983
example: env:staging status:low
4698446984
type: string
46985+
tags:
46986+
description: List of tags associated with the suppression rule.
46987+
example:
46988+
- technique:T1110-brute-force
46989+
- source:cloudtrail
46990+
items:
46991+
type: string
46992+
type: array
4698546993
update_date:
4698646994
description: A Unix millisecond timestamp given the update date of the suppression
4698746995
rule.
@@ -47043,6 +47051,14 @@ components:
4704347051
same syntax as the queries to search signals in the Signals Explorer.
4704447052
example: env:staging status:low
4704547053
type: string
47054+
tags:
47055+
description: List of tags associated with the suppression rule.
47056+
example:
47057+
- technique:T1110-brute-force
47058+
- source:cloudtrail
47059+
items:
47060+
type: string
47061+
type: array
4704647062
required:
4704747063
- name
4704847064
- enabled
@@ -47138,6 +47154,14 @@ components:
4713847154
the queries to search signals in the signal explorer.
4713947155
example: env:staging status:low
4714047156
type: string
47157+
tags:
47158+
description: List of tags associated with the suppression rule.
47159+
example:
47160+
- technique:T1110-brute-force
47161+
- source:cloudtrail
47162+
items:
47163+
type: string
47164+
type: array
4714147165
version:
4714247166
description: The current version of the suppression. This is optional, but
4714347167
it can help prevent concurrent modifications.

examples/v2_security-monitoring_CreateSecurityMonitoringSuppression.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ async fn main() {
2020
)
2121
.expiration_date(1638443471000)
2222
.start_date(1637493071000)
23-
.suppression_query("env:staging status:low".to_string()),
23+
.suppression_query("env:staging status:low".to_string())
24+
.tags(vec![
25+
"technique:T1110-brute-force".to_string(),
26+
"source:cloudtrail".to_string(),
27+
]),
2428
SecurityMonitoringSuppressionType::SUPPRESSIONS,
2529
),
2630
);

src/datadogV2/model/model_security_monitoring_suppression_attributes.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ pub struct SecurityMonitoringSuppressionAttributes {
4444
/// The suppression query of the suppression rule. If a signal matches this query, it is suppressed and not triggered. Same syntax as the queries to search signals in the signal explorer.
4545
#[serde(rename = "suppression_query")]
4646
pub suppression_query: Option<String>,
47+
/// List of tags associated with the suppression rule.
48+
#[serde(rename = "tags")]
49+
pub tags: Option<Vec<String>>,
4750
/// A Unix millisecond timestamp given the update date of the suppression rule.
4851
#[serde(rename = "update_date")]
4952
pub update_date: Option<i64>,
@@ -74,6 +77,7 @@ impl SecurityMonitoringSuppressionAttributes {
7477
rule_query: None,
7578
start_date: None,
7679
suppression_query: None,
80+
tags: None,
7781
update_date: None,
7882
updater: None,
7983
version: None,
@@ -137,6 +141,11 @@ impl SecurityMonitoringSuppressionAttributes {
137141
self
138142
}
139143

144+
pub fn tags(mut self, value: Vec<String>) -> Self {
145+
self.tags = Some(value);
146+
self
147+
}
148+
140149
pub fn update_date(mut self, value: i64) -> Self {
141150
self.update_date = Some(value);
142151
self
@@ -195,6 +204,7 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionAttributes {
195204
let mut rule_query: Option<String> = None;
196205
let mut start_date: Option<i64> = None;
197206
let mut suppression_query: Option<String> = None;
207+
let mut tags: Option<Vec<String>> = None;
198208
let mut update_date: Option<i64> = None;
199209
let mut updater: Option<crate::datadogV2::model::SecurityMonitoringUser> = None;
200210
let mut version: Option<i32> = None;
@@ -277,6 +287,12 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionAttributes {
277287
suppression_query =
278288
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
279289
}
290+
"tags" => {
291+
if v.is_null() {
292+
continue;
293+
}
294+
tags = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
295+
}
280296
"update_date" => {
281297
if v.is_null() {
282298
continue;
@@ -316,6 +332,7 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionAttributes {
316332
rule_query,
317333
start_date,
318334
suppression_query,
335+
tags,
319336
update_date,
320337
updater,
321338
version,

src/datadogV2/model/model_security_monitoring_suppression_create_attributes.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ pub struct SecurityMonitoringSuppressionCreateAttributes {
3535
/// The suppression query of the suppression rule. If a signal matches this query, it is suppressed and is not triggered. It uses the same syntax as the queries to search signals in the Signals Explorer.
3636
#[serde(rename = "suppression_query")]
3737
pub suppression_query: Option<String>,
38+
/// List of tags associated with the suppression rule.
39+
#[serde(rename = "tags")]
40+
pub tags: Option<Vec<String>>,
3841
#[serde(flatten)]
3942
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
4043
#[serde(skip)]
@@ -57,6 +60,7 @@ impl SecurityMonitoringSuppressionCreateAttributes {
5760
rule_query,
5861
start_date: None,
5962
suppression_query: None,
63+
tags: None,
6064
additional_properties: std::collections::BTreeMap::new(),
6165
_unparsed: false,
6266
}
@@ -87,6 +91,11 @@ impl SecurityMonitoringSuppressionCreateAttributes {
8791
self
8892
}
8993

94+
pub fn tags(mut self, value: Vec<String>) -> Self {
95+
self.tags = Some(value);
96+
self
97+
}
98+
9099
pub fn additional_properties(
91100
mut self,
92101
value: std::collections::BTreeMap<String, serde_json::Value>,
@@ -121,6 +130,7 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionCreateAttributes {
121130
let mut rule_query: Option<String> = None;
122131
let mut start_date: Option<i64> = None;
123132
let mut suppression_query: Option<String> = None;
133+
let mut tags: Option<Vec<String>> = None;
124134
let mut additional_properties: std::collections::BTreeMap<
125135
String,
126136
serde_json::Value,
@@ -172,6 +182,12 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionCreateAttributes {
172182
suppression_query =
173183
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
174184
}
185+
"tags" => {
186+
if v.is_null() {
187+
continue;
188+
}
189+
tags = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
190+
}
175191
&_ => {
176192
if let Ok(value) = serde_json::from_value(v.clone()) {
177193
additional_properties.insert(k, value);
@@ -192,6 +208,7 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionCreateAttributes {
192208
rule_query,
193209
start_date,
194210
suppression_query,
211+
tags,
195212
additional_properties,
196213
_unparsed,
197214
};

src/datadogV2/model/model_security_monitoring_suppression_update_attributes.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ pub struct SecurityMonitoringSuppressionUpdateAttributes {
4343
/// The suppression query of the suppression rule. If a signal matches this query, it is suppressed and not triggered. Same syntax as the queries to search signals in the signal explorer.
4444
#[serde(rename = "suppression_query")]
4545
pub suppression_query: Option<String>,
46+
/// List of tags associated with the suppression rule.
47+
#[serde(rename = "tags")]
48+
pub tags: Option<Vec<String>>,
4649
/// The current version of the suppression. This is optional, but it can help prevent concurrent modifications.
4750
#[serde(rename = "version")]
4851
pub version: Option<i32>,
@@ -64,6 +67,7 @@ impl SecurityMonitoringSuppressionUpdateAttributes {
6467
rule_query: None,
6568
start_date: None,
6669
suppression_query: None,
70+
tags: None,
6771
version: None,
6872
additional_properties: std::collections::BTreeMap::new(),
6973
_unparsed: false,
@@ -110,6 +114,11 @@ impl SecurityMonitoringSuppressionUpdateAttributes {
110114
self
111115
}
112116

117+
pub fn tags(mut self, value: Vec<String>) -> Self {
118+
self.tags = Some(value);
119+
self
120+
}
121+
113122
pub fn version(mut self, value: i32) -> Self {
114123
self.version = Some(value);
115124
self
@@ -155,6 +164,7 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionUpdateAttributes {
155164
let mut rule_query: Option<String> = None;
156165
let mut start_date: Option<Option<i64>> = None;
157166
let mut suppression_query: Option<String> = None;
167+
let mut tags: Option<Vec<String>> = None;
158168
let mut version: Option<i32> = None;
159169
let mut additional_properties: std::collections::BTreeMap<
160170
String,
@@ -210,6 +220,12 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionUpdateAttributes {
210220
suppression_query =
211221
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
212222
}
223+
"tags" => {
224+
if v.is_null() {
225+
continue;
226+
}
227+
tags = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
228+
}
213229
"version" => {
214230
if v.is_null() {
215231
continue;
@@ -233,6 +249,7 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionUpdateAttributes {
233249
rule_query,
234250
start_date,
235251
suppression_query,
252+
tags,
236253
version,
237254
additional_properties,
238255
_unparsed,

tests/scenarios/features/v2/given.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@
967967
"parameters": [
968968
{
969969
"name": "body",
970-
"value": "{\n \"data\": {\n \"type\": \"suppressions\",\n \"attributes\": {\n \"enabled\": true,\n \"name\": \"{{ unique }}\",\n \"description\": \"{{ unique }}\",\n \"rule_query\": \"source:cloudtrail\",\n \"suppression_query\": \"env:test\"\n }\n }\n}"
970+
"value": "{\n \"data\": {\n \"type\": \"suppressions\",\n \"attributes\": {\n \"enabled\": true,\n \"name\": \"{{ unique }}\",\n \"description\": \"{{ unique }}\",\n \"rule_query\": \"source:cloudtrail\",\n \"suppression_query\": \"env:test\",\n \"tags\": [\"technique:T1110-brute-force\", \"source:cloudtrail\"]\n }\n }\n}"
971971
}
972972
],
973973
"step": "there is a valid \"suppression\" in the system",

tests/scenarios/features/v2/security_monitoring.feature

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -376,21 +376,21 @@ Feature: Security Monitoring
376376
@generated @skip @team:DataDog/k9-cloud-security-platform
377377
Scenario: Create a suppression rule returns "Bad Request" response
378378
Given new "CreateSecurityMonitoringSuppression" request
379-
And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
379+
And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low", "tags": ["technique:T1110-brute-force", "source:cloudtrail"]}, "type": "suppressions"}}
380380
When the request is sent
381381
Then the response status is 400 Bad Request
382382

383383
@generated @skip @team:DataDog/k9-cloud-security-platform
384384
Scenario: Create a suppression rule returns "Conflict" response
385385
Given new "CreateSecurityMonitoringSuppression" request
386-
And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
386+
And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low", "tags": ["technique:T1110-brute-force", "source:cloudtrail"]}, "type": "suppressions"}}
387387
When the request is sent
388388
Then the response status is 409 Conflict
389389

390390
@skip-validation @team:DataDog/k9-cloud-security-platform
391391
Scenario: Create a suppression rule returns "OK" response
392392
Given new "CreateSecurityMonitoringSuppression" request
393-
And body with value {"data": {"attributes": {"description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "start_date": {{ timestamp('now + 10d') }}000, "expiration_date": {{ timestamp('now + 21d') }}000, "name": "{{ unique }}", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
393+
And body with value {"data": {"attributes": {"description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "start_date": {{ timestamp('now + 10d') }}000, "expiration_date": {{ timestamp('now + 21d') }}000, "name": "{{ unique }}", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low", "tags": ["technique:T1110-brute-force", "source:cloudtrail"]}, "type": "suppressions"}}
394394
When the request is sent
395395
Then the response status is 200 OK
396396
And the response "data.type" is equal to "suppressions"
@@ -1474,23 +1474,23 @@ Feature: Security Monitoring
14741474
Scenario: Update a suppression rule returns "Bad Request" response
14751475
Given new "UpdateSecurityMonitoringSuppression" request
14761476
And request contains "suppression_id" parameter from "REPLACE.ME"
1477-
And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
1477+
And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low", "tags": ["technique:T1110-brute-force", "source:cloudtrail"]}, "type": "suppressions"}}
14781478
When the request is sent
14791479
Then the response status is 400 Bad Request
14801480

14811481
@generated @skip @team:DataDog/k9-cloud-security-platform
14821482
Scenario: Update a suppression rule returns "Concurrent Modification" response
14831483
Given new "UpdateSecurityMonitoringSuppression" request
14841484
And request contains "suppression_id" parameter from "REPLACE.ME"
1485-
And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
1485+
And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low", "tags": ["technique:T1110-brute-force", "source:cloudtrail"]}, "type": "suppressions"}}
14861486
When the request is sent
14871487
Then the response status is 409 Concurrent Modification
14881488

14891489
@generated @skip @team:DataDog/k9-cloud-security-platform
14901490
Scenario: Update a suppression rule returns "Not Found" response
14911491
Given new "UpdateSecurityMonitoringSuppression" request
14921492
And request contains "suppression_id" parameter from "REPLACE.ME"
1493-
And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
1493+
And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low", "tags": ["technique:T1110-brute-force", "source:cloudtrail"]}, "type": "suppressions"}}
14941494
When the request is sent
14951495
Then the response status is 404 Not Found
14961496

0 commit comments

Comments
 (0)