From c3eae8f461fdfd8ea5073f7bd96cf106b40800bf Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Sun, 30 Aug 2026 21:48:38 +0000 Subject: [PATCH] Regenerate client from commit f5ef2e8 of spec repo --- .generator/schemas/v2/openapi.yaml | 246 +++++++++++++++++- src/datadogV2/model/mod.rs | 40 +++ src/datadogV2/model/model_execution_limit.rs | 92 +++++++ .../model/model_incident_condition.rs | 105 ++++++++ .../model/model_incident_created_trigger.rs | 124 +++++++++ .../model_incident_created_trigger_wrapper.rs | 116 +++++++++ .../model_incident_impact_created_trigger.rs | 142 ++++++++++ ...incident_impact_created_trigger_wrapper.rs | 116 +++++++++ .../model_incident_impact_updated_trigger.rs | 142 ++++++++++ ...incident_impact_updated_trigger_wrapper.rs | 116 +++++++++ ...del_incident_postmortem_updated_trigger.rs | 142 ++++++++++ ...dent_postmortem_updated_trigger_wrapper.rs | 119 +++++++++ ...odel_incident_responder_created_trigger.rs | 142 ++++++++++ ...ident_responder_created_trigger_wrapper.rs | 117 +++++++++ .../model/model_incident_saved_trigger.rs | 160 ++++++++++++ .../model_incident_saved_trigger_wrapper.rs | 116 +++++++++ .../model/model_incident_schedule_trigger.rs | 128 +++++++++ ...model_incident_schedule_trigger_wrapper.rs | 116 +++++++++ .../model/model_incident_tag_value.rs | 102 ++++++++ src/datadogV2/model/model_incident_trigger.rs | 19 +- .../model/model_incident_trigger_wrapper.rs | 4 +- src/datadogV2/model/model_serial_execution.rs | 92 +++++++ .../model/model_slack_reaction_config.rs | 104 ++++++++ src/datadogV2/model/model_slack_trigger.rs | 111 ++++++++ .../model/model_slack_trigger_wrapper.rs | 10 +- src/datadogV2/model/model_trigger.rs | 71 +++++ 26 files changed, 2778 insertions(+), 14 deletions(-) create mode 100644 src/datadogV2/model/model_execution_limit.rs create mode 100644 src/datadogV2/model/model_incident_condition.rs create mode 100644 src/datadogV2/model/model_incident_created_trigger.rs create mode 100644 src/datadogV2/model/model_incident_created_trigger_wrapper.rs create mode 100644 src/datadogV2/model/model_incident_impact_created_trigger.rs create mode 100644 src/datadogV2/model/model_incident_impact_created_trigger_wrapper.rs create mode 100644 src/datadogV2/model/model_incident_impact_updated_trigger.rs create mode 100644 src/datadogV2/model/model_incident_impact_updated_trigger_wrapper.rs create mode 100644 src/datadogV2/model/model_incident_postmortem_updated_trigger.rs create mode 100644 src/datadogV2/model/model_incident_postmortem_updated_trigger_wrapper.rs create mode 100644 src/datadogV2/model/model_incident_responder_created_trigger.rs create mode 100644 src/datadogV2/model/model_incident_responder_created_trigger_wrapper.rs create mode 100644 src/datadogV2/model/model_incident_saved_trigger.rs create mode 100644 src/datadogV2/model/model_incident_saved_trigger_wrapper.rs create mode 100644 src/datadogV2/model/model_incident_schedule_trigger.rs create mode 100644 src/datadogV2/model/model_incident_schedule_trigger_wrapper.rs create mode 100644 src/datadogV2/model/model_incident_tag_value.rs create mode 100644 src/datadogV2/model/model_serial_execution.rs create mode 100644 src/datadogV2/model/model_slack_reaction_config.rs create mode 100644 src/datadogV2/model/model_slack_trigger.rs diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b6a3ce30c8..5fe94fe87a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -38188,6 +38188,19 @@ components: example: "One or several indexes are missing or invalid. Results hold data from the other indexes." type: string type: object + ExecutionLimit: + description: "The maximum number of times to execute a workflow for an incident." + properties: + count: + description: "The maximum number of workflow executions." + example: 1 + format: int32 + maximum: 9999 + minimum: 1 + type: integer + required: + - count + type: object ExecutionPolicyActionPattern: description: The set of actions this policy applies to. properties: @@ -47979,6 +47992,15 @@ components: type: string x-enum-varnames: - INCIDENT_ATTACHMENTS + IncidentCondition: + description: "Conditions that determine which incidents trigger the workflow." + properties: + tagValues: + description: "Incident tags and values used to filter matching incidents." + items: + $ref: "#/components/schemas/IncidentTagValue" + type: array + type: object IncidentConfigurationDataAttributesRequest: description: Attributes for creating an incident configuration. properties: @@ -48332,6 +48354,25 @@ components: required: - data type: object + IncidentCreatedTrigger: + description: "Trigger a workflow when an incident is declared." + properties: + incidentType: + description: "The type of incident that triggers the workflow." + type: string + tagCondition: + $ref: "#/components/schemas/IncidentCondition" + type: object + IncidentCreatedTriggerWrapper: + description: "Schema for an incident declared trigger." + properties: + incidentCreatedTrigger: + $ref: "#/components/schemas/IncidentCreatedTrigger" + startStepNames: + $ref: "#/components/schemas/StartStepNames" + required: + - incidentCreatedTrigger + type: object IncidentFieldAttributes: description: Dynamic fields for which selections can be made, with field names as keys. oneOf: @@ -49011,6 +49052,27 @@ components: required: - data type: object + IncidentImpactCreatedTrigger: + description: "Trigger a workflow when an impact is created for an incident." + properties: + executionLimit: + $ref: "#/components/schemas/ExecutionLimit" + incidentType: + description: "The type of incident that triggers the workflow." + type: string + tagCondition: + $ref: "#/components/schemas/IncidentCondition" + type: object + IncidentImpactCreatedTriggerWrapper: + description: "Schema for an incident impact created trigger." + properties: + incidentImpactCreatedTrigger: + $ref: "#/components/schemas/IncidentImpactCreatedTrigger" + startStepNames: + $ref: "#/components/schemas/StartStepNames" + required: + - incidentImpactCreatedTrigger + type: object IncidentImpactFieldChoice: description: A choice option for a dropdown or multiselect impact field. properties: @@ -49309,6 +49371,27 @@ components: type: string x-enum-varnames: - INCIDENT_IMPACTS + IncidentImpactUpdatedTrigger: + description: "Trigger a workflow when an impact is updated for an incident." + properties: + executionLimit: + $ref: "#/components/schemas/ExecutionLimit" + incidentType: + description: "The type of incident that triggers the workflow." + type: string + tagCondition: + $ref: "#/components/schemas/IncidentCondition" + type: object + IncidentImpactUpdatedTriggerWrapper: + description: "Schema for an incident impact updated trigger." + properties: + incidentImpactUpdatedTrigger: + $ref: "#/components/schemas/IncidentImpactUpdatedTrigger" + startStepNames: + $ref: "#/components/schemas/StartStepNames" + required: + - incidentImpactUpdatedTrigger + type: object IncidentImpactsResponse: description: Response with a list of incident impacts. properties: @@ -50530,6 +50613,27 @@ components: type: string x-enum-varnames: - INCIDENT_POSTMORTEMS + IncidentPostmortemUpdatedTrigger: + description: "Trigger a workflow when a postmortem is updated for an incident." + properties: + executionLimit: + $ref: "#/components/schemas/ExecutionLimit" + incidentType: + description: "The type of incident that triggers the workflow." + type: string + tagCondition: + $ref: "#/components/schemas/IncidentCondition" + type: object + IncidentPostmortemUpdatedTriggerWrapper: + description: "Schema for an incident postmortem updated trigger." + properties: + incidentPostmortemUpdatedTrigger: + $ref: "#/components/schemas/IncidentPostmortemUpdatedTrigger" + startStepNames: + $ref: "#/components/schemas/StartStepNames" + required: + - incidentPostmortemUpdatedTrigger + type: object IncidentRelatedObject: description: Object related to an incident. enum: @@ -50560,6 +50664,27 @@ components: type: string x-enum-varnames: - INCIDENTS + IncidentResponderCreatedTrigger: + description: "Trigger a workflow when a responder is created for an incident." + properties: + executionLimit: + $ref: "#/components/schemas/ExecutionLimit" + incidentType: + description: "The type of incident that triggers the workflow." + type: string + tagCondition: + $ref: "#/components/schemas/IncidentCondition" + type: object + IncidentResponderCreatedTriggerWrapper: + description: "Schema for an incident responder created trigger." + properties: + incidentResponderCreatedTrigger: + $ref: "#/components/schemas/IncidentResponderCreatedTrigger" + startStepNames: + $ref: "#/components/schemas/StartStepNames" + required: + - incidentResponderCreatedTrigger + type: object IncidentResponderDataAttributesResponse: description: Attributes of an incident responder in a response. properties: @@ -51313,6 +51438,55 @@ components: required: - data type: object + IncidentSavedTrigger: + description: "Trigger a workflow when an incident is declared or updated." + properties: + executionLimit: + $ref: "#/components/schemas/ExecutionLimit" + incidentType: + description: "The type of incident that triggers the workflow." + type: string + serialExecution: + $ref: "#/components/schemas/SerialExecution" + tagCondition: + $ref: "#/components/schemas/IncidentCondition" + type: object + IncidentSavedTriggerWrapper: + description: "Schema for an incident declared or updated trigger." + properties: + incidentSavedTrigger: + $ref: "#/components/schemas/IncidentSavedTrigger" + startStepNames: + $ref: "#/components/schemas/StartStepNames" + required: + - incidentSavedTrigger + type: object + IncidentScheduleTrigger: + description: "Trigger a workflow on a schedule for an incident." + properties: + incidentType: + description: "The type of incident that triggers the workflow." + type: string + rrule: + description: "The recurrence rule for the schedule, expressed as an iCalendar `RRULE` string." + example: "DTSTART:20241220T151700Z\nRRULE:FREQ=MONTHLY" + minLength: 1 + type: string + tagCondition: + $ref: "#/components/schemas/IncidentCondition" + required: + - rrule + type: object + IncidentScheduleTriggerWrapper: + description: "Schema for an incident schedule trigger." + properties: + incidentScheduleTrigger: + $ref: "#/components/schemas/IncidentScheduleTrigger" + startStepNames: + $ref: "#/components/schemas/StartStepNames" + required: + - incidentScheduleTrigger + type: object IncidentSearchResponse: description: Response with incidents and facets. properties: @@ -51606,6 +51780,24 @@ components: - SEV_3 - SEV_4 - SEV_5 + IncidentTagValue: + description: "An incident tag and its accepted values." + properties: + tag: + description: "The incident tag to match." + example: "" + type: string + values: + description: "The accepted values for the incident tag." + example: + - "" + items: + type: string + type: array + required: + - tag + - values + type: object IncidentTimelineCellCreateAttributes: description: The timeline cell's attributes for a create request. oneOf: @@ -52025,13 +52217,16 @@ components: x-enum-varnames: - INCIDENT_TODOS IncidentTrigger: - description: "Trigger a workflow from an Incident. For automatic triggering a handle must be configured and the workflow must be published." + description: "Trigger a workflow from an incident. For automatic triggering a handle must be configured and the workflow must be published." properties: rateLimit: $ref: "#/components/schemas/TriggerRateLimit" + version: + description: "Version of the incident manual trigger." + type: string type: object IncidentTriggerWrapper: - description: "Schema for an Incident-based trigger." + description: "Schema for an incident-based trigger." properties: incidentTrigger: $ref: "#/components/schemas/IncidentTrigger" @@ -103923,6 +104118,16 @@ components: - REPLACEMENT_STRING - PARTIAL_REPLACEMENT_FROM_BEGINNING - PARTIAL_REPLACEMENT_FROM_END + SerialExecution: + description: "Whether to execute the workflow serially for an incident." + properties: + enabled: + description: "Whether serial execution is enabled." + example: false + type: boolean + required: + - enabled + type: object ServiceAccessToken: description: Datadog access token. properties: @@ -107006,12 +107211,38 @@ components: - channel_name - redirect_url type: object + SlackReactionConfig: + description: "Configuration for a Slack emoji reaction trigger." + properties: + reactionEmoji: + description: "The Slack emoji reaction name." + example: L + minLength: 1 + type: string + teamId: + description: "The Slack workspace ID." + example: L + minLength: 1 + type: string + required: + - teamId + - reactionEmoji + type: object + SlackTrigger: + description: "Trigger a workflow from Slack. The workflow must be published." + properties: + reactionTriggers: + description: "Slack emoji reactions that trigger the workflow." + items: + $ref: "#/components/schemas/SlackReactionConfig" + type: array + uniqueItems: true + type: object SlackTriggerWrapper: description: "Schema for a Slack-based trigger." properties: slackTrigger: - description: "Trigger a workflow from Slack. The workflow must be published." - type: object + $ref: "#/components/schemas/SlackTrigger" startStepNames: $ref: "#/components/schemas/StartStepNames" required: @@ -118899,6 +119130,13 @@ components: - $ref: "#/components/schemas/DashboardTriggerWrapper" - $ref: "#/components/schemas/FormTriggerWrapper" - $ref: "#/components/schemas/GithubWebhookTriggerWrapper" + - $ref: "#/components/schemas/IncidentCreatedTriggerWrapper" + - $ref: "#/components/schemas/IncidentImpactCreatedTriggerWrapper" + - $ref: "#/components/schemas/IncidentImpactUpdatedTriggerWrapper" + - $ref: "#/components/schemas/IncidentPostmortemUpdatedTriggerWrapper" + - $ref: "#/components/schemas/IncidentResponderCreatedTriggerWrapper" + - $ref: "#/components/schemas/IncidentSavedTriggerWrapper" + - $ref: "#/components/schemas/IncidentScheduleTriggerWrapper" - $ref: "#/components/schemas/IncidentTriggerWrapper" - $ref: "#/components/schemas/MonitorTriggerWrapper" - $ref: "#/components/schemas/NotebookTriggerWrapper" diff --git a/src/datadogV2/model/mod.rs b/src/datadogV2/model/mod.rs index 50018801e5..608df0b87e 100644 --- a/src/datadogV2/model/mod.rs +++ b/src/datadogV2/model/mod.rs @@ -15212,6 +15212,42 @@ pub mod model_github_webhook_trigger_wrapper; pub use self::model_github_webhook_trigger_wrapper::GithubWebhookTriggerWrapper; pub mod model_github_webhook_trigger; pub use self::model_github_webhook_trigger::GithubWebhookTrigger; +pub mod model_incident_created_trigger_wrapper; +pub use self::model_incident_created_trigger_wrapper::IncidentCreatedTriggerWrapper; +pub mod model_incident_created_trigger; +pub use self::model_incident_created_trigger::IncidentCreatedTrigger; +pub mod model_incident_condition; +pub use self::model_incident_condition::IncidentCondition; +pub mod model_incident_tag_value; +pub use self::model_incident_tag_value::IncidentTagValue; +pub mod model_incident_impact_created_trigger_wrapper; +pub use self::model_incident_impact_created_trigger_wrapper::IncidentImpactCreatedTriggerWrapper; +pub mod model_incident_impact_created_trigger; +pub use self::model_incident_impact_created_trigger::IncidentImpactCreatedTrigger; +pub mod model_execution_limit; +pub use self::model_execution_limit::ExecutionLimit; +pub mod model_incident_impact_updated_trigger_wrapper; +pub use self::model_incident_impact_updated_trigger_wrapper::IncidentImpactUpdatedTriggerWrapper; +pub mod model_incident_impact_updated_trigger; +pub use self::model_incident_impact_updated_trigger::IncidentImpactUpdatedTrigger; +pub mod model_incident_postmortem_updated_trigger_wrapper; +pub use self::model_incident_postmortem_updated_trigger_wrapper::IncidentPostmortemUpdatedTriggerWrapper; +pub mod model_incident_postmortem_updated_trigger; +pub use self::model_incident_postmortem_updated_trigger::IncidentPostmortemUpdatedTrigger; +pub mod model_incident_responder_created_trigger_wrapper; +pub use self::model_incident_responder_created_trigger_wrapper::IncidentResponderCreatedTriggerWrapper; +pub mod model_incident_responder_created_trigger; +pub use self::model_incident_responder_created_trigger::IncidentResponderCreatedTrigger; +pub mod model_incident_saved_trigger_wrapper; +pub use self::model_incident_saved_trigger_wrapper::IncidentSavedTriggerWrapper; +pub mod model_incident_saved_trigger; +pub use self::model_incident_saved_trigger::IncidentSavedTrigger; +pub mod model_serial_execution; +pub use self::model_serial_execution::SerialExecution; +pub mod model_incident_schedule_trigger_wrapper; +pub use self::model_incident_schedule_trigger_wrapper::IncidentScheduleTriggerWrapper; +pub mod model_incident_schedule_trigger; +pub use self::model_incident_schedule_trigger::IncidentScheduleTrigger; pub mod model_incident_trigger_wrapper; pub use self::model_incident_trigger_wrapper::IncidentTriggerWrapper; pub mod model_incident_trigger; @@ -15240,6 +15276,10 @@ pub mod model_self_service_trigger_wrapper; pub use self::model_self_service_trigger_wrapper::SelfServiceTriggerWrapper; pub mod model_slack_trigger_wrapper; pub use self::model_slack_trigger_wrapper::SlackTriggerWrapper; +pub mod model_slack_trigger; +pub use self::model_slack_trigger::SlackTrigger; +pub mod model_slack_reaction_config; +pub use self::model_slack_reaction_config::SlackReactionConfig; pub mod model_software_catalog_trigger_wrapper; pub use self::model_software_catalog_trigger_wrapper::SoftwareCatalogTriggerWrapper; pub mod model_workflow_trigger_wrapper; diff --git a/src/datadogV2/model/model_execution_limit.rs b/src/datadogV2/model/model_execution_limit.rs new file mode 100644 index 0000000000..4d556e752f --- /dev/null +++ b/src/datadogV2/model/model_execution_limit.rs @@ -0,0 +1,92 @@ +// 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}; + +/// The maximum number of times to execute a workflow for an incident. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct ExecutionLimit { + /// The maximum number of workflow executions. + #[serde(rename = "count")] + pub count: i32, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl ExecutionLimit { + pub fn new(count: i32) -> ExecutionLimit { + ExecutionLimit { + count, + 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 ExecutionLimit { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct ExecutionLimitVisitor; + impl<'a> Visitor<'a> for ExecutionLimitVisitor { + type Value = ExecutionLimit; + + 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 count: Option = 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() { + "count" => { + count = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let count = count.ok_or_else(|| M::Error::missing_field("count"))?; + + let content = ExecutionLimit { + count, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(ExecutionLimitVisitor) + } +} diff --git a/src/datadogV2/model/model_incident_condition.rs b/src/datadogV2/model/model_incident_condition.rs new file mode 100644 index 0000000000..e1e936a79f --- /dev/null +++ b/src/datadogV2/model/model_incident_condition.rs @@ -0,0 +1,105 @@ +// 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}; + +/// Conditions that determine which incidents trigger the workflow. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct IncidentCondition { + /// Incident tags and values used to filter matching incidents. + #[serde(rename = "tagValues")] + pub tag_values: Option>, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl IncidentCondition { + pub fn new() -> IncidentCondition { + IncidentCondition { + tag_values: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn tag_values(mut self, value: Vec) -> Self { + self.tag_values = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl Default for IncidentCondition { + fn default() -> Self { + Self::new() + } +} + +impl<'de> Deserialize<'de> for IncidentCondition { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct IncidentConditionVisitor; + impl<'a> Visitor<'a> for IncidentConditionVisitor { + type Value = IncidentCondition; + + 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 tag_values: Option> = 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() { + "tagValues" => { + if v.is_null() { + continue; + } + tag_values = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + + let content = IncidentCondition { + tag_values, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(IncidentConditionVisitor) + } +} diff --git a/src/datadogV2/model/model_incident_created_trigger.rs b/src/datadogV2/model/model_incident_created_trigger.rs new file mode 100644 index 0000000000..e783a97f0b --- /dev/null +++ b/src/datadogV2/model/model_incident_created_trigger.rs @@ -0,0 +1,124 @@ +// 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}; + +/// Trigger a workflow when an incident is declared. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct IncidentCreatedTrigger { + /// The type of incident that triggers the workflow. + #[serde(rename = "incidentType")] + pub incident_type: Option, + /// Conditions that determine which incidents trigger the workflow. + #[serde(rename = "tagCondition")] + pub tag_condition: Option, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl IncidentCreatedTrigger { + pub fn new() -> IncidentCreatedTrigger { + IncidentCreatedTrigger { + incident_type: None, + tag_condition: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn incident_type(mut self, value: String) -> Self { + self.incident_type = Some(value); + self + } + + pub fn tag_condition(mut self, value: crate::datadogV2::model::IncidentCondition) -> Self { + self.tag_condition = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl Default for IncidentCreatedTrigger { + fn default() -> Self { + Self::new() + } +} + +impl<'de> Deserialize<'de> for IncidentCreatedTrigger { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct IncidentCreatedTriggerVisitor; + impl<'a> Visitor<'a> for IncidentCreatedTriggerVisitor { + type Value = IncidentCreatedTrigger; + + 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 incident_type: Option = None; + let mut tag_condition: Option = 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() { + "incidentType" => { + if v.is_null() { + continue; + } + incident_type = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "tagCondition" => { + if v.is_null() { + continue; + } + tag_condition = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + + let content = IncidentCreatedTrigger { + incident_type, + tag_condition, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(IncidentCreatedTriggerVisitor) + } +} diff --git a/src/datadogV2/model/model_incident_created_trigger_wrapper.rs b/src/datadogV2/model/model_incident_created_trigger_wrapper.rs new file mode 100644 index 0000000000..706155faea --- /dev/null +++ b/src/datadogV2/model/model_incident_created_trigger_wrapper.rs @@ -0,0 +1,116 @@ +// 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}; + +/// Schema for an incident declared trigger. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct IncidentCreatedTriggerWrapper { + /// Trigger a workflow when an incident is declared. + #[serde(rename = "incidentCreatedTrigger")] + pub incident_created_trigger: crate::datadogV2::model::IncidentCreatedTrigger, + /// Names of existing workflow steps that run first after a trigger fires. + #[serde(rename = "startStepNames")] + pub start_step_names: Option>, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl IncidentCreatedTriggerWrapper { + pub fn new( + incident_created_trigger: crate::datadogV2::model::IncidentCreatedTrigger, + ) -> IncidentCreatedTriggerWrapper { + IncidentCreatedTriggerWrapper { + incident_created_trigger, + start_step_names: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn start_step_names(mut self, value: Vec) -> Self { + self.start_step_names = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for IncidentCreatedTriggerWrapper { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct IncidentCreatedTriggerWrapperVisitor; + impl<'a> Visitor<'a> for IncidentCreatedTriggerWrapperVisitor { + type Value = IncidentCreatedTriggerWrapper; + + 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 incident_created_trigger: Option< + crate::datadogV2::model::IncidentCreatedTrigger, + > = None; + let mut start_step_names: Option> = 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() { + "incidentCreatedTrigger" => { + incident_created_trigger = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "startStepNames" => { + if v.is_null() { + continue; + } + start_step_names = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let incident_created_trigger = incident_created_trigger + .ok_or_else(|| M::Error::missing_field("incident_created_trigger"))?; + + let content = IncidentCreatedTriggerWrapper { + incident_created_trigger, + start_step_names, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(IncidentCreatedTriggerWrapperVisitor) + } +} diff --git a/src/datadogV2/model/model_incident_impact_created_trigger.rs b/src/datadogV2/model/model_incident_impact_created_trigger.rs new file mode 100644 index 0000000000..2776c26d44 --- /dev/null +++ b/src/datadogV2/model/model_incident_impact_created_trigger.rs @@ -0,0 +1,142 @@ +// 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}; + +/// Trigger a workflow when an impact is created for an incident. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct IncidentImpactCreatedTrigger { + /// The maximum number of times to execute a workflow for an incident. + #[serde(rename = "executionLimit")] + pub execution_limit: Option, + /// The type of incident that triggers the workflow. + #[serde(rename = "incidentType")] + pub incident_type: Option, + /// Conditions that determine which incidents trigger the workflow. + #[serde(rename = "tagCondition")] + pub tag_condition: Option, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl IncidentImpactCreatedTrigger { + pub fn new() -> IncidentImpactCreatedTrigger { + IncidentImpactCreatedTrigger { + execution_limit: None, + incident_type: None, + tag_condition: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn execution_limit(mut self, value: crate::datadogV2::model::ExecutionLimit) -> Self { + self.execution_limit = Some(value); + self + } + + pub fn incident_type(mut self, value: String) -> Self { + self.incident_type = Some(value); + self + } + + pub fn tag_condition(mut self, value: crate::datadogV2::model::IncidentCondition) -> Self { + self.tag_condition = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl Default for IncidentImpactCreatedTrigger { + fn default() -> Self { + Self::new() + } +} + +impl<'de> Deserialize<'de> for IncidentImpactCreatedTrigger { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct IncidentImpactCreatedTriggerVisitor; + impl<'a> Visitor<'a> for IncidentImpactCreatedTriggerVisitor { + type Value = IncidentImpactCreatedTrigger; + + 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 execution_limit: Option = None; + let mut incident_type: Option = None; + let mut tag_condition: Option = 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() { + "executionLimit" => { + if v.is_null() { + continue; + } + execution_limit = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "incidentType" => { + if v.is_null() { + continue; + } + incident_type = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "tagCondition" => { + if v.is_null() { + continue; + } + tag_condition = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + + let content = IncidentImpactCreatedTrigger { + execution_limit, + incident_type, + tag_condition, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(IncidentImpactCreatedTriggerVisitor) + } +} diff --git a/src/datadogV2/model/model_incident_impact_created_trigger_wrapper.rs b/src/datadogV2/model/model_incident_impact_created_trigger_wrapper.rs new file mode 100644 index 0000000000..fa5161dd26 --- /dev/null +++ b/src/datadogV2/model/model_incident_impact_created_trigger_wrapper.rs @@ -0,0 +1,116 @@ +// 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}; + +/// Schema for an incident impact created trigger. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct IncidentImpactCreatedTriggerWrapper { + /// Trigger a workflow when an impact is created for an incident. + #[serde(rename = "incidentImpactCreatedTrigger")] + pub incident_impact_created_trigger: crate::datadogV2::model::IncidentImpactCreatedTrigger, + /// Names of existing workflow steps that run first after a trigger fires. + #[serde(rename = "startStepNames")] + pub start_step_names: Option>, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl IncidentImpactCreatedTriggerWrapper { + pub fn new( + incident_impact_created_trigger: crate::datadogV2::model::IncidentImpactCreatedTrigger, + ) -> IncidentImpactCreatedTriggerWrapper { + IncidentImpactCreatedTriggerWrapper { + incident_impact_created_trigger, + start_step_names: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn start_step_names(mut self, value: Vec) -> Self { + self.start_step_names = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for IncidentImpactCreatedTriggerWrapper { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct IncidentImpactCreatedTriggerWrapperVisitor; + impl<'a> Visitor<'a> for IncidentImpactCreatedTriggerWrapperVisitor { + type Value = IncidentImpactCreatedTriggerWrapper; + + 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 incident_impact_created_trigger: Option< + crate::datadogV2::model::IncidentImpactCreatedTrigger, + > = None; + let mut start_step_names: Option> = 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() { + "incidentImpactCreatedTrigger" => { + incident_impact_created_trigger = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "startStepNames" => { + if v.is_null() { + continue; + } + start_step_names = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let incident_impact_created_trigger = incident_impact_created_trigger + .ok_or_else(|| M::Error::missing_field("incident_impact_created_trigger"))?; + + let content = IncidentImpactCreatedTriggerWrapper { + incident_impact_created_trigger, + start_step_names, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(IncidentImpactCreatedTriggerWrapperVisitor) + } +} diff --git a/src/datadogV2/model/model_incident_impact_updated_trigger.rs b/src/datadogV2/model/model_incident_impact_updated_trigger.rs new file mode 100644 index 0000000000..cd67a05efa --- /dev/null +++ b/src/datadogV2/model/model_incident_impact_updated_trigger.rs @@ -0,0 +1,142 @@ +// 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}; + +/// Trigger a workflow when an impact is updated for an incident. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct IncidentImpactUpdatedTrigger { + /// The maximum number of times to execute a workflow for an incident. + #[serde(rename = "executionLimit")] + pub execution_limit: Option, + /// The type of incident that triggers the workflow. + #[serde(rename = "incidentType")] + pub incident_type: Option, + /// Conditions that determine which incidents trigger the workflow. + #[serde(rename = "tagCondition")] + pub tag_condition: Option, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl IncidentImpactUpdatedTrigger { + pub fn new() -> IncidentImpactUpdatedTrigger { + IncidentImpactUpdatedTrigger { + execution_limit: None, + incident_type: None, + tag_condition: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn execution_limit(mut self, value: crate::datadogV2::model::ExecutionLimit) -> Self { + self.execution_limit = Some(value); + self + } + + pub fn incident_type(mut self, value: String) -> Self { + self.incident_type = Some(value); + self + } + + pub fn tag_condition(mut self, value: crate::datadogV2::model::IncidentCondition) -> Self { + self.tag_condition = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl Default for IncidentImpactUpdatedTrigger { + fn default() -> Self { + Self::new() + } +} + +impl<'de> Deserialize<'de> for IncidentImpactUpdatedTrigger { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct IncidentImpactUpdatedTriggerVisitor; + impl<'a> Visitor<'a> for IncidentImpactUpdatedTriggerVisitor { + type Value = IncidentImpactUpdatedTrigger; + + 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 execution_limit: Option = None; + let mut incident_type: Option = None; + let mut tag_condition: Option = 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() { + "executionLimit" => { + if v.is_null() { + continue; + } + execution_limit = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "incidentType" => { + if v.is_null() { + continue; + } + incident_type = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "tagCondition" => { + if v.is_null() { + continue; + } + tag_condition = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + + let content = IncidentImpactUpdatedTrigger { + execution_limit, + incident_type, + tag_condition, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(IncidentImpactUpdatedTriggerVisitor) + } +} diff --git a/src/datadogV2/model/model_incident_impact_updated_trigger_wrapper.rs b/src/datadogV2/model/model_incident_impact_updated_trigger_wrapper.rs new file mode 100644 index 0000000000..58b6b57b5f --- /dev/null +++ b/src/datadogV2/model/model_incident_impact_updated_trigger_wrapper.rs @@ -0,0 +1,116 @@ +// 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}; + +/// Schema for an incident impact updated trigger. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct IncidentImpactUpdatedTriggerWrapper { + /// Trigger a workflow when an impact is updated for an incident. + #[serde(rename = "incidentImpactUpdatedTrigger")] + pub incident_impact_updated_trigger: crate::datadogV2::model::IncidentImpactUpdatedTrigger, + /// Names of existing workflow steps that run first after a trigger fires. + #[serde(rename = "startStepNames")] + pub start_step_names: Option>, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl IncidentImpactUpdatedTriggerWrapper { + pub fn new( + incident_impact_updated_trigger: crate::datadogV2::model::IncidentImpactUpdatedTrigger, + ) -> IncidentImpactUpdatedTriggerWrapper { + IncidentImpactUpdatedTriggerWrapper { + incident_impact_updated_trigger, + start_step_names: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn start_step_names(mut self, value: Vec) -> Self { + self.start_step_names = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for IncidentImpactUpdatedTriggerWrapper { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct IncidentImpactUpdatedTriggerWrapperVisitor; + impl<'a> Visitor<'a> for IncidentImpactUpdatedTriggerWrapperVisitor { + type Value = IncidentImpactUpdatedTriggerWrapper; + + 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 incident_impact_updated_trigger: Option< + crate::datadogV2::model::IncidentImpactUpdatedTrigger, + > = None; + let mut start_step_names: Option> = 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() { + "incidentImpactUpdatedTrigger" => { + incident_impact_updated_trigger = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "startStepNames" => { + if v.is_null() { + continue; + } + start_step_names = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let incident_impact_updated_trigger = incident_impact_updated_trigger + .ok_or_else(|| M::Error::missing_field("incident_impact_updated_trigger"))?; + + let content = IncidentImpactUpdatedTriggerWrapper { + incident_impact_updated_trigger, + start_step_names, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(IncidentImpactUpdatedTriggerWrapperVisitor) + } +} diff --git a/src/datadogV2/model/model_incident_postmortem_updated_trigger.rs b/src/datadogV2/model/model_incident_postmortem_updated_trigger.rs new file mode 100644 index 0000000000..80307ef1e3 --- /dev/null +++ b/src/datadogV2/model/model_incident_postmortem_updated_trigger.rs @@ -0,0 +1,142 @@ +// 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}; + +/// Trigger a workflow when a postmortem is updated for an incident. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct IncidentPostmortemUpdatedTrigger { + /// The maximum number of times to execute a workflow for an incident. + #[serde(rename = "executionLimit")] + pub execution_limit: Option, + /// The type of incident that triggers the workflow. + #[serde(rename = "incidentType")] + pub incident_type: Option, + /// Conditions that determine which incidents trigger the workflow. + #[serde(rename = "tagCondition")] + pub tag_condition: Option, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl IncidentPostmortemUpdatedTrigger { + pub fn new() -> IncidentPostmortemUpdatedTrigger { + IncidentPostmortemUpdatedTrigger { + execution_limit: None, + incident_type: None, + tag_condition: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn execution_limit(mut self, value: crate::datadogV2::model::ExecutionLimit) -> Self { + self.execution_limit = Some(value); + self + } + + pub fn incident_type(mut self, value: String) -> Self { + self.incident_type = Some(value); + self + } + + pub fn tag_condition(mut self, value: crate::datadogV2::model::IncidentCondition) -> Self { + self.tag_condition = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl Default for IncidentPostmortemUpdatedTrigger { + fn default() -> Self { + Self::new() + } +} + +impl<'de> Deserialize<'de> for IncidentPostmortemUpdatedTrigger { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct IncidentPostmortemUpdatedTriggerVisitor; + impl<'a> Visitor<'a> for IncidentPostmortemUpdatedTriggerVisitor { + type Value = IncidentPostmortemUpdatedTrigger; + + 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 execution_limit: Option = None; + let mut incident_type: Option = None; + let mut tag_condition: Option = 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() { + "executionLimit" => { + if v.is_null() { + continue; + } + execution_limit = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "incidentType" => { + if v.is_null() { + continue; + } + incident_type = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "tagCondition" => { + if v.is_null() { + continue; + } + tag_condition = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + + let content = IncidentPostmortemUpdatedTrigger { + execution_limit, + incident_type, + tag_condition, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(IncidentPostmortemUpdatedTriggerVisitor) + } +} diff --git a/src/datadogV2/model/model_incident_postmortem_updated_trigger_wrapper.rs b/src/datadogV2/model/model_incident_postmortem_updated_trigger_wrapper.rs new file mode 100644 index 0000000000..29086211ef --- /dev/null +++ b/src/datadogV2/model/model_incident_postmortem_updated_trigger_wrapper.rs @@ -0,0 +1,119 @@ +// 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}; + +/// Schema for an incident postmortem updated trigger. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct IncidentPostmortemUpdatedTriggerWrapper { + /// Trigger a workflow when a postmortem is updated for an incident. + #[serde(rename = "incidentPostmortemUpdatedTrigger")] + pub incident_postmortem_updated_trigger: + crate::datadogV2::model::IncidentPostmortemUpdatedTrigger, + /// Names of existing workflow steps that run first after a trigger fires. + #[serde(rename = "startStepNames")] + pub start_step_names: Option>, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl IncidentPostmortemUpdatedTriggerWrapper { + pub fn new( + incident_postmortem_updated_trigger: crate::datadogV2::model::IncidentPostmortemUpdatedTrigger, + ) -> IncidentPostmortemUpdatedTriggerWrapper { + IncidentPostmortemUpdatedTriggerWrapper { + incident_postmortem_updated_trigger, + start_step_names: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn start_step_names(mut self, value: Vec) -> Self { + self.start_step_names = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for IncidentPostmortemUpdatedTriggerWrapper { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct IncidentPostmortemUpdatedTriggerWrapperVisitor; + impl<'a> Visitor<'a> for IncidentPostmortemUpdatedTriggerWrapperVisitor { + type Value = IncidentPostmortemUpdatedTriggerWrapper; + + 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 incident_postmortem_updated_trigger: Option< + crate::datadogV2::model::IncidentPostmortemUpdatedTrigger, + > = None; + let mut start_step_names: Option> = 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() { + "incidentPostmortemUpdatedTrigger" => { + incident_postmortem_updated_trigger = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "startStepNames" => { + if v.is_null() { + continue; + } + start_step_names = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let incident_postmortem_updated_trigger = incident_postmortem_updated_trigger + .ok_or_else(|| { + M::Error::missing_field("incident_postmortem_updated_trigger") + })?; + + let content = IncidentPostmortemUpdatedTriggerWrapper { + incident_postmortem_updated_trigger, + start_step_names, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(IncidentPostmortemUpdatedTriggerWrapperVisitor) + } +} diff --git a/src/datadogV2/model/model_incident_responder_created_trigger.rs b/src/datadogV2/model/model_incident_responder_created_trigger.rs new file mode 100644 index 0000000000..21dbcd91ee --- /dev/null +++ b/src/datadogV2/model/model_incident_responder_created_trigger.rs @@ -0,0 +1,142 @@ +// 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}; + +/// Trigger a workflow when a responder is created for an incident. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct IncidentResponderCreatedTrigger { + /// The maximum number of times to execute a workflow for an incident. + #[serde(rename = "executionLimit")] + pub execution_limit: Option, + /// The type of incident that triggers the workflow. + #[serde(rename = "incidentType")] + pub incident_type: Option, + /// Conditions that determine which incidents trigger the workflow. + #[serde(rename = "tagCondition")] + pub tag_condition: Option, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl IncidentResponderCreatedTrigger { + pub fn new() -> IncidentResponderCreatedTrigger { + IncidentResponderCreatedTrigger { + execution_limit: None, + incident_type: None, + tag_condition: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn execution_limit(mut self, value: crate::datadogV2::model::ExecutionLimit) -> Self { + self.execution_limit = Some(value); + self + } + + pub fn incident_type(mut self, value: String) -> Self { + self.incident_type = Some(value); + self + } + + pub fn tag_condition(mut self, value: crate::datadogV2::model::IncidentCondition) -> Self { + self.tag_condition = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl Default for IncidentResponderCreatedTrigger { + fn default() -> Self { + Self::new() + } +} + +impl<'de> Deserialize<'de> for IncidentResponderCreatedTrigger { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct IncidentResponderCreatedTriggerVisitor; + impl<'a> Visitor<'a> for IncidentResponderCreatedTriggerVisitor { + type Value = IncidentResponderCreatedTrigger; + + 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 execution_limit: Option = None; + let mut incident_type: Option = None; + let mut tag_condition: Option = 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() { + "executionLimit" => { + if v.is_null() { + continue; + } + execution_limit = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "incidentType" => { + if v.is_null() { + continue; + } + incident_type = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "tagCondition" => { + if v.is_null() { + continue; + } + tag_condition = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + + let content = IncidentResponderCreatedTrigger { + execution_limit, + incident_type, + tag_condition, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(IncidentResponderCreatedTriggerVisitor) + } +} diff --git a/src/datadogV2/model/model_incident_responder_created_trigger_wrapper.rs b/src/datadogV2/model/model_incident_responder_created_trigger_wrapper.rs new file mode 100644 index 0000000000..fad485c97a --- /dev/null +++ b/src/datadogV2/model/model_incident_responder_created_trigger_wrapper.rs @@ -0,0 +1,117 @@ +// 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}; + +/// Schema for an incident responder created trigger. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct IncidentResponderCreatedTriggerWrapper { + /// Trigger a workflow when a responder is created for an incident. + #[serde(rename = "incidentResponderCreatedTrigger")] + pub incident_responder_created_trigger: + crate::datadogV2::model::IncidentResponderCreatedTrigger, + /// Names of existing workflow steps that run first after a trigger fires. + #[serde(rename = "startStepNames")] + pub start_step_names: Option>, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl IncidentResponderCreatedTriggerWrapper { + pub fn new( + incident_responder_created_trigger: crate::datadogV2::model::IncidentResponderCreatedTrigger, + ) -> IncidentResponderCreatedTriggerWrapper { + IncidentResponderCreatedTriggerWrapper { + incident_responder_created_trigger, + start_step_names: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn start_step_names(mut self, value: Vec) -> Self { + self.start_step_names = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for IncidentResponderCreatedTriggerWrapper { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct IncidentResponderCreatedTriggerWrapperVisitor; + impl<'a> Visitor<'a> for IncidentResponderCreatedTriggerWrapperVisitor { + type Value = IncidentResponderCreatedTriggerWrapper; + + 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 incident_responder_created_trigger: Option< + crate::datadogV2::model::IncidentResponderCreatedTrigger, + > = None; + let mut start_step_names: Option> = 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() { + "incidentResponderCreatedTrigger" => { + incident_responder_created_trigger = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "startStepNames" => { + if v.is_null() { + continue; + } + start_step_names = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let incident_responder_created_trigger = incident_responder_created_trigger + .ok_or_else(|| M::Error::missing_field("incident_responder_created_trigger"))?; + + let content = IncidentResponderCreatedTriggerWrapper { + incident_responder_created_trigger, + start_step_names, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(IncidentResponderCreatedTriggerWrapperVisitor) + } +} diff --git a/src/datadogV2/model/model_incident_saved_trigger.rs b/src/datadogV2/model/model_incident_saved_trigger.rs new file mode 100644 index 0000000000..785415f54b --- /dev/null +++ b/src/datadogV2/model/model_incident_saved_trigger.rs @@ -0,0 +1,160 @@ +// 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}; + +/// Trigger a workflow when an incident is declared or updated. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct IncidentSavedTrigger { + /// The maximum number of times to execute a workflow for an incident. + #[serde(rename = "executionLimit")] + pub execution_limit: Option, + /// The type of incident that triggers the workflow. + #[serde(rename = "incidentType")] + pub incident_type: Option, + /// Whether to execute the workflow serially for an incident. + #[serde(rename = "serialExecution")] + pub serial_execution: Option, + /// Conditions that determine which incidents trigger the workflow. + #[serde(rename = "tagCondition")] + pub tag_condition: Option, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl IncidentSavedTrigger { + pub fn new() -> IncidentSavedTrigger { + IncidentSavedTrigger { + execution_limit: None, + incident_type: None, + serial_execution: None, + tag_condition: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn execution_limit(mut self, value: crate::datadogV2::model::ExecutionLimit) -> Self { + self.execution_limit = Some(value); + self + } + + pub fn incident_type(mut self, value: String) -> Self { + self.incident_type = Some(value); + self + } + + pub fn serial_execution(mut self, value: crate::datadogV2::model::SerialExecution) -> Self { + self.serial_execution = Some(value); + self + } + + pub fn tag_condition(mut self, value: crate::datadogV2::model::IncidentCondition) -> Self { + self.tag_condition = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl Default for IncidentSavedTrigger { + fn default() -> Self { + Self::new() + } +} + +impl<'de> Deserialize<'de> for IncidentSavedTrigger { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct IncidentSavedTriggerVisitor; + impl<'a> Visitor<'a> for IncidentSavedTriggerVisitor { + type Value = IncidentSavedTrigger; + + 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 execution_limit: Option = None; + let mut incident_type: Option = None; + let mut serial_execution: Option = None; + let mut tag_condition: Option = 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() { + "executionLimit" => { + if v.is_null() { + continue; + } + execution_limit = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "incidentType" => { + if v.is_null() { + continue; + } + incident_type = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "serialExecution" => { + if v.is_null() { + continue; + } + serial_execution = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "tagCondition" => { + if v.is_null() { + continue; + } + tag_condition = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + + let content = IncidentSavedTrigger { + execution_limit, + incident_type, + serial_execution, + tag_condition, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(IncidentSavedTriggerVisitor) + } +} diff --git a/src/datadogV2/model/model_incident_saved_trigger_wrapper.rs b/src/datadogV2/model/model_incident_saved_trigger_wrapper.rs new file mode 100644 index 0000000000..e769237e85 --- /dev/null +++ b/src/datadogV2/model/model_incident_saved_trigger_wrapper.rs @@ -0,0 +1,116 @@ +// 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}; + +/// Schema for an incident declared or updated trigger. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct IncidentSavedTriggerWrapper { + /// Trigger a workflow when an incident is declared or updated. + #[serde(rename = "incidentSavedTrigger")] + pub incident_saved_trigger: crate::datadogV2::model::IncidentSavedTrigger, + /// Names of existing workflow steps that run first after a trigger fires. + #[serde(rename = "startStepNames")] + pub start_step_names: Option>, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl IncidentSavedTriggerWrapper { + pub fn new( + incident_saved_trigger: crate::datadogV2::model::IncidentSavedTrigger, + ) -> IncidentSavedTriggerWrapper { + IncidentSavedTriggerWrapper { + incident_saved_trigger, + start_step_names: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn start_step_names(mut self, value: Vec) -> Self { + self.start_step_names = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for IncidentSavedTriggerWrapper { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct IncidentSavedTriggerWrapperVisitor; + impl<'a> Visitor<'a> for IncidentSavedTriggerWrapperVisitor { + type Value = IncidentSavedTriggerWrapper; + + 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 incident_saved_trigger: Option< + crate::datadogV2::model::IncidentSavedTrigger, + > = None; + let mut start_step_names: Option> = 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() { + "incidentSavedTrigger" => { + incident_saved_trigger = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "startStepNames" => { + if v.is_null() { + continue; + } + start_step_names = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let incident_saved_trigger = incident_saved_trigger + .ok_or_else(|| M::Error::missing_field("incident_saved_trigger"))?; + + let content = IncidentSavedTriggerWrapper { + incident_saved_trigger, + start_step_names, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(IncidentSavedTriggerWrapperVisitor) + } +} diff --git a/src/datadogV2/model/model_incident_schedule_trigger.rs b/src/datadogV2/model/model_incident_schedule_trigger.rs new file mode 100644 index 0000000000..838103ef1e --- /dev/null +++ b/src/datadogV2/model/model_incident_schedule_trigger.rs @@ -0,0 +1,128 @@ +// 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}; + +/// Trigger a workflow on a schedule for an incident. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct IncidentScheduleTrigger { + /// The type of incident that triggers the workflow. + #[serde(rename = "incidentType")] + pub incident_type: Option, + /// The recurrence rule for the schedule, expressed as an iCalendar `RRULE` string. + #[serde(rename = "rrule")] + pub rrule: String, + /// Conditions that determine which incidents trigger the workflow. + #[serde(rename = "tagCondition")] + pub tag_condition: Option, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl IncidentScheduleTrigger { + pub fn new(rrule: String) -> IncidentScheduleTrigger { + IncidentScheduleTrigger { + incident_type: None, + rrule, + tag_condition: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn incident_type(mut self, value: String) -> Self { + self.incident_type = Some(value); + self + } + + pub fn tag_condition(mut self, value: crate::datadogV2::model::IncidentCondition) -> Self { + self.tag_condition = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for IncidentScheduleTrigger { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct IncidentScheduleTriggerVisitor; + impl<'a> Visitor<'a> for IncidentScheduleTriggerVisitor { + type Value = IncidentScheduleTrigger; + + 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 incident_type: Option = None; + let mut rrule: Option = None; + let mut tag_condition: Option = 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() { + "incidentType" => { + if v.is_null() { + continue; + } + incident_type = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "rrule" => { + rrule = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "tagCondition" => { + if v.is_null() { + continue; + } + tag_condition = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let rrule = rrule.ok_or_else(|| M::Error::missing_field("rrule"))?; + + let content = IncidentScheduleTrigger { + incident_type, + rrule, + tag_condition, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(IncidentScheduleTriggerVisitor) + } +} diff --git a/src/datadogV2/model/model_incident_schedule_trigger_wrapper.rs b/src/datadogV2/model/model_incident_schedule_trigger_wrapper.rs new file mode 100644 index 0000000000..8c42625ee9 --- /dev/null +++ b/src/datadogV2/model/model_incident_schedule_trigger_wrapper.rs @@ -0,0 +1,116 @@ +// 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}; + +/// Schema for an incident schedule trigger. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct IncidentScheduleTriggerWrapper { + /// Trigger a workflow on a schedule for an incident. + #[serde(rename = "incidentScheduleTrigger")] + pub incident_schedule_trigger: crate::datadogV2::model::IncidentScheduleTrigger, + /// Names of existing workflow steps that run first after a trigger fires. + #[serde(rename = "startStepNames")] + pub start_step_names: Option>, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl IncidentScheduleTriggerWrapper { + pub fn new( + incident_schedule_trigger: crate::datadogV2::model::IncidentScheduleTrigger, + ) -> IncidentScheduleTriggerWrapper { + IncidentScheduleTriggerWrapper { + incident_schedule_trigger, + start_step_names: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn start_step_names(mut self, value: Vec) -> Self { + self.start_step_names = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for IncidentScheduleTriggerWrapper { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct IncidentScheduleTriggerWrapperVisitor; + impl<'a> Visitor<'a> for IncidentScheduleTriggerWrapperVisitor { + type Value = IncidentScheduleTriggerWrapper; + + 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 incident_schedule_trigger: Option< + crate::datadogV2::model::IncidentScheduleTrigger, + > = None; + let mut start_step_names: Option> = 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() { + "incidentScheduleTrigger" => { + incident_schedule_trigger = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "startStepNames" => { + if v.is_null() { + continue; + } + start_step_names = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let incident_schedule_trigger = incident_schedule_trigger + .ok_or_else(|| M::Error::missing_field("incident_schedule_trigger"))?; + + let content = IncidentScheduleTriggerWrapper { + incident_schedule_trigger, + start_step_names, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(IncidentScheduleTriggerWrapperVisitor) + } +} diff --git a/src/datadogV2/model/model_incident_tag_value.rs b/src/datadogV2/model/model_incident_tag_value.rs new file mode 100644 index 0000000000..f7a3e27f8f --- /dev/null +++ b/src/datadogV2/model/model_incident_tag_value.rs @@ -0,0 +1,102 @@ +// 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}; + +/// An incident tag and its accepted values. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct IncidentTagValue { + /// The incident tag to match. + #[serde(rename = "tag")] + pub tag: String, + /// The accepted values for the incident tag. + #[serde(rename = "values")] + pub values: Vec, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl IncidentTagValue { + pub fn new(tag: String, values: Vec) -> IncidentTagValue { + IncidentTagValue { + tag, + values, + 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 IncidentTagValue { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct IncidentTagValueVisitor; + impl<'a> Visitor<'a> for IncidentTagValueVisitor { + type Value = IncidentTagValue; + + 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 tag: Option = None; + let mut values: Option> = 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() { + "tag" => { + tag = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "values" => { + values = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let tag = tag.ok_or_else(|| M::Error::missing_field("tag"))?; + let values = values.ok_or_else(|| M::Error::missing_field("values"))?; + + let content = IncidentTagValue { + tag, + values, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(IncidentTagValueVisitor) + } +} diff --git a/src/datadogV2/model/model_incident_trigger.rs b/src/datadogV2/model/model_incident_trigger.rs index 1d7a3eaac0..64ad995c5c 100644 --- a/src/datadogV2/model/model_incident_trigger.rs +++ b/src/datadogV2/model/model_incident_trigger.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// Trigger a workflow from an Incident. For automatic triggering a handle must be configured and the workflow must be published. +/// Trigger a workflow from an incident. For automatic triggering a handle must be configured and the workflow must be published. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] @@ -14,6 +14,9 @@ pub struct IncidentTrigger { /// Defines a rate limit for a trigger. #[serde(rename = "rateLimit")] pub rate_limit: Option, + /// Version of the incident manual trigger. + #[serde(rename = "version")] + pub version: Option, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -25,6 +28,7 @@ impl IncidentTrigger { pub fn new() -> IncidentTrigger { IncidentTrigger { rate_limit: None, + version: None, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, } @@ -35,6 +39,11 @@ impl IncidentTrigger { self } + pub fn version(mut self, value: String) -> Self { + self.version = Some(value); + self + } + pub fn additional_properties( mut self, value: std::collections::BTreeMap, @@ -68,6 +77,7 @@ impl<'de> Deserialize<'de> for IncidentTrigger { M: MapAccess<'a>, { let mut rate_limit: Option = None; + let mut version: Option = None; let mut additional_properties: std::collections::BTreeMap< String, serde_json::Value, @@ -82,6 +92,12 @@ impl<'de> Deserialize<'de> for IncidentTrigger { } rate_limit = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } + "version" => { + if v.is_null() { + continue; + } + version = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } &_ => { if let Ok(value) = serde_json::from_value(v.clone()) { additional_properties.insert(k, value); @@ -92,6 +108,7 @@ impl<'de> Deserialize<'de> for IncidentTrigger { let content = IncidentTrigger { rate_limit, + version, additional_properties, _unparsed, }; diff --git a/src/datadogV2/model/model_incident_trigger_wrapper.rs b/src/datadogV2/model/model_incident_trigger_wrapper.rs index 0c91c34a3d..c5989878b0 100644 --- a/src/datadogV2/model/model_incident_trigger_wrapper.rs +++ b/src/datadogV2/model/model_incident_trigger_wrapper.rs @@ -6,12 +6,12 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// Schema for an Incident-based trigger. +/// Schema for an incident-based trigger. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] pub struct IncidentTriggerWrapper { - /// Trigger a workflow from an Incident. For automatic triggering a handle must be configured and the workflow must be published. + /// Trigger a workflow from an incident. For automatic triggering a handle must be configured and the workflow must be published. #[serde(rename = "incidentTrigger")] pub incident_trigger: crate::datadogV2::model::IncidentTrigger, /// Names of existing workflow steps that run first after a trigger fires. diff --git a/src/datadogV2/model/model_serial_execution.rs b/src/datadogV2/model/model_serial_execution.rs new file mode 100644 index 0000000000..b00d8f747a --- /dev/null +++ b/src/datadogV2/model/model_serial_execution.rs @@ -0,0 +1,92 @@ +// 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}; + +/// Whether to execute the workflow serially for an incident. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct SerialExecution { + /// Whether serial execution is enabled. + #[serde(rename = "enabled")] + pub enabled: bool, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl SerialExecution { + pub fn new(enabled: bool) -> SerialExecution { + SerialExecution { + enabled, + 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 SerialExecution { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct SerialExecutionVisitor; + impl<'a> Visitor<'a> for SerialExecutionVisitor { + type Value = SerialExecution; + + 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 enabled: Option = 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() { + "enabled" => { + enabled = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let enabled = enabled.ok_or_else(|| M::Error::missing_field("enabled"))?; + + let content = SerialExecution { + enabled, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(SerialExecutionVisitor) + } +} diff --git a/src/datadogV2/model/model_slack_reaction_config.rs b/src/datadogV2/model/model_slack_reaction_config.rs new file mode 100644 index 0000000000..9761e537bc --- /dev/null +++ b/src/datadogV2/model/model_slack_reaction_config.rs @@ -0,0 +1,104 @@ +// 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}; + +/// Configuration for a Slack emoji reaction trigger. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct SlackReactionConfig { + /// The Slack emoji reaction name. + #[serde(rename = "reactionEmoji")] + pub reaction_emoji: String, + /// The Slack workspace ID. + #[serde(rename = "teamId")] + pub team_id: String, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl SlackReactionConfig { + pub fn new(reaction_emoji: String, team_id: String) -> SlackReactionConfig { + SlackReactionConfig { + reaction_emoji, + team_id, + 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 SlackReactionConfig { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct SlackReactionConfigVisitor; + impl<'a> Visitor<'a> for SlackReactionConfigVisitor { + type Value = SlackReactionConfig; + + 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 reaction_emoji: Option = None; + let mut team_id: Option = 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() { + "reactionEmoji" => { + reaction_emoji = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "teamId" => { + team_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let reaction_emoji = + reaction_emoji.ok_or_else(|| M::Error::missing_field("reaction_emoji"))?; + let team_id = team_id.ok_or_else(|| M::Error::missing_field("team_id"))?; + + let content = SlackReactionConfig { + reaction_emoji, + team_id, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(SlackReactionConfigVisitor) + } +} diff --git a/src/datadogV2/model/model_slack_trigger.rs b/src/datadogV2/model/model_slack_trigger.rs new file mode 100644 index 0000000000..5774f9abe0 --- /dev/null +++ b/src/datadogV2/model/model_slack_trigger.rs @@ -0,0 +1,111 @@ +// 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}; + +/// Trigger a workflow from Slack. The workflow must be published. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct SlackTrigger { + /// Slack emoji reactions that trigger the workflow. + #[serde(rename = "reactionTriggers")] + pub reaction_triggers: Option>, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl SlackTrigger { + pub fn new() -> SlackTrigger { + SlackTrigger { + reaction_triggers: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn reaction_triggers( + mut self, + value: Vec, + ) -> Self { + self.reaction_triggers = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl Default for SlackTrigger { + fn default() -> Self { + Self::new() + } +} + +impl<'de> Deserialize<'de> for SlackTrigger { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct SlackTriggerVisitor; + impl<'a> Visitor<'a> for SlackTriggerVisitor { + type Value = SlackTrigger; + + 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 reaction_triggers: Option< + Vec, + > = 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() { + "reactionTriggers" => { + if v.is_null() { + continue; + } + reaction_triggers = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + + let content = SlackTrigger { + reaction_triggers, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(SlackTriggerVisitor) + } +} diff --git a/src/datadogV2/model/model_slack_trigger_wrapper.rs b/src/datadogV2/model/model_slack_trigger_wrapper.rs index 0433d9e924..bb1c4d7d8d 100644 --- a/src/datadogV2/model/model_slack_trigger_wrapper.rs +++ b/src/datadogV2/model/model_slack_trigger_wrapper.rs @@ -13,7 +13,7 @@ use std::fmt::{self, Formatter}; pub struct SlackTriggerWrapper { /// Trigger a workflow from Slack. The workflow must be published. #[serde(rename = "slackTrigger")] - pub slack_trigger: std::collections::BTreeMap, + pub slack_trigger: crate::datadogV2::model::SlackTrigger, /// Names of existing workflow steps that run first after a trigger fires. #[serde(rename = "startStepNames")] pub start_step_names: Option>, @@ -25,9 +25,7 @@ pub struct SlackTriggerWrapper { } impl SlackTriggerWrapper { - pub fn new( - slack_trigger: std::collections::BTreeMap, - ) -> SlackTriggerWrapper { + pub fn new(slack_trigger: crate::datadogV2::model::SlackTrigger) -> SlackTriggerWrapper { SlackTriggerWrapper { slack_trigger, start_step_names: None, @@ -67,9 +65,7 @@ impl<'de> Deserialize<'de> for SlackTriggerWrapper { where M: MapAccess<'a>, { - let mut slack_trigger: Option< - std::collections::BTreeMap, - > = None; + let mut slack_trigger: Option = None; let mut start_step_names: Option> = None; let mut additional_properties: std::collections::BTreeMap< String, diff --git a/src/datadogV2/model/model_trigger.rs b/src/datadogV2/model/model_trigger.rs index ca61c1f905..bf0a598d2f 100644 --- a/src/datadogV2/model/model_trigger.rs +++ b/src/datadogV2/model/model_trigger.rs @@ -20,6 +20,21 @@ pub enum Trigger { DashboardTriggerWrapper(Box), FormTriggerWrapper(Box), GithubWebhookTriggerWrapper(Box), + IncidentCreatedTriggerWrapper(Box), + IncidentImpactCreatedTriggerWrapper( + Box, + ), + IncidentImpactUpdatedTriggerWrapper( + Box, + ), + IncidentPostmortemUpdatedTriggerWrapper( + Box, + ), + IncidentResponderCreatedTriggerWrapper( + Box, + ), + IncidentSavedTriggerWrapper(Box), + IncidentScheduleTriggerWrapper(Box), IncidentTriggerWrapper(Box), MonitorTriggerWrapper(Box), NotebookTriggerWrapper(Box), @@ -114,6 +129,62 @@ impl<'de> Deserialize<'de> for Trigger { return Ok(Trigger::GithubWebhookTriggerWrapper(_v)); } } + if let Ok(_v) = serde_json::from_value::< + Box, + >(value.clone()) + { + if !_v._unparsed { + return Ok(Trigger::IncidentCreatedTriggerWrapper(_v)); + } + } + if let Ok(_v) = serde_json::from_value::< + Box, + >(value.clone()) + { + if !_v._unparsed { + return Ok(Trigger::IncidentImpactCreatedTriggerWrapper(_v)); + } + } + if let Ok(_v) = serde_json::from_value::< + Box, + >(value.clone()) + { + if !_v._unparsed { + return Ok(Trigger::IncidentImpactUpdatedTriggerWrapper(_v)); + } + } + if let Ok(_v) = serde_json::from_value::< + Box, + >(value.clone()) + { + if !_v._unparsed { + return Ok(Trigger::IncidentPostmortemUpdatedTriggerWrapper(_v)); + } + } + if let Ok(_v) = serde_json::from_value::< + Box, + >(value.clone()) + { + if !_v._unparsed { + return Ok(Trigger::IncidentResponderCreatedTriggerWrapper(_v)); + } + } + if let Ok(_v) = serde_json::from_value::< + Box, + >(value.clone()) + { + if !_v._unparsed { + return Ok(Trigger::IncidentSavedTriggerWrapper(_v)); + } + } + if let Ok(_v) = serde_json::from_value::< + Box, + >(value.clone()) + { + if !_v._unparsed { + return Ok(Trigger::IncidentScheduleTriggerWrapper(_v)); + } + } if let Ok(_v) = serde_json::from_value::>( value.clone(), ) {