onesignal-rust-api 5.12.0

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
Documentation
/*
 * OneSignal
 *
 * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
 *
 * Contact: devrel@onesignal.com
 * Generated by: https://openapi-generator.tech
 */

/// JourneyNodeStats : Stats for a single node. Keyed in the response by the node's server-assigned id.



#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct JourneyNodeStats {
    /// Node kind, repeated here so stats can be read without joining against the journey definition.
    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
    pub kind: Option<KindType>,
    /// Users currently held at this node.
    #[serde(rename = "waiting", skip_serializing_if = "Option::is_none")]
    pub waiting: Option<i32>,
    /// Users who advanced past this node normally.
    #[serde(rename = "completed", skip_serializing_if = "Option::is_none")]
    pub completed: Option<i32>,
    /// Users who left the journey from this node through an early exit rule.
    #[serde(rename = "exited_early", skip_serializing_if = "Option::is_none")]
    pub exited_early: Option<i32>,
    #[serde(rename = "message_stats", skip_serializing_if = "Option::is_none")]
    pub message_stats: Option<Box<crate::models::JourneyMessageStats>>,
}

impl JourneyNodeStats {
    /// Stats for a single node. Keyed in the response by the node's server-assigned id.
    pub fn new() -> JourneyNodeStats {
        JourneyNodeStats {
            kind: None,
            waiting: None,
            completed: None,
            exited_early: None,
            message_stats: None,
        }
    }
}

/// Node kind, repeated here so stats can be read without joining against the journey definition.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum KindType {
    #[serde(rename = "wait")]
    Wait,
    #[serde(rename = "time_window")]
    TimeWindow,
    #[serde(rename = "send_push")]
    SendPush,
    #[serde(rename = "send_email")]
    SendEmail,
    #[serde(rename = "send_sms")]
    SendSms,
    #[serde(rename = "send_iam")]
    SendIam,
    #[serde(rename = "send_webhook")]
    SendWebhook,
    #[serde(rename = "tag")]
    Tag,
    #[serde(rename = "split_range")]
    SplitRange,
    #[serde(rename = "yes_no")]
    YesNo,
    #[serde(rename = "wait_until")]
    WaitUntil,
}

impl Default for KindType {
    fn default() -> KindType {
        Self::Wait
    }
}