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.
84                    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>> {
85                        let input = self.inner.build().map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86                        let runtime_plugins = crate::operation::restore_table_from_backup::RestoreTableFromBackup::operation_runtime_plugins(
87                            self.handle.runtime_plugins.clone(),
88                            &self.handle.conf,
89                            self.config_override,
90                        );
91                        crate::operation::restore_table_from_backup::RestoreTableFromBackup::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<crate::operation::restore_table_from_backup::RestoreTableFromBackupOutput, crate::operation::restore_table_from_backup::RestoreTableFromBackupError, Self> {
98                        crate::client::customize::CustomizableOperation::new(self)
99                    }
100    pub(crate) fn config_override(
101                            mut self,
102                            config_override: impl ::std::convert::Into<crate::config::Builder>,
103                        ) -> Self {
104                            self.set_config_override(::std::option::Option::Some(config_override.into()));
105                            self
106                        }
107    
108                        pub(crate) fn set_config_override(
109                            &mut self,
110                            config_override: ::std::option::Option<crate::config::Builder>,
111                        ) -> &mut Self {
112                            self.config_override = config_override;
113                            self
114                        }
115    /// <p>The name of the new table to which the backup must be restored.</p>
116    pub fn target_table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117                    self.inner = self.inner.target_table_name(input.into());
118                    self
119                }
120    /// <p>The name of the new table to which the backup must be restored.</p>
121    pub fn set_target_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122                    self.inner = self.inner.set_target_table_name(input);
123                    self
124                }
125    /// <p>The name of the new table to which the backup must be restored.</p>
126    pub fn get_target_table_name(&self) -> &::std::option::Option<::std::string::String> {
127                    self.inner.get_target_table_name()
128                }
129    /// <p>The Amazon Resource Name (ARN) associated with the backup.</p>
130    pub fn backup_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131                    self.inner = self.inner.backup_arn(input.into());
132                    self
133                }
134    /// <p>The Amazon Resource Name (ARN) associated with the backup.</p>
135    pub fn set_backup_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136                    self.inner = self.inner.set_backup_arn(input);
137                    self
138                }
139    /// <p>The Amazon Resource Name (ARN) associated with the backup.</p>
140    pub fn get_backup_arn(&self) -> &::std::option::Option<::std::string::String> {
141                    self.inner.get_backup_arn()
142                }
143    /// <p>The billing mode of the restored table.</p>
144    pub fn billing_mode_override(mut self, input: crate::types::BillingMode) -> Self {
145                    self.inner = self.inner.billing_mode_override(input);
146                    self
147                }
148    /// <p>The billing mode of the restored table.</p>
149    pub fn set_billing_mode_override(mut self, input: ::std::option::Option<crate::types::BillingMode>) -> Self {
150                    self.inner = self.inner.set_billing_mode_override(input);
151                    self
152                }
153    /// <p>The billing mode of the restored table.</p>
154    pub fn get_billing_mode_override(&self) -> &::std::option::Option<crate::types::BillingMode> {
155                    self.inner.get_billing_mode_override()
156                }
157    /// 
158    /// Appends an item to `GlobalSecondaryIndexOverride`.
159    /// 
160    /// To override the contents of this collection use [`set_global_secondary_index_override`](Self::set_global_secondary_index_override).
161    /// 
162    /// <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>
163    pub fn global_secondary_index_override(mut self, input: crate::types::GlobalSecondaryIndex) -> Self {
164                        self.inner = self.inner.global_secondary_index_override(input);
165                        self
166                    }
167    /// <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>
168    pub fn set_global_secondary_index_override(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::GlobalSecondaryIndex>>) -> Self {
169                    self.inner = self.inner.set_global_secondary_index_override(input);
170                    self
171                }
172    /// <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>
173    pub fn get_global_secondary_index_override(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::GlobalSecondaryIndex>> {
174                    self.inner.get_global_secondary_index_override()
175                }
176    /// 
177    /// Appends an item to `LocalSecondaryIndexOverride`.
178    /// 
179    /// To override the contents of this collection use [`set_local_secondary_index_override`](Self::set_local_secondary_index_override).
180    /// 
181    /// <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>
182    pub fn local_secondary_index_override(mut self, input: crate::types::LocalSecondaryIndex) -> Self {
183                        self.inner = self.inner.local_secondary_index_override(input);
184                        self
185                    }
186    /// <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>
187    pub fn set_local_secondary_index_override(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::LocalSecondaryIndex>>) -> Self {
188                    self.inner = self.inner.set_local_secondary_index_override(input);
189                    self
190                }
191    /// <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>
192    pub fn get_local_secondary_index_override(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::LocalSecondaryIndex>> {
193                    self.inner.get_local_secondary_index_override()
194                }
195    /// <p>Provisioned throughput settings for the restored table.</p>
196    pub fn provisioned_throughput_override(mut self, input: crate::types::ProvisionedThroughput) -> Self {
197                    self.inner = self.inner.provisioned_throughput_override(input);
198                    self
199                }
200    /// <p>Provisioned throughput settings for the restored table.</p>
201    pub fn set_provisioned_throughput_override(mut self, input: ::std::option::Option<crate::types::ProvisionedThroughput>) -> Self {
202                    self.inner = self.inner.set_provisioned_throughput_override(input);
203                    self
204                }
205    /// <p>Provisioned throughput settings for the restored table.</p>
206    pub fn get_provisioned_throughput_override(&self) -> &::std::option::Option<crate::types::ProvisionedThroughput> {
207                    self.inner.get_provisioned_throughput_override()
208                }
209    /// <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>
210    pub fn on_demand_throughput_override(mut self, input: crate::types::OnDemandThroughput) -> Self {
211                    self.inner = self.inner.on_demand_throughput_override(input);
212                    self
213                }
214    /// <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>
215    pub fn set_on_demand_throughput_override(mut self, input: ::std::option::Option<crate::types::OnDemandThroughput>) -> Self {
216                    self.inner = self.inner.set_on_demand_throughput_override(input);
217                    self
218                }
219    /// <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>
220    pub fn get_on_demand_throughput_override(&self) -> &::std::option::Option<crate::types::OnDemandThroughput> {
221                    self.inner.get_on_demand_throughput_override()
222                }
223    /// <p>The new server-side encryption settings for the restored table.</p>
224    pub fn sse_specification_override(mut self, input: crate::types::SseSpecification) -> Self {
225                    self.inner = self.inner.sse_specification_override(input);
226                    self
227                }
228    /// <p>The new server-side encryption settings for the restored table.</p>
229    pub fn set_sse_specification_override(mut self, input: ::std::option::Option<crate::types::SseSpecification>) -> Self {
230                    self.inner = self.inner.set_sse_specification_override(input);
231                    self
232                }
233    /// <p>The new server-side encryption settings for the restored table.</p>
234    pub fn get_sse_specification_override(&self) -> &::std::option::Option<crate::types::SseSpecification> {
235                    self.inner.get_sse_specification_override()
236                }
237}
238