aws_sdk_glue/operation/get_partitions/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_partitions::_get_partitions_output::GetPartitionsOutputBuilder;
3
4pub use crate::operation::get_partitions::_get_partitions_input::GetPartitionsInputBuilder;
5
6impl crate::operation::get_partitions::builders::GetPartitionsInputBuilder {
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_partitions::GetPartitionsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_partitions::GetPartitionsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_partitions();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetPartitions`.
24///
25/// <p>Retrieves information about the partitions in a table.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct GetPartitionsFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::get_partitions::builders::GetPartitionsInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::get_partitions::GetPartitionsOutput,
35        crate::operation::get_partitions::GetPartitionsError,
36    > for GetPartitionsFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::get_partitions::GetPartitionsOutput,
44            crate::operation::get_partitions::GetPartitionsError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl GetPartitionsFluentBuilder {
51    /// Creates a new `GetPartitionsFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the GetPartitions as a reference.
60    pub fn as_input(&self) -> &crate::operation::get_partitions::builders::GetPartitionsInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::get_partitions::GetPartitionsOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::get_partitions::GetPartitionsError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::get_partitions::GetPartitions::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::get_partitions::GetPartitions::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::get_partitions::GetPartitionsOutput,
97        crate::operation::get_partitions::GetPartitionsError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// Create a paginator for this request
112    ///
113    /// Paginators are used by calling [`send().await`](crate::operation::get_partitions::paginator::GetPartitionsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
114    pub fn into_paginator(self) -> crate::operation::get_partitions::paginator::GetPartitionsPaginator {
115        crate::operation::get_partitions::paginator::GetPartitionsPaginator::new(self.handle, self.inner)
116    }
117    /// <p>The ID of the Data Catalog where the partitions in question reside. If none is provided, the Amazon Web Services account ID is used by default.</p>
118    pub fn catalog_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.inner = self.inner.catalog_id(input.into());
120        self
121    }
122    /// <p>The ID of the Data Catalog where the partitions in question reside. If none is provided, the Amazon Web Services account ID is used by default.</p>
123    pub fn set_catalog_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.inner = self.inner.set_catalog_id(input);
125        self
126    }
127    /// <p>The ID of the Data Catalog where the partitions in question reside. If none is provided, the Amazon Web Services account ID is used by default.</p>
128    pub fn get_catalog_id(&self) -> &::std::option::Option<::std::string::String> {
129        self.inner.get_catalog_id()
130    }
131    /// <p>The name of the catalog database where the partitions reside.</p>
132    pub fn database_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.inner = self.inner.database_name(input.into());
134        self
135    }
136    /// <p>The name of the catalog database where the partitions reside.</p>
137    pub fn set_database_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.inner = self.inner.set_database_name(input);
139        self
140    }
141    /// <p>The name of the catalog database where the partitions reside.</p>
142    pub fn get_database_name(&self) -> &::std::option::Option<::std::string::String> {
143        self.inner.get_database_name()
144    }
145    /// <p>The name of the partitions' table.</p>
146    pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.inner = self.inner.table_name(input.into());
148        self
149    }
150    /// <p>The name of the partitions' table.</p>
151    pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.inner = self.inner.set_table_name(input);
153        self
154    }
155    /// <p>The name of the partitions' table.</p>
156    pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
157        self.inner.get_table_name()
158    }
159    /// <p>An expression that filters the partitions to be returned.</p>
160    /// <p>The expression uses SQL syntax similar to the SQL <code>WHERE</code> filter clause. The SQL statement parser <a href="http://jsqlparser.sourceforge.net/home.php">JSQLParser</a> parses the expression.</p>
161    /// <p><i>Operators</i>: The following are the operators that you can use in the <code>Expression</code> API call:</p>
162    /// <dl>
163    /// <dt>
164    /// =
165    /// </dt>
166    /// <dd>
167    /// <p>Checks whether the values of the two operands are equal; if yes, then the condition becomes true.</p>
168    /// <p>Example: Assume 'variable a' holds 10 and 'variable b' holds 20.</p>
169    /// <p>(a = b) is not true.</p>
170    /// </dd>
171    /// <dt>
172    /// &lt; &gt;
173    /// </dt>
174    /// <dd>
175    /// <p>Checks whether the values of two operands are equal; if the values are not equal, then the condition becomes true.</p>
176    /// <p>Example: (a &lt; &gt; b) is true.</p>
177    /// </dd>
178    /// <dt>
179    /// &gt;
180    /// </dt>
181    /// <dd>
182    /// <p>Checks whether the value of the left operand is greater than the value of the right operand; if yes, then the condition becomes true.</p>
183    /// <p>Example: (a &gt; b) is not true.</p>
184    /// </dd>
185    /// <dt>
186    /// &lt;
187    /// </dt>
188    /// <dd>
189    /// <p>Checks whether the value of the left operand is less than the value of the right operand; if yes, then the condition becomes true.</p>
190    /// <p>Example: (a &lt; b) is true.</p>
191    /// </dd>
192    /// <dt>
193    /// &gt;=
194    /// </dt>
195    /// <dd>
196    /// <p>Checks whether the value of the left operand is greater than or equal to the value of the right operand; if yes, then the condition becomes true.</p>
197    /// <p>Example: (a &gt;= b) is not true.</p>
198    /// </dd>
199    /// <dt>
200    /// &lt;=
201    /// </dt>
202    /// <dd>
203    /// <p>Checks whether the value of the left operand is less than or equal to the value of the right operand; if yes, then the condition becomes true.</p>
204    /// <p>Example: (a &lt;= b) is true.</p>
205    /// </dd>
206    /// <dt>
207    /// AND, OR, IN, BETWEEN, LIKE, NOT, IS NULL
208    /// </dt>
209    /// <dd>
210    /// <p>Logical operators.</p>
211    /// </dd>
212    /// </dl>
213    /// <p><i>Supported Partition Key Types</i>: The following are the supported partition keys.</p>
214    /// <ul>
215    /// <li>
216    /// <p><code>string</code></p></li>
217    /// <li>
218    /// <p><code>date</code></p></li>
219    /// <li>
220    /// <p><code>timestamp</code></p></li>
221    /// <li>
222    /// <p><code>int</code></p></li>
223    /// <li>
224    /// <p><code>bigint</code></p></li>
225    /// <li>
226    /// <p><code>long</code></p></li>
227    /// <li>
228    /// <p><code>tinyint</code></p></li>
229    /// <li>
230    /// <p><code>smallint</code></p></li>
231    /// <li>
232    /// <p><code>decimal</code></p></li>
233    /// </ul>
234    /// <p>If an type is encountered that is not valid, an exception is thrown.</p>
235    /// <p>The following list shows the valid operators on each type. When you define a crawler, the <code>partitionKey</code> type is created as a <code>STRING</code>, to be compatible with the catalog partitions.</p>
236    /// <p><i>Sample API Call</i>:</p>
237    pub fn expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
238        self.inner = self.inner.expression(input.into());
239        self
240    }
241    /// <p>An expression that filters the partitions to be returned.</p>
242    /// <p>The expression uses SQL syntax similar to the SQL <code>WHERE</code> filter clause. The SQL statement parser <a href="http://jsqlparser.sourceforge.net/home.php">JSQLParser</a> parses the expression.</p>
243    /// <p><i>Operators</i>: The following are the operators that you can use in the <code>Expression</code> API call:</p>
244    /// <dl>
245    /// <dt>
246    /// =
247    /// </dt>
248    /// <dd>
249    /// <p>Checks whether the values of the two operands are equal; if yes, then the condition becomes true.</p>
250    /// <p>Example: Assume 'variable a' holds 10 and 'variable b' holds 20.</p>
251    /// <p>(a = b) is not true.</p>
252    /// </dd>
253    /// <dt>
254    /// &lt; &gt;
255    /// </dt>
256    /// <dd>
257    /// <p>Checks whether the values of two operands are equal; if the values are not equal, then the condition becomes true.</p>
258    /// <p>Example: (a &lt; &gt; b) is true.</p>
259    /// </dd>
260    /// <dt>
261    /// &gt;
262    /// </dt>
263    /// <dd>
264    /// <p>Checks whether the value of the left operand is greater than the value of the right operand; if yes, then the condition becomes true.</p>
265    /// <p>Example: (a &gt; b) is not true.</p>
266    /// </dd>
267    /// <dt>
268    /// &lt;
269    /// </dt>
270    /// <dd>
271    /// <p>Checks whether the value of the left operand is less than the value of the right operand; if yes, then the condition becomes true.</p>
272    /// <p>Example: (a &lt; b) is true.</p>
273    /// </dd>
274    /// <dt>
275    /// &gt;=
276    /// </dt>
277    /// <dd>
278    /// <p>Checks whether the value of the left operand is greater than or equal to the value of the right operand; if yes, then the condition becomes true.</p>
279    /// <p>Example: (a &gt;= b) is not true.</p>
280    /// </dd>
281    /// <dt>
282    /// &lt;=
283    /// </dt>
284    /// <dd>
285    /// <p>Checks whether the value of the left operand is less than or equal to the value of the right operand; if yes, then the condition becomes true.</p>
286    /// <p>Example: (a &lt;= b) is true.</p>
287    /// </dd>
288    /// <dt>
289    /// AND, OR, IN, BETWEEN, LIKE, NOT, IS NULL
290    /// </dt>
291    /// <dd>
292    /// <p>Logical operators.</p>
293    /// </dd>
294    /// </dl>
295    /// <p><i>Supported Partition Key Types</i>: The following are the supported partition keys.</p>
296    /// <ul>
297    /// <li>
298    /// <p><code>string</code></p></li>
299    /// <li>
300    /// <p><code>date</code></p></li>
301    /// <li>
302    /// <p><code>timestamp</code></p></li>
303    /// <li>
304    /// <p><code>int</code></p></li>
305    /// <li>
306    /// <p><code>bigint</code></p></li>
307    /// <li>
308    /// <p><code>long</code></p></li>
309    /// <li>
310    /// <p><code>tinyint</code></p></li>
311    /// <li>
312    /// <p><code>smallint</code></p></li>
313    /// <li>
314    /// <p><code>decimal</code></p></li>
315    /// </ul>
316    /// <p>If an type is encountered that is not valid, an exception is thrown.</p>
317    /// <p>The following list shows the valid operators on each type. When you define a crawler, the <code>partitionKey</code> type is created as a <code>STRING</code>, to be compatible with the catalog partitions.</p>
318    /// <p><i>Sample API Call</i>:</p>
319    pub fn set_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
320        self.inner = self.inner.set_expression(input);
321        self
322    }
323    /// <p>An expression that filters the partitions to be returned.</p>
324    /// <p>The expression uses SQL syntax similar to the SQL <code>WHERE</code> filter clause. The SQL statement parser <a href="http://jsqlparser.sourceforge.net/home.php">JSQLParser</a> parses the expression.</p>
325    /// <p><i>Operators</i>: The following are the operators that you can use in the <code>Expression</code> API call:</p>
326    /// <dl>
327    /// <dt>
328    /// =
329    /// </dt>
330    /// <dd>
331    /// <p>Checks whether the values of the two operands are equal; if yes, then the condition becomes true.</p>
332    /// <p>Example: Assume 'variable a' holds 10 and 'variable b' holds 20.</p>
333    /// <p>(a = b) is not true.</p>
334    /// </dd>
335    /// <dt>
336    /// &lt; &gt;
337    /// </dt>
338    /// <dd>
339    /// <p>Checks whether the values of two operands are equal; if the values are not equal, then the condition becomes true.</p>
340    /// <p>Example: (a &lt; &gt; b) is true.</p>
341    /// </dd>
342    /// <dt>
343    /// &gt;
344    /// </dt>
345    /// <dd>
346    /// <p>Checks whether the value of the left operand is greater than the value of the right operand; if yes, then the condition becomes true.</p>
347    /// <p>Example: (a &gt; b) is not true.</p>
348    /// </dd>
349    /// <dt>
350    /// &lt;
351    /// </dt>
352    /// <dd>
353    /// <p>Checks whether the value of the left operand is less than the value of the right operand; if yes, then the condition becomes true.</p>
354    /// <p>Example: (a &lt; b) is true.</p>
355    /// </dd>
356    /// <dt>
357    /// &gt;=
358    /// </dt>
359    /// <dd>
360    /// <p>Checks whether the value of the left operand is greater than or equal to the value of the right operand; if yes, then the condition becomes true.</p>
361    /// <p>Example: (a &gt;= b) is not true.</p>
362    /// </dd>
363    /// <dt>
364    /// &lt;=
365    /// </dt>
366    /// <dd>
367    /// <p>Checks whether the value of the left operand is less than or equal to the value of the right operand; if yes, then the condition becomes true.</p>
368    /// <p>Example: (a &lt;= b) is true.</p>
369    /// </dd>
370    /// <dt>
371    /// AND, OR, IN, BETWEEN, LIKE, NOT, IS NULL
372    /// </dt>
373    /// <dd>
374    /// <p>Logical operators.</p>
375    /// </dd>
376    /// </dl>
377    /// <p><i>Supported Partition Key Types</i>: The following are the supported partition keys.</p>
378    /// <ul>
379    /// <li>
380    /// <p><code>string</code></p></li>
381    /// <li>
382    /// <p><code>date</code></p></li>
383    /// <li>
384    /// <p><code>timestamp</code></p></li>
385    /// <li>
386    /// <p><code>int</code></p></li>
387    /// <li>
388    /// <p><code>bigint</code></p></li>
389    /// <li>
390    /// <p><code>long</code></p></li>
391    /// <li>
392    /// <p><code>tinyint</code></p></li>
393    /// <li>
394    /// <p><code>smallint</code></p></li>
395    /// <li>
396    /// <p><code>decimal</code></p></li>
397    /// </ul>
398    /// <p>If an type is encountered that is not valid, an exception is thrown.</p>
399    /// <p>The following list shows the valid operators on each type. When you define a crawler, the <code>partitionKey</code> type is created as a <code>STRING</code>, to be compatible with the catalog partitions.</p>
400    /// <p><i>Sample API Call</i>:</p>
401    pub fn get_expression(&self) -> &::std::option::Option<::std::string::String> {
402        self.inner.get_expression()
403    }
404    /// <p>A continuation token, if this is not the first call to retrieve these partitions.</p>
405    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
406        self.inner = self.inner.next_token(input.into());
407        self
408    }
409    /// <p>A continuation token, if this is not the first call to retrieve these partitions.</p>
410    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
411        self.inner = self.inner.set_next_token(input);
412        self
413    }
414    /// <p>A continuation token, if this is not the first call to retrieve these partitions.</p>
415    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
416        self.inner.get_next_token()
417    }
418    /// <p>The segment of the table's partitions to scan in this request.</p>
419    pub fn segment(mut self, input: crate::types::Segment) -> Self {
420        self.inner = self.inner.segment(input);
421        self
422    }
423    /// <p>The segment of the table's partitions to scan in this request.</p>
424    pub fn set_segment(mut self, input: ::std::option::Option<crate::types::Segment>) -> Self {
425        self.inner = self.inner.set_segment(input);
426        self
427    }
428    /// <p>The segment of the table's partitions to scan in this request.</p>
429    pub fn get_segment(&self) -> &::std::option::Option<crate::types::Segment> {
430        self.inner.get_segment()
431    }
432    /// <p>The maximum number of partitions to return in a single response.</p>
433    pub fn max_results(mut self, input: i32) -> Self {
434        self.inner = self.inner.max_results(input);
435        self
436    }
437    /// <p>The maximum number of partitions to return in a single response.</p>
438    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
439        self.inner = self.inner.set_max_results(input);
440        self
441    }
442    /// <p>The maximum number of partitions to return in a single response.</p>
443    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
444        self.inner.get_max_results()
445    }
446    /// <p>When true, specifies not returning the partition column schema. Useful when you are interested only in other partition attributes such as partition values or location. This approach avoids the problem of a large response by not returning duplicate data.</p>
447    pub fn exclude_column_schema(mut self, input: bool) -> Self {
448        self.inner = self.inner.exclude_column_schema(input);
449        self
450    }
451    /// <p>When true, specifies not returning the partition column schema. Useful when you are interested only in other partition attributes such as partition values or location. This approach avoids the problem of a large response by not returning duplicate data.</p>
452    pub fn set_exclude_column_schema(mut self, input: ::std::option::Option<bool>) -> Self {
453        self.inner = self.inner.set_exclude_column_schema(input);
454        self
455    }
456    /// <p>When true, specifies not returning the partition column schema. Useful when you are interested only in other partition attributes such as partition values or location. This approach avoids the problem of a large response by not returning duplicate data.</p>
457    pub fn get_exclude_column_schema(&self) -> &::std::option::Option<bool> {
458        self.inner.get_exclude_column_schema()
459    }
460    /// <p>The transaction ID at which to read the partition contents.</p>
461    pub fn transaction_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
462        self.inner = self.inner.transaction_id(input.into());
463        self
464    }
465    /// <p>The transaction ID at which to read the partition contents.</p>
466    pub fn set_transaction_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
467        self.inner = self.inner.set_transaction_id(input);
468        self
469    }
470    /// <p>The transaction ID at which to read the partition contents.</p>
471    pub fn get_transaction_id(&self) -> &::std::option::Option<::std::string::String> {
472        self.inner.get_transaction_id()
473    }
474    /// <p>The time as of when to read the partition contents. If not set, the most recent transaction commit time will be used. Cannot be specified along with <code>TransactionId</code>.</p>
475    pub fn query_as_of_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
476        self.inner = self.inner.query_as_of_time(input);
477        self
478    }
479    /// <p>The time as of when to read the partition contents. If not set, the most recent transaction commit time will be used. Cannot be specified along with <code>TransactionId</code>.</p>
480    pub fn set_query_as_of_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
481        self.inner = self.inner.set_query_as_of_time(input);
482        self
483    }
484    /// <p>The time as of when to read the partition contents. If not set, the most recent transaction commit time will be used. Cannot be specified along with <code>TransactionId</code>.</p>
485    pub fn get_query_as_of_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
486        self.inner.get_query_as_of_time()
487    }
488}