aws_sdk_redshiftdata/operation/list_statements/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_statements::_list_statements_output::ListStatementsOutputBuilder;
3
4pub use crate::operation::list_statements::_list_statements_input::ListStatementsInputBuilder;
5
6impl crate::operation::list_statements::builders::ListStatementsInputBuilder {
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::list_statements::ListStatementsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_statements::ListStatementsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_statements();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListStatements`.
24///
25/// <p>List of SQL statements. By default, only finished statements are shown. A token is returned to page through the statement list.</p>
26/// <p>When you use identity-enhanced role sessions to list statements, you must provide either the <code>cluster-identifier</code> or <code>workgroup-name</code> parameter. This ensures that the IdC user can only access the Amazon Redshift IdC applications they are assigned. For more information, see <a href="https://docs.aws.amazon.com/singlesignon/latest/userguide/trustedidentitypropagation-overview.html"> Trusted identity propagation overview</a>.</p>
27/// <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>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct ListStatementsFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::list_statements::builders::ListStatementsInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::list_statements::ListStatementsOutput,
37        crate::operation::list_statements::ListStatementsError,
38    > for ListStatementsFluentBuilder
39{
40    fn send(
41        self,
42        config_override: crate::config::Builder,
43    ) -> crate::client::customize::internal::BoxFuture<
44        crate::client::customize::internal::SendResult<
45            crate::operation::list_statements::ListStatementsOutput,
46            crate::operation::list_statements::ListStatementsError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl ListStatementsFluentBuilder {
53    /// Creates a new `ListStatementsFluentBuilder`.
54    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55        Self {
56            handle,
57            inner: ::std::default::Default::default(),
58            config_override: ::std::option::Option::None,
59        }
60    }
61    /// Access the ListStatements as a reference.
62    pub fn as_input(&self) -> &crate::operation::list_statements::builders::ListStatementsInputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::list_statements::ListStatementsOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::list_statements::ListStatementsError,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins = crate::operation::list_statements::ListStatements::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::list_statements::ListStatements::orchestrate(&runtime_plugins, input).await
92    }
93
94    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95    pub fn customize(
96        self,
97    ) -> crate::client::customize::CustomizableOperation<
98        crate::operation::list_statements::ListStatementsOutput,
99        crate::operation::list_statements::ListStatementsError,
100        Self,
101    > {
102        crate::client::customize::CustomizableOperation::new(self)
103    }
104    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105        self.set_config_override(::std::option::Option::Some(config_override.into()));
106        self
107    }
108
109    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110        self.config_override = config_override;
111        self
112    }
113    /// Create a paginator for this request
114    ///
115    /// Paginators are used by calling [`send().await`](crate::operation::list_statements::paginator::ListStatementsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
116    pub fn into_paginator(self) -> crate::operation::list_statements::paginator::ListStatementsPaginator {
117        crate::operation::list_statements::paginator::ListStatementsPaginator::new(self.handle, self.inner)
118    }
119    /// <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>
120    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.next_token(input.into());
122        self
123    }
124    /// <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>
125    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.inner = self.inner.set_next_token(input);
127        self
128    }
129    /// <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>
130    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
131        self.inner.get_next_token()
132    }
133    /// <p>The maximum number of SQL statements to return in the response. If more SQL statements exist than fit in one response, then <code>NextToken</code> is returned to page through the results.</p>
134    pub fn max_results(mut self, input: i32) -> Self {
135        self.inner = self.inner.max_results(input);
136        self
137    }
138    /// <p>The maximum number of SQL statements to return in the response. If more SQL statements exist than fit in one response, then <code>NextToken</code> is returned to page through the results.</p>
139    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
140        self.inner = self.inner.set_max_results(input);
141        self
142    }
143    /// <p>The maximum number of SQL statements to return in the response. If more SQL statements exist than fit in one response, then <code>NextToken</code> is returned to page through the results.</p>
144    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
145        self.inner.get_max_results()
146    }
147    /// <p>The name of the SQL statement specified as input to <code>BatchExecuteStatement</code> or <code>ExecuteStatement</code> to identify the query. You can list multiple statements by providing a prefix that matches the beginning of the statement name. For example, to list myStatement1, myStatement2, myStatement3, and so on, then provide the a value of <code>myStatement</code>. Data API does a case-sensitive match of SQL statement names to the prefix value you provide.</p>
148    pub fn statement_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.inner = self.inner.statement_name(input.into());
150        self
151    }
152    /// <p>The name of the SQL statement specified as input to <code>BatchExecuteStatement</code> or <code>ExecuteStatement</code> to identify the query. You can list multiple statements by providing a prefix that matches the beginning of the statement name. For example, to list myStatement1, myStatement2, myStatement3, and so on, then provide the a value of <code>myStatement</code>. Data API does a case-sensitive match of SQL statement names to the prefix value you provide.</p>
153    pub fn set_statement_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.inner = self.inner.set_statement_name(input);
155        self
156    }
157    /// <p>The name of the SQL statement specified as input to <code>BatchExecuteStatement</code> or <code>ExecuteStatement</code> to identify the query. You can list multiple statements by providing a prefix that matches the beginning of the statement name. For example, to list myStatement1, myStatement2, myStatement3, and so on, then provide the a value of <code>myStatement</code>. Data API does a case-sensitive match of SQL statement names to the prefix value you provide.</p>
158    pub fn get_statement_name(&self) -> &::std::option::Option<::std::string::String> {
159        self.inner.get_statement_name()
160    }
161    /// <p>The status of the SQL statement to list. Status values are defined as follows:</p>
162    /// <ul>
163    /// <li>
164    /// <p>ABORTED - The query run was stopped by the user.</p></li>
165    /// <li>
166    /// <p>ALL - A status value that includes all query statuses. This value can be used to filter results.</p></li>
167    /// <li>
168    /// <p>FAILED - The query run failed.</p></li>
169    /// <li>
170    /// <p>FINISHED - The query has finished running.</p></li>
171    /// <li>
172    /// <p>PICKED - The query has been chosen to be run.</p></li>
173    /// <li>
174    /// <p>STARTED - The query run has started.</p></li>
175    /// <li>
176    /// <p>SUBMITTED - The query was submitted, but not yet processed.</p></li>
177    /// </ul>
178    pub fn status(mut self, input: crate::types::StatusString) -> Self {
179        self.inner = self.inner.status(input);
180        self
181    }
182    /// <p>The status of the SQL statement to list. Status values are defined as follows:</p>
183    /// <ul>
184    /// <li>
185    /// <p>ABORTED - The query run was stopped by the user.</p></li>
186    /// <li>
187    /// <p>ALL - A status value that includes all query statuses. This value can be used to filter results.</p></li>
188    /// <li>
189    /// <p>FAILED - The query run failed.</p></li>
190    /// <li>
191    /// <p>FINISHED - The query has finished running.</p></li>
192    /// <li>
193    /// <p>PICKED - The query has been chosen to be run.</p></li>
194    /// <li>
195    /// <p>STARTED - The query run has started.</p></li>
196    /// <li>
197    /// <p>SUBMITTED - The query was submitted, but not yet processed.</p></li>
198    /// </ul>
199    pub fn set_status(mut self, input: ::std::option::Option<crate::types::StatusString>) -> Self {
200        self.inner = self.inner.set_status(input);
201        self
202    }
203    /// <p>The status of the SQL statement to list. Status values are defined as follows:</p>
204    /// <ul>
205    /// <li>
206    /// <p>ABORTED - The query run was stopped by the user.</p></li>
207    /// <li>
208    /// <p>ALL - A status value that includes all query statuses. This value can be used to filter results.</p></li>
209    /// <li>
210    /// <p>FAILED - The query run failed.</p></li>
211    /// <li>
212    /// <p>FINISHED - The query has finished running.</p></li>
213    /// <li>
214    /// <p>PICKED - The query has been chosen to be run.</p></li>
215    /// <li>
216    /// <p>STARTED - The query run has started.</p></li>
217    /// <li>
218    /// <p>SUBMITTED - The query was submitted, but not yet processed.</p></li>
219    /// </ul>
220    pub fn get_status(&self) -> &::std::option::Option<crate::types::StatusString> {
221        self.inner.get_status()
222    }
223    /// <p>A value that filters which statements to return in the response. If true, all statements run by the caller's IAM role are returned. If false, only statements run by the caller's IAM role in the current IAM session are returned. The default is true.</p>
224    pub fn role_level(mut self, input: bool) -> Self {
225        self.inner = self.inner.role_level(input);
226        self
227    }
228    /// <p>A value that filters which statements to return in the response. If true, all statements run by the caller's IAM role are returned. If false, only statements run by the caller's IAM role in the current IAM session are returned. The default is true.</p>
229    pub fn set_role_level(mut self, input: ::std::option::Option<bool>) -> Self {
230        self.inner = self.inner.set_role_level(input);
231        self
232    }
233    /// <p>A value that filters which statements to return in the response. If true, all statements run by the caller's IAM role are returned. If false, only statements run by the caller's IAM role in the current IAM session are returned. The default is true.</p>
234    pub fn get_role_level(&self) -> &::std::option::Option<bool> {
235        self.inner.get_role_level()
236    }
237    /// <p>The name of the database when listing statements run against a <code>ClusterIdentifier</code> or <code>WorkgroupName</code>.</p>
238    pub fn database(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
239        self.inner = self.inner.database(input.into());
240        self
241    }
242    /// <p>The name of the database when listing statements run against a <code>ClusterIdentifier</code> or <code>WorkgroupName</code>.</p>
243    pub fn set_database(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
244        self.inner = self.inner.set_database(input);
245        self
246    }
247    /// <p>The name of the database when listing statements run against a <code>ClusterIdentifier</code> or <code>WorkgroupName</code>.</p>
248    pub fn get_database(&self) -> &::std::option::Option<::std::string::String> {
249        self.inner.get_database()
250    }
251    /// <p>The cluster identifier. Only statements that ran on this cluster are returned. When providing <code>ClusterIdentifier</code>, then <code>WorkgroupName</code> can't be specified.</p>
252    pub fn cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
253        self.inner = self.inner.cluster_identifier(input.into());
254        self
255    }
256    /// <p>The cluster identifier. Only statements that ran on this cluster are returned. When providing <code>ClusterIdentifier</code>, then <code>WorkgroupName</code> can't be specified.</p>
257    pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
258        self.inner = self.inner.set_cluster_identifier(input);
259        self
260    }
261    /// <p>The cluster identifier. Only statements that ran on this cluster are returned. When providing <code>ClusterIdentifier</code>, then <code>WorkgroupName</code> can't be specified.</p>
262    pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
263        self.inner.get_cluster_identifier()
264    }
265    /// <p>The serverless workgroup name or Amazon Resource Name (ARN). Only statements that ran on this workgroup are returned. When providing <code>WorkgroupName</code>, then <code>ClusterIdentifier</code> can't be specified.</p>
266    pub fn workgroup_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
267        self.inner = self.inner.workgroup_name(input.into());
268        self
269    }
270    /// <p>The serverless workgroup name or Amazon Resource Name (ARN). Only statements that ran on this workgroup are returned. When providing <code>WorkgroupName</code>, then <code>ClusterIdentifier</code> can't be specified.</p>
271    pub fn set_workgroup_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
272        self.inner = self.inner.set_workgroup_name(input);
273        self
274    }
275    /// <p>The serverless workgroup name or Amazon Resource Name (ARN). Only statements that ran on this workgroup are returned. When providing <code>WorkgroupName</code>, then <code>ClusterIdentifier</code> can't be specified.</p>
276    pub fn get_workgroup_name(&self) -> &::std::option::Option<::std::string::String> {
277        self.inner.get_workgroup_name()
278    }
279}