aws_sdk_redshiftdata/operation/execute_statement/
_execute_statement_output.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 ExecuteStatementOutput {
6    /// <p>The identifier of the SQL statement whose results are to be fetched. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.</p>
7    pub id: ::std::option::Option<::std::string::String>,
8    /// <p>The date and time (UTC) the statement was created.</p>
9    pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
10    /// <p>The cluster identifier. This element is not returned when connecting to a serverless workgroup.</p>
11    pub cluster_identifier: ::std::option::Option<::std::string::String>,
12    /// <p>The database user name.</p>
13    pub db_user: ::std::option::Option<::std::string::String>,
14    /// <p>A list of colon (:) separated names of database groups.</p>
15    pub db_groups: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
16    /// <p>The name of the database.</p>
17    pub database: ::std::option::Option<::std::string::String>,
18    /// <p>The name or ARN of the secret that enables access to the database.</p>
19    pub secret_arn: ::std::option::Option<::std::string::String>,
20    /// <p>The serverless workgroup name or Amazon Resource Name (ARN). This element is not returned when connecting to a provisioned cluster.</p>
21    pub workgroup_name: ::std::option::Option<::std::string::String>,
22    /// <p>The session identifier of the query.</p>
23    pub session_id: ::std::option::Option<::std::string::String>,
24    _request_id: Option<String>,
25}
26impl ExecuteStatementOutput {
27    /// <p>The identifier of the SQL statement whose results are to be fetched. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.</p>
28    pub fn id(&self) -> ::std::option::Option<&str> {
29        self.id.as_deref()
30    }
31    /// <p>The date and time (UTC) the statement was created.</p>
32    pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
33        self.created_at.as_ref()
34    }
35    /// <p>The cluster identifier. This element is not returned when connecting to a serverless workgroup.</p>
36    pub fn cluster_identifier(&self) -> ::std::option::Option<&str> {
37        self.cluster_identifier.as_deref()
38    }
39    /// <p>The database user name.</p>
40    pub fn db_user(&self) -> ::std::option::Option<&str> {
41        self.db_user.as_deref()
42    }
43    /// <p>A list of colon (:) separated names of database groups.</p>
44    ///
45    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.db_groups.is_none()`.
46    pub fn db_groups(&self) -> &[::std::string::String] {
47        self.db_groups.as_deref().unwrap_or_default()
48    }
49    /// <p>The name of the database.</p>
50    pub fn database(&self) -> ::std::option::Option<&str> {
51        self.database.as_deref()
52    }
53    /// <p>The name or ARN of the secret that enables access to the database.</p>
54    pub fn secret_arn(&self) -> ::std::option::Option<&str> {
55        self.secret_arn.as_deref()
56    }
57    /// <p>The serverless workgroup name or Amazon Resource Name (ARN). This element is not returned when connecting to a provisioned cluster.</p>
58    pub fn workgroup_name(&self) -> ::std::option::Option<&str> {
59        self.workgroup_name.as_deref()
60    }
61    /// <p>The session identifier of the query.</p>
62    pub fn session_id(&self) -> ::std::option::Option<&str> {
63        self.session_id.as_deref()
64    }
65}
66impl ::aws_types::request_id::RequestId for ExecuteStatementOutput {
67    fn request_id(&self) -> Option<&str> {
68        self._request_id.as_deref()
69    }
70}
71impl ExecuteStatementOutput {
72    /// Creates a new builder-style object to manufacture [`ExecuteStatementOutput`](crate::operation::execute_statement::ExecuteStatementOutput).
73    pub fn builder() -> crate::operation::execute_statement::builders::ExecuteStatementOutputBuilder {
74        crate::operation::execute_statement::builders::ExecuteStatementOutputBuilder::default()
75    }
76}
77
78/// A builder for [`ExecuteStatementOutput`](crate::operation::execute_statement::ExecuteStatementOutput).
79#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
80#[non_exhaustive]
81pub struct ExecuteStatementOutputBuilder {
82    pub(crate) id: ::std::option::Option<::std::string::String>,
83    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
84    pub(crate) cluster_identifier: ::std::option::Option<::std::string::String>,
85    pub(crate) db_user: ::std::option::Option<::std::string::String>,
86    pub(crate) db_groups: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
87    pub(crate) database: ::std::option::Option<::std::string::String>,
88    pub(crate) secret_arn: ::std::option::Option<::std::string::String>,
89    pub(crate) workgroup_name: ::std::option::Option<::std::string::String>,
90    pub(crate) session_id: ::std::option::Option<::std::string::String>,
91    _request_id: Option<String>,
92}
93impl ExecuteStatementOutputBuilder {
94    /// <p>The identifier of the SQL statement whose results are to be fetched. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.</p>
95    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96        self.id = ::std::option::Option::Some(input.into());
97        self
98    }
99    /// <p>The identifier of the SQL statement whose results are to be fetched. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.</p>
100    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101        self.id = input;
102        self
103    }
104    /// <p>The identifier of the SQL statement whose results are to be fetched. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.</p>
105    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
106        &self.id
107    }
108    /// <p>The date and time (UTC) the statement was created.</p>
109    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
110        self.created_at = ::std::option::Option::Some(input);
111        self
112    }
113    /// <p>The date and time (UTC) the statement was created.</p>
114    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
115        self.created_at = input;
116        self
117    }
118    /// <p>The date and time (UTC) the statement was created.</p>
119    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
120        &self.created_at
121    }
122    /// <p>The cluster identifier. This element is not returned when connecting to a serverless workgroup.</p>
123    pub fn cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        self.cluster_identifier = ::std::option::Option::Some(input.into());
125        self
126    }
127    /// <p>The cluster identifier. This element is not returned when connecting to a serverless workgroup.</p>
128    pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129        self.cluster_identifier = input;
130        self
131    }
132    /// <p>The cluster identifier. This element is not returned when connecting to a serverless workgroup.</p>
133    pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
134        &self.cluster_identifier
135    }
136    /// <p>The database user name.</p>
137    pub fn db_user(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138        self.db_user = ::std::option::Option::Some(input.into());
139        self
140    }
141    /// <p>The database user name.</p>
142    pub fn set_db_user(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143        self.db_user = input;
144        self
145    }
146    /// <p>The database user name.</p>
147    pub fn get_db_user(&self) -> &::std::option::Option<::std::string::String> {
148        &self.db_user
149    }
150    /// Appends an item to `db_groups`.
151    ///
152    /// To override the contents of this collection use [`set_db_groups`](Self::set_db_groups).
153    ///
154    /// <p>A list of colon (:) separated names of database groups.</p>
155    pub fn db_groups(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
156        let mut v = self.db_groups.unwrap_or_default();
157        v.push(input.into());
158        self.db_groups = ::std::option::Option::Some(v);
159        self
160    }
161    /// <p>A list of colon (:) separated names of database groups.</p>
162    pub fn set_db_groups(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
163        self.db_groups = input;
164        self
165    }
166    /// <p>A list of colon (:) separated names of database groups.</p>
167    pub fn get_db_groups(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
168        &self.db_groups
169    }
170    /// <p>The name of the database.</p>
171    pub fn database(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172        self.database = ::std::option::Option::Some(input.into());
173        self
174    }
175    /// <p>The name of the database.</p>
176    pub fn set_database(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177        self.database = input;
178        self
179    }
180    /// <p>The name of the database.</p>
181    pub fn get_database(&self) -> &::std::option::Option<::std::string::String> {
182        &self.database
183    }
184    /// <p>The name or ARN of the secret that enables access to the database.</p>
185    pub fn secret_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
186        self.secret_arn = ::std::option::Option::Some(input.into());
187        self
188    }
189    /// <p>The name or ARN of the secret that enables access to the database.</p>
190    pub fn set_secret_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
191        self.secret_arn = input;
192        self
193    }
194    /// <p>The name or ARN of the secret that enables access to the database.</p>
195    pub fn get_secret_arn(&self) -> &::std::option::Option<::std::string::String> {
196        &self.secret_arn
197    }
198    /// <p>The serverless workgroup name or Amazon Resource Name (ARN). This element is not returned when connecting to a provisioned cluster.</p>
199    pub fn workgroup_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
200        self.workgroup_name = ::std::option::Option::Some(input.into());
201        self
202    }
203    /// <p>The serverless workgroup name or Amazon Resource Name (ARN). This element is not returned when connecting to a provisioned cluster.</p>
204    pub fn set_workgroup_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
205        self.workgroup_name = input;
206        self
207    }
208    /// <p>The serverless workgroup name or Amazon Resource Name (ARN). This element is not returned when connecting to a provisioned cluster.</p>
209    pub fn get_workgroup_name(&self) -> &::std::option::Option<::std::string::String> {
210        &self.workgroup_name
211    }
212    /// <p>The session identifier of the query.</p>
213    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
214        self.session_id = ::std::option::Option::Some(input.into());
215        self
216    }
217    /// <p>The session identifier of the query.</p>
218    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
219        self.session_id = input;
220        self
221    }
222    /// <p>The session identifier of the query.</p>
223    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
224        &self.session_id
225    }
226    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
227        self._request_id = Some(request_id.into());
228        self
229    }
230
231    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
232        self._request_id = request_id;
233        self
234    }
235    /// Consumes the builder and constructs a [`ExecuteStatementOutput`](crate::operation::execute_statement::ExecuteStatementOutput).
236    pub fn build(self) -> crate::operation::execute_statement::ExecuteStatementOutput {
237        crate::operation::execute_statement::ExecuteStatementOutput {
238            id: self.id,
239            created_at: self.created_at,
240            cluster_identifier: self.cluster_identifier,
241            db_user: self.db_user,
242            db_groups: self.db_groups,
243            database: self.database,
244            secret_arn: self.secret_arn,
245            workgroup_name: self.workgroup_name,
246            session_id: self.session_id,
247            _request_id: self._request_id,
248        }
249    }
250}