Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19082,6 +19082,11 @@ components:
format: int32
maximum: 2147483647
type: integer
contentPackUpdateAvailable:
description: "Whether a content pack update is available for the policy."
example: false
nullable: true
type: boolean
datadogManaged:
description: "Whether the policy is managed by Datadog"
example: false
Expand Down Expand Up @@ -19148,6 +19153,10 @@ components:
format: int32
maximum: 2147483647
type: integer
sourceDefaultPolicyId:
description: "The ID of the Datadog-managed default policy this policy is sourced from."
example: "threat-detection.policy"
type: string
updateDate:
description: "Timestamp in milliseconds when the policy was last updated"
example: 1624366480320
Expand Down Expand Up @@ -19330,6 +19339,9 @@ components:
CloudWorkloadSecurityAgentRuleAction:
description: "The action the rule can perform if triggered"
properties:
disabled:
description: "Whether the action is disabled."
type: boolean
filter:
description: "SECL expression used to target the container to apply the action on"
type: string
Expand Down Expand Up @@ -19386,6 +19398,9 @@ components:
scope:
description: "The scope of the set action."
type: string
scope_field:
description: "The scope field of the set action."
type: string
size:
description: "The size of the set action."
format: int64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ pub struct CloudWorkloadSecurityAgentPolicyAttributes {
/// The number of rules with the blocking feature in this policy
#[serde(rename = "blockingRulesCount")]
pub blocking_rules_count: Option<i32>,
/// Whether a content pack update is available for the policy.
#[serde(
rename = "contentPackUpdateAvailable",
default,
with = "::serde_with::rust::double_option"
)]
pub content_pack_update_available: Option<Option<bool>>,
/// Whether the policy is managed by Datadog
#[serde(rename = "datadogManaged")]
pub datadog_managed: Option<bool>,
Expand Down Expand Up @@ -53,6 +60,9 @@ pub struct CloudWorkloadSecurityAgentPolicyAttributes {
/// The number of rules in this policy
#[serde(rename = "ruleCount")]
pub rule_count: Option<i32>,
/// The ID of the Datadog-managed default policy this policy is sourced from.
#[serde(rename = "sourceDefaultPolicyId")]
pub source_default_policy_id: Option<String>,
/// Timestamp in milliseconds when the policy was last updated
#[serde(rename = "updateDate")]
pub update_date: Option<i64>,
Expand All @@ -76,6 +86,7 @@ impl CloudWorkloadSecurityAgentPolicyAttributes {
pub fn new() -> CloudWorkloadSecurityAgentPolicyAttributes {
CloudWorkloadSecurityAgentPolicyAttributes {
blocking_rules_count: None,
content_pack_update_available: None,
datadog_managed: None,
description: None,
disabled_rules_count: None,
Expand All @@ -89,6 +100,7 @@ impl CloudWorkloadSecurityAgentPolicyAttributes {
policy_version: None,
priority: None,
rule_count: None,
source_default_policy_id: None,
update_date: None,
updated_at: None,
updater: None,
Expand All @@ -103,6 +115,11 @@ impl CloudWorkloadSecurityAgentPolicyAttributes {
self
}

pub fn content_pack_update_available(mut self, value: Option<bool>) -> Self {
self.content_pack_update_available = Some(value);
self
}

pub fn datadog_managed(mut self, value: bool) -> Self {
self.datadog_managed = Some(value);
self
Expand Down Expand Up @@ -168,6 +185,11 @@ impl CloudWorkloadSecurityAgentPolicyAttributes {
self
}

pub fn source_default_policy_id(mut self, value: String) -> Self {
self.source_default_policy_id = Some(value);
self
}

pub fn update_date(mut self, value: i64) -> Self {
self.update_date = Some(value);
self
Expand Down Expand Up @@ -227,6 +249,7 @@ impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentPolicyAttributes {
M: MapAccess<'a>,
{
let mut blocking_rules_count: Option<i32> = None;
let mut content_pack_update_available: Option<Option<bool>> = None;
let mut datadog_managed: Option<bool> = None;
let mut description: Option<String> = None;
let mut disabled_rules_count: Option<i32> = None;
Expand All @@ -240,6 +263,7 @@ impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentPolicyAttributes {
let mut policy_version: Option<String> = None;
let mut priority: Option<i64> = None;
let mut rule_count: Option<i32> = None;
let mut source_default_policy_id: Option<String> = None;
let mut update_date: Option<i64> = None;
let mut updated_at: Option<i64> = None;
let mut updater: Option<
Expand All @@ -263,6 +287,10 @@ impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentPolicyAttributes {
blocking_rules_count =
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"contentPackUpdateAvailable" => {
content_pack_update_available =
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"datadogManaged" => {
if v.is_null() {
continue;
Expand Down Expand Up @@ -348,6 +376,13 @@ impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentPolicyAttributes {
}
rule_count = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"sourceDefaultPolicyId" => {
if v.is_null() {
continue;
}
source_default_policy_id =
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"updateDate" => {
if v.is_null() {
continue;
Expand Down Expand Up @@ -383,6 +418,7 @@ impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentPolicyAttributes {

let content = CloudWorkloadSecurityAgentPolicyAttributes {
blocking_rules_count,
content_pack_update_available,
datadog_managed,
description,
disabled_rules_count,
Expand All @@ -396,6 +432,7 @@ impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentPolicyAttributes {
policy_version,
priority,
rule_count,
source_default_policy_id,
update_date,
updated_at,
updater,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ use std::fmt::{self, Formatter};
#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize)]
pub struct CloudWorkloadSecurityAgentRuleAction {
/// Whether the action is disabled.
#[serde(rename = "disabled")]
pub disabled: Option<bool>,
/// SECL expression used to target the container to apply the action on
#[serde(rename = "filter")]
pub filter: Option<String>,
Expand All @@ -36,6 +39,7 @@ pub struct CloudWorkloadSecurityAgentRuleAction {
impl CloudWorkloadSecurityAgentRuleAction {
pub fn new() -> CloudWorkloadSecurityAgentRuleAction {
CloudWorkloadSecurityAgentRuleAction {
disabled: None,
filter: None,
hash: None,
kill: None,
Expand All @@ -46,6 +50,11 @@ impl CloudWorkloadSecurityAgentRuleAction {
}
}

pub fn disabled(mut self, value: bool) -> Self {
self.disabled = Some(value);
self
}

pub fn filter(mut self, value: String) -> Self {
self.filter = Some(value);
self
Expand Down Expand Up @@ -115,6 +124,7 @@ impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentRuleAction {
where
M: MapAccess<'a>,
{
let mut disabled: Option<bool> = None;
let mut filter: Option<String> = None;
let mut hash: Option<
crate::datadogV2::model::CloudWorkloadSecurityAgentRuleActionHash,
Expand All @@ -135,6 +145,12 @@ impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentRuleAction {

while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
match k.as_str() {
"disabled" => {
if v.is_null() {
continue;
}
disabled = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"filter" => {
if v.is_null() {
continue;
Expand Down Expand Up @@ -174,6 +190,7 @@ impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentRuleAction {
}

let content = CloudWorkloadSecurityAgentRuleAction {
disabled,
filter,
hash,
kill,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ pub struct CloudWorkloadSecurityAgentRuleActionSet {
/// The scope of the set action.
#[serde(rename = "scope")]
pub scope: Option<String>,
/// The scope field of the set action.
#[serde(rename = "scope_field")]
pub scope_field: Option<String>,
/// The size of the set action.
#[serde(rename = "size")]
pub size: Option<i64>,
Expand All @@ -58,6 +61,7 @@ impl CloudWorkloadSecurityAgentRuleActionSet {
inherited: None,
name: None,
scope: None,
scope_field: None,
size: None,
ttl: None,
value: None,
Expand Down Expand Up @@ -101,6 +105,11 @@ impl CloudWorkloadSecurityAgentRuleActionSet {
self
}

pub fn scope_field(mut self, value: String) -> Self {
self.scope_field = Some(value);
self
}

pub fn size(mut self, value: i64) -> Self {
self.size = Some(value);
self
Expand Down Expand Up @@ -158,6 +167,7 @@ impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentRuleActionSet {
let mut inherited: Option<bool> = None;
let mut name: Option<String> = None;
let mut scope: Option<String> = None;
let mut scope_field: Option<String> = None;
let mut size: Option<i64> = None;
let mut ttl: Option<i64> = None;
let mut value: Option<
Expand Down Expand Up @@ -214,6 +224,13 @@ impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentRuleActionSet {
}
scope = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"scope_field" => {
if v.is_null() {
continue;
}
scope_field =
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"size" => {
if v.is_null() {
continue;
Expand Down Expand Up @@ -256,6 +273,7 @@ impl<'de> Deserialize<'de> for CloudWorkloadSecurityAgentRuleActionSet {
inherited,
name,
scope,
scope_field,
size,
ttl,
value,
Expand Down
Loading