aws_sdk_applicationinsights/types/
_problem.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes a problem that is detected by correlating observations.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Problem {
7    /// <p>The ID of the problem.</p>
8    pub id: ::std::option::Option<::std::string::String>,
9    /// <p>The name of the problem.</p>
10    pub title: ::std::option::Option<::std::string::String>,
11    /// <p>The short name of the problem associated with the SNS notification.</p>
12    pub short_name: ::std::option::Option<::std::string::String>,
13    /// <p>A detailed analysis of the problem using machine learning.</p>
14    pub insights: ::std::option::Option<::std::string::String>,
15    /// <p>The status of the problem.</p>
16    pub status: ::std::option::Option<crate::types::Status>,
17    /// <p>The resource affected by the problem.</p>
18    pub affected_resource: ::std::option::Option<::std::string::String>,
19    /// <p>The time when the problem started, in epoch seconds.</p>
20    pub start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
21    /// <p>The time when the problem ended, in epoch seconds.</p>
22    pub end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
23    /// <p>A measure of the level of impact of the problem.</p>
24    pub severity_level: ::std::option::Option<crate::types::SeverityLevel>,
25    /// <p>The Amazon Web Services account ID for the owner of the resource group affected by the problem.</p>
26    pub account_id: ::std::option::Option<::std::string::String>,
27    /// <p>The name of the resource group affected by the problem.</p>
28    pub resource_group_name: ::std::option::Option<::std::string::String>,
29    /// <p>Feedback provided by the user about the problem.</p>
30    pub feedback: ::std::option::Option<::std::collections::HashMap<crate::types::FeedbackKey, crate::types::FeedbackValue>>,
31    /// <p>The number of times that the same problem reoccurred after the first time it was resolved.</p>
32    pub recurring_count: ::std::option::Option<i64>,
33    /// <p>The last time that the problem reoccurred after its last resolution.</p>
34    pub last_recurrence_time: ::std::option::Option<::aws_smithy_types::DateTime>,
35    /// <p>Specifies whether or not you can view the problem. Updates to ignored problems do not generate notifications.</p>
36    pub visibility: ::std::option::Option<crate::types::Visibility>,
37    /// <p>Specifies how the problem was resolved. If the value is <code>AUTOMATIC</code>, the system resolved the problem. If the value is <code>MANUAL</code>, the user resolved the problem. If the value is <code>UNRESOLVED</code>, then the problem is not resolved.</p>
38    pub resolution_method: ::std::option::Option<crate::types::ResolutionMethod>,
39}
40impl Problem {
41    /// <p>The ID of the problem.</p>
42    pub fn id(&self) -> ::std::option::Option<&str> {
43        self.id.as_deref()
44    }
45    /// <p>The name of the problem.</p>
46    pub fn title(&self) -> ::std::option::Option<&str> {
47        self.title.as_deref()
48    }
49    /// <p>The short name of the problem associated with the SNS notification.</p>
50    pub fn short_name(&self) -> ::std::option::Option<&str> {
51        self.short_name.as_deref()
52    }
53    /// <p>A detailed analysis of the problem using machine learning.</p>
54    pub fn insights(&self) -> ::std::option::Option<&str> {
55        self.insights.as_deref()
56    }
57    /// <p>The status of the problem.</p>
58    pub fn status(&self) -> ::std::option::Option<&crate::types::Status> {
59        self.status.as_ref()
60    }
61    /// <p>The resource affected by the problem.</p>
62    pub fn affected_resource(&self) -> ::std::option::Option<&str> {
63        self.affected_resource.as_deref()
64    }
65    /// <p>The time when the problem started, in epoch seconds.</p>
66    pub fn start_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
67        self.start_time.as_ref()
68    }
69    /// <p>The time when the problem ended, in epoch seconds.</p>
70    pub fn end_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
71        self.end_time.as_ref()
72    }
73    /// <p>A measure of the level of impact of the problem.</p>
74    pub fn severity_level(&self) -> ::std::option::Option<&crate::types::SeverityLevel> {
75        self.severity_level.as_ref()
76    }
77    /// <p>The Amazon Web Services account ID for the owner of the resource group affected by the problem.</p>
78    pub fn account_id(&self) -> ::std::option::Option<&str> {
79        self.account_id.as_deref()
80    }
81    /// <p>The name of the resource group affected by the problem.</p>
82    pub fn resource_group_name(&self) -> ::std::option::Option<&str> {
83        self.resource_group_name.as_deref()
84    }
85    /// <p>Feedback provided by the user about the problem.</p>
86    pub fn feedback(&self) -> ::std::option::Option<&::std::collections::HashMap<crate::types::FeedbackKey, crate::types::FeedbackValue>> {
87        self.feedback.as_ref()
88    }
89    /// <p>The number of times that the same problem reoccurred after the first time it was resolved.</p>
90    pub fn recurring_count(&self) -> ::std::option::Option<i64> {
91        self.recurring_count
92    }
93    /// <p>The last time that the problem reoccurred after its last resolution.</p>
94    pub fn last_recurrence_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
95        self.last_recurrence_time.as_ref()
96    }
97    /// <p>Specifies whether or not you can view the problem. Updates to ignored problems do not generate notifications.</p>
98    pub fn visibility(&self) -> ::std::option::Option<&crate::types::Visibility> {
99        self.visibility.as_ref()
100    }
101    /// <p>Specifies how the problem was resolved. If the value is <code>AUTOMATIC</code>, the system resolved the problem. If the value is <code>MANUAL</code>, the user resolved the problem. If the value is <code>UNRESOLVED</code>, then the problem is not resolved.</p>
102    pub fn resolution_method(&self) -> ::std::option::Option<&crate::types::ResolutionMethod> {
103        self.resolution_method.as_ref()
104    }
105}
106impl Problem {
107    /// Creates a new builder-style object to manufacture [`Problem`](crate::types::Problem).
108    pub fn builder() -> crate::types::builders::ProblemBuilder {
109        crate::types::builders::ProblemBuilder::default()
110    }
111}
112
113/// A builder for [`Problem`](crate::types::Problem).
114#[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    /// <p>The ID of the problem.</p>
136    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    /// <p>The ID of the problem.</p>
141    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142        self.id = input;
143        self
144    }
145    /// <p>The ID of the problem.</p>
146    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
147        &self.id
148    }
149    /// <p>The name of the problem.</p>
150    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    /// <p>The name of the problem.</p>
155    pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156        self.title = input;
157        self
158    }
159    /// <p>The name of the problem.</p>
160    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
161        &self.title
162    }
163    /// <p>The short name of the problem associated with the SNS notification.</p>
164    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    /// <p>The short name of the problem associated with the SNS notification.</p>
169    pub fn set_short_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.short_name = input;
171        self
172    }
173    /// <p>The short name of the problem associated with the SNS notification.</p>
174    pub fn get_short_name(&self) -> &::std::option::Option<::std::string::String> {
175        &self.short_name
176    }
177    /// <p>A detailed analysis of the problem using machine learning.</p>
178    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    /// <p>A detailed analysis of the problem using machine learning.</p>
183    pub fn set_insights(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
184        self.insights = input;
185        self
186    }
187    /// <p>A detailed analysis of the problem using machine learning.</p>
188    pub fn get_insights(&self) -> &::std::option::Option<::std::string::String> {
189        &self.insights
190    }
191    /// <p>The status of the problem.</p>
192    pub fn status(mut self, input: crate::types::Status) -> Self {
193        self.status = ::std::option::Option::Some(input);
194        self
195    }
196    /// <p>The status of the problem.</p>
197    pub fn set_status(mut self, input: ::std::option::Option<crate::types::Status>) -> Self {
198        self.status = input;
199        self
200    }
201    /// <p>The status of the problem.</p>
202    pub fn get_status(&self) -> &::std::option::Option<crate::types::Status> {
203        &self.status
204    }
205    /// <p>The resource affected by the problem.</p>
206    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    /// <p>The resource affected by the problem.</p>
211    pub fn set_affected_resource(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
212        self.affected_resource = input;
213        self
214    }
215    /// <p>The resource affected by the problem.</p>
216    pub fn get_affected_resource(&self) -> &::std::option::Option<::std::string::String> {
217        &self.affected_resource
218    }
219    /// <p>The time when the problem started, in epoch seconds.</p>
220    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    /// <p>The time when the problem started, in epoch seconds.</p>
225    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    /// <p>The time when the problem started, in epoch seconds.</p>
230    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
231        &self.start_time
232    }
233    /// <p>The time when the problem ended, in epoch seconds.</p>
234    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    /// <p>The time when the problem ended, in epoch seconds.</p>
239    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    /// <p>The time when the problem ended, in epoch seconds.</p>
244    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
245        &self.end_time
246    }
247    /// <p>A measure of the level of impact of the problem.</p>
248    pub fn severity_level(mut self, input: crate::types::SeverityLevel) -> Self {
249        self.severity_level = ::std::option::Option::Some(input);
250        self
251    }
252    /// <p>A measure of the level of impact of the problem.</p>
253    pub fn set_severity_level(mut self, input: ::std::option::Option<crate::types::SeverityLevel>) -> Self {
254        self.severity_level = input;
255        self
256    }
257    /// <p>A measure of the level of impact of the problem.</p>
258    pub fn get_severity_level(&self) -> &::std::option::Option<crate::types::SeverityLevel> {
259        &self.severity_level
260    }
261    /// <p>The Amazon Web Services account ID for the owner of the resource group affected by the problem.</p>
262    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    /// <p>The Amazon Web Services account ID for the owner of the resource group affected by the problem.</p>
267    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
268        self.account_id = input;
269        self
270    }
271    /// <p>The Amazon Web Services account ID for the owner of the resource group affected by the problem.</p>
272    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
273        &self.account_id
274    }
275    /// <p>The name of the resource group affected by the problem.</p>
276    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    /// <p>The name of the resource group affected by the problem.</p>
281    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    /// <p>The name of the resource group affected by the problem.</p>
286    pub fn get_resource_group_name(&self) -> &::std::option::Option<::std::string::String> {
287        &self.resource_group_name
288    }
289    /// Adds a key-value pair to `feedback`.
290    ///
291    /// To override the contents of this collection use [`set_feedback`](Self::set_feedback).
292    ///
293    /// <p>Feedback provided by the user about the problem.</p>
294    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    /// <p>Feedback provided by the user about the problem.</p>
301    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    /// <p>Feedback provided by the user about the problem.</p>
309    pub fn get_feedback(&self) -> &::std::option::Option<::std::collections::HashMap<crate::types::FeedbackKey, crate::types::FeedbackValue>> {
310        &self.feedback
311    }
312    /// <p>The number of times that the same problem reoccurred after the first time it was resolved.</p>
313    pub fn recurring_count(mut self, input: i64) -> Self {
314        self.recurring_count = ::std::option::Option::Some(input);
315        self
316    }
317    /// <p>The number of times that the same problem reoccurred after the first time it was resolved.</p>
318    pub fn set_recurring_count(mut self, input: ::std::option::Option<i64>) -> Self {
319        self.recurring_count = input;
320        self
321    }
322    /// <p>The number of times that the same problem reoccurred after the first time it was resolved.</p>
323    pub fn get_recurring_count(&self) -> &::std::option::Option<i64> {
324        &self.recurring_count
325    }
326    /// <p>The last time that the problem reoccurred after its last resolution.</p>
327    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    /// <p>The last time that the problem reoccurred after its last resolution.</p>
332    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    /// <p>The last time that the problem reoccurred after its last resolution.</p>
337    pub fn get_last_recurrence_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
338        &self.last_recurrence_time
339    }
340    /// <p>Specifies whether or not you can view the problem. Updates to ignored problems do not generate notifications.</p>
341    pub fn visibility(mut self, input: crate::types::Visibility) -> Self {
342        self.visibility = ::std::option::Option::Some(input);
343        self
344    }
345    /// <p>Specifies whether or not you can view the problem. Updates to ignored problems do not generate notifications.</p>
346    pub fn set_visibility(mut self, input: ::std::option::Option<crate::types::Visibility>) -> Self {
347        self.visibility = input;
348        self
349    }
350    /// <p>Specifies whether or not you can view the problem. Updates to ignored problems do not generate notifications.</p>
351    pub fn get_visibility(&self) -> &::std::option::Option<crate::types::Visibility> {
352        &self.visibility
353    }
354    /// <p>Specifies how the problem was resolved. If the value is <code>AUTOMATIC</code>, the system resolved the problem. If the value is <code>MANUAL</code>, the user resolved the problem. If the value is <code>UNRESOLVED</code>, then the problem is not resolved.</p>
355    pub fn resolution_method(mut self, input: crate::types::ResolutionMethod) -> Self {
356        self.resolution_method = ::std::option::Option::Some(input);
357        self
358    }
359    /// <p>Specifies how the problem was resolved. If the value is <code>AUTOMATIC</code>, the system resolved the problem. If the value is <code>MANUAL</code>, the user resolved the problem. If the value is <code>UNRESOLVED</code>, then the problem is not resolved.</p>
360    pub fn set_resolution_method(mut self, input: ::std::option::Option<crate::types::ResolutionMethod>) -> Self {
361        self.resolution_method = input;
362        self
363    }
364    /// <p>Specifies how the problem was resolved. If the value is <code>AUTOMATIC</code>, the system resolved the problem. If the value is <code>MANUAL</code>, the user resolved the problem. If the value is <code>UNRESOLVED</code>, then the problem is not resolved.</p>
365    pub fn get_resolution_method(&self) -> &::std::option::Option<crate::types::ResolutionMethod> {
366        &self.resolution_method
367    }
368    /// Consumes the builder and constructs a [`Problem`](crate::types::Problem).
369    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}