Skip to content

Commit dbfa7f7

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 2a9c644 of spec repo
1 parent 37d739b commit dbfa7f7

File tree

59 files changed

+303
-186
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+303
-186
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10236,8 +10236,11 @@ components:
1023610236
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActionSet'
1023710237
type: object
1023810238
CloudWorkloadSecurityAgentRuleActionHash:
10239-
additionalProperties: {}
10240-
description: An empty object indicating the hash action
10239+
description: Hash file specified by the field attribute
10240+
properties:
10241+
field:
10242+
description: The field of the hash action
10243+
type: string
1024110244
type: object
1024210245
CloudWorkloadSecurityAgentRuleActionMetadata:
1024310246
description: The metadata action applied on the scope matching the rule

examples/v2_csm-threats_CreateCSMThreatsAgentRule_1295653933.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
use datadog_api_client::datadog;
33
use datadog_api_client::datadogV2::api_csm_threats::CSMThreatsAPI;
44
use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleAction;
5+
use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleActionHash;
56
use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleActionSet;
67
use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleCreateAttributes;
78
use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleCreateData;
89
use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleCreateRequest;
910
use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleType;
10-
use std::collections::BTreeMap;
1111

1212
#[tokio::main]
1313
async fn main() {
@@ -27,7 +27,9 @@ async fn main() {
2727
.scope("process".to_string())
2828
.value("test_value".to_string()),
2929
),
30-
CloudWorkloadSecurityAgentRuleAction::new().hash(BTreeMap::from([])),
30+
CloudWorkloadSecurityAgentRuleAction::new().hash(
31+
CloudWorkloadSecurityAgentRuleActionHash::new().field("exec.file".to_string()),
32+
),
3133
]))
3234
.description("My Agent rule with set action".to_string())
3335
.enabled(true)

