Skip to content

Commit a99765f

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
[SIEM] Include ruleId in SecurityMonitoringRuleConvertResponse (#910)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 5c5284c commit a99765f

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39011,6 +39011,9 @@ components:
3901139011
SecurityMonitoringRuleConvertResponse:
3901239012
description: Result of the convert rule request containing Terraform content.
3901339013
properties:
39014+
ruleId:
39015+
description: the ID of the rule.
39016+
type: string
3901439017
terraformContent:
3901539018
description: Terraform string as a result of converting the rule from JSON.
3901639019
type: string

src/datadogV2/model/model_security_monitoring_rule_convert_response.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ use std::fmt::{self, Formatter};
1111
#[skip_serializing_none]
1212
#[derive(Clone, Debug, PartialEq, Serialize)]
1313
pub struct SecurityMonitoringRuleConvertResponse {
14+
/// the ID of the rule.
15+
#[serde(rename = "ruleId")]
16+
pub rule_id: Option<String>,
1417
/// Terraform string as a result of converting the rule from JSON.
1518
#[serde(rename = "terraformContent")]
1619
pub terraform_content: Option<String>,
@@ -24,12 +27,18 @@ pub struct SecurityMonitoringRuleConvertResponse {
2427
impl SecurityMonitoringRuleConvertResponse {
2528
pub fn new() -> SecurityMonitoringRuleConvertResponse {
2629
SecurityMonitoringRuleConvertResponse {
30+
rule_id: None,
2731
terraform_content: None,
2832
additional_properties: std::collections::BTreeMap::new(),
2933
_unparsed: false,
3034
}
3135
}
3236

37+
pub fn rule_id(mut self, value: String) -> Self {
38+
self.rule_id = Some(value);
39+
self
40+
}
41+
3342
pub fn terraform_content(mut self, value: String) -> Self {
3443
self.terraform_content = Some(value);
3544
self
@@ -67,6 +76,7 @@ impl<'de> Deserialize<'de> for SecurityMonitoringRuleConvertResponse {
6776
where
6877
M: MapAccess<'a>,
6978
{
79+
let mut rule_id: Option<String> = None;
7080
let mut terraform_content: Option<String> = None;
7181
let mut additional_properties: std::collections::BTreeMap<
7282
String,
@@ -76,6 +86,12 @@ impl<'de> Deserialize<'de> for SecurityMonitoringRuleConvertResponse {
7686

7787
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
7888
match k.as_str() {
89+
"ruleId" => {
90+
if v.is_null() {
91+
continue;
92+
}
93+
rule_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
94+
}
7995
"terraformContent" => {
8096
if v.is_null() {
8197
continue;
@@ -92,6 +108,7 @@ impl<'de> Deserialize<'de> for SecurityMonitoringRuleConvertResponse {
92108
}
93109

94110
let content = SecurityMonitoringRuleConvertResponse {
111+
rule_id,
95112
terraform_content,
96113
additional_properties,
97114
_unparsed,

0 commit comments

Comments
 (0)