stcloud/models/
alert_rule_response.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 AlertRuleResponse {
26  #[serde(rename = "data")]
27  #[serde(default)]
28  data: Option<AlertRuleResponseEntry>, 
29  #[serde(rename = "errors")]
30  #[serde(default)]
31  errors: Option<Vec<Error>>, 
32  #[serde(rename = "message")]
33  #[serde(default)]
34  message: Option<String>, 
35  #[serde(rename = "success")]
36  #[serde(default)]
37  success: Option<bool> 
38}
39
40impl AlertRuleResponse {
41  pub fn new() -> AlertRuleResponse {
42    AlertRuleResponse {
43      data: None,
44      errors: None,
45      message: None,
46      success: None
47    }
48  }
49
50  pub fn set_data(&mut self, data: AlertRuleResponseEntry) {
51    self.data = Some(data);
52  }
53
54  pub fn with_data(mut self, data: AlertRuleResponseEntry) -> AlertRuleResponse {
55    self.data = Some(data);
56    self
57  }
58
59  pub fn data(&self) -> Option<&AlertRuleResponseEntry> {
60    self.data.as_ref()
61  }
62
63  pub fn reset_data(&mut self) {
64    self.data = None;
65  }
66
67  pub fn set_errors(&mut self, errors: Vec<Error>) {
68    self.errors = Some(errors);
69  }
70
71  pub fn with_errors(mut self, errors: Vec<Error>) -> AlertRuleResponse {
72    self.errors = Some(errors);
73    self
74  }
75
76  pub fn errors(&self) -> Option<&Vec<Error>> {
77    self.errors.as_ref()
78  }
79
80  pub fn reset_errors(&mut self) {
81    self.errors = None;
82  }
83
84  pub fn set_message(&mut self, message: String) {
85    self.message = Some(message);
86  }
87
88  pub fn with_message(mut self, message: String) -> AlertRuleResponse {
89    self.message = Some(message);
90    self
91  }
92
93  pub fn message(&self) -> Option<&String> {
94    self.message.as_ref()
95  }
96
97  pub fn reset_message(&mut self) {
98    self.message = None;
99  }
100
101  pub fn set_success(&mut self, success: bool) {
102    self.success = Some(success);
103  }
104
105  pub fn with_success(mut self, success: bool) -> AlertRuleResponse {
106    self.success = Some(success);
107    self
108  }
109
110  pub fn success(&self) -> Option<&bool> {
111    self.success.as_ref()
112  }
113
114  pub fn reset_success(&mut self) {
115    self.success = None;
116  }
117
118
119  pub fn validate(&self) {
120  }
121
122}
123
124