aws_sdk_redshiftdata/operation/describe_table/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_table::_describe_table_output::DescribeTableOutputBuilder;
3
4pub use crate::operation::describe_table::_describe_table_input::DescribeTableInputBuilder;
5
6impl crate::operation::describe_table::builders::DescribeTableInputBuilder {
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::describe_table::DescribeTableOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_table::DescribeTableError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_table();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribeTable`.
24///
25/// <p>Describes the detailed information about a table from metadata in the cluster. The information includes its columns. A token is returned to page through the column list. Depending on the authorization method, use one of the following combinations of request parameters:</p>
26/// <ul>
27/// <li>
28/// <p>Secrets Manager - when connecting to a cluster, provide the <code>secret-arn</code> of a secret stored in Secrets Manager which has <code>username</code> and <code>password</code>. The specified secret contains credentials to connect to the <code>database</code> you specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (<code>dbClusterIdentifier</code>), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name.</p></li>
29/// <li>
30/// <p>Temporary credentials - when connecting to your data warehouse, choose one of the following options:</p>
31/// <ul>
32/// <li>
33/// <p>When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, <code>arn:iam::123456789012:user:foo</code> has the database user name <code>IAM:foo</code>. Also, permission to call the <code>redshift-serverless:GetCredentials</code> operation is required.</p></li>
34/// <li>
35/// <p>When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, <code>arn:iam::123456789012:user:foo</code> has the database user name <code>IAM:foo</code>. Also, permission to call the <code>redshift:GetClusterCredentialsWithIAM</code> operation is required.</p></li>
36/// <li>
37/// <p>When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the <code>redshift:GetClusterCredentials</code> operation is required.</p></li>
38/// </ul></li>
39/// </ul>
40/// <p>For more information about the Amazon Redshift Data API and CLI usage examples, see <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html">Using the Amazon Redshift Data API</a> in the <i>Amazon Redshift Management Guide</i>.</p>
41#[derive(::std::clone::Clone, ::std::fmt::Debug)]
42pub struct DescribeTableFluentBuilder {
43    handle: ::std::sync::Arc<crate::client::Handle>,
44    inner: crate::operation::describe_table::builders::DescribeTableInputBuilder,
45    config_override: ::std::option::Option<crate::config::Builder>,
46}
47impl
48    crate::client::customize::internal::CustomizableSend<
49        crate::operation::describe_table::DescribeTableOutput,
50        crate::operation::describe_table::DescribeTableError,
51    > for DescribeTableFluentBuilder
52{
53    fn send(
54        self,
55        config_override: crate::config::Builder,
56    ) -> crate::client::customize::internal::BoxFuture<
57        crate::client::customize::internal::SendResult<
58            crate::operation::describe_table::DescribeTableOutput,
59            crate::operation::describe_table::DescribeTableError,
60        >,
61    > {
62        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
63    }
64}
65impl DescribeTableFluentBuilder {
66    /// Creates a new `DescribeTableFluentBuilder`.
67    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
68        Self {
69            handle,
70            inner: ::std::default::Default::default(),
71            config_override: ::std::option::Option::None,
72        }
73    }
74    /// Access the DescribeTable as a reference.
75    pub fn as_input(&self) -> &crate::operation::describe_table::builders::DescribeTableInputBuilder {
76        &self.inner
77    }
78    /// Sends the request and returns the response.
79    ///
80    /// If an error occurs, an `SdkError` will be returned with additional details that
81    /// can be matched against.
82    ///
83    /// By default, any retryable failures will be retried twice. Retry behavior
84    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
85    /// set when configuring the client.
86    pub async fn send(
87        self,
88    ) -> ::std::result::Result<
89        crate::operation::describe_table::DescribeTableOutput,
90        ::aws_smithy_runtime_api::client::result::SdkError<
91            crate::operation::describe_table::DescribeTableError,
92            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
93        >,
94    > {
95        let input = self
96            .inner
97            .build()
98            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
99        let runtime_plugins = crate::operation::describe_table::DescribeTable::operation_runtime_plugins(
100            self.handle.runtime_plugins.clone(),
101            &self.handle.conf,
102            self.config_override,
103        );
104        crate::operation::describe_table::DescribeTable::orchestrate(&runtime_plugins, input).await
105    }
106
107    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
108    pub fn customize(
109        self,
110    ) -> crate::client::customize::CustomizableOperation<
111        crate::operation::describe_table::DescribeTableOutput,
112        crate::operation::describe_table::DescribeTableError,
113        Self,
114    > {
115        crate::client::customize::CustomizableOperation::new(self)
116    }
117    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
118        self.set_config_override(::std::option::Option::Some(config_override.into()));
119        self
120    }
121
122    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
123        self.config_override = config_override;
124        self
125    }
126    /// Create a paginator for this request
127    ///
128    /// Paginators are used by calling [`send().await`](crate::operation::describe_table::paginator::DescribeTablePaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
129    pub fn into_paginator(self) -> crate::operation::describe_table::paginator::DescribeTablePaginator {
130        crate::operation::describe_table::paginator::DescribeTablePaginator::new(self.handle, self.inner)
131    }
132    /// <p>The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.</p>
133    pub fn cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.inner = self.inner.cluster_identifier(input.into());
135        self
136    }
137    /// <p>The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.</p>
138    pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.inner = self.inner.set_cluster_identifier(input);
140        self
141    }
142    /// <p>The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.</p>
143    pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
144        self.inner.get_cluster_identifier()
145    }
146    /// <p>The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.</p>
147    pub fn secret_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.secret_arn(input.into());
149        self
150    }
151    /// <p>The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.</p>
152    pub fn set_secret_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.inner = self.inner.set_secret_arn(input);
154        self
155    }
156    /// <p>The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.</p>
157    pub fn get_secret_arn(&self) -> &::std::option::Option<::std::string::String> {
158        self.inner.get_secret_arn()
159    }
160    /// <p>The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.</p>
161    pub fn db_user(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
162        self.inner = self.inner.db_user(input.into());
163        self
164    }
165    /// <p>The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.</p>
166    pub fn set_db_user(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167        self.inner = self.inner.set_db_user(input);
168        self
169    }
170    /// <p>The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.</p>
171    pub fn get_db_user(&self) -> &::std::option::Option<::std::string::String> {
172        self.inner.get_db_user()
173    }
174    /// <p>The name of the database that contains the tables to be described. If <code>ConnectedDatabase</code> is not specified, this is also the database to connect to with your authentication credentials.</p>
175    pub fn database(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
176        self.inner = self.inner.database(input.into());
177        self
178    }
179    /// <p>The name of the database that contains the tables to be described. If <code>ConnectedDatabase</code> is not specified, this is also the database to connect to with your authentication credentials.</p>
180    pub fn set_database(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
181        self.inner = self.inner.set_database(input);
182        self
183    }
184    /// <p>The name of the database that contains the tables to be described. If <code>ConnectedDatabase</code> is not specified, this is also the database to connect to with your authentication credentials.</p>
185    pub fn get_database(&self) -> &::std::option::Option<::std::string::String> {
186        self.inner.get_database()
187    }
188    /// <p>A database name. The connected database is specified when you connect with your authentication credentials.</p>
189    pub fn connected_database(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
190        self.inner = self.inner.connected_database(input.into());
191        self
192    }
193    /// <p>A database name. The connected database is specified when you connect with your authentication credentials.</p>
194    pub fn set_connected_database(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
195        self.inner = self.inner.set_connected_database(input);
196        self
197    }
198    /// <p>A database name. The connected database is specified when you connect with your authentication credentials.</p>
199    pub fn get_connected_database(&self) -> &::std::option::Option<::std::string::String> {
200        self.inner.get_connected_database()
201    }
202    /// <p>The schema that contains the table. If no schema is specified, then matching tables for all schemas are returned.</p>
203    pub fn schema(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
204        self.inner = self.inner.schema(input.into());
205        self
206    }
207    /// <p>The schema that contains the table. If no schema is specified, then matching tables for all schemas are returned.</p>
208    pub fn set_schema(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
209        self.inner = self.inner.set_schema(input);
210        self
211    }
212    /// <p>The schema that contains the table. If no schema is specified, then matching tables for all schemas are returned.</p>
213    pub fn get_schema(&self) -> &::std::option::Option<::std::string::String> {
214        self.inner.get_schema()
215    }
216    /// <p>The table name. If no table is specified, then all tables for all matching schemas are returned. If no table and no schema is specified, then all tables for all schemas in the database are returned</p>
217    pub fn table(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
218        self.inner = self.inner.table(input.into());
219        self
220    }
221    /// <p>The table name. If no table is specified, then all tables for all matching schemas are returned. If no table and no schema is specified, then all tables for all schemas in the database are returned</p>
222    pub fn set_table(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
223        self.inner = self.inner.set_table(input);
224        self
225    }
226    /// <p>The table name. If no table is specified, then all tables for all matching schemas are returned. If no table and no schema is specified, then all tables for all schemas in the database are returned</p>
227    pub fn get_table(&self) -> &::std::option::Option<::std::string::String> {
228        self.inner.get_table()
229    }
230    /// <p>A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.</p>
231    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
232        self.inner = self.inner.next_token(input.into());
233        self
234    }
235    /// <p>A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.</p>
236    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
237        self.inner = self.inner.set_next_token(input);
238        self
239    }
240    /// <p>A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.</p>
241    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
242        self.inner.get_next_token()
243    }
244    /// <p>The maximum number of tables to return in the response. If more tables exist than fit in one response, then <code>NextToken</code> is returned to page through the results.</p>
245    pub fn max_results(mut self, input: i32) -> Self {
246        self.inner = self.inner.max_results(input);
247        self
248    }
249    /// <p>The maximum number of tables to return in the response. If more tables exist than fit in one response, then <code>NextToken</code> is returned to page through the results.</p>
250    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
251        self.inner = self.inner.set_max_results(input);
252        self
253    }
254    /// <p>The maximum number of tables to return in the response. If more tables exist than fit in one response, then <code>NextToken</code> is returned to page through the results.</p>
255    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
256        self.inner.get_max_results()
257    }
258    /// <p>The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.</p>
259    pub fn workgroup_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
260        self.inner = self.inner.workgroup_name(input.into());
261        self
262    }
263    /// <p>The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.</p>
264    pub fn set_workgroup_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
265        self.inner = self.inner.set_workgroup_name(input);
266        self
267    }
268    /// <p>The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.</p>
269    pub fn get_workgroup_name(&self) -> &::std::option::Option<::std::string::String> {
270        self.inner.get_workgroup_name()
271    }
272}