aws_sdk_keyspaces/operation/get_table/
_get_table_output.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 GetTableOutput {
6    /// <p>The name of the keyspace that the specified table is stored in.</p>
7    pub keyspace_name: ::std::string::String,
8    /// <p>The name of the specified table.</p>
9    pub table_name: ::std::string::String,
10    /// <p>The Amazon Resource Name (ARN) of the specified table.</p>
11    pub resource_arn: ::std::string::String,
12    /// <p>The creation timestamp of the specified table.</p>
13    pub creation_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
14    /// <p>The current status of the specified table.</p>
15    pub status: ::std::option::Option<crate::types::TableStatus>,
16    /// <p>The schema definition of the specified table.</p>
17    pub schema_definition: ::std::option::Option<crate::types::SchemaDefinition>,
18    /// <p>The read/write throughput capacity mode for a table. The options are:</p>
19    /// <ul>
20    /// <li>
21    /// <p><code>throughputMode:PAY_PER_REQUEST</code></p></li>
22    /// <li>
23    /// <p><code>throughputMode:PROVISIONED</code></p></li>
24    /// </ul>
25    pub capacity_specification: ::std::option::Option<crate::types::CapacitySpecificationSummary>,
26    /// <p>The encryption settings of the specified table.</p>
27    pub encryption_specification: ::std::option::Option<crate::types::EncryptionSpecification>,
28    /// <p>The point-in-time recovery status of the specified table.</p>
29    pub point_in_time_recovery: ::std::option::Option<crate::types::PointInTimeRecoverySummary>,
30    /// <p>The custom Time to Live settings of the specified table.</p>
31    pub ttl: ::std::option::Option<crate::types::TimeToLive>,
32    /// <p>The default Time to Live settings in seconds of the specified table.</p>
33    pub default_time_to_live: ::std::option::Option<i32>,
34    /// <p>The the description of the specified table.</p>
35    pub comment: ::std::option::Option<crate::types::Comment>,
36    /// <p>The client-side timestamps setting of the table.</p>
37    pub client_side_timestamps: ::std::option::Option<crate::types::ClientSideTimestamps>,
38    /// <p>Returns the Amazon Web Services Region specific settings of all Regions a multi-Region table is replicated in.</p>
39    pub replica_specifications: ::std::option::Option<::std::vec::Vec<crate::types::ReplicaSpecificationSummary>>,
40    /// <p>The Amazon Resource Name (ARN) of the stream.</p>
41    pub latest_stream_arn: ::std::option::Option<::std::string::String>,
42    /// <p>The CDC stream settings of the table.</p>
43    pub cdc_specification: ::std::option::Option<crate::types::CdcSpecificationSummary>,
44    _request_id: Option<String>,
45}
46impl GetTableOutput {
47    /// <p>The name of the keyspace that the specified table is stored in.</p>
48    pub fn keyspace_name(&self) -> &str {
49        use std::ops::Deref;
50        self.keyspace_name.deref()
51    }
52    /// <p>The name of the specified table.</p>
53    pub fn table_name(&self) -> &str {
54        use std::ops::Deref;
55        self.table_name.deref()
56    }
57    /// <p>The Amazon Resource Name (ARN) of the specified table.</p>
58    pub fn resource_arn(&self) -> &str {
59        use std::ops::Deref;
60        self.resource_arn.deref()
61    }
62    /// <p>The creation timestamp of the specified table.</p>
63    pub fn creation_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
64        self.creation_timestamp.as_ref()
65    }
66    /// <p>The current status of the specified table.</p>
67    pub fn status(&self) -> ::std::option::Option<&crate::types::TableStatus> {
68        self.status.as_ref()
69    }
70    /// <p>The schema definition of the specified table.</p>
71    pub fn schema_definition(&self) -> ::std::option::Option<&crate::types::SchemaDefinition> {
72        self.schema_definition.as_ref()
73    }
74    /// <p>The read/write throughput capacity mode for a table. The options are:</p>
75    /// <ul>
76    /// <li>
77    /// <p><code>throughputMode:PAY_PER_REQUEST</code></p></li>
78    /// <li>
79    /// <p><code>throughputMode:PROVISIONED</code></p></li>
80    /// </ul>
81    pub fn capacity_specification(&self) -> ::std::option::Option<&crate::types::CapacitySpecificationSummary> {
82        self.capacity_specification.as_ref()
83    }
84    /// <p>The encryption settings of the specified table.</p>
85    pub fn encryption_specification(&self) -> ::std::option::Option<&crate::types::EncryptionSpecification> {
86        self.encryption_specification.as_ref()
87    }
88    /// <p>The point-in-time recovery status of the specified table.</p>
89    pub fn point_in_time_recovery(&self) -> ::std::option::Option<&crate::types::PointInTimeRecoverySummary> {
90        self.point_in_time_recovery.as_ref()
91    }
92    /// <p>The custom Time to Live settings of the specified table.</p>
93    pub fn ttl(&self) -> ::std::option::Option<&crate::types::TimeToLive> {
94        self.ttl.as_ref()
95    }
96    /// <p>The default Time to Live settings in seconds of the specified table.</p>
97    pub fn default_time_to_live(&self) -> ::std::option::Option<i32> {
98        self.default_time_to_live
99    }
100    /// <p>The the description of the specified table.</p>
101    pub fn comment(&self) -> ::std::option::Option<&crate::types::Comment> {
102        self.comment.as_ref()
103    }
104    /// <p>The client-side timestamps setting of the table.</p>
105    pub fn client_side_timestamps(&self) -> ::std::option::Option<&crate::types::ClientSideTimestamps> {
106        self.client_side_timestamps.as_ref()
107    }
108    /// <p>Returns the Amazon Web Services Region specific settings of all Regions a multi-Region table is replicated in.</p>
109    ///
110    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.replica_specifications.is_none()`.
111    pub fn replica_specifications(&self) -> &[crate::types::ReplicaSpecificationSummary] {
112        self.replica_specifications.as_deref().unwrap_or_default()
113    }
114    /// <p>The Amazon Resource Name (ARN) of the stream.</p>
115    pub fn latest_stream_arn(&self) -> ::std::option::Option<&str> {
116        self.latest_stream_arn.as_deref()
117    }
118    /// <p>The CDC stream settings of the table.</p>
119    pub fn cdc_specification(&self) -> ::std::option::Option<&crate::types::CdcSpecificationSummary> {
120        self.cdc_specification.as_ref()
121    }
122}
123impl ::aws_types::request_id::RequestId for GetTableOutput {
124    fn request_id(&self) -> Option<&str> {
125        self._request_id.as_deref()
126    }
127}
128impl GetTableOutput {
129    /// Creates a new builder-style object to manufacture [`GetTableOutput`](crate::operation::get_table::GetTableOutput).
130    pub fn builder() -> crate::operation::get_table::builders::GetTableOutputBuilder {
131        crate::operation::get_table::builders::GetTableOutputBuilder::default()
132    }
133}
134
135/// A builder for [`GetTableOutput`](crate::operation::get_table::GetTableOutput).
136#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
137#[non_exhaustive]
138pub struct GetTableOutputBuilder {
139    pub(crate) keyspace_name: ::std::option::Option<::std::string::String>,
140    pub(crate) table_name: ::std::option::Option<::std::string::String>,
141    pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
142    pub(crate) creation_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
143    pub(crate) status: ::std::option::Option<crate::types::TableStatus>,
144    pub(crate) schema_definition: ::std::option::Option<crate::types::SchemaDefinition>,
145    pub(crate) capacity_specification: ::std::option::Option<crate::types::CapacitySpecificationSummary>,
146    pub(crate) encryption_specification: ::std::option::Option<crate::types::EncryptionSpecification>,
147    pub(crate) point_in_time_recovery: ::std::option::Option<crate::types::PointInTimeRecoverySummary>,
148    pub(crate) ttl: ::std::option::Option<crate::types::TimeToLive>,
149    pub(crate) default_time_to_live: ::std::option::Option<i32>,
150    pub(crate) comment: ::std::option::Option<crate::types::Comment>,
151    pub(crate) client_side_timestamps: ::std::option::Option<crate::types::ClientSideTimestamps>,
152    pub(crate) replica_specifications: ::std::option::Option<::std::vec::Vec<crate::types::ReplicaSpecificationSummary>>,
153    pub(crate) latest_stream_arn: ::std::option::Option<::std::string::String>,
154    pub(crate) cdc_specification: ::std::option::Option<crate::types::CdcSpecificationSummary>,
155    _request_id: Option<String>,
156}
157impl GetTableOutputBuilder {
158    /// <p>The name of the keyspace that the specified table is stored in.</p>
159    /// This field is required.
160    pub fn keyspace_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161        self.keyspace_name = ::std::option::Option::Some(input.into());
162        self
163    }
164    /// <p>The name of the keyspace that the specified table is stored in.</p>
165    pub fn set_keyspace_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
166        self.keyspace_name = input;
167        self
168    }
169    /// <p>The name of the keyspace that the specified table is stored in.</p>
170    pub fn get_keyspace_name(&self) -> &::std::option::Option<::std::string::String> {
171        &self.keyspace_name
172    }
173    /// <p>The name of the specified table.</p>
174    /// This field is required.
175    pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
176        self.table_name = ::std::option::Option::Some(input.into());
177        self
178    }
179    /// <p>The name of the specified table.</p>
180    pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
181        self.table_name = input;
182        self
183    }
184    /// <p>The name of the specified table.</p>
185    pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
186        &self.table_name
187    }
188    /// <p>The Amazon Resource Name (ARN) of the specified table.</p>
189    /// This field is required.
190    pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191        self.resource_arn = ::std::option::Option::Some(input.into());
192        self
193    }
194    /// <p>The Amazon Resource Name (ARN) of the specified table.</p>
195    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196        self.resource_arn = input;
197        self
198    }
199    /// <p>The Amazon Resource Name (ARN) of the specified table.</p>
200    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
201        &self.resource_arn
202    }
203    /// <p>The creation timestamp of the specified table.</p>
204    pub fn creation_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
205        self.creation_timestamp = ::std::option::Option::Some(input);
206        self
207    }
208    /// <p>The creation timestamp of the specified table.</p>
209    pub fn set_creation_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
210        self.creation_timestamp = input;
211        self
212    }
213    /// <p>The creation timestamp of the specified table.</p>
214    pub fn get_creation_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
215        &self.creation_timestamp
216    }
217    /// <p>The current status of the specified table.</p>
218    pub fn status(mut self, input: crate::types::TableStatus) -> Self {
219        self.status = ::std::option::Option::Some(input);
220        self
221    }
222    /// <p>The current status of the specified table.</p>
223    pub fn set_status(mut self, input: ::std::option::Option<crate::types::TableStatus>) -> Self {
224        self.status = input;
225        self
226    }
227    /// <p>The current status of the specified table.</p>
228    pub fn get_status(&self) -> &::std::option::Option<crate::types::TableStatus> {
229        &self.status
230    }
231    /// <p>The schema definition of the specified table.</p>
232    pub fn schema_definition(mut self, input: crate::types::SchemaDefinition) -> Self {
233        self.schema_definition = ::std::option::Option::Some(input);
234        self
235    }
236    /// <p>The schema definition of the specified table.</p>
237    pub fn set_schema_definition(mut self, input: ::std::option::Option<crate::types::SchemaDefinition>) -> Self {
238        self.schema_definition = input;
239        self
240    }
241    /// <p>The schema definition of the specified table.</p>
242    pub fn get_schema_definition(&self) -> &::std::option::Option<crate::types::SchemaDefinition> {
243        &self.schema_definition
244    }
245    /// <p>The read/write throughput capacity mode for a table. The options are:</p>
246    /// <ul>
247    /// <li>
248    /// <p><code>throughputMode:PAY_PER_REQUEST</code></p></li>
249    /// <li>
250    /// <p><code>throughputMode:PROVISIONED</code></p></li>
251    /// </ul>
252    pub fn capacity_specification(mut self, input: crate::types::CapacitySpecificationSummary) -> Self {
253        self.capacity_specification = ::std::option::Option::Some(input);
254        self
255    }
256    /// <p>The read/write throughput capacity mode for a table. The options are:</p>
257    /// <ul>
258    /// <li>
259    /// <p><code>throughputMode:PAY_PER_REQUEST</code></p></li>
260    /// <li>
261    /// <p><code>throughputMode:PROVISIONED</code></p></li>
262    /// </ul>
263    pub fn set_capacity_specification(mut self, input: ::std::option::Option<crate::types::CapacitySpecificationSummary>) -> Self {
264        self.capacity_specification = input;
265        self
266    }
267    /// <p>The read/write throughput capacity mode for a table. The options are:</p>
268    /// <ul>
269    /// <li>
270    /// <p><code>throughputMode:PAY_PER_REQUEST</code></p></li>
271    /// <li>
272    /// <p><code>throughputMode:PROVISIONED</code></p></li>
273    /// </ul>
274    pub fn get_capacity_specification(&self) -> &::std::option::Option<crate::types::CapacitySpecificationSummary> {
275        &self.capacity_specification
276    }
277    /// <p>The encryption settings of the specified table.</p>
278    pub fn encryption_specification(mut self, input: crate::types::EncryptionSpecification) -> Self {
279        self.encryption_specification = ::std::option::Option::Some(input);
280        self
281    }
282    /// <p>The encryption settings of the specified table.</p>
283    pub fn set_encryption_specification(mut self, input: ::std::option::Option<crate::types::EncryptionSpecification>) -> Self {
284        self.encryption_specification = input;
285        self
286    }
287    /// <p>The encryption settings of the specified table.</p>
288    pub fn get_encryption_specification(&self) -> &::std::option::Option<crate::types::EncryptionSpecification> {
289        &self.encryption_specification
290    }
291    /// <p>The point-in-time recovery status of the specified table.</p>
292    pub fn point_in_time_recovery(mut self, input: crate::types::PointInTimeRecoverySummary) -> Self {
293        self.point_in_time_recovery = ::std::option::Option::Some(input);
294        self
295    }
296    /// <p>The point-in-time recovery status of the specified table.</p>
297    pub fn set_point_in_time_recovery(mut self, input: ::std::option::Option<crate::types::PointInTimeRecoverySummary>) -> Self {
298        self.point_in_time_recovery = input;
299        self
300    }
301    /// <p>The point-in-time recovery status of the specified table.</p>
302    pub fn get_point_in_time_recovery(&self) -> &::std::option::Option<crate::types::PointInTimeRecoverySummary> {
303        &self.point_in_time_recovery
304    }
305    /// <p>The custom Time to Live settings of the specified table.</p>
306    pub fn ttl(mut self, input: crate::types::TimeToLive) -> Self {
307        self.ttl = ::std::option::Option::Some(input);
308        self
309    }
310    /// <p>The custom Time to Live settings of the specified table.</p>
311    pub fn set_ttl(mut self, input: ::std::option::Option<crate::types::TimeToLive>) -> Self {
312        self.ttl = input;
313        self
314    }
315    /// <p>The custom Time to Live settings of the specified table.</p>
316    pub fn get_ttl(&self) -> &::std::option::Option<crate::types::TimeToLive> {
317        &self.ttl
318    }
319    /// <p>The default Time to Live settings in seconds of the specified table.</p>
320    pub fn default_time_to_live(mut self, input: i32) -> Self {
321        self.default_time_to_live = ::std::option::Option::Some(input);
322        self
323    }
324    /// <p>The default Time to Live settings in seconds of the specified table.</p>
325    pub fn set_default_time_to_live(mut self, input: ::std::option::Option<i32>) -> Self {
326        self.default_time_to_live = input;
327        self
328    }
329    /// <p>The default Time to Live settings in seconds of the specified table.</p>
330    pub fn get_default_time_to_live(&self) -> &::std::option::Option<i32> {
331        &self.default_time_to_live
332    }
333    /// <p>The the description of the specified table.</p>
334    pub fn comment(mut self, input: crate::types::Comment) -> Self {
335        self.comment = ::std::option::Option::Some(input);
336        self
337    }
338    /// <p>The the description of the specified table.</p>
339    pub fn set_comment(mut self, input: ::std::option::Option<crate::types::Comment>) -> Self {
340        self.comment = input;
341        self
342    }
343    /// <p>The the description of the specified table.</p>
344    pub fn get_comment(&self) -> &::std::option::Option<crate::types::Comment> {
345        &self.comment
346    }
347    /// <p>The client-side timestamps setting of the table.</p>
348    pub fn client_side_timestamps(mut self, input: crate::types::ClientSideTimestamps) -> Self {
349        self.client_side_timestamps = ::std::option::Option::Some(input);
350        self
351    }
352    /// <p>The client-side timestamps setting of the table.</p>
353    pub fn set_client_side_timestamps(mut self, input: ::std::option::Option<crate::types::ClientSideTimestamps>) -> Self {
354        self.client_side_timestamps = input;
355        self
356    }
357    /// <p>The client-side timestamps setting of the table.</p>
358    pub fn get_client_side_timestamps(&self) -> &::std::option::Option<crate::types::ClientSideTimestamps> {
359        &self.client_side_timestamps
360    }
361    /// Appends an item to `replica_specifications`.
362    ///
363    /// To override the contents of this collection use [`set_replica_specifications`](Self::set_replica_specifications).
364    ///
365    /// <p>Returns the Amazon Web Services Region specific settings of all Regions a multi-Region table is replicated in.</p>
366    pub fn replica_specifications(mut self, input: crate::types::ReplicaSpecificationSummary) -> Self {
367        let mut v = self.replica_specifications.unwrap_or_default();
368        v.push(input);
369        self.replica_specifications = ::std::option::Option::Some(v);
370        self
371    }
372    /// <p>Returns the Amazon Web Services Region specific settings of all Regions a multi-Region table is replicated in.</p>
373    pub fn set_replica_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ReplicaSpecificationSummary>>) -> Self {
374        self.replica_specifications = input;
375        self
376    }
377    /// <p>Returns the Amazon Web Services Region specific settings of all Regions a multi-Region table is replicated in.</p>
378    pub fn get_replica_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ReplicaSpecificationSummary>> {
379        &self.replica_specifications
380    }
381    /// <p>The Amazon Resource Name (ARN) of the stream.</p>
382    pub fn latest_stream_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
383        self.latest_stream_arn = ::std::option::Option::Some(input.into());
384        self
385    }
386    /// <p>The Amazon Resource Name (ARN) of the stream.</p>
387    pub fn set_latest_stream_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
388        self.latest_stream_arn = input;
389        self
390    }
391    /// <p>The Amazon Resource Name (ARN) of the stream.</p>
392    pub fn get_latest_stream_arn(&self) -> &::std::option::Option<::std::string::String> {
393        &self.latest_stream_arn
394    }
395    /// <p>The CDC stream settings of the table.</p>
396    pub fn cdc_specification(mut self, input: crate::types::CdcSpecificationSummary) -> Self {
397        self.cdc_specification = ::std::option::Option::Some(input);
398        self
399    }
400    /// <p>The CDC stream settings of the table.</p>
401    pub fn set_cdc_specification(mut self, input: ::std::option::Option<crate::types::CdcSpecificationSummary>) -> Self {
402        self.cdc_specification = input;
403        self
404    }
405    /// <p>The CDC stream settings of the table.</p>
406    pub fn get_cdc_specification(&self) -> &::std::option::Option<crate::types::CdcSpecificationSummary> {
407        &self.cdc_specification
408    }
409    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
410        self._request_id = Some(request_id.into());
411        self
412    }
413
414    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
415        self._request_id = request_id;
416        self
417    }
418    /// Consumes the builder and constructs a [`GetTableOutput`](crate::operation::get_table::GetTableOutput).
419    /// This method will fail if any of the following fields are not set:
420    /// - [`keyspace_name`](crate::operation::get_table::builders::GetTableOutputBuilder::keyspace_name)
421    /// - [`table_name`](crate::operation::get_table::builders::GetTableOutputBuilder::table_name)
422    /// - [`resource_arn`](crate::operation::get_table::builders::GetTableOutputBuilder::resource_arn)
423    pub fn build(self) -> ::std::result::Result<crate::operation::get_table::GetTableOutput, ::aws_smithy_types::error::operation::BuildError> {
424        ::std::result::Result::Ok(crate::operation::get_table::GetTableOutput {
425            keyspace_name: self.keyspace_name.ok_or_else(|| {
426                ::aws_smithy_types::error::operation::BuildError::missing_field(
427                    "keyspace_name",
428                    "keyspace_name was not specified but it is required when building GetTableOutput",
429                )
430            })?,
431            table_name: self.table_name.ok_or_else(|| {
432                ::aws_smithy_types::error::operation::BuildError::missing_field(
433                    "table_name",
434                    "table_name was not specified but it is required when building GetTableOutput",
435                )
436            })?,
437            resource_arn: self.resource_arn.ok_or_else(|| {
438                ::aws_smithy_types::error::operation::BuildError::missing_field(
439                    "resource_arn",
440                    "resource_arn was not specified but it is required when building GetTableOutput",
441                )
442            })?,
443            creation_timestamp: self.creation_timestamp,
444            status: self.status,
445            schema_definition: self.schema_definition,
446            capacity_specification: self.capacity_specification,
447            encryption_specification: self.encryption_specification,
448            point_in_time_recovery: self.point_in_time_recovery,
449            ttl: self.ttl,
450            default_time_to_live: self.default_time_to_live,
451            comment: self.comment,
452            client_side_timestamps: self.client_side_timestamps,
453            replica_specifications: self.replica_specifications,
454            latest_stream_arn: self.latest_stream_arn,
455            cdc_specification: self.cdc_specification,
456            _request_id: self._request_id,
457        })
458    }
459}