aws_sdk_dynamodb/operation/restore_table_to_point_in_time/
_restore_table_to_point_in_time_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct RestoreTableToPointInTimeInput {
6    /// <p>The DynamoDB table that will be restored. This value is an Amazon Resource Name (ARN).</p>
7    pub source_table_arn: ::std::option::Option<::std::string::String>,
8    /// <p>Name of the source table that is being restored.</p>
9    pub source_table_name: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the new table to which it must be restored to.</p>
11    pub target_table_name: ::std::option::Option<::std::string::String>,
12    /// <p>Restore the table to the latest possible time. <code>LatestRestorableDateTime</code> is typically 5 minutes before the current time.</p>
13    pub use_latest_restorable_time: ::std::option::Option<bool>,
14    /// <p>Time in the past to restore the table to.</p>
15    pub restore_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
16    /// <p>The billing mode of the restored table.</p>
17    pub billing_mode_override: ::std::option::Option<crate::types::BillingMode>,
18    /// <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>
19    pub global_secondary_index_override: ::std::option::Option<::std::vec::Vec<crate::types::GlobalSecondaryIndex>>,
20    /// <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>
21    pub local_secondary_index_override: ::std::option::Option<::std::vec::Vec<crate::types::LocalSecondaryIndex>>,
22    /// <p>Provisioned throughput settings for the restored table.</p>
23    pub provisioned_throughput_override: ::std::option::Option<crate::types::ProvisionedThroughput>,
24    /// <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>
25    pub on_demand_throughput_override: ::std::option::Option<crate::types::OnDemandThroughput>,
26    /// <p>The new server-side encryption settings for the restored table.</p>
27    pub sse_specification_override: ::std::option::Option<crate::types::SseSpecification>,
28}
29impl RestoreTableToPointInTimeInput {
30    /// <p>The DynamoDB table that will be restored. This value is an Amazon Resource Name (ARN).</p>
31    pub fn source_table_arn(&self) -> ::std::option::Option<&str> {
32        self.source_table_arn.as_deref()
33    }
34    /// <p>Name of the source table that is being restored.</p>
35    pub fn source_table_name(&self) -> ::std::option::Option<&str> {
36        self.source_table_name.as_deref()
37    }
38    /// <p>The name of the new table to which it must be restored to.</p>
39    pub fn target_table_name(&self) -> ::std::option::Option<&str> {
40        self.target_table_name.as_deref()
41    }
42    /// <p>Restore the table to the latest possible time. <code>LatestRestorableDateTime</code> is typically 5 minutes before the current time.</p>
43    pub fn use_latest_restorable_time(&self) -> ::std::option::Option<bool> {
44        self.use_latest_restorable_time
45    }
46    /// <p>Time in the past to restore the table to.</p>
47    pub fn restore_date_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
48        self.restore_date_time.as_ref()
49    }
50    /// <p>The billing mode of the restored table.</p>
51    pub fn billing_mode_override(&self) -> ::std::option::Option<&crate::types::BillingMode> {
52        self.billing_mode_override.as_ref()
53    }
54    /// <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>
55    ///
56    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.global_secondary_index_override.is_none()`.
57    pub fn global_secondary_index_override(&self) -> &[crate::types::GlobalSecondaryIndex] {
58        self.global_secondary_index_override.as_deref().unwrap_or_default()
59    }
60    /// <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>
61    ///
62    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.local_secondary_index_override.is_none()`.
63    pub fn local_secondary_index_override(&self) -> &[crate::types::LocalSecondaryIndex] {
64        self.local_secondary_index_override.as_deref().unwrap_or_default()
65    }
66    /// <p>Provisioned throughput settings for the restored table.</p>
67    pub fn provisioned_throughput_override(&self) -> ::std::option::Option<&crate::types::ProvisionedThroughput> {
68        self.provisioned_throughput_override.as_ref()
69    }
70    /// <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>
71    pub fn on_demand_throughput_override(&self) -> ::std::option::Option<&crate::types::OnDemandThroughput> {
72        self.on_demand_throughput_override.as_ref()
73    }
74    /// <p>The new server-side encryption settings for the restored table.</p>
75    pub fn sse_specification_override(&self) -> ::std::option::Option<&crate::types::SseSpecification> {
76        self.sse_specification_override.as_ref()
77    }
78}
79impl RestoreTableToPointInTimeInput {
80    /// Creates a new builder-style object to manufacture [`RestoreTableToPointInTimeInput`](crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeInput).
81    pub fn builder() -> crate::operation::restore_table_to_point_in_time::builders::RestoreTableToPointInTimeInputBuilder {
82        crate::operation::restore_table_to_point_in_time::builders::RestoreTableToPointInTimeInputBuilder::default()
83    }
84}
85
86/// A builder for [`RestoreTableToPointInTimeInput`](crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeInput).
87#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
88#[non_exhaustive]
89pub struct RestoreTableToPointInTimeInputBuilder {
90    pub(crate) source_table_arn: ::std::option::Option<::std::string::String>,
91    pub(crate) source_table_name: ::std::option::Option<::std::string::String>,
92    pub(crate) target_table_name: ::std::option::Option<::std::string::String>,
93    pub(crate) use_latest_restorable_time: ::std::option::Option<bool>,
94    pub(crate) restore_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
95    pub(crate) billing_mode_override: ::std::option::Option<crate::types::BillingMode>,
96    pub(crate) global_secondary_index_override: ::std::option::Option<::std::vec::Vec<crate::types::GlobalSecondaryIndex>>,
97    pub(crate) local_secondary_index_override: ::std::option::Option<::std::vec::Vec<crate::types::LocalSecondaryIndex>>,
98    pub(crate) provisioned_throughput_override: ::std::option::Option<crate::types::ProvisionedThroughput>,
99    pub(crate) on_demand_throughput_override: ::std::option::Option<crate::types::OnDemandThroughput>,
100    pub(crate) sse_specification_override: ::std::option::Option<crate::types::SseSpecification>,
101}
102impl RestoreTableToPointInTimeInputBuilder {
103    /// <p>The DynamoDB table that will be restored. This value is an Amazon Resource Name (ARN).</p>
104    pub fn source_table_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105        self.source_table_arn = ::std::option::Option::Some(input.into());
106        self
107    }
108    /// <p>The DynamoDB table that will be restored. This value is an Amazon Resource Name (ARN).</p>
109    pub fn set_source_table_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110        self.source_table_arn = input;
111        self
112    }
113    /// <p>The DynamoDB table that will be restored. This value is an Amazon Resource Name (ARN).</p>
114    pub fn get_source_table_arn(&self) -> &::std::option::Option<::std::string::String> {
115        &self.source_table_arn
116    }
117    /// <p>Name of the source table that is being restored.</p>
118    pub fn source_table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.source_table_name = ::std::option::Option::Some(input.into());
120        self
121    }
122    /// <p>Name of the source table that is being restored.</p>
123    pub fn set_source_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.source_table_name = input;
125        self
126    }
127    /// <p>Name of the source table that is being restored.</p>
128    pub fn get_source_table_name(&self) -> &::std::option::Option<::std::string::String> {
129        &self.source_table_name
130    }
131    /// <p>The name of the new table to which it must be restored to.</p>
132    /// This field is required.
133    pub fn target_table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.target_table_name = ::std::option::Option::Some(input.into());
135        self
136    }
137    /// <p>The name of the new table to which it must be restored to.</p>
138    pub fn set_target_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.target_table_name = input;
140        self
141    }
142    /// <p>The name of the new table to which it must be restored to.</p>
143    pub fn get_target_table_name(&self) -> &::std::option::Option<::std::string::String> {
144        &self.target_table_name
145    }
146    /// <p>Restore the table to the latest possible time. <code>LatestRestorableDateTime</code> is typically 5 minutes before the current time.</p>
147    pub fn use_latest_restorable_time(mut self, input: bool) -> Self {
148        self.use_latest_restorable_time = ::std::option::Option::Some(input);
149        self
150    }
151    /// <p>Restore the table to the latest possible time. <code>LatestRestorableDateTime</code> is typically 5 minutes before the current time.</p>
152    pub fn set_use_latest_restorable_time(mut self, input: ::std::option::Option<bool>) -> Self {
153        self.use_latest_restorable_time = input;
154        self
155    }
156    /// <p>Restore the table to the latest possible time. <code>LatestRestorableDateTime</code> is typically 5 minutes before the current time.</p>
157    pub fn get_use_latest_restorable_time(&self) -> &::std::option::Option<bool> {
158        &self.use_latest_restorable_time
159    }
160    /// <p>Time in the past to restore the table to.</p>
161    pub fn restore_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
162        self.restore_date_time = ::std::option::Option::Some(input);
163        self
164    }
165    /// <p>Time in the past to restore the table to.</p>
166    pub fn set_restore_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
167        self.restore_date_time = input;
168        self
169    }
170    /// <p>Time in the past to restore the table to.</p>
171    pub fn get_restore_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
172        &self.restore_date_time
173    }
174    /// <p>The billing mode of the restored table.</p>
175    pub fn billing_mode_override(mut self, input: crate::types::BillingMode) -> Self {
176        self.billing_mode_override = ::std::option::Option::Some(input);
177        self
178    }
179    /// <p>The billing mode of the restored table.</p>
180    pub fn set_billing_mode_override(mut self, input: ::std::option::Option<crate::types::BillingMode>) -> Self {
181        self.billing_mode_override = input;
182        self
183    }
184    /// <p>The billing mode of the restored table.</p>
185    pub fn get_billing_mode_override(&self) -> &::std::option::Option<crate::types::BillingMode> {
186        &self.billing_mode_override
187    }
188    /// Appends an item to `global_secondary_index_override`.
189    ///
190    /// To override the contents of this collection use [`set_global_secondary_index_override`](Self::set_global_secondary_index_override).
191    ///
192    /// <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>
193    pub fn global_secondary_index_override(mut self, input: crate::types::GlobalSecondaryIndex) -> Self {
194        let mut v = self.global_secondary_index_override.unwrap_or_default();
195        v.push(input);
196        self.global_secondary_index_override = ::std::option::Option::Some(v);
197        self
198    }
199    /// <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>
200    pub fn set_global_secondary_index_override(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GlobalSecondaryIndex>>) -> Self {
201        self.global_secondary_index_override = input;
202        self
203    }
204    /// <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>
205    pub fn get_global_secondary_index_override(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GlobalSecondaryIndex>> {
206        &self.global_secondary_index_override
207    }
208    /// Appends an item to `local_secondary_index_override`.
209    ///
210    /// To override the contents of this collection use [`set_local_secondary_index_override`](Self::set_local_secondary_index_override).
211    ///
212    /// <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>
213    pub fn local_secondary_index_override(mut self, input: crate::types::LocalSecondaryIndex) -> Self {
214        let mut v = self.local_secondary_index_override.unwrap_or_default();
215        v.push(input);
216        self.local_secondary_index_override = ::std::option::Option::Some(v);
217        self
218    }
219    /// <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>
220    pub fn set_local_secondary_index_override(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LocalSecondaryIndex>>) -> Self {
221        self.local_secondary_index_override = input;
222        self
223    }
224    /// <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>
225    pub fn get_local_secondary_index_override(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LocalSecondaryIndex>> {
226        &self.local_secondary_index_override
227    }
228    /// <p>Provisioned throughput settings for the restored table.</p>
229    pub fn provisioned_throughput_override(mut self, input: crate::types::ProvisionedThroughput) -> Self {
230        self.provisioned_throughput_override = ::std::option::Option::Some(input);
231        self
232    }
233    /// <p>Provisioned throughput settings for the restored table.</p>
234    pub fn set_provisioned_throughput_override(mut self, input: ::std::option::Option<crate::types::ProvisionedThroughput>) -> Self {
235        self.provisioned_throughput_override = input;
236        self
237    }
238    /// <p>Provisioned throughput settings for the restored table.</p>
239    pub fn get_provisioned_throughput_override(&self) -> &::std::option::Option<crate::types::ProvisionedThroughput> {
240        &self.provisioned_throughput_override
241    }
242    /// <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>
243    pub fn on_demand_throughput_override(mut self, input: crate::types::OnDemandThroughput) -> Self {
244        self.on_demand_throughput_override = ::std::option::Option::Some(input);
245        self
246    }
247    /// <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>
248    pub fn set_on_demand_throughput_override(mut self, input: ::std::option::Option<crate::types::OnDemandThroughput>) -> Self {
249        self.on_demand_throughput_override = input;
250        self
251    }
252    /// <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>
253    pub fn get_on_demand_throughput_override(&self) -> &::std::option::Option<crate::types::OnDemandThroughput> {
254        &self.on_demand_throughput_override
255    }
256    /// <p>The new server-side encryption settings for the restored table.</p>
257    pub fn sse_specification_override(mut self, input: crate::types::SseSpecification) -> Self {
258        self.sse_specification_override = ::std::option::Option::Some(input);
259        self
260    }
261    /// <p>The new server-side encryption settings for the restored table.</p>
262    pub fn set_sse_specification_override(mut self, input: ::std::option::Option<crate::types::SseSpecification>) -> Self {
263        self.sse_specification_override = input;
264        self
265    }
266    /// <p>The new server-side encryption settings for the restored table.</p>
267    pub fn get_sse_specification_override(&self) -> &::std::option::Option<crate::types::SseSpecification> {
268        &self.sse_specification_override
269    }
270    /// Consumes the builder and constructs a [`RestoreTableToPointInTimeInput`](crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeInput).
271    pub fn build(
272        self,
273    ) -> ::std::result::Result<
274        crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeInput,
275        ::aws_smithy_types::error::operation::BuildError,
276    > {
277        ::std::result::Result::Ok(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeInput {
278            source_table_arn: self.source_table_arn,
279            source_table_name: self.source_table_name,
280            target_table_name: self.target_table_name,
281            use_latest_restorable_time: self.use_latest_restorable_time,
282            restore_date_time: self.restore_date_time,
283            billing_mode_override: self.billing_mode_override,
284            global_secondary_index_override: self.global_secondary_index_override,
285            local_secondary_index_override: self.local_secondary_index_override,
286            provisioned_throughput_override: self.provisioned_throughput_override,
287            on_demand_throughput_override: self.on_demand_throughput_override,
288            sse_specification_override: self.sse_specification_override,
289        })
290    }
291}