Skip to content

Commit cdc2bda

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

File tree

62 files changed

+377
-198
lines changed

Some content is hidden

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

62 files changed

+377
-198
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10205,11 +10205,11 @@ components:
1020510205
CloudWorkloadSecurityAgentPolicyVersion:
1020610206
description: The versions of the policy
1020710207
properties:
10208-
Date:
10208+
date:
1020910209
description: The date and time the version was created
1021010210
nullable: true
1021110211
type: string
10212-
Name:
10212+
name:
1021310213
description: The version of the policy
1021410214
example: 1.47.0-rc2
1021510215
type: string
@@ -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
@@ -10285,9 +10288,14 @@ components:
1028510288
format: int64
1028610289
type: integer
1028710290
value:
10288-
description: The value of the set action
10289-
type: string
10291+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActionSetValue'
1029010292
type: object
10293+
CloudWorkloadSecurityAgentRuleActionSetValue:
10294+
description: The value of the set action
10295+
oneOf:
10296+
- type: string
10297+
- type: integer
10298+
- type: boolean
1029110299
CloudWorkloadSecurityAgentRuleActions:
1029210300
description: The array of actions the rule can perform if triggered
1029310301
items:

examples/v2_csm-threats_CreateCSMThreatsAgentRule_1295653933.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
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;
7+
use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleActionSetValue;
68
use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleCreateAttributes;
79
use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleCreateData;
810
use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleCreateRequest;
911
use datadog_api_client::datadogV2::model::CloudWorkloadSecurityAgentRuleType;
10-
use std::collections::BTreeMap;
1112

1213
#[tokio::main]
1314
async fn main() {
@@ -25,9 +26,13 @@ async fn main() {
2526
.inherited(true)
2627
.name("test_set".to_string())
2728
.scope("process".to_string())
28-
.value("test_value".to_string()),
29+
.value(CloudWorkloadSecurityAgentRuleActionSetValue::String(
30+
"test_value".to_string(),
31+
)),
32+
),
33+
CloudWorkloadSecurityAgentRuleAction::new().hash(
34+
CloudWorkloadSecurityAgentRuleActionHash::new().field("exec.file".to_string()),
2935
),
30-
CloudWorkloadSecurityAgentRuleAction::new().hash(BTreeMap::from([])),
3136
]))
3237
.description("My Agent rule with set action".to_string())
3338
.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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4748,12 +4748,16 @@ 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;
47544756
pub use self::model_cloud_workload_security_agent_rule_action_metadata::CloudWorkloadSecurityAgentRuleActionMetadata;
47554757
pub mod model_cloud_workload_security_agent_rule_action_set;
47564758
pub use self::model_cloud_workload_security_agent_rule_action_set::CloudWorkloadSecurityAgentRuleActionSet;
4759+
pub mod model_cloud_workload_security_agent_rule_action_set_value;
4760+
pub use self::model_cloud_workload_security_agent_rule_action_set_value::CloudWorkloadSecurityAgentRuleActionSetValue;
47574761
pub mod model_cloud_workload_security_agent_rule_creator_attributes;
47584762
pub use self::model_cloud_workload_security_agent_rule_creator_attributes::CloudWorkloadSecurityAgentRuleCreatorAttributes;
47594763
pub mod model_cloud_workload_security_agent_rule_updater_attributes;

