Skip to main content

aws_sdk_computeoptimizer/types/
_ecs_service_recommendation.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes an Amazon ECS service recommendation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct EcsServiceRecommendation {
7    /// <p>The Amazon Resource Name (ARN) of the current Amazon ECS service.</p>
8    /// <p>The following is the format of the ARN:</p>
9    /// <p><code>arn:aws:ecs:region:aws_account_id:service/cluster-name/service-name</code></p>
10    pub service_arn: ::std::option::Option<::std::string::String>,
11    /// <p>The Amazon Web Services account ID of the Amazon ECS service.</p>
12    pub account_id: ::std::option::Option<::std::string::String>,
13    /// <p>The configuration of the current Amazon ECS service.</p>
14    pub current_service_configuration: ::std::option::Option<crate::types::ServiceConfiguration>,
15    /// <p>An array of objects that describe the utilization metrics of the Amazon ECS service.</p>
16    pub utilization_metrics: ::std::option::Option<::std::vec::Vec<crate::types::EcsServiceUtilizationMetric>>,
17    /// <p>The number of days the Amazon ECS service utilization metrics were analyzed.</p>
18    pub lookback_period_in_days: f64,
19    /// <p>The launch type the Amazon ECS service is using.</p><note>
20    /// <p>Compute Optimizer only supports the Fargate launch type.</p>
21    /// </note>
22    pub launch_type: ::std::option::Option<crate::types::EcsServiceLaunchType>,
23    /// <p>The timestamp of when the Amazon ECS service recommendation was last generated.</p>
24    pub last_refresh_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
25    /// <p>The finding classification of an Amazon ECS service.</p>
26    /// <p>Findings for Amazon ECS services include:</p>
27    /// <ul>
28    /// <li>
29    /// <p><b> <code>Underprovisioned</code> </b> — When Compute Optimizer detects that there’s not enough memory or CPU, an Amazon ECS service is considered under-provisioned. An under-provisioned service might result in poor application performance.</p></li>
30    /// <li>
31    /// <p><b> <code>Overprovisioned</code> </b> — When Compute Optimizer detects that there’s excessive memory or CPU, an Amazon ECS service is considered over-provisioned. An over-provisioned service might result in additional infrastructure costs.</p></li>
32    /// <li>
33    /// <p><b> <code>Optimized</code> </b> — When both the CPU and memory of your Amazon ECS service meet the performance requirements of your workload, the service is considered optimized.</p></li>
34    /// </ul>
35    pub finding: ::std::option::Option<crate::types::EcsServiceRecommendationFinding>,
36    /// <p>The reason for the finding classification of an Amazon ECS service.</p>
37    /// <p>Finding reason codes for Amazon ECS services include:</p>
38    /// <ul>
39    /// <li>
40    /// <p><b> <code>CPUUnderprovisioned</code> </b> — The service CPU configuration can be sized up to enhance the performance of your workload. This is identified by analyzing the <code>CPUUtilization</code> metric of the current service during the look-back period.</p></li>
41    /// <li>
42    /// <p><b> <code>CPUOverprovisioned</code> </b> — The service CPU configuration can be sized down while still meeting the performance requirements of your workload. This is identified by analyzing the <code>CPUUtilization</code> metric of the current service during the look-back period.</p></li>
43    /// <li>
44    /// <p><b> <code>MemoryUnderprovisioned</code> </b> — The service memory configuration can be sized up to enhance the performance of your workload. This is identified by analyzing the <code>MemoryUtilization</code> metric of the current service during the look-back period.</p></li>
45    /// <li>
46    /// <p><b> <code>MemoryOverprovisioned</code> </b> — The service memory configuration can be sized down while still meeting the performance requirements of your workload. This is identified by analyzing the <code>MemoryUtilization</code> metric of the current service during the look-back period.</p></li>
47    /// </ul>
48    pub finding_reason_codes: ::std::option::Option<::std::vec::Vec<crate::types::EcsServiceRecommendationFindingReasonCode>>,
49    /// <p>An array of objects that describe the recommendation options for the Amazon ECS service.</p>
50    pub service_recommendation_options: ::std::option::Option<::std::vec::Vec<crate::types::EcsServiceRecommendationOption>>,
51    /// <p>The risk of the current Amazon ECS service not meeting the performance needs of its workloads. The higher the risk, the more likely the current service can't meet the performance requirements of its workload.</p>
52    pub current_performance_risk: ::std::option::Option<crate::types::CurrentPerformanceRisk>,
53    /// <p>Describes the effective recommendation preferences for Amazon ECS services.</p>
54    pub effective_recommendation_preferences: ::std::option::Option<crate::types::EcsEffectiveRecommendationPreferences>,
55    /// <p>A list of tags assigned to your Amazon ECS service recommendations.</p>
56    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
57}
58impl EcsServiceRecommendation {
59    /// <p>The Amazon Resource Name (ARN) of the current Amazon ECS service.</p>
60    /// <p>The following is the format of the ARN:</p>
61    /// <p><code>arn:aws:ecs:region:aws_account_id:service/cluster-name/service-name</code></p>
62    pub fn service_arn(&self) -> ::std::option::Option<&str> {
63        self.service_arn.as_deref()
64    }
65    /// <p>The Amazon Web Services account ID of the Amazon ECS service.</p>
66    pub fn account_id(&self) -> ::std::option::Option<&str> {
67        self.account_id.as_deref()
68    }
69    /// <p>The configuration of the current Amazon ECS service.</p>
70    pub fn current_service_configuration(&self) -> ::std::option::Option<&crate::types::ServiceConfiguration> {
71        self.current_service_configuration.as_ref()
72    }
73    /// <p>An array of objects that describe the utilization metrics of the Amazon ECS service.</p>
74    ///
75    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.utilization_metrics.is_none()`.
76    pub fn utilization_metrics(&self) -> &[crate::types::EcsServiceUtilizationMetric] {
77        self.utilization_metrics.as_deref().unwrap_or_default()
78    }
79    /// <p>The number of days the Amazon ECS service utilization metrics were analyzed.</p>
80    pub fn lookback_period_in_days(&self) -> f64 {
81        self.lookback_period_in_days
82    }
83    /// <p>The launch type the Amazon ECS service is using.</p><note>
84    /// <p>Compute Optimizer only supports the Fargate launch type.</p>
85    /// </note>
86    pub fn launch_type(&self) -> ::std::option::Option<&crate::types::EcsServiceLaunchType> {
87        self.launch_type.as_ref()
88    }
89    /// <p>The timestamp of when the Amazon ECS service recommendation was last generated.</p>
90    pub fn last_refresh_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
91        self.last_refresh_timestamp.as_ref()
92    }
93    /// <p>The finding classification of an Amazon ECS service.</p>
94    /// <p>Findings for Amazon ECS services include:</p>
95    /// <ul>
96    /// <li>
97    /// <p><b> <code>Underprovisioned</code> </b> — When Compute Optimizer detects that there’s not enough memory or CPU, an Amazon ECS service is considered under-provisioned. An under-provisioned service might result in poor application performance.</p></li>
98    /// <li>
99    /// <p><b> <code>Overprovisioned</code> </b> — When Compute Optimizer detects that there’s excessive memory or CPU, an Amazon ECS service is considered over-provisioned. An over-provisioned service might result in additional infrastructure costs.</p></li>
100    /// <li>
101    /// <p><b> <code>Optimized</code> </b> — When both the CPU and memory of your Amazon ECS service meet the performance requirements of your workload, the service is considered optimized.</p></li>
102    /// </ul>
103    pub fn finding(&self) -> ::std::option::Option<&crate::types::EcsServiceRecommendationFinding> {
104        self.finding.as_ref()
105    }
106    /// <p>The reason for the finding classification of an Amazon ECS service.</p>
107    /// <p>Finding reason codes for Amazon ECS services include:</p>
108    /// <ul>
109    /// <li>
110    /// <p><b> <code>CPUUnderprovisioned</code> </b> — The service CPU configuration can be sized up to enhance the performance of your workload. This is identified by analyzing the <code>CPUUtilization</code> metric of the current service during the look-back period.</p></li>
111    /// <li>
112    /// <p><b> <code>CPUOverprovisioned</code> </b> — The service CPU configuration can be sized down while still meeting the performance requirements of your workload. This is identified by analyzing the <code>CPUUtilization</code> metric of the current service during the look-back period.</p></li>
113    /// <li>
114    /// <p><b> <code>MemoryUnderprovisioned</code> </b> — The service memory configuration can be sized up to enhance the performance of your workload. This is identified by analyzing the <code>MemoryUtilization</code> metric of the current service during the look-back period.</p></li>
115    /// <li>
116    /// <p><b> <code>MemoryOverprovisioned</code> </b> — The service memory configuration can be sized down while still meeting the performance requirements of your workload. This is identified by analyzing the <code>MemoryUtilization</code> metric of the current service during the look-back period.</p></li>
117    /// </ul>
118    ///
119    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.finding_reason_codes.is_none()`.
120    pub fn finding_reason_codes(&self) -> &[crate::types::EcsServiceRecommendationFindingReasonCode] {
121        self.finding_reason_codes.as_deref().unwrap_or_default()
122    }
123    /// <p>An array of objects that describe the recommendation options for the Amazon ECS service.</p>
124    ///
125    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.service_recommendation_options.is_none()`.
126    pub fn service_recommendation_options(&self) -> &[crate::types::EcsServiceRecommendationOption] {
127        self.service_recommendation_options.as_deref().unwrap_or_default()
128    }
129    /// <p>The risk of the current Amazon ECS service not meeting the performance needs of its workloads. The higher the risk, the more likely the current service can't meet the performance requirements of its workload.</p>
130    pub fn current_performance_risk(&self) -> ::std::option::Option<&crate::types::CurrentPerformanceRisk> {
131        self.current_performance_risk.as_ref()
132    }
133    /// <p>Describes the effective recommendation preferences for Amazon ECS services.</p>
134    pub fn effective_recommendation_preferences(&self) -> ::std::option::Option<&crate::types::EcsEffectiveRecommendationPreferences> {
135        self.effective_recommendation_preferences.as_ref()
136    }
137    /// <p>A list of tags assigned to your Amazon ECS service recommendations.</p>
138    ///
139    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
140    pub fn tags(&self) -> &[crate::types::Tag] {
141        self.tags.as_deref().unwrap_or_default()
142    }
143}
144impl EcsServiceRecommendation {
145    /// Creates a new builder-style object to manufacture [`EcsServiceRecommendation`](crate::types::EcsServiceRecommendation).
146    pub fn builder() -> crate::types::builders::EcsServiceRecommendationBuilder {
147        crate::types::builders::EcsServiceRecommendationBuilder::default()
148    }
149}
150
151/// A builder for [`EcsServiceRecommendation`](crate::types::EcsServiceRecommendation).
152#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
153#[non_exhaustive]
154pub struct EcsServiceRecommendationBuilder {
155    pub(crate) service_arn: ::std::option::Option<::std::string::String>,
156    pub(crate) account_id: ::std::option::Option<::std::string::String>,
157    pub(crate) current_service_configuration: ::std::option::Option<crate::types::ServiceConfiguration>,
158    pub(crate) utilization_metrics: ::std::option::Option<::std::vec::Vec<crate::types::EcsServiceUtilizationMetric>>,
159    pub(crate) lookback_period_in_days: ::std::option::Option<f64>,
160    pub(crate) launch_type: ::std::option::Option<crate::types::EcsServiceLaunchType>,
161    pub(crate) last_refresh_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
162    pub(crate) finding: ::std::option::Option<crate::types::EcsServiceRecommendationFinding>,
163    pub(crate) finding_reason_codes: ::std::option::Option<::std::vec::Vec<crate::types::EcsServiceRecommendationFindingReasonCode>>,
164    pub(crate) service_recommendation_options: ::std::option::Option<::std::vec::Vec<crate::types::EcsServiceRecommendationOption>>,
165    pub(crate) current_performance_risk: ::std::option::Option<crate::types::CurrentPerformanceRisk>,
166    pub(crate) effective_recommendation_preferences: ::std::option::Option<crate::types::EcsEffectiveRecommendationPreferences>,
167    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
168}
169impl EcsServiceRecommendationBuilder {
170    /// <p>The Amazon Resource Name (ARN) of the current Amazon ECS service.</p>
171    /// <p>The following is the format of the ARN:</p>
172    /// <p><code>arn:aws:ecs:region:aws_account_id:service/cluster-name/service-name</code></p>
173    pub fn service_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
174        self.service_arn = ::std::option::Option::Some(input.into());
175        self
176    }
177    /// <p>The Amazon Resource Name (ARN) of the current Amazon ECS service.</p>
178    /// <p>The following is the format of the ARN:</p>
179    /// <p><code>arn:aws:ecs:region:aws_account_id:service/cluster-name/service-name</code></p>
180    pub fn set_service_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
181        self.service_arn = input;
182        self
183    }
184    /// <p>The Amazon Resource Name (ARN) of the current Amazon ECS service.</p>
185    /// <p>The following is the format of the ARN:</p>
186    /// <p><code>arn:aws:ecs:region:aws_account_id:service/cluster-name/service-name</code></p>
187    pub fn get_service_arn(&self) -> &::std::option::Option<::std::string::String> {
188        &self.service_arn
189    }
190    /// <p>The Amazon Web Services account ID of the Amazon ECS service.</p>
191    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
192        self.account_id = ::std::option::Option::Some(input.into());
193        self
194    }
195    /// <p>The Amazon Web Services account ID of the Amazon ECS service.</p>
196    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
197        self.account_id = input;
198        self
199    }
200    /// <p>The Amazon Web Services account ID of the Amazon ECS service.</p>
201    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
202        &self.account_id
203    }
204    /// <p>The configuration of the current Amazon ECS service.</p>
205    pub fn current_service_configuration(mut self, input: crate::types::ServiceConfiguration) -> Self {
206        self.current_service_configuration = ::std::option::Option::Some(input);
207        self
208    }
209    /// <p>The configuration of the current Amazon ECS service.</p>
210    pub fn set_current_service_configuration(mut self, input: ::std::option::Option<crate::types::ServiceConfiguration>) -> Self {
211        self.current_service_configuration = input;
212        self
213    }
214    /// <p>The configuration of the current Amazon ECS service.</p>
215    pub fn get_current_service_configuration(&self) -> &::std::option::Option<crate::types::ServiceConfiguration> {
216        &self.current_service_configuration
217    }
218    /// Appends an item to `utilization_metrics`.
219    ///
220    /// To override the contents of this collection use [`set_utilization_metrics`](Self::set_utilization_metrics).
221    ///
222    /// <p>An array of objects that describe the utilization metrics of the Amazon ECS service.</p>
223    pub fn utilization_metrics(mut self, input: crate::types::EcsServiceUtilizationMetric) -> Self {
224        let mut v = self.utilization_metrics.unwrap_or_default();
225        v.push(input);
226        self.utilization_metrics = ::std::option::Option::Some(v);
227        self
228    }
229    /// <p>An array of objects that describe the utilization metrics of the Amazon ECS service.</p>
230    pub fn set_utilization_metrics(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EcsServiceUtilizationMetric>>) -> Self {
231        self.utilization_metrics = input;
232        self
233    }
234    /// <p>An array of objects that describe the utilization metrics of the Amazon ECS service.</p>
235    pub fn get_utilization_metrics(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EcsServiceUtilizationMetric>> {
236        &self.utilization_metrics
237    }
238    /// <p>The number of days the Amazon ECS service utilization metrics were analyzed.</p>
239    pub fn lookback_period_in_days(mut self, input: f64) -> Self {
240        self.lookback_period_in_days = ::std::option::Option::Some(input);
241        self
242    }
243    /// <p>The number of days the Amazon ECS service utilization metrics were analyzed.</p>
244    pub fn set_lookback_period_in_days(mut self, input: ::std::option::Option<f64>) -> Self {
245        self.lookback_period_in_days = input;
246        self
247    }
248    /// <p>The number of days the Amazon ECS service utilization metrics were analyzed.</p>
249    pub fn get_lookback_period_in_days(&self) -> &::std::option::Option<f64> {
250        &self.lookback_period_in_days
251    }
252    /// <p>The launch type the Amazon ECS service is using.</p><note>
253    /// <p>Compute Optimizer only supports the Fargate launch type.</p>
254    /// </note>
255    pub fn launch_type(mut self, input: crate::types::EcsServiceLaunchType) -> Self {
256        self.launch_type = ::std::option::Option::Some(input);
257        self
258    }
259    /// <p>The launch type the Amazon ECS service is using.</p><note>
260    /// <p>Compute Optimizer only supports the Fargate launch type.</p>
261    /// </note>
262    pub fn set_launch_type(mut self, input: ::std::option::Option<crate::types::EcsServiceLaunchType>) -> Self {
263        self.launch_type = input;
264        self
265    }
266    /// <p>The launch type the Amazon ECS service is using.</p><note>
267    /// <p>Compute Optimizer only supports the Fargate launch type.</p>
268    /// </note>
269    pub fn get_launch_type(&self) -> &::std::option::Option<crate::types::EcsServiceLaunchType> {
270        &self.launch_type
271    }
272    /// <p>The timestamp of when the Amazon ECS service recommendation was last generated.</p>
273    pub fn last_refresh_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
274        self.last_refresh_timestamp = ::std::option::Option::Some(input);
275        self
276    }
277    /// <p>The timestamp of when the Amazon ECS service recommendation was last generated.</p>
278    pub fn set_last_refresh_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
279        self.last_refresh_timestamp = input;
280        self
281    }
282    /// <p>The timestamp of when the Amazon ECS service recommendation was last generated.</p>
283    pub fn get_last_refresh_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
284        &self.last_refresh_timestamp
285    }
286    /// <p>The finding classification of an Amazon ECS service.</p>
287    /// <p>Findings for Amazon ECS services include:</p>
288    /// <ul>
289    /// <li>
290    /// <p><b> <code>Underprovisioned</code> </b> — When Compute Optimizer detects that there’s not enough memory or CPU, an Amazon ECS service is considered under-provisioned. An under-provisioned service might result in poor application performance.</p></li>
291    /// <li>
292    /// <p><b> <code>Overprovisioned</code> </b> — When Compute Optimizer detects that there’s excessive memory or CPU, an Amazon ECS service is considered over-provisioned. An over-provisioned service might result in additional infrastructure costs.</p></li>
293    /// <li>
294    /// <p><b> <code>Optimized</code> </b> — When both the CPU and memory of your Amazon ECS service meet the performance requirements of your workload, the service is considered optimized.</p></li>
295    /// </ul>
296    pub fn finding(mut self, input: crate::types::EcsServiceRecommendationFinding) -> Self {
297        self.finding = ::std::option::Option::Some(input);
298        self
299    }
300    /// <p>The finding classification of an Amazon ECS service.</p>
301    /// <p>Findings for Amazon ECS services include:</p>
302    /// <ul>
303    /// <li>
304    /// <p><b> <code>Underprovisioned</code> </b> — When Compute Optimizer detects that there’s not enough memory or CPU, an Amazon ECS service is considered under-provisioned. An under-provisioned service might result in poor application performance.</p></li>
305    /// <li>
306    /// <p><b> <code>Overprovisioned</code> </b> — When Compute Optimizer detects that there’s excessive memory or CPU, an Amazon ECS service is considered over-provisioned. An over-provisioned service might result in additional infrastructure costs.</p></li>
307    /// <li>
308    /// <p><b> <code>Optimized</code> </b> — When both the CPU and memory of your Amazon ECS service meet the performance requirements of your workload, the service is considered optimized.</p></li>
309    /// </ul>
310    pub fn set_finding(mut self, input: ::std::option::Option<crate::types::EcsServiceRecommendationFinding>) -> Self {
311        self.finding = input;
312        self
313    }
314    /// <p>The finding classification of an Amazon ECS service.</p>
315    /// <p>Findings for Amazon ECS services include:</p>
316    /// <ul>
317    /// <li>
318    /// <p><b> <code>Underprovisioned</code> </b> — When Compute Optimizer detects that there’s not enough memory or CPU, an Amazon ECS service is considered under-provisioned. An under-provisioned service might result in poor application performance.</p></li>
319    /// <li>
320    /// <p><b> <code>Overprovisioned</code> </b> — When Compute Optimizer detects that there’s excessive memory or CPU, an Amazon ECS service is considered over-provisioned. An over-provisioned service might result in additional infrastructure costs.</p></li>
321    /// <li>
322    /// <p><b> <code>Optimized</code> </b> — When both the CPU and memory of your Amazon ECS service meet the performance requirements of your workload, the service is considered optimized.</p></li>
323    /// </ul>
324    pub fn get_finding(&self) -> &::std::option::Option<crate::types::EcsServiceRecommendationFinding> {
325        &self.finding
326    }
327    /// Appends an item to `finding_reason_codes`.
328    ///
329    /// To override the contents of this collection use [`set_finding_reason_codes`](Self::set_finding_reason_codes).
330    ///
331    /// <p>The reason for the finding classification of an Amazon ECS service.</p>
332    /// <p>Finding reason codes for Amazon ECS services include:</p>
333    /// <ul>
334    /// <li>
335    /// <p><b> <code>CPUUnderprovisioned</code> </b> — The service CPU configuration can be sized up to enhance the performance of your workload. This is identified by analyzing the <code>CPUUtilization</code> metric of the current service during the look-back period.</p></li>
336    /// <li>
337    /// <p><b> <code>CPUOverprovisioned</code> </b> — The service CPU configuration can be sized down while still meeting the performance requirements of your workload. This is identified by analyzing the <code>CPUUtilization</code> metric of the current service during the look-back period.</p></li>
338    /// <li>
339    /// <p><b> <code>MemoryUnderprovisioned</code> </b> — The service memory configuration can be sized up to enhance the performance of your workload. This is identified by analyzing the <code>MemoryUtilization</code> metric of the current service during the look-back period.</p></li>
340    /// <li>
341    /// <p><b> <code>MemoryOverprovisioned</code> </b> — The service memory configuration can be sized down while still meeting the performance requirements of your workload. This is identified by analyzing the <code>MemoryUtilization</code> metric of the current service during the look-back period.</p></li>
342    /// </ul>
343    pub fn finding_reason_codes(mut self, input: crate::types::EcsServiceRecommendationFindingReasonCode) -> Self {
344        let mut v = self.finding_reason_codes.unwrap_or_default();
345        v.push(input);
346        self.finding_reason_codes = ::std::option::Option::Some(v);
347        self
348    }
349    /// <p>The reason for the finding classification of an Amazon ECS service.</p>
350    /// <p>Finding reason codes for Amazon ECS services include:</p>
351    /// <ul>
352    /// <li>
353    /// <p><b> <code>CPUUnderprovisioned</code> </b> — The service CPU configuration can be sized up to enhance the performance of your workload. This is identified by analyzing the <code>CPUUtilization</code> metric of the current service during the look-back period.</p></li>
354    /// <li>
355    /// <p><b> <code>CPUOverprovisioned</code> </b> — The service CPU configuration can be sized down while still meeting the performance requirements of your workload. This is identified by analyzing the <code>CPUUtilization</code> metric of the current service during the look-back period.</p></li>
356    /// <li>
357    /// <p><b> <code>MemoryUnderprovisioned</code> </b> — The service memory configuration can be sized up to enhance the performance of your workload. This is identified by analyzing the <code>MemoryUtilization</code> metric of the current service during the look-back period.</p></li>
358    /// <li>
359    /// <p><b> <code>MemoryOverprovisioned</code> </b> — The service memory configuration can be sized down while still meeting the performance requirements of your workload. This is identified by analyzing the <code>MemoryUtilization</code> metric of the current service during the look-back period.</p></li>
360    /// </ul>
361    pub fn set_finding_reason_codes(
362        mut self,
363        input: ::std::option::Option<::std::vec::Vec<crate::types::EcsServiceRecommendationFindingReasonCode>>,
364    ) -> Self {
365        self.finding_reason_codes = input;
366        self
367    }
368    /// <p>The reason for the finding classification of an Amazon ECS service.</p>
369    /// <p>Finding reason codes for Amazon ECS services include:</p>
370    /// <ul>
371    /// <li>
372    /// <p><b> <code>CPUUnderprovisioned</code> </b> — The service CPU configuration can be sized up to enhance the performance of your workload. This is identified by analyzing the <code>CPUUtilization</code> metric of the current service during the look-back period.</p></li>
373    /// <li>
374    /// <p><b> <code>CPUOverprovisioned</code> </b> — The service CPU configuration can be sized down while still meeting the performance requirements of your workload. This is identified by analyzing the <code>CPUUtilization</code> metric of the current service during the look-back period.</p></li>
375    /// <li>
376    /// <p><b> <code>MemoryUnderprovisioned</code> </b> — The service memory configuration can be sized up to enhance the performance of your workload. This is identified by analyzing the <code>MemoryUtilization</code> metric of the current service during the look-back period.</p></li>
377    /// <li>
378    /// <p><b> <code>MemoryOverprovisioned</code> </b> — The service memory configuration can be sized down while still meeting the performance requirements of your workload. This is identified by analyzing the <code>MemoryUtilization</code> metric of the current service during the look-back period.</p></li>
379    /// </ul>
380    pub fn get_finding_reason_codes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EcsServiceRecommendationFindingReasonCode>> {
381        &self.finding_reason_codes
382    }
383    /// Appends an item to `service_recommendation_options`.
384    ///
385    /// To override the contents of this collection use [`set_service_recommendation_options`](Self::set_service_recommendation_options).
386    ///
387    /// <p>An array of objects that describe the recommendation options for the Amazon ECS service.</p>
388    pub fn service_recommendation_options(mut self, input: crate::types::EcsServiceRecommendationOption) -> Self {
389        let mut v = self.service_recommendation_options.unwrap_or_default();
390        v.push(input);
391        self.service_recommendation_options = ::std::option::Option::Some(v);
392        self
393    }
394    /// <p>An array of objects that describe the recommendation options for the Amazon ECS service.</p>
395    pub fn set_service_recommendation_options(
396        mut self,
397        input: ::std::option::Option<::std::vec::Vec<crate::types::EcsServiceRecommendationOption>>,
398    ) -> Self {
399        self.service_recommendation_options = input;
400        self
401    }
402    /// <p>An array of objects that describe the recommendation options for the Amazon ECS service.</p>
403    pub fn get_service_recommendation_options(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EcsServiceRecommendationOption>> {
404        &self.service_recommendation_options
405    }
406    /// <p>The risk of the current Amazon ECS service not meeting the performance needs of its workloads. The higher the risk, the more likely the current service can't meet the performance requirements of its workload.</p>
407    pub fn current_performance_risk(mut self, input: crate::types::CurrentPerformanceRisk) -> Self {
408        self.current_performance_risk = ::std::option::Option::Some(input);
409        self
410    }
411    /// <p>The risk of the current Amazon ECS service not meeting the performance needs of its workloads. The higher the risk, the more likely the current service can't meet the performance requirements of its workload.</p>
412    pub fn set_current_performance_risk(mut self, input: ::std::option::Option<crate::types::CurrentPerformanceRisk>) -> Self {
413        self.current_performance_risk = input;
414        self
415    }
416    /// <p>The risk of the current Amazon ECS service not meeting the performance needs of its workloads. The higher the risk, the more likely the current service can't meet the performance requirements of its workload.</p>
417    pub fn get_current_performance_risk(&self) -> &::std::option::Option<crate::types::CurrentPerformanceRisk> {
418        &self.current_performance_risk
419    }
420    /// <p>Describes the effective recommendation preferences for Amazon ECS services.</p>
421    pub fn effective_recommendation_preferences(mut self, input: crate::types::EcsEffectiveRecommendationPreferences) -> Self {
422        self.effective_recommendation_preferences = ::std::option::Option::Some(input);
423        self
424    }
425    /// <p>Describes the effective recommendation preferences for Amazon ECS services.</p>
426    pub fn set_effective_recommendation_preferences(
427        mut self,
428        input: ::std::option::Option<crate::types::EcsEffectiveRecommendationPreferences>,
429    ) -> Self {
430        self.effective_recommendation_preferences = input;
431        self
432    }
433    /// <p>Describes the effective recommendation preferences for Amazon ECS services.</p>
434    pub fn get_effective_recommendation_preferences(&self) -> &::std::option::Option<crate::types::EcsEffectiveRecommendationPreferences> {
435        &self.effective_recommendation_preferences
436    }
437    /// Appends an item to `tags`.
438    ///
439    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
440    ///
441    /// <p>A list of tags assigned to your Amazon ECS service recommendations.</p>
442    pub fn tags(mut self, input: crate::types::Tag) -> Self {
443        let mut v = self.tags.unwrap_or_default();
444        v.push(input);
445        self.tags = ::std::option::Option::Some(v);
446        self
447    }
448    /// <p>A list of tags assigned to your Amazon ECS service recommendations.</p>
449    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
450        self.tags = input;
451        self
452    }
453    /// <p>A list of tags assigned to your Amazon ECS service recommendations.</p>
454    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
455        &self.tags
456    }
457    /// Consumes the builder and constructs a [`EcsServiceRecommendation`](crate::types::EcsServiceRecommendation).
458    pub fn build(self) -> crate::types::EcsServiceRecommendation {
459        crate::types::EcsServiceRecommendation {
460            service_arn: self.service_arn,
461            account_id: self.account_id,
462            current_service_configuration: self.current_service_configuration,
463            utilization_metrics: self.utilization_metrics,
464            lookback_period_in_days: self.lookback_period_in_days.unwrap_or_default(),
465            launch_type: self.launch_type,
466            last_refresh_timestamp: self.last_refresh_timestamp,
467            finding: self.finding,
468            finding_reason_codes: self.finding_reason_codes,
469            service_recommendation_options: self.service_recommendation_options,
470            current_performance_risk: self.current_performance_risk,
471            effective_recommendation_preferences: self.effective_recommendation_preferences,
472            tags: self.tags,
473        }
474    }
475}