aws_sdk_keyspaces/operation/restore_table/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::restore_table::_restore_table_output::RestoreTableOutputBuilder;
3
4pub use crate::operation::restore_table::_restore_table_input::RestoreTableInputBuilder;
5
6impl crate::operation::restore_table::builders::RestoreTableInputBuilder {
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::RestoreTableOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::restore_table::RestoreTableError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.restore_table();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `RestoreTable`.
24///
25/// <p>Restores the table to the specified point in time within the <code>earliest_restorable_timestamp</code> and the current time. For more information about restore points, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/PointInTimeRecovery_HowItWorks.html#howitworks_backup_window"> Time window for PITR continuous backups</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
26/// <p>Any number of users can execute up to 4 concurrent restores (any type of restore) in a given account.</p>
27/// <p>When you restore using point in time recovery, Amazon Keyspaces restores your source table's schema and data to the state based on the selected timestamp <code>(day:hour:minute:second)</code> to a new table. The Time to Live (TTL) settings are also restored to the state based on the selected timestamp.</p>
28/// <p>In addition to the table's schema, data, and TTL settings, <code>RestoreTable</code> restores the capacity mode, auto scaling settings, encryption settings, and point-in-time recovery settings from the source table. Unlike the table's schema data and TTL settings, which are restored based on the selected timestamp, these settings are always restored based on the table's settings as of the current time or when the table was deleted.</p>
29/// <p>You can also overwrite these settings during restore:</p>
30/// <ul>
31/// <li>
32/// <p>Read/write capacity mode</p></li>
33/// <li>
34/// <p>Provisioned throughput capacity units</p></li>
35/// <li>
36/// <p>Auto scaling settings</p></li>
37/// <li>
38/// <p>Point-in-time (PITR) settings</p></li>
39/// <li>
40/// <p>Tags</p></li>
41/// </ul>
42/// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/PointInTimeRecovery_HowItWorks.html#howitworks_backup_settings">PITR restore settings</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
43/// <p>Note that the following settings are not restored, and you must configure them manually for the new table:</p>
44/// <ul>
45/// <li>
46/// <p>Identity and Access Management (IAM) policies</p></li>
47/// <li>
48/// <p>Amazon CloudWatch metrics and alarms</p></li>
49/// </ul>
50#[derive(::std::clone::Clone, ::std::fmt::Debug)]
51pub struct RestoreTableFluentBuilder {
52    handle: ::std::sync::Arc<crate::client::Handle>,
53    inner: crate::operation::restore_table::builders::RestoreTableInputBuilder,
54    config_override: ::std::option::Option<crate::config::Builder>,
55}
56impl
57    crate::client::customize::internal::CustomizableSend<
58        crate::operation::restore_table::RestoreTableOutput,
59        crate::operation::restore_table::RestoreTableError,
60    > for RestoreTableFluentBuilder
61{
62    fn send(
63        self,
64        config_override: crate::config::Builder,
65    ) -> crate::client::customize::internal::BoxFuture<
66        crate::client::customize::internal::SendResult<
67            crate::operation::restore_table::RestoreTableOutput,
68            crate::operation::restore_table::RestoreTableError,
69        >,
70    > {
71        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
72    }
73}
74impl RestoreTableFluentBuilder {
75    /// Creates a new `RestoreTableFluentBuilder`.
76    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
77        Self {
78            handle,
79            inner: ::std::default::Default::default(),
80            config_override: ::std::option::Option::None,
81        }
82    }
83    /// Access the RestoreTable as a reference.
84    pub fn as_input(&self) -> &crate::operation::restore_table::builders::RestoreTableInputBuilder {
85        &self.inner
86    }
87    /// Sends the request and returns the response.
88    ///
89    /// If an error occurs, an `SdkError` will be returned with additional details that
90    /// can be matched against.
91    ///
92    /// By default, any retryable failures will be retried twice. Retry behavior
93    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
94    /// set when configuring the client.
95    pub async fn send(
96        self,
97    ) -> ::std::result::Result<
98        crate::operation::restore_table::RestoreTableOutput,
99        ::aws_smithy_runtime_api::client::result::SdkError<
100            crate::operation::restore_table::RestoreTableError,
101            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
102        >,
103    > {
104        let input = self
105            .inner
106            .build()
107            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
108        let runtime_plugins = crate::operation::restore_table::RestoreTable::operation_runtime_plugins(
109            self.handle.runtime_plugins.clone(),
110            &self.handle.conf,
111            self.config_override,
112        );
113        crate::operation::restore_table::RestoreTable::orchestrate(&runtime_plugins, input).await
114    }
115
116    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
117    pub fn customize(
118        self,
119    ) -> crate::client::customize::CustomizableOperation<
120        crate::operation::restore_table::RestoreTableOutput,
121        crate::operation::restore_table::RestoreTableError,
122        Self,
123    > {
124        crate::client::customize::CustomizableOperation::new(self)
125    }
126    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
127        self.set_config_override(::std::option::Option::Some(config_override.into()));
128        self
129    }
130
131    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
132        self.config_override = config_override;
133        self
134    }
135    /// <p>The keyspace name of the source table.</p>
136    pub fn source_keyspace_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137        self.inner = self.inner.source_keyspace_name(input.into());
138        self
139    }
140    /// <p>The keyspace name of the source table.</p>
141    pub fn set_source_keyspace_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142        self.inner = self.inner.set_source_keyspace_name(input);
143        self
144    }
145    /// <p>The keyspace name of the source table.</p>
146    pub fn get_source_keyspace_name(&self) -> &::std::option::Option<::std::string::String> {
147        self.inner.get_source_keyspace_name()
148    }
149    /// <p>The name of the source table.</p>
150    pub fn source_table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151        self.inner = self.inner.source_table_name(input.into());
152        self
153    }
154    /// <p>The name of the source table.</p>
155    pub fn set_source_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156        self.inner = self.inner.set_source_table_name(input);
157        self
158    }
159    /// <p>The name of the source table.</p>
160    pub fn get_source_table_name(&self) -> &::std::option::Option<::std::string::String> {
161        self.inner.get_source_table_name()
162    }
163    /// <p>The name of the target keyspace.</p>
164    pub fn target_keyspace_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165        self.inner = self.inner.target_keyspace_name(input.into());
166        self
167    }
168    /// <p>The name of the target keyspace.</p>
169    pub fn set_target_keyspace_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.inner = self.inner.set_target_keyspace_name(input);
171        self
172    }
173    /// <p>The name of the target keyspace.</p>
174    pub fn get_target_keyspace_name(&self) -> &::std::option::Option<::std::string::String> {
175        self.inner.get_target_keyspace_name()
176    }
177    /// <p>The name of the target table.</p>
178    pub fn target_table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
179        self.inner = self.inner.target_table_name(input.into());
180        self
181    }
182    /// <p>The name of the target table.</p>
183    pub fn set_target_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
184        self.inner = self.inner.set_target_table_name(input);
185        self
186    }
187    /// <p>The name of the target table.</p>
188    pub fn get_target_table_name(&self) -> &::std::option::Option<::std::string::String> {
189        self.inner.get_target_table_name()
190    }
191    /// <p>The restore timestamp in ISO 8601 format.</p>
192    pub fn restore_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
193        self.inner = self.inner.restore_timestamp(input);
194        self
195    }
196    /// <p>The restore timestamp in ISO 8601 format.</p>
197    pub fn set_restore_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
198        self.inner = self.inner.set_restore_timestamp(input);
199        self
200    }
201    /// <p>The restore timestamp in ISO 8601 format.</p>
202    pub fn get_restore_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
203        self.inner.get_restore_timestamp()
204    }
205    /// <p>Specifies the read/write throughput capacity mode for the target table. The options are:</p>
206    /// <ul>
207    /// <li>
208    /// <p><code>throughputMode:PAY_PER_REQUEST</code></p></li>
209    /// <li>
210    /// <p><code>throughputMode:PROVISIONED</code> - Provisioned capacity mode requires <code>readCapacityUnits</code> and <code>writeCapacityUnits</code> as input.</p></li>
211    /// </ul>
212    /// <p>The default is <code>throughput_mode:PAY_PER_REQUEST</code>.</p>
213    /// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/ReadWriteCapacityMode.html">Read/write capacity modes</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
214    pub fn capacity_specification_override(mut self, input: crate::types::CapacitySpecification) -> Self {
215        self.inner = self.inner.capacity_specification_override(input);
216        self
217    }
218    /// <p>Specifies the read/write throughput capacity mode for the target table. The options are:</p>
219    /// <ul>
220    /// <li>
221    /// <p><code>throughputMode:PAY_PER_REQUEST</code></p></li>
222    /// <li>
223    /// <p><code>throughputMode:PROVISIONED</code> - Provisioned capacity mode requires <code>readCapacityUnits</code> and <code>writeCapacityUnits</code> as input.</p></li>
224    /// </ul>
225    /// <p>The default is <code>throughput_mode:PAY_PER_REQUEST</code>.</p>
226    /// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/ReadWriteCapacityMode.html">Read/write capacity modes</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
227    pub fn set_capacity_specification_override(mut self, input: ::std::option::Option<crate::types::CapacitySpecification>) -> Self {
228        self.inner = self.inner.set_capacity_specification_override(input);
229        self
230    }
231    /// <p>Specifies the read/write throughput capacity mode for the target table. The options are:</p>
232    /// <ul>
233    /// <li>
234    /// <p><code>throughputMode:PAY_PER_REQUEST</code></p></li>
235    /// <li>
236    /// <p><code>throughputMode:PROVISIONED</code> - Provisioned capacity mode requires <code>readCapacityUnits</code> and <code>writeCapacityUnits</code> as input.</p></li>
237    /// </ul>
238    /// <p>The default is <code>throughput_mode:PAY_PER_REQUEST</code>.</p>
239    /// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/ReadWriteCapacityMode.html">Read/write capacity modes</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
240    pub fn get_capacity_specification_override(&self) -> &::std::option::Option<crate::types::CapacitySpecification> {
241        self.inner.get_capacity_specification_override()
242    }
243    /// <p>Specifies the encryption settings for the target table. You can choose one of the following KMS key (KMS key):</p>
244    /// <ul>
245    /// <li>
246    /// <p><code>type:AWS_OWNED_KMS_KEY</code> - This key is owned by Amazon Keyspaces.</p></li>
247    /// <li>
248    /// <p><code>type:CUSTOMER_MANAGED_KMS_KEY</code> - This key is stored in your account and is created, owned, and managed by you. This option requires the <code>kms_key_identifier</code> of the KMS key in Amazon Resource Name (ARN) format as input.</p></li>
249    /// </ul>
250    /// <p>The default is <code>type:AWS_OWNED_KMS_KEY</code>.</p>
251    /// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/EncryptionAtRest.html">Encryption at rest</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
252    pub fn encryption_specification_override(mut self, input: crate::types::EncryptionSpecification) -> Self {
253        self.inner = self.inner.encryption_specification_override(input);
254        self
255    }
256    /// <p>Specifies the encryption settings for the target table. You can choose one of the following KMS key (KMS key):</p>
257    /// <ul>
258    /// <li>
259    /// <p><code>type:AWS_OWNED_KMS_KEY</code> - This key is owned by Amazon Keyspaces.</p></li>
260    /// <li>
261    /// <p><code>type:CUSTOMER_MANAGED_KMS_KEY</code> - This key is stored in your account and is created, owned, and managed by you. This option requires the <code>kms_key_identifier</code> of the KMS key in Amazon Resource Name (ARN) format as input.</p></li>
262    /// </ul>
263    /// <p>The default is <code>type:AWS_OWNED_KMS_KEY</code>.</p>
264    /// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/EncryptionAtRest.html">Encryption at rest</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
265    pub fn set_encryption_specification_override(mut self, input: ::std::option::Option<crate::types::EncryptionSpecification>) -> Self {
266        self.inner = self.inner.set_encryption_specification_override(input);
267        self
268    }
269    /// <p>Specifies the encryption settings for the target table. You can choose one of the following KMS key (KMS key):</p>
270    /// <ul>
271    /// <li>
272    /// <p><code>type:AWS_OWNED_KMS_KEY</code> - This key is owned by Amazon Keyspaces.</p></li>
273    /// <li>
274    /// <p><code>type:CUSTOMER_MANAGED_KMS_KEY</code> - This key is stored in your account and is created, owned, and managed by you. This option requires the <code>kms_key_identifier</code> of the KMS key in Amazon Resource Name (ARN) format as input.</p></li>
275    /// </ul>
276    /// <p>The default is <code>type:AWS_OWNED_KMS_KEY</code>.</p>
277    /// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/EncryptionAtRest.html">Encryption at rest</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
278    pub fn get_encryption_specification_override(&self) -> &::std::option::Option<crate::types::EncryptionSpecification> {
279        self.inner.get_encryption_specification_override()
280    }
281    /// <p>Specifies the <code>pointInTimeRecovery</code> settings for the target table. The options are:</p>
282    /// <ul>
283    /// <li>
284    /// <p><code>status=ENABLED</code></p></li>
285    /// <li>
286    /// <p><code>status=DISABLED</code></p></li>
287    /// </ul>
288    /// <p>If it's not specified, the default is <code>status=DISABLED</code>.</p>
289    /// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/PointInTimeRecovery.html">Point-in-time recovery</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
290    pub fn point_in_time_recovery_override(mut self, input: crate::types::PointInTimeRecovery) -> Self {
291        self.inner = self.inner.point_in_time_recovery_override(input);
292        self
293    }
294    /// <p>Specifies the <code>pointInTimeRecovery</code> settings for the target table. The options are:</p>
295    /// <ul>
296    /// <li>
297    /// <p><code>status=ENABLED</code></p></li>
298    /// <li>
299    /// <p><code>status=DISABLED</code></p></li>
300    /// </ul>
301    /// <p>If it's not specified, the default is <code>status=DISABLED</code>.</p>
302    /// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/PointInTimeRecovery.html">Point-in-time recovery</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
303    pub fn set_point_in_time_recovery_override(mut self, input: ::std::option::Option<crate::types::PointInTimeRecovery>) -> Self {
304        self.inner = self.inner.set_point_in_time_recovery_override(input);
305        self
306    }
307    /// <p>Specifies the <code>pointInTimeRecovery</code> settings for the target table. The options are:</p>
308    /// <ul>
309    /// <li>
310    /// <p><code>status=ENABLED</code></p></li>
311    /// <li>
312    /// <p><code>status=DISABLED</code></p></li>
313    /// </ul>
314    /// <p>If it's not specified, the default is <code>status=DISABLED</code>.</p>
315    /// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/PointInTimeRecovery.html">Point-in-time recovery</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
316    pub fn get_point_in_time_recovery_override(&self) -> &::std::option::Option<crate::types::PointInTimeRecovery> {
317        self.inner.get_point_in_time_recovery_override()
318    }
319    ///
320    /// Appends an item to `tagsOverride`.
321    ///
322    /// To override the contents of this collection use [`set_tags_override`](Self::set_tags_override).
323    ///
324    /// <p>A list of key-value pair tags to be attached to the restored table.</p>
325    /// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/tagging-keyspaces.html">Adding tags and labels to Amazon Keyspaces resources</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
326    pub fn tags_override(mut self, input: crate::types::Tag) -> Self {
327        self.inner = self.inner.tags_override(input);
328        self
329    }
330    /// <p>A list of key-value pair tags to be attached to the restored table.</p>
331    /// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/tagging-keyspaces.html">Adding tags and labels to Amazon Keyspaces resources</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
332    pub fn set_tags_override(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
333        self.inner = self.inner.set_tags_override(input);
334        self
335    }
336    /// <p>A list of key-value pair tags to be attached to the restored table.</p>
337    /// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/tagging-keyspaces.html">Adding tags and labels to Amazon Keyspaces resources</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
338    pub fn get_tags_override(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
339        self.inner.get_tags_override()
340    }
341    /// <p>The optional auto scaling settings for the restored table in provisioned capacity mode. Specifies if the service can manage throughput capacity of a provisioned table automatically on your behalf. Amazon Keyspaces auto scaling helps you provision throughput capacity for variable workloads efficiently by increasing and decreasing your table's read and write capacity automatically in response to application traffic.</p>
342    /// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/autoscaling.html">Managing throughput capacity automatically with Amazon Keyspaces auto scaling</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
343    pub fn auto_scaling_specification(mut self, input: crate::types::AutoScalingSpecification) -> Self {
344        self.inner = self.inner.auto_scaling_specification(input);
345        self
346    }
347    /// <p>The optional auto scaling settings for the restored table in provisioned capacity mode. Specifies if the service can manage throughput capacity of a provisioned table automatically on your behalf. Amazon Keyspaces auto scaling helps you provision throughput capacity for variable workloads efficiently by increasing and decreasing your table's read and write capacity automatically in response to application traffic.</p>
348    /// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/autoscaling.html">Managing throughput capacity automatically with Amazon Keyspaces auto scaling</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
349    pub fn set_auto_scaling_specification(mut self, input: ::std::option::Option<crate::types::AutoScalingSpecification>) -> Self {
350        self.inner = self.inner.set_auto_scaling_specification(input);
351        self
352    }
353    /// <p>The optional auto scaling settings for the restored table in provisioned capacity mode. Specifies if the service can manage throughput capacity of a provisioned table automatically on your behalf. Amazon Keyspaces auto scaling helps you provision throughput capacity for variable workloads efficiently by increasing and decreasing your table's read and write capacity automatically in response to application traffic.</p>
354    /// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/autoscaling.html">Managing throughput capacity automatically with Amazon Keyspaces auto scaling</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
355    pub fn get_auto_scaling_specification(&self) -> &::std::option::Option<crate::types::AutoScalingSpecification> {
356        self.inner.get_auto_scaling_specification()
357    }
358    ///
359    /// Appends an item to `replicaSpecifications`.
360    ///
361    /// To override the contents of this collection use [`set_replica_specifications`](Self::set_replica_specifications).
362    ///
363    /// <p>The optional Region specific settings of a multi-Regional table.</p>
364    pub fn replica_specifications(mut self, input: crate::types::ReplicaSpecification) -> Self {
365        self.inner = self.inner.replica_specifications(input);
366        self
367    }
368    /// <p>The optional Region specific settings of a multi-Regional table.</p>
369    pub fn set_replica_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ReplicaSpecification>>) -> Self {
370        self.inner = self.inner.set_replica_specifications(input);
371        self
372    }
373    /// <p>The optional Region specific settings of a multi-Regional table.</p>
374    pub fn get_replica_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ReplicaSpecification>> {
375        self.inner.get_replica_specifications()
376    }
377}