examples/v2_csm-threats_CreateCSMThreatsAgentRule_1363354233.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async fn main() {
2222
.actions(Some(vec![CloudWorkloadSecurityAgentRuleAction::new().set(
2323
CloudWorkloadSecurityAgentRuleActionSet::new()
2424
.default_value("/dev/null".to_string())
25-
.expression("open.file.path".to_string())
25+
.expression("exec.file.path".to_string())
2626
.name("test_set".to_string())
2727
.scope("process".to_string()),
2828
)]))

src/datadogV2/model/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4748,6 +4748,8 @@ pub mod model_cloud_workload_security_agent_rule_attributes;
47484748
pub use self::model_cloud_workload_security_agent_rule_attributes::CloudWorkloadSecurityAgentRuleAttributes;
47494749
pub mod model_cloud_workload_security_agent_rule_action;
47504750
pub use self::model_cloud_workload_security_agent_rule_action::CloudWorkloadSecurityAgentRuleAction;
4751+
pub mod model_cloud_workload_security_agent_rule_action_hash;
4752+
pub use self::model_cloud_workload_security_agent_rule_action_hash::CloudWorkloadSecurityAgentRuleActionHash;
47514753
pub mod model_cloud_workload_security_agent_rule_kill;
47524754
pub use self::model_cloud_workload_security_agent_rule_kill::CloudWorkloadSecurityAgentRuleKill;
47534755
pub mod model_cloud_workload_security_agent_rule_action_metadata;

src/datadogV2/model/model_cloud_workload_security_agent_rule_action.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ pub struct CloudWorkloadSecurityAgentRuleAction {
1414
/// SECL expression used to target the container to apply the action on
1515
#[serde(rename = "filter")]
1616
pub filter: Option<String>,
17-
/// An empty object indicating the hash action
17+
/// Hash file specified by the field attribute
1818
#[serde(rename = "hash")]
19-
pub hash: Option<std::collections::BTreeMap<String, serde_json::Value>>,
19+
pub hash: Option<crate::datadogV2::model::CloudWorkloadSecurityAgentRuleActionHash>,
2020
/// Kill system call applied on the container matching the rule
2121
#[serde(rename = "kill")]
2222
pub kill: Option<crate::datadogV2::model::CloudWorkloadSecurityAgentRuleKill>,
@@ -51,7 +51,10 @@ impl CloudWorkloadSecurityAgentRuleAction {
5151
self
5252
}
5353

54-
pub fn hash(mut self, value: std::collections::BTreeMap<String, serde_json::Value>) -> Self {
54+
pub fn hash(
55+
mut self,
56+
value: crate::datadogV2::model::CloudWorkloadSecurityAgentRuleActionHash,
57+
) -> Self {
5558
self.hash = Some(value);
5659
self
5760
}
@@ -113,7 +116,9 @@ impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentRuleAction {
113116
M: MapAccess<'a>,
114117
{
115118
let mut filter: Option<String> = None;
116-
let mut hash: Option<std::collections::BTreeMap<String, serde_json::Value>> = None;
119+
let mut hash: Option<
120+
crate::datadogV2::model::CloudWorkloadSecurityAgentRuleActionHash,
121+
> = None;
117122
let mut kill: Option<crate::datadogV2::model::CloudWorkloadSecurityAgentRuleKill> =
118123
None;
119124
let mut metadata: Option<
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
use serde::de::{Error, MapAccess, Visitor};
5+
use serde::{Deserialize, Deserializer, Serialize};
6+
use serde_with::skip_serializing_none;
7+
use std::fmt::{self, Formatter};
8+
9+
/// Hash file specified by the field attribute
10+
#[non_exhaustive]
11+
#[skip_serializing_none]
12+
#[derive(Clone, Debug, PartialEq, Serialize)]
13+
pub struct CloudWorkloadSecurityAgentRuleActionHash {
14+
/// The field of the hash action
15+
#[serde(rename = "field")]
16+
pub field: Option<String>,
17+
#[serde(flatten)]
18+
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
19+
#[serde(skip)]
20+
#[serde(default)]
21+
pub(crate) _unparsed: bool,
22+
}
23+
24+
impl CloudWorkloadSecurityAgentRuleActionHash {
25+
pub fn new() -> CloudWorkloadSecurityAgentRuleActionHash {
26+
CloudWorkloadSecurityAgentRuleActionHash {
27+
field: None,
28+
additional_properties: std::collections::BTreeMap::new(),
29+
_unparsed: false,
30+
}
31+
}
32+
33+
pub fn field(mut self, value: String) -> Self {
34+
self.field = Some(value);
35+
self
36+
}
37+
38+
pub fn additional_properties(
39+
mut self,
40+
value: std::collections::BTreeMap<String, serde_json::Value>,
41+
) -> Self {
42+
self.additional_properties = value;
43+
self
44+
}
45+
}
46+
47+
impl Default for CloudWorkloadSecurityAgentRuleActionHash {
48+
fn default() -> Self {
49+
Self::new()
50+
}
51+
}
52+
53+
impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentRuleActionHash {
54+
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
55+
where
56+
D: Deserializer<'de>,
57+
{
58+
struct CloudWorkloadSecurityAgentRuleActionHashVisitor;
59+
impl<'a> Visitor<'a> for CloudWorkloadSecurityAgentRuleActionHashVisitor {
60+
type Value = CloudWorkloadSecurityAgentRuleActionHash;
61+
62+
fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
63+
f.write_str("a mapping")
64+
}
65+
66+
fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
67+
where
68+
M: MapAccess<'a>,
69+
{
70+
let mut field: Option<String> = None;
71+
let mut additional_properties: std::collections::BTreeMap<
72+
String,
73+
serde_json::Value,
74+
> = std::collections::BTreeMap::new();
75+
let mut _unparsed = false;
76+
77+
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
78+
match k.as_str() {
79+
"field" => {
80+
if v.is_null() {
81+
continue;
82+
}
83+
field = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
84+
}
85+
&_ => {
86+
if let Ok(value) = serde_json::from_value(v.clone()) {
87+
additional_properties.insert(k, value);
88+
}
89+
}
90+
}
91+
}
92+
93+
let content = CloudWorkloadSecurityAgentRuleActionHash {
94+
field,
95+
additional_properties,
96+
_unparsed,
97+
};
98+
99+
Ok(content)
100+
}
101+
}
102+
103+
deserializer.deserialize_any(CloudWorkloadSecurityAgentRuleActionHashVisitor)
104+
}
105+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-10-10T15:20:39.566Z
1+
2025-11-24T13:58:56.166Z

tests/scenarios/cassettes/v2/csm_threats/Create-a-Workload-Protection-agent-rule-returns-Bad-Request-response.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"request": {
55
"body": {
6-
"string": "{\"data\":{\"attributes\":{\"description\":\"My agent policy\",\"enabled\":true,\"hostTags\":[\"env:staging\"],\"name\":\"testcreateaworkloadprotectionagentrulereturnsbadrequestresponse1760109639\"},\"type\":\"policy\"}}",
6+
"string": "{\"data\":{\"attributes\":{\"description\":\"My agent policy\",\"enabled\":true,\"hostTags\":[\"env:staging\"],\"name\":\"testcreateaworkloadprotectionagentrulereturnsbadrequestresponse1763992736\"},\"type\":\"policy\"}}",
77
"encoding": null
88
},
99
"headers": {
@@ -19,7 +19,7 @@
1919
},
2020
"response": {
2121
"body": {
22-
"string": "{\"data\":{\"id\":\"sr5-i0h-lty\",\"type\":\"policy\",\"attributes\":{\"blockingRulesCount\":0,\"datadogManaged\":false,\"description\":\"My agent policy\",\"disabledRulesCount\":1,\"enabled\":true,\"hostTagsLists\":[[\"env:staging\"]],\"monitoringRulesCount\":7,\"name\":\"testcreateaworkloadprotectionagentrulereturnsbadrequestresponse1760109639\",\"pinned\":false,\"policyVersion\":\"1\",\"ruleCount\":8,\"updateDate\":1760109639958,\"updater\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"}}}}",
22+
"string": "{\"data\":{\"id\":\"w9c-4xq-y9a\",\"type\":\"policy\",\"attributes\":{\"blockingRulesCount\":0,\"datadogManaged\":false,\"description\":\"My agent policy\",\"disabledRulesCount\":1,\"enabled\":true,\"hostTagsLists\":[[\"env:staging\"]],\"monitoringRulesCount\":7,\"name\":\"testcreateaworkloadprotectionagentrulereturnsbadrequestresponse1763992736\",\"pinned\":false,\"policyVersion\":\"1\",\"ruleCount\":8,\"updateDate\":1763992736520,\"updater\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"}}}}",
2323
"encoding": null
2424
},
2525
"headers": {
@@ -32,12 +32,12 @@
3232
"message": "OK"
3333
}
3434
},
35-
"recorded_at": "Fri, 10 Oct 2025 15:20:39 GMT"
35+
"recorded_at": "Mon, 24 Nov 2025 13:58:56 GMT"
3636
},
3737
{
3838
"request": {
3939
"body": {
40-
"string": "{\"data\":{\"attributes\":{\"description\":\"My Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name\",\"filters\":[],\"name\":\"my_agent_rule\",\"policy_id\":\"sr5-i0h-lty\",\"product_tags\":[]},\"type\":\"agent_rule\"}}",
40+
"string": "{\"data\":{\"attributes\":{\"description\":\"My Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name\",\"filters\":[],\"name\":\"my_agent_rule\",\"policy_id\":\"w9c-4xq-y9a\",\"product_tags\":[]},\"type\":\"agent_rule\"}}",
4141
"encoding": null
4242
},
4343
"headers": {
@@ -53,7 +53,7 @@
5353
},
5454
"response": {
5555
"body": {
56-
"string": "{\"errors\":[\"input_validation_error(Field 'name' is invalid: the name 'my_agent_rule' is already used by a custom rule)\"]}",
56+
"string": "{\"errors\":[\"input_validation_error(Field 'expression' is invalid: rule `my_agent_rule` error: rule syntax error: bool expected: 1:1: exec.file.name\\n^)\"]}",
5757
"encoding": null
5858
},
5959
"headers": {
@@ -66,7 +66,7 @@
6666
"message": "Bad Request"
6767
}
6868
},
69-
"recorded_at": "Fri, 10 Oct 2025 15:20:39 GMT"
69+
"recorded_at": "Mon, 24 Nov 2025 13:58:56 GMT"
7070
},
7171
{
7272
"request": {
@@ -77,7 +77,7 @@
7777
]
7878
},
7979
"method": "delete",
80-
"uri": "https://api.datadoghq.com/api/v2/remote_config/products/cws/policy/sr5-i0h-lty"
80+
"uri": "https://api.datadoghq.com/api/v2/remote_config/products/cws/policy/w9c-4xq-y9a"
8181
},
8282
"response": {
8383
"body": {
@@ -94,7 +94,7 @@
9494
"message": "No Content"
9595
}
9696
},
97-
"recorded_at": "Fri, 10 Oct 2025 15:20:39 GMT"
97+
"recorded_at": "Mon, 24 Nov 2025 13:58:56 GMT"
9898
}
9999
],
100100
"recorded_with": "VCR 6.0.0"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-10-10T15:20:41.757Z
1+
2025-11-24T13:58:58.874Z

