aws_sdk_s3tables/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 table.</p>
7    pub name: ::std::string::String,
8    /// <p>The type of the table.</p>
9    pub r#type: crate::types::TableType,
10    /// <p>The Amazon Resource Name (ARN) of the table.</p>
11    pub table_arn: ::std::string::String,
12    /// <p>The namespace associated with the table.</p>
13    pub namespace: ::std::vec::Vec<::std::string::String>,
14    /// <p>The unique identifier of the namespace containing this table.</p>
15    pub namespace_id: ::std::option::Option<::std::string::String>,
16    /// <p>The version token of the table.</p>
17    pub version_token: ::std::string::String,
18    /// <p>The metadata location of the table.</p>
19    pub metadata_location: ::std::option::Option<::std::string::String>,
20    /// <p>The warehouse location of the table.</p>
21    pub warehouse_location: ::std::string::String,
22    /// <p>The date and time the table bucket was created at.</p>
23    pub created_at: ::aws_smithy_types::DateTime,
24    /// <p>The ID of the account that created the table.</p>
25    pub created_by: ::std::string::String,
26    /// <p>The service that manages the table.</p>
27    pub managed_by_service: ::std::option::Option<::std::string::String>,
28    /// <p>The date and time the table was last modified on.</p>
29    pub modified_at: ::aws_smithy_types::DateTime,
30    /// <p>The ID of the account that last modified the table.</p>
31    pub modified_by: ::std::string::String,
32    /// <p>The ID of the account that owns the table.</p>
33    pub owner_account_id: ::std::string::String,
34    /// <p>The format of the table.</p>
35    pub format: crate::types::OpenTableFormat,
36    /// <p>The unique identifier of the table bucket containing this table.</p>
37    pub table_bucket_id: ::std::option::Option<::std::string::String>,
38    /// <p>If this table is managed by S3 Tables, contains additional information such as replication details.</p>
39    pub managed_table_information: ::std::option::Option<crate::types::ManagedTableInformation>,
40    _request_id: Option<String>,
41}
42impl GetTableOutput {
43    /// <p>The name of the table.</p>
44    pub fn name(&self) -> &str {
45        use std::ops::Deref;
46        self.name.deref()
47    }
48    /// <p>The type of the table.</p>
49    pub fn r#type(&self) -> &crate::types::TableType {
50        &self.r#type
51    }
52    /// <p>The Amazon Resource Name (ARN) of the table.</p>
53    pub fn table_arn(&self) -> &str {
54        use std::ops::Deref;
55        self.table_arn.deref()
56    }
57    /// <p>The namespace associated with the table.</p>
58    pub fn namespace(&self) -> &[::std::string::String] {
59        use std::ops::Deref;
60        self.namespace.deref()
61    }
62    /// <p>The unique identifier of the namespace containing this table.</p>
63    pub fn namespace_id(&self) -> ::std::option::Option<&str> {
64        self.namespace_id.as_deref()
65    }
66    /// <p>The version token of the table.</p>
67    pub fn version_token(&self) -> &str {
68        use std::ops::Deref;
69        self.version_token.deref()
70    }
71    /// <p>The metadata location of the table.</p>
72    pub fn metadata_location(&self) -> ::std::option::Option<&str> {
73        self.metadata_location.as_deref()
74    }
75    /// <p>The warehouse location of the table.</p>
76    pub fn warehouse_location(&self) -> &str {
77        use std::ops::Deref;
78        self.warehouse_location.deref()
79    }
80    /// <p>The date and time the table bucket was created at.</p>
81    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
82        &self.created_at
83    }
84    /// <p>The ID of the account that created the table.</p>
85    pub fn created_by(&self) -> &str {
86        use std::ops::Deref;
87        self.created_by.deref()
88    }
89    /// <p>The service that manages the table.</p>
90    pub fn managed_by_service(&self) -> ::std::option::Option<&str> {
91        self.managed_by_service.as_deref()
92    }
93    /// <p>The date and time the table was last modified on.</p>
94    pub fn modified_at(&self) -> &::aws_smithy_types::DateTime {
95        &self.modified_at
96    }
97    /// <p>The ID of the account that last modified the table.</p>
98    pub fn modified_by(&self) -> &str {
99        use std::ops::Deref;
100        self.modified_by.deref()
101    }
102    /// <p>The ID of the account that owns the table.</p>
103    pub fn owner_account_id(&self) -> &str {
104        use std::ops::Deref;
105        self.owner_account_id.deref()
106    }
107    /// <p>The format of the table.</p>
108    pub fn format(&self) -> &crate::types::OpenTableFormat {
109        &self.format
110    }
111    /// <p>The unique identifier of the table bucket containing this table.</p>
112    pub fn table_bucket_id(&self) -> ::std::option::Option<&str> {
113        self.table_bucket_id.as_deref()
114    }
115    /// <p>If this table is managed by S3 Tables, contains additional information such as replication details.</p>
116    pub fn managed_table_information(&self) -> ::std::option::Option<&crate::types::ManagedTableInformation> {
117        self.managed_table_information.as_ref()
118    }
119}
120impl ::aws_types::request_id::RequestId for GetTableOutput {
121    fn request_id(&self) -> Option<&str> {
122        self._request_id.as_deref()
123    }
124}
125impl GetTableOutput {
126    /// Creates a new builder-style object to manufacture [`GetTableOutput`](crate::operation::get_table::GetTableOutput).
127    pub fn builder() -> crate::operation::get_table::builders::GetTableOutputBuilder {
128        crate::operation::get_table::builders::GetTableOutputBuilder::default()
129    }
130}
131
132/// A builder for [`GetTableOutput`](crate::operation::get_table::GetTableOutput).
133#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
134#[non_exhaustive]
135pub struct GetTableOutputBuilder {
136    pub(crate) name: ::std::option::Option<::std::string::String>,
137    pub(crate) r#type: ::std::option::Option<crate::types::TableType>,
138    pub(crate) table_arn: ::std::option::Option<::std::string::String>,
139    pub(crate) namespace: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
140    pub(crate) namespace_id: ::std::option::Option<::std::string::String>,
141    pub(crate) version_token: ::std::option::Option<::std::string::String>,
142    pub(crate) metadata_location: ::std::option::Option<::std::string::String>,
143    pub(crate) warehouse_location: ::std::option::Option<::std::string::String>,
144    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
145    pub(crate) created_by: ::std::option::Option<::std::string::String>,
146    pub(crate) managed_by_service: ::std::option::Option<::std::string::String>,
147    pub(crate) modified_at: ::std::option::Option<::aws_smithy_types::DateTime>,
148    pub(crate) modified_by: ::std::option::Option<::std::string::String>,
149    pub(crate) owner_account_id: ::std::option::Option<::std::string::String>,
150    pub(crate) format: ::std::option::Option<crate::types::OpenTableFormat>,
151    pub(crate) table_bucket_id: ::std::option::Option<::std::string::String>,
152    pub(crate) managed_table_information: ::std::option::Option<crate::types::ManagedTableInformation>,
153    _request_id: Option<String>,
154}
155impl GetTableOutputBuilder {
156    /// <p>The name of the table.</p>
157    /// This field is required.
158    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159        self.name = ::std::option::Option::Some(input.into());
160        self
161    }
162    /// <p>The name of the table.</p>
163    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.name = input;
165        self
166    }
167    /// <p>The name of the table.</p>
168    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
169        &self.name
170    }
171    /// <p>The type of the table.</p>
172    /// This field is required.
173    pub fn r#type(mut self, input: crate::types::TableType) -> Self {
174        self.r#type = ::std::option::Option::Some(input);
175        self
176    }
177    /// <p>The type of the table.</p>
178    pub fn set_type(mut self, input: ::std::option::Option<crate::types::TableType>) -> Self {
179        self.r#type = input;
180        self
181    }
182    /// <p>The type of the table.</p>
183    pub fn get_type(&self) -> &::std::option::Option<crate::types::TableType> {
184        &self.r#type
185    }
186    /// <p>The Amazon Resource Name (ARN) of the table.</p>
187    /// This field is required.
188    pub fn table_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
189        self.table_arn = ::std::option::Option::Some(input.into());
190        self
191    }
192    /// <p>The Amazon Resource Name (ARN) of the table.</p>
193    pub fn set_table_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
194        self.table_arn = input;
195        self
196    }
197    /// <p>The Amazon Resource Name (ARN) of the table.</p>
198    pub fn get_table_arn(&self) -> &::std::option::Option<::std::string::String> {
199        &self.table_arn
200    }
201    /// Appends an item to `namespace`.
202    ///
203    /// To override the contents of this collection use [`set_namespace`](Self::set_namespace).
204    ///
205    /// <p>The namespace associated with the table.</p>
206    pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
207        let mut v = self.namespace.unwrap_or_default();
208        v.push(input.into());
209        self.namespace = ::std::option::Option::Some(v);
210        self
211    }
212    /// <p>The namespace associated with the table.</p>
213    pub fn set_namespace(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
214        self.namespace = input;
215        self
216    }
217    /// <p>The namespace associated with the table.</p>
218    pub fn get_namespace(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
219        &self.namespace
220    }
221    /// <p>The unique identifier of the namespace containing this table.</p>
222    pub fn namespace_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
223        self.namespace_id = ::std::option::Option::Some(input.into());
224        self
225    }
226    /// <p>The unique identifier of the namespace containing this table.</p>
227    pub fn set_namespace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
228        self.namespace_id = input;
229        self
230    }
231    /// <p>The unique identifier of the namespace containing this table.</p>
232    pub fn get_namespace_id(&self) -> &::std::option::Option<::std::string::String> {
233        &self.namespace_id
234    }
235    /// <p>The version token of the table.</p>
236    /// This field is required.
237    pub fn version_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
238        self.version_token = ::std::option::Option::Some(input.into());
239        self
240    }
241    /// <p>The version token of the table.</p>
242    pub fn set_version_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
243        self.version_token = input;
244        self
245    }
246    /// <p>The version token of the table.</p>
247    pub fn get_version_token(&self) -> &::std::option::Option<::std::string::String> {
248        &self.version_token
249    }
250    /// <p>The metadata location of the table.</p>
251    pub fn metadata_location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
252        self.metadata_location = ::std::option::Option::Some(input.into());
253        self
254    }
255    /// <p>The metadata location of the table.</p>
256    pub fn set_metadata_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
257        self.metadata_location = input;
258        self
259    }
260    /// <p>The metadata location of the table.</p>
261    pub fn get_metadata_location(&self) -> &::std::option::Option<::std::string::String> {
262        &self.metadata_location
263    }
264    /// <p>The warehouse location of the table.</p>
265    /// This field is required.
266    pub fn warehouse_location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
267        self.warehouse_location = ::std::option::Option::Some(input.into());
268        self
269    }
270    /// <p>The warehouse location of the table.</p>
271    pub fn set_warehouse_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
272        self.warehouse_location = input;
273        self
274    }
275    /// <p>The warehouse location of the table.</p>
276    pub fn get_warehouse_location(&self) -> &::std::option::Option<::std::string::String> {
277        &self.warehouse_location
278    }
279    /// <p>The date and time the table bucket was created at.</p>
280    /// This field is required.
281    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
282        self.created_at = ::std::option::Option::Some(input);
283        self
284    }
285    /// <p>The date and time the table bucket was created at.</p>
286    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
287        self.created_at = input;
288        self
289    }
290    /// <p>The date and time the table bucket was created at.</p>
291    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
292        &self.created_at
293    }
294    /// <p>The ID of the account that created the table.</p>
295    /// This field is required.
296    pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
297        self.created_by = ::std::option::Option::Some(input.into());
298        self
299    }
300    /// <p>The ID of the account that created the table.</p>
301    pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
302        self.created_by = input;
303        self
304    }
305    /// <p>The ID of the account that created the table.</p>
306    pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
307        &self.created_by
308    }
309    /// <p>The service that manages the table.</p>
310    pub fn managed_by_service(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
311        self.managed_by_service = ::std::option::Option::Some(input.into());
312        self
313    }
314    /// <p>The service that manages the table.</p>
315    pub fn set_managed_by_service(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
316        self.managed_by_service = input;
317        self
318    }
319    /// <p>The service that manages the table.</p>
320    pub fn get_managed_by_service(&self) -> &::std::option::Option<::std::string::String> {
321        &self.managed_by_service
322    }
323    /// <p>The date and time the table was last modified on.</p>
324    /// This field is required.
325    pub fn modified_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
326        self.modified_at = ::std::option::Option::Some(input);
327        self
328    }
329    /// <p>The date and time the table was last modified on.</p>
330    pub fn set_modified_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
331        self.modified_at = input;
332        self
333    }
334    /// <p>The date and time the table was last modified on.</p>
335    pub fn get_modified_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
336        &self.modified_at
337    }
338    /// <p>The ID of the account that last modified the table.</p>
339    /// This field is required.
340    pub fn modified_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
341        self.modified_by = ::std::option::Option::Some(input.into());
342        self
343    }
344    /// <p>The ID of the account that last modified the table.</p>
345    pub fn set_modified_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
346        self.modified_by = input;
347        self
348    }
349    /// <p>The ID of the account that last modified the table.</p>
350    pub fn get_modified_by(&self) -> &::std::option::Option<::std::string::String> {
351        &self.modified_by
352    }
353    /// <p>The ID of the account that owns the table.</p>
354    /// This field is required.
355    pub fn owner_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
356        self.owner_account_id = ::std::option::Option::Some(input.into());
357        self
358    }
359    /// <p>The ID of the account that owns the table.</p>
360    pub fn set_owner_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
361        self.owner_account_id = input;
362        self
363    }
364    /// <p>The ID of the account that owns the table.</p>
365    pub fn get_owner_account_id(&self) -> &::std::option::Option<::std::string::String> {
366        &self.owner_account_id
367    }
368    /// <p>The format of the table.</p>
369    /// This field is required.
370    pub fn format(mut self, input: crate::types::OpenTableFormat) -> Self {
371        self.format = ::std::option::Option::Some(input);
372        self
373    }
374    /// <p>The format of the table.</p>
375    pub fn set_format(mut self, input: ::std::option::Option<crate::types::OpenTableFormat>) -> Self {
376        self.format = input;
377        self
378    }
379    /// <p>The format of the table.</p>
380    pub fn get_format(&self) -> &::std::option::Option<crate::types::OpenTableFormat> {
381        &self.format
382    }
383    /// <p>The unique identifier of the table bucket containing this table.</p>
384    pub fn table_bucket_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
385        self.table_bucket_id = ::std::option::Option::Some(input.into());
386        self
387    }
388    /// <p>The unique identifier of the table bucket containing this table.</p>
389    pub fn set_table_bucket_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
390        self.table_bucket_id = input;
391        self
392    }
393    /// <p>The unique identifier of the table bucket containing this table.</p>
394    pub fn get_table_bucket_id(&self) -> &::std::option::Option<::std::string::String> {
395        &self.table_bucket_id
396    }
397    /// <p>If this table is managed by S3 Tables, contains additional information such as replication details.</p>
398    pub fn managed_table_information(mut self, input: crate::types::ManagedTableInformation) -> Self {
399        self.managed_table_information = ::std::option::Option::Some(input);
400        self
401    }
402    /// <p>If this table is managed by S3 Tables, contains additional information such as replication details.</p>
403    pub fn set_managed_table_information(mut self, input: ::std::option::Option<crate::types::ManagedTableInformation>) -> Self {
404        self.managed_table_information = input;
405        self
406    }
407    /// <p>If this table is managed by S3 Tables, contains additional information such as replication details.</p>
408    pub fn get_managed_table_information(&self) -> &::std::option::Option<crate::types::ManagedTableInformation> {
409        &self.managed_table_information
410    }
411    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
412        self._request_id = Some(request_id.into());
413        self
414    }
415
416    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
417        self._request_id = request_id;
418        self
419    }
420    /// Consumes the builder and constructs a [`GetTableOutput`](crate::operation::get_table::GetTableOutput).
421    /// This method will fail if any of the following fields are not set:
422    /// - [`name`](crate::operation::get_table::builders::GetTableOutputBuilder::name)
423    /// - [`r#type`](crate::operation::get_table::builders::GetTableOutputBuilder::type)
424    /// - [`table_arn`](crate::operation::get_table::builders::GetTableOutputBuilder::table_arn)
425    /// - [`namespace`](crate::operation::get_table::builders::GetTableOutputBuilder::namespace)
426    /// - [`version_token`](crate::operation::get_table::builders::GetTableOutputBuilder::version_token)
427    /// - [`warehouse_location`](crate::operation::get_table::builders::GetTableOutputBuilder::warehouse_location)
428    /// - [`created_at`](crate::operation::get_table::builders::GetTableOutputBuilder::created_at)
429    /// - [`created_by`](crate::operation::get_table::builders::GetTableOutputBuilder::created_by)
430    /// - [`modified_at`](crate::operation::get_table::builders::GetTableOutputBuilder::modified_at)
431    /// - [`modified_by`](crate::operation::get_table::builders::GetTableOutputBuilder::modified_by)
432    /// - [`owner_account_id`](crate::operation::get_table::builders::GetTableOutputBuilder::owner_account_id)
433    /// - [`format`](crate::operation::get_table::builders::GetTableOutputBuilder::format)
434    pub fn build(self) -> ::std::result::Result<crate::operation::get_table::GetTableOutput, ::aws_smithy_types::error::operation::BuildError> {
435        ::std::result::Result::Ok(crate::operation::get_table::GetTableOutput {
436            name: self.name.ok_or_else(|| {
437                ::aws_smithy_types::error::operation::BuildError::missing_field(
438                    "name",
439                    "name was not specified but it is required when building GetTableOutput",
440                )
441            })?,
442            r#type: self.r#type.ok_or_else(|| {
443                ::aws_smithy_types::error::operation::BuildError::missing_field(
444                    "r#type",
445                    "r#type was not specified but it is required when building GetTableOutput",
446                )
447            })?,
448            table_arn: self.table_arn.ok_or_else(|| {
449                ::aws_smithy_types::error::operation::BuildError::missing_field(
450                    "table_arn",
451                    "table_arn was not specified but it is required when building GetTableOutput",
452                )
453            })?,
454            namespace: self.namespace.ok_or_else(|| {
455                ::aws_smithy_types::error::operation::BuildError::missing_field(
456                    "namespace",
457                    "namespace was not specified but it is required when building GetTableOutput",
458                )
459            })?,
460            namespace_id: self.namespace_id,
461            version_token: self.version_token.ok_or_else(|| {
462                ::aws_smithy_types::error::operation::BuildError::missing_field(
463                    "version_token",
464                    "version_token was not specified but it is required when building GetTableOutput",
465                )
466            })?,
467            metadata_location: self.metadata_location,
468            warehouse_location: self.warehouse_location.ok_or_else(|| {
469                ::aws_smithy_types::error::operation::BuildError::missing_field(
470                    "warehouse_location",
471                    "warehouse_location was not specified but it is required when building GetTableOutput",
472                )
473            })?,
474            created_at: self.created_at.ok_or_else(|| {
475                ::aws_smithy_types::error::operation::BuildError::missing_field(
476                    "created_at",
477                    "created_at was not specified but it is required when building GetTableOutput",
478                )
479            })?,
480            created_by: self.created_by.ok_or_else(|| {
481                ::aws_smithy_types::error::operation::BuildError::missing_field(
482                    "created_by",
483                    "created_by was not specified but it is required when building GetTableOutput",
484                )
485            })?,
486            managed_by_service: self.managed_by_service,
487            modified_at: self.modified_at.ok_or_else(|| {
488                ::aws_smithy_types::error::operation::BuildError::missing_field(
489                    "modified_at",
490                    "modified_at was not specified but it is required when building GetTableOutput",
491                )
492            })?,
493            modified_by: self.modified_by.ok_or_else(|| {
494                ::aws_smithy_types::error::operation::BuildError::missing_field(
495                    "modified_by",
496                    "modified_by was not specified but it is required when building GetTableOutput",
497                )
498            })?,
499            owner_account_id: self.owner_account_id.ok_or_else(|| {
500                ::aws_smithy_types::error::operation::BuildError::missing_field(
501                    "owner_account_id",
502                    "owner_account_id was not specified but it is required when building GetTableOutput",
503                )
504            })?,
505            format: self.format.ok_or_else(|| {
506                ::aws_smithy_types::error::operation::BuildError::missing_field(
507                    "format",
508                    "format was not specified but it is required when building GetTableOutput",
509                )
510            })?,
511            table_bucket_id: self.table_bucket_id,
512            managed_table_information: self.managed_table_information,
513            _request_id: self._request_id,
514        })
515    }
516}