From cb712353a94241bce238472f458e014ce6cc63a9 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 6 May 2026 16:22:31 +0000 Subject: [PATCH] Regenerate client from commit 7199d0c of spec repo --- .generator/schemas/v2/openapi.yaml | 23 ++++ src/datadogV2/model/mod.rs | 4 + .../model/model_routing_rule_action.rs | 9 ++ ...odel_trigger_workflow_automation_action.rs | 115 ++++++++++++++++++ ...trigger_workflow_automation_action_type.rs | 48 ++++++++ 5 files changed, 199 insertions(+) create mode 100644 src/datadogV2/model/model_trigger_workflow_automation_action.rs create mode 100644 src/datadogV2/model/model_trigger_workflow_automation_action_type.rs diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 6e652ca45f..888a641612 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -59651,6 +59651,7 @@ components: oneOf: - $ref: "#/components/schemas/SendSlackMessageAction" - $ref: "#/components/schemas/SendTeamsMessageAction" + - $ref: "#/components/schemas/TriggerWorkflowAutomationAction" RoutingRuleAttributes: description: Defines the configurable attributes of a routing rule, such as actions, query, time restriction, and urgency. properties: @@ -79447,6 +79448,28 @@ components: type: string x-enum-varnames: - MONITOR_ALERT_TRIGGER + TriggerWorkflowAutomationAction: + description: "Triggers a Workflow Automation." + properties: + handle: + description: "The handle of the Workflow Automation to trigger." + example: my-workflow-handle + type: string + type: + $ref: "#/components/schemas/TriggerWorkflowAutomationActionType" + required: + - type + - handle + type: object + TriggerWorkflowAutomationActionType: + default: workflow + description: "Indicates that the action triggers a Workflow Automation." + enum: + - workflow + example: workflow + type: string + x-enum-varnames: + - TRIGGER_WORKFLOW_AUTOMATION UCConfigPair: description: The definition of `UCConfigPair` object. example: diff --git a/src/datadogV2/model/mod.rs b/src/datadogV2/model/mod.rs index 7193eea2e5..80cfff4aa0 100644 --- a/src/datadogV2/model/mod.rs +++ b/src/datadogV2/model/mod.rs @@ -6210,6 +6210,10 @@ pub mod model_send_teams_message_action; pub use self::model_send_teams_message_action::SendTeamsMessageAction; pub mod model_send_teams_message_action_type; pub use self::model_send_teams_message_action_type::SendTeamsMessageActionType; +pub mod model_trigger_workflow_automation_action; +pub use self::model_trigger_workflow_automation_action::TriggerWorkflowAutomationAction; +pub mod model_trigger_workflow_automation_action_type; +pub use self::model_trigger_workflow_automation_action_type::TriggerWorkflowAutomationActionType; pub mod model_routing_rule_action; pub use self::model_routing_rule_action::RoutingRuleAction; pub mod model_time_restrictions; diff --git a/src/datadogV2/model/model_routing_rule_action.rs b/src/datadogV2/model/model_routing_rule_action.rs index 283c525ba7..eaea3ef9ac 100644 --- a/src/datadogV2/model/model_routing_rule_action.rs +++ b/src/datadogV2/model/model_routing_rule_action.rs @@ -10,6 +10,7 @@ use serde::{Deserialize, Deserializer, Serialize}; pub enum RoutingRuleAction { SendSlackMessageAction(Box), SendTeamsMessageAction(Box), + TriggerWorkflowAutomationAction(Box), UnparsedObject(crate::datadog::UnparsedObject), } @@ -33,6 +34,14 @@ impl<'de> Deserialize<'de> for RoutingRuleAction { return Ok(RoutingRuleAction::SendTeamsMessageAction(_v)); } } + if let Ok(_v) = serde_json::from_value::< + Box, + >(value.clone()) + { + if !_v._unparsed { + return Ok(RoutingRuleAction::TriggerWorkflowAutomationAction(_v)); + } + } return Ok(RoutingRuleAction::UnparsedObject( crate::datadog::UnparsedObject { value }, diff --git a/src/datadogV2/model/model_trigger_workflow_automation_action.rs b/src/datadogV2/model/model_trigger_workflow_automation_action.rs new file mode 100644 index 0000000000..fffe6ec097 --- /dev/null +++ b/src/datadogV2/model/model_trigger_workflow_automation_action.rs @@ -0,0 +1,115 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Triggers a Workflow Automation. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct TriggerWorkflowAutomationAction { + /// The handle of the Workflow Automation to trigger. + #[serde(rename = "handle")] + pub handle: String, + /// Indicates that the action triggers a Workflow Automation. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::TriggerWorkflowAutomationActionType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl TriggerWorkflowAutomationAction { + pub fn new( + handle: String, + type_: crate::datadogV2::model::TriggerWorkflowAutomationActionType, + ) -> TriggerWorkflowAutomationAction { + TriggerWorkflowAutomationAction { + handle, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for TriggerWorkflowAutomationAction { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct TriggerWorkflowAutomationActionVisitor; + impl<'a> Visitor<'a> for TriggerWorkflowAutomationActionVisitor { + type Value = TriggerWorkflowAutomationAction; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut handle: Option = None; + let mut type_: Option< + crate::datadogV2::model::TriggerWorkflowAutomationActionType, + > = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "handle" => { + handle = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::TriggerWorkflowAutomationActionType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let handle = handle.ok_or_else(|| M::Error::missing_field("handle"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = TriggerWorkflowAutomationAction { + handle, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(TriggerWorkflowAutomationActionVisitor) + } +} diff --git a/src/datadogV2/model/model_trigger_workflow_automation_action_type.rs b/src/datadogV2/model/model_trigger_workflow_automation_action_type.rs new file mode 100644 index 0000000000..9c824fc3f0 --- /dev/null +++ b/src/datadogV2/model/model_trigger_workflow_automation_action_type.rs @@ -0,0 +1,48 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[non_exhaustive] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum TriggerWorkflowAutomationActionType { + TRIGGER_WORKFLOW_AUTOMATION, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for TriggerWorkflowAutomationActionType { + fn to_string(&self) -> String { + match self { + Self::TRIGGER_WORKFLOW_AUTOMATION => String::from("workflow"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for TriggerWorkflowAutomationActionType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for TriggerWorkflowAutomationActionType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "workflow" => Self::TRIGGER_WORKFLOW_AUTOMATION, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +}