onesignal-rust-api 5.12.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
 */

/// CreateJourneyRequest : Writable fields for Create journey. Journeys are always created in the draft state. Server-controlled fields such as state or id are rejected.



#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct CreateJourneyRequest {
    /// Journey name, up to 300 characters.
    #[serde(rename = "name")]
    pub name: String,
    /// Optional journey description, up to 1024 characters.
    #[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>>,
    /// Ordered list of journey nodes. Server-assigned id fields are rejected on create.
    #[serde(rename = "nodes", skip_serializing_if = "Option::is_none")]
    pub nodes: Option<Vec<crate::models::JourneyNode>>,
}

impl CreateJourneyRequest {
    /// Writable fields for Create journey. Journeys are always created in the draft state. Server-controlled fields such as state or id are rejected.
    pub fn new(name: String) -> CreateJourneyRequest {
        CreateJourneyRequest {
            name,
            description: None,
            audience: None,
            early_exit: None,
            reentry_rules: None,
            schedule: None,
            nodes: None,
        }
    }
}