onesignal-rust-api 5.15.0

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
Documentation
/*
 * 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
 */

/// 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.



#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct UpdateJourneyRequest {
    /// Journey name.
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Journey description. Send null to clear it.
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(rename = "audience", skip_serializing_if = "Option::is_none")]
    pub audience: Option<Box<crate::models::JourneyAudience>>,
    #[serde(rename = "early_exit", skip_serializing_if = "Option::is_none")]
    pub early_exit: Option<Box<crate::models::JourneyEarlyExit>>,
    #[serde(rename = "reentry_rules", skip_serializing_if = "Option::is_none")]
    pub reentry_rules: Option<Box<crate::models::JourneyReentryRules>>,
    #[serde(rename = "schedule", skip_serializing_if = "Option::is_none")]
    pub schedule: Option<Box<crate::models::JourneySchedule>>,
    /// 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.
    #[serde(rename = "nodes", skip_serializing_if = "Option::is_none")]
    pub nodes: Option<Vec<crate::models::JourneyNode>>,
    /// 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.
    #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
    pub state: Option<StateType>,
    /// 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.
    #[serde(rename = "concurrency_key", skip_serializing_if = "Option::is_none")]
    pub concurrency_key: Option<String>,
}

impl 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.
    pub fn new() -> UpdateJourneyRequest {
        UpdateJourneyRequest {
            name: None,
            description: None,
            audience: None,
            early_exit: None,
            reentry_rules: None,
            schedule: None,
            nodes: None,
            state: None,
            concurrency_key: None,
        }
    }
}

/// 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.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum StateType {
    #[serde(rename = "draft")]
    Draft,
    #[serde(rename = "scheduled")]
    Scheduled,
    #[serde(rename = "active")]
    Active,
    #[serde(rename = "archived")]
    Archived,
}

impl Default for StateType {
    fn default() -> StateType {
        Self::Draft
    }
}