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