Skip to main content

aws_sdk_glue/operation/get_table/
_get_table_input.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 GetTableInput {
6    /// <p>The ID of the Data Catalog where the table resides. If none is provided, the Amazon Web Services account ID is used by default.</p>
7    pub catalog_id: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the database in the catalog in which the table resides. For Hive compatibility, this name is entirely lowercase.</p>
9    pub database_name: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the table for which to retrieve the definition. For Hive compatibility, this name is entirely lowercase.</p>
11    pub name: ::std::option::Option<::std::string::String>,
12    /// <p>The transaction ID at which to read the table contents.</p>
13    pub transaction_id: ::std::option::Option<::std::string::String>,
14    /// <p>The time as of when to read the table contents. If not set, the most recent transaction commit time will be used. Cannot be specified along with <code>TransactionId</code>.</p>
15    pub query_as_of_time: ::std::option::Option<::aws_smithy_types::DateTime>,
16    /// <p>A structure containing the Lake Formation <a href="https://docs.aws.amazon.com/glue/latest/webapi/API_AuditContext.html">audit context</a>.</p>
17    pub audit_context: ::std::option::Option<crate::types::AuditContext>,
18    /// <p>Specifies whether to include status details related to a request to create or update an Glue Data Catalog view.</p>
19    pub include_status_details: ::std::option::Option<bool>,
20    /// <p>Specifies the table fields returned by the <code>GetTable</code> call. This parameter doesn't accept an empty list.</p>
21    /// <p>The following are the valid combinations of values:</p>
22    /// <ul>
23    /// <li>
24    /// <p><code>DEFAULT</code> - Returns the Hive-style table definition only.</p></li>
25    /// <li>
26    /// <p><code>LATEST_ICEBERG_METADATA</code> - Returns only the latest Apache Iceberg table metadata.</p></li>
27    /// <li>
28    /// <p><code>DEFAULT</code>, <code>LATEST_ICEBERG_METADATA</code> - Returns both the Hive-style table definition and the latest Apache Iceberg table metadata.</p></li>
29    /// </ul>
30    pub attributes_to_get: ::std::option::Option<::std::vec::Vec<crate::types::TableAttributes>>,
31}
32impl GetTableInput {
33    /// <p>The ID of the Data Catalog where the table resides. If none is provided, the Amazon Web Services account ID is used by default.</p>
34    pub fn catalog_id(&self) -> ::std::option::Option<&str> {
35        self.catalog_id.as_deref()
36    }
37    /// <p>The name of the database in the catalog in which the table resides. For Hive compatibility, this name is entirely lowercase.</p>
38    pub fn database_name(&self) -> ::std::option::Option<&str> {
39        self.database_name.as_deref()
40    }
41    /// <p>The name of the table for which to retrieve the definition. For Hive compatibility, this name is entirely lowercase.</p>
42    pub fn name(&self) -> ::std::option::Option<&str> {
43        self.name.as_deref()
44    }
45    /// <p>The transaction ID at which to read the table contents.</p>
46    pub fn transaction_id(&self) -> ::std::option::Option<&str> {
47        self.transaction_id.as_deref()
48    }
49    /// <p>The time as of when to read the table contents. If not set, the most recent transaction commit time will be used. Cannot be specified along with <code>TransactionId</code>.</p>
50    pub fn query_as_of_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
51        self.query_as_of_time.as_ref()
52    }
53    /// <p>A structure containing the Lake Formation <a href="https://docs.aws.amazon.com/glue/latest/webapi/API_AuditContext.html">audit context</a>.</p>
54    pub fn audit_context(&self) -> ::std::option::Option<&crate::types::AuditContext> {
55        self.audit_context.as_ref()
56    }
57    /// <p>Specifies whether to include status details related to a request to create or update an Glue Data Catalog view.</p>
58    pub fn include_status_details(&self) -> ::std::option::Option<bool> {
59        self.include_status_details
60    }
61    /// <p>Specifies the table fields returned by the <code>GetTable</code> call. This parameter doesn't accept an empty list.</p>
62    /// <p>The following are the valid combinations of values:</p>
63    /// <ul>
64    /// <li>
65    /// <p><code>DEFAULT</code> - Returns the Hive-style table definition only.</p></li>
66    /// <li>
67    /// <p><code>LATEST_ICEBERG_METADATA</code> - Returns only the latest Apache Iceberg table metadata.</p></li>
68    /// <li>
69    /// <p><code>DEFAULT</code>, <code>LATEST_ICEBERG_METADATA</code> - Returns both the Hive-style table definition and the latest Apache Iceberg table metadata.</p></li>
70    /// </ul>
71    ///
72    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.attributes_to_get.is_none()`.
73    pub fn attributes_to_get(&self) -> &[crate::types::TableAttributes] {
74        self.attributes_to_get.as_deref().unwrap_or_default()
75    }
76}
77impl GetTableInput {
78    /// Creates a new builder-style object to manufacture [`GetTableInput`](crate::operation::get_table::GetTableInput).
79    pub fn builder() -> crate::operation::get_table::builders::GetTableInputBuilder {
80        crate::operation::get_table::builders::GetTableInputBuilder::default()
81    }
82}
83
84/// A builder for [`GetTableInput`](crate::operation::get_table::GetTableInput).
85#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
86#[non_exhaustive]
87pub struct GetTableInputBuilder {
88    pub(crate) catalog_id: ::std::option::Option<::std::string::String>,
89    pub(crate) database_name: ::std::option::Option<::std::string::String>,
90    pub(crate) name: ::std::option::Option<::std::string::String>,
91    pub(crate) transaction_id: ::std::option::Option<::std::string::String>,
92    pub(crate) query_as_of_time: ::std::option::Option<::aws_smithy_types::DateTime>,
93    pub(crate) audit_context: ::std::option::Option<crate::types::AuditContext>,
94    pub(crate) include_status_details: ::std::option::Option<bool>,
95    pub(crate) attributes_to_get: ::std::option::Option<::std::vec::Vec<crate::types::TableAttributes>>,
96}
97impl GetTableInputBuilder {
98    /// <p>The ID of the Data Catalog where the table resides. If none is provided, the Amazon Web Services account ID is used by default.</p>
99    pub fn catalog_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
100        self.catalog_id = ::std::option::Option::Some(input.into());
101        self
102    }
103    /// <p>The ID of the Data Catalog where the table resides. If none is provided, the Amazon Web Services account ID is used by default.</p>
104    pub fn set_catalog_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
105        self.catalog_id = input;
106        self
107    }
108    /// <p>The ID of the Data Catalog where the table resides. If none is provided, the Amazon Web Services account ID is used by default.</p>
109    pub fn get_catalog_id(&self) -> &::std::option::Option<::std::string::String> {
110        &self.catalog_id
111    }
112    /// <p>The name of the database in the catalog in which the table resides. For Hive compatibility, this name is entirely lowercase.</p>
113    /// This field is required.
114    pub fn database_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.database_name = ::std::option::Option::Some(input.into());
116        self
117    }
118    /// <p>The name of the database in the catalog in which the table resides. For Hive compatibility, this name is entirely lowercase.</p>
119    pub fn set_database_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.database_name = input;
121        self
122    }
123    /// <p>The name of the database in the catalog in which the table resides. For Hive compatibility, this name is entirely lowercase.</p>
124    pub fn get_database_name(&self) -> &::std::option::Option<::std::string::String> {
125        &self.database_name
126    }
127    /// <p>The name of the table for which to retrieve the definition. For Hive compatibility, this name is entirely lowercase.</p>
128    /// This field is required.
129    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.name = ::std::option::Option::Some(input.into());
131        self
132    }
133    /// <p>The name of the table for which to retrieve the definition. For Hive compatibility, this name is entirely lowercase.</p>
134    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.name = input;
136        self
137    }
138    /// <p>The name of the table for which to retrieve the definition. For Hive compatibility, this name is entirely lowercase.</p>
139    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
140        &self.name
141    }
142    /// <p>The transaction ID at which to read the table contents.</p>
143    pub fn transaction_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.transaction_id = ::std::option::Option::Some(input.into());
145        self
146    }
147    /// <p>The transaction ID at which to read the table contents.</p>
148    pub fn set_transaction_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.transaction_id = input;
150        self
151    }
152    /// <p>The transaction ID at which to read the table contents.</p>
153    pub fn get_transaction_id(&self) -> &::std::option::Option<::std::string::String> {
154        &self.transaction_id
155    }
156    /// <p>The time as of when to read the table contents. If not set, the most recent transaction commit time will be used. Cannot be specified along with <code>TransactionId</code>.</p>
157    pub fn query_as_of_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
158        self.query_as_of_time = ::std::option::Option::Some(input);
159        self
160    }
161    /// <p>The time as of when to read the table contents. If not set, the most recent transaction commit time will be used. Cannot be specified along with <code>TransactionId</code>.</p>
162    pub fn set_query_as_of_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
163        self.query_as_of_time = input;
164        self
165    }
166    /// <p>The time as of when to read the table contents. If not set, the most recent transaction commit time will be used. Cannot be specified along with <code>TransactionId</code>.</p>
167    pub fn get_query_as_of_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
168        &self.query_as_of_time
169    }
170    /// <p>A structure containing the Lake Formation <a href="https://docs.aws.amazon.com/glue/latest/webapi/API_AuditContext.html">audit context</a>.</p>
171    pub fn audit_context(mut self, input: crate::types::AuditContext) -> Self {
172        self.audit_context = ::std::option::Option::Some(input);
173        self
174    }
175    /// <p>A structure containing the Lake Formation <a href="https://docs.aws.amazon.com/glue/latest/webapi/API_AuditContext.html">audit context</a>.</p>
176    pub fn set_audit_context(mut self, input: ::std::option::Option<crate::types::AuditContext>) -> Self {
177        self.audit_context = input;
178        self
179    }
180    /// <p>A structure containing the Lake Formation <a href="https://docs.aws.amazon.com/glue/latest/webapi/API_AuditContext.html">audit context</a>.</p>
181    pub fn get_audit_context(&self) -> &::std::option::Option<crate::types::AuditContext> {
182        &self.audit_context
183    }
184    /// <p>Specifies whether to include status details related to a request to create or update an Glue Data Catalog view.</p>
185    pub fn include_status_details(mut self, input: bool) -> Self {
186        self.include_status_details = ::std::option::Option::Some(input);
187        self
188    }
189    /// <p>Specifies whether to include status details related to a request to create or update an Glue Data Catalog view.</p>
190    pub fn set_include_status_details(mut self, input: ::std::option::Option<bool>) -> Self {
191        self.include_status_details = input;
192        self
193    }
194    /// <p>Specifies whether to include status details related to a request to create or update an Glue Data Catalog view.</p>
195    pub fn get_include_status_details(&self) -> &::std::option::Option<bool> {
196        &self.include_status_details
197    }
198    /// Appends an item to `attributes_to_get`.
199    ///
200    /// To override the contents of this collection use [`set_attributes_to_get`](Self::set_attributes_to_get).
201    ///
202    /// <p>Specifies the table fields returned by the <code>GetTable</code> call. This parameter doesn't accept an empty list.</p>
203    /// <p>The following are the valid combinations of values:</p>
204    /// <ul>
205    /// <li>
206    /// <p><code>DEFAULT</code> - Returns the Hive-style table definition only.</p></li>
207    /// <li>
208    /// <p><code>LATEST_ICEBERG_METADATA</code> - Returns only the latest Apache Iceberg table metadata.</p></li>
209    /// <li>
210    /// <p><code>DEFAULT</code>, <code>LATEST_ICEBERG_METADATA</code> - Returns both the Hive-style table definition and the latest Apache Iceberg table metadata.</p></li>
211    /// </ul>
212    pub fn attributes_to_get(mut self, input: crate::types::TableAttributes) -> Self {
213        let mut v = self.attributes_to_get.unwrap_or_default();
214        v.push(input);
215        self.attributes_to_get = ::std::option::Option::Some(v);
216        self
217    }
218    /// <p>Specifies the table fields returned by the <code>GetTable</code> call. This parameter doesn't accept an empty list.</p>
219    /// <p>The following are the valid combinations of values:</p>
220    /// <ul>
221    /// <li>
222    /// <p><code>DEFAULT</code> - Returns the Hive-style table definition only.</p></li>
223    /// <li>
224    /// <p><code>LATEST_ICEBERG_METADATA</code> - Returns only the latest Apache Iceberg table metadata.</p></li>
225    /// <li>
226    /// <p><code>DEFAULT</code>, <code>LATEST_ICEBERG_METADATA</code> - Returns both the Hive-style table definition and the latest Apache Iceberg table metadata.</p></li>
227    /// </ul>
228    pub fn set_attributes_to_get(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TableAttributes>>) -> Self {
229        self.attributes_to_get = input;
230        self
231    }
232    /// <p>Specifies the table fields returned by the <code>GetTable</code> call. This parameter doesn't accept an empty list.</p>
233    /// <p>The following are the valid combinations of values:</p>
234    /// <ul>
235    /// <li>
236    /// <p><code>DEFAULT</code> - Returns the Hive-style table definition only.</p></li>
237    /// <li>
238    /// <p><code>LATEST_ICEBERG_METADATA</code> - Returns only the latest Apache Iceberg table metadata.</p></li>
239    /// <li>
240    /// <p><code>DEFAULT</code>, <code>LATEST_ICEBERG_METADATA</code> - Returns both the Hive-style table definition and the latest Apache Iceberg table metadata.</p></li>
241    /// </ul>
242    pub fn get_attributes_to_get(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TableAttributes>> {
243        &self.attributes_to_get
244    }
245    /// Consumes the builder and constructs a [`GetTableInput`](crate::operation::get_table::GetTableInput).
246    pub fn build(self) -> ::std::result::Result<crate::operation::get_table::GetTableInput, ::aws_smithy_types::error::operation::BuildError> {
247        ::std::result::Result::Ok(crate::operation::get_table::GetTableInput {
248            catalog_id: self.catalog_id,
249            database_name: self.database_name,
250            name: self.name,
251            transaction_id: self.transaction_id,
252            query_as_of_time: self.query_as_of_time,
253            audit_context: self.audit_context,
254            include_status_details: self.include_status_details,
255            attributes_to_get: self.attributes_to_get,
256        })
257    }
258}