aws_sdk_rds/operation/start_export_task/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_export_task::_start_export_task_output::StartExportTaskOutputBuilder;
3
4pub use crate::operation::start_export_task::_start_export_task_input::StartExportTaskInputBuilder;
5
6impl crate::operation::start_export_task::builders::StartExportTaskInputBuilder {
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::start_export_task::StartExportTaskOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::start_export_task::StartExportTaskError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.start_export_task();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `StartExportTask`.
24///
25/// <p>Starts an export of DB snapshot or DB cluster data to Amazon S3. The provided IAM role must have access to the S3 bucket.</p>
26/// <p>You can't export snapshot data from RDS Custom DB instances. For more information, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RDS_Fea_Regions_DB-eng.Feature.ExportSnapshotToS3.html"> Supported Regions and DB engines for exporting snapshots to S3 in Amazon RDS</a>.</p>
27/// <p>For more information on exporting DB snapshot data, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ExportSnapshot.html">Exporting DB snapshot data to Amazon S3</a> in the <i>Amazon RDS User Guide</i> or <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-export-snapshot.html">Exporting DB cluster snapshot data to Amazon S3</a> in the <i>Amazon Aurora User Guide</i>.</p>
28/// <p>For more information on exporting DB cluster data, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/export-cluster-data.html">Exporting DB cluster data to Amazon S3</a> in the <i>Amazon Aurora User Guide</i>.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct StartExportTaskFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::start_export_task::builders::StartExportTaskInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36    crate::client::customize::internal::CustomizableSend<
37        crate::operation::start_export_task::StartExportTaskOutput,
38        crate::operation::start_export_task::StartExportTaskError,
39    > for StartExportTaskFluentBuilder
40{
41    fn send(
42        self,
43        config_override: crate::config::Builder,
44    ) -> crate::client::customize::internal::BoxFuture<
45        crate::client::customize::internal::SendResult<
46            crate::operation::start_export_task::StartExportTaskOutput,
47            crate::operation::start_export_task::StartExportTaskError,
48        >,
49    > {
50        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51    }
52}
53impl StartExportTaskFluentBuilder {
54    /// Creates a new `StartExportTaskFluentBuilder`.
55    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56        Self {
57            handle,
58            inner: ::std::default::Default::default(),
59            config_override: ::std::option::Option::None,
60        }
61    }
62    /// Access the StartExportTask as a reference.
63    pub fn as_input(&self) -> &crate::operation::start_export_task::builders::StartExportTaskInputBuilder {
64        &self.inner
65    }
66    /// Sends the request and returns the response.
67    ///
68    /// If an error occurs, an `SdkError` will be returned with additional details that
69    /// can be matched against.
70    ///
71    /// By default, any retryable failures will be retried twice. Retry behavior
72    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73    /// set when configuring the client.
74    pub async fn send(
75        self,
76    ) -> ::std::result::Result<
77        crate::operation::start_export_task::StartExportTaskOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::start_export_task::StartExportTaskError,
80            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81        >,
82    > {
83        let input = self
84            .inner
85            .build()
86            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87        let runtime_plugins = crate::operation::start_export_task::StartExportTask::operation_runtime_plugins(
88            self.handle.runtime_plugins.clone(),
89            &self.handle.conf,
90            self.config_override,
91        );
92        crate::operation::start_export_task::StartExportTask::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::start_export_task::StartExportTaskOutput,
100        crate::operation::start_export_task::StartExportTaskError,
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    /// <p>A unique identifier for the export task. This ID isn't an identifier for the Amazon S3 bucket where the data is to be exported.</p>
115    pub fn export_task_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.inner = self.inner.export_task_identifier(input.into());
117        self
118    }
119    /// <p>A unique identifier for the export task. This ID isn't an identifier for the Amazon S3 bucket where the data is to be exported.</p>
120    pub fn set_export_task_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.inner = self.inner.set_export_task_identifier(input);
122        self
123    }
124    /// <p>A unique identifier for the export task. This ID isn't an identifier for the Amazon S3 bucket where the data is to be exported.</p>
125    pub fn get_export_task_identifier(&self) -> &::std::option::Option<::std::string::String> {
126        self.inner.get_export_task_identifier()
127    }
128    /// <p>The Amazon Resource Name (ARN) of the snapshot or cluster to export to Amazon S3.</p>
129    pub fn source_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.inner = self.inner.source_arn(input.into());
131        self
132    }
133    /// <p>The Amazon Resource Name (ARN) of the snapshot or cluster to export to Amazon S3.</p>
134    pub fn set_source_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.inner = self.inner.set_source_arn(input);
136        self
137    }
138    /// <p>The Amazon Resource Name (ARN) of the snapshot or cluster to export to Amazon S3.</p>
139    pub fn get_source_arn(&self) -> &::std::option::Option<::std::string::String> {
140        self.inner.get_source_arn()
141    }
142    /// <p>The name of the Amazon S3 bucket to export the snapshot or cluster data to.</p>
143    pub fn s3_bucket_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.inner = self.inner.s3_bucket_name(input.into());
145        self
146    }
147    /// <p>The name of the Amazon S3 bucket to export the snapshot or cluster data to.</p>
148    pub fn set_s3_bucket_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.inner = self.inner.set_s3_bucket_name(input);
150        self
151    }
152    /// <p>The name of the Amazon S3 bucket to export the snapshot or cluster data to.</p>
153    pub fn get_s3_bucket_name(&self) -> &::std::option::Option<::std::string::String> {
154        self.inner.get_s3_bucket_name()
155    }
156    /// <p>The name of the IAM role to use for writing to the Amazon S3 bucket when exporting a snapshot or cluster.</p>
157    /// <p>In the IAM policy attached to your IAM role, include the following required actions to allow the transfer of files from Amazon RDS or Amazon Aurora to an S3 bucket:</p>
158    /// <ul>
159    /// <li>
160    /// <p>s3:PutObject*</p></li>
161    /// <li>
162    /// <p>s3:GetObject*</p></li>
163    /// <li>
164    /// <p>s3:ListBucket</p></li>
165    /// <li>
166    /// <p>s3:DeleteObject*</p></li>
167    /// <li>
168    /// <p>s3:GetBucketLocation</p></li>
169    /// </ul>
170    /// <p>In the policy, include the resources to identify the S3 bucket and objects in the bucket. The following list of resources shows the Amazon Resource Name (ARN) format for accessing S3:</p>
171    /// <ul>
172    /// <li>
173    /// <p><code>arn:aws:s3:::<i>your-s3-bucket</i> </code></p></li>
174    /// <li>
175    /// <p><code>arn:aws:s3:::<i>your-s3-bucket</i>/*</code></p></li>
176    /// </ul>
177    pub fn iam_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
178        self.inner = self.inner.iam_role_arn(input.into());
179        self
180    }
181    /// <p>The name of the IAM role to use for writing to the Amazon S3 bucket when exporting a snapshot or cluster.</p>
182    /// <p>In the IAM policy attached to your IAM role, include the following required actions to allow the transfer of files from Amazon RDS or Amazon Aurora to an S3 bucket:</p>
183    /// <ul>
184    /// <li>
185    /// <p>s3:PutObject*</p></li>
186    /// <li>
187    /// <p>s3:GetObject*</p></li>
188    /// <li>
189    /// <p>s3:ListBucket</p></li>
190    /// <li>
191    /// <p>s3:DeleteObject*</p></li>
192    /// <li>
193    /// <p>s3:GetBucketLocation</p></li>
194    /// </ul>
195    /// <p>In the policy, include the resources to identify the S3 bucket and objects in the bucket. The following list of resources shows the Amazon Resource Name (ARN) format for accessing S3:</p>
196    /// <ul>
197    /// <li>
198    /// <p><code>arn:aws:s3:::<i>your-s3-bucket</i> </code></p></li>
199    /// <li>
200    /// <p><code>arn:aws:s3:::<i>your-s3-bucket</i>/*</code></p></li>
201    /// </ul>
202    pub fn set_iam_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
203        self.inner = self.inner.set_iam_role_arn(input);
204        self
205    }
206    /// <p>The name of the IAM role to use for writing to the Amazon S3 bucket when exporting a snapshot or cluster.</p>
207    /// <p>In the IAM policy attached to your IAM role, include the following required actions to allow the transfer of files from Amazon RDS or Amazon Aurora to an S3 bucket:</p>
208    /// <ul>
209    /// <li>
210    /// <p>s3:PutObject*</p></li>
211    /// <li>
212    /// <p>s3:GetObject*</p></li>
213    /// <li>
214    /// <p>s3:ListBucket</p></li>
215    /// <li>
216    /// <p>s3:DeleteObject*</p></li>
217    /// <li>
218    /// <p>s3:GetBucketLocation</p></li>
219    /// </ul>
220    /// <p>In the policy, include the resources to identify the S3 bucket and objects in the bucket. The following list of resources shows the Amazon Resource Name (ARN) format for accessing S3:</p>
221    /// <ul>
222    /// <li>
223    /// <p><code>arn:aws:s3:::<i>your-s3-bucket</i> </code></p></li>
224    /// <li>
225    /// <p><code>arn:aws:s3:::<i>your-s3-bucket</i>/*</code></p></li>
226    /// </ul>
227    pub fn get_iam_role_arn(&self) -> &::std::option::Option<::std::string::String> {
228        self.inner.get_iam_role_arn()
229    }
230    /// <p>The ID of the Amazon Web Services KMS key to use to encrypt the data exported to Amazon S3. The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key. The caller of this operation must be authorized to run the following operations. These can be set in the Amazon Web Services KMS key policy:</p>
231    /// <ul>
232    /// <li>
233    /// <p>kms:CreateGrant</p></li>
234    /// <li>
235    /// <p>kms:DescribeKey</p></li>
236    /// </ul>
237    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
238        self.inner = self.inner.kms_key_id(input.into());
239        self
240    }
241    /// <p>The ID of the Amazon Web Services KMS key to use to encrypt the data exported to Amazon S3. The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key. The caller of this operation must be authorized to run the following operations. These can be set in the Amazon Web Services KMS key policy:</p>
242    /// <ul>
243    /// <li>
244    /// <p>kms:CreateGrant</p></li>
245    /// <li>
246    /// <p>kms:DescribeKey</p></li>
247    /// </ul>
248    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
249        self.inner = self.inner.set_kms_key_id(input);
250        self
251    }
252    /// <p>The ID of the Amazon Web Services KMS key to use to encrypt the data exported to Amazon S3. The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key. The caller of this operation must be authorized to run the following operations. These can be set in the Amazon Web Services KMS key policy:</p>
253    /// <ul>
254    /// <li>
255    /// <p>kms:CreateGrant</p></li>
256    /// <li>
257    /// <p>kms:DescribeKey</p></li>
258    /// </ul>
259    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
260        self.inner.get_kms_key_id()
261    }
262    /// <p>The Amazon S3 bucket prefix to use as the file name and path of the exported data.</p>
263    pub fn s3_prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
264        self.inner = self.inner.s3_prefix(input.into());
265        self
266    }
267    /// <p>The Amazon S3 bucket prefix to use as the file name and path of the exported data.</p>
268    pub fn set_s3_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
269        self.inner = self.inner.set_s3_prefix(input);
270        self
271    }
272    /// <p>The Amazon S3 bucket prefix to use as the file name and path of the exported data.</p>
273    pub fn get_s3_prefix(&self) -> &::std::option::Option<::std::string::String> {
274        self.inner.get_s3_prefix()
275    }
276    ///
277    /// Appends an item to `ExportOnly`.
278    ///
279    /// To override the contents of this collection use [`set_export_only`](Self::set_export_only).
280    ///
281    /// <p>The data to be exported from the snapshot or cluster. If this parameter isn't provided, all of the data is exported.</p>
282    /// <p>Valid Values:</p>
283    /// <ul>
284    /// <li>
285    /// <p><code>database</code> - Export all the data from a specified database.</p></li>
286    /// <li>
287    /// <p><code>database.table</code> <i>table-name</i> - Export a table of the snapshot or cluster. This format is valid only for RDS for MySQL, RDS for MariaDB, and Aurora MySQL.</p></li>
288    /// <li>
289    /// <p><code>database.schema</code> <i>schema-name</i> - Export a database schema of the snapshot or cluster. This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL.</p></li>
290    /// <li>
291    /// <p><code>database.schema.table</code> <i>table-name</i> - Export a table of the database schema. This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL.</p></li>
292    /// </ul>
293    pub fn export_only(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
294        self.inner = self.inner.export_only(input.into());
295        self
296    }
297    /// <p>The data to be exported from the snapshot or cluster. If this parameter isn't provided, all of the data is exported.</p>
298    /// <p>Valid Values:</p>
299    /// <ul>
300    /// <li>
301    /// <p><code>database</code> - Export all the data from a specified database.</p></li>
302    /// <li>
303    /// <p><code>database.table</code> <i>table-name</i> - Export a table of the snapshot or cluster. This format is valid only for RDS for MySQL, RDS for MariaDB, and Aurora MySQL.</p></li>
304    /// <li>
305    /// <p><code>database.schema</code> <i>schema-name</i> - Export a database schema of the snapshot or cluster. This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL.</p></li>
306    /// <li>
307    /// <p><code>database.schema.table</code> <i>table-name</i> - Export a table of the database schema. This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL.</p></li>
308    /// </ul>
309    pub fn set_export_only(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
310        self.inner = self.inner.set_export_only(input);
311        self
312    }
313    /// <p>The data to be exported from the snapshot or cluster. If this parameter isn't provided, all of the data is exported.</p>
314    /// <p>Valid Values:</p>
315    /// <ul>
316    /// <li>
317    /// <p><code>database</code> - Export all the data from a specified database.</p></li>
318    /// <li>
319    /// <p><code>database.table</code> <i>table-name</i> - Export a table of the snapshot or cluster. This format is valid only for RDS for MySQL, RDS for MariaDB, and Aurora MySQL.</p></li>
320    /// <li>
321    /// <p><code>database.schema</code> <i>schema-name</i> - Export a database schema of the snapshot or cluster. This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL.</p></li>
322    /// <li>
323    /// <p><code>database.schema.table</code> <i>table-name</i> - Export a table of the database schema. This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL.</p></li>
324    /// </ul>
325    pub fn get_export_only(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
326        self.inner.get_export_only()
327    }
328}