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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A set of conditions that specify which recommended action qualify for implementation. When a rule is active and a recommended action matches these criteria, Compute Optimizer implements the action at the scheduled run time. You can specify up to 20 conditions per filter criteria and 20 values per condition.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Criteria {
/// <p>Filter criteria for Amazon Web Services regions where resources must be located.</p>
pub region: ::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>>,
/// <p>Filter criteria for specific resource ARNs to include or exclude.</p>
pub resource_arn: ::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>>,
/// <p>Filter criteria for EBS volume types, such as gp2, gp3, io1, io2, st1, or sc1.</p>
pub ebs_volume_type: ::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>>,
/// <p>Filter criteria for EBS volume sizes in gibibytes (GiB).</p>
pub ebs_volume_size_in_gib: ::std::option::Option<::std::vec::Vec<crate::types::IntegerCriteriaCondition>>,
/// <p>Filter criteria for estimated monthly cost savings from the recommended action.</p>
pub estimated_monthly_savings: ::std::option::Option<::std::vec::Vec<crate::types::DoubleCriteriaCondition>>,
/// <p>Filter criteria for resource tags, allowing filtering by tag key and value combinations.</p>
pub resource_tag: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTagsCriteriaCondition>>,
/// <p>Filter criteria for the lookback period in days used to analyze resource utilization.</p>
pub look_back_period_in_days: ::std::option::Option<::std::vec::Vec<crate::types::IntegerCriteriaCondition>>,
/// <p>Filter criteria indicating whether the recommended action requires a resource restart.</p>
pub restart_needed: ::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>>,
}
impl Criteria {
/// <p>Filter criteria for Amazon Web Services regions where resources must be located.</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 `.region.is_none()`.
pub fn region(&self) -> &[crate::types::StringCriteriaCondition] {
self.region.as_deref().unwrap_or_default()
}
/// <p>Filter criteria for specific resource ARNs to include or exclude.</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 `.resource_arn.is_none()`.
pub fn resource_arn(&self) -> &[crate::types::StringCriteriaCondition] {
self.resource_arn.as_deref().unwrap_or_default()
}
/// <p>Filter criteria for EBS volume types, such as gp2, gp3, io1, io2, st1, or sc1.</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 `.ebs_volume_type.is_none()`.
pub fn ebs_volume_type(&self) -> &[crate::types::StringCriteriaCondition] {
self.ebs_volume_type.as_deref().unwrap_or_default()
}
/// <p>Filter criteria for EBS volume sizes in gibibytes (GiB).</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 `.ebs_volume_size_in_gib.is_none()`.
pub fn ebs_volume_size_in_gib(&self) -> &[crate::types::IntegerCriteriaCondition] {
self.ebs_volume_size_in_gib.as_deref().unwrap_or_default()
}
/// <p>Filter criteria for estimated monthly cost savings from the recommended action.</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 `.estimated_monthly_savings.is_none()`.
pub fn estimated_monthly_savings(&self) -> &[crate::types::DoubleCriteriaCondition] {
self.estimated_monthly_savings.as_deref().unwrap_or_default()
}
/// <p>Filter criteria for resource tags, allowing filtering by tag key and value combinations.</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 `.resource_tag.is_none()`.
pub fn resource_tag(&self) -> &[crate::types::ResourceTagsCriteriaCondition] {
self.resource_tag.as_deref().unwrap_or_default()
}
/// <p>Filter criteria for the lookback period in days used to analyze resource utilization.</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 `.look_back_period_in_days.is_none()`.
pub fn look_back_period_in_days(&self) -> &[crate::types::IntegerCriteriaCondition] {
self.look_back_period_in_days.as_deref().unwrap_or_default()
}
/// <p>Filter criteria indicating whether the recommended action requires a resource restart.</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 `.restart_needed.is_none()`.
pub fn restart_needed(&self) -> &[crate::types::StringCriteriaCondition] {
self.restart_needed.as_deref().unwrap_or_default()
}
}
impl Criteria {
/// Creates a new builder-style object to manufacture [`Criteria`](crate::types::Criteria).
pub fn builder() -> crate::types::builders::CriteriaBuilder {
crate::types::builders::CriteriaBuilder::default()
}
}
/// A builder for [`Criteria`](crate::types::Criteria).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CriteriaBuilder {
pub(crate) region: ::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>>,
pub(crate) resource_arn: ::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>>,
pub(crate) ebs_volume_type: ::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>>,
pub(crate) ebs_volume_size_in_gib: ::std::option::Option<::std::vec::Vec<crate::types::IntegerCriteriaCondition>>,
pub(crate) estimated_monthly_savings: ::std::option::Option<::std::vec::Vec<crate::types::DoubleCriteriaCondition>>,
pub(crate) resource_tag: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTagsCriteriaCondition>>,
pub(crate) look_back_period_in_days: ::std::option::Option<::std::vec::Vec<crate::types::IntegerCriteriaCondition>>,
pub(crate) restart_needed: ::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>>,
}
impl CriteriaBuilder {
/// Appends an item to `region`.
///
/// To override the contents of this collection use [`set_region`](Self::set_region).
///
/// <p>Filter criteria for Amazon Web Services regions where resources must be located.</p>
pub fn region(mut self, input: crate::types::StringCriteriaCondition) -> Self {
let mut v = self.region.unwrap_or_default();
v.push(input);
self.region = ::std::option::Option::Some(v);
self
}
/// <p>Filter criteria for Amazon Web Services regions where resources must be located.</p>
pub fn set_region(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>>) -> Self {
self.region = input;
self
}
/// <p>Filter criteria for Amazon Web Services regions where resources must be located.</p>
pub fn get_region(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>> {
&self.region
}
/// Appends an item to `resource_arn`.
///
/// To override the contents of this collection use [`set_resource_arn`](Self::set_resource_arn).
///
/// <p>Filter criteria for specific resource ARNs to include or exclude.</p>
pub fn resource_arn(mut self, input: crate::types::StringCriteriaCondition) -> Self {
let mut v = self.resource_arn.unwrap_or_default();
v.push(input);
self.resource_arn = ::std::option::Option::Some(v);
self
}
/// <p>Filter criteria for specific resource ARNs to include or exclude.</p>
pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>>) -> Self {
self.resource_arn = input;
self
}
/// <p>Filter criteria for specific resource ARNs to include or exclude.</p>
pub fn get_resource_arn(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>> {
&self.resource_arn
}
/// Appends an item to `ebs_volume_type`.
///
/// To override the contents of this collection use [`set_ebs_volume_type`](Self::set_ebs_volume_type).
///
/// <p>Filter criteria for EBS volume types, such as gp2, gp3, io1, io2, st1, or sc1.</p>
pub fn ebs_volume_type(mut self, input: crate::types::StringCriteriaCondition) -> Self {
let mut v = self.ebs_volume_type.unwrap_or_default();
v.push(input);
self.ebs_volume_type = ::std::option::Option::Some(v);
self
}
/// <p>Filter criteria for EBS volume types, such as gp2, gp3, io1, io2, st1, or sc1.</p>
pub fn set_ebs_volume_type(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>>) -> Self {
self.ebs_volume_type = input;
self
}
/// <p>Filter criteria for EBS volume types, such as gp2, gp3, io1, io2, st1, or sc1.</p>
pub fn get_ebs_volume_type(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>> {
&self.ebs_volume_type
}
/// Appends an item to `ebs_volume_size_in_gib`.
///
/// To override the contents of this collection use [`set_ebs_volume_size_in_gib`](Self::set_ebs_volume_size_in_gib).
///
/// <p>Filter criteria for EBS volume sizes in gibibytes (GiB).</p>
pub fn ebs_volume_size_in_gib(mut self, input: crate::types::IntegerCriteriaCondition) -> Self {
let mut v = self.ebs_volume_size_in_gib.unwrap_or_default();
v.push(input);
self.ebs_volume_size_in_gib = ::std::option::Option::Some(v);
self
}
/// <p>Filter criteria for EBS volume sizes in gibibytes (GiB).</p>
pub fn set_ebs_volume_size_in_gib(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::IntegerCriteriaCondition>>) -> Self {
self.ebs_volume_size_in_gib = input;
self
}
/// <p>Filter criteria for EBS volume sizes in gibibytes (GiB).</p>
pub fn get_ebs_volume_size_in_gib(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::IntegerCriteriaCondition>> {
&self.ebs_volume_size_in_gib
}
/// Appends an item to `estimated_monthly_savings`.
///
/// To override the contents of this collection use [`set_estimated_monthly_savings`](Self::set_estimated_monthly_savings).
///
/// <p>Filter criteria for estimated monthly cost savings from the recommended action.</p>
pub fn estimated_monthly_savings(mut self, input: crate::types::DoubleCriteriaCondition) -> Self {
let mut v = self.estimated_monthly_savings.unwrap_or_default();
v.push(input);
self.estimated_monthly_savings = ::std::option::Option::Some(v);
self
}
/// <p>Filter criteria for estimated monthly cost savings from the recommended action.</p>
pub fn set_estimated_monthly_savings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DoubleCriteriaCondition>>) -> Self {
self.estimated_monthly_savings = input;
self
}
/// <p>Filter criteria for estimated monthly cost savings from the recommended action.</p>
pub fn get_estimated_monthly_savings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DoubleCriteriaCondition>> {
&self.estimated_monthly_savings
}
/// Appends an item to `resource_tag`.
///
/// To override the contents of this collection use [`set_resource_tag`](Self::set_resource_tag).
///
/// <p>Filter criteria for resource tags, allowing filtering by tag key and value combinations.</p>
pub fn resource_tag(mut self, input: crate::types::ResourceTagsCriteriaCondition) -> Self {
let mut v = self.resource_tag.unwrap_or_default();
v.push(input);
self.resource_tag = ::std::option::Option::Some(v);
self
}
/// <p>Filter criteria for resource tags, allowing filtering by tag key and value combinations.</p>
pub fn set_resource_tag(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTagsCriteriaCondition>>) -> Self {
self.resource_tag = input;
self
}
/// <p>Filter criteria for resource tags, allowing filtering by tag key and value combinations.</p>
pub fn get_resource_tag(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourceTagsCriteriaCondition>> {
&self.resource_tag
}
/// Appends an item to `look_back_period_in_days`.
///
/// To override the contents of this collection use [`set_look_back_period_in_days`](Self::set_look_back_period_in_days).
///
/// <p>Filter criteria for the lookback period in days used to analyze resource utilization.</p>
pub fn look_back_period_in_days(mut self, input: crate::types::IntegerCriteriaCondition) -> Self {
let mut v = self.look_back_period_in_days.unwrap_or_default();
v.push(input);
self.look_back_period_in_days = ::std::option::Option::Some(v);
self
}
/// <p>Filter criteria for the lookback period in days used to analyze resource utilization.</p>
pub fn set_look_back_period_in_days(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::IntegerCriteriaCondition>>) -> Self {
self.look_back_period_in_days = input;
self
}
/// <p>Filter criteria for the lookback period in days used to analyze resource utilization.</p>
pub fn get_look_back_period_in_days(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::IntegerCriteriaCondition>> {
&self.look_back_period_in_days
}
/// Appends an item to `restart_needed`.
///
/// To override the contents of this collection use [`set_restart_needed`](Self::set_restart_needed).
///
/// <p>Filter criteria indicating whether the recommended action requires a resource restart.</p>
pub fn restart_needed(mut self, input: crate::types::StringCriteriaCondition) -> Self {
let mut v = self.restart_needed.unwrap_or_default();
v.push(input);
self.restart_needed = ::std::option::Option::Some(v);
self
}
/// <p>Filter criteria indicating whether the recommended action requires a resource restart.</p>
pub fn set_restart_needed(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>>) -> Self {
self.restart_needed = input;
self
}
/// <p>Filter criteria indicating whether the recommended action requires a resource restart.</p>
pub fn get_restart_needed(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StringCriteriaCondition>> {
&self.restart_needed
}
/// Consumes the builder and constructs a [`Criteria`](crate::types::Criteria).
pub fn build(self) -> crate::types::Criteria {
crate::types::Criteria {
region: self.region,
resource_arn: self.resource_arn,
ebs_volume_type: self.ebs_volume_type,
ebs_volume_size_in_gib: self.ebs_volume_size_in_gib,
estimated_monthly_savings: self.estimated_monthly_savings,
resource_tag: self.resource_tag,
look_back_period_in_days: self.look_back_period_in_days,
restart_needed: self.restart_needed,
}
}
}