src/datadogV2/model/model_cloud_workload_security_agent_policy_version.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ use std::fmt::{self, Formatter};
1212
#[derive(Clone, Debug, PartialEq, Serialize)]
1313
pub struct CloudWorkloadSecurityAgentPolicyVersion {
1414
/// The date and time the version was created
15-
#[serde(rename = "Date", default, with = "::serde_with::rust::double_option")]
15+
#[serde(rename = "date", default, with = "::serde_with::rust::double_option")]
1616
pub date: Option<Option<String>>,
1717
/// The version of the policy
18-
#[serde(rename = "Name")]
18+
#[serde(rename = "name")]
1919
pub name: Option<String>,
2020
#[serde(flatten)]
2121
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
@@ -86,10 +86,10 @@ impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentPolicyVersion {
8686

8787
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
8888
match k.as_str() {
89-
"Date" => {
89+
"date" => {
9090
date = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
9191
}
92-
"Name" => {
92+
"name" => {
9393
if v.is_null() {
9494
continue;
9595
}

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+
}

src/datadogV2/model/model_cloud_workload_security_agent_rule_action_set.rs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub struct CloudWorkloadSecurityAgentRuleActionSet {
4040
pub ttl: Option<i64>,
4141
/// The value of the set action
4242
#[serde(rename = "value")]
43-
pub value: Option<String>,
43+
pub value: Option<crate::datadogV2::model::CloudWorkloadSecurityAgentRuleActionSetValue>,
4444
#[serde(flatten)]
4545
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
4646
#[serde(skip)]
@@ -111,7 +111,10 @@ impl CloudWorkloadSecurityAgentRuleActionSet {
111111
self
112112
}
113113

114-
pub fn value(mut self, value: String) -> Self {
114+
pub fn value(
115+
mut self,
116+
value: crate::datadogV2::model::CloudWorkloadSecurityAgentRuleActionSetValue,
117+
) -> Self {
115118
self.value = Some(value);
116119
self
117120
}
@@ -157,7 +160,9 @@ impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentRuleActionSet {
157160
let mut scope: Option<String> = None;
158161
let mut size: Option<i64> = None;
159162
let mut ttl: Option<i64> = None;
160-
let mut value: Option<String> = None;
163+
let mut value: Option<
164+
crate::datadogV2::model::CloudWorkloadSecurityAgentRuleActionSetValue,
165+
> = None;
161166
let mut additional_properties: std::collections::BTreeMap<
162167
String,
163168
serde_json::Value,
@@ -226,6 +231,14 @@ impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentRuleActionSet {
226231
continue;
227232
}
228233
value = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
234+
if let Some(ref _value) = value {
235+
match _value {
236+
crate::datadogV2::model::CloudWorkloadSecurityAgentRuleActionSetValue::UnparsedObject(_value) => {
237+
_unparsed = true;
238+
},
239+
_ => {}
240+
}
241+
}
229242
}
230243
&_ => {
231244
if let Ok(value) = serde_json::from_value(v.clone()) {
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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::{Deserialize, Deserializer, Serialize};
5+
6+
/// The value of the set action
7+
#[non_exhaustive]
8+
#[derive(Clone, Debug, PartialEq, Serialize)]
9+
#[serde(untagged)]
10+
pub enum CloudWorkloadSecurityAgentRuleActionSetValue {
11+
String(String),
12+
I32(i32),
13+
Bool(bool),
14+
UnparsedObject(crate::datadog::UnparsedObject),
15+
}
16+
17+
impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentRuleActionSetValue {
18+
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
19+
where
20+
D: Deserializer<'de>,
21+
{
22+
let value: serde_json::Value = Deserialize::deserialize(deserializer)?;
23+
if let Ok(_v) = serde_json::from_value::<String>(value.clone()) {
24+
return Ok(CloudWorkloadSecurityAgentRuleActionSetValue::String(_v));
25+
}
26+
if let Ok(_v) = serde_json::from_value::<i32>(value.clone()) {
27+
return Ok(CloudWorkloadSecurityAgentRuleActionSetValue::I32(_v));
28+
}
29+
if let Ok(_v) = serde_json::from_value::<bool>(value.clone()) {
30+
return Ok(CloudWorkloadSecurityAgentRuleActionSetValue::Bool(_v));
31+
}
32+
33+
return Ok(
34+
CloudWorkloadSecurityAgentRuleActionSetValue::UnparsedObject(
35+
crate::datadog::UnparsedObject { value },
36+
),
37+
);
38+
}
39+
}
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-27T16:28:19.381Z

0 commit comments

Comments
 (0)