aws_sdk_computeoptimizer/operation/export_lambda_function_recommendations/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::export_lambda_function_recommendations::_export_lambda_function_recommendations_output::ExportLambdaFunctionRecommendationsOutputBuilder;
3
4pub use crate::operation::export_lambda_function_recommendations::_export_lambda_function_recommendations_input::ExportLambdaFunctionRecommendationsInputBuilder;
5
6impl crate::operation::export_lambda_function_recommendations::builders::ExportLambdaFunctionRecommendationsInputBuilder {
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_lambda_function_recommendations::ExportLambdaFunctionRecommendationsOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::export_lambda_function_recommendations::ExportLambdaFunctionRecommendationsError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.export_lambda_function_recommendations();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `ExportLambdaFunctionRecommendations`.
24///
25/// <p>Exports optimization recommendations for Lambda functions.</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 Lambda function export job in progress per Amazon Web Services Region.</p>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct ExportLambdaFunctionRecommendationsFluentBuilder {
30 handle: ::std::sync::Arc<crate::client::Handle>,
31 inner: crate::operation::export_lambda_function_recommendations::builders::ExportLambdaFunctionRecommendationsInputBuilder,
32 config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35 crate::client::customize::internal::CustomizableSend<
36 crate::operation::export_lambda_function_recommendations::ExportLambdaFunctionRecommendationsOutput,
37 crate::operation::export_lambda_function_recommendations::ExportLambdaFunctionRecommendationsError,
38 > for ExportLambdaFunctionRecommendationsFluentBuilder
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_lambda_function_recommendations::ExportLambdaFunctionRecommendationsOutput,
46 crate::operation::export_lambda_function_recommendations::ExportLambdaFunctionRecommendationsError,
47 >,
48 > {
49 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50 }
51}
52impl ExportLambdaFunctionRecommendationsFluentBuilder {
53 /// Creates a new `ExportLambdaFunctionRecommendationsFluentBuilder`.
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 ExportLambdaFunctionRecommendations as a reference.
62 pub fn as_input(&self) -> &crate::operation::export_lambda_function_recommendations::builders::ExportLambdaFunctionRecommendationsInputBuilder {
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_lambda_function_recommendations::ExportLambdaFunctionRecommendationsOutput,
77 ::aws_smithy_runtime_api::client::result::SdkError<
78 crate::operation::export_lambda_function_recommendations::ExportLambdaFunctionRecommendationsError,
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 =
87 crate::operation::export_lambda_function_recommendations::ExportLambdaFunctionRecommendations::operation_runtime_plugins(
88 self.handle.runtime_plugins.clone(),
89 &self.handle.conf,
90 self.config_override,
91 );
92 crate::operation::export_lambda_function_recommendations::ExportLambdaFunctionRecommendations::orchestrate(&runtime_plugins, input).await
93 }
94
95 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96 pub fn customize(
97 self,
98 ) -> crate::client::customize::CustomizableOperation<
99 crate::operation::export_lambda_function_recommendations::ExportLambdaFunctionRecommendationsOutput,
100 crate::operation::export_lambda_function_recommendations::ExportLambdaFunctionRecommendationsError,
101 Self,
102 > {
103 crate::client::customize::CustomizableOperation::new(self)
104 }
105 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106 self.set_config_override(::std::option::Option::Some(config_override.into()));
107 self
108 }
109
110 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111 self.config_override = config_override;
112 self
113 }
114 ///
115 /// Appends an item to `accountIds`.
116 ///
117 /// To override the contents of this collection use [`set_account_ids`](Self::set_account_ids).
118 ///
119 /// <p>The IDs of the Amazon Web Services accounts for which to export Lambda function recommendations.</p>
120 /// <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>
121 /// <p>This parameter cannot be specified together with the include member accounts parameter. The parameters are mutually exclusive.</p>
122 /// <p>Recommendations for member accounts are not included in the export if this parameter, or the include member accounts parameter, is omitted.</p>
123 /// <p>You can specify multiple account IDs per request.</p>
124 pub fn account_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125 self.inner = self.inner.account_ids(input.into());
126 self
127 }
128 /// <p>The IDs of the Amazon Web Services accounts for which to export Lambda function recommendations.</p>
129 /// <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>
130 /// <p>This parameter cannot be specified together with the include member accounts parameter. The parameters are mutually exclusive.</p>
131 /// <p>Recommendations for member accounts are not included in the export if this parameter, or the include member accounts parameter, is omitted.</p>
132 /// <p>You can specify multiple account IDs per request.</p>
133 pub fn set_account_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
134 self.inner = self.inner.set_account_ids(input);
135 self
136 }
137 /// <p>The IDs of the Amazon Web Services accounts for which to export Lambda function recommendations.</p>
138 /// <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>
139 /// <p>This parameter cannot be specified together with the include member accounts parameter. The parameters are mutually exclusive.</p>
140 /// <p>Recommendations for member accounts are not included in the export if this parameter, or the include member accounts parameter, is omitted.</p>
141 /// <p>You can specify multiple account IDs per request.</p>
142 pub fn get_account_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
143 self.inner.get_account_ids()
144 }
145 ///
146 /// Appends an item to `filters`.
147 ///
148 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
149 ///
150 /// <p>An array of objects to specify a filter that exports a more specific set of Lambda function recommendations.</p>
151 pub fn filters(mut self, input: crate::types::LambdaFunctionRecommendationFilter) -> Self {
152 self.inner = self.inner.filters(input);
153 self
154 }
155 /// <p>An array of objects to specify a filter that exports a more specific set of Lambda function recommendations.</p>
156 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LambdaFunctionRecommendationFilter>>) -> Self {
157 self.inner = self.inner.set_filters(input);
158 self
159 }
160 /// <p>An array of objects to specify a filter that exports a more specific set of Lambda function recommendations.</p>
161 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LambdaFunctionRecommendationFilter>> {
162 self.inner.get_filters()
163 }
164 ///
165 /// Appends an item to `fieldsToExport`.
166 ///
167 /// To override the contents of this collection use [`set_fields_to_export`](Self::set_fields_to_export).
168 ///
169 /// <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>
170 pub fn fields_to_export(mut self, input: crate::types::ExportableLambdaFunctionField) -> Self {
171 self.inner = self.inner.fields_to_export(input);
172 self
173 }
174 /// <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>
175 pub fn set_fields_to_export(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ExportableLambdaFunctionField>>) -> Self {
176 self.inner = self.inner.set_fields_to_export(input);
177 self
178 }
179 /// <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>
180 pub fn get_fields_to_export(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ExportableLambdaFunctionField>> {
181 self.inner.get_fields_to_export()
182 }
183 /// <p>Describes the destination Amazon Simple Storage Service (Amazon S3) bucket name and key prefix for a recommendations export job.</p>
184 /// <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>
185 pub fn s3_destination_config(mut self, input: crate::types::S3DestinationConfig) -> Self {
186 self.inner = self.inner.s3_destination_config(input);
187 self
188 }
189 /// <p>Describes the destination Amazon Simple Storage Service (Amazon S3) bucket name and key prefix for a recommendations export job.</p>
190 /// <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>
191 pub fn set_s3_destination_config(mut self, input: ::std::option::Option<crate::types::S3DestinationConfig>) -> Self {
192 self.inner = self.inner.set_s3_destination_config(input);
193 self
194 }
195 /// <p>Describes the destination Amazon Simple Storage Service (Amazon S3) bucket name and key prefix for a recommendations export job.</p>
196 /// <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>
197 pub fn get_s3_destination_config(&self) -> &::std::option::Option<crate::types::S3DestinationConfig> {
198 self.inner.get_s3_destination_config()
199 }
200 /// <p>The format of the export file.</p>
201 /// <p>The only export file format currently supported is <code>Csv</code>.</p>
202 pub fn file_format(mut self, input: crate::types::FileFormat) -> Self {
203 self.inner = self.inner.file_format(input);
204 self
205 }
206 /// <p>The format of the export file.</p>
207 /// <p>The only export file format currently supported is <code>Csv</code>.</p>
208 pub fn set_file_format(mut self, input: ::std::option::Option<crate::types::FileFormat>) -> Self {
209 self.inner = self.inner.set_file_format(input);
210 self
211 }
212 /// <p>The format of the export file.</p>
213 /// <p>The only export file format currently supported is <code>Csv</code>.</p>
214 pub fn get_file_format(&self) -> &::std::option::Option<crate::types::FileFormat> {
215 self.inner.get_file_format()
216 }
217 /// <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>
218 /// <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>
219 /// <p>Recommendations for member accounts of the organization are not included in the export file if this parameter is omitted.</p>
220 /// <p>This parameter cannot be specified together with the account IDs parameter. The parameters are mutually exclusive.</p>
221 /// <p>Recommendations for member accounts are not included in the export if this parameter, or the account IDs parameter, is omitted.</p>
222 pub fn include_member_accounts(mut self, input: bool) -> Self {
223 self.inner = self.inner.include_member_accounts(input);
224 self
225 }
226 /// <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>
227 /// <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>
228 /// <p>Recommendations for member accounts of the organization are not included in the export file if this parameter is omitted.</p>
229 /// <p>This parameter cannot be specified together with the account IDs parameter. The parameters are mutually exclusive.</p>
230 /// <p>Recommendations for member accounts are not included in the export if this parameter, or the account IDs parameter, is omitted.</p>
231 pub fn set_include_member_accounts(mut self, input: ::std::option::Option<bool>) -> Self {
232 self.inner = self.inner.set_include_member_accounts(input);
233 self
234 }
235 /// <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>
236 /// <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>
237 /// <p>Recommendations for member accounts of the organization are not included in the export file if this parameter is omitted.</p>
238 /// <p>This parameter cannot be specified together with the account IDs parameter. The parameters are mutually exclusive.</p>
239 /// <p>Recommendations for member accounts are not included in the export if this parameter, or the account IDs parameter, is omitted.</p>
240 pub fn get_include_member_accounts(&self) -> &::std::option::Option<bool> {
241 self.inner.get_include_member_accounts()
242 }
243}