ElasticEmail 4.2.0

Official Rust SDK for the Elastic Email REST API v4
Documentation
/*
 * Elastic Email REST API
 *
 * This API is based on the REST API architecture, allowing the user to easily manage their data with this resource-based approach.    Every API call is established on which specific request type (GET, POST, PUT, DELETE) will be used.    The API has a limit of 20 concurrent connections and a hard timeout of 600 seconds per request.    To start using this API, you will need your Access Token (available <a target='_blank' href='https://app.elasticemail.com/marketing/settings/new/manage-api'>here</a>). Remember to keep it safe. Required access levels are listed in the given request’s description.    Downloadable library clients can be found in our Github repository <a target='_blank' href='https://github.com/ElasticEmail?tab=repositories&q=%22rest+api%22+in%3Areadme'>here</a>
 *
 * The version of the OpenAPI document: 4.0.0
 * Contact: support@elasticemail.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// CampaignOptions : Different send options for a Campaign
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CampaignOptions {
    #[serde(rename = "DeliveryOptimization", skip_serializing_if = "Option::is_none")]
    pub delivery_optimization: Option<models::DeliveryOptimizationType>,
    /// Should the opens be tracked? If no value has been provided, Account's default setting will be used.
    #[serde(rename = "TrackOpens", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub track_opens: Option<Option<bool>>,
    /// Should the clicks be tracked? If no value has been provided, Account's default setting will be used.
    #[serde(rename = "TrackClicks", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub track_clicks: Option<Option<bool>>,
    /// Date when this Campaign is scheduled to be sent on
    #[serde(rename = "ScheduleFor", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub schedule_for: Option<Option<String>>,
    /// How often (in minutes) to send the campaign
    #[serde(rename = "TriggerFrequency", skip_serializing_if = "Option::is_none")]
    pub trigger_frequency: Option<f64>,
    /// How many times send the campaign
    #[serde(rename = "TriggerCount", skip_serializing_if = "Option::is_none")]
    pub trigger_count: Option<i32>,
    #[serde(rename = "SplitOptions", skip_serializing_if = "Option::is_none")]
    pub split_options: Option<Box<models::SplitOptions>>,
    /// Send email at local time of contact.
    #[serde(rename = "SendAtLocalTime", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub send_at_local_time: Option<Option<bool>>,
}

impl CampaignOptions {
    /// Different send options for a Campaign
    pub fn new() -> CampaignOptions {
        CampaignOptions {
            delivery_optimization: None,
            track_opens: None,
            track_clicks: None,
            schedule_for: None,
            trigger_frequency: None,
            trigger_count: None,
            split_options: None,
            send_at_local_time: None,
        }
    }
}