onesignal-rust-api 5.4.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
 *
 * The version of the OpenAPI document: 5.4.0
 * Contact: devrel@onesignal.com
 * Generated by: https://openapi-generator.tech
 */




#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct CreateTemplateRequest {
    /// Your OneSignal App ID in UUID v4 format.
    #[serde(rename = "app_id")]
    pub app_id: String,
    /// Name of the template.
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "contents")]
    pub contents: Box<crate::models::LanguageStringMap>,
    #[serde(rename = "headings", skip_serializing_if = "Option::is_none")]
    pub headings: Option<Box<crate::models::LanguageStringMap>>,
    #[serde(rename = "subtitle", skip_serializing_if = "Option::is_none")]
    pub subtitle: Option<Box<crate::models::LanguageStringMap>>,
    /// Set true for an Email template.
    #[serde(rename = "isEmail", skip_serializing_if = "Option::is_none")]
    pub is_email: Option<bool>,
    /// Subject of the email.
    #[serde(rename = "email_subject", skip_serializing_if = "Option::is_none")]
    pub email_subject: Option<String>,
    /// Body of the email (HTML supported).
    #[serde(rename = "email_body", skip_serializing_if = "Option::is_none")]
    pub email_body: Option<String>,
    /// Set true for an SMS template.
    #[serde(rename = "isSMS", skip_serializing_if = "Option::is_none")]
    pub is_sms: Option<bool>,
    /// JSON string for dynamic content personalization.
    #[serde(rename = "dynamic_content", skip_serializing_if = "Option::is_none")]
    pub dynamic_content: Option<String>,
}

impl CreateTemplateRequest {
    pub fn new(app_id: String, name: String, contents: crate::models::LanguageStringMap) -> CreateTemplateRequest {
        CreateTemplateRequest {
            app_id,
            name,
            contents: Box::new(contents),
            headings: None,
            subtitle: None,
            is_email: None,
            email_subject: None,
            email_body: None,
            is_sms: None,
            dynamic_content: None,
        }
    }
}