Skip to main content

aws_sdk_glue/operation/get_tables/
_get_tables_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 GetTablesInput {
6    /// <p>The ID of the Data Catalog where the tables reside. 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 database in the catalog whose tables to list. For Hive compatibility, this name is entirely lowercase.</p>
9    pub database_name: ::std::option::Option<::std::string::String>,
10    /// <p>A regular expression pattern. If present, only those tables whose names match the pattern are returned.</p>
11    pub expression: ::std::option::Option<::std::string::String>,
12    /// <p>A continuation token, included if this is a continuation call.</p>
13    pub next_token: ::std::option::Option<::std::string::String>,
14    /// <p>The maximum number of tables to return in a single response.</p>
15    pub max_results: ::std::option::Option<i32>,
16    /// <p>The transaction ID at which to read the table contents.</p>
17    pub transaction_id: ::std::option::Option<::std::string::String>,
18    /// <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>
19    pub query_as_of_time: ::std::option::Option<::aws_smithy_types::DateTime>,
20    /// <p>A structure containing the Lake Formation <a href="https://docs.aws.amazon.com/glue/latest/webapi/API_AuditContext.html">audit context</a>.</p>
21    pub audit_context: ::std::option::Option<crate::types::AuditContext>,
22    /// <p>Specifies which tables the <code>GetTables</code> call returns. The allowable values are <code>FEDERATED</code> or <code>ALL</code>.</p>
23    /// <ul>
24    /// <li>
25    /// <p>If set to <code>FEDERATED</code>, returns only federated tables, which reference an entity outside the Glue Data Catalog.</p></li>
26    /// <li>
27    /// <p>If set to <code>ALL</code>, returns all tables in the database, both federated and non-federated.</p></li>
28    /// </ul>
29    pub resource_share_type: ::std::option::Option<crate::types::TableResourceShareType>,
30    /// <p>Specifies whether to include status details related to a request to create or update an Glue Data Catalog view.</p>
31    pub include_status_details: ::std::option::Option<bool>,
32    /// <p>Specifies the table fields returned by the <code>GetTables</code> call. This parameter doesn’t accept an empty list. The request must include <code>NAME</code>.</p>
33    /// <p>The following are the valid combinations of values:</p>
34    /// <ul>
35    /// <li>
36    /// <p><code>NAME</code> - Names of all tables in the database.</p></li>
37    /// <li>
38    /// <p><code>NAME</code>, <code>TABLE_TYPE</code> - Names of all tables and the table types.</p></li>
39    /// </ul>
40    pub attributes_to_get: ::std::option::Option<::std::vec::Vec<crate::types::TableAttributes>>,
41}
42impl GetTablesInput {
43    /// <p>The ID of the Data Catalog where the tables reside. If none is provided, the Amazon Web Services account ID is used by default.</p>
44    pub fn catalog_id(&self) -> ::std::option::Option<&str> {
45        self.catalog_id.as_deref()
46    }
47    /// <p>The database in the catalog whose tables to list. For Hive compatibility, this name is entirely lowercase.</p>
48    pub fn database_name(&self) -> ::std::option::Option<&str> {
49        self.database_name.as_deref()
50    }
51    /// <p>A regular expression pattern. If present, only those tables whose names match the pattern are returned.</p>
52    pub fn expression(&self) -> ::std::option::Option<&str> {
53        self.expression.as_deref()
54    }
55    /// <p>A continuation token, included if this is a continuation call.</p>
56    pub fn next_token(&self) -> ::std::option::Option<&str> {
57        self.next_token.as_deref()
58    }
59    /// <p>The maximum number of tables to return in a single response.</p>
60    pub fn max_results(&self) -> ::std::option::Option<i32> {
61        self.max_results
62    }
63    /// <p>The transaction ID at which to read the table contents.</p>
64    pub fn transaction_id(&self) -> ::std::option::Option<&str> {
65        self.transaction_id.as_deref()
66    }
67    /// <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>
68    pub fn query_as_of_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
69        self.query_as_of_time.as_ref()
70    }
71    /// <p>A structure containing the Lake Formation <a href="https://docs.aws.amazon.com/glue/latest/webapi/API_AuditContext.html">audit context</a>.</p>
72    pub fn audit_context(&self) -> ::std::option::Option<&crate::types::AuditContext> {
73        self.audit_context.as_ref()
74    }
75    /// <p>Specifies which tables the <code>GetTables</code> call returns. The allowable values are <code>FEDERATED</code> or <code>ALL</code>.</p>
76    /// <ul>
77    /// <li>
78    /// <p>If set to <code>FEDERATED</code>, returns only federated tables, which reference an entity outside the Glue Data Catalog.</p></li>
79    /// <li>
80    /// <p>If set to <code>ALL</code>, returns all tables in the database, both federated and non-federated.</p></li>
81    /// </ul>
82    pub fn resource_share_type(&self) -> ::std::option::Option<&crate::types::TableResourceShareType> {
83        self.resource_share_type.as_ref()
84    }
85    /// <p>Specifies whether to include status details related to a request to create or update an Glue Data Catalog view.</p>
86    pub fn include_status_details(&self) -> ::std::option::Option<bool> {
87        self.include_status_details
88    }
89    /// <p>Specifies the table fields returned by the <code>GetTables</code> call. This parameter doesn’t accept an empty list. The request must include <code>NAME</code>.</p>
90    /// <p>The following are the valid combinations of values:</p>
91    /// <ul>
92    /// <li>
93    /// <p><code>NAME</code> - Names of all tables in the database.</p></li>
94    /// <li>
95    /// <p><code>NAME</code>, <code>TABLE_TYPE</code> - Names of all tables and the table types.</p></li>
96    /// </ul>
97    ///
98    /// 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()`.
99    pub fn attributes_to_get(&self) -> &[crate::types::TableAttributes] {
100        self.attributes_to_get.as_deref().unwrap_or_default()
101    }
102}
103impl GetTablesInput {
104    /// Creates a new builder-style object to manufacture [`GetTablesInput`](crate::operation::get_tables::GetTablesInput).
105    pub fn builder() -> crate::operation::get_tables::builders::GetTablesInputBuilder {
106        crate::operation::get_tables::builders::GetTablesInputBuilder::default()
107    }
108}
109
110/// A builder for [`GetTablesInput`](crate::operation::get_tables::GetTablesInput).
111#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
112#[non_exhaustive]
113pub struct GetTablesInputBuilder {
114    pub(crate) catalog_id: ::std::option::Option<::std::string::String>,
115    pub(crate) database_name: ::std::option::Option<::std::string::String>,
116    pub(crate) expression: ::std::option::Option<::std::string::String>,
117    pub(crate) next_token: ::std::option::Option<::std::string::String>,
118    pub(crate) max_results: ::std::option::Option<i32>,
119    pub(crate) transaction_id: ::std::option::Option<::std::string::String>,
120    pub(crate) query_as_of_time: ::std::option::Option<::aws_smithy_types::DateTime>,
121    pub(crate) audit_context: ::std::option::Option<crate::types::AuditContext>,
122    pub(crate) resource_share_type: ::std::option::Option<crate::types::TableResourceShareType>,
123    pub(crate) include_status_details: ::std::option::Option<bool>,
124    pub(crate) attributes_to_get: ::std::option::Option<::std::vec::Vec<crate::types::TableAttributes>>,
125}
126impl GetTablesInputBuilder {
127    /// <p>The ID of the Data Catalog where the tables reside. If none is provided, the Amazon Web Services account ID is used by default.</p>
128    pub fn catalog_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.catalog_id = ::std::option::Option::Some(input.into());
130        self
131    }
132    /// <p>The ID of the Data Catalog where the tables reside. If none is provided, the Amazon Web Services account ID is used by default.</p>
133    pub fn set_catalog_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.catalog_id = input;
135        self
136    }
137    /// <p>The ID of the Data Catalog where the tables reside. If none is provided, the Amazon Web Services account ID is used by default.</p>
138    pub fn get_catalog_id(&self) -> &::std::option::Option<::std::string::String> {
139        &self.catalog_id
140    }
141    /// <p>The database in the catalog whose tables to list. For Hive compatibility, this name is entirely lowercase.</p>
142    /// This field is required.
143    pub fn database_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.database_name = ::std::option::Option::Some(input.into());
145        self
146    }
147    /// <p>The database in the catalog whose tables to list. For Hive compatibility, this name is entirely lowercase.</p>
148    pub fn set_database_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.database_name = input;
150        self
151    }
152    /// <p>The database in the catalog whose tables to list. For Hive compatibility, this name is entirely lowercase.</p>
153    pub fn get_database_name(&self) -> &::std::option::Option<::std::string::String> {
154        &self.database_name
155    }
156    /// <p>A regular expression pattern. If present, only those tables whose names match the pattern are returned.</p>
157    pub fn expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.expression = ::std::option::Option::Some(input.into());
159        self
160    }
161    /// <p>A regular expression pattern. If present, only those tables whose names match the pattern are returned.</p>
162    pub fn set_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163        self.expression = input;
164        self
165    }
166    /// <p>A regular expression pattern. If present, only those tables whose names match the pattern are returned.</p>
167    pub fn get_expression(&self) -> &::std::option::Option<::std::string::String> {
168        &self.expression
169    }
170    /// <p>A continuation token, included if this is a continuation call.</p>
171    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172        self.next_token = ::std::option::Option::Some(input.into());
173        self
174    }
175    /// <p>A continuation token, included if this is a continuation call.</p>
176    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177        self.next_token = input;
178        self
179    }
180    /// <p>A continuation token, included if this is a continuation call.</p>
181    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
182        &self.next_token
183    }
184    /// <p>The maximum number of tables to return in a single response.</p>
185    pub fn max_results(mut self, input: i32) -> Self {
186        self.max_results = ::std::option::Option::Some(input);
187        self
188    }
189    /// <p>The maximum number of tables to return in a single response.</p>
190    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
191        self.max_results = input;
192        self
193    }
194    /// <p>The maximum number of tables to return in a single response.</p>
195    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
196        &self.max_results
197    }
198    /// <p>The transaction ID at which to read the table contents.</p>
199    pub fn transaction_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
200        self.transaction_id = ::std::option::Option::Some(input.into());
201        self
202    }
203    /// <p>The transaction ID at which to read the table contents.</p>
204    pub fn set_transaction_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
205        self.transaction_id = input;
206        self
207    }
208    /// <p>The transaction ID at which to read the table contents.</p>
209    pub fn get_transaction_id(&self) -> &::std::option::Option<::std::string::String> {
210        &self.transaction_id
211    }
212    /// <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>
213    pub fn query_as_of_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
214        self.query_as_of_time = ::std::option::Option::Some(input);
215        self
216    }
217    /// <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>
218    pub fn set_query_as_of_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
219        self.query_as_of_time = input;
220        self
221    }
222    /// <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>
223    pub fn get_query_as_of_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
224        &self.query_as_of_time
225    }
226    /// <p>A structure containing the Lake Formation <a href="https://docs.aws.amazon.com/glue/latest/webapi/API_AuditContext.html">audit context</a>.</p>
227    pub fn audit_context(mut self, input: crate::types::AuditContext) -> Self {
228        self.audit_context = ::std::option::Option::Some(input);
229        self
230    }
231    /// <p>A structure containing the Lake Formation <a href="https://docs.aws.amazon.com/glue/latest/webapi/API_AuditContext.html">audit context</a>.</p>
232    pub fn set_audit_context(mut self, input: ::std::option::Option<crate::types::AuditContext>) -> Self {
233        self.audit_context = input;
234        self
235    }
236    /// <p>A structure containing the Lake Formation <a href="https://docs.aws.amazon.com/glue/latest/webapi/API_AuditContext.html">audit context</a>.</p>
237    pub fn get_audit_context(&self) -> &::std::option::Option<crate::types::AuditContext> {
238        &self.audit_context
239    }
240    /// <p>Specifies which tables the <code>GetTables</code> call returns. The allowable values are <code>FEDERATED</code> or <code>ALL</code>.</p>
241    /// <ul>
242    /// <li>
243    /// <p>If set to <code>FEDERATED</code>, returns only federated tables, which reference an entity outside the Glue Data Catalog.</p></li>
244    /// <li>
245    /// <p>If set to <code>ALL</code>, returns all tables in the database, both federated and non-federated.</p></li>
246    /// </ul>
247    pub fn resource_share_type(mut self, input: crate::types::TableResourceShareType) -> Self {
248        self.resource_share_type = ::std::option::Option::Some(input);
249        self
250    }
251    /// <p>Specifies which tables the <code>GetTables</code> call returns. The allowable values are <code>FEDERATED</code> or <code>ALL</code>.</p>
252    /// <ul>
253    /// <li>
254    /// <p>If set to <code>FEDERATED</code>, returns only federated tables, which reference an entity outside the Glue Data Catalog.</p></li>
255    /// <li>
256    /// <p>If set to <code>ALL</code>, returns all tables in the database, both federated and non-federated.</p></li>
257    /// </ul>
258    pub fn set_resource_share_type(mut self, input: ::std::option::Option<crate::types::TableResourceShareType>) -> Self {
259        self.resource_share_type = input;
260        self
261    }
262    /// <p>Specifies which tables the <code>GetTables</code> call returns. The allowable values are <code>FEDERATED</code> or <code>ALL</code>.</p>
263    /// <ul>
264    /// <li>
265    /// <p>If set to <code>FEDERATED</code>, returns only federated tables, which reference an entity outside the Glue Data Catalog.</p></li>
266    /// <li>
267    /// <p>If set to <code>ALL</code>, returns all tables in the database, both federated and non-federated.</p></li>
268    /// </ul>
269    pub fn get_resource_share_type(&self) -> &::std::option::Option<crate::types::TableResourceShareType> {
270        &self.resource_share_type
271    }
272    /// <p>Specifies whether to include status details related to a request to create or update an Glue Data Catalog view.</p>
273    pub fn include_status_details(mut self, input: bool) -> Self {
274        self.include_status_details = ::std::option::Option::Some(input);
275        self
276    }
277    /// <p>Specifies whether to include status details related to a request to create or update an Glue Data Catalog view.</p>
278    pub fn set_include_status_details(mut self, input: ::std::option::Option<bool>) -> Self {
279        self.include_status_details = input;
280        self
281    }
282    /// <p>Specifies whether to include status details related to a request to create or update an Glue Data Catalog view.</p>
283    pub fn get_include_status_details(&self) -> &::std::option::Option<bool> {
284        &self.include_status_details
285    }
286    /// Appends an item to `attributes_to_get`.
287    ///
288    /// To override the contents of this collection use [`set_attributes_to_get`](Self::set_attributes_to_get).
289    ///
290    /// <p>Specifies the table fields returned by the <code>GetTables</code> call. This parameter doesn’t accept an empty list. The request must include <code>NAME</code>.</p>
291    /// <p>The following are the valid combinations of values:</p>
292    /// <ul>
293    /// <li>
294    /// <p><code>NAME</code> - Names of all tables in the database.</p></li>
295    /// <li>
296    /// <p><code>NAME</code>, <code>TABLE_TYPE</code> - Names of all tables and the table types.</p></li>
297    /// </ul>
298    pub fn attributes_to_get(mut self, input: crate::types::TableAttributes) -> Self {
299        let mut v = self.attributes_to_get.unwrap_or_default();
300        v.push(input);
301        self.attributes_to_get = ::std::option::Option::Some(v);
302        self
303    }
304    /// <p>Specifies the table fields returned by the <code>GetTables</code> call. This parameter doesn’t accept an empty list. The request must include <code>NAME</code>.</p>
305    /// <p>The following are the valid combinations of values:</p>
306    /// <ul>
307    /// <li>
308    /// <p><code>NAME</code> - Names of all tables in the database.</p></li>
309    /// <li>
310    /// <p><code>NAME</code>, <code>TABLE_TYPE</code> - Names of all tables and the table types.</p></li>
311    /// </ul>
312    pub fn set_attributes_to_get(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TableAttributes>>) -> Self {
313        self.attributes_to_get = input;
314        self
315    }
316    /// <p>Specifies the table fields returned by the <code>GetTables</code> call. This parameter doesn’t accept an empty list. The request must include <code>NAME</code>.</p>
317    /// <p>The following are the valid combinations of values:</p>
318    /// <ul>
319    /// <li>
320    /// <p><code>NAME</code> - Names of all tables in the database.</p></li>
321    /// <li>
322    /// <p><code>NAME</code>, <code>TABLE_TYPE</code> - Names of all tables and the table types.</p></li>
323    /// </ul>
324    pub fn get_attributes_to_get(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TableAttributes>> {
325        &self.attributes_to_get
326    }
327    /// Consumes the builder and constructs a [`GetTablesInput`](crate::operation::get_tables::GetTablesInput).
328    pub fn build(self) -> ::std::result::Result<crate::operation::get_tables::GetTablesInput, ::aws_smithy_types::error::operation::BuildError> {
329        ::std::result::Result::Ok(crate::operation::get_tables::GetTablesInput {
330            catalog_id: self.catalog_id,
331            database_name: self.database_name,
332            expression: self.expression,
333            next_token: self.next_token,
334            max_results: self.max_results,
335            transaction_id: self.transaction_id,
336            query_as_of_time: self.query_as_of_time,
337            audit_context: self.audit_context,
338            resource_share_type: self.resource_share_type,
339            include_status_details: self.include_status_details,
340            attributes_to_get: self.attributes_to_get,
341        })
342    }
343}