stcloud/models/
notification_integration.rs

1/* 
2 * Sematext Cloud API
3 *
4 * API Explorer provides access and documentation for Sematext REST API. The REST API requires the API Key to be sent as part of `Authorization` header. E.g.: `Authorization : apiKey e5f18450-205a-48eb-8589-7d49edaea813`.
5 *
6 * OpenAPI spec version: v3
7 * 
8 * Generated by: https://github.com/swagger-api/swagger-codegen.git
9 */
10#![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//Uncomment this to deal with limited rfc support on server side
22//use crate::datetime_serializer::*;
23
24#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
25pub struct NotificationIntegration {
26  #[serde(rename = "applicability")]
27  #[serde(default)]
28  applicability: Option<String>, 
29  #[serde(rename = "createDate")]
30  #[serde(default)]
31  //Uncomment this also to deal with limited rfc support on server side
32  //#[serde(serialize_with = "serialize_dt", deserialize_with = "deserialize_dt")]
33  create_date: Option<DateTime<Utc>>, 
34  #[serde(rename = "createdByOwner")]
35  #[serde(default)]
36  created_by_owner: Option<bool>, 
37  #[serde(rename = "creatorId")]
38  #[serde(default)]
39  creator_id: Option<i64>, 
40  #[serde(rename = "id")]
41  #[serde(default)]
42  id: Option<i64>, 
43  #[serde(rename = "integrationType")]
44  #[serde(default)]
45  integration_type: Option<String>, 
46  #[serde(rename = "name")]
47  #[serde(default)]
48  name: Option<String>, 
49  #[serde(rename = "params")]
50  #[serde(default)]
51  params: Option<::std::collections::HashMap<String, String>>, 
52  #[serde(rename = "state")]
53  #[serde(default)]
54  state: Option<String>, 
55  #[serde(rename = "userId")]
56  #[serde(default)]
57  user_id: Option<i64> 
58}
59
60impl NotificationIntegration {
61  pub fn new() -> NotificationIntegration {
62    NotificationIntegration {
63      applicability: None,
64      create_date: None,
65      created_by_owner: None,
66      creator_id: None,
67      id: None,
68      integration_type: None,
69      name: None,
70      params: None,
71      state: None,
72      user_id: None
73    }
74  }
75
76  pub fn set_applicability(&mut self, applicability: String) {
77    self.applicability = Some(applicability);
78  }
79
80  pub fn with_applicability(mut self, applicability: String) -> NotificationIntegration {
81    self.applicability = Some(applicability);
82    self
83  }
84
85  pub fn applicability(&self) -> Option<&String> {
86    self.applicability.as_ref()
87  }
88
89  pub fn reset_applicability(&mut self) {
90    self.applicability = None;
91  }
92
93  pub fn set_create_date(&mut self, create_date: DateTime<Utc>) {
94    self.create_date = Some(create_date);
95  }
96
97  pub fn with_create_date(mut self, create_date: DateTime<Utc>) -> NotificationIntegration {
98    self.create_date = Some(create_date);
99    self
100  }
101
102  pub fn create_date(&self) -> Option<&DateTime<Utc>> {
103    self.create_date.as_ref()
104  }
105
106  pub fn reset_create_date(&mut self) {
107    self.create_date = None;
108  }
109
110  pub fn set_created_by_owner(&mut self, created_by_owner: bool) {
111    self.created_by_owner = Some(created_by_owner);
112  }
113
114  pub fn with_created_by_owner(mut self, created_by_owner: bool) -> NotificationIntegration {
115    self.created_by_owner = Some(created_by_owner);
116    self
117  }
118
119  pub fn created_by_owner(&self) -> Option<&bool> {
120    self.created_by_owner.as_ref()
121  }
122
123  pub fn reset_created_by_owner(&mut self) {
124    self.created_by_owner = None;
125  }
126
127  pub fn set_creator_id(&mut self, creator_id: i64) {
128    self.creator_id = Some(creator_id);
129  }
130
131  pub fn with_creator_id(mut self, creator_id: i64) -> NotificationIntegration {
132    self.creator_id = Some(creator_id);
133    self
134  }
135
136  pub fn creator_id(&self) -> Option<&i64> {
137    self.creator_id.as_ref()
138  }
139
140  pub fn reset_creator_id(&mut self) {
141    self.creator_id = None;
142  }
143
144  pub fn set_id(&mut self, id: i64) {
145    self.id = Some(id);
146  }
147
148  pub fn with_id(mut self, id: i64) -> NotificationIntegration {
149    self.id = Some(id);
150    self
151  }
152
153  pub fn id(&self) -> Option<&i64> {
154    self.id.as_ref()
155  }
156
157  pub fn reset_id(&mut self) {
158    self.id = None;
159  }
160
161  pub fn set_integration_type(&mut self, integration_type: String) {
162    self.integration_type = Some(integration_type);
163  }
164
165  pub fn with_integration_type(mut self, integration_type: String) -> NotificationIntegration {
166    self.integration_type = Some(integration_type);
167    self
168  }
169
170  pub fn integration_type(&self) -> Option<&String> {
171    self.integration_type.as_ref()
172  }
173
174  pub fn reset_integration_type(&mut self) {
175    self.integration_type = None;
176  }
177
178  pub fn set_name(&mut self, name: String) {
179    self.name = Some(name);
180  }
181
182  pub fn with_name(mut self, name: String) -> NotificationIntegration {
183    self.name = Some(name);
184    self
185  }
186
187  pub fn name(&self) -> Option<&String> {
188    self.name.as_ref()
189  }
190
191  pub fn reset_name(&mut self) {
192    self.name = None;
193  }
194
195  pub fn set_params(&mut self, params: ::std::collections::HashMap<String, String>) {
196    self.params = Some(params);
197  }
198
199  pub fn with_params(mut self, params: ::std::collections::HashMap<String, String>) -> NotificationIntegration {
200    self.params = Some(params);
201    self
202  }
203
204  pub fn params(&self) -> Option<&::std::collections::HashMap<String, String>> {
205    self.params.as_ref()
206  }
207
208  pub fn reset_params(&mut self) {
209    self.params = None;
210  }
211
212  pub fn set_state(&mut self, state: String) {
213    self.state = Some(state);
214  }
215
216  pub fn with_state(mut self, state: String) -> NotificationIntegration {
217    self.state = Some(state);
218    self
219  }
220
221  pub fn state(&self) -> Option<&String> {
222    self.state.as_ref()
223  }
224
225  pub fn reset_state(&mut self) {
226    self.state = None;
227  }
228
229  pub fn set_user_id(&mut self, user_id: i64) {
230    self.user_id = Some(user_id);
231  }
232
233  pub fn with_user_id(mut self, user_id: i64) -> NotificationIntegration {
234    self.user_id = Some(user_id);
235    self
236  }
237
238  pub fn user_id(&self) -> Option<&i64> {
239    self.user_id.as_ref()
240  }
241
242  pub fn reset_user_id(&mut self) {
243    self.user_id = None;
244  }
245
246
247  pub fn validate(&self) {
248  }
249
250}
251
252