1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/*
* 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
*/
/// JourneyNode : A journey node. The kind field selects which other fields apply. Branching nodes (split_range, yes_no, wait_until) nest their sub-graphs inline via branches[].nodes.
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct JourneyNode {
/// Server-assigned node UUID. Returned on reads. Required on update to keep an existing node. Rejected on create with a 400 validation error.
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
/// Node kind. Selects which other fields apply.
#[serde(rename = "kind")]
pub kind: KindType,
/// Optional client-assigned identifier, unique within the journey. Use it to reference this node from elsewhere in the same request. Persisted and returned on reads.
#[serde(rename = "client_node_id", skip_serializing_if = "Option::is_none")]
pub client_node_id: Option<String>,
/// Optional free-text label, up to 255 characters. Stored and returned as-is with no effect on journey behavior.
#[serde(rename = "annotation", skip_serializing_if = "Option::is_none")]
pub annotation: Option<String>,
/// wait nodes: seconds to hold the user. Minimum 60, maximum 31556952 (1 year).
#[serde(rename = "duration_seconds", skip_serializing_if = "Option::is_none")]
pub duration_seconds: Option<i32>,
/// time_window nodes: schedule_in_timezone uses the configured windows; last_active_time holds relative to the user's last active time.
#[serde(rename = "relative_to", skip_serializing_if = "Option::is_none")]
pub relative_to: Option<RelativeToType>,
/// time_window nodes: one or more time windows. A window with no day_of_week applies to every day. Required when relative_to is schedule_in_timezone; omit when it is last_active_time.
#[serde(rename = "windows", skip_serializing_if = "Option::is_none")]
pub windows: Option<Vec<crate::models::JourneyTimeWindow>>,
/// time_window nodes: IANA timezone identifier used when the user's timezone is unavailable.
#[serde(rename = "time_zone", skip_serializing_if = "Option::is_none")]
pub time_zone: Option<String>,
/// time_window nodes: when true, uses the user's timezone if available.
#[serde(rename = "use_user_time_zone", skip_serializing_if = "Option::is_none")]
pub use_user_time_zone: Option<bool>,
/// send_push, send_email, and send_sms nodes: UUID of the template to send.
#[serde(rename = "template_id", skip_serializing_if = "Option::is_none")]
pub template_id: Option<String>,
/// send_iam nodes: UUID of the in-app message to send.
#[serde(rename = "iam_id", skip_serializing_if = "Option::is_none")]
pub iam_id: Option<String>,
/// send_iam nodes: optional time-to-live for the in-app message, in seconds.
#[serde(rename = "user_ttl_seconds", skip_serializing_if = "Option::is_none")]
pub user_ttl_seconds: Option<i32>,
/// send_webhook nodes: UUID of the webhook to send.
#[serde(rename = "webhook_id", skip_serializing_if = "Option::is_none")]
pub webhook_id: Option<String>,
/// tag nodes: tag key-value pairs to assign. An empty string value removes the tag. Keys are limited to 255 characters and values to 1024.
#[serde(rename = "assignments", skip_serializing_if = "Option::is_none")]
pub assignments: Option<::std::collections::HashMap<String, String>>,
/// split_range nodes: when true, assigns each user to a branch at random on entry. Defaults to false.
#[serde(rename = "randomize_on_entry", skip_serializing_if = "Option::is_none")]
pub randomize_on_entry: Option<bool>,
/// Branching nodes: nested branches. split_range requires 2-20 weighted branches that sum to 100. yes_no requires exactly 2 branches. wait_until requires 1-10 condition branches.
#[serde(rename = "branches", skip_serializing_if = "Option::is_none")]
pub branches: Option<Vec<crate::models::JourneyBranch>>,
#[serde(rename = "expiration", skip_serializing_if = "Option::is_none")]
pub expiration: Option<Box<crate::models::JourneyWaitUntilExpiration>>,
}
impl JourneyNode {
/// A journey node. The kind field selects which other fields apply. Branching nodes (split_range, yes_no, wait_until) nest their sub-graphs inline via branches[].nodes.
pub fn new(kind: KindType) -> JourneyNode {
JourneyNode {
id: None,
kind,
client_node_id: None,
annotation: None,
duration_seconds: None,
relative_to: None,
windows: None,
time_zone: None,
use_user_time_zone: None,
template_id: None,
iam_id: None,
user_ttl_seconds: None,
webhook_id: None,
assignments: None,
randomize_on_entry: None,
branches: None,
expiration: None,
}
}
}
/// Node kind. Selects which other fields apply.
#[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
}
}
/// time_window nodes: schedule_in_timezone uses the configured windows; last_active_time holds relative to the user's last active time.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum RelativeToType {
#[serde(rename = "schedule_in_timezone")]
ScheduleInTimezone,
#[serde(rename = "last_active_time")]
LastActiveTime,
}
impl Default for RelativeToType {
fn default() -> RelativeToType {
Self::ScheduleInTimezone
}
}