aws_sdk_computeoptimizer/operation/export_ebs_volume_recommendations/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::export_ebs_volume_recommendations::_export_ebs_volume_recommendations_output::ExportEbsVolumeRecommendationsOutputBuilder;
3
4pub use crate::operation::export_ebs_volume_recommendations::_export_ebs_volume_recommendations_input::ExportEbsVolumeRecommendationsInputBuilder;
5
6impl crate::operation::export_ebs_volume_recommendations::builders::ExportEbsVolumeRecommendationsInputBuilder {
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_ebs_volume_recommendations::ExportEbsVolumeRecommendationsOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::export_ebs_volume_recommendations::ExportEBSVolumeRecommendationsError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.export_ebs_volume_recommendations();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `ExportEBSVolumeRecommendations`.
24///
25/// <p>Exports optimization recommendations for Amazon EBS volumes.</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 Amazon EBS volume export job in progress per Amazon Web Services Region.</p>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct ExportEBSVolumeRecommendationsFluentBuilder {
30 handle: ::std::sync::Arc<crate::client::Handle>,
31 inner: crate::operation::export_ebs_volume_recommendations::builders::ExportEbsVolumeRecommendationsInputBuilder,
32 config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35 crate::client::customize::internal::CustomizableSend<
36 crate::operation::export_ebs_volume_recommendations::ExportEbsVolumeRecommendationsOutput,
37 crate::operation::export_ebs_volume_recommendations::ExportEBSVolumeRecommendationsError,
38 > for ExportEBSVolumeRecommendationsFluentBuilder
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_ebs_volume_recommendations::ExportEbsVolumeRecommendationsOutput,
46 crate::operation::export_ebs_volume_recommendations::ExportEBSVolumeRecommendationsError,
47 >,
48 > {
49 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50 }
51}
52impl ExportEBSVolumeRecommendationsFluentBuilder {
53 /// Creates a new `ExportEBSVolumeRecommendationsFluentBuilder`.
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 ExportEBSVolumeRecommendations as a reference.
62 pub fn as_input(&self) -> &crate::operation::export_ebs_volume_recommendations::builders::ExportEbsVolumeRecommendationsInputBuilder {
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_ebs_volume_recommendations::ExportEbsVolumeRecommendationsOutput,
77 ::aws_smithy_runtime_api::client::result::SdkError<
78 crate::operation::export_ebs_volume_recommendations::ExportEBSVolumeRecommendationsError,
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_ebs_volume_recommendations::ExportEBSVolumeRecommendations::operation_runtime_plugins(
87 self.handle.runtime_plugins.clone(),
88 &self.handle.conf,
89 self.config_override,
90 );
91 crate::operation::export_ebs_volume_recommendations::ExportEBSVolumeRecommendations::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_ebs_volume_recommendations::ExportEbsVolumeRecommendationsOutput,
99 crate::operation::export_ebs_volume_recommendations::ExportEBSVolumeRecommendationsError,
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 IDs of the Amazon Web Services accounts for which to export Amazon EBS volume recommendations.</p>
119 /// <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>
120 /// <p>This parameter cannot be specified together with the include member accounts parameter. The parameters are mutually exclusive.</p>
121 /// <p>Recommendations for member accounts are not included in the export if this parameter, or the include member accounts parameter, is omitted.</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 IDs of the Amazon Web Services accounts for which to export Amazon EBS volume recommendations.</p>
128 /// <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>
129 /// <p>This parameter cannot be specified together with the include member accounts parameter. The parameters are mutually exclusive.</p>
130 /// <p>Recommendations for member accounts are not included in the export if this parameter, or the include member accounts parameter, is omitted.</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 IDs of the Amazon Web Services accounts for which to export Amazon EBS volume recommendations.</p>
137 /// <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>
138 /// <p>This parameter cannot be specified together with the include member accounts parameter. The parameters are mutually exclusive.</p>
139 /// <p>Recommendations for member accounts are not included in the export if this parameter, or the include member accounts parameter, is omitted.</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 EBS volume recommendations.</p>
150 pub fn filters(mut self, input: crate::types::EbsFilter) -> 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 EBS volume recommendations.</p>
155 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EbsFilter>>) -> 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 EBS volume recommendations.</p>
160 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EbsFilter>> {
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::ExportableVolumeField) -> 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::ExportableVolumeField>>) -> 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::ExportableVolumeField>> {
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 only export file format currently supported is <code>Csv</code>.</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 only export file format currently supported is <code>Csv</code>.</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 only export file format currently supported is <code>Csv</code>.</p>
213 pub fn get_file_format(&self) -> &::std::option::Option<crate::types::FileFormat> {
214 self.inner.get_file_format()
215 }
216 /// <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>
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>Recommendations for member accounts of the organization are not included in the export file if this parameter is omitted.</p>
219 /// <p>This parameter cannot be specified together with the account IDs parameter. The parameters are mutually exclusive.</p>
220 /// <p>Recommendations for member accounts are not included in the export if this parameter, or the account IDs parameter, is omitted.</p>
221 pub fn include_member_accounts(mut self, input: bool) -> Self {
222 self.inner = self.inner.include_member_accounts(input);
223 self
224 }
225 /// <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>
226 /// <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>
227 /// <p>Recommendations for member accounts of the organization are not included in the export file if this parameter is omitted.</p>
228 /// <p>This parameter cannot be specified together with the account IDs parameter. The parameters are mutually exclusive.</p>
229 /// <p>Recommendations for member accounts are not included in the export if this parameter, or the account IDs parameter, is omitted.</p>
230 pub fn set_include_member_accounts(mut self, input: ::std::option::Option<bool>) -> Self {
231 self.inner = self.inner.set_include_member_accounts(input);
232 self
233 }
234 /// <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>
235 /// <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>
236 /// <p>Recommendations for member accounts of the organization are not included in the export file if this parameter is omitted.</p>
237 /// <p>This parameter cannot be specified together with the account IDs parameter. The parameters are mutually exclusive.</p>
238 /// <p>Recommendations for member accounts are not included in the export if this parameter, or the account IDs parameter, is omitted.</p>
239 pub fn get_include_member_accounts(&self) -> &::std::option::Option<bool> {
240 self.inner.get_include_member_accounts()
241 }
242}