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