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

/// EmailWarmUp : Channel: Email Present only when this notification's `kind` is \"warmup\". The Auto Warm Up campaign's stage schedule, scheduling strategy, and live status.



#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct EmailWarmUp {
    /// The campaign's sending schedule, stage by stage.
    #[serde(rename = "stages", skip_serializing_if = "Option::is_none")]
    pub stages: Option<Vec<crate::models::EmailWarmUpStage>>,
    /// How the stage schedule was produced:   * `recommended` - OneSignal generated (and may still adjust) the schedule based on past delivery volumes, scheduled Auto Warm Up emails, and the size of the current audience.   * `custom` - The stages were provided as-is in the create request. 
    #[serde(rename = "strategy", skip_serializing_if = "Option::is_none")]
    pub strategy: Option<StrategyType>,
    /// Current status of the campaign:   * `initializing` - The stages have been submitted and the schedule is being set up.   * `draft` - The campaign has been created but has not started sending.   * `active` - The campaign is currently working through its stages.   * `finished` - All stages have completed.   * `canceled` - The campaign was canceled before finishing. 
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<StatusType>,
    /// Whether the campaign is currently live (actively sending).
    #[serde(rename = "is_live", skip_serializing_if = "Option::is_none")]
    pub is_live: Option<bool>,
}

impl EmailWarmUp {
    /// Channel: Email Present only when this notification's `kind` is \"warmup\". The Auto Warm Up campaign's stage schedule, scheduling strategy, and live status.
    pub fn new() -> EmailWarmUp {
        EmailWarmUp {
            stages: None,
            strategy: None,
            status: None,
            is_live: None,
        }
    }
}

/// How the stage schedule was produced:   * `recommended` - OneSignal generated (and may still adjust) the schedule based on past delivery volumes, scheduled Auto Warm Up emails, and the size of the current audience.   * `custom` - The stages were provided as-is in the create request. 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum StrategyType {
    #[serde(rename = "recommended")]
    Recommended,
    #[serde(rename = "custom")]
    Custom,
}

impl Default for StrategyType {
    fn default() -> StrategyType {
        Self::Recommended
    }
}
/// Current status of the campaign:   * `initializing` - The stages have been submitted and the schedule is being set up.   * `draft` - The campaign has been created but has not started sending.   * `active` - The campaign is currently working through its stages.   * `finished` - All stages have completed.   * `canceled` - The campaign was canceled before finishing. 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum StatusType {
    #[serde(rename = "initializing")]
    Initializing,
    #[serde(rename = "draft")]
    Draft,
    #[serde(rename = "active")]
    Active,
    #[serde(rename = "finished")]
    Finished,
    #[serde(rename = "canceled")]
    Canceled,
}

impl Default for StatusType {
    fn default() -> StatusType {
        Self::Initializing
    }
}