aws_sdk_glue/operation/get_tables/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_tables::_get_tables_output::GetTablesOutputBuilder;
3
4pub use crate::operation::get_tables::_get_tables_input::GetTablesInputBuilder;
5
6impl crate::operation::get_tables::builders::GetTablesInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::get_tables::GetTablesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_tables::GetTablesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_tables();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetTables`.
24///
25/// <p>Retrieves the definitions of some or all of the tables in a given <code>Database</code>.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct GetTablesFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::get_tables::builders::GetTablesInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl crate::client::customize::internal::CustomizableSend<crate::operation::get_tables::GetTablesOutput, crate::operation::get_tables::GetTablesError>
33    for GetTablesFluentBuilder
34{
35    fn send(
36        self,
37        config_override: crate::config::Builder,
38    ) -> crate::client::customize::internal::BoxFuture<
39        crate::client::customize::internal::SendResult<crate::operation::get_tables::GetTablesOutput, crate::operation::get_tables::GetTablesError>,
40    > {
41        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
42    }
43}
44impl GetTablesFluentBuilder {
45    /// Creates a new `GetTablesFluentBuilder`.
46    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
47        Self {
48            handle,
49            inner: ::std::default::Default::default(),
50            config_override: ::std::option::Option::None,
51        }
52    }
53    /// Access the GetTables as a reference.
54    pub fn as_input(&self) -> &crate::operation::get_tables::builders::GetTablesInputBuilder {
55        &self.inner
56    }
57    /// Sends the request and returns the response.
58    ///
59    /// If an error occurs, an `SdkError` will be returned with additional details that
60    /// can be matched against.
61    ///
62    /// By default, any retryable failures will be retried twice. Retry behavior
63    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
64    /// set when configuring the client.
65    pub async fn send(
66        self,
67    ) -> ::std::result::Result<
68        crate::operation::get_tables::GetTablesOutput,
69        ::aws_smithy_runtime_api::client::result::SdkError<
70            crate::operation::get_tables::GetTablesError,
71            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
72        >,
73    > {
74        let input = self
75            .inner
76            .build()
77            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
78        let runtime_plugins = crate::operation::get_tables::GetTables::operation_runtime_plugins(
79            self.handle.runtime_plugins.clone(),
80            &self.handle.conf,
81            self.config_override,
82        );
83        crate::operation::get_tables::GetTables::orchestrate(&runtime_plugins, input).await
84    }
85
86    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
87    pub fn customize(
88        self,
89    ) -> crate::client::customize::CustomizableOperation<
90        crate::operation::get_tables::GetTablesOutput,
91        crate::operation::get_tables::GetTablesError,
92        Self,
93    > {
94        crate::client::customize::CustomizableOperation::new(self)
95    }
96    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
97        self.set_config_override(::std::option::Option::Some(config_override.into()));
98        self
99    }
100
101    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
102        self.config_override = config_override;
103        self
104    }
105    /// Create a paginator for this request
106    ///
107    /// Paginators are used by calling [`send().await`](crate::operation::get_tables::paginator::GetTablesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
108    pub fn into_paginator(self) -> crate::operation::get_tables::paginator::GetTablesPaginator {
109        crate::operation::get_tables::paginator::GetTablesPaginator::new(self.handle, self.inner)
110    }
111    /// <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>
112    pub fn catalog_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.catalog_id(input.into());
114        self
115    }
116    /// <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>
117    pub fn set_catalog_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_catalog_id(input);
119        self
120    }
121    /// <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>
122    pub fn get_catalog_id(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_catalog_id()
124    }
125    /// <p>The database in the catalog whose tables to list. For Hive compatibility, this name is entirely lowercase.</p>
126    pub fn database_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.database_name(input.into());
128        self
129    }
130    /// <p>The database in the catalog whose tables to list. For Hive compatibility, this name is entirely lowercase.</p>
131    pub fn set_database_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_database_name(input);
133        self
134    }
135    /// <p>The database in the catalog whose tables to list. For Hive compatibility, this name is entirely lowercase.</p>
136    pub fn get_database_name(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_database_name()
138    }
139    /// <p>A regular expression pattern. If present, only those tables whose names match the pattern are returned.</p>
140    pub fn expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.expression(input.into());
142        self
143    }
144    /// <p>A regular expression pattern. If present, only those tables whose names match the pattern are returned.</p>
145    pub fn set_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_expression(input);
147        self
148    }
149    /// <p>A regular expression pattern. If present, only those tables whose names match the pattern are returned.</p>
150    pub fn get_expression(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_expression()
152    }
153    /// <p>A continuation token, included if this is a continuation call.</p>
154    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.next_token(input.into());
156        self
157    }
158    /// <p>A continuation token, included if this is a continuation call.</p>
159    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_next_token(input);
161        self
162    }
163    /// <p>A continuation token, included if this is a continuation call.</p>
164    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_next_token()
166    }
167    /// <p>The maximum number of tables to return in a single response.</p>
168    pub fn max_results(mut self, input: i32) -> Self {
169        self.inner = self.inner.max_results(input);
170        self
171    }
172    /// <p>The maximum number of tables to return in a single response.</p>
173    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
174        self.inner = self.inner.set_max_results(input);
175        self
176    }
177    /// <p>The maximum number of tables to return in a single response.</p>
178    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
179        self.inner.get_max_results()
180    }
181    /// <p>The transaction ID at which to read the table contents.</p>
182    pub fn transaction_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183        self.inner = self.inner.transaction_id(input.into());
184        self
185    }
186    /// <p>The transaction ID at which to read the table contents.</p>
187    pub fn set_transaction_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188        self.inner = self.inner.set_transaction_id(input);
189        self
190    }
191    /// <p>The transaction ID at which to read the table contents.</p>
192    pub fn get_transaction_id(&self) -> &::std::option::Option<::std::string::String> {
193        self.inner.get_transaction_id()
194    }
195    /// <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>
196    pub fn query_as_of_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
197        self.inner = self.inner.query_as_of_time(input);
198        self
199    }
200    /// <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>
201    pub fn set_query_as_of_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
202        self.inner = self.inner.set_query_as_of_time(input);
203        self
204    }
205    /// <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>
206    pub fn get_query_as_of_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
207        self.inner.get_query_as_of_time()
208    }
209    /// <p>A structure containing the Lake Formation <a href="https://docs.aws.amazon.com/glue/latest/webapi/API_AuditContext.html">audit context</a>.</p>
210    pub fn audit_context(mut self, input: crate::types::AuditContext) -> Self {
211        self.inner = self.inner.audit_context(input);
212        self
213    }
214    /// <p>A structure containing the Lake Formation <a href="https://docs.aws.amazon.com/glue/latest/webapi/API_AuditContext.html">audit context</a>.</p>
215    pub fn set_audit_context(mut self, input: ::std::option::Option<crate::types::AuditContext>) -> Self {
216        self.inner = self.inner.set_audit_context(input);
217        self
218    }
219    /// <p>A structure containing the Lake Formation <a href="https://docs.aws.amazon.com/glue/latest/webapi/API_AuditContext.html">audit context</a>.</p>
220    pub fn get_audit_context(&self) -> &::std::option::Option<crate::types::AuditContext> {
221        self.inner.get_audit_context()
222    }
223    /// <p>Specifies whether to include status details related to a request to create or update an Glue Data Catalog view.</p>
224    pub fn include_status_details(mut self, input: bool) -> Self {
225        self.inner = self.inner.include_status_details(input);
226        self
227    }
228    /// <p>Specifies whether to include status details related to a request to create or update an Glue Data Catalog view.</p>
229    pub fn set_include_status_details(mut self, input: ::std::option::Option<bool>) -> Self {
230        self.inner = self.inner.set_include_status_details(input);
231        self
232    }
233    /// <p>Specifies whether to include status details related to a request to create or update an Glue Data Catalog view.</p>
234    pub fn get_include_status_details(&self) -> &::std::option::Option<bool> {
235        self.inner.get_include_status_details()
236    }
237    ///
238    /// Appends an item to `AttributesToGet`.
239    ///
240    /// To override the contents of this collection use [`set_attributes_to_get`](Self::set_attributes_to_get).
241    ///
242    /// <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>
243    /// <p>The following are the valid combinations of values:</p>
244    /// <ul>
245    /// <li>
246    /// <p><code>NAME</code> - Names of all tables in the database.</p></li>
247    /// <li>
248    /// <p><code>NAME</code>, <code>TABLE_TYPE</code> - Names of all tables and the table types.</p></li>
249    /// </ul>
250    pub fn attributes_to_get(mut self, input: crate::types::TableAttributes) -> Self {
251        self.inner = self.inner.attributes_to_get(input);
252        self
253    }
254    /// <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>
255    /// <p>The following are the valid combinations of values:</p>
256    /// <ul>
257    /// <li>
258    /// <p><code>NAME</code> - Names of all tables in the database.</p></li>
259    /// <li>
260    /// <p><code>NAME</code>, <code>TABLE_TYPE</code> - Names of all tables and the table types.</p></li>
261    /// </ul>
262    pub fn set_attributes_to_get(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TableAttributes>>) -> Self {
263        self.inner = self.inner.set_attributes_to_get(input);
264        self
265    }
266    /// <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>
267    /// <p>The following are the valid combinations of values:</p>
268    /// <ul>
269    /// <li>
270    /// <p><code>NAME</code> - Names of all tables in the database.</p></li>
271    /// <li>
272    /// <p><code>NAME</code>, <code>TABLE_TYPE</code> - Names of all tables and the table types.</p></li>
273    /// </ul>
274    pub fn get_attributes_to_get(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TableAttributes>> {
275        self.inner.get_attributes_to_get()
276    }
277}