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

/// JourneyListItem : Summary journey representation returned by the list endpoint. Excludes description, nodes, early-exit configuration, and concurrency_key.



#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct JourneyListItem {
    /// Journey UUID. Read-only.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// UUID of the app the journey belongs to. Read-only.
    #[serde(rename = "app_id", skip_serializing_if = "Option::is_none")]
    pub app_id: Option<String>,
    /// Journey name, up to 300 characters.
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Journey state. New journeys are created as draft. processing is transient while activation is in progress. archived is a journey that has been stopped. Change it through the state field on Update journey.
    #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
    pub state: Option<StateType>,
    /// ISO 8601 creation time. Read-only.
    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
    pub created_at: Option<String>,
    /// ISO 8601 last-update time. Read-only.
    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
    pub updated_at: Option<String>,
    /// ISO 8601 time the journey was activated, or null. Read-only.
    #[serde(rename = "started_at", skip_serializing_if = "Option::is_none")]
    pub started_at: Option<String>,
    /// ISO 8601 time the journey was archived, or null. Read-only.
    #[serde(rename = "archived_at", skip_serializing_if = "Option::is_none")]
    pub archived_at: Option<String>,
    /// Origin of the journey, for example public_api or dashboard. Read-only.
    #[serde(rename = "created_source", skip_serializing_if = "Option::is_none")]
    pub created_source: Option<String>,
    #[serde(rename = "schedule", skip_serializing_if = "Option::is_none")]
    pub schedule: Option<Box<crate::models::JourneySchedule>>,
    #[serde(rename = "audience", skip_serializing_if = "Option::is_none")]
    pub audience: Option<Box<crate::models::JourneyListAudience>>,
    #[serde(rename = "reentry_rules", skip_serializing_if = "Option::is_none")]
    pub reentry_rules: Option<Box<crate::models::JourneyReentryRules>>,
}

impl JourneyListItem {
    /// Summary journey representation returned by the list endpoint. Excludes description, nodes, early-exit configuration, and concurrency_key.
    pub fn new() -> JourneyListItem {
        JourneyListItem {
            id: None,
            app_id: None,
            name: None,
            state: None,
            created_at: None,
            updated_at: None,
            started_at: None,
            archived_at: None,
            created_source: None,
            schedule: None,
            audience: None,
            reentry_rules: None,
        }
    }
}

/// Journey state. New journeys are created as draft. processing is transient while activation is in progress. archived is a journey that has been stopped. Change it through the state field on Update journey.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum StateType {
    #[serde(rename = "draft")]
    Draft,
    #[serde(rename = "scheduled")]
    Scheduled,
    #[serde(rename = "processing")]
    Processing,
    #[serde(rename = "active")]
    Active,
    #[serde(rename = "archived")]
    Archived,
}

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