aws_sdk_applicationinsights/types/
_problem.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Problem {
7 pub id: ::std::option::Option<::std::string::String>,
9 pub title: ::std::option::Option<::std::string::String>,
11 pub short_name: ::std::option::Option<::std::string::String>,
13 pub insights: ::std::option::Option<::std::string::String>,
15 pub status: ::std::option::Option<crate::types::Status>,
17 pub affected_resource: ::std::option::Option<::std::string::String>,
19 pub start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
21 pub end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
23 pub severity_level: ::std::option::Option<crate::types::SeverityLevel>,
25 pub account_id: ::std::option::Option<::std::string::String>,
27 pub resource_group_name: ::std::option::Option<::std::string::String>,
29 pub feedback: ::std::option::Option<::std::collections::HashMap<crate::types::FeedbackKey, crate::types::FeedbackValue>>,
31 pub recurring_count: ::std::option::Option<i64>,
33 pub last_recurrence_time: ::std::option::Option<::aws_smithy_types::DateTime>,
35 pub visibility: ::std::option::Option<crate::types::Visibility>,
37 pub resolution_method: ::std::option::Option<crate::types::ResolutionMethod>,
39}
40impl Problem {
41 pub fn id(&self) -> ::std::option::Option<&str> {
43 self.id.as_deref()
44 }
45 pub fn title(&self) -> ::std::option::Option<&str> {
47 self.title.as_deref()
48 }
49 pub fn short_name(&self) -> ::std::option::Option<&str> {
51 self.short_name.as_deref()
52 }
53 pub fn insights(&self) -> ::std::option::Option<&str> {
55 self.insights.as_deref()
56 }
57 pub fn status(&self) -> ::std::option::Option<&crate::types::Status> {
59 self.status.as_ref()
60 }
61 pub fn affected_resource(&self) -> ::std::option::Option<&str> {
63 self.affected_resource.as_deref()
64 }
65 pub fn start_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
67 self.start_time.as_ref()
68 }
69 pub fn end_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
71 self.end_time.as_ref()
72 }
73 pub fn severity_level(&self) -> ::std::option::Option<&crate::types::SeverityLevel> {
75 self.severity_level.as_ref()
76 }
77 pub fn account_id(&self) -> ::std::option::Option<&str> {
79 self.account_id.as_deref()
80 }
81 pub fn resource_group_name(&self) -> ::std::option::Option<&str> {
83 self.resource_group_name.as_deref()
84 }
85 pub fn feedback(&self) -> ::std::option::Option<&::std::collections::HashMap<crate::types::FeedbackKey, crate::types::FeedbackValue>> {
87 self.feedback.as_ref()
88 }
89 pub fn recurring_count(&self) -> ::std::option::Option<i64> {
91 self.recurring_count
92 }
93 pub fn last_recurrence_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
95 self.last_recurrence_time.as_ref()
96 }
97 pub fn visibility(&self) -> ::std::option::Option<&crate::types::Visibility> {
99 self.visibility.as_ref()
100 }
101 pub fn resolution_method(&self) -> ::std::option::Option<&crate::types::ResolutionMethod> {
103 self.resolution_method.as_ref()
104 }
105}
106impl Problem {
107 pub fn builder() -> crate::types::builders::ProblemBuilder {
109 crate::types::builders::ProblemBuilder::default()
110 }
111}
112
113#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
115#[non_exhaustive]
116pub struct ProblemBuilder {
117 pub(crate) id: ::std::option::Option<::std::string::String>,
118 pub(crate) title: ::std::option::Option<::std::string::String>,
119 pub(crate) short_name: ::std::option::Option<::std::string::String>,
120 pub(crate) insights: ::std::option::Option<::std::string::String>,
121 pub(crate) status: ::std::option::Option<crate::types::Status>,
122 pub(crate) affected_resource: ::std::option::Option<::std::string::String>,
123 pub(crate) start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
124 pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
125 pub(crate) severity_level: ::std::option::Option<crate::types::SeverityLevel>,
126 pub(crate) account_id: ::std::option::Option<::std::string::String>,
127 pub(crate) resource_group_name: ::std::option::Option<::std::string::String>,
128 pub(crate) feedback: ::std::option::Option<::std::collections::HashMap<crate::types::FeedbackKey, crate::types::FeedbackValue>>,
129 pub(crate) recurring_count: ::std::option::Option<i64>,
130 pub(crate) last_recurrence_time: ::std::option::Option<::aws_smithy_types::DateTime>,
131 pub(crate) visibility: ::std::option::Option<crate::types::Visibility>,
132 pub(crate) resolution_method: ::std::option::Option<crate::types::ResolutionMethod>,
133}
134impl ProblemBuilder {
135 pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137 self.id = ::std::option::Option::Some(input.into());
138 self
139 }
140 pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142 self.id = input;
143 self
144 }
145 pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
147 &self.id
148 }
149 pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151 self.title = ::std::option::Option::Some(input.into());
152 self
153 }
154 pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156 self.title = input;
157 self
158 }
159 pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
161 &self.title
162 }
163 pub fn short_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165 self.short_name = ::std::option::Option::Some(input.into());
166 self
167 }
168 pub fn set_short_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170 self.short_name = input;
171 self
172 }
173 pub fn get_short_name(&self) -> &::std::option::Option<::std::string::String> {
175 &self.short_name
176 }
177 pub fn insights(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
179 self.insights = ::std::option::Option::Some(input.into());
180 self
181 }
182 pub fn set_insights(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
184 self.insights = input;
185 self
186 }
187 pub fn get_insights(&self) -> &::std::option::Option<::std::string::String> {
189 &self.insights
190 }
191 pub fn status(mut self, input: crate::types::Status) -> Self {
193 self.status = ::std::option::Option::Some(input);
194 self
195 }
196 pub fn set_status(mut self, input: ::std::option::Option<crate::types::Status>) -> Self {
198 self.status = input;
199 self
200 }
201 pub fn get_status(&self) -> &::std::option::Option<crate::types::Status> {
203 &self.status
204 }
205 pub fn affected_resource(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
207 self.affected_resource = ::std::option::Option::Some(input.into());
208 self
209 }
210 pub fn set_affected_resource(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
212 self.affected_resource = input;
213 self
214 }
215 pub fn get_affected_resource(&self) -> &::std::option::Option<::std::string::String> {
217 &self.affected_resource
218 }
219 pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
221 self.start_time = ::std::option::Option::Some(input);
222 self
223 }
224 pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
226 self.start_time = input;
227 self
228 }
229 pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
231 &self.start_time
232 }
233 pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
235 self.end_time = ::std::option::Option::Some(input);
236 self
237 }
238 pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
240 self.end_time = input;
241 self
242 }
243 pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
245 &self.end_time
246 }
247 pub fn severity_level(mut self, input: crate::types::SeverityLevel) -> Self {
249 self.severity_level = ::std::option::Option::Some(input);
250 self
251 }
252 pub fn set_severity_level(mut self, input: ::std::option::Option<crate::types::SeverityLevel>) -> Self {
254 self.severity_level = input;
255 self
256 }
257 pub fn get_severity_level(&self) -> &::std::option::Option<crate::types::SeverityLevel> {
259 &self.severity_level
260 }
261 pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
263 self.account_id = ::std::option::Option::Some(input.into());
264 self
265 }
266 pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
268 self.account_id = input;
269 self
270 }
271 pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
273 &self.account_id
274 }
275 pub fn resource_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
277 self.resource_group_name = ::std::option::Option::Some(input.into());
278 self
279 }
280 pub fn set_resource_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
282 self.resource_group_name = input;
283 self
284 }
285 pub fn get_resource_group_name(&self) -> &::std::option::Option<::std::string::String> {
287 &self.resource_group_name
288 }
289 pub fn feedback(mut self, k: crate::types::FeedbackKey, v: crate::types::FeedbackValue) -> Self {
295 let mut hash_map = self.feedback.unwrap_or_default();
296 hash_map.insert(k, v);
297 self.feedback = ::std::option::Option::Some(hash_map);
298 self
299 }
300 pub fn set_feedback(
302 mut self,
303 input: ::std::option::Option<::std::collections::HashMap<crate::types::FeedbackKey, crate::types::FeedbackValue>>,
304 ) -> Self {
305 self.feedback = input;
306 self
307 }
308 pub fn get_feedback(&self) -> &::std::option::Option<::std::collections::HashMap<crate::types::FeedbackKey, crate::types::FeedbackValue>> {
310 &self.feedback
311 }
312 pub fn recurring_count(mut self, input: i64) -> Self {
314 self.recurring_count = ::std::option::Option::Some(input);
315 self
316 }
317 pub fn set_recurring_count(mut self, input: ::std::option::Option<i64>) -> Self {
319 self.recurring_count = input;
320 self
321 }
322 pub fn get_recurring_count(&self) -> &::std::option::Option<i64> {
324 &self.recurring_count
325 }
326 pub fn last_recurrence_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
328 self.last_recurrence_time = ::std::option::Option::Some(input);
329 self
330 }
331 pub fn set_last_recurrence_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
333 self.last_recurrence_time = input;
334 self
335 }
336 pub fn get_last_recurrence_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
338 &self.last_recurrence_time
339 }
340 pub fn visibility(mut self, input: crate::types::Visibility) -> Self {
342 self.visibility = ::std::option::Option::Some(input);
343 self
344 }
345 pub fn set_visibility(mut self, input: ::std::option::Option<crate::types::Visibility>) -> Self {
347 self.visibility = input;
348 self
349 }
350 pub fn get_visibility(&self) -> &::std::option::Option<crate::types::Visibility> {
352 &self.visibility
353 }
354 pub fn resolution_method(mut self, input: crate::types::ResolutionMethod) -> Self {
356 self.resolution_method = ::std::option::Option::Some(input);
357 self
358 }
359 pub fn set_resolution_method(mut self, input: ::std::option::Option<crate::types::ResolutionMethod>) -> Self {
361 self.resolution_method = input;
362 self
363 }
364 pub fn get_resolution_method(&self) -> &::std::option::Option<crate::types::ResolutionMethod> {
366 &self.resolution_method
367 }
368 pub fn build(self) -> crate::types::Problem {
370 crate::types::Problem {
371 id: self.id,
372 title: self.title,
373 short_name: self.short_name,
374 insights: self.insights,
375 status: self.status,
376 affected_resource: self.affected_resource,
377 start_time: self.start_time,
378 end_time: self.end_time,
379 severity_level: self.severity_level,
380 account_id: self.account_id,
381 resource_group_name: self.resource_group_name,
382 feedback: self.feedback,
383 recurring_count: self.recurring_count,
384 last_recurrence_time: self.last_recurrence_time,
385 visibility: self.visibility,
386 resolution_method: self.resolution_method,
387 }
388 }
389}