aws_sdk_dynamodb/types/_source_table_details.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the details of the table when the backup was created.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct SourceTableDetails {
7 /// <p>The name of the table for which the backup was created.</p>
8 pub table_name: ::std::string::String,
9 /// <p>Unique identifier for the table for which the backup was created.</p>
10 pub table_id: ::std::string::String,
11 /// <p>ARN of the table for which backup was created.</p>
12 pub table_arn: ::std::option::Option<::std::string::String>,
13 /// <p>Size of the table in bytes. Note that this is an approximate value.</p>
14 pub table_size_bytes: ::std::option::Option<i64>,
15 /// <p>Schema of the table.</p>
16 pub key_schema: ::std::vec::Vec<crate::types::KeySchemaElement>,
17 /// <p>Time when the source table was created.</p>
18 pub table_creation_date_time: ::aws_smithy_types::DateTime,
19 /// <p>Read IOPs and Write IOPS on the table when the backup was created.</p>
20 pub provisioned_throughput: ::std::option::Option<crate::types::ProvisionedThroughput>,
21 /// <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>
22 pub on_demand_throughput: ::std::option::Option<crate::types::OnDemandThroughput>,
23 /// <p>Number of items in the table. Note that this is an approximate value.</p>
24 pub item_count: ::std::option::Option<i64>,
25 /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
26 /// <ul>
27 /// <li>
28 /// <p><code>PROVISIONED</code> - Sets the read/write capacity mode to <code>PROVISIONED</code>. We recommend using <code>PROVISIONED</code> for predictable workloads.</p></li>
29 /// <li>
30 /// <p><code>PAY_PER_REQUEST</code> - Sets the read/write capacity mode to <code>PAY_PER_REQUEST</code>. We recommend using <code>PAY_PER_REQUEST</code> for unpredictable workloads.</p></li>
31 /// </ul>
32 pub billing_mode: ::std::option::Option<crate::types::BillingMode>,
33}
34impl SourceTableDetails {
35 /// <p>The name of the table for which the backup was created.</p>
36 pub fn table_name(&self) -> &str {
37 use std::ops::Deref;
38 self.table_name.deref()
39 }
40 /// <p>Unique identifier for the table for which the backup was created.</p>
41 pub fn table_id(&self) -> &str {
42 use std::ops::Deref;
43 self.table_id.deref()
44 }
45 /// <p>ARN of the table for which backup was created.</p>
46 pub fn table_arn(&self) -> ::std::option::Option<&str> {
47 self.table_arn.as_deref()
48 }
49 /// <p>Size of the table in bytes. Note that this is an approximate value.</p>
50 pub fn table_size_bytes(&self) -> ::std::option::Option<i64> {
51 self.table_size_bytes
52 }
53 /// <p>Schema of the table.</p>
54 pub fn key_schema(&self) -> &[crate::types::KeySchemaElement] {
55 use std::ops::Deref;
56 self.key_schema.deref()
57 }
58 /// <p>Time when the source table was created.</p>
59 pub fn table_creation_date_time(&self) -> &::aws_smithy_types::DateTime {
60 &self.table_creation_date_time
61 }
62 /// <p>Read IOPs and Write IOPS on the table when the backup was created.</p>
63 pub fn provisioned_throughput(&self) -> ::std::option::Option<&crate::types::ProvisionedThroughput> {
64 self.provisioned_throughput.as_ref()
65 }
66 /// <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>
67 pub fn on_demand_throughput(&self) -> ::std::option::Option<&crate::types::OnDemandThroughput> {
68 self.on_demand_throughput.as_ref()
69 }
70 /// <p>Number of items in the table. Note that this is an approximate value.</p>
71 pub fn item_count(&self) -> ::std::option::Option<i64> {
72 self.item_count
73 }
74 /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
75 /// <ul>
76 /// <li>
77 /// <p><code>PROVISIONED</code> - Sets the read/write capacity mode to <code>PROVISIONED</code>. We recommend using <code>PROVISIONED</code> for predictable workloads.</p></li>
78 /// <li>
79 /// <p><code>PAY_PER_REQUEST</code> - Sets the read/write capacity mode to <code>PAY_PER_REQUEST</code>. We recommend using <code>PAY_PER_REQUEST</code> for unpredictable workloads.</p></li>
80 /// </ul>
81 pub fn billing_mode(&self) -> ::std::option::Option<&crate::types::BillingMode> {
82 self.billing_mode.as_ref()
83 }
84}
85impl SourceTableDetails {
86 /// Creates a new builder-style object to manufacture [`SourceTableDetails`](crate::types::SourceTableDetails).
87 pub fn builder() -> crate::types::builders::SourceTableDetailsBuilder {
88 crate::types::builders::SourceTableDetailsBuilder::default()
89 }
90}
91
92/// A builder for [`SourceTableDetails`](crate::types::SourceTableDetails).
93#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
94#[non_exhaustive]
95pub struct SourceTableDetailsBuilder {
96 pub(crate) table_name: ::std::option::Option<::std::string::String>,
97 pub(crate) table_id: ::std::option::Option<::std::string::String>,
98 pub(crate) table_arn: ::std::option::Option<::std::string::String>,
99 pub(crate) table_size_bytes: ::std::option::Option<i64>,
100 pub(crate) key_schema: ::std::option::Option<::std::vec::Vec<crate::types::KeySchemaElement>>,
101 pub(crate) table_creation_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
102 pub(crate) provisioned_throughput: ::std::option::Option<crate::types::ProvisionedThroughput>,
103 pub(crate) on_demand_throughput: ::std::option::Option<crate::types::OnDemandThroughput>,
104 pub(crate) item_count: ::std::option::Option<i64>,
105 pub(crate) billing_mode: ::std::option::Option<crate::types::BillingMode>,
106}
107impl SourceTableDetailsBuilder {
108 /// <p>The name of the table for which the backup was created.</p>
109 /// This field is required.
110 pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111 self.table_name = ::std::option::Option::Some(input.into());
112 self
113 }
114 /// <p>The name of the table for which the backup was created.</p>
115 pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116 self.table_name = input;
117 self
118 }
119 /// <p>The name of the table for which the backup was created.</p>
120 pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
121 &self.table_name
122 }
123 /// <p>Unique identifier for the table for which the backup was created.</p>
124 /// This field is required.
125 pub fn table_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126 self.table_id = ::std::option::Option::Some(input.into());
127 self
128 }
129 /// <p>Unique identifier for the table for which the backup was created.</p>
130 pub fn set_table_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131 self.table_id = input;
132 self
133 }
134 /// <p>Unique identifier for the table for which the backup was created.</p>
135 pub fn get_table_id(&self) -> &::std::option::Option<::std::string::String> {
136 &self.table_id
137 }
138 /// <p>ARN of the table for which backup was created.</p>
139 pub fn table_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140 self.table_arn = ::std::option::Option::Some(input.into());
141 self
142 }
143 /// <p>ARN of the table for which backup was created.</p>
144 pub fn set_table_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145 self.table_arn = input;
146 self
147 }
148 /// <p>ARN of the table for which backup was created.</p>
149 pub fn get_table_arn(&self) -> &::std::option::Option<::std::string::String> {
150 &self.table_arn
151 }
152 /// <p>Size of the table in bytes. Note that this is an approximate value.</p>
153 pub fn table_size_bytes(mut self, input: i64) -> Self {
154 self.table_size_bytes = ::std::option::Option::Some(input);
155 self
156 }
157 /// <p>Size of the table in bytes. Note that this is an approximate value.</p>
158 pub fn set_table_size_bytes(mut self, input: ::std::option::Option<i64>) -> Self {
159 self.table_size_bytes = input;
160 self
161 }
162 /// <p>Size of the table in bytes. Note that this is an approximate value.</p>
163 pub fn get_table_size_bytes(&self) -> &::std::option::Option<i64> {
164 &self.table_size_bytes
165 }
166 /// Appends an item to `key_schema`.
167 ///
168 /// To override the contents of this collection use [`set_key_schema`](Self::set_key_schema).
169 ///
170 /// <p>Schema of the table.</p>
171 pub fn key_schema(mut self, input: crate::types::KeySchemaElement) -> Self {
172 let mut v = self.key_schema.unwrap_or_default();
173 v.push(input);
174 self.key_schema = ::std::option::Option::Some(v);
175 self
176 }
177 /// <p>Schema of the table.</p>
178 pub fn set_key_schema(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::KeySchemaElement>>) -> Self {
179 self.key_schema = input;
180 self
181 }
182 /// <p>Schema of the table.</p>
183 pub fn get_key_schema(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::KeySchemaElement>> {
184 &self.key_schema
185 }
186 /// <p>Time when the source table was created.</p>
187 /// This field is required.
188 pub fn table_creation_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
189 self.table_creation_date_time = ::std::option::Option::Some(input);
190 self
191 }
192 /// <p>Time when the source table was created.</p>
193 pub fn set_table_creation_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
194 self.table_creation_date_time = input;
195 self
196 }
197 /// <p>Time when the source table was created.</p>
198 pub fn get_table_creation_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
199 &self.table_creation_date_time
200 }
201 /// <p>Read IOPs and Write IOPS on the table when the backup was created.</p>
202 /// This field is required.
203 pub fn provisioned_throughput(mut self, input: crate::types::ProvisionedThroughput) -> Self {
204 self.provisioned_throughput = ::std::option::Option::Some(input);
205 self
206 }
207 /// <p>Read IOPs and Write IOPS on the table when the backup was created.</p>
208 pub fn set_provisioned_throughput(mut self, input: ::std::option::Option<crate::types::ProvisionedThroughput>) -> Self {
209 self.provisioned_throughput = input;
210 self
211 }
212 /// <p>Read IOPs and Write IOPS on the table when the backup was created.</p>
213 pub fn get_provisioned_throughput(&self) -> &::std::option::Option<crate::types::ProvisionedThroughput> {
214 &self.provisioned_throughput
215 }
216 /// <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>
217 pub fn on_demand_throughput(mut self, input: crate::types::OnDemandThroughput) -> Self {
218 self.on_demand_throughput = ::std::option::Option::Some(input);
219 self
220 }
221 /// <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>
222 pub fn set_on_demand_throughput(mut self, input: ::std::option::Option<crate::types::OnDemandThroughput>) -> Self {
223 self.on_demand_throughput = input;
224 self
225 }
226 /// <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>
227 pub fn get_on_demand_throughput(&self) -> &::std::option::Option<crate::types::OnDemandThroughput> {
228 &self.on_demand_throughput
229 }
230 /// <p>Number of items in the table. Note that this is an approximate value.</p>
231 pub fn item_count(mut self, input: i64) -> Self {
232 self.item_count = ::std::option::Option::Some(input);
233 self
234 }
235 /// <p>Number of items in the table. Note that this is an approximate value.</p>
236 pub fn set_item_count(mut self, input: ::std::option::Option<i64>) -> Self {
237 self.item_count = input;
238 self
239 }
240 /// <p>Number of items in the table. Note that this is an approximate value.</p>
241 pub fn get_item_count(&self) -> &::std::option::Option<i64> {
242 &self.item_count
243 }
244 /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
245 /// <ul>
246 /// <li>
247 /// <p><code>PROVISIONED</code> - Sets the read/write capacity mode to <code>PROVISIONED</code>. We recommend using <code>PROVISIONED</code> for predictable workloads.</p></li>
248 /// <li>
249 /// <p><code>PAY_PER_REQUEST</code> - Sets the read/write capacity mode to <code>PAY_PER_REQUEST</code>. We recommend using <code>PAY_PER_REQUEST</code> for unpredictable workloads.</p></li>
250 /// </ul>
251 pub fn billing_mode(mut self, input: crate::types::BillingMode) -> Self {
252 self.billing_mode = ::std::option::Option::Some(input);
253 self
254 }
255 /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
256 /// <ul>
257 /// <li>
258 /// <p><code>PROVISIONED</code> - Sets the read/write capacity mode to <code>PROVISIONED</code>. We recommend using <code>PROVISIONED</code> for predictable workloads.</p></li>
259 /// <li>
260 /// <p><code>PAY_PER_REQUEST</code> - Sets the read/write capacity mode to <code>PAY_PER_REQUEST</code>. We recommend using <code>PAY_PER_REQUEST</code> for unpredictable workloads.</p></li>
261 /// </ul>
262 pub fn set_billing_mode(mut self, input: ::std::option::Option<crate::types::BillingMode>) -> Self {
263 self.billing_mode = input;
264 self
265 }
266 /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
267 /// <ul>
268 /// <li>
269 /// <p><code>PROVISIONED</code> - Sets the read/write capacity mode to <code>PROVISIONED</code>. We recommend using <code>PROVISIONED</code> for predictable workloads.</p></li>
270 /// <li>
271 /// <p><code>PAY_PER_REQUEST</code> - Sets the read/write capacity mode to <code>PAY_PER_REQUEST</code>. We recommend using <code>PAY_PER_REQUEST</code> for unpredictable workloads.</p></li>
272 /// </ul>
273 pub fn get_billing_mode(&self) -> &::std::option::Option<crate::types::BillingMode> {
274 &self.billing_mode
275 }
276 /// Consumes the builder and constructs a [`SourceTableDetails`](crate::types::SourceTableDetails).
277 /// This method will fail if any of the following fields are not set:
278 /// - [`table_name`](crate::types::builders::SourceTableDetailsBuilder::table_name)
279 /// - [`table_id`](crate::types::builders::SourceTableDetailsBuilder::table_id)
280 /// - [`key_schema`](crate::types::builders::SourceTableDetailsBuilder::key_schema)
281 /// - [`table_creation_date_time`](crate::types::builders::SourceTableDetailsBuilder::table_creation_date_time)
282 pub fn build(self) -> ::std::result::Result<crate::types::SourceTableDetails, ::aws_smithy_types::error::operation::BuildError> {
283 ::std::result::Result::Ok(crate::types::SourceTableDetails {
284 table_name: self.table_name.ok_or_else(|| {
285 ::aws_smithy_types::error::operation::BuildError::missing_field(
286 "table_name",
287 "table_name was not specified but it is required when building SourceTableDetails",
288 )
289 })?,
290 table_id: self.table_id.ok_or_else(|| {
291 ::aws_smithy_types::error::operation::BuildError::missing_field(
292 "table_id",
293 "table_id was not specified but it is required when building SourceTableDetails",
294 )
295 })?,
296 table_arn: self.table_arn,
297 table_size_bytes: self.table_size_bytes,
298 key_schema: self.key_schema.ok_or_else(|| {
299 ::aws_smithy_types::error::operation::BuildError::missing_field(
300 "key_schema",
301 "key_schema was not specified but it is required when building SourceTableDetails",
302 )
303 })?,
304 table_creation_date_time: self.table_creation_date_time.ok_or_else(|| {
305 ::aws_smithy_types::error::operation::BuildError::missing_field(
306 "table_creation_date_time",
307 "table_creation_date_time was not specified but it is required when building SourceTableDetails",
308 )
309 })?,
310 provisioned_throughput: self.provisioned_throughput,
311 on_demand_throughput: self.on_demand_throughput,
312 item_count: self.item_count,
313 billing_mode: self.billing_mode,
314 })
315 }
316}