rusoto_compute_optimizer/
generated.rs

1// =================================================================
2//
3//                           * WARNING *
4//
5//                    This file is generated!
6//
7//  Changes made to this file will be overwritten. If changes are
8//  required to the generated code, the service_crategen project
9//  must be updated to generate the changes.
10//
11// =================================================================
12
13use std::error::Error;
14use std::fmt;
15
16use async_trait::async_trait;
17use rusoto_core::credential::ProvideAwsCredentials;
18use rusoto_core::region;
19use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
20use rusoto_core::{Client, RusotoError};
21
22use rusoto_core::proto;
23use rusoto_core::request::HttpResponse;
24use rusoto_core::signature::SignedRequest;
25#[allow(unused_imports)]
26use serde::{Deserialize, Serialize};
27
28impl ComputeOptimizerClient {
29    fn new_signed_request(&self, http_method: &str, request_uri: &str) -> SignedRequest {
30        let mut request =
31            SignedRequest::new(http_method, "compute-optimizer", &self.region, request_uri);
32
33        request.set_content_type("application/x-amz-json-1.0".to_owned());
34
35        request
36    }
37
38    async fn sign_and_dispatch<E>(
39        &self,
40        request: SignedRequest,
41        from_response: fn(BufferedHttpResponse) -> RusotoError<E>,
42    ) -> Result<HttpResponse, RusotoError<E>> {
43        let mut response = self.client.sign_and_dispatch(request).await?;
44        if !response.status.is_success() {
45            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
46            return Err(from_response(response));
47        }
48
49        Ok(response)
50    }
51}
52
53use serde_json;
54/// <p>Describes the configuration of an Auto Scaling group.</p>
55#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
56#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
57pub struct AutoScalingGroupConfiguration {
58    /// <p>The desired capacity, or number of instances, for the Auto Scaling group.</p>
59    #[serde(rename = "desiredCapacity")]
60    #[serde(skip_serializing_if = "Option::is_none")]
61    pub desired_capacity: Option<i64>,
62    /// <p>The instance type for the Auto Scaling group.</p>
63    #[serde(rename = "instanceType")]
64    #[serde(skip_serializing_if = "Option::is_none")]
65    pub instance_type: Option<String>,
66    /// <p>The maximum size, or maximum number of instances, for the Auto Scaling group.</p>
67    #[serde(rename = "maxSize")]
68    #[serde(skip_serializing_if = "Option::is_none")]
69    pub max_size: Option<i64>,
70    /// <p>The minimum size, or minimum number of instances, for the Auto Scaling group.</p>
71    #[serde(rename = "minSize")]
72    #[serde(skip_serializing_if = "Option::is_none")]
73    pub min_size: Option<i64>,
74}
75
76/// <p>Describes an Auto Scaling group recommendation.</p>
77#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
78#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
79pub struct AutoScalingGroupRecommendation {
80    /// <p>The AWS account ID of the Auto Scaling group.</p>
81    #[serde(rename = "accountId")]
82    #[serde(skip_serializing_if = "Option::is_none")]
83    pub account_id: Option<String>,
84    /// <p>The Amazon Resource Name (ARN) of the Auto Scaling group.</p>
85    #[serde(rename = "autoScalingGroupArn")]
86    #[serde(skip_serializing_if = "Option::is_none")]
87    pub auto_scaling_group_arn: Option<String>,
88    /// <p>The name of the Auto Scaling group.</p>
89    #[serde(rename = "autoScalingGroupName")]
90    #[serde(skip_serializing_if = "Option::is_none")]
91    pub auto_scaling_group_name: Option<String>,
92    /// <p>An array of objects that describe the current configuration of the Auto Scaling group.</p>
93    #[serde(rename = "currentConfiguration")]
94    #[serde(skip_serializing_if = "Option::is_none")]
95    pub current_configuration: Option<AutoScalingGroupConfiguration>,
96    /// <p><p>The finding classification for the Auto Scaling group.</p> <p>Findings for Auto Scaling groups include:</p> <ul> <li> <p> <b> <code>NotOptimized</code> </b>—An Auto Scaling group is considered not optimized when AWS Compute Optimizer identifies a recommendation that can provide better performance for your workload.</p> </li> <li> <p> <b> <code>Optimized</code> </b>—An Auto Scaling group is considered optimized when Compute Optimizer determines that the group is correctly provisioned to run your workload based on the chosen instance type. For optimized resources, Compute Optimizer might recommend a new generation instance type.</p> </li> </ul> <note> <p>The values that are returned might be <code>NOT_OPTIMIZED</code> or <code>OPTIMIZED</code>.</p> </note></p>
97    #[serde(rename = "finding")]
98    #[serde(skip_serializing_if = "Option::is_none")]
99    pub finding: Option<String>,
100    /// <p>The time stamp of when the Auto Scaling group recommendation was last refreshed.</p>
101    #[serde(rename = "lastRefreshTimestamp")]
102    #[serde(skip_serializing_if = "Option::is_none")]
103    pub last_refresh_timestamp: Option<f64>,
104    /// <p>The number of days for which utilization metrics were analyzed for the Auto Scaling group.</p>
105    #[serde(rename = "lookBackPeriodInDays")]
106    #[serde(skip_serializing_if = "Option::is_none")]
107    pub look_back_period_in_days: Option<f64>,
108    /// <p>An array of objects that describe the recommendation options for the Auto Scaling group.</p>
109    #[serde(rename = "recommendationOptions")]
110    #[serde(skip_serializing_if = "Option::is_none")]
111    pub recommendation_options: Option<Vec<AutoScalingGroupRecommendationOption>>,
112    /// <p>An array of objects that describe the utilization metrics of the Auto Scaling group.</p>
113    #[serde(rename = "utilizationMetrics")]
114    #[serde(skip_serializing_if = "Option::is_none")]
115    pub utilization_metrics: Option<Vec<UtilizationMetric>>,
116}
117
118/// <p>Describes a recommendation option for an Auto Scaling group.</p>
119#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
120#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
121pub struct AutoScalingGroupRecommendationOption {
122    /// <p>An array of objects that describe an Auto Scaling group configuration.</p>
123    #[serde(rename = "configuration")]
124    #[serde(skip_serializing_if = "Option::is_none")]
125    pub configuration: Option<AutoScalingGroupConfiguration>,
126    /// <p>The performance risk of the Auto Scaling group configuration recommendation.</p> <p>Performance risk is the likelihood of the recommended instance type not meeting the performance requirement of your workload.</p> <p>The lowest performance risk is categorized as <code>0</code>, and the highest as <code>5</code>.</p>
127    #[serde(rename = "performanceRisk")]
128    #[serde(skip_serializing_if = "Option::is_none")]
129    pub performance_risk: Option<f64>,
130    /// <p>An array of objects that describe the projected utilization metrics of the Auto Scaling group recommendation option.</p>
131    #[serde(rename = "projectedUtilizationMetrics")]
132    #[serde(skip_serializing_if = "Option::is_none")]
133    pub projected_utilization_metrics: Option<Vec<UtilizationMetric>>,
134    /// <p>The rank of the Auto Scaling group recommendation option.</p> <p>The top recommendation option is ranked as <code>1</code>.</p>
135    #[serde(rename = "rank")]
136    #[serde(skip_serializing_if = "Option::is_none")]
137    pub rank: Option<i64>,
138}
139
140#[derive(Clone, Debug, Default, PartialEq, Serialize)]
141#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
142pub struct DescribeRecommendationExportJobsRequest {
143    /// <p>An array of objects that describe a filter to return a more specific list of export jobs.</p>
144    #[serde(rename = "filters")]
145    #[serde(skip_serializing_if = "Option::is_none")]
146    pub filters: Option<Vec<JobFilter>>,
147    /// <p>The identification numbers of the export jobs to return.</p> <p>An export job ID is returned when you create an export using the <code>ExportAutoScalingGroupRecommendations</code> or <code>ExportEC2InstanceRecommendations</code> actions.</p> <p>All export jobs created in the last seven days are returned if this parameter is omitted.</p>
148    #[serde(rename = "jobIds")]
149    #[serde(skip_serializing_if = "Option::is_none")]
150    pub job_ids: Option<Vec<String>>,
151    /// <p>The maximum number of export jobs to return with a single request.</p> <p>To retrieve the remaining results, make another request with the returned <code>NextToken</code> value.</p>
152    #[serde(rename = "maxResults")]
153    #[serde(skip_serializing_if = "Option::is_none")]
154    pub max_results: Option<i64>,
155    /// <p>The token to advance to the next page of export jobs.</p>
156    #[serde(rename = "nextToken")]
157    #[serde(skip_serializing_if = "Option::is_none")]
158    pub next_token: Option<String>,
159}
160
161#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
162#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
163pub struct DescribeRecommendationExportJobsResponse {
164    /// <p>The token to use to advance to the next page of export jobs.</p> <p>This value is null when there are no more pages of export jobs to return.</p>
165    #[serde(rename = "nextToken")]
166    #[serde(skip_serializing_if = "Option::is_none")]
167    pub next_token: Option<String>,
168    /// <p>An array of objects that describe recommendation export jobs.</p>
169    #[serde(rename = "recommendationExportJobs")]
170    #[serde(skip_serializing_if = "Option::is_none")]
171    pub recommendation_export_jobs: Option<Vec<RecommendationExportJob>>,
172}
173
174#[derive(Clone, Debug, Default, PartialEq, Serialize)]
175#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
176pub struct ExportAutoScalingGroupRecommendationsRequest {
177    /// <p>The IDs of the AWS accounts for which to export Auto Scaling group recommendations.</p> <p>If your account is the master account of an organization, use this parameter to specify the member accounts for which you want to export recommendations.</p> <p>This parameter cannot be specified together with the include member accounts parameter. The parameters are mutually exclusive.</p> <p>Recommendations for member accounts are not included in the export if this parameter, or the include member accounts parameter, is omitted.</p> <p>You can specify multiple account IDs per request.</p>
178    #[serde(rename = "accountIds")]
179    #[serde(skip_serializing_if = "Option::is_none")]
180    pub account_ids: Option<Vec<String>>,
181    /// <p>The recommendations data to include in the export file.</p>
182    #[serde(rename = "fieldsToExport")]
183    #[serde(skip_serializing_if = "Option::is_none")]
184    pub fields_to_export: Option<Vec<String>>,
185    /// <p>The format of the export file.</p> <p>The only export file format currently supported is <code>Csv</code>.</p>
186    #[serde(rename = "fileFormat")]
187    #[serde(skip_serializing_if = "Option::is_none")]
188    pub file_format: Option<String>,
189    /// <p>An array of objects that describe a filter to export a more specific set of Auto Scaling group recommendations.</p>
190    #[serde(rename = "filters")]
191    #[serde(skip_serializing_if = "Option::is_none")]
192    pub filters: Option<Vec<Filter>>,
193    /// <p>Indicates whether to include recommendations for resources in all member accounts of the organization if your account is the master account of an organization.</p> <p>The member accounts must also be opted in to Compute Optimizer.</p> <p>Recommendations for member accounts of the organization are not included in the export file if this parameter is omitted.</p> <p>This parameter cannot be specified together with the account IDs parameter. The parameters are mutually exclusive.</p> <p>Recommendations for member accounts are not included in the export if this parameter, or the account IDs parameter, is omitted.</p>
194    #[serde(rename = "includeMemberAccounts")]
195    #[serde(skip_serializing_if = "Option::is_none")]
196    pub include_member_accounts: Option<bool>,
197    /// <p>An object to specify the destination Amazon Simple Storage Service (Amazon S3) bucket name and key prefix for the export job.</p> <p>You must create the destination Amazon S3 bucket for your recommendations export before you create the export job. Compute Optimizer does not create the S3 bucket for you. After you create the S3 bucket, ensure that it has the required permission policy to allow Compute Optimizer to write the export file to it. If you plan to specify an object prefix when you create the export job, you must include the object prefix in the policy that you add to the S3 bucket. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/create-s3-bucket-policy-for-compute-optimizer.html">Amazon S3 Bucket Policy for Compute Optimizer</a> in the <i>Compute Optimizer user guide</i>.</p>
198    #[serde(rename = "s3DestinationConfig")]
199    pub s_3_destination_config: S3DestinationConfig,
200}
201
202#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
203#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
204pub struct ExportAutoScalingGroupRecommendationsResponse {
205    /// <p>The identification number of the export job.</p> <p>Use the <code>DescribeRecommendationExportJobs</code> action, and specify the job ID to view the status of an export job.</p>
206    #[serde(rename = "jobId")]
207    #[serde(skip_serializing_if = "Option::is_none")]
208    pub job_id: Option<String>,
209    /// <p>An object that describes the destination Amazon S3 bucket of a recommendations export file.</p>
210    #[serde(rename = "s3Destination")]
211    #[serde(skip_serializing_if = "Option::is_none")]
212    pub s_3_destination: Option<S3Destination>,
213}
214
215/// <p>Describes the destination of the recommendations export and metadata files.</p>
216#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
217#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
218pub struct ExportDestination {
219    /// <p>An object that describes the destination Amazon Simple Storage Service (Amazon S3) bucket name and object keys of a recommendations export file, and its associated metadata file.</p>
220    #[serde(rename = "s3")]
221    #[serde(skip_serializing_if = "Option::is_none")]
222    pub s_3: Option<S3Destination>,
223}
224
225#[derive(Clone, Debug, Default, PartialEq, Serialize)]
226#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
227pub struct ExportEC2InstanceRecommendationsRequest {
228    /// <p>The IDs of the AWS accounts for which to export instance recommendations.</p> <p>If your account is the master account of an organization, use this parameter to specify the member accounts for which you want to export recommendations.</p> <p>This parameter cannot be specified together with the include member accounts parameter. The parameters are mutually exclusive.</p> <p>Recommendations for member accounts are not included in the export if this parameter, or the include member accounts parameter, is omitted.</p> <p>You can specify multiple account IDs per request.</p>
229    #[serde(rename = "accountIds")]
230    #[serde(skip_serializing_if = "Option::is_none")]
231    pub account_ids: Option<Vec<String>>,
232    /// <p>The recommendations data to include in the export file.</p>
233    #[serde(rename = "fieldsToExport")]
234    #[serde(skip_serializing_if = "Option::is_none")]
235    pub fields_to_export: Option<Vec<String>>,
236    /// <p>The format of the export file.</p> <p>The only export file format currently supported is <code>Csv</code>.</p>
237    #[serde(rename = "fileFormat")]
238    #[serde(skip_serializing_if = "Option::is_none")]
239    pub file_format: Option<String>,
240    /// <p>An array of objects that describe a filter to export a more specific set of instance recommendations.</p>
241    #[serde(rename = "filters")]
242    #[serde(skip_serializing_if = "Option::is_none")]
243    pub filters: Option<Vec<Filter>>,
244    /// <p>Indicates whether to include recommendations for resources in all member accounts of the organization if your account is the master account of an organization.</p> <p>The member accounts must also be opted in to Compute Optimizer.</p> <p>Recommendations for member accounts of the organization are not included in the export file if this parameter is omitted.</p> <p>Recommendations for member accounts are not included in the export if this parameter, or the account IDs parameter, is omitted.</p>
245    #[serde(rename = "includeMemberAccounts")]
246    #[serde(skip_serializing_if = "Option::is_none")]
247    pub include_member_accounts: Option<bool>,
248    /// <p>An object to specify the destination Amazon Simple Storage Service (Amazon S3) bucket name and key prefix for the export job.</p> <p>You must create the destination Amazon S3 bucket for your recommendations export before you create the export job. Compute Optimizer does not create the S3 bucket for you. After you create the S3 bucket, ensure that it has the required permission policy to allow Compute Optimizer to write the export file to it. If you plan to specify an object prefix when you create the export job, you must include the object prefix in the policy that you add to the S3 bucket. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/create-s3-bucket-policy-for-compute-optimizer.html">Amazon S3 Bucket Policy for Compute Optimizer</a> in the <i>Compute Optimizer user guide</i>.</p>
249    #[serde(rename = "s3DestinationConfig")]
250    pub s_3_destination_config: S3DestinationConfig,
251}
252
253#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
254#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
255pub struct ExportEC2InstanceRecommendationsResponse {
256    /// <p>The identification number of the export job.</p> <p>Use the <code>DescribeRecommendationExportJobs</code> action, and specify the job ID to view the status of an export job.</p>
257    #[serde(rename = "jobId")]
258    #[serde(skip_serializing_if = "Option::is_none")]
259    pub job_id: Option<String>,
260    /// <p>An object that describes the destination Amazon S3 bucket of a recommendations export file.</p>
261    #[serde(rename = "s3Destination")]
262    #[serde(skip_serializing_if = "Option::is_none")]
263    pub s_3_destination: Option<S3Destination>,
264}
265
266/// <p>Describes a filter that returns a more specific list of recommendations.</p>
267#[derive(Clone, Debug, Default, PartialEq, Serialize)]
268#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
269pub struct Filter {
270    /// <p>The name of the filter.</p> <p>Specify <code>Finding</code> to return recommendations with a specific findings classification (e.g., <code>Overprovisioned</code>).</p> <p>Specify <code>RecommendationSourceType</code> to return recommendations of a specific resource type (e.g., <code>AutoScalingGroup</code>).</p>
271    #[serde(rename = "name")]
272    #[serde(skip_serializing_if = "Option::is_none")]
273    pub name: Option<String>,
274    /// <p>The value of the filter.</p> <p>If you specify the <code>name</code> parameter as <code>Finding</code>, and you request recommendations for an <i>instance</i>, then the valid values are <code>Underprovisioned</code>, <code>Overprovisioned</code>, <code>NotOptimized</code>, or <code>Optimized</code>.</p> <p>If you specify the <code>name</code> parameter as <code>Finding</code>, and you request recommendations for an <i>Auto Scaling group</i>, then the valid values are <code>Optimized</code>, or <code>NotOptimized</code>.</p> <p>If you specify the <code>name</code> parameter as <code>RecommendationSourceType</code>, then the valid values are <code>Ec2Instance</code>, or <code>AutoScalingGroup</code>.</p>
275    #[serde(rename = "values")]
276    #[serde(skip_serializing_if = "Option::is_none")]
277    pub values: Option<Vec<String>>,
278}
279
280#[derive(Clone, Debug, Default, PartialEq, Serialize)]
281#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
282pub struct GetAutoScalingGroupRecommendationsRequest {
283    /// <p>The IDs of the AWS accounts for which to return Auto Scaling group recommendations.</p> <p>If your account is the master account of an organization, use this parameter to specify the member accounts for which you want to return Auto Scaling group recommendations.</p> <p>Only one account ID can be specified per request.</p>
284    #[serde(rename = "accountIds")]
285    #[serde(skip_serializing_if = "Option::is_none")]
286    pub account_ids: Option<Vec<String>>,
287    /// <p>The Amazon Resource Name (ARN) of the Auto Scaling groups for which to return recommendations.</p>
288    #[serde(rename = "autoScalingGroupArns")]
289    #[serde(skip_serializing_if = "Option::is_none")]
290    pub auto_scaling_group_arns: Option<Vec<String>>,
291    /// <p>An array of objects that describe a filter that returns a more specific list of Auto Scaling group recommendations.</p>
292    #[serde(rename = "filters")]
293    #[serde(skip_serializing_if = "Option::is_none")]
294    pub filters: Option<Vec<Filter>>,
295    /// <p>The maximum number of Auto Scaling group recommendations to return with a single request.</p> <p>To retrieve the remaining results, make another request with the returned <code>NextToken</code> value.</p>
296    #[serde(rename = "maxResults")]
297    #[serde(skip_serializing_if = "Option::is_none")]
298    pub max_results: Option<i64>,
299    /// <p>The token to advance to the next page of Auto Scaling group recommendations.</p>
300    #[serde(rename = "nextToken")]
301    #[serde(skip_serializing_if = "Option::is_none")]
302    pub next_token: Option<String>,
303}
304
305#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
306#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
307pub struct GetAutoScalingGroupRecommendationsResponse {
308    /// <p>An array of objects that describe Auto Scaling group recommendations.</p>
309    #[serde(rename = "autoScalingGroupRecommendations")]
310    #[serde(skip_serializing_if = "Option::is_none")]
311    pub auto_scaling_group_recommendations: Option<Vec<AutoScalingGroupRecommendation>>,
312    /// <p>An array of objects that describe errors of the request.</p> <p>For example, an error is returned if you request recommendations for an unsupported Auto Scaling group.</p>
313    #[serde(rename = "errors")]
314    #[serde(skip_serializing_if = "Option::is_none")]
315    pub errors: Option<Vec<GetRecommendationError>>,
316    /// <p>The token to use to advance to the next page of Auto Scaling group recommendations.</p> <p>This value is null when there are no more pages of Auto Scaling group recommendations to return.</p>
317    #[serde(rename = "nextToken")]
318    #[serde(skip_serializing_if = "Option::is_none")]
319    pub next_token: Option<String>,
320}
321
322#[derive(Clone, Debug, Default, PartialEq, Serialize)]
323#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
324pub struct GetEC2InstanceRecommendationsRequest {
325    /// <p>The IDs of the AWS accounts for which to return instance recommendations.</p> <p>If your account is the master account of an organization, use this parameter to specify the member accounts for which you want to return instance recommendations.</p> <p>Only one account ID can be specified per request.</p>
326    #[serde(rename = "accountIds")]
327    #[serde(skip_serializing_if = "Option::is_none")]
328    pub account_ids: Option<Vec<String>>,
329    /// <p>An array of objects that describe a filter that returns a more specific list of instance recommendations.</p>
330    #[serde(rename = "filters")]
331    #[serde(skip_serializing_if = "Option::is_none")]
332    pub filters: Option<Vec<Filter>>,
333    /// <p>The Amazon Resource Name (ARN) of the instances for which to return recommendations.</p>
334    #[serde(rename = "instanceArns")]
335    #[serde(skip_serializing_if = "Option::is_none")]
336    pub instance_arns: Option<Vec<String>>,
337    /// <p>The maximum number of instance recommendations to return with a single request.</p> <p>To retrieve the remaining results, make another request with the returned <code>NextToken</code> value.</p>
338    #[serde(rename = "maxResults")]
339    #[serde(skip_serializing_if = "Option::is_none")]
340    pub max_results: Option<i64>,
341    /// <p>The token to advance to the next page of instance recommendations.</p>
342    #[serde(rename = "nextToken")]
343    #[serde(skip_serializing_if = "Option::is_none")]
344    pub next_token: Option<String>,
345}
346
347#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
348#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
349pub struct GetEC2InstanceRecommendationsResponse {
350    /// <p>An array of objects that describe errors of the request.</p> <p>For example, an error is returned if you request recommendations for an instance of an unsupported instance family.</p>
351    #[serde(rename = "errors")]
352    #[serde(skip_serializing_if = "Option::is_none")]
353    pub errors: Option<Vec<GetRecommendationError>>,
354    /// <p>An array of objects that describe instance recommendations.</p>
355    #[serde(rename = "instanceRecommendations")]
356    #[serde(skip_serializing_if = "Option::is_none")]
357    pub instance_recommendations: Option<Vec<InstanceRecommendation>>,
358    /// <p>The token to use to advance to the next page of instance recommendations.</p> <p>This value is null when there are no more pages of instance recommendations to return.</p>
359    #[serde(rename = "nextToken")]
360    #[serde(skip_serializing_if = "Option::is_none")]
361    pub next_token: Option<String>,
362}
363
364#[derive(Clone, Debug, Default, PartialEq, Serialize)]
365#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
366pub struct GetEC2RecommendationProjectedMetricsRequest {
367    /// <p>The time stamp of the last projected metrics data point to return.</p>
368    #[serde(rename = "endTime")]
369    pub end_time: f64,
370    /// <p>The Amazon Resource Name (ARN) of the instances for which to return recommendation projected metrics.</p>
371    #[serde(rename = "instanceArn")]
372    pub instance_arn: String,
373    /// <p>The granularity, in seconds, of the projected metrics data points.</p>
374    #[serde(rename = "period")]
375    pub period: i64,
376    /// <p>The time stamp of the first projected metrics data point to return.</p>
377    #[serde(rename = "startTime")]
378    pub start_time: f64,
379    /// <p>The statistic of the projected metrics.</p>
380    #[serde(rename = "stat")]
381    pub stat: String,
382}
383
384#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
385#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
386pub struct GetEC2RecommendationProjectedMetricsResponse {
387    /// <p>An array of objects that describe a projected metrics.</p>
388    #[serde(rename = "recommendedOptionProjectedMetrics")]
389    #[serde(skip_serializing_if = "Option::is_none")]
390    pub recommended_option_projected_metrics: Option<Vec<RecommendedOptionProjectedMetric>>,
391}
392
393#[derive(Clone, Debug, Default, PartialEq, Serialize)]
394#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
395pub struct GetEnrollmentStatusRequest {}
396
397#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
398#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
399pub struct GetEnrollmentStatusResponse {
400    /// <p>Confirms the enrollment status of member accounts within the organization, if the account is a master account of an organization.</p>
401    #[serde(rename = "memberAccountsEnrolled")]
402    #[serde(skip_serializing_if = "Option::is_none")]
403    pub member_accounts_enrolled: Option<bool>,
404    /// <p>The enrollment status of the account.</p>
405    #[serde(rename = "status")]
406    #[serde(skip_serializing_if = "Option::is_none")]
407    pub status: Option<String>,
408    /// <p>The reason for the enrollment status of the account.</p> <p>For example, an account might show a status of <code>Pending</code> because member accounts of an organization require more time to be enrolled in the service.</p>
409    #[serde(rename = "statusReason")]
410    #[serde(skip_serializing_if = "Option::is_none")]
411    pub status_reason: Option<String>,
412}
413
414/// <p>Describes an error experienced when getting recommendations.</p> <p>For example, an error is returned if you request recommendations for an unsupported Auto Scaling group, or if you request recommendations for an instance of an unsupported instance family.</p>
415#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
416#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
417pub struct GetRecommendationError {
418    /// <p>The error code.</p>
419    #[serde(rename = "code")]
420    #[serde(skip_serializing_if = "Option::is_none")]
421    pub code: Option<String>,
422    /// <p>The ID of the error.</p>
423    #[serde(rename = "identifier")]
424    #[serde(skip_serializing_if = "Option::is_none")]
425    pub identifier: Option<String>,
426    /// <p>The message, or reason, for the error.</p>
427    #[serde(rename = "message")]
428    #[serde(skip_serializing_if = "Option::is_none")]
429    pub message: Option<String>,
430}
431
432#[derive(Clone, Debug, Default, PartialEq, Serialize)]
433#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
434pub struct GetRecommendationSummariesRequest {
435    /// <p>The IDs of the AWS accounts for which to return recommendation summaries.</p> <p>If your account is the master account of an organization, use this parameter to specify the member accounts for which you want to return recommendation summaries.</p> <p>Only one account ID can be specified per request.</p>
436    #[serde(rename = "accountIds")]
437    #[serde(skip_serializing_if = "Option::is_none")]
438    pub account_ids: Option<Vec<String>>,
439    /// <p>The maximum number of recommendation summaries to return with a single request.</p> <p>To retrieve the remaining results, make another request with the returned <code>NextToken</code> value.</p>
440    #[serde(rename = "maxResults")]
441    #[serde(skip_serializing_if = "Option::is_none")]
442    pub max_results: Option<i64>,
443    /// <p>The token to advance to the next page of recommendation summaries.</p>
444    #[serde(rename = "nextToken")]
445    #[serde(skip_serializing_if = "Option::is_none")]
446    pub next_token: Option<String>,
447}
448
449#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
450#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
451pub struct GetRecommendationSummariesResponse {
452    /// <p>The token to use to advance to the next page of recommendation summaries.</p> <p>This value is null when there are no more pages of recommendation summaries to return.</p>
453    #[serde(rename = "nextToken")]
454    #[serde(skip_serializing_if = "Option::is_none")]
455    pub next_token: Option<String>,
456    /// <p>An array of objects that summarize a recommendation.</p>
457    #[serde(rename = "recommendationSummaries")]
458    #[serde(skip_serializing_if = "Option::is_none")]
459    pub recommendation_summaries: Option<Vec<RecommendationSummary>>,
460}
461
462/// <p>Describes an Amazon EC2 instance recommendation.</p>
463#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
464#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
465pub struct InstanceRecommendation {
466    /// <p>The AWS account ID of the instance.</p>
467    #[serde(rename = "accountId")]
468    #[serde(skip_serializing_if = "Option::is_none")]
469    pub account_id: Option<String>,
470    /// <p>The instance type of the current instance.</p>
471    #[serde(rename = "currentInstanceType")]
472    #[serde(skip_serializing_if = "Option::is_none")]
473    pub current_instance_type: Option<String>,
474    /// <p><p>The finding classification for the instance.</p> <p>Findings for instances include:</p> <ul> <li> <p> <b> <code>Underprovisioned</code> </b>—An instance is considered under-provisioned when at least one specification of your instance, such as CPU, memory, or network, does not meet the performance requirements of your workload. Under-provisioned instances may lead to poor application performance.</p> </li> <li> <p> <b> <code>Overprovisioned</code> </b>—An instance is considered over-provisioned when at least one specification of your instance, such as CPU, memory, or network, can be sized down while still meeting the performance requirements of your workload, and no specification is under-provisioned. Over-provisioned instances may lead to unnecessary infrastructure cost.</p> </li> <li> <p> <b> <code>Optimized</code> </b>—An instance is considered optimized when all specifications of your instance, such as CPU, memory, and network, meet the performance requirements of your workload and is not over provisioned. An optimized instance runs your workloads with optimal performance and infrastructure cost. For optimized resources, AWS Compute Optimizer might recommend a new generation instance type.</p> </li> </ul> <note> <p>The values that are returned might be <code>UNDER<em>PROVISIONED</code>, <code>OVER</em>PROVISIONED</code>, or <code>OPTIMIZED</code>.</p> </note></p>
475    #[serde(rename = "finding")]
476    #[serde(skip_serializing_if = "Option::is_none")]
477    pub finding: Option<String>,
478    /// <p>The Amazon Resource Name (ARN) of the current instance.</p>
479    #[serde(rename = "instanceArn")]
480    #[serde(skip_serializing_if = "Option::is_none")]
481    pub instance_arn: Option<String>,
482    /// <p>The name of the current instance.</p>
483    #[serde(rename = "instanceName")]
484    #[serde(skip_serializing_if = "Option::is_none")]
485    pub instance_name: Option<String>,
486    /// <p>The time stamp of when the instance recommendation was last refreshed.</p>
487    #[serde(rename = "lastRefreshTimestamp")]
488    #[serde(skip_serializing_if = "Option::is_none")]
489    pub last_refresh_timestamp: Option<f64>,
490    /// <p>The number of days for which utilization metrics were analyzed for the instance.</p>
491    #[serde(rename = "lookBackPeriodInDays")]
492    #[serde(skip_serializing_if = "Option::is_none")]
493    pub look_back_period_in_days: Option<f64>,
494    /// <p>An array of objects that describe the recommendation options for the instance.</p>
495    #[serde(rename = "recommendationOptions")]
496    #[serde(skip_serializing_if = "Option::is_none")]
497    pub recommendation_options: Option<Vec<InstanceRecommendationOption>>,
498    /// <p>An array of objects that describe the source resource of the recommendation.</p>
499    #[serde(rename = "recommendationSources")]
500    #[serde(skip_serializing_if = "Option::is_none")]
501    pub recommendation_sources: Option<Vec<RecommendationSource>>,
502    /// <p>An array of objects that describe the utilization metrics of the instance.</p>
503    #[serde(rename = "utilizationMetrics")]
504    #[serde(skip_serializing_if = "Option::is_none")]
505    pub utilization_metrics: Option<Vec<UtilizationMetric>>,
506}
507
508/// <p>Describes a recommendation option for an Amazon EC2 instance.</p>
509#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
510#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
511pub struct InstanceRecommendationOption {
512    /// <p>The instance type of the instance recommendation.</p>
513    #[serde(rename = "instanceType")]
514    #[serde(skip_serializing_if = "Option::is_none")]
515    pub instance_type: Option<String>,
516    /// <p>The performance risk of the instance recommendation option.</p> <p>Performance risk is the likelihood of the recommended instance type not meeting the performance requirement of your workload.</p> <p>The lowest performance risk is categorized as <code>0</code>, and the highest as <code>5</code>.</p>
517    #[serde(rename = "performanceRisk")]
518    #[serde(skip_serializing_if = "Option::is_none")]
519    pub performance_risk: Option<f64>,
520    /// <p>An array of objects that describe the projected utilization metrics of the instance recommendation option.</p>
521    #[serde(rename = "projectedUtilizationMetrics")]
522    #[serde(skip_serializing_if = "Option::is_none")]
523    pub projected_utilization_metrics: Option<Vec<UtilizationMetric>>,
524    /// <p>The rank of the instance recommendation option.</p> <p>The top recommendation option is ranked as <code>1</code>.</p>
525    #[serde(rename = "rank")]
526    #[serde(skip_serializing_if = "Option::is_none")]
527    pub rank: Option<i64>,
528}
529
530/// <p>Describes a filter that returns a more specific list of recommendation export jobs.</p> <p>This filter is used with the <code>DescribeRecommendationExportJobs</code> action.</p>
531#[derive(Clone, Debug, Default, PartialEq, Serialize)]
532#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
533pub struct JobFilter {
534    /// <p>The name of the filter.</p> <p>Specify <code>ResourceType</code> to return export jobs of a specific resource type (e.g., <code>Ec2Instance</code>).</p> <p>Specify <code>JobStatus</code> to return export jobs with a specific status (e.g, <code>Complete</code>).</p>
535    #[serde(rename = "name")]
536    #[serde(skip_serializing_if = "Option::is_none")]
537    pub name: Option<String>,
538    /// <p>The value of the filter.</p> <p>If you specify the <code>name</code> parameter as <code>ResourceType</code>, the valid values are <code>Ec2Instance</code> or <code>AutoScalingGroup</code>.</p> <p>If you specify the <code>name</code> parameter as <code>JobStatus</code>, the valid values are <code>Queued</code>, <code>InProgress</code>, <code>Complete</code>, or <code>Failed</code>.</p>
539    #[serde(rename = "values")]
540    #[serde(skip_serializing_if = "Option::is_none")]
541    pub values: Option<Vec<String>>,
542}
543
544/// <p>Describes a projected utilization metric of a recommendation option, such as an Amazon EC2 instance.</p>
545#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
546#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
547pub struct ProjectedMetric {
548    /// <p><p>The name of the projected utilization metric.</p> <note> <p>Memory metrics are only returned for resources that have the unified CloudWatch agent installed on them. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Install-CloudWatch-Agent.html">Enabling Memory Utilization with the CloudWatch Agent</a>.</p> </note></p>
549    #[serde(rename = "name")]
550    #[serde(skip_serializing_if = "Option::is_none")]
551    pub name: Option<String>,
552    /// <p>The time stamps of the projected utilization metric.</p>
553    #[serde(rename = "timestamps")]
554    #[serde(skip_serializing_if = "Option::is_none")]
555    pub timestamps: Option<Vec<f64>>,
556    /// <p>The values of the projected utilization metrics.</p>
557    #[serde(rename = "values")]
558    #[serde(skip_serializing_if = "Option::is_none")]
559    pub values: Option<Vec<f64>>,
560}
561
562/// <p>Describes a recommendation export job.</p> <p>Use the <code>DescribeRecommendationExportJobs</code> action to view your recommendation export jobs.</p> <p>Use the <code>ExportAutoScalingGroupRecommendations</code> or <code>ExportEC2InstanceRecommendations</code> actions to request an export of your recommendations.</p>
563#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
564#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
565pub struct RecommendationExportJob {
566    /// <p>The timestamp of when the export job was created.</p>
567    #[serde(rename = "creationTimestamp")]
568    #[serde(skip_serializing_if = "Option::is_none")]
569    pub creation_timestamp: Option<f64>,
570    /// <p>An object that describes the destination of the export file.</p>
571    #[serde(rename = "destination")]
572    #[serde(skip_serializing_if = "Option::is_none")]
573    pub destination: Option<ExportDestination>,
574    /// <p>The reason for an export job failure.</p>
575    #[serde(rename = "failureReason")]
576    #[serde(skip_serializing_if = "Option::is_none")]
577    pub failure_reason: Option<String>,
578    /// <p>The identification number of the export job.</p>
579    #[serde(rename = "jobId")]
580    #[serde(skip_serializing_if = "Option::is_none")]
581    pub job_id: Option<String>,
582    /// <p>The timestamp of when the export job was last updated.</p>
583    #[serde(rename = "lastUpdatedTimestamp")]
584    #[serde(skip_serializing_if = "Option::is_none")]
585    pub last_updated_timestamp: Option<f64>,
586    /// <p>The resource type of the exported recommendations.</p>
587    #[serde(rename = "resourceType")]
588    #[serde(skip_serializing_if = "Option::is_none")]
589    pub resource_type: Option<String>,
590    /// <p>The status of the export job.</p>
591    #[serde(rename = "status")]
592    #[serde(skip_serializing_if = "Option::is_none")]
593    pub status: Option<String>,
594}
595
596/// <p>Describes the source of a recommendation, such as an Amazon EC2 instance or Auto Scaling group.</p>
597#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
598#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
599pub struct RecommendationSource {
600    /// <p>The Amazon Resource Name (ARN) of the recommendation source.</p>
601    #[serde(rename = "recommendationSourceArn")]
602    #[serde(skip_serializing_if = "Option::is_none")]
603    pub recommendation_source_arn: Option<String>,
604    /// <p>The resource type of the recommendation source.</p>
605    #[serde(rename = "recommendationSourceType")]
606    #[serde(skip_serializing_if = "Option::is_none")]
607    pub recommendation_source_type: Option<String>,
608}
609
610/// <p>A summary of a recommendation.</p>
611#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
612#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
613pub struct RecommendationSummary {
614    /// <p>The AWS account ID of the recommendation summary.</p>
615    #[serde(rename = "accountId")]
616    #[serde(skip_serializing_if = "Option::is_none")]
617    pub account_id: Option<String>,
618    /// <p>The resource type of the recommendation.</p>
619    #[serde(rename = "recommendationResourceType")]
620    #[serde(skip_serializing_if = "Option::is_none")]
621    pub recommendation_resource_type: Option<String>,
622    /// <p>An array of objects that describe a recommendation summary.</p>
623    #[serde(rename = "summaries")]
624    #[serde(skip_serializing_if = "Option::is_none")]
625    pub summaries: Option<Vec<Summary>>,
626}
627
628/// <p>Describes a projected utilization metric of a recommendation option.</p>
629#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
630#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
631pub struct RecommendedOptionProjectedMetric {
632    /// <p>An array of objects that describe a projected utilization metric.</p>
633    #[serde(rename = "projectedMetrics")]
634    #[serde(skip_serializing_if = "Option::is_none")]
635    pub projected_metrics: Option<Vec<ProjectedMetric>>,
636    /// <p>The rank of the recommendation option projected metric.</p> <p>The top recommendation option is ranked as <code>1</code>.</p> <p>The projected metric rank correlates to the recommendation option rank. For example, the projected metric ranked as <code>1</code> is related to the recommendation option that is also ranked as <code>1</code> in the same response.</p>
637    #[serde(rename = "rank")]
638    #[serde(skip_serializing_if = "Option::is_none")]
639    pub rank: Option<i64>,
640    /// <p>The recommended instance type.</p>
641    #[serde(rename = "recommendedInstanceType")]
642    #[serde(skip_serializing_if = "Option::is_none")]
643    pub recommended_instance_type: Option<String>,
644}
645
646/// <p>Describes the destination Amazon Simple Storage Service (Amazon S3) bucket name and object keys of a recommendations export file, and its associated metadata file.</p>
647#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
648#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
649pub struct S3Destination {
650    /// <p>The name of the Amazon S3 bucket used as the destination of an export file.</p>
651    #[serde(rename = "bucket")]
652    #[serde(skip_serializing_if = "Option::is_none")]
653    pub bucket: Option<String>,
654    /// <p>The Amazon S3 bucket key of an export file.</p> <p>The key uniquely identifies the object, or export file, in the S3 bucket.</p>
655    #[serde(rename = "key")]
656    #[serde(skip_serializing_if = "Option::is_none")]
657    pub key: Option<String>,
658    /// <p>The Amazon S3 bucket key of a metadata file.</p> <p>The key uniquely identifies the object, or metadata file, in the S3 bucket.</p>
659    #[serde(rename = "metadataKey")]
660    #[serde(skip_serializing_if = "Option::is_none")]
661    pub metadata_key: Option<String>,
662}
663
664/// <p>Describes the destination Amazon Simple Storage Service (Amazon S3) bucket name and key prefix for a recommendations export job.</p> <p>You must create the destination Amazon S3 bucket for your recommendations export before you create the export job. Compute Optimizer does not create the S3 bucket for you. After you create the S3 bucket, ensure that it has the required permission policy to allow Compute Optimizer to write the export file to it. If you plan to specify an object prefix when you create the export job, you must include the object prefix in the policy that you add to the S3 bucket. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/create-s3-bucket-policy-for-compute-optimizer.html">Amazon S3 Bucket Policy for Compute Optimizer</a> in the <i>Compute Optimizer user guide</i>.</p>
665#[derive(Clone, Debug, Default, PartialEq, Serialize)]
666#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
667pub struct S3DestinationConfig {
668    /// <p>The name of the Amazon S3 bucket to use as the destination for an export job.</p>
669    #[serde(rename = "bucket")]
670    #[serde(skip_serializing_if = "Option::is_none")]
671    pub bucket: Option<String>,
672    /// <p>The Amazon S3 bucket prefix for an export job.</p>
673    #[serde(rename = "keyPrefix")]
674    #[serde(skip_serializing_if = "Option::is_none")]
675    pub key_prefix: Option<String>,
676}
677
678/// <p>The summary of a recommendation.</p>
679#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
680#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
681pub struct Summary {
682    /// <p>The finding classification of the recommendation.</p>
683    #[serde(rename = "name")]
684    #[serde(skip_serializing_if = "Option::is_none")]
685    pub name: Option<String>,
686    /// <p>The value of the recommendation summary.</p>
687    #[serde(rename = "value")]
688    #[serde(skip_serializing_if = "Option::is_none")]
689    pub value: Option<f64>,
690}
691
692#[derive(Clone, Debug, Default, PartialEq, Serialize)]
693#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
694pub struct UpdateEnrollmentStatusRequest {
695    /// <p>Indicates whether to enroll member accounts of the organization if the your account is the master account of an organization.</p>
696    #[serde(rename = "includeMemberAccounts")]
697    #[serde(skip_serializing_if = "Option::is_none")]
698    pub include_member_accounts: Option<bool>,
699    /// <p>The new enrollment status of the account.</p> <p>Accepted options are <code>Active</code> or <code>Inactive</code>. You will get an error if <code>Pending</code> or <code>Failed</code> are specified.</p>
700    #[serde(rename = "status")]
701    pub status: String,
702}
703
704#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
705#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
706pub struct UpdateEnrollmentStatusResponse {
707    /// <p>The enrollment status of the account.</p>
708    #[serde(rename = "status")]
709    #[serde(skip_serializing_if = "Option::is_none")]
710    pub status: Option<String>,
711    /// <p>The reason for the enrollment status of the account. For example, an account might show a status of <code>Pending</code> because member accounts of an organization require more time to be enrolled in the service.</p>
712    #[serde(rename = "statusReason")]
713    #[serde(skip_serializing_if = "Option::is_none")]
714    pub status_reason: Option<String>,
715}
716
717/// <p>Describes a utilization metric of a resource, such as an Amazon EC2 instance.</p>
718#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
719#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
720pub struct UtilizationMetric {
721    /// <p><p>The name of the utilization metric.</p> <note> <p>Memory metrics are only returned for resources that have the unified CloudWatch agent installed on them. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Install-CloudWatch-Agent.html">Enabling Memory Utilization with the CloudWatch Agent</a>.</p> </note></p>
722    #[serde(rename = "name")]
723    #[serde(skip_serializing_if = "Option::is_none")]
724    pub name: Option<String>,
725    /// <p>The statistic of the utilization metric.</p>
726    #[serde(rename = "statistic")]
727    #[serde(skip_serializing_if = "Option::is_none")]
728    pub statistic: Option<String>,
729    /// <p>The value of the utilization metric.</p>
730    #[serde(rename = "value")]
731    #[serde(skip_serializing_if = "Option::is_none")]
732    pub value: Option<f64>,
733}
734
735/// Errors returned by DescribeRecommendationExportJobs
736#[derive(Debug, PartialEq)]
737pub enum DescribeRecommendationExportJobsError {
738    /// <p>You do not have sufficient access to perform this action.</p>
739    AccessDenied(String),
740    /// <p>An internal error has occurred. Try your call again.</p>
741    InternalServer(String),
742    /// <p>An invalid or out-of-range value was supplied for the input parameter.</p>
743    InvalidParameterValue(String),
744    /// <p>The request must contain either a valid (registered) AWS access key ID or X.509 certificate.</p>
745    MissingAuthenticationToken(String),
746    /// <p>The account is not opted in to AWS Compute Optimizer.</p>
747    OptInRequired(String),
748    /// <p>A resource that is required for the action doesn't exist.</p>
749    ResourceNotFound(String),
750    /// <p>The request has failed due to a temporary failure of the server.</p>
751    ServiceUnavailable(String),
752    /// <p>The request was denied due to request throttling.</p>
753    Throttling(String),
754}
755
756impl DescribeRecommendationExportJobsError {
757    pub fn from_response(
758        res: BufferedHttpResponse,
759    ) -> RusotoError<DescribeRecommendationExportJobsError> {
760        if let Some(err) = proto::json::Error::parse(&res) {
761            match err.typ.as_str() {
762                "AccessDeniedException" => {
763                    return RusotoError::Service(
764                        DescribeRecommendationExportJobsError::AccessDenied(err.msg),
765                    )
766                }
767                "InternalServerException" => {
768                    return RusotoError::Service(
769                        DescribeRecommendationExportJobsError::InternalServer(err.msg),
770                    )
771                }
772                "InvalidParameterValueException" => {
773                    return RusotoError::Service(
774                        DescribeRecommendationExportJobsError::InvalidParameterValue(err.msg),
775                    )
776                }
777                "MissingAuthenticationToken" => {
778                    return RusotoError::Service(
779                        DescribeRecommendationExportJobsError::MissingAuthenticationToken(err.msg),
780                    )
781                }
782                "OptInRequiredException" => {
783                    return RusotoError::Service(
784                        DescribeRecommendationExportJobsError::OptInRequired(err.msg),
785                    )
786                }
787                "ResourceNotFoundException" => {
788                    return RusotoError::Service(
789                        DescribeRecommendationExportJobsError::ResourceNotFound(err.msg),
790                    )
791                }
792                "ServiceUnavailableException" => {
793                    return RusotoError::Service(
794                        DescribeRecommendationExportJobsError::ServiceUnavailable(err.msg),
795                    )
796                }
797                "ThrottlingException" => {
798                    return RusotoError::Service(DescribeRecommendationExportJobsError::Throttling(
799                        err.msg,
800                    ))
801                }
802                "ValidationException" => return RusotoError::Validation(err.msg),
803                _ => {}
804            }
805        }
806        RusotoError::Unknown(res)
807    }
808}
809impl fmt::Display for DescribeRecommendationExportJobsError {
810    #[allow(unused_variables)]
811    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
812        match *self {
813            DescribeRecommendationExportJobsError::AccessDenied(ref cause) => {
814                write!(f, "{}", cause)
815            }
816            DescribeRecommendationExportJobsError::InternalServer(ref cause) => {
817                write!(f, "{}", cause)
818            }
819            DescribeRecommendationExportJobsError::InvalidParameterValue(ref cause) => {
820                write!(f, "{}", cause)
821            }
822            DescribeRecommendationExportJobsError::MissingAuthenticationToken(ref cause) => {
823                write!(f, "{}", cause)
824            }
825            DescribeRecommendationExportJobsError::OptInRequired(ref cause) => {
826                write!(f, "{}", cause)
827            }
828            DescribeRecommendationExportJobsError::ResourceNotFound(ref cause) => {
829                write!(f, "{}", cause)
830            }
831            DescribeRecommendationExportJobsError::ServiceUnavailable(ref cause) => {
832                write!(f, "{}", cause)
833            }
834            DescribeRecommendationExportJobsError::Throttling(ref cause) => write!(f, "{}", cause),
835        }
836    }
837}
838impl Error for DescribeRecommendationExportJobsError {}
839/// Errors returned by ExportAutoScalingGroupRecommendations
840#[derive(Debug, PartialEq)]
841pub enum ExportAutoScalingGroupRecommendationsError {
842    /// <p>You do not have sufficient access to perform this action.</p>
843    AccessDenied(String),
844    /// <p>An internal error has occurred. Try your call again.</p>
845    InternalServer(String),
846    /// <p>An invalid or out-of-range value was supplied for the input parameter.</p>
847    InvalidParameterValue(String),
848    /// <p>The request exceeds a limit of the service.</p>
849    LimitExceeded(String),
850    /// <p>The request must contain either a valid (registered) AWS access key ID or X.509 certificate.</p>
851    MissingAuthenticationToken(String),
852    /// <p>The account is not opted in to AWS Compute Optimizer.</p>
853    OptInRequired(String),
854    /// <p>The request has failed due to a temporary failure of the server.</p>
855    ServiceUnavailable(String),
856    /// <p>The request was denied due to request throttling.</p>
857    Throttling(String),
858}
859
860impl ExportAutoScalingGroupRecommendationsError {
861    pub fn from_response(
862        res: BufferedHttpResponse,
863    ) -> RusotoError<ExportAutoScalingGroupRecommendationsError> {
864        if let Some(err) = proto::json::Error::parse(&res) {
865            match err.typ.as_str() {
866                "AccessDeniedException" => {
867                    return RusotoError::Service(
868                        ExportAutoScalingGroupRecommendationsError::AccessDenied(err.msg),
869                    )
870                }
871                "InternalServerException" => {
872                    return RusotoError::Service(
873                        ExportAutoScalingGroupRecommendationsError::InternalServer(err.msg),
874                    )
875                }
876                "InvalidParameterValueException" => {
877                    return RusotoError::Service(
878                        ExportAutoScalingGroupRecommendationsError::InvalidParameterValue(err.msg),
879                    )
880                }
881                "LimitExceededException" => {
882                    return RusotoError::Service(
883                        ExportAutoScalingGroupRecommendationsError::LimitExceeded(err.msg),
884                    )
885                }
886                "MissingAuthenticationToken" => {
887                    return RusotoError::Service(
888                        ExportAutoScalingGroupRecommendationsError::MissingAuthenticationToken(
889                            err.msg,
890                        ),
891                    )
892                }
893                "OptInRequiredException" => {
894                    return RusotoError::Service(
895                        ExportAutoScalingGroupRecommendationsError::OptInRequired(err.msg),
896                    )
897                }
898                "ServiceUnavailableException" => {
899                    return RusotoError::Service(
900                        ExportAutoScalingGroupRecommendationsError::ServiceUnavailable(err.msg),
901                    )
902                }
903                "ThrottlingException" => {
904                    return RusotoError::Service(
905                        ExportAutoScalingGroupRecommendationsError::Throttling(err.msg),
906                    )
907                }
908                "ValidationException" => return RusotoError::Validation(err.msg),
909                _ => {}
910            }
911        }
912        RusotoError::Unknown(res)
913    }
914}
915impl fmt::Display for ExportAutoScalingGroupRecommendationsError {
916    #[allow(unused_variables)]
917    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
918        match *self {
919            ExportAutoScalingGroupRecommendationsError::AccessDenied(ref cause) => {
920                write!(f, "{}", cause)
921            }
922            ExportAutoScalingGroupRecommendationsError::InternalServer(ref cause) => {
923                write!(f, "{}", cause)
924            }
925            ExportAutoScalingGroupRecommendationsError::InvalidParameterValue(ref cause) => {
926                write!(f, "{}", cause)
927            }
928            ExportAutoScalingGroupRecommendationsError::LimitExceeded(ref cause) => {
929                write!(f, "{}", cause)
930            }
931            ExportAutoScalingGroupRecommendationsError::MissingAuthenticationToken(ref cause) => {
932                write!(f, "{}", cause)
933            }
934            ExportAutoScalingGroupRecommendationsError::OptInRequired(ref cause) => {
935                write!(f, "{}", cause)
936            }
937            ExportAutoScalingGroupRecommendationsError::ServiceUnavailable(ref cause) => {
938                write!(f, "{}", cause)
939            }
940            ExportAutoScalingGroupRecommendationsError::Throttling(ref cause) => {
941                write!(f, "{}", cause)
942            }
943        }
944    }
945}
946impl Error for ExportAutoScalingGroupRecommendationsError {}
947/// Errors returned by ExportEC2InstanceRecommendations
948#[derive(Debug, PartialEq)]
949pub enum ExportEC2InstanceRecommendationsError {
950    /// <p>You do not have sufficient access to perform this action.</p>
951    AccessDenied(String),
952    /// <p>An internal error has occurred. Try your call again.</p>
953    InternalServer(String),
954    /// <p>An invalid or out-of-range value was supplied for the input parameter.</p>
955    InvalidParameterValue(String),
956    /// <p>The request exceeds a limit of the service.</p>
957    LimitExceeded(String),
958    /// <p>The request must contain either a valid (registered) AWS access key ID or X.509 certificate.</p>
959    MissingAuthenticationToken(String),
960    /// <p>The account is not opted in to AWS Compute Optimizer.</p>
961    OptInRequired(String),
962    /// <p>The request has failed due to a temporary failure of the server.</p>
963    ServiceUnavailable(String),
964    /// <p>The request was denied due to request throttling.</p>
965    Throttling(String),
966}
967
968impl ExportEC2InstanceRecommendationsError {
969    pub fn from_response(
970        res: BufferedHttpResponse,
971    ) -> RusotoError<ExportEC2InstanceRecommendationsError> {
972        if let Some(err) = proto::json::Error::parse(&res) {
973            match err.typ.as_str() {
974                "AccessDeniedException" => {
975                    return RusotoError::Service(
976                        ExportEC2InstanceRecommendationsError::AccessDenied(err.msg),
977                    )
978                }
979                "InternalServerException" => {
980                    return RusotoError::Service(
981                        ExportEC2InstanceRecommendationsError::InternalServer(err.msg),
982                    )
983                }
984                "InvalidParameterValueException" => {
985                    return RusotoError::Service(
986                        ExportEC2InstanceRecommendationsError::InvalidParameterValue(err.msg),
987                    )
988                }
989                "LimitExceededException" => {
990                    return RusotoError::Service(
991                        ExportEC2InstanceRecommendationsError::LimitExceeded(err.msg),
992                    )
993                }
994                "MissingAuthenticationToken" => {
995                    return RusotoError::Service(
996                        ExportEC2InstanceRecommendationsError::MissingAuthenticationToken(err.msg),
997                    )
998                }
999                "OptInRequiredException" => {
1000                    return RusotoError::Service(
1001                        ExportEC2InstanceRecommendationsError::OptInRequired(err.msg),
1002                    )
1003                }
1004                "ServiceUnavailableException" => {
1005                    return RusotoError::Service(
1006                        ExportEC2InstanceRecommendationsError::ServiceUnavailable(err.msg),
1007                    )
1008                }
1009                "ThrottlingException" => {
1010                    return RusotoError::Service(ExportEC2InstanceRecommendationsError::Throttling(
1011                        err.msg,
1012                    ))
1013                }
1014                "ValidationException" => return RusotoError::Validation(err.msg),
1015                _ => {}
1016            }
1017        }
1018        RusotoError::Unknown(res)
1019    }
1020}
1021impl fmt::Display for ExportEC2InstanceRecommendationsError {
1022    #[allow(unused_variables)]
1023    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1024        match *self {
1025            ExportEC2InstanceRecommendationsError::AccessDenied(ref cause) => {
1026                write!(f, "{}", cause)
1027            }
1028            ExportEC2InstanceRecommendationsError::InternalServer(ref cause) => {
1029                write!(f, "{}", cause)
1030            }
1031            ExportEC2InstanceRecommendationsError::InvalidParameterValue(ref cause) => {
1032                write!(f, "{}", cause)
1033            }
1034            ExportEC2InstanceRecommendationsError::LimitExceeded(ref cause) => {
1035                write!(f, "{}", cause)
1036            }
1037            ExportEC2InstanceRecommendationsError::MissingAuthenticationToken(ref cause) => {
1038                write!(f, "{}", cause)
1039            }
1040            ExportEC2InstanceRecommendationsError::OptInRequired(ref cause) => {
1041                write!(f, "{}", cause)
1042            }
1043            ExportEC2InstanceRecommendationsError::ServiceUnavailable(ref cause) => {
1044                write!(f, "{}", cause)
1045            }
1046            ExportEC2InstanceRecommendationsError::Throttling(ref cause) => write!(f, "{}", cause),
1047        }
1048    }
1049}
1050impl Error for ExportEC2InstanceRecommendationsError {}
1051/// Errors returned by GetAutoScalingGroupRecommendations
1052#[derive(Debug, PartialEq)]
1053pub enum GetAutoScalingGroupRecommendationsError {
1054    /// <p>You do not have sufficient access to perform this action.</p>
1055    AccessDenied(String),
1056    /// <p>An internal error has occurred. Try your call again.</p>
1057    InternalServer(String),
1058    /// <p>An invalid or out-of-range value was supplied for the input parameter.</p>
1059    InvalidParameterValue(String),
1060    /// <p>The request must contain either a valid (registered) AWS access key ID or X.509 certificate.</p>
1061    MissingAuthenticationToken(String),
1062    /// <p>The account is not opted in to AWS Compute Optimizer.</p>
1063    OptInRequired(String),
1064    /// <p>A resource that is required for the action doesn't exist.</p>
1065    ResourceNotFound(String),
1066    /// <p>The request has failed due to a temporary failure of the server.</p>
1067    ServiceUnavailable(String),
1068    /// <p>The request was denied due to request throttling.</p>
1069    Throttling(String),
1070}
1071
1072impl GetAutoScalingGroupRecommendationsError {
1073    pub fn from_response(
1074        res: BufferedHttpResponse,
1075    ) -> RusotoError<GetAutoScalingGroupRecommendationsError> {
1076        if let Some(err) = proto::json::Error::parse(&res) {
1077            match err.typ.as_str() {
1078                "AccessDeniedException" => {
1079                    return RusotoError::Service(
1080                        GetAutoScalingGroupRecommendationsError::AccessDenied(err.msg),
1081                    )
1082                }
1083                "InternalServerException" => {
1084                    return RusotoError::Service(
1085                        GetAutoScalingGroupRecommendationsError::InternalServer(err.msg),
1086                    )
1087                }
1088                "InvalidParameterValueException" => {
1089                    return RusotoError::Service(
1090                        GetAutoScalingGroupRecommendationsError::InvalidParameterValue(err.msg),
1091                    )
1092                }
1093                "MissingAuthenticationToken" => {
1094                    return RusotoError::Service(
1095                        GetAutoScalingGroupRecommendationsError::MissingAuthenticationToken(
1096                            err.msg,
1097                        ),
1098                    )
1099                }
1100                "OptInRequiredException" => {
1101                    return RusotoError::Service(
1102                        GetAutoScalingGroupRecommendationsError::OptInRequired(err.msg),
1103                    )
1104                }
1105                "ResourceNotFoundException" => {
1106                    return RusotoError::Service(
1107                        GetAutoScalingGroupRecommendationsError::ResourceNotFound(err.msg),
1108                    )
1109                }
1110                "ServiceUnavailableException" => {
1111                    return RusotoError::Service(
1112                        GetAutoScalingGroupRecommendationsError::ServiceUnavailable(err.msg),
1113                    )
1114                }
1115                "ThrottlingException" => {
1116                    return RusotoError::Service(
1117                        GetAutoScalingGroupRecommendationsError::Throttling(err.msg),
1118                    )
1119                }
1120                "ValidationException" => return RusotoError::Validation(err.msg),
1121                _ => {}
1122            }
1123        }
1124        RusotoError::Unknown(res)
1125    }
1126}
1127impl fmt::Display for GetAutoScalingGroupRecommendationsError {
1128    #[allow(unused_variables)]
1129    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1130        match *self {
1131            GetAutoScalingGroupRecommendationsError::AccessDenied(ref cause) => {
1132                write!(f, "{}", cause)
1133            }
1134            GetAutoScalingGroupRecommendationsError::InternalServer(ref cause) => {
1135                write!(f, "{}", cause)
1136            }
1137            GetAutoScalingGroupRecommendationsError::InvalidParameterValue(ref cause) => {
1138                write!(f, "{}", cause)
1139            }
1140            GetAutoScalingGroupRecommendationsError::MissingAuthenticationToken(ref cause) => {
1141                write!(f, "{}", cause)
1142            }
1143            GetAutoScalingGroupRecommendationsError::OptInRequired(ref cause) => {
1144                write!(f, "{}", cause)
1145            }
1146            GetAutoScalingGroupRecommendationsError::ResourceNotFound(ref cause) => {
1147                write!(f, "{}", cause)
1148            }
1149            GetAutoScalingGroupRecommendationsError::ServiceUnavailable(ref cause) => {
1150                write!(f, "{}", cause)
1151            }
1152            GetAutoScalingGroupRecommendationsError::Throttling(ref cause) => {
1153                write!(f, "{}", cause)
1154            }
1155        }
1156    }
1157}
1158impl Error for GetAutoScalingGroupRecommendationsError {}
1159/// Errors returned by GetEC2InstanceRecommendations
1160#[derive(Debug, PartialEq)]
1161pub enum GetEC2InstanceRecommendationsError {
1162    /// <p>You do not have sufficient access to perform this action.</p>
1163    AccessDenied(String),
1164    /// <p>An internal error has occurred. Try your call again.</p>
1165    InternalServer(String),
1166    /// <p>An invalid or out-of-range value was supplied for the input parameter.</p>
1167    InvalidParameterValue(String),
1168    /// <p>The request must contain either a valid (registered) AWS access key ID or X.509 certificate.</p>
1169    MissingAuthenticationToken(String),
1170    /// <p>The account is not opted in to AWS Compute Optimizer.</p>
1171    OptInRequired(String),
1172    /// <p>A resource that is required for the action doesn't exist.</p>
1173    ResourceNotFound(String),
1174    /// <p>The request has failed due to a temporary failure of the server.</p>
1175    ServiceUnavailable(String),
1176    /// <p>The request was denied due to request throttling.</p>
1177    Throttling(String),
1178}
1179
1180impl GetEC2InstanceRecommendationsError {
1181    pub fn from_response(
1182        res: BufferedHttpResponse,
1183    ) -> RusotoError<GetEC2InstanceRecommendationsError> {
1184        if let Some(err) = proto::json::Error::parse(&res) {
1185            match err.typ.as_str() {
1186                "AccessDeniedException" => {
1187                    return RusotoError::Service(GetEC2InstanceRecommendationsError::AccessDenied(
1188                        err.msg,
1189                    ))
1190                }
1191                "InternalServerException" => {
1192                    return RusotoError::Service(
1193                        GetEC2InstanceRecommendationsError::InternalServer(err.msg),
1194                    )
1195                }
1196                "InvalidParameterValueException" => {
1197                    return RusotoError::Service(
1198                        GetEC2InstanceRecommendationsError::InvalidParameterValue(err.msg),
1199                    )
1200                }
1201                "MissingAuthenticationToken" => {
1202                    return RusotoError::Service(
1203                        GetEC2InstanceRecommendationsError::MissingAuthenticationToken(err.msg),
1204                    )
1205                }
1206                "OptInRequiredException" => {
1207                    return RusotoError::Service(GetEC2InstanceRecommendationsError::OptInRequired(
1208                        err.msg,
1209                    ))
1210                }
1211                "ResourceNotFoundException" => {
1212                    return RusotoError::Service(
1213                        GetEC2InstanceRecommendationsError::ResourceNotFound(err.msg),
1214                    )
1215                }
1216                "ServiceUnavailableException" => {
1217                    return RusotoError::Service(
1218                        GetEC2InstanceRecommendationsError::ServiceUnavailable(err.msg),
1219                    )
1220                }
1221                "ThrottlingException" => {
1222                    return RusotoError::Service(GetEC2InstanceRecommendationsError::Throttling(
1223                        err.msg,
1224                    ))
1225                }
1226                "ValidationException" => return RusotoError::Validation(err.msg),
1227                _ => {}
1228            }
1229        }
1230        RusotoError::Unknown(res)
1231    }
1232}
1233impl fmt::Display for GetEC2InstanceRecommendationsError {
1234    #[allow(unused_variables)]
1235    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1236        match *self {
1237            GetEC2InstanceRecommendationsError::AccessDenied(ref cause) => write!(f, "{}", cause),
1238            GetEC2InstanceRecommendationsError::InternalServer(ref cause) => write!(f, "{}", cause),
1239            GetEC2InstanceRecommendationsError::InvalidParameterValue(ref cause) => {
1240                write!(f, "{}", cause)
1241            }
1242            GetEC2InstanceRecommendationsError::MissingAuthenticationToken(ref cause) => {
1243                write!(f, "{}", cause)
1244            }
1245            GetEC2InstanceRecommendationsError::OptInRequired(ref cause) => write!(f, "{}", cause),
1246            GetEC2InstanceRecommendationsError::ResourceNotFound(ref cause) => {
1247                write!(f, "{}", cause)
1248            }
1249            GetEC2InstanceRecommendationsError::ServiceUnavailable(ref cause) => {
1250                write!(f, "{}", cause)
1251            }
1252            GetEC2InstanceRecommendationsError::Throttling(ref cause) => write!(f, "{}", cause),
1253        }
1254    }
1255}
1256impl Error for GetEC2InstanceRecommendationsError {}
1257/// Errors returned by GetEC2RecommendationProjectedMetrics
1258#[derive(Debug, PartialEq)]
1259pub enum GetEC2RecommendationProjectedMetricsError {
1260    /// <p>You do not have sufficient access to perform this action.</p>
1261    AccessDenied(String),
1262    /// <p>An internal error has occurred. Try your call again.</p>
1263    InternalServer(String),
1264    /// <p>An invalid or out-of-range value was supplied for the input parameter.</p>
1265    InvalidParameterValue(String),
1266    /// <p>The request must contain either a valid (registered) AWS access key ID or X.509 certificate.</p>
1267    MissingAuthenticationToken(String),
1268    /// <p>The account is not opted in to AWS Compute Optimizer.</p>
1269    OptInRequired(String),
1270    /// <p>A resource that is required for the action doesn't exist.</p>
1271    ResourceNotFound(String),
1272    /// <p>The request has failed due to a temporary failure of the server.</p>
1273    ServiceUnavailable(String),
1274    /// <p>The request was denied due to request throttling.</p>
1275    Throttling(String),
1276}
1277
1278impl GetEC2RecommendationProjectedMetricsError {
1279    pub fn from_response(
1280        res: BufferedHttpResponse,
1281    ) -> RusotoError<GetEC2RecommendationProjectedMetricsError> {
1282        if let Some(err) = proto::json::Error::parse(&res) {
1283            match err.typ.as_str() {
1284                "AccessDeniedException" => {
1285                    return RusotoError::Service(
1286                        GetEC2RecommendationProjectedMetricsError::AccessDenied(err.msg),
1287                    )
1288                }
1289                "InternalServerException" => {
1290                    return RusotoError::Service(
1291                        GetEC2RecommendationProjectedMetricsError::InternalServer(err.msg),
1292                    )
1293                }
1294                "InvalidParameterValueException" => {
1295                    return RusotoError::Service(
1296                        GetEC2RecommendationProjectedMetricsError::InvalidParameterValue(err.msg),
1297                    )
1298                }
1299                "MissingAuthenticationToken" => {
1300                    return RusotoError::Service(
1301                        GetEC2RecommendationProjectedMetricsError::MissingAuthenticationToken(
1302                            err.msg,
1303                        ),
1304                    )
1305                }
1306                "OptInRequiredException" => {
1307                    return RusotoError::Service(
1308                        GetEC2RecommendationProjectedMetricsError::OptInRequired(err.msg),
1309                    )
1310                }
1311                "ResourceNotFoundException" => {
1312                    return RusotoError::Service(
1313                        GetEC2RecommendationProjectedMetricsError::ResourceNotFound(err.msg),
1314                    )
1315                }
1316                "ServiceUnavailableException" => {
1317                    return RusotoError::Service(
1318                        GetEC2RecommendationProjectedMetricsError::ServiceUnavailable(err.msg),
1319                    )
1320                }
1321                "ThrottlingException" => {
1322                    return RusotoError::Service(
1323                        GetEC2RecommendationProjectedMetricsError::Throttling(err.msg),
1324                    )
1325                }
1326                "ValidationException" => return RusotoError::Validation(err.msg),
1327                _ => {}
1328            }
1329        }
1330        RusotoError::Unknown(res)
1331    }
1332}
1333impl fmt::Display for GetEC2RecommendationProjectedMetricsError {
1334    #[allow(unused_variables)]
1335    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1336        match *self {
1337            GetEC2RecommendationProjectedMetricsError::AccessDenied(ref cause) => {
1338                write!(f, "{}", cause)
1339            }
1340            GetEC2RecommendationProjectedMetricsError::InternalServer(ref cause) => {
1341                write!(f, "{}", cause)
1342            }
1343            GetEC2RecommendationProjectedMetricsError::InvalidParameterValue(ref cause) => {
1344                write!(f, "{}", cause)
1345            }
1346            GetEC2RecommendationProjectedMetricsError::MissingAuthenticationToken(ref cause) => {
1347                write!(f, "{}", cause)
1348            }
1349            GetEC2RecommendationProjectedMetricsError::OptInRequired(ref cause) => {
1350                write!(f, "{}", cause)
1351            }
1352            GetEC2RecommendationProjectedMetricsError::ResourceNotFound(ref cause) => {
1353                write!(f, "{}", cause)
1354            }
1355            GetEC2RecommendationProjectedMetricsError::ServiceUnavailable(ref cause) => {
1356                write!(f, "{}", cause)
1357            }
1358            GetEC2RecommendationProjectedMetricsError::Throttling(ref cause) => {
1359                write!(f, "{}", cause)
1360            }
1361        }
1362    }
1363}
1364impl Error for GetEC2RecommendationProjectedMetricsError {}
1365/// Errors returned by GetEnrollmentStatus
1366#[derive(Debug, PartialEq)]
1367pub enum GetEnrollmentStatusError {
1368    /// <p>You do not have sufficient access to perform this action.</p>
1369    AccessDenied(String),
1370    /// <p>An internal error has occurred. Try your call again.</p>
1371    InternalServer(String),
1372    /// <p>An invalid or out-of-range value was supplied for the input parameter.</p>
1373    InvalidParameterValue(String),
1374    /// <p>The request must contain either a valid (registered) AWS access key ID or X.509 certificate.</p>
1375    MissingAuthenticationToken(String),
1376    /// <p>The request has failed due to a temporary failure of the server.</p>
1377    ServiceUnavailable(String),
1378    /// <p>The request was denied due to request throttling.</p>
1379    Throttling(String),
1380}
1381
1382impl GetEnrollmentStatusError {
1383    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetEnrollmentStatusError> {
1384        if let Some(err) = proto::json::Error::parse(&res) {
1385            match err.typ.as_str() {
1386                "AccessDeniedException" => {
1387                    return RusotoError::Service(GetEnrollmentStatusError::AccessDenied(err.msg))
1388                }
1389                "InternalServerException" => {
1390                    return RusotoError::Service(GetEnrollmentStatusError::InternalServer(err.msg))
1391                }
1392                "InvalidParameterValueException" => {
1393                    return RusotoError::Service(GetEnrollmentStatusError::InvalidParameterValue(
1394                        err.msg,
1395                    ))
1396                }
1397                "MissingAuthenticationToken" => {
1398                    return RusotoError::Service(
1399                        GetEnrollmentStatusError::MissingAuthenticationToken(err.msg),
1400                    )
1401                }
1402                "ServiceUnavailableException" => {
1403                    return RusotoError::Service(GetEnrollmentStatusError::ServiceUnavailable(
1404                        err.msg,
1405                    ))
1406                }
1407                "ThrottlingException" => {
1408                    return RusotoError::Service(GetEnrollmentStatusError::Throttling(err.msg))
1409                }
1410                "ValidationException" => return RusotoError::Validation(err.msg),
1411                _ => {}
1412            }
1413        }
1414        RusotoError::Unknown(res)
1415    }
1416}
1417impl fmt::Display for GetEnrollmentStatusError {
1418    #[allow(unused_variables)]
1419    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1420        match *self {
1421            GetEnrollmentStatusError::AccessDenied(ref cause) => write!(f, "{}", cause),
1422            GetEnrollmentStatusError::InternalServer(ref cause) => write!(f, "{}", cause),
1423            GetEnrollmentStatusError::InvalidParameterValue(ref cause) => write!(f, "{}", cause),
1424            GetEnrollmentStatusError::MissingAuthenticationToken(ref cause) => {
1425                write!(f, "{}", cause)
1426            }
1427            GetEnrollmentStatusError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1428            GetEnrollmentStatusError::Throttling(ref cause) => write!(f, "{}", cause),
1429        }
1430    }
1431}
1432impl Error for GetEnrollmentStatusError {}
1433/// Errors returned by GetRecommendationSummaries
1434#[derive(Debug, PartialEq)]
1435pub enum GetRecommendationSummariesError {
1436    /// <p>You do not have sufficient access to perform this action.</p>
1437    AccessDenied(String),
1438    /// <p>An internal error has occurred. Try your call again.</p>
1439    InternalServer(String),
1440    /// <p>An invalid or out-of-range value was supplied for the input parameter.</p>
1441    InvalidParameterValue(String),
1442    /// <p>The request must contain either a valid (registered) AWS access key ID or X.509 certificate.</p>
1443    MissingAuthenticationToken(String),
1444    /// <p>The account is not opted in to AWS Compute Optimizer.</p>
1445    OptInRequired(String),
1446    /// <p>The request has failed due to a temporary failure of the server.</p>
1447    ServiceUnavailable(String),
1448    /// <p>The request was denied due to request throttling.</p>
1449    Throttling(String),
1450}
1451
1452impl GetRecommendationSummariesError {
1453    pub fn from_response(
1454        res: BufferedHttpResponse,
1455    ) -> RusotoError<GetRecommendationSummariesError> {
1456        if let Some(err) = proto::json::Error::parse(&res) {
1457            match err.typ.as_str() {
1458                "AccessDeniedException" => {
1459                    return RusotoError::Service(GetRecommendationSummariesError::AccessDenied(
1460                        err.msg,
1461                    ))
1462                }
1463                "InternalServerException" => {
1464                    return RusotoError::Service(GetRecommendationSummariesError::InternalServer(
1465                        err.msg,
1466                    ))
1467                }
1468                "InvalidParameterValueException" => {
1469                    return RusotoError::Service(
1470                        GetRecommendationSummariesError::InvalidParameterValue(err.msg),
1471                    )
1472                }
1473                "MissingAuthenticationToken" => {
1474                    return RusotoError::Service(
1475                        GetRecommendationSummariesError::MissingAuthenticationToken(err.msg),
1476                    )
1477                }
1478                "OptInRequiredException" => {
1479                    return RusotoError::Service(GetRecommendationSummariesError::OptInRequired(
1480                        err.msg,
1481                    ))
1482                }
1483                "ServiceUnavailableException" => {
1484                    return RusotoError::Service(
1485                        GetRecommendationSummariesError::ServiceUnavailable(err.msg),
1486                    )
1487                }
1488                "ThrottlingException" => {
1489                    return RusotoError::Service(GetRecommendationSummariesError::Throttling(
1490                        err.msg,
1491                    ))
1492                }
1493                "ValidationException" => return RusotoError::Validation(err.msg),
1494                _ => {}
1495            }
1496        }
1497        RusotoError::Unknown(res)
1498    }
1499}
1500impl fmt::Display for GetRecommendationSummariesError {
1501    #[allow(unused_variables)]
1502    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1503        match *self {
1504            GetRecommendationSummariesError::AccessDenied(ref cause) => write!(f, "{}", cause),
1505            GetRecommendationSummariesError::InternalServer(ref cause) => write!(f, "{}", cause),
1506            GetRecommendationSummariesError::InvalidParameterValue(ref cause) => {
1507                write!(f, "{}", cause)
1508            }
1509            GetRecommendationSummariesError::MissingAuthenticationToken(ref cause) => {
1510                write!(f, "{}", cause)
1511            }
1512            GetRecommendationSummariesError::OptInRequired(ref cause) => write!(f, "{}", cause),
1513            GetRecommendationSummariesError::ServiceUnavailable(ref cause) => {
1514                write!(f, "{}", cause)
1515            }
1516            GetRecommendationSummariesError::Throttling(ref cause) => write!(f, "{}", cause),
1517        }
1518    }
1519}
1520impl Error for GetRecommendationSummariesError {}
1521/// Errors returned by UpdateEnrollmentStatus
1522#[derive(Debug, PartialEq)]
1523pub enum UpdateEnrollmentStatusError {
1524    /// <p>You do not have sufficient access to perform this action.</p>
1525    AccessDenied(String),
1526    /// <p>An internal error has occurred. Try your call again.</p>
1527    InternalServer(String),
1528    /// <p>An invalid or out-of-range value was supplied for the input parameter.</p>
1529    InvalidParameterValue(String),
1530    /// <p>The request must contain either a valid (registered) AWS access key ID or X.509 certificate.</p>
1531    MissingAuthenticationToken(String),
1532    /// <p>The request has failed due to a temporary failure of the server.</p>
1533    ServiceUnavailable(String),
1534    /// <p>The request was denied due to request throttling.</p>
1535    Throttling(String),
1536}
1537
1538impl UpdateEnrollmentStatusError {
1539    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateEnrollmentStatusError> {
1540        if let Some(err) = proto::json::Error::parse(&res) {
1541            match err.typ.as_str() {
1542                "AccessDeniedException" => {
1543                    return RusotoError::Service(UpdateEnrollmentStatusError::AccessDenied(err.msg))
1544                }
1545                "InternalServerException" => {
1546                    return RusotoError::Service(UpdateEnrollmentStatusError::InternalServer(
1547                        err.msg,
1548                    ))
1549                }
1550                "InvalidParameterValueException" => {
1551                    return RusotoError::Service(
1552                        UpdateEnrollmentStatusError::InvalidParameterValue(err.msg),
1553                    )
1554                }
1555                "MissingAuthenticationToken" => {
1556                    return RusotoError::Service(
1557                        UpdateEnrollmentStatusError::MissingAuthenticationToken(err.msg),
1558                    )
1559                }
1560                "ServiceUnavailableException" => {
1561                    return RusotoError::Service(UpdateEnrollmentStatusError::ServiceUnavailable(
1562                        err.msg,
1563                    ))
1564                }
1565                "ThrottlingException" => {
1566                    return RusotoError::Service(UpdateEnrollmentStatusError::Throttling(err.msg))
1567                }
1568                "ValidationException" => return RusotoError::Validation(err.msg),
1569                _ => {}
1570            }
1571        }
1572        RusotoError::Unknown(res)
1573    }
1574}
1575impl fmt::Display for UpdateEnrollmentStatusError {
1576    #[allow(unused_variables)]
1577    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1578        match *self {
1579            UpdateEnrollmentStatusError::AccessDenied(ref cause) => write!(f, "{}", cause),
1580            UpdateEnrollmentStatusError::InternalServer(ref cause) => write!(f, "{}", cause),
1581            UpdateEnrollmentStatusError::InvalidParameterValue(ref cause) => write!(f, "{}", cause),
1582            UpdateEnrollmentStatusError::MissingAuthenticationToken(ref cause) => {
1583                write!(f, "{}", cause)
1584            }
1585            UpdateEnrollmentStatusError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1586            UpdateEnrollmentStatusError::Throttling(ref cause) => write!(f, "{}", cause),
1587        }
1588    }
1589}
1590impl Error for UpdateEnrollmentStatusError {}
1591/// Trait representing the capabilities of the AWS Compute Optimizer API. AWS Compute Optimizer clients implement this trait.
1592#[async_trait]
1593pub trait ComputeOptimizer {
1594    /// <p>Describes recommendation export jobs created in the last seven days.</p> <p>Use the <code>ExportAutoScalingGroupRecommendations</code> or <code>ExportEC2InstanceRecommendations</code> actions to request an export of your recommendations. Then use the <code>DescribeRecommendationExportJobs</code> action to view your export jobs.</p>
1595    async fn describe_recommendation_export_jobs(
1596        &self,
1597        input: DescribeRecommendationExportJobsRequest,
1598    ) -> Result<
1599        DescribeRecommendationExportJobsResponse,
1600        RusotoError<DescribeRecommendationExportJobsError>,
1601    >;
1602
1603    /// <p>Exports optimization recommendations for Auto Scaling groups.</p> <p>Recommendations are exported in a comma-separated values (.csv) file, and its metadata in a JavaScript Object Notation (.json) file, to an existing Amazon Simple Storage Service (Amazon S3) bucket that you specify. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/exporting-recommendations.html">Exporting Recommendations</a> in the <i>Compute Optimizer User Guide</i>.</p> <p>You can have only one Auto Scaling group export job in progress per AWS Region.</p>
1604    async fn export_auto_scaling_group_recommendations(
1605        &self,
1606        input: ExportAutoScalingGroupRecommendationsRequest,
1607    ) -> Result<
1608        ExportAutoScalingGroupRecommendationsResponse,
1609        RusotoError<ExportAutoScalingGroupRecommendationsError>,
1610    >;
1611
1612    /// <p>Exports optimization recommendations for Amazon EC2 instances.</p> <p>Recommendations are exported in a comma-separated values (.csv) file, and its metadata in a JavaScript Object Notation (.json) file, to an existing Amazon Simple Storage Service (Amazon S3) bucket that you specify. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/exporting-recommendations.html">Exporting Recommendations</a> in the <i>Compute Optimizer User Guide</i>.</p> <p>You can have only one Amazon EC2 instance export job in progress per AWS Region.</p>
1613    async fn export_ec2_instance_recommendations(
1614        &self,
1615        input: ExportEC2InstanceRecommendationsRequest,
1616    ) -> Result<
1617        ExportEC2InstanceRecommendationsResponse,
1618        RusotoError<ExportEC2InstanceRecommendationsError>,
1619    >;
1620
1621    /// <p>Returns Auto Scaling group recommendations.</p> <p>AWS Compute Optimizer currently generates recommendations for Auto Scaling groups that are configured to run instances of the M, C, R, T, and X instance families. The service does not generate recommendations for Auto Scaling groups that have a scaling policy attached to them, or that do not have the same values for desired, minimum, and maximum capacity. In order for Compute Optimizer to analyze your Auto Scaling groups, they must be of a fixed size. For more information, see the <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/what-is.html">AWS Compute Optimizer User Guide</a>.</p>
1622    async fn get_auto_scaling_group_recommendations(
1623        &self,
1624        input: GetAutoScalingGroupRecommendationsRequest,
1625    ) -> Result<
1626        GetAutoScalingGroupRecommendationsResponse,
1627        RusotoError<GetAutoScalingGroupRecommendationsError>,
1628    >;
1629
1630    /// <p>Returns Amazon EC2 instance recommendations.</p> <p>AWS Compute Optimizer currently generates recommendations for Amazon Elastic Compute Cloud (Amazon EC2) and Amazon EC2 Auto Scaling. It generates recommendations for M, C, R, T, and X instance families. For more information, see the <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/what-is.html">AWS Compute Optimizer User Guide</a>.</p>
1631    async fn get_ec2_instance_recommendations(
1632        &self,
1633        input: GetEC2InstanceRecommendationsRequest,
1634    ) -> Result<
1635        GetEC2InstanceRecommendationsResponse,
1636        RusotoError<GetEC2InstanceRecommendationsError>,
1637    >;
1638
1639    /// <p>Returns the projected utilization metrics of Amazon EC2 instance recommendations.</p>
1640    async fn get_ec2_recommendation_projected_metrics(
1641        &self,
1642        input: GetEC2RecommendationProjectedMetricsRequest,
1643    ) -> Result<
1644        GetEC2RecommendationProjectedMetricsResponse,
1645        RusotoError<GetEC2RecommendationProjectedMetricsError>,
1646    >;
1647
1648    /// <p>Returns the enrollment (opt in) status of an account to the AWS Compute Optimizer service.</p> <p>If the account is the master account of an organization, this action also confirms the enrollment status of member accounts within the organization.</p>
1649    async fn get_enrollment_status(
1650        &self,
1651    ) -> Result<GetEnrollmentStatusResponse, RusotoError<GetEnrollmentStatusError>>;
1652
1653    /// <p>Returns the optimization findings for an account.</p> <p>For example, it returns the number of Amazon EC2 instances in an account that are under-provisioned, over-provisioned, or optimized. It also returns the number of Auto Scaling groups in an account that are not optimized, or optimized.</p>
1654    async fn get_recommendation_summaries(
1655        &self,
1656        input: GetRecommendationSummariesRequest,
1657    ) -> Result<GetRecommendationSummariesResponse, RusotoError<GetRecommendationSummariesError>>;
1658
1659    /// <p>Updates the enrollment (opt in) status of an account to the AWS Compute Optimizer service.</p> <p>If the account is a master account of an organization, this action can also be used to enroll member accounts within the organization.</p>
1660    async fn update_enrollment_status(
1661        &self,
1662        input: UpdateEnrollmentStatusRequest,
1663    ) -> Result<UpdateEnrollmentStatusResponse, RusotoError<UpdateEnrollmentStatusError>>;
1664}
1665/// A client for the AWS Compute Optimizer API.
1666#[derive(Clone)]
1667pub struct ComputeOptimizerClient {
1668    client: Client,
1669    region: region::Region,
1670}
1671
1672impl ComputeOptimizerClient {
1673    /// Creates a client backed by the default tokio event loop.
1674    ///
1675    /// The client will use the default credentials provider and tls client.
1676    pub fn new(region: region::Region) -> ComputeOptimizerClient {
1677        ComputeOptimizerClient {
1678            client: Client::shared(),
1679            region,
1680        }
1681    }
1682
1683    pub fn new_with<P, D>(
1684        request_dispatcher: D,
1685        credentials_provider: P,
1686        region: region::Region,
1687    ) -> ComputeOptimizerClient
1688    where
1689        P: ProvideAwsCredentials + Send + Sync + 'static,
1690        D: DispatchSignedRequest + Send + Sync + 'static,
1691    {
1692        ComputeOptimizerClient {
1693            client: Client::new_with(credentials_provider, request_dispatcher),
1694            region,
1695        }
1696    }
1697
1698    pub fn new_with_client(client: Client, region: region::Region) -> ComputeOptimizerClient {
1699        ComputeOptimizerClient { client, region }
1700    }
1701}
1702
1703#[async_trait]
1704impl ComputeOptimizer for ComputeOptimizerClient {
1705    /// <p>Describes recommendation export jobs created in the last seven days.</p> <p>Use the <code>ExportAutoScalingGroupRecommendations</code> or <code>ExportEC2InstanceRecommendations</code> actions to request an export of your recommendations. Then use the <code>DescribeRecommendationExportJobs</code> action to view your export jobs.</p>
1706    async fn describe_recommendation_export_jobs(
1707        &self,
1708        input: DescribeRecommendationExportJobsRequest,
1709    ) -> Result<
1710        DescribeRecommendationExportJobsResponse,
1711        RusotoError<DescribeRecommendationExportJobsError>,
1712    > {
1713        let mut request = self.new_signed_request("POST", "/");
1714        request.add_header(
1715            "x-amz-target",
1716            "ComputeOptimizerService.DescribeRecommendationExportJobs",
1717        );
1718        let encoded = serde_json::to_string(&input).unwrap();
1719        request.set_payload(Some(encoded));
1720
1721        let response = self
1722            .sign_and_dispatch(
1723                request,
1724                DescribeRecommendationExportJobsError::from_response,
1725            )
1726            .await?;
1727        let mut response = response;
1728        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1729        proto::json::ResponsePayload::new(&response)
1730            .deserialize::<DescribeRecommendationExportJobsResponse, _>()
1731    }
1732
1733    /// <p>Exports optimization recommendations for Auto Scaling groups.</p> <p>Recommendations are exported in a comma-separated values (.csv) file, and its metadata in a JavaScript Object Notation (.json) file, to an existing Amazon Simple Storage Service (Amazon S3) bucket that you specify. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/exporting-recommendations.html">Exporting Recommendations</a> in the <i>Compute Optimizer User Guide</i>.</p> <p>You can have only one Auto Scaling group export job in progress per AWS Region.</p>
1734    async fn export_auto_scaling_group_recommendations(
1735        &self,
1736        input: ExportAutoScalingGroupRecommendationsRequest,
1737    ) -> Result<
1738        ExportAutoScalingGroupRecommendationsResponse,
1739        RusotoError<ExportAutoScalingGroupRecommendationsError>,
1740    > {
1741        let mut request = self.new_signed_request("POST", "/");
1742        request.add_header(
1743            "x-amz-target",
1744            "ComputeOptimizerService.ExportAutoScalingGroupRecommendations",
1745        );
1746        let encoded = serde_json::to_string(&input).unwrap();
1747        request.set_payload(Some(encoded));
1748
1749        let response = self
1750            .sign_and_dispatch(
1751                request,
1752                ExportAutoScalingGroupRecommendationsError::from_response,
1753            )
1754            .await?;
1755        let mut response = response;
1756        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1757        proto::json::ResponsePayload::new(&response)
1758            .deserialize::<ExportAutoScalingGroupRecommendationsResponse, _>()
1759    }
1760
1761    /// <p>Exports optimization recommendations for Amazon EC2 instances.</p> <p>Recommendations are exported in a comma-separated values (.csv) file, and its metadata in a JavaScript Object Notation (.json) file, to an existing Amazon Simple Storage Service (Amazon S3) bucket that you specify. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/exporting-recommendations.html">Exporting Recommendations</a> in the <i>Compute Optimizer User Guide</i>.</p> <p>You can have only one Amazon EC2 instance export job in progress per AWS Region.</p>
1762    async fn export_ec2_instance_recommendations(
1763        &self,
1764        input: ExportEC2InstanceRecommendationsRequest,
1765    ) -> Result<
1766        ExportEC2InstanceRecommendationsResponse,
1767        RusotoError<ExportEC2InstanceRecommendationsError>,
1768    > {
1769        let mut request = self.new_signed_request("POST", "/");
1770        request.add_header(
1771            "x-amz-target",
1772            "ComputeOptimizerService.ExportEC2InstanceRecommendations",
1773        );
1774        let encoded = serde_json::to_string(&input).unwrap();
1775        request.set_payload(Some(encoded));
1776
1777        let response = self
1778            .sign_and_dispatch(
1779                request,
1780                ExportEC2InstanceRecommendationsError::from_response,
1781            )
1782            .await?;
1783        let mut response = response;
1784        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1785        proto::json::ResponsePayload::new(&response)
1786            .deserialize::<ExportEC2InstanceRecommendationsResponse, _>()
1787    }
1788
1789    /// <p>Returns Auto Scaling group recommendations.</p> <p>AWS Compute Optimizer currently generates recommendations for Auto Scaling groups that are configured to run instances of the M, C, R, T, and X instance families. The service does not generate recommendations for Auto Scaling groups that have a scaling policy attached to them, or that do not have the same values for desired, minimum, and maximum capacity. In order for Compute Optimizer to analyze your Auto Scaling groups, they must be of a fixed size. For more information, see the <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/what-is.html">AWS Compute Optimizer User Guide</a>.</p>
1790    async fn get_auto_scaling_group_recommendations(
1791        &self,
1792        input: GetAutoScalingGroupRecommendationsRequest,
1793    ) -> Result<
1794        GetAutoScalingGroupRecommendationsResponse,
1795        RusotoError<GetAutoScalingGroupRecommendationsError>,
1796    > {
1797        let mut request = self.new_signed_request("POST", "/");
1798        request.add_header(
1799            "x-amz-target",
1800            "ComputeOptimizerService.GetAutoScalingGroupRecommendations",
1801        );
1802        let encoded = serde_json::to_string(&input).unwrap();
1803        request.set_payload(Some(encoded));
1804
1805        let response = self
1806            .sign_and_dispatch(
1807                request,
1808                GetAutoScalingGroupRecommendationsError::from_response,
1809            )
1810            .await?;
1811        let mut response = response;
1812        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1813        proto::json::ResponsePayload::new(&response)
1814            .deserialize::<GetAutoScalingGroupRecommendationsResponse, _>()
1815    }
1816
1817    /// <p>Returns Amazon EC2 instance recommendations.</p> <p>AWS Compute Optimizer currently generates recommendations for Amazon Elastic Compute Cloud (Amazon EC2) and Amazon EC2 Auto Scaling. It generates recommendations for M, C, R, T, and X instance families. For more information, see the <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/what-is.html">AWS Compute Optimizer User Guide</a>.</p>
1818    async fn get_ec2_instance_recommendations(
1819        &self,
1820        input: GetEC2InstanceRecommendationsRequest,
1821    ) -> Result<
1822        GetEC2InstanceRecommendationsResponse,
1823        RusotoError<GetEC2InstanceRecommendationsError>,
1824    > {
1825        let mut request = self.new_signed_request("POST", "/");
1826        request.add_header(
1827            "x-amz-target",
1828            "ComputeOptimizerService.GetEC2InstanceRecommendations",
1829        );
1830        let encoded = serde_json::to_string(&input).unwrap();
1831        request.set_payload(Some(encoded));
1832
1833        let response = self
1834            .sign_and_dispatch(request, GetEC2InstanceRecommendationsError::from_response)
1835            .await?;
1836        let mut response = response;
1837        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1838        proto::json::ResponsePayload::new(&response)
1839            .deserialize::<GetEC2InstanceRecommendationsResponse, _>()
1840    }
1841
1842    /// <p>Returns the projected utilization metrics of Amazon EC2 instance recommendations.</p>
1843    async fn get_ec2_recommendation_projected_metrics(
1844        &self,
1845        input: GetEC2RecommendationProjectedMetricsRequest,
1846    ) -> Result<
1847        GetEC2RecommendationProjectedMetricsResponse,
1848        RusotoError<GetEC2RecommendationProjectedMetricsError>,
1849    > {
1850        let mut request = self.new_signed_request("POST", "/");
1851        request.add_header(
1852            "x-amz-target",
1853            "ComputeOptimizerService.GetEC2RecommendationProjectedMetrics",
1854        );
1855        let encoded = serde_json::to_string(&input).unwrap();
1856        request.set_payload(Some(encoded));
1857
1858        let response = self
1859            .sign_and_dispatch(
1860                request,
1861                GetEC2RecommendationProjectedMetricsError::from_response,
1862            )
1863            .await?;
1864        let mut response = response;
1865        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1866        proto::json::ResponsePayload::new(&response)
1867            .deserialize::<GetEC2RecommendationProjectedMetricsResponse, _>()
1868    }
1869
1870    /// <p>Returns the enrollment (opt in) status of an account to the AWS Compute Optimizer service.</p> <p>If the account is the master account of an organization, this action also confirms the enrollment status of member accounts within the organization.</p>
1871    async fn get_enrollment_status(
1872        &self,
1873    ) -> Result<GetEnrollmentStatusResponse, RusotoError<GetEnrollmentStatusError>> {
1874        let mut request = self.new_signed_request("POST", "/");
1875        request.add_header(
1876            "x-amz-target",
1877            "ComputeOptimizerService.GetEnrollmentStatus",
1878        );
1879        request.set_payload(Some(bytes::Bytes::from_static(b"{}")));
1880
1881        let response = self
1882            .sign_and_dispatch(request, GetEnrollmentStatusError::from_response)
1883            .await?;
1884        let mut response = response;
1885        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1886        proto::json::ResponsePayload::new(&response).deserialize::<GetEnrollmentStatusResponse, _>()
1887    }
1888
1889    /// <p>Returns the optimization findings for an account.</p> <p>For example, it returns the number of Amazon EC2 instances in an account that are under-provisioned, over-provisioned, or optimized. It also returns the number of Auto Scaling groups in an account that are not optimized, or optimized.</p>
1890    async fn get_recommendation_summaries(
1891        &self,
1892        input: GetRecommendationSummariesRequest,
1893    ) -> Result<GetRecommendationSummariesResponse, RusotoError<GetRecommendationSummariesError>>
1894    {
1895        let mut request = self.new_signed_request("POST", "/");
1896        request.add_header(
1897            "x-amz-target",
1898            "ComputeOptimizerService.GetRecommendationSummaries",
1899        );
1900        let encoded = serde_json::to_string(&input).unwrap();
1901        request.set_payload(Some(encoded));
1902
1903        let response = self
1904            .sign_and_dispatch(request, GetRecommendationSummariesError::from_response)
1905            .await?;
1906        let mut response = response;
1907        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1908        proto::json::ResponsePayload::new(&response)
1909            .deserialize::<GetRecommendationSummariesResponse, _>()
1910    }
1911
1912    /// <p>Updates the enrollment (opt in) status of an account to the AWS Compute Optimizer service.</p> <p>If the account is a master account of an organization, this action can also be used to enroll member accounts within the organization.</p>
1913    async fn update_enrollment_status(
1914        &self,
1915        input: UpdateEnrollmentStatusRequest,
1916    ) -> Result<UpdateEnrollmentStatusResponse, RusotoError<UpdateEnrollmentStatusError>> {
1917        let mut request = self.new_signed_request("POST", "/");
1918        request.add_header(
1919            "x-amz-target",
1920            "ComputeOptimizerService.UpdateEnrollmentStatus",
1921        );
1922        let encoded = serde_json::to_string(&input).unwrap();
1923        request.set_payload(Some(encoded));
1924
1925        let response = self
1926            .sign_and_dispatch(request, UpdateEnrollmentStatusError::from_response)
1927            .await?;
1928        let mut response = response;
1929        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1930        proto::json::ResponsePayload::new(&response)
1931            .deserialize::<UpdateEnrollmentStatusResponse, _>()
1932    }
1933}