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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53833,6 +53833,10 @@ components:
OnCallTrigger:
description: "Trigger a workflow from an On-Call Page or On-Call Handover. For automatic triggering a handle must be configured and the workflow must be published."
properties:
handle:
description: "The handle used to reference this trigger from On-Call. Required for automatic triggering."
example: ""
type: string
rateLimit:
$ref: "#/components/schemas/TriggerRateLimit"
type: object
Expand Down
17 changes: 17 additions & 0 deletions src/datadogV2/model/model_on_call_trigger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ use std::fmt::{self, Formatter};
#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize)]
pub struct OnCallTrigger {
/// The handle used to reference this trigger from On-Call. Required for automatic triggering.
#[serde(rename = "handle")]
pub handle: Option<String>,
/// Defines a rate limit for a trigger.
#[serde(rename = "rateLimit")]
pub rate_limit: Option<crate::datadogV2::model::TriggerRateLimit>,
Expand All @@ -24,12 +27,18 @@ pub struct OnCallTrigger {
impl OnCallTrigger {
pub fn new() -> OnCallTrigger {
OnCallTrigger {
handle: None,
rate_limit: None,
additional_properties: std::collections::BTreeMap::new(),
_unparsed: false,
}
}

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

pub fn rate_limit(mut self, value: crate::datadogV2::model::TriggerRateLimit) -> Self {
self.rate_limit = Some(value);
self
Expand Down Expand Up @@ -67,6 +76,7 @@ impl<'de> Deserialize<'de> for OnCallTrigger {
where
M: MapAccess<'a>,
{
let mut handle: Option<String> = None;
let mut rate_limit: Option<crate::datadogV2::model::TriggerRateLimit> = None;
let mut additional_properties: std::collections::BTreeMap<
String,
Expand All @@ -76,6 +86,12 @@ impl<'de> Deserialize<'de> for OnCallTrigger {

while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
match k.as_str() {
"handle" => {
if v.is_null() {
continue;
}
handle = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"rateLimit" => {
if v.is_null() {
continue;
Expand All @@ -91,6 +107,7 @@ impl<'de> Deserialize<'de> for OnCallTrigger {
}

let content = OnCallTrigger {
handle,
rate_limit,
additional_properties,
_unparsed,
Expand Down
Loading