Skip to main content

onesignal_rust_api/models/
update_journey_node_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/// UpdateJourneyNodeRequest : Node fields to change, merged onto the current node. Send only the fields you want to change. The node's kind and id cannot be changed. Send null to clear a nullable field. Which other fields apply depends on the node's kind, matching JourneyNode.
11
12
13
14#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
15pub struct UpdateJourneyNodeRequest {
16    /// 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.
17    #[serde(rename = "client_node_id", skip_serializing_if = "Option::is_none")]
18    pub client_node_id: Option<String>,
19    /// Optional free-text label, up to 255 characters. Stored and returned as-is with no effect on journey behavior.
20    #[serde(rename = "annotation", skip_serializing_if = "Option::is_none")]
21    pub annotation: Option<String>,
22    /// wait nodes: seconds to hold the user. Minimum 60, maximum 31556952 (1 year).
23    #[serde(rename = "duration_seconds", skip_serializing_if = "Option::is_none")]
24    pub duration_seconds: Option<i32>,
25    /// time_window nodes: schedule_in_timezone uses the configured windows; last_active_time holds relative to the user's last active time.
26    #[serde(rename = "relative_to", skip_serializing_if = "Option::is_none")]
27    pub relative_to: Option<RelativeToType>,
28    /// 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.
29    #[serde(rename = "windows", skip_serializing_if = "Option::is_none")]
30    pub windows: Option<Vec<crate::models::JourneyTimeWindow>>,
31    /// time_window nodes: IANA timezone identifier used when the user's timezone is unavailable.
32    #[serde(rename = "time_zone", skip_serializing_if = "Option::is_none")]
33    pub time_zone: Option<String>,
34    /// time_window nodes: when true, uses the user's timezone if available.
35    #[serde(rename = "use_user_time_zone", skip_serializing_if = "Option::is_none")]
36    pub use_user_time_zone: Option<bool>,
37    /// send_push, send_email, and send_sms nodes: UUID of the template to send.
38    #[serde(rename = "template_id", skip_serializing_if = "Option::is_none")]
39    pub template_id: Option<String>,
40    /// send_iam nodes: UUID of the in-app message to send.
41    #[serde(rename = "iam_id", skip_serializing_if = "Option::is_none")]
42    pub iam_id: Option<String>,
43    /// send_iam nodes: optional time-to-live for the in-app message, in seconds.
44    #[serde(rename = "user_ttl_seconds", skip_serializing_if = "Option::is_none")]
45    pub user_ttl_seconds: Option<i32>,
46    /// send_webhook nodes: UUID of the webhook to send.
47    #[serde(rename = "webhook_id", skip_serializing_if = "Option::is_none")]
48    pub webhook_id: Option<String>,
49    /// 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.
50    #[serde(rename = "assignments", skip_serializing_if = "Option::is_none")]
51    pub assignments: Option<::std::collections::HashMap<String, String>>,
52    /// split_range nodes: when true, assigns each user to a branch at random on entry. Defaults to false.
53    #[serde(rename = "randomize_on_entry", skip_serializing_if = "Option::is_none")]
54    pub randomize_on_entry: Option<bool>,
55    /// 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.
56    #[serde(rename = "branches", skip_serializing_if = "Option::is_none")]
57    pub branches: Option<Vec<crate::models::JourneyBranch>>,
58    #[serde(rename = "expiration", skip_serializing_if = "Option::is_none")]
59    pub expiration: Option<Box<crate::models::JourneyWaitUntilExpiration>>,
60    /// 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. It is not merged onto the node.
61    #[serde(rename = "concurrency_key", skip_serializing_if = "Option::is_none")]
62    pub concurrency_key: Option<String>,
63}
64
65impl UpdateJourneyNodeRequest {
66    /// Node fields to change, merged onto the current node. Send only the fields you want to change. The node's kind and id cannot be changed. Send null to clear a nullable field. Which other fields apply depends on the node's kind, matching JourneyNode.
67    pub fn new() -> UpdateJourneyNodeRequest {
68        UpdateJourneyNodeRequest {
69            client_node_id: None,
70            annotation: None,
71            duration_seconds: None,
72            relative_to: None,
73            windows: None,
74            time_zone: None,
75            use_user_time_zone: None,
76            template_id: None,
77            iam_id: None,
78            user_ttl_seconds: None,
79            webhook_id: None,
80            assignments: None,
81            randomize_on_entry: None,
82            branches: None,
83            expiration: None,
84            concurrency_key: None,
85        }
86    }
87}
88
89/// time_window nodes: schedule_in_timezone uses the configured windows; last_active_time holds relative to the user's last active time.
90#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
91pub enum RelativeToType {
92    #[serde(rename = "schedule_in_timezone")]
93    ScheduleInTimezone,
94    #[serde(rename = "last_active_time")]
95    LastActiveTime,
96}
97
98impl Default for RelativeToType {
99    fn default() -> RelativeToType {
100        Self::ScheduleInTimezone
101    }
102}
103