1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Recommendation information to help you remediate detected anomalous behavior that generated an insight.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Recommendation {
/// <p>A description of the problem.</p>
pub description: ::std::option::Option<::std::string::String>,
/// <p>A hyperlink to information to help you address the problem.</p>
pub link: ::std::option::Option<::std::string::String>,
/// <p>The name of the recommendation.</p>
pub name: ::std::option::Option<::std::string::String>,
/// <p>The reason DevOps Guru flagged the anomalous behavior as a problem.</p>
pub reason: ::std::option::Option<::std::string::String>,
/// <p>Events that are related to the problem. Use these events to learn more about what's happening and to help address the issue.</p>
pub related_events: ::std::option::Option<::std::vec::Vec<crate::types::RecommendationRelatedEvent>>,
/// <p>Anomalies that are related to the problem. Use these Anomalies to learn more about what's happening and to help address the issue.</p>
pub related_anomalies: ::std::option::Option<::std::vec::Vec<crate::types::RecommendationRelatedAnomaly>>,
/// <p>The category type of the recommendation.</p>
pub category: ::std::option::Option<::std::string::String>,
}
impl Recommendation {
/// <p>A description of the problem.</p>
pub fn description(&self) -> ::std::option::Option<&str> {
self.description.as_deref()
}
/// <p>A hyperlink to information to help you address the problem.</p>
pub fn link(&self) -> ::std::option::Option<&str> {
self.link.as_deref()
}
/// <p>The name of the recommendation.</p>
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The reason DevOps Guru flagged the anomalous behavior as a problem.</p>
pub fn reason(&self) -> ::std::option::Option<&str> {
self.reason.as_deref()
}
/// <p>Events that are related to the problem. Use these events to learn more about what's happening and to help address the issue.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.related_events.is_none()`.
pub fn related_events(&self) -> &[crate::types::RecommendationRelatedEvent] {
self.related_events.as_deref().unwrap_or_default()
}
/// <p>Anomalies that are related to the problem. Use these Anomalies to learn more about what's happening and to help address the issue.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.related_anomalies.is_none()`.
pub fn related_anomalies(&self) -> &[crate::types::RecommendationRelatedAnomaly] {
self.related_anomalies.as_deref().unwrap_or_default()
}
/// <p>The category type of the recommendation.</p>
pub fn category(&self) -> ::std::option::Option<&str> {
self.category.as_deref()
}
}
impl Recommendation {
/// Creates a new builder-style object to manufacture [`Recommendation`](crate::types::Recommendation).
pub fn builder() -> crate::types::builders::RecommendationBuilder {
crate::types::builders::RecommendationBuilder::default()
}
}
/// A builder for [`Recommendation`](crate::types::Recommendation).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RecommendationBuilder {
pub(crate) description: ::std::option::Option<::std::string::String>,
pub(crate) link: ::std::option::Option<::std::string::String>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) reason: ::std::option::Option<::std::string::String>,
pub(crate) related_events: ::std::option::Option<::std::vec::Vec<crate::types::RecommendationRelatedEvent>>,
pub(crate) related_anomalies: ::std::option::Option<::std::vec::Vec<crate::types::RecommendationRelatedAnomaly>>,
pub(crate) category: ::std::option::Option<::std::string::String>,
}
impl RecommendationBuilder {
/// <p>A description of the problem.</p>
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.description = ::std::option::Option::Some(input.into());
self
}
/// <p>A description of the problem.</p>
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input;
self
}
/// <p>A description of the problem.</p>
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
/// <p>A hyperlink to information to help you address the problem.</p>
pub fn link(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.link = ::std::option::Option::Some(input.into());
self
}
/// <p>A hyperlink to information to help you address the problem.</p>
pub fn set_link(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.link = input;
self
}
/// <p>A hyperlink to information to help you address the problem.</p>
pub fn get_link(&self) -> &::std::option::Option<::std::string::String> {
&self.link
}
/// <p>The name of the recommendation.</p>
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the recommendation.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The name of the recommendation.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// <p>The reason DevOps Guru flagged the anomalous behavior as a problem.</p>
pub fn reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.reason = ::std::option::Option::Some(input.into());
self
}
/// <p>The reason DevOps Guru flagged the anomalous behavior as a problem.</p>
pub fn set_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.reason = input;
self
}
/// <p>The reason DevOps Guru flagged the anomalous behavior as a problem.</p>
pub fn get_reason(&self) -> &::std::option::Option<::std::string::String> {
&self.reason
}
/// Appends an item to `related_events`.
///
/// To override the contents of this collection use [`set_related_events`](Self::set_related_events).
///
/// <p>Events that are related to the problem. Use these events to learn more about what's happening and to help address the issue.</p>
pub fn related_events(mut self, input: crate::types::RecommendationRelatedEvent) -> Self {
let mut v = self.related_events.unwrap_or_default();
v.push(input);
self.related_events = ::std::option::Option::Some(v);
self
}
/// <p>Events that are related to the problem. Use these events to learn more about what's happening and to help address the issue.</p>
pub fn set_related_events(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RecommendationRelatedEvent>>) -> Self {
self.related_events = input;
self
}
/// <p>Events that are related to the problem. Use these events to learn more about what's happening and to help address the issue.</p>
pub fn get_related_events(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RecommendationRelatedEvent>> {
&self.related_events
}
/// Appends an item to `related_anomalies`.
///
/// To override the contents of this collection use [`set_related_anomalies`](Self::set_related_anomalies).
///
/// <p>Anomalies that are related to the problem. Use these Anomalies to learn more about what's happening and to help address the issue.</p>
pub fn related_anomalies(mut self, input: crate::types::RecommendationRelatedAnomaly) -> Self {
let mut v = self.related_anomalies.unwrap_or_default();
v.push(input);
self.related_anomalies = ::std::option::Option::Some(v);
self
}
/// <p>Anomalies that are related to the problem. Use these Anomalies to learn more about what's happening and to help address the issue.</p>
pub fn set_related_anomalies(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RecommendationRelatedAnomaly>>) -> Self {
self.related_anomalies = input;
self
}
/// <p>Anomalies that are related to the problem. Use these Anomalies to learn more about what's happening and to help address the issue.</p>
pub fn get_related_anomalies(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RecommendationRelatedAnomaly>> {
&self.related_anomalies
}
/// <p>The category type of the recommendation.</p>
pub fn category(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.category = ::std::option::Option::Some(input.into());
self
}
/// <p>The category type of the recommendation.</p>
pub fn set_category(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.category = input;
self
}
/// <p>The category type of the recommendation.</p>
pub fn get_category(&self) -> &::std::option::Option<::std::string::String> {
&self.category
}
/// Consumes the builder and constructs a [`Recommendation`](crate::types::Recommendation).
pub fn build(self) -> crate::types::Recommendation {
crate::types::Recommendation {
description: self.description,
link: self.link,
name: self.name,
reason: self.reason,
related_events: self.related_events,
related_anomalies: self.related_anomalies,
category: self.category,
}
}
}