Skip to main content

onesignal_rust_api/models/
email_warm_up_request.rs

1/*
2 * OneSignal
3 *
4 * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
5 *
6 * Contact: devrel@onesignal.com
7 * Generated by: https://openapi-generator.tech
8 */
9
10/// EmailWarmUpRequest : Channel: Email Required when `kind` is \"warmup\". The gradual sending schedule for the Auto Warm Up campaign.
11
12
13
14#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
15pub struct EmailWarmUpRequest {
16    /// Required. The ordered stages that make up the campaign's sending schedule.
17    #[serde(rename = "stages")]
18    pub stages: Vec<crate::models::EmailWarmUpStage>,
19    /// 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. 
20    #[serde(rename = "strategy", skip_serializing_if = "Option::is_none")]
21    pub strategy: Option<StrategyType>,
22}
23
24impl EmailWarmUpRequest {
25    /// Channel: Email Required when `kind` is \"warmup\". The gradual sending schedule for the Auto Warm Up campaign.
26    pub fn new(stages: Vec<crate::models::EmailWarmUpStage>) -> EmailWarmUpRequest {
27        EmailWarmUpRequest {
28            stages,
29            strategy: None,
30        }
31    }
32}
33
34/// 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. 
35#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
36pub enum StrategyType {
37    #[serde(rename = "recommended")]
38    Recommended,
39    #[serde(rename = "custom")]
40    Custom,
41}
42
43impl Default for StrategyType {
44    fn default() -> StrategyType {
45        Self::Recommended
46    }
47}
48