-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcreate_template_request.rs
More file actions
62 lines (55 loc) · 2.16 KB
/
create_template_request.rs
File metadata and controls
62 lines (55 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* 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,
}
}
}