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

/// EmailWarmUpRequest : Channel: Email Required when `kind` is \"warmup\". The gradual sending schedule for the Auto Warm Up campaign.



#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct EmailWarmUpRequest {
    /// Required. The ordered stages that make up the campaign's sending schedule.
    #[serde(rename = "stages")]
    pub stages: Vec<crate::models::EmailWarmUpStage>,
    /// How the stage schedule should be treated:   * `recommended` - (Default) OneSignal may adjust the provided stages based on past delivery volumes, scheduled Auto Warm Up emails, and the size of the current audience.   * `custom` - The stages provided are sent as-is. 
    #[serde(rename = "strategy", skip_serializing_if = "Option::is_none")]
    pub strategy: Option<StrategyType>,
}

impl EmailWarmUpRequest {
    /// Channel: Email Required when `kind` is \"warmup\". The gradual sending schedule for the Auto Warm Up campaign.
    pub fn new(stages: Vec<crate::models::EmailWarmUpStage>) -> EmailWarmUpRequest {
        EmailWarmUpRequest {
            stages,
            strategy: None,
        }
    }
}

/// How the stage schedule should be treated:   * `recommended` - (Default) OneSignal may adjust the provided stages based on past delivery volumes, scheduled Auto Warm Up emails, and the size of the current audience.   * `custom` - The stages provided are sent as-is. 
#[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
    }
}