Skip to main content

onesignal_rust_api/models/
journey.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/// Journey : Full journey representation returned by the detail, create, and update endpoints.
11
12
13
14#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
15pub struct Journey {
16    /// Journey UUID. Read-only.
17    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
18    pub id: Option<String>,
19    /// UUID of the app the journey belongs to. Read-only.
20    #[serde(rename = "app_id", skip_serializing_if = "Option::is_none")]
21    pub app_id: Option<String>,
22    /// Journey name, up to 300 characters.
23    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
24    pub name: Option<String>,
25    /// Journey description, up to 1024 characters. Defaults to an empty string.
26    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
27    pub description: Option<String>,
28    /// Journey state. New journeys are created as draft. processing is transient while activation is in progress. archived is a journey that has been stopped. Change it through the state field on Update journey.
29    #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
30    pub state: Option<StateType>,
31    /// ISO 8601 creation time. Read-only.
32    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
33    pub created_at: Option<String>,
34    /// ISO 8601 last-update time. Read-only.
35    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
36    pub updated_at: Option<String>,
37    /// ISO 8601 time the journey was activated, or null. Read-only. May stay null briefly after you set state to active: activation is enqueued, and started_at populates once the journey finishes processing.
38    #[serde(rename = "started_at", skip_serializing_if = "Option::is_none")]
39    pub started_at: Option<String>,
40    /// ISO 8601 time the journey was archived, or null. Read-only.
41    #[serde(rename = "archived_at", skip_serializing_if = "Option::is_none")]
42    pub archived_at: Option<String>,
43    /// Origin of the journey, for example public_api or dashboard. Read-only.
44    #[serde(rename = "created_source", skip_serializing_if = "Option::is_none")]
45    pub created_source: Option<String>,
46    #[serde(rename = "audience", skip_serializing_if = "Option::is_none")]
47    pub audience: Option<Box<crate::models::JourneyAudience>>,
48    #[serde(rename = "early_exit", skip_serializing_if = "Option::is_none")]
49    pub early_exit: Option<Box<crate::models::JourneyEarlyExit>>,
50    #[serde(rename = "reentry_rules", skip_serializing_if = "Option::is_none")]
51    pub reentry_rules: Option<Box<crate::models::JourneyReentryRules>>,
52    #[serde(rename = "schedule", skip_serializing_if = "Option::is_none")]
53    pub schedule: Option<Box<crate::models::JourneySchedule>>,
54    /// Ordered list of journey nodes.
55    #[serde(rename = "nodes", skip_serializing_if = "Option::is_none")]
56    pub nodes: Option<Vec<crate::models::JourneyNode>>,
57    /// Opaque optimistic-concurrency token. Read-only. Pass it back on update to guard against overwriting a concurrent change (409). Send it back exactly as read; do not construct or parse it.
58    #[serde(rename = "concurrency_key", skip_serializing_if = "Option::is_none")]
59    pub concurrency_key: Option<String>,
60}
61
62impl Journey {
63    /// Full journey representation returned by the detail, create, and update endpoints.
64    pub fn new() -> Journey {
65        Journey {
66            id: None,
67            app_id: None,
68            name: None,
69            description: None,
70            state: None,
71            created_at: None,
72            updated_at: None,
73            started_at: None,
74            archived_at: None,
75            created_source: None,
76            audience: None,
77            early_exit: None,
78            reentry_rules: None,
79            schedule: None,
80            nodes: None,
81            concurrency_key: None,
82        }
83    }
84}
85
86/// Journey state. New journeys are created as draft. processing is transient while activation is in progress. archived is a journey that has been stopped. Change it through the state field on Update journey.
87#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
88pub enum StateType {
89    #[serde(rename = "draft")]
90    Draft,
91    #[serde(rename = "scheduled")]
92    Scheduled,
93    #[serde(rename = "processing")]
94    Processing,
95    #[serde(rename = "active")]
96    Active,
97    #[serde(rename = "archived")]
98    Archived,
99}
100
101impl Default for StateType {
102    fn default() -> StateType {
103        Self::Draft
104    }
105}
106