aws_sdk_dynamodb/operation/restore_table_from_backup/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::restore_table_from_backup::_restore_table_from_backup_output::RestoreTableFromBackupOutputBuilder;
3
4pub use crate::operation::restore_table_from_backup::_restore_table_from_backup_input::RestoreTableFromBackupInputBuilder;
5
6impl crate::operation::restore_table_from_backup::builders::RestoreTableFromBackupInputBuilder {
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::restore_table_from_backup::RestoreTableFromBackupOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::restore_table_from_backup::RestoreTableFromBackupError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.restore_table_from_backup();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `RestoreTableFromBackup`.
24///
25/// <p>Creates a new table from an existing backup. Any number of users can execute up to 50 concurrent restores (any type of restore) in a given account.</p>
26/// <p>You can call <code>RestoreTableFromBackup</code> at a maximum rate of 10 times per second.</p>
27/// <p>You must manually set up the following on the restored table:</p>
28/// <ul>
29/// <li>
30/// <p>Auto scaling policies</p></li>
31/// <li>
32/// <p>IAM policies</p></li>
33/// <li>
34/// <p>Amazon CloudWatch metrics and alarms</p></li>
35/// <li>
36/// <p>Tags</p></li>
37/// <li>
38/// <p>Stream settings</p></li>
39/// <li>
40/// <p>Time to Live (TTL) settings</p></li>
41/// </ul>
42#[derive(::std::clone::Clone, ::std::fmt::Debug)]
43pub struct RestoreTableFromBackupFluentBuilder {
44    handle: ::std::sync::Arc<crate::client::Handle>,
45    inner: crate::operation::restore_table_from_backup::builders::RestoreTableFromBackupInputBuilder,
46    config_override: ::std::option::Option<crate::config::Builder>,
47}
48impl
49    crate::client::customize::internal::CustomizableSend<
50        crate::operation::restore_table_from_backup::RestoreTableFromBackupOutput,
51        crate::operation::restore_table_from_backup::RestoreTableFromBackupError,
52    > for RestoreTableFromBackupFluentBuilder
53{
54    fn send(
55        self,
56        config_override: crate::config::Builder,
57    ) -> crate::client::customize::internal::BoxFuture<
58        crate::client::customize::internal::SendResult<
59            crate::operation::restore_table_from_backup::RestoreTableFromBackupOutput,
60            crate::operation::restore_table_from_backup::RestoreTableFromBackupError,
61        >,
62    > {
63        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
64    }
65}
66impl RestoreTableFromBackupFluentBuilder {
67    /// Creates a new `RestoreTableFromBackupFluentBuilder`.
68    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
69        Self {
70            handle,
71            inner: ::std::default::Default::default(),
72            config_override: ::std::option::Option::None,
73        }
74    }
75    /// Access the RestoreTableFromBackup as a reference.
76    pub fn as_input(&self) -> &crate::operation::restore_table_from_backup::builders::RestoreTableFromBackupInputBuilder {
77        &self.inner
78    }
79    /// Sends the request and returns the response.
80    ///
81    /// If an error occurs, an `SdkError` will be returned with additional details that
82    /// can be matched against.
83    ///
84    /// By default, any retryable failures will be retried twice. Retry behavior
85    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
86    /// set when configuring the client.
87    pub async fn send(
88        self,
89    ) -> ::std::result::Result<
90        crate::operation::restore_table_from_backup::RestoreTableFromBackupOutput,
91        ::aws_smithy_runtime_api::client::result::SdkError<
92            crate::operation::restore_table_from_backup::RestoreTableFromBackupError,
93            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
94        >,
95    > {
96        let input = self
97            .inner
98            .build()
99            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
100        let runtime_plugins = crate::operation::restore_table_from_backup::RestoreTableFromBackup::operation_runtime_plugins(
101            self.handle.runtime_plugins.clone(),
102            &self.handle.conf,
103            self.config_override,
104        );
105        crate::operation::restore_table_from_backup::RestoreTableFromBackup::orchestrate(&runtime_plugins, input).await
106    }
107
108    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
109    pub fn customize(
110        self,
111    ) -> crate::client::customize::CustomizableOperation<
112        crate::operation::restore_table_from_backup::RestoreTableFromBackupOutput,
113        crate::operation::restore_table_from_backup::RestoreTableFromBackupError,
114        Self,
115    > {
116        crate::client::customize::CustomizableOperation::new(self)
117    }
118    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
119        self.set_config_override(::std::option::Option::Some(config_override.into()));
120        self
121    }
122
123    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
124        self.config_override = config_override;
125        self
126    }
127    /// <p>The name of the new table to which the backup must be restored.</p>
128    pub fn target_table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.inner = self.inner.target_table_name(input.into());
130        self
131    }
132    /// <p>The name of the new table to which the backup must be restored.</p>
133    pub fn set_target_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.inner = self.inner.set_target_table_name(input);
135        self
136    }
137    /// <p>The name of the new table to which the backup must be restored.</p>
138    pub fn get_target_table_name(&self) -> &::std::option::Option<::std::string::String> {
139        self.inner.get_target_table_name()
140    }
141    /// <p>The Amazon Resource Name (ARN) associated with the backup.</p>
142    pub fn backup_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.inner = self.inner.backup_arn(input.into());
144        self
145    }
146    /// <p>The Amazon Resource Name (ARN) associated with the backup.</p>
147    pub fn set_backup_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.inner = self.inner.set_backup_arn(input);
149        self
150    }
151    /// <p>The Amazon Resource Name (ARN) associated with the backup.</p>
152    pub fn get_backup_arn(&self) -> &::std::option::Option<::std::string::String> {
153        self.inner.get_backup_arn()
154    }
155    /// <p>The billing mode of the restored table.</p>
156    pub fn billing_mode_override(mut self, input: crate::types::BillingMode) -> Self {
157        self.inner = self.inner.billing_mode_override(input);
158        self
159    }
160    /// <p>The billing mode of the restored table.</p>
161    pub fn set_billing_mode_override(mut self, input: ::std::option::Option<crate::types::BillingMode>) -> Self {
162        self.inner = self.inner.set_billing_mode_override(input);
163        self
164    }
165    /// <p>The billing mode of the restored table.</p>
166    pub fn get_billing_mode_override(&self) -> &::std::option::Option<crate::types::BillingMode> {
167        self.inner.get_billing_mode_override()
168    }
169    ///
170    /// Appends an item to `GlobalSecondaryIndexOverride`.
171    ///
172    /// To override the contents of this collection use [`set_global_secondary_index_override`](Self::set_global_secondary_index_override).
173    ///
174    /// <p>List of global secondary indexes for the restored table. The indexes provided should match existing secondary indexes. You can choose to exclude some or all of the indexes at the time of restore.</p>
175    pub fn global_secondary_index_override(mut self, input: crate::types::GlobalSecondaryIndex) -> Self {
176        self.inner = self.inner.global_secondary_index_override(input);
177        self
178    }
179    /// <p>List of global secondary indexes for the restored table. The indexes provided should match existing secondary indexes. You can choose to exclude some or all of the indexes at the time of restore.</p>
180    pub fn set_global_secondary_index_override(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GlobalSecondaryIndex>>) -> Self {
181        self.inner = self.inner.set_global_secondary_index_override(input);
182        self
183    }
184    /// <p>List of global secondary indexes for the restored table. The indexes provided should match existing secondary indexes. You can choose to exclude some or all of the indexes at the time of restore.</p>
185    pub fn get_global_secondary_index_override(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GlobalSecondaryIndex>> {
186        self.inner.get_global_secondary_index_override()
187    }
188    ///
189    /// Appends an item to `LocalSecondaryIndexOverride`.
190    ///
191    /// To override the contents of this collection use [`set_local_secondary_index_override`](Self::set_local_secondary_index_override).
192    ///
193    /// <p>List of local secondary indexes for the restored table. The indexes provided should match existing secondary indexes. You can choose to exclude some or all of the indexes at the time of restore.</p>
194    pub fn local_secondary_index_override(mut self, input: crate::types::LocalSecondaryIndex) -> Self {
195        self.inner = self.inner.local_secondary_index_override(input);
196        self
197    }
198    /// <p>List of local secondary indexes for the restored table. The indexes provided should match existing secondary indexes. You can choose to exclude some or all of the indexes at the time of restore.</p>
199    pub fn set_local_secondary_index_override(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LocalSecondaryIndex>>) -> Self {
200        self.inner = self.inner.set_local_secondary_index_override(input);
201        self
202    }
203    /// <p>List of local secondary indexes for the restored table. The indexes provided should match existing secondary indexes. You can choose to exclude some or all of the indexes at the time of restore.</p>
204    pub fn get_local_secondary_index_override(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LocalSecondaryIndex>> {
205        self.inner.get_local_secondary_index_override()
206    }
207    /// <p>Provisioned throughput settings for the restored table.</p>
208    pub fn provisioned_throughput_override(mut self, input: crate::types::ProvisionedThroughput) -> Self {
209        self.inner = self.inner.provisioned_throughput_override(input);
210        self
211    }
212    /// <p>Provisioned throughput settings for the restored table.</p>
213    pub fn set_provisioned_throughput_override(mut self, input: ::std::option::Option<crate::types::ProvisionedThroughput>) -> Self {
214        self.inner = self.inner.set_provisioned_throughput_override(input);
215        self
216    }
217    /// <p>Provisioned throughput settings for the restored table.</p>
218    pub fn get_provisioned_throughput_override(&self) -> &::std::option::Option<crate::types::ProvisionedThroughput> {
219        self.inner.get_provisioned_throughput_override()
220    }
221    /// <p>Sets the maximum number of read and write units for the specified on-demand table. If you use this parameter, you must specify <code>MaxReadRequestUnits</code>, <code>MaxWriteRequestUnits</code>, or both.</p>
222    pub fn on_demand_throughput_override(mut self, input: crate::types::OnDemandThroughput) -> Self {
223        self.inner = self.inner.on_demand_throughput_override(input);
224        self
225    }
226    /// <p>Sets the maximum number of read and write units for the specified on-demand table. If you use this parameter, you must specify <code>MaxReadRequestUnits</code>, <code>MaxWriteRequestUnits</code>, or both.</p>
227    pub fn set_on_demand_throughput_override(mut self, input: ::std::option::Option<crate::types::OnDemandThroughput>) -> Self {
228        self.inner = self.inner.set_on_demand_throughput_override(input);
229        self
230    }
231    /// <p>Sets the maximum number of read and write units for the specified on-demand table. If you use this parameter, you must specify <code>MaxReadRequestUnits</code>, <code>MaxWriteRequestUnits</code>, or both.</p>
232    pub fn get_on_demand_throughput_override(&self) -> &::std::option::Option<crate::types::OnDemandThroughput> {
233        self.inner.get_on_demand_throughput_override()
234    }
235    /// <p>The new server-side encryption settings for the restored table.</p>
236    pub fn sse_specification_override(mut self, input: crate::types::SseSpecification) -> Self {
237        self.inner = self.inner.sse_specification_override(input);
238        self
239    }
240    /// <p>The new server-side encryption settings for the restored table.</p>
241    pub fn set_sse_specification_override(mut self, input: ::std::option::Option<crate::types::SseSpecification>) -> Self {
242        self.inner = self.inner.set_sse_specification_override(input);
243        self
244    }
245    /// <p>The new server-side encryption settings for the restored table.</p>
246    pub fn get_sse_specification_override(&self) -> &::std::option::Option<crate::types::SseSpecification> {
247        self.inner.get_sse_specification_override()
248    }
249}