Skip to main content

onesignal_rust_api/models/
email_warm_up.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/// 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.
11
12
13
14#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
15pub struct EmailWarmUp {
16    /// The campaign's sending schedule, stage by stage.
17    #[serde(rename = "stages", skip_serializing_if = "Option::is_none")]
18    pub stages: Option<Vec<crate::models::EmailWarmUpStage>>,
19    /// 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. 
20    #[serde(rename = "strategy", skip_serializing_if = "Option::is_none")]
21    pub strategy: Option<StrategyType>,
22    /// 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. 
23    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
24    pub status: Option<StatusType>,
25    /// Whether the campaign is currently live (actively sending).
26    #[serde(rename = "is_live", skip_serializing_if = "Option::is_none")]
27    pub is_live: Option<bool>,
28}
29
30impl EmailWarmUp {
31    /// Channel: Email Present only when this notification's `kind` is \"warmup\". The Auto Warm Up campaign's stage schedule, scheduling strategy, and live status.
32    pub fn new() -> EmailWarmUp {
33        EmailWarmUp {
34            stages: None,
35            strategy: None,
36            status: None,
37            is_live: None,
38        }
39    }
40}
41
42/// 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. 
43#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
44pub enum StrategyType {
45    #[serde(rename = "recommended")]
46    Recommended,
47    #[serde(rename = "custom")]
48    Custom,
49}
50
51impl Default for StrategyType {
52    fn default() -> StrategyType {
53        Self::Recommended
54    }
55}
56/// 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. 
57#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
58pub enum StatusType {
59    #[serde(rename = "initializing")]
60    Initializing,
61    #[serde(rename = "draft")]
62    Draft,
63    #[serde(rename = "active")]
64    Active,
65    #[serde(rename = "finished")]
66    Finished,
67    #[serde(rename = "canceled")]
68    Canceled,
69}
70
71impl Default for StatusType {
72    fn default() -> StatusType {
73        Self::Initializing
74    }
75}
76