aws_sdk_computeoptimizer/operation/export_rds_database_recommendations/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::export_rds_database_recommendations::_export_rds_database_recommendations_output::ExportRdsDatabaseRecommendationsOutputBuilder;
3
4pub use crate::operation::export_rds_database_recommendations::_export_rds_database_recommendations_input::ExportRdsDatabaseRecommendationsInputBuilder;
5
6impl crate::operation::export_rds_database_recommendations::builders::ExportRdsDatabaseRecommendationsInputBuilder {
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_rds_database_recommendations::ExportRdsDatabaseRecommendationsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::export_rds_database_recommendations::ExportRDSDatabaseRecommendationsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.export_rds_database_recommendations();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ExportRDSDatabaseRecommendations`.
24///
25/// <p>Export optimization recommendations for your Amazon Aurora and Amazon Relational Database Service (Amazon RDS) databases.</p>
26/// <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>
27/// <p>You can have only one Amazon Aurora or RDS export job in progress per Amazon Web Services Region.</p>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct ExportRDSDatabaseRecommendationsFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::export_rds_database_recommendations::builders::ExportRdsDatabaseRecommendationsInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::export_rds_database_recommendations::ExportRdsDatabaseRecommendationsOutput,
37        crate::operation::export_rds_database_recommendations::ExportRDSDatabaseRecommendationsError,
38    > for ExportRDSDatabaseRecommendationsFluentBuilder
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_rds_database_recommendations::ExportRdsDatabaseRecommendationsOutput,
46            crate::operation::export_rds_database_recommendations::ExportRDSDatabaseRecommendationsError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl ExportRDSDatabaseRecommendationsFluentBuilder {
53    /// Creates a new `ExportRDSDatabaseRecommendationsFluentBuilder`.
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 ExportRDSDatabaseRecommendations as a reference.
62    pub fn as_input(&self) -> &crate::operation::export_rds_database_recommendations::builders::ExportRdsDatabaseRecommendationsInputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::export_rds_database_recommendations::ExportRdsDatabaseRecommendationsOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::export_rds_database_recommendations::ExportRDSDatabaseRecommendationsError,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins = crate::operation::export_rds_database_recommendations::ExportRDSDatabaseRecommendations::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::export_rds_database_recommendations::ExportRDSDatabaseRecommendations::orchestrate(&runtime_plugins, input).await
92    }
93
94    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95    pub fn customize(
96        self,
97    ) -> crate::client::customize::CustomizableOperation<
98        crate::operation::export_rds_database_recommendations::ExportRdsDatabaseRecommendationsOutput,
99        crate::operation::export_rds_database_recommendations::ExportRDSDatabaseRecommendationsError,
100        Self,
101    > {
102        crate::client::customize::CustomizableOperation::new(self)
103    }
104    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105        self.set_config_override(::std::option::Option::Some(config_override.into()));
106        self
107    }
108
109    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110        self.config_override = config_override;
111        self
112    }
113    ///
114    /// Appends an item to `accountIds`.
115    ///
116    /// To override the contents of this collection use [`set_account_ids`](Self::set_account_ids).
117    ///
118    /// <p>The Amazon Web Services account IDs for the export Amazon Aurora and RDS database recommendations.</p>
119    /// <p>If your account is the management account or the delegated administrator of an organization, use this parameter to specify the member account you want to export recommendations to.</p>
120    /// <p>This parameter can't be specified together with the include member accounts parameter. The parameters are mutually exclusive.</p>
121    /// <p>If this parameter or the include member accounts parameter is omitted, the recommendations for member accounts aren't included in the export.</p>
122    /// <p>You can specify multiple account IDs per request.</p>
123    pub fn account_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        self.inner = self.inner.account_ids(input.into());
125        self
126    }
127    /// <p>The Amazon Web Services account IDs for the export Amazon Aurora and RDS database recommendations.</p>
128    /// <p>If your account is the management account or the delegated administrator of an organization, use this parameter to specify the member account you want to export recommendations to.</p>
129    /// <p>This parameter can't be specified together with the include member accounts parameter. The parameters are mutually exclusive.</p>
130    /// <p>If this parameter or the include member accounts parameter is omitted, the recommendations for member accounts aren't included in the export.</p>
131    /// <p>You can specify multiple account IDs per request.</p>
132    pub fn set_account_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
133        self.inner = self.inner.set_account_ids(input);
134        self
135    }
136    /// <p>The Amazon Web Services account IDs for the export Amazon Aurora and RDS database recommendations.</p>
137    /// <p>If your account is the management account or the delegated administrator of an organization, use this parameter to specify the member account you want to export recommendations to.</p>
138    /// <p>This parameter can't be specified together with the include member accounts parameter. The parameters are mutually exclusive.</p>
139    /// <p>If this parameter or the include member accounts parameter is omitted, the recommendations for member accounts aren't included in the export.</p>
140    /// <p>You can specify multiple account IDs per request.</p>
141    pub fn get_account_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
142        self.inner.get_account_ids()
143    }
144    ///
145    /// Appends an item to `filters`.
146    ///
147    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
148    ///
149    /// <p>An array of objects to specify a filter that exports a more specific set of Amazon Aurora and RDS recommendations.</p>
150    pub fn filters(mut self, input: crate::types::RdsdbRecommendationFilter) -> Self {
151        self.inner = self.inner.filters(input);
152        self
153    }
154    /// <p>An array of objects to specify a filter that exports a more specific set of Amazon Aurora and RDS recommendations.</p>
155    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RdsdbRecommendationFilter>>) -> Self {
156        self.inner = self.inner.set_filters(input);
157        self
158    }
159    /// <p>An array of objects to specify a filter that exports a more specific set of Amazon Aurora and RDS recommendations.</p>
160    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RdsdbRecommendationFilter>> {
161        self.inner.get_filters()
162    }
163    ///
164    /// Appends an item to `fieldsToExport`.
165    ///
166    /// To override the contents of this collection use [`set_fields_to_export`](Self::set_fields_to_export).
167    ///
168    /// <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>
169    pub fn fields_to_export(mut self, input: crate::types::ExportableRdsdbField) -> Self {
170        self.inner = self.inner.fields_to_export(input);
171        self
172    }
173    /// <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>
174    pub fn set_fields_to_export(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ExportableRdsdbField>>) -> Self {
175        self.inner = self.inner.set_fields_to_export(input);
176        self
177    }
178    /// <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>
179    pub fn get_fields_to_export(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ExportableRdsdbField>> {
180        self.inner.get_fields_to_export()
181    }
182    /// <p>Describes the destination Amazon Simple Storage Service (Amazon S3) bucket name and key prefix for a recommendations export job.</p>
183    /// <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>
184    pub fn s3_destination_config(mut self, input: crate::types::S3DestinationConfig) -> Self {
185        self.inner = self.inner.s3_destination_config(input);
186        self
187    }
188    /// <p>Describes the destination Amazon Simple Storage Service (Amazon S3) bucket name and key prefix for a recommendations export job.</p>
189    /// <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>
190    pub fn set_s3_destination_config(mut self, input: ::std::option::Option<crate::types::S3DestinationConfig>) -> Self {
191        self.inner = self.inner.set_s3_destination_config(input);
192        self
193    }
194    /// <p>Describes the destination Amazon Simple Storage Service (Amazon S3) bucket name and key prefix for a recommendations export job.</p>
195    /// <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>
196    pub fn get_s3_destination_config(&self) -> &::std::option::Option<crate::types::S3DestinationConfig> {
197        self.inner.get_s3_destination_config()
198    }
199    /// <p>The format of the export file.</p>
200    /// <p>The CSV file is the only export file format currently supported.</p>
201    pub fn file_format(mut self, input: crate::types::FileFormat) -> Self {
202        self.inner = self.inner.file_format(input);
203        self
204    }
205    /// <p>The format of the export file.</p>
206    /// <p>The CSV file is the only export file format currently supported.</p>
207    pub fn set_file_format(mut self, input: ::std::option::Option<crate::types::FileFormat>) -> Self {
208        self.inner = self.inner.set_file_format(input);
209        self
210    }
211    /// <p>The format of the export file.</p>
212    /// <p>The CSV file is the only export file format currently supported.</p>
213    pub fn get_file_format(&self) -> &::std::option::Option<crate::types::FileFormat> {
214        self.inner.get_file_format()
215    }
216    /// <p>If your account is the management account or the delegated administrator of an organization, this parameter indicates whether to include recommendations for resources in all member accounts of the organization.</p>
217    /// <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>
218    /// <p>If this parameter is omitted, recommendations for member accounts of the organization aren't included in the export file.</p>
219    /// <p>If this parameter or the account ID parameter is omitted, recommendations for member accounts aren't included in the export.</p>
220    pub fn include_member_accounts(mut self, input: bool) -> Self {
221        self.inner = self.inner.include_member_accounts(input);
222        self
223    }
224    /// <p>If your account is the management account or the delegated administrator of an organization, this parameter indicates whether to include recommendations for resources in all member accounts of the organization.</p>
225    /// <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>
226    /// <p>If this parameter is omitted, recommendations for member accounts of the organization aren't included in the export file.</p>
227    /// <p>If this parameter or the account ID parameter is omitted, recommendations for member accounts aren't included in the export.</p>
228    pub fn set_include_member_accounts(mut self, input: ::std::option::Option<bool>) -> Self {
229        self.inner = self.inner.set_include_member_accounts(input);
230        self
231    }
232    /// <p>If your account is the management account or the delegated administrator of an organization, this parameter indicates whether to include recommendations for resources in all member accounts of the organization.</p>
233    /// <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>
234    /// <p>If this parameter is omitted, recommendations for member accounts of the organization aren't included in the export file.</p>
235    /// <p>If this parameter or the account ID parameter is omitted, recommendations for member accounts aren't included in the export.</p>
236    pub fn get_include_member_accounts(&self) -> &::std::option::Option<bool> {
237        self.inner.get_include_member_accounts()
238    }
239    /// <p>Describes the recommendation preferences to return in the response of a <code>GetAutoScalingGroupRecommendations</code>, <code>GetEC2InstanceRecommendations</code>, <code>GetEC2RecommendationProjectedMetrics</code>, <code>GetRDSDatabaseRecommendations</code>, and <code>GetRDSDatabaseRecommendationProjectedMetrics</code> request.</p>
240    pub fn recommendation_preferences(mut self, input: crate::types::RecommendationPreferences) -> Self {
241        self.inner = self.inner.recommendation_preferences(input);
242        self
243    }
244    /// <p>Describes the recommendation preferences to return in the response of a <code>GetAutoScalingGroupRecommendations</code>, <code>GetEC2InstanceRecommendations</code>, <code>GetEC2RecommendationProjectedMetrics</code>, <code>GetRDSDatabaseRecommendations</code>, and <code>GetRDSDatabaseRecommendationProjectedMetrics</code> request.</p>
245    pub fn set_recommendation_preferences(mut self, input: ::std::option::Option<crate::types::RecommendationPreferences>) -> Self {
246        self.inner = self.inner.set_recommendation_preferences(input);
247        self
248    }
249    /// <p>Describes the recommendation preferences to return in the response of a <code>GetAutoScalingGroupRecommendations</code>, <code>GetEC2InstanceRecommendations</code>, <code>GetEC2RecommendationProjectedMetrics</code>, <code>GetRDSDatabaseRecommendations</code>, and <code>GetRDSDatabaseRecommendationProjectedMetrics</code> request.</p>
250    pub fn get_recommendation_preferences(&self) -> &::std::option::Option<crate::types::RecommendationPreferences> {
251        self.inner.get_recommendation_preferences()
252    }
253}