tests/scenarios/cassettes/v2/csm_threats/Create-a-Workload-Protection-agent-rule-returns-OK-response.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"request": {
55
"body": {
6-
"string": "{\"data\":{\"attributes\":{\"description\":\"My agent policy\",\"enabled\":true,\"hostTags\":[\"env:staging\"],\"name\":\"testcreateaworkloadprotectionagentrulereturnsokresponse1760109641\"},\"type\":\"policy\"}}",
6+
"string": "{\"data\":{\"attributes\":{\"description\":\"My agent policy\",\"enabled\":true,\"hostTags\":[\"env:staging\"],\"name\":\"testcreateaworkloadprotectionagentrulereturnsokresponse1763992738\"},\"type\":\"policy\"}}",
77
"encoding": null
88
},
99
"headers": {
@@ -19,7 +19,7 @@
1919
},
2020
"response": {
2121
"body": {
22-
"string": "{\"data\":{\"id\":\"cwy-qfn-4k8\",\"type\":\"policy\",\"attributes\":{\"blockingRulesCount\":0,\"datadogManaged\":false,\"description\":\"My agent policy\",\"disabledRulesCount\":1,\"enabled\":true,\"hostTagsLists\":[[\"env:staging\"]],\"monitoringRulesCount\":7,\"name\":\"testcreateaworkloadprotectionagentrulereturnsokresponse1760109641\",\"pinned\":false,\"policyVersion\":\"1\",\"ruleCount\":8,\"updateDate\":1760109642133,\"updater\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"}}}}",
22+
"string": "{\"data\":{\"id\":\"tlt-msl-sfd\",\"type\":\"policy\",\"attributes\":{\"blockingRulesCount\":0,\"datadogManaged\":false,\"description\":\"My agent policy\",\"disabledRulesCount\":1,\"enabled\":true,\"hostTagsLists\":[[\"env:staging\"]],\"monitoringRulesCount\":7,\"name\":\"testcreateaworkloadprotectionagentrulereturnsokresponse1763992738\",\"pinned\":false,\"policyVersion\":\"1\",\"ruleCount\":8,\"updateDate\":1763992739217,\"updater\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"}}}}",
2323
"encoding": null
2424
},
2525
"headers": {
@@ -32,12 +32,12 @@
3232
"message": "OK"
3333
}
3434
},
35-
"recorded_at": "Fri, 10 Oct 2025 15:20:41 GMT"
35+
"recorded_at": "Mon, 24 Nov 2025 13:58:58 GMT"
3636
},
3737
{
3838
"request": {
3939
"body": {
40-
"string": "{\"data\":{\"attributes\":{\"agent_version\":\"> 7.60\",\"description\":\"My Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"filters\":[],\"name\":\"testcreateaworkloadprotectionagentrulereturnsokresponse1760109641\",\"policy_id\":\"cwy-qfn-4k8\",\"product_tags\":[]},\"type\":\"agent_rule\"}}",
40+
"string": "{\"data\":{\"attributes\":{\"agent_version\":\"> 7.60\",\"description\":\"My Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"filters\":[],\"name\":\"testcreateaworkloadprotectionagentrulereturnsokresponse1763992738\",\"policy_id\":\"tlt-msl-sfd\",\"product_tags\":[]},\"type\":\"agent_rule\"}}",
4141
"encoding": null
4242
},
4343
"headers": {
@@ -53,7 +53,7 @@
5353
},
5454
"response": {
5555
"body": {
56-
"string": "{\"data\":{\"id\":\"iua-dxr-uvh\",\"type\":\"agent_rule\",\"attributes\":{\"category\":\"Process Activity\",\"creationDate\":1760109643225,\"creator\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"defaultRule\":false,\"description\":\"My Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"filters\":[\"os == \\\"linux\\\"\"],\"monitoring\":[\"cwy-qfn-4k8\"],\"name\":\"testcreateaworkloadprotectionagentrulereturnsokresponse1760109641\",\"product_tags\":[],\"updateDate\":1760109643225,\"updater\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"}}}}",
56+
"string": "{\"data\":{\"id\":\"ps2-esj-nuh\",\"type\":\"agent_rule\",\"attributes\":{\"category\":\"Process Activity\",\"creationDate\":1763992740362,\"creator\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"defaultRule\":false,\"description\":\"My Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"filters\":[\"os == \\\"linux\\\"\"],\"monitoring\":[\"tlt-msl-sfd\"],\"name\":\"testcreateaworkloadprotectionagentrulereturnsokresponse1763992738\",\"product_tags\":[],\"updateDate\":1763992740362,\"updater\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"}}}}",
5757
"encoding": null
5858
},
5959
"headers": {
@@ -66,7 +66,7 @@
6666
"message": "OK"
6767
}
6868
},
69-
"recorded_at": "Fri, 10 Oct 2025 15:20:41 GMT"
69+
"recorded_at": "Mon, 24 Nov 2025 13:58:58 GMT"
7070
},
7171
{
7272
"request": {
@@ -77,7 +77,7 @@
7777
]
7878
},
7979
"method": "delete",
80-
"uri": "https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules/iua-dxr-uvh"
80+
"uri": "https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules/ps2-esj-nuh"
8181
},
8282
"response": {
8383
"body": {
@@ -94,7 +94,7 @@
9494
"message": "No Content"
9595
}
9696
},
97-
"recorded_at": "Fri, 10 Oct 2025 15:20:41 GMT"
97+
"recorded_at": "Mon, 24 Nov 2025 13:58:58 GMT"
9898
},
9999
{
100100
"request": {
@@ -105,7 +105,7 @@
105105
]
106106
},
107107
"method": "delete",
108-
"uri": "https://api.datadoghq.com/api/v2/remote_config/products/cws/policy/cwy-qfn-4k8"
108+
"uri": "https://api.datadoghq.com/api/v2/remote_config/products/cws/policy/tlt-msl-sfd"
109109
},
110110
"response": {
111111
"body": {
@@ -122,7 +122,7 @@
122122
"message": "No Content"
123123
}
124124
},
125-
"recorded_at": "Fri, 10 Oct 2025 15:20:41 GMT"
125+
"recorded_at": "Mon, 24 Nov 2025 13:58:58 GMT"
126126
}
127127
],
128128
"recorded_with": "VCR 6.0.0"

0 commit comments

Comments
 (0)