Skip to main content

onesignal_rust_api/models/
update_journey_request.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/// UpdateJourneyRequest : Partial update applied with JSON Merge Patch (RFC 7396). Send only the fields you want to change. A null value clears a nullable field. Arrays such as nodes are replaced wholesale.
11
12
13
14#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
15pub struct UpdateJourneyRequest {
16    /// Journey name.
17    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
18    pub name: Option<String>,
19    /// Journey description. Send null to clear it.
20    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
21    pub description: Option<String>,
22    #[serde(rename = "audience", skip_serializing_if = "Option::is_none")]
23    pub audience: Option<Box<crate::models::JourneyAudience>>,
24    #[serde(rename = "early_exit", skip_serializing_if = "Option::is_none")]
25    pub early_exit: Option<Box<crate::models::JourneyEarlyExit>>,
26    #[serde(rename = "reentry_rules", skip_serializing_if = "Option::is_none")]
27    pub reentry_rules: Option<Box<crate::models::JourneyReentryRules>>,
28    #[serde(rename = "schedule", skip_serializing_if = "Option::is_none")]
29    pub schedule: Option<Box<crate::models::JourneySchedule>>,
30    /// Full ordered list of nodes, which replaces the existing graph wholesale. Preserve each node's server-assigned id from a prior fetch to keep in-flight users on that node; omit id to add a new node.
31    #[serde(rename = "nodes", skip_serializing_if = "Option::is_none")]
32    pub nodes: Option<Vec<crate::models::JourneyNode>>,
33    /// Target state. Set active to activate a draft journey, or scheduled together with a future schedule.start_at to activate it later. Set archived to stop a running journey; archiving is permanent. Only scheduled and processing journeys can return to draft.
34    #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
35    pub state: Option<StateType>,
36    /// Optional optimistic-concurrency token. Pass the concurrency_key from a prior fetch to reject the update with 409 if the journey changed. Omit to skip the check.
37    #[serde(rename = "concurrency_key", skip_serializing_if = "Option::is_none")]
38    pub concurrency_key: Option<String>,
39}
40
41impl UpdateJourneyRequest {
42    /// Partial update applied with JSON Merge Patch (RFC 7396). Send only the fields you want to change. A null value clears a nullable field. Arrays such as nodes are replaced wholesale.
43    pub fn new() -> UpdateJourneyRequest {
44        UpdateJourneyRequest {
45            name: None,
46            description: None,
47            audience: None,
48            early_exit: None,
49            reentry_rules: None,
50            schedule: None,
51            nodes: None,
52            state: None,
53            concurrency_key: None,
54        }
55    }
56}
57
58/// Target state. Set active to activate a draft journey, or scheduled together with a future schedule.start_at to activate it later. Set archived to stop a running journey; archiving is permanent. Only scheduled and processing journeys can return to draft.
59#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
60pub enum StateType {
61    #[serde(rename = "draft")]
62    Draft,
63    #[serde(rename = "scheduled")]
64    Scheduled,
65    #[serde(rename = "active")]
66    Active,
67    #[serde(rename = "archived")]
68    Archived,
69}
70
71impl Default for StateType {
72    fn default() -> StateType {
73        Self::Draft
74    }
75}
76