aws_sdk_computeoptimizer/operation/export_auto_scaling_group_recommendations/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::export_auto_scaling_group_recommendations::_export_auto_scaling_group_recommendations_output::ExportAutoScalingGroupRecommendationsOutputBuilder;
3
4pub use crate::operation::export_auto_scaling_group_recommendations::_export_auto_scaling_group_recommendations_input::ExportAutoScalingGroupRecommendationsInputBuilder;
5
6impl crate::operation::export_auto_scaling_group_recommendations::builders::ExportAutoScalingGroupRecommendationsInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::export_auto_scaling_group_recommendations::ExportAutoScalingGroupRecommendationsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::export_auto_scaling_group_recommendations::ExportAutoScalingGroupRecommendationsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.export_auto_scaling_group_recommendations();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ExportAutoScalingGroupRecommendations`.
24///
25/// <p>Exports optimization recommendations for Auto Scaling groups.</p>
26/// <p>Recommendations are exported in a comma-separated values (.csv) file, and its metadata in a JavaScript Object Notation (JSON) (.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>
27/// <p>You can have only one Auto Scaling group export job in progress per Amazon Web Services Region.</p>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct ExportAutoScalingGroupRecommendationsFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::export_auto_scaling_group_recommendations::builders::ExportAutoScalingGroupRecommendationsInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::export_auto_scaling_group_recommendations::ExportAutoScalingGroupRecommendationsOutput,
37        crate::operation::export_auto_scaling_group_recommendations::ExportAutoScalingGroupRecommendationsError,
38    > for ExportAutoScalingGroupRecommendationsFluentBuilder
39{
40    fn send(
41        self,
42        config_override: crate::config::Builder,
43    ) -> crate::client::customize::internal::BoxFuture<
44        crate::client::customize::internal::SendResult<
45            crate::operation::export_auto_scaling_group_recommendations::ExportAutoScalingGroupRecommendationsOutput,
46            crate::operation::export_auto_scaling_group_recommendations::ExportAutoScalingGroupRecommendationsError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl ExportAutoScalingGroupRecommendationsFluentBuilder {
53    /// Creates a new `ExportAutoScalingGroupRecommendationsFluentBuilder`.
54    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55        Self {
56            handle,
57            inner: ::std::default::Default::default(),
58            config_override: ::std::option::Option::None,
59        }
60    }
61    /// Access the ExportAutoScalingGroupRecommendations as a reference.
62    pub fn as_input(
63        &self,
64    ) -> &crate::operation::export_auto_scaling_group_recommendations::builders::ExportAutoScalingGroupRecommendationsInputBuilder {
65        &self.inner
66    }
67    /// Sends the request and returns the response.
68    ///
69    /// If an error occurs, an `SdkError` will be returned with additional details that
70    /// can be matched against.
71    ///
72    /// By default, any retryable failures will be retried twice. Retry behavior
73    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
74    /// set when configuring the client.
75    pub async fn send(
76        self,
77    ) -> ::std::result::Result<
78        crate::operation::export_auto_scaling_group_recommendations::ExportAutoScalingGroupRecommendationsOutput,
79        ::aws_smithy_runtime_api::client::result::SdkError<
80            crate::operation::export_auto_scaling_group_recommendations::ExportAutoScalingGroupRecommendationsError,
81            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
82        >,
83    > {
84        let input = self
85            .inner
86            .build()
87            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
88        let runtime_plugins =
89            crate::operation::export_auto_scaling_group_recommendations::ExportAutoScalingGroupRecommendations::operation_runtime_plugins(
90                self.handle.runtime_plugins.clone(),
91                &self.handle.conf,
92                self.config_override,
93            );
94        crate::operation::export_auto_scaling_group_recommendations::ExportAutoScalingGroupRecommendations::orchestrate(&runtime_plugins, input).await
95    }
96
97    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98    pub fn customize(
99        self,
100    ) -> crate::client::customize::CustomizableOperation<
101        crate::operation::export_auto_scaling_group_recommendations::ExportAutoScalingGroupRecommendationsOutput,
102        crate::operation::export_auto_scaling_group_recommendations::ExportAutoScalingGroupRecommendationsError,
103        Self,
104    > {
105        crate::client::customize::CustomizableOperation::new(self)
106    }
107    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108        self.set_config_override(::std::option::Option::Some(config_override.into()));
109        self
110    }
111
112    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113        self.config_override = config_override;
114        self
115    }
116    ///
117    /// Appends an item to `accountIds`.
118    ///
119    /// To override the contents of this collection use [`set_account_ids`](Self::set_account_ids).
120    ///
121    /// <p>The IDs of the Amazon Web Services accounts for which to export Auto Scaling group recommendations.</p>
122    /// <p>If your account is the management account of an organization, use this parameter to specify the member account for which you want to export recommendations.</p>
123    /// <p>This parameter cannot be specified together with the include member accounts parameter. The parameters are mutually exclusive.</p>
124    /// <p>Recommendations for member accounts are not included in the export if this parameter, or the include member accounts parameter, is omitted.</p>
125    /// <p>You can specify multiple account IDs per request.</p>
126    pub fn account_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.account_ids(input.into());
128        self
129    }
130    /// <p>The IDs of the Amazon Web Services accounts for which to export Auto Scaling group recommendations.</p>
131    /// <p>If your account is the management account of an organization, use this parameter to specify the member account for which you want to export recommendations.</p>
132    /// <p>This parameter cannot be specified together with the include member accounts parameter. The parameters are mutually exclusive.</p>
133    /// <p>Recommendations for member accounts are not included in the export if this parameter, or the include member accounts parameter, is omitted.</p>
134    /// <p>You can specify multiple account IDs per request.</p>
135    pub fn set_account_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
136        self.inner = self.inner.set_account_ids(input);
137        self
138    }
139    /// <p>The IDs of the Amazon Web Services accounts for which to export Auto Scaling group recommendations.</p>
140    /// <p>If your account is the management account of an organization, use this parameter to specify the member account for which you want to export recommendations.</p>
141    /// <p>This parameter cannot be specified together with the include member accounts parameter. The parameters are mutually exclusive.</p>
142    /// <p>Recommendations for member accounts are not included in the export if this parameter, or the include member accounts parameter, is omitted.</p>
143    /// <p>You can specify multiple account IDs per request.</p>
144    pub fn get_account_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
145        self.inner.get_account_ids()
146    }
147    ///
148    /// Appends an item to `filters`.
149    ///
150    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
151    ///
152    /// <p>An array of objects to specify a filter that exports a more specific set of Auto Scaling group recommendations.</p>
153    pub fn filters(mut self, input: crate::types::Filter) -> Self {
154        self.inner = self.inner.filters(input);
155        self
156    }
157    /// <p>An array of objects to specify a filter that exports a more specific set of Auto Scaling group recommendations.</p>
158    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
159        self.inner = self.inner.set_filters(input);
160        self
161    }
162    /// <p>An array of objects to specify a filter that exports a more specific set of Auto Scaling group recommendations.</p>
163    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
164        self.inner.get_filters()
165    }
166    ///
167    /// Appends an item to `fieldsToExport`.
168    ///
169    /// To override the contents of this collection use [`set_fields_to_export`](Self::set_fields_to_export).
170    ///
171    /// <p>The recommendations data to include in the export file. For more information about the fields that can be exported, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/exporting-recommendations.html#exported-files">Exported files</a> in the <i>Compute Optimizer User Guide</i>.</p>
172    pub fn fields_to_export(mut self, input: crate::types::ExportableAutoScalingGroupField) -> Self {
173        self.inner = self.inner.fields_to_export(input);
174        self
175    }
176    /// <p>The recommendations data to include in the export file. For more information about the fields that can be exported, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/exporting-recommendations.html#exported-files">Exported files</a> in the <i>Compute Optimizer User Guide</i>.</p>
177    pub fn set_fields_to_export(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ExportableAutoScalingGroupField>>) -> Self {
178        self.inner = self.inner.set_fields_to_export(input);
179        self
180    }
181    /// <p>The recommendations data to include in the export file. For more information about the fields that can be exported, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/exporting-recommendations.html#exported-files">Exported files</a> in the <i>Compute Optimizer User Guide</i>.</p>
182    pub fn get_fields_to_export(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ExportableAutoScalingGroupField>> {
183        self.inner.get_fields_to_export()
184    }
185    /// <p>An object to specify the destination Amazon Simple Storage Service (Amazon S3) bucket name and key prefix for the export job.</p>
186    /// <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 permissions 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>
187    pub fn s3_destination_config(mut self, input: crate::types::S3DestinationConfig) -> Self {
188        self.inner = self.inner.s3_destination_config(input);
189        self
190    }
191    /// <p>An object to specify the destination Amazon Simple Storage Service (Amazon S3) bucket name and key prefix for the export job.</p>
192    /// <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 permissions 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>
193    pub fn set_s3_destination_config(mut self, input: ::std::option::Option<crate::types::S3DestinationConfig>) -> Self {
194        self.inner = self.inner.set_s3_destination_config(input);
195        self
196    }
197    /// <p>An object to specify the destination Amazon Simple Storage Service (Amazon S3) bucket name and key prefix for the export job.</p>
198    /// <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 permissions 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>
199    pub fn get_s3_destination_config(&self) -> &::std::option::Option<crate::types::S3DestinationConfig> {
200        self.inner.get_s3_destination_config()
201    }
202    /// <p>The format of the export file.</p>
203    /// <p>The only export file format currently supported is <code>Csv</code>.</p>
204    pub fn file_format(mut self, input: crate::types::FileFormat) -> Self {
205        self.inner = self.inner.file_format(input);
206        self
207    }
208    /// <p>The format of the export file.</p>
209    /// <p>The only export file format currently supported is <code>Csv</code>.</p>
210    pub fn set_file_format(mut self, input: ::std::option::Option<crate::types::FileFormat>) -> Self {
211        self.inner = self.inner.set_file_format(input);
212        self
213    }
214    /// <p>The format of the export file.</p>
215    /// <p>The only export file format currently supported is <code>Csv</code>.</p>
216    pub fn get_file_format(&self) -> &::std::option::Option<crate::types::FileFormat> {
217        self.inner.get_file_format()
218    }
219    /// <p>Indicates whether to include recommendations for resources in all member accounts of the organization if your account is the management account of an organization.</p>
220    /// <p>The member accounts must also be opted in to Compute Optimizer, and trusted access for Compute Optimizer must be enabled in the organization account. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/security-iam.html#trusted-service-access">Compute Optimizer and Amazon Web Services Organizations trusted access</a> in the <i>Compute Optimizer User Guide</i>.</p>
221    /// <p>Recommendations for member accounts of the organization are not included in the export file if this parameter is omitted.</p>
222    /// <p>This parameter cannot be specified together with the account IDs parameter. The parameters are mutually exclusive.</p>
223    /// <p>Recommendations for member accounts are not included in the export if this parameter, or the account IDs parameter, is omitted.</p>
224    pub fn include_member_accounts(mut self, input: bool) -> Self {
225        self.inner = self.inner.include_member_accounts(input);
226        self
227    }
228    /// <p>Indicates whether to include recommendations for resources in all member accounts of the organization if your account is the management account of an organization.</p>
229    /// <p>The member accounts must also be opted in to Compute Optimizer, and trusted access for Compute Optimizer must be enabled in the organization account. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/security-iam.html#trusted-service-access">Compute Optimizer and Amazon Web Services Organizations trusted access</a> in the <i>Compute Optimizer User Guide</i>.</p>
230    /// <p>Recommendations for member accounts of the organization are not included in the export file if this parameter is omitted.</p>
231    /// <p>This parameter cannot be specified together with the account IDs parameter. The parameters are mutually exclusive.</p>
232    /// <p>Recommendations for member accounts are not included in the export if this parameter, or the account IDs parameter, is omitted.</p>
233    pub fn set_include_member_accounts(mut self, input: ::std::option::Option<bool>) -> Self {
234        self.inner = self.inner.set_include_member_accounts(input);
235        self
236    }
237    /// <p>Indicates whether to include recommendations for resources in all member accounts of the organization if your account is the management account of an organization.</p>
238    /// <p>The member accounts must also be opted in to Compute Optimizer, and trusted access for Compute Optimizer must be enabled in the organization account. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/security-iam.html#trusted-service-access">Compute Optimizer and Amazon Web Services Organizations trusted access</a> in the <i>Compute Optimizer User Guide</i>.</p>
239    /// <p>Recommendations for member accounts of the organization are not included in the export file if this parameter is omitted.</p>
240    /// <p>This parameter cannot be specified together with the account IDs parameter. The parameters are mutually exclusive.</p>
241    /// <p>Recommendations for member accounts are not included in the export if this parameter, or the account IDs parameter, is omitted.</p>
242    pub fn get_include_member_accounts(&self) -> &::std::option::Option<bool> {
243        self.inner.get_include_member_accounts()
244    }
245    /// <p>An object to specify the preferences for the Auto Scaling group recommendations to export.</p>
246    pub fn recommendation_preferences(mut self, input: crate::types::RecommendationPreferences) -> Self {
247        self.inner = self.inner.recommendation_preferences(input);
248        self
249    }
250    /// <p>An object to specify the preferences for the Auto Scaling group recommendations to export.</p>
251    pub fn set_recommendation_preferences(mut self, input: ::std::option::Option<crate::types::RecommendationPreferences>) -> Self {
252        self.inner = self.inner.set_recommendation_preferences(input);
253        self
254    }
255    /// <p>An object to specify the preferences for the Auto Scaling group recommendations to export.</p>
256    pub fn get_recommendation_preferences(&self) -> &::std::option::Option<crate::types::RecommendationPreferences> {
257        self.inner.get_recommendation_preferences()
258    }
259}