aws_sdk_dynamodb/operation/restore_table_to_point_in_time/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::restore_table_to_point_in_time::_restore_table_to_point_in_time_output::RestoreTableToPointInTimeOutputBuilder;
3
4pub use crate::operation::restore_table_to_point_in_time::_restore_table_to_point_in_time_input::RestoreTableToPointInTimeInputBuilder;
5
6impl crate::operation::restore_table_to_point_in_time::builders::RestoreTableToPointInTimeInputBuilder {
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_to_point_in_time::RestoreTableToPointInTimeOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.restore_table_to_point_in_time();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `RestoreTableToPointInTime`.
24///
25/// <p>Restores the specified table to the specified point in time within <code>EarliestRestorableDateTime</code> and <code>LatestRestorableDateTime</code>. You can restore your table to any point in time in the last 35 days. You can set the recovery period to any value between 1 and 35 days. Any number of users can execute up to 50 concurrent restores (any type of restore) in a given account.</p>
26/// <p>When you restore using point in time recovery, DynamoDB restores your table data to the state based on the selected date and time (day:hour:minute:second) to a new table.</p>
27/// <p>Along with data, the following are also included on the new restored table using point in time recovery:</p>
28/// <ul>
29/// <li>
30/// <p>Global secondary indexes (GSIs)</p></li>
31/// <li>
32/// <p>Local secondary indexes (LSIs)</p></li>
33/// <li>
34/// <p>Provisioned read and write capacity</p></li>
35/// <li>
36/// <p>Encryption settings</p><important>
37/// <p>All these settings come from the current settings of the source table at the time of restore.</p>
38/// </important></li>
39/// </ul>
40/// <p>You must manually set up the following on the restored table:</p>
41/// <ul>
42/// <li>
43/// <p>Auto scaling policies</p></li>
44/// <li>
45/// <p>IAM policies</p></li>
46/// <li>
47/// <p>Amazon CloudWatch metrics and alarms</p></li>
48/// <li>
49/// <p>Tags</p></li>
50/// <li>
51/// <p>Stream settings</p></li>
52/// <li>
53/// <p>Time to Live (TTL) settings</p></li>
54/// <li>
55/// <p>Point in time recovery settings</p></li>
56/// </ul>
57#[derive(::std::clone::Clone, ::std::fmt::Debug)]
58pub struct RestoreTableToPointInTimeFluentBuilder {
59    handle: ::std::sync::Arc<crate::client::Handle>,
60    inner: crate::operation::restore_table_to_point_in_time::builders::RestoreTableToPointInTimeInputBuilder,
61    config_override: ::std::option::Option<crate::config::Builder>,
62}
63impl
64    crate::client::customize::internal::CustomizableSend<
65        crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeOutput,
66        crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError,
67    > for RestoreTableToPointInTimeFluentBuilder
68{
69    fn send(
70        self,
71        config_override: crate::config::Builder,
72    ) -> crate::client::customize::internal::BoxFuture<
73        crate::client::customize::internal::SendResult<
74            crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeOutput,
75            crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError,
76        >,
77    > {
78        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
79    }
80}
81impl RestoreTableToPointInTimeFluentBuilder {
82    /// Creates a new `RestoreTableToPointInTimeFluentBuilder`.
83    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
84        Self {
85            handle,
86            inner: ::std::default::Default::default(),
87            config_override: ::std::option::Option::None,
88        }
89    }
90    /// Access the RestoreTableToPointInTime as a reference.
91    pub fn as_input(&self) -> &crate::operation::restore_table_to_point_in_time::builders::RestoreTableToPointInTimeInputBuilder {
92        &self.inner
93    }
94    /// Sends the request and returns the response.
95    ///
96    /// If an error occurs, an `SdkError` will be returned with additional details that
97    /// can be matched against.
98    ///
99    /// By default, any retryable failures will be retried twice. Retry behavior
100    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
101    /// set when configuring the client.
102    pub async fn send(
103        self,
104    ) -> ::std::result::Result<
105        crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeOutput,
106        ::aws_smithy_runtime_api::client::result::SdkError<
107            crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError,
108            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
109        >,
110    > {
111        let input = self
112            .inner
113            .build()
114            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
115        let runtime_plugins = crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTime::operation_runtime_plugins(
116            self.handle.runtime_plugins.clone(),
117            &self.handle.conf,
118            self.config_override,
119        );
120        crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTime::orchestrate(&runtime_plugins, input).await
121    }
122
123    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
124    pub fn customize(
125        self,
126    ) -> crate::client::customize::CustomizableOperation<
127        crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeOutput,
128        crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError,
129        Self,
130    > {
131        crate::client::customize::CustomizableOperation::new(self)
132    }
133    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
134        self.set_config_override(::std::option::Option::Some(config_override.into()));
135        self
136    }
137
138    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
139        self.config_override = config_override;
140        self
141    }
142    /// <p>The DynamoDB table that will be restored. This value is an Amazon Resource Name (ARN).</p>
143    pub fn source_table_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.inner = self.inner.source_table_arn(input.into());
145        self
146    }
147    /// <p>The DynamoDB table that will be restored. This value is an Amazon Resource Name (ARN).</p>
148    pub fn set_source_table_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.inner = self.inner.set_source_table_arn(input);
150        self
151    }
152    /// <p>The DynamoDB table that will be restored. This value is an Amazon Resource Name (ARN).</p>
153    pub fn get_source_table_arn(&self) -> &::std::option::Option<::std::string::String> {
154        self.inner.get_source_table_arn()
155    }
156    /// <p>Name of the source table that is being restored.</p>
157    pub fn source_table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.inner = self.inner.source_table_name(input.into());
159        self
160    }
161    /// <p>Name of the source table that is being restored.</p>
162    pub fn set_source_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163        self.inner = self.inner.set_source_table_name(input);
164        self
165    }
166    /// <p>Name of the source table that is being restored.</p>
167    pub fn get_source_table_name(&self) -> &::std::option::Option<::std::string::String> {
168        self.inner.get_source_table_name()
169    }
170    /// <p>The name of the new table to which it must be restored to.</p>
171    pub fn target_table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172        self.inner = self.inner.target_table_name(input.into());
173        self
174    }
175    /// <p>The name of the new table to which it must be restored to.</p>
176    pub fn set_target_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177        self.inner = self.inner.set_target_table_name(input);
178        self
179    }
180    /// <p>The name of the new table to which it must be restored to.</p>
181    pub fn get_target_table_name(&self) -> &::std::option::Option<::std::string::String> {
182        self.inner.get_target_table_name()
183    }
184    /// <p>Restore the table to the latest possible time. <code>LatestRestorableDateTime</code> is typically 5 minutes before the current time.</p>
185    pub fn use_latest_restorable_time(mut self, input: bool) -> Self {
186        self.inner = self.inner.use_latest_restorable_time(input);
187        self
188    }
189    /// <p>Restore the table to the latest possible time. <code>LatestRestorableDateTime</code> is typically 5 minutes before the current time.</p>
190    pub fn set_use_latest_restorable_time(mut self, input: ::std::option::Option<bool>) -> Self {
191        self.inner = self.inner.set_use_latest_restorable_time(input);
192        self
193    }
194    /// <p>Restore the table to the latest possible time. <code>LatestRestorableDateTime</code> is typically 5 minutes before the current time.</p>
195    pub fn get_use_latest_restorable_time(&self) -> &::std::option::Option<bool> {
196        self.inner.get_use_latest_restorable_time()
197    }
198    /// <p>Time in the past to restore the table to.</p>
199    pub fn restore_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
200        self.inner = self.inner.restore_date_time(input);
201        self
202    }
203    /// <p>Time in the past to restore the table to.</p>
204    pub fn set_restore_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
205        self.inner = self.inner.set_restore_date_time(input);
206        self
207    }
208    /// <p>Time in the past to restore the table to.</p>
209    pub fn get_restore_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
210        self.inner.get_restore_date_time()
211    }
212    /// <p>The billing mode of the restored table.</p>
213    pub fn billing_mode_override(mut self, input: crate::types::BillingMode) -> Self {
214        self.inner = self.inner.billing_mode_override(input);
215        self
216    }
217    /// <p>The billing mode of the restored table.</p>
218    pub fn set_billing_mode_override(mut self, input: ::std::option::Option<crate::types::BillingMode>) -> Self {
219        self.inner = self.inner.set_billing_mode_override(input);
220        self
221    }
222    /// <p>The billing mode of the restored table.</p>
223    pub fn get_billing_mode_override(&self) -> &::std::option::Option<crate::types::BillingMode> {
224        self.inner.get_billing_mode_override()
225    }
226    ///
227    /// Appends an item to `GlobalSecondaryIndexOverride`.
228    ///
229    /// To override the contents of this collection use [`set_global_secondary_index_override`](Self::set_global_secondary_index_override).
230    ///
231    /// <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>
232    pub fn global_secondary_index_override(mut self, input: crate::types::GlobalSecondaryIndex) -> Self {
233        self.inner = self.inner.global_secondary_index_override(input);
234        self
235    }
236    /// <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>
237    pub fn set_global_secondary_index_override(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GlobalSecondaryIndex>>) -> Self {
238        self.inner = self.inner.set_global_secondary_index_override(input);
239        self
240    }
241    /// <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>
242    pub fn get_global_secondary_index_override(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GlobalSecondaryIndex>> {
243        self.inner.get_global_secondary_index_override()
244    }
245    ///
246    /// Appends an item to `LocalSecondaryIndexOverride`.
247    ///
248    /// To override the contents of this collection use [`set_local_secondary_index_override`](Self::set_local_secondary_index_override).
249    ///
250    /// <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>
251    pub fn local_secondary_index_override(mut self, input: crate::types::LocalSecondaryIndex) -> Self {
252        self.inner = self.inner.local_secondary_index_override(input);
253        self
254    }
255    /// <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>
256    pub fn set_local_secondary_index_override(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LocalSecondaryIndex>>) -> Self {
257        self.inner = self.inner.set_local_secondary_index_override(input);
258        self
259    }
260    /// <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>
261    pub fn get_local_secondary_index_override(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LocalSecondaryIndex>> {
262        self.inner.get_local_secondary_index_override()
263    }
264    /// <p>Provisioned throughput settings for the restored table.</p>
265    pub fn provisioned_throughput_override(mut self, input: crate::types::ProvisionedThroughput) -> Self {
266        self.inner = self.inner.provisioned_throughput_override(input);
267        self
268    }
269    /// <p>Provisioned throughput settings for the restored table.</p>
270    pub fn set_provisioned_throughput_override(mut self, input: ::std::option::Option<crate::types::ProvisionedThroughput>) -> Self {
271        self.inner = self.inner.set_provisioned_throughput_override(input);
272        self
273    }
274    /// <p>Provisioned throughput settings for the restored table.</p>
275    pub fn get_provisioned_throughput_override(&self) -> &::std::option::Option<crate::types::ProvisionedThroughput> {
276        self.inner.get_provisioned_throughput_override()
277    }
278    /// <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>
279    pub fn on_demand_throughput_override(mut self, input: crate::types::OnDemandThroughput) -> Self {
280        self.inner = self.inner.on_demand_throughput_override(input);
281        self
282    }
283    /// <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>
284    pub fn set_on_demand_throughput_override(mut self, input: ::std::option::Option<crate::types::OnDemandThroughput>) -> Self {
285        self.inner = self.inner.set_on_demand_throughput_override(input);
286        self
287    }
288    /// <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>
289    pub fn get_on_demand_throughput_override(&self) -> &::std::option::Option<crate::types::OnDemandThroughput> {
290        self.inner.get_on_demand_throughput_override()
291    }
292    /// <p>The new server-side encryption settings for the restored table.</p>
293    pub fn sse_specification_override(mut self, input: crate::types::SseSpecification) -> Self {
294        self.inner = self.inner.sse_specification_override(input);
295        self
296    }
297    /// <p>The new server-side encryption settings for the restored table.</p>
298    pub fn set_sse_specification_override(mut self, input: ::std::option::Option<crate::types::SseSpecification>) -> Self {
299        self.inner = self.inner.set_sse_specification_override(input);
300        self
301    }
302    /// <p>The new server-side encryption settings for the restored table.</p>
303    pub fn get_sse_specification_override(&self) -> &::std::option::Option<crate::types::SseSpecification> {
304        self.inner.get_sse_specification_override()
305    }
306}