Skip to main content

onesignal_rust_api/models/
journey_node_stats.rs

1/*
2 * OneSignal
3 *
4 * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
5 *
6 * Contact: devrel@onesignal.com
7 * Generated by: https://openapi-generator.tech
8 */
9
10/// JourneyNodeStats : Stats for a single node. Keyed in the response by the node's server-assigned id.
11
12
13
14#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
15pub struct JourneyNodeStats {
16    /// Node kind, repeated here so stats can be read without joining against the journey definition.
17    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
18    pub kind: Option<KindType>,
19    /// Users currently held at this node.
20    #[serde(rename = "waiting", skip_serializing_if = "Option::is_none")]
21    pub waiting: Option<i32>,
22    /// Users who advanced past this node normally.
23    #[serde(rename = "completed", skip_serializing_if = "Option::is_none")]
24    pub completed: Option<i32>,
25    /// Users who left the journey from this node through an early exit rule.
26    #[serde(rename = "exited_early", skip_serializing_if = "Option::is_none")]
27    pub exited_early: Option<i32>,
28    #[serde(rename = "message_stats", skip_serializing_if = "Option::is_none")]
29    pub message_stats: Option<Box<crate::models::JourneyMessageStats>>,
30}
31
32impl JourneyNodeStats {
33    /// Stats for a single node. Keyed in the response by the node's server-assigned id.
34    pub fn new() -> JourneyNodeStats {
35        JourneyNodeStats {
36            kind: None,
37            waiting: None,
38            completed: None,
39            exited_early: None,
40            message_stats: None,
41        }
42    }
43}
44
45/// Node kind, repeated here so stats can be read without joining against the journey definition.
46#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
47pub enum KindType {
48    #[serde(rename = "wait")]
49    Wait,
50    #[serde(rename = "time_window")]
51    TimeWindow,
52    #[serde(rename = "send_push")]
53    SendPush,
54    #[serde(rename = "send_email")]
55    SendEmail,
56    #[serde(rename = "send_sms")]
57    SendSms,
58    #[serde(rename = "send_iam")]
59    SendIam,
60    #[serde(rename = "send_webhook")]
61    SendWebhook,
62    #[serde(rename = "tag")]
63    Tag,
64    #[serde(rename = "split_range")]
65    SplitRange,
66    #[serde(rename = "yes_no")]
67    YesNo,
68    #[serde(rename = "wait_until")]
69    WaitUntil,
70}
71
72impl Default for KindType {
73    fn default() -> KindType {
74        Self::Wait
75    }
76}
77