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 /// <p>The status of the SQL statement. Status values are defined as follows:</p>
25 /// <ul>
26 /// <li>
27 /// <p>ABORTED - The query run was stopped by the user.</p></li>
28 /// <li>
29 /// <p>FAILED - The query run failed.</p></li>
30 /// <li>
31 /// <p>FINISHED - The query has finished running.</p></li>
32 /// <li>
33 /// <p>PICKED - The query has been chosen to be run.</p></li>
34 /// <li>
35 /// <p>STARTED - The query run has started.</p></li>
36 /// <li>
37 /// <p>SUBMITTED - The query was submitted, but not yet processed.</p></li>
38 /// </ul>
39 pub status: ::std::option::Option<crate::types::StatementStatusString>,
40 /// <p>The process identifier from Amazon Redshift.</p>
41 pub redshift_pid: ::std::option::Option<i64>,
42 /// <p>A value that indicates whether the statement has a result set. The result set can be empty. The value is true for an empty result set.</p>
43 pub has_result_set: ::std::option::Option<bool>,
44 _request_id: Option<String>,
45}
46impl ExecuteStatementOutput {
47 /// <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>
48 pub fn id(&self) -> ::std::option::Option<&str> {
49 self.id.as_deref()
50 }
51 /// <p>The date and time (UTC) the statement was created.</p>
52 pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
53 self.created_at.as_ref()
54 }
55 /// <p>The cluster identifier. This element is not returned when connecting to a serverless workgroup.</p>
56 pub fn cluster_identifier(&self) -> ::std::option::Option<&str> {
57 self.cluster_identifier.as_deref()
58 }
59 /// <p>The database user name.</p>
60 pub fn db_user(&self) -> ::std::option::Option<&str> {
61 self.db_user.as_deref()
62 }
63 /// <p>A list of colon (:) separated names of database groups.</p>
64 ///
65 /// 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()`.
66 pub fn db_groups(&self) -> &[::std::string::String] {
67 self.db_groups.as_deref().unwrap_or_default()
68 }
69 /// <p>The name of the database.</p>
70 pub fn database(&self) -> ::std::option::Option<&str> {
71 self.database.as_deref()
72 }
73 /// <p>The name or ARN of the secret that enables access to the database.</p>
74 pub fn secret_arn(&self) -> ::std::option::Option<&str> {
75 self.secret_arn.as_deref()
76 }
77 /// <p>The serverless workgroup name or Amazon Resource Name (ARN). This element is not returned when connecting to a provisioned cluster.</p>
78 pub fn workgroup_name(&self) -> ::std::option::Option<&str> {
79 self.workgroup_name.as_deref()
80 }
81 /// <p>The session identifier of the query.</p>
82 pub fn session_id(&self) -> ::std::option::Option<&str> {
83 self.session_id.as_deref()
84 }
85 /// <p>The status of the SQL statement. Status values are defined as follows:</p>
86 /// <ul>
87 /// <li>
88 /// <p>ABORTED - The query run was stopped by the user.</p></li>
89 /// <li>
90 /// <p>FAILED - The query run failed.</p></li>
91 /// <li>
92 /// <p>FINISHED - The query has finished running.</p></li>
93 /// <li>
94 /// <p>PICKED - The query has been chosen to be run.</p></li>
95 /// <li>
96 /// <p>STARTED - The query run has started.</p></li>
97 /// <li>
98 /// <p>SUBMITTED - The query was submitted, but not yet processed.</p></li>
99 /// </ul>
100 pub fn status(&self) -> ::std::option::Option<&crate::types::StatementStatusString> {
101 self.status.as_ref()
102 }
103 /// <p>The process identifier from Amazon Redshift.</p>
104 pub fn redshift_pid(&self) -> ::std::option::Option<i64> {
105 self.redshift_pid
106 }
107 /// <p>A value that indicates whether the statement has a result set. The result set can be empty. The value is true for an empty result set.</p>
108 pub fn has_result_set(&self) -> ::std::option::Option<bool> {
109 self.has_result_set
110 }
111}
112impl ::aws_types::request_id::RequestId for ExecuteStatementOutput {
113 fn request_id(&self) -> Option<&str> {
114 self._request_id.as_deref()
115 }
116}
117impl ExecuteStatementOutput {
118 /// Creates a new builder-style object to manufacture [`ExecuteStatementOutput`](crate::operation::execute_statement::ExecuteStatementOutput).
119 pub fn builder() -> crate::operation::execute_statement::builders::ExecuteStatementOutputBuilder {
120 crate::operation::execute_statement::builders::ExecuteStatementOutputBuilder::default()
121 }
122}
123
124/// A builder for [`ExecuteStatementOutput`](crate::operation::execute_statement::ExecuteStatementOutput).
125#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
126#[non_exhaustive]
127pub struct ExecuteStatementOutputBuilder {
128 pub(crate) id: ::std::option::Option<::std::string::String>,
129 pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
130 pub(crate) cluster_identifier: ::std::option::Option<::std::string::String>,
131 pub(crate) db_user: ::std::option::Option<::std::string::String>,
132 pub(crate) db_groups: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
133 pub(crate) database: ::std::option::Option<::std::string::String>,
134 pub(crate) secret_arn: ::std::option::Option<::std::string::String>,
135 pub(crate) workgroup_name: ::std::option::Option<::std::string::String>,
136 pub(crate) session_id: ::std::option::Option<::std::string::String>,
137 pub(crate) status: ::std::option::Option<crate::types::StatementStatusString>,
138 pub(crate) redshift_pid: ::std::option::Option<i64>,
139 pub(crate) has_result_set: ::std::option::Option<bool>,
140 _request_id: Option<String>,
141}
142impl ExecuteStatementOutputBuilder {
143 /// <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>
144 pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145 self.id = ::std::option::Option::Some(input.into());
146 self
147 }
148 /// <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>
149 pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150 self.id = input;
151 self
152 }
153 /// <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>
154 pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
155 &self.id
156 }
157 /// <p>The date and time (UTC) the statement was created.</p>
158 pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
159 self.created_at = ::std::option::Option::Some(input);
160 self
161 }
162 /// <p>The date and time (UTC) the statement was created.</p>
163 pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
164 self.created_at = input;
165 self
166 }
167 /// <p>The date and time (UTC) the statement was created.</p>
168 pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
169 &self.created_at
170 }
171 /// <p>The cluster identifier. This element is not returned when connecting to a serverless workgroup.</p>
172 pub fn cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173 self.cluster_identifier = ::std::option::Option::Some(input.into());
174 self
175 }
176 /// <p>The cluster identifier. This element is not returned when connecting to a serverless workgroup.</p>
177 pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178 self.cluster_identifier = input;
179 self
180 }
181 /// <p>The cluster identifier. This element is not returned when connecting to a serverless workgroup.</p>
182 pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
183 &self.cluster_identifier
184 }
185 /// <p>The database user name.</p>
186 pub fn db_user(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
187 self.db_user = ::std::option::Option::Some(input.into());
188 self
189 }
190 /// <p>The database user name.</p>
191 pub fn set_db_user(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
192 self.db_user = input;
193 self
194 }
195 /// <p>The database user name.</p>
196 pub fn get_db_user(&self) -> &::std::option::Option<::std::string::String> {
197 &self.db_user
198 }
199 /// Appends an item to `db_groups`.
200 ///
201 /// To override the contents of this collection use [`set_db_groups`](Self::set_db_groups).
202 ///
203 /// <p>A list of colon (:) separated names of database groups.</p>
204 pub fn db_groups(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
205 let mut v = self.db_groups.unwrap_or_default();
206 v.push(input.into());
207 self.db_groups = ::std::option::Option::Some(v);
208 self
209 }
210 /// <p>A list of colon (:) separated names of database groups.</p>
211 pub fn set_db_groups(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
212 self.db_groups = input;
213 self
214 }
215 /// <p>A list of colon (:) separated names of database groups.</p>
216 pub fn get_db_groups(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
217 &self.db_groups
218 }
219 /// <p>The name of the database.</p>
220 pub fn database(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
221 self.database = ::std::option::Option::Some(input.into());
222 self
223 }
224 /// <p>The name of the database.</p>
225 pub fn set_database(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
226 self.database = input;
227 self
228 }
229 /// <p>The name of the database.</p>
230 pub fn get_database(&self) -> &::std::option::Option<::std::string::String> {
231 &self.database
232 }
233 /// <p>The name or ARN of the secret that enables access to the database.</p>
234 pub fn secret_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
235 self.secret_arn = ::std::option::Option::Some(input.into());
236 self
237 }
238 /// <p>The name or ARN of the secret that enables access to the database.</p>
239 pub fn set_secret_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
240 self.secret_arn = input;
241 self
242 }
243 /// <p>The name or ARN of the secret that enables access to the database.</p>
244 pub fn get_secret_arn(&self) -> &::std::option::Option<::std::string::String> {
245 &self.secret_arn
246 }
247 /// <p>The serverless workgroup name or Amazon Resource Name (ARN). This element is not returned when connecting to a provisioned cluster.</p>
248 pub fn workgroup_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
249 self.workgroup_name = ::std::option::Option::Some(input.into());
250 self
251 }
252 /// <p>The serverless workgroup name or Amazon Resource Name (ARN). This element is not returned when connecting to a provisioned cluster.</p>
253 pub fn set_workgroup_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
254 self.workgroup_name = input;
255 self
256 }
257 /// <p>The serverless workgroup name or Amazon Resource Name (ARN). This element is not returned when connecting to a provisioned cluster.</p>
258 pub fn get_workgroup_name(&self) -> &::std::option::Option<::std::string::String> {
259 &self.workgroup_name
260 }
261 /// <p>The session identifier of the query.</p>
262 pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
263 self.session_id = ::std::option::Option::Some(input.into());
264 self
265 }
266 /// <p>The session identifier of the query.</p>
267 pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
268 self.session_id = input;
269 self
270 }
271 /// <p>The session identifier of the query.</p>
272 pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
273 &self.session_id
274 }
275 /// <p>The status of the SQL statement. Status values are defined as follows:</p>
276 /// <ul>
277 /// <li>
278 /// <p>ABORTED - The query run was stopped by the user.</p></li>
279 /// <li>
280 /// <p>FAILED - The query run failed.</p></li>
281 /// <li>
282 /// <p>FINISHED - The query has finished running.</p></li>
283 /// <li>
284 /// <p>PICKED - The query has been chosen to be run.</p></li>
285 /// <li>
286 /// <p>STARTED - The query run has started.</p></li>
287 /// <li>
288 /// <p>SUBMITTED - The query was submitted, but not yet processed.</p></li>
289 /// </ul>
290 pub fn status(mut self, input: crate::types::StatementStatusString) -> Self {
291 self.status = ::std::option::Option::Some(input);
292 self
293 }
294 /// <p>The status of the SQL statement. Status values are defined as follows:</p>
295 /// <ul>
296 /// <li>
297 /// <p>ABORTED - The query run was stopped by the user.</p></li>
298 /// <li>
299 /// <p>FAILED - The query run failed.</p></li>
300 /// <li>
301 /// <p>FINISHED - The query has finished running.</p></li>
302 /// <li>
303 /// <p>PICKED - The query has been chosen to be run.</p></li>
304 /// <li>
305 /// <p>STARTED - The query run has started.</p></li>
306 /// <li>
307 /// <p>SUBMITTED - The query was submitted, but not yet processed.</p></li>
308 /// </ul>
309 pub fn set_status(mut self, input: ::std::option::Option<crate::types::StatementStatusString>) -> Self {
310 self.status = input;
311 self
312 }
313 /// <p>The status of the SQL statement. Status values are defined as follows:</p>
314 /// <ul>
315 /// <li>
316 /// <p>ABORTED - The query run was stopped by the user.</p></li>
317 /// <li>
318 /// <p>FAILED - The query run failed.</p></li>
319 /// <li>
320 /// <p>FINISHED - The query has finished running.</p></li>
321 /// <li>
322 /// <p>PICKED - The query has been chosen to be run.</p></li>
323 /// <li>
324 /// <p>STARTED - The query run has started.</p></li>
325 /// <li>
326 /// <p>SUBMITTED - The query was submitted, but not yet processed.</p></li>
327 /// </ul>
328 pub fn get_status(&self) -> &::std::option::Option<crate::types::StatementStatusString> {
329 &self.status
330 }
331 /// <p>The process identifier from Amazon Redshift.</p>
332 pub fn redshift_pid(mut self, input: i64) -> Self {
333 self.redshift_pid = ::std::option::Option::Some(input);
334 self
335 }
336 /// <p>The process identifier from Amazon Redshift.</p>
337 pub fn set_redshift_pid(mut self, input: ::std::option::Option<i64>) -> Self {
338 self.redshift_pid = input;
339 self
340 }
341 /// <p>The process identifier from Amazon Redshift.</p>
342 pub fn get_redshift_pid(&self) -> &::std::option::Option<i64> {
343 &self.redshift_pid
344 }
345 /// <p>A value that indicates whether the statement has a result set. The result set can be empty. The value is true for an empty result set.</p>
346 pub fn has_result_set(mut self, input: bool) -> Self {
347 self.has_result_set = ::std::option::Option::Some(input);
348 self
349 }
350 /// <p>A value that indicates whether the statement has a result set. The result set can be empty. The value is true for an empty result set.</p>
351 pub fn set_has_result_set(mut self, input: ::std::option::Option<bool>) -> Self {
352 self.has_result_set = input;
353 self
354 }
355 /// <p>A value that indicates whether the statement has a result set. The result set can be empty. The value is true for an empty result set.</p>
356 pub fn get_has_result_set(&self) -> &::std::option::Option<bool> {
357 &self.has_result_set
358 }
359 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
360 self._request_id = Some(request_id.into());
361 self
362 }
363
364 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
365 self._request_id = request_id;
366 self
367 }
368 /// Consumes the builder and constructs a [`ExecuteStatementOutput`](crate::operation::execute_statement::ExecuteStatementOutput).
369 pub fn build(self) -> crate::operation::execute_statement::ExecuteStatementOutput {
370 crate::operation::execute_statement::ExecuteStatementOutput {
371 id: self.id,
372 created_at: self.created_at,
373 cluster_identifier: self.cluster_identifier,
374 db_user: self.db_user,
375 db_groups: self.db_groups,
376 database: self.database,
377 secret_arn: self.secret_arn,
378 workgroup_name: self.workgroup_name,
379 session_id: self.session_id,
380 status: self.status,
381 redshift_pid: self.redshift_pid,
382 has_result_set: self.has_result_set,
383 _request_id: self._request_id,
384 }
385 }
386}