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