stcloud/models/
alert_notification.rs1#![allow(unused_imports)]
11
12use serde_json::Value;
13use bigdecimal::BigDecimal;
14use chrono::{Date, NaiveDateTime, NaiveDate, DateTime, FixedOffset, Utc};
15
16use crate::models::*;
17use crate::date_serializer;
18use crate::date_serializer_opt;
19use crate::serialize_quoted_numbers;
20use crate::serialize_quoted_numbers_opt;
21#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
25pub struct AlertNotification {
26  #[serde(rename = "appName")]
27  #[serde(default)]
28  app_name: Option<String>, 
29  #[serde(rename = "appType")]
30  #[serde(default)]
31  app_type: Option<String>, 
32  #[serde(rename = "backToNormal")]
33  #[serde(default)]
34  back_to_normal: Option<bool>, 
35  #[serde(rename = "createTime")]
36  #[serde(default)]
37  create_time: Option<String>, 
38  #[serde(rename = "sent")]
39  #[serde(default)]
40  sent: Option<bool>, 
41  #[serde(rename = "text")]
42  #[serde(default)]
43  text: Option<String>, 
44  #[serde(rename = "when")]
45  #[serde(default)]
46  when: Option<String> 
47}
48
49impl AlertNotification {
50  pub fn new() -> AlertNotification {
51    AlertNotification {
52      app_name: None,
53      app_type: None,
54      back_to_normal: None,
55      create_time: None,
56      sent: None,
57      text: None,
58      when: None
59    }
60  }
61
62  pub fn set_app_name(&mut self, app_name: String) {
63    self.app_name = Some(app_name);
64  }
65
66  pub fn with_app_name(mut self, app_name: String) -> AlertNotification {
67    self.app_name = Some(app_name);
68    self
69  }
70
71  pub fn app_name(&self) -> Option<&String> {
72    self.app_name.as_ref()
73  }
74
75  pub fn reset_app_name(&mut self) {
76    self.app_name = None;
77  }
78
79  pub fn set_app_type(&mut self, app_type: String) {
80    self.app_type = Some(app_type);
81  }
82
83  pub fn with_app_type(mut self, app_type: String) -> AlertNotification {
84    self.app_type = Some(app_type);
85    self
86  }
87
88  pub fn app_type(&self) -> Option<&String> {
89    self.app_type.as_ref()
90  }
91
92  pub fn reset_app_type(&mut self) {
93    self.app_type = None;
94  }
95
96  pub fn set_back_to_normal(&mut self, back_to_normal: bool) {
97    self.back_to_normal = Some(back_to_normal);
98  }
99
100  pub fn with_back_to_normal(mut self, back_to_normal: bool) -> AlertNotification {
101    self.back_to_normal = Some(back_to_normal);
102    self
103  }
104
105  pub fn back_to_normal(&self) -> Option<&bool> {
106    self.back_to_normal.as_ref()
107  }
108
109  pub fn reset_back_to_normal(&mut self) {
110    self.back_to_normal = None;
111  }
112
113  pub fn set_create_time(&mut self, create_time: String) {
114    self.create_time = Some(create_time);
115  }
116
117  pub fn with_create_time(mut self, create_time: String) -> AlertNotification {
118    self.create_time = Some(create_time);
119    self
120  }
121
122  pub fn create_time(&self) -> Option<&String> {
123    self.create_time.as_ref()
124  }
125
126  pub fn reset_create_time(&mut self) {
127    self.create_time = None;
128  }
129
130  pub fn set_sent(&mut self, sent: bool) {
131    self.sent = Some(sent);
132  }
133
134  pub fn with_sent(mut self, sent: bool) -> AlertNotification {
135    self.sent = Some(sent);
136    self
137  }
138
139  pub fn sent(&self) -> Option<&bool> {
140    self.sent.as_ref()
141  }
142
143  pub fn reset_sent(&mut self) {
144    self.sent = None;
145  }
146
147  pub fn set_text(&mut self, text: String) {
148    self.text = Some(text);
149  }
150
151  pub fn with_text(mut self, text: String) -> AlertNotification {
152    self.text = Some(text);
153    self
154  }
155
156  pub fn text(&self) -> Option<&String> {
157    self.text.as_ref()
158  }
159
160  pub fn reset_text(&mut self) {
161    self.text = None;
162  }
163
164  pub fn set_when(&mut self, when: String) {
165    self.when = Some(when);
166  }
167
168  pub fn with_when(mut self, when: String) -> AlertNotification {
169    self.when = Some(when);
170    self
171  }
172
173  pub fn when(&self) -> Option<&String> {
174    self.when.as_ref()
175  }
176
177  pub fn reset_when(&mut self) {
178    self.when = None;
179  }
180
181
182  pub fn validate(&self) {
183  }
184
185}
186
187