aws_sdk_redshiftdata/operation/execute_statement/
_execute_statement_input.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ExecuteStatementInput {
    /// <p>The SQL statement text to run.</p>
    pub sql: ::std::option::Option<::std::string::String>,
    /// <p>The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.</p>
    pub cluster_identifier: ::std::option::Option<::std::string::String>,
    /// <p>The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.</p>
    pub secret_arn: ::std::option::Option<::std::string::String>,
    /// <p>The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.</p>
    pub db_user: ::std::option::Option<::std::string::String>,
    /// <p>The name of the database. This parameter is required when authenticating using either Secrets Manager or temporary credentials.</p>
    pub database: ::std::option::Option<::std::string::String>,
    /// <p>A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statement runs.</p>
    pub with_event: ::std::option::Option<bool>,
    /// <p>The name of the SQL statement. You can name the SQL statement when you create it to identify the query.</p>
    pub statement_name: ::std::option::Option<::std::string::String>,
    /// <p>The parameters for the SQL statement.</p>
    pub parameters: ::std::option::Option<::std::vec::Vec<crate::types::SqlParameter>>,
    /// <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>
    pub workgroup_name: ::std::option::Option<::std::string::String>,
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
    /// <p>The number of seconds to keep the session alive after the query finishes. The maximum time a session can keep alive is 24 hours. After 24 hours, the session is forced closed and the query is terminated.</p>
    pub session_keep_alive_seconds: ::std::option::Option<i32>,
    /// <p>The session identifier of the query.</p>
    pub session_id: ::std::option::Option<::std::string::String>,
    /// <p>The data format of the result of the SQL statement. If no format is specified, the default is JSON.</p>
    pub result_format: ::std::option::Option<crate::types::ResultFormatString>,
}
impl ExecuteStatementInput {
    /// <p>The SQL statement text to run.</p>
    pub fn sql(&self) -> ::std::option::Option<&str> {
        self.sql.as_deref()
    }
    /// <p>The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.</p>
    pub fn cluster_identifier(&self) -> ::std::option::Option<&str> {
        self.cluster_identifier.as_deref()
    }
    /// <p>The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.</p>
    pub fn secret_arn(&self) -> ::std::option::Option<&str> {
        self.secret_arn.as_deref()
    }
    /// <p>The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.</p>
    pub fn db_user(&self) -> ::std::option::Option<&str> {
        self.db_user.as_deref()
    }
    /// <p>The name of the database. This parameter is required when authenticating using either Secrets Manager or temporary credentials.</p>
    pub fn database(&self) -> ::std::option::Option<&str> {
        self.database.as_deref()
    }
    /// <p>A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statement runs.</p>
    pub fn with_event(&self) -> ::std::option::Option<bool> {
        self.with_event
    }
    /// <p>The name of the SQL statement. You can name the SQL statement when you create it to identify the query.</p>
    pub fn statement_name(&self) -> ::std::option::Option<&str> {
        self.statement_name.as_deref()
    }
    /// <p>The parameters for the SQL statement.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.parameters.is_none()`.
    pub fn parameters(&self) -> &[crate::types::SqlParameter] {
        self.parameters.as_deref().unwrap_or_default()
    }
    /// <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>
    pub fn workgroup_name(&self) -> ::std::option::Option<&str> {
        self.workgroup_name.as_deref()
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
    /// <p>The number of seconds to keep the session alive after the query finishes. The maximum time a session can keep alive is 24 hours. After 24 hours, the session is forced closed and the query is terminated.</p>
    pub fn session_keep_alive_seconds(&self) -> ::std::option::Option<i32> {
        self.session_keep_alive_seconds
    }
    /// <p>The session identifier of the query.</p>
    pub fn session_id(&self) -> ::std::option::Option<&str> {
        self.session_id.as_deref()
    }
    /// <p>The data format of the result of the SQL statement. If no format is specified, the default is JSON.</p>
    pub fn result_format(&self) -> ::std::option::Option<&crate::types::ResultFormatString> {
        self.result_format.as_ref()
    }
}
impl ExecuteStatementInput {
    /// Creates a new builder-style object to manufacture [`ExecuteStatementInput`](crate::operation::execute_statement::ExecuteStatementInput).
    pub fn builder() -> crate::operation::execute_statement::builders::ExecuteStatementInputBuilder {
        crate::operation::execute_statement::builders::ExecuteStatementInputBuilder::default()
    }
}

/// A builder for [`ExecuteStatementInput`](crate::operation::execute_statement::ExecuteStatementInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ExecuteStatementInputBuilder {
    pub(crate) sql: ::std::option::Option<::std::string::String>,
    pub(crate) cluster_identifier: ::std::option::Option<::std::string::String>,
    pub(crate) secret_arn: ::std::option::Option<::std::string::String>,
    pub(crate) db_user: ::std::option::Option<::std::string::String>,
    pub(crate) database: ::std::option::Option<::std::string::String>,
    pub(crate) with_event: ::std::option::Option<bool>,
    pub(crate) statement_name: ::std::option::Option<::std::string::String>,
    pub(crate) parameters: ::std::option::Option<::std::vec::Vec<crate::types::SqlParameter>>,
    pub(crate) workgroup_name: ::std::option::Option<::std::string::String>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) session_keep_alive_seconds: ::std::option::Option<i32>,
    pub(crate) session_id: ::std::option::Option<::std::string::String>,
    pub(crate) result_format: ::std::option::Option<crate::types::ResultFormatString>,
}
impl ExecuteStatementInputBuilder {
    /// <p>The SQL statement text to run.</p>
    /// This field is required.
    pub fn sql(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.sql = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The SQL statement text to run.</p>
    pub fn set_sql(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.sql = input;
        self
    }
    /// <p>The SQL statement text to run.</p>
    pub fn get_sql(&self) -> &::std::option::Option<::std::string::String> {
        &self.sql
    }
    /// <p>The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.</p>
    pub fn cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.cluster_identifier = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.</p>
    pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.cluster_identifier = input;
        self
    }
    /// <p>The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.</p>
    pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.cluster_identifier
    }
    /// <p>The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.</p>
    pub fn secret_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.secret_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.</p>
    pub fn set_secret_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.secret_arn = input;
        self
    }
    /// <p>The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.</p>
    pub fn get_secret_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.secret_arn
    }
    /// <p>The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.</p>
    pub fn db_user(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.db_user = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.</p>
    pub fn set_db_user(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.db_user = input;
        self
    }
    /// <p>The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.</p>
    pub fn get_db_user(&self) -> &::std::option::Option<::std::string::String> {
        &self.db_user
    }
    /// <p>The name of the database. This parameter is required when authenticating using either Secrets Manager or temporary credentials.</p>
    pub fn database(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.database = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the database. This parameter is required when authenticating using either Secrets Manager or temporary credentials.</p>
    pub fn set_database(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.database = input;
        self
    }
    /// <p>The name of the database. This parameter is required when authenticating using either Secrets Manager or temporary credentials.</p>
    pub fn get_database(&self) -> &::std::option::Option<::std::string::String> {
        &self.database
    }
    /// <p>A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statement runs.</p>
    pub fn with_event(mut self, input: bool) -> Self {
        self.with_event = ::std::option::Option::Some(input);
        self
    }
    /// <p>A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statement runs.</p>
    pub fn set_with_event(mut self, input: ::std::option::Option<bool>) -> Self {
        self.with_event = input;
        self
    }
    /// <p>A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statement runs.</p>
    pub fn get_with_event(&self) -> &::std::option::Option<bool> {
        &self.with_event
    }
    /// <p>The name of the SQL statement. You can name the SQL statement when you create it to identify the query.</p>
    pub fn statement_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.statement_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the SQL statement. You can name the SQL statement when you create it to identify the query.</p>
    pub fn set_statement_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.statement_name = input;
        self
    }
    /// <p>The name of the SQL statement. You can name the SQL statement when you create it to identify the query.</p>
    pub fn get_statement_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.statement_name
    }
    /// Appends an item to `parameters`.
    ///
    /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
    ///
    /// <p>The parameters for the SQL statement.</p>
    pub fn parameters(mut self, input: crate::types::SqlParameter) -> Self {
        let mut v = self.parameters.unwrap_or_default();
        v.push(input);
        self.parameters = ::std::option::Option::Some(v);
        self
    }
    /// <p>The parameters for the SQL statement.</p>
    pub fn set_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SqlParameter>>) -> Self {
        self.parameters = input;
        self
    }
    /// <p>The parameters for the SQL statement.</p>
    pub fn get_parameters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SqlParameter>> {
        &self.parameters
    }
    /// <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>
    pub fn workgroup_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.workgroup_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <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>
    pub fn set_workgroup_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.workgroup_name = input;
        self
    }
    /// <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>
    pub fn get_workgroup_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.workgroup_name
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// <p>The number of seconds to keep the session alive after the query finishes. The maximum time a session can keep alive is 24 hours. After 24 hours, the session is forced closed and the query is terminated.</p>
    pub fn session_keep_alive_seconds(mut self, input: i32) -> Self {
        self.session_keep_alive_seconds = ::std::option::Option::Some(input);
        self
    }
    /// <p>The number of seconds to keep the session alive after the query finishes. The maximum time a session can keep alive is 24 hours. After 24 hours, the session is forced closed and the query is terminated.</p>
    pub fn set_session_keep_alive_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
        self.session_keep_alive_seconds = input;
        self
    }
    /// <p>The number of seconds to keep the session alive after the query finishes. The maximum time a session can keep alive is 24 hours. After 24 hours, the session is forced closed and the query is terminated.</p>
    pub fn get_session_keep_alive_seconds(&self) -> &::std::option::Option<i32> {
        &self.session_keep_alive_seconds
    }
    /// <p>The session identifier of the query.</p>
    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.session_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The session identifier of the query.</p>
    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.session_id = input;
        self
    }
    /// <p>The session identifier of the query.</p>
    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.session_id
    }
    /// <p>The data format of the result of the SQL statement. If no format is specified, the default is JSON.</p>
    pub fn result_format(mut self, input: crate::types::ResultFormatString) -> Self {
        self.result_format = ::std::option::Option::Some(input);
        self
    }
    /// <p>The data format of the result of the SQL statement. If no format is specified, the default is JSON.</p>
    pub fn set_result_format(mut self, input: ::std::option::Option<crate::types::ResultFormatString>) -> Self {
        self.result_format = input;
        self
    }
    /// <p>The data format of the result of the SQL statement. If no format is specified, the default is JSON.</p>
    pub fn get_result_format(&self) -> &::std::option::Option<crate::types::ResultFormatString> {
        &self.result_format
    }
    /// Consumes the builder and constructs a [`ExecuteStatementInput`](crate::operation::execute_statement::ExecuteStatementInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::execute_statement::ExecuteStatementInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::execute_statement::ExecuteStatementInput {
            sql: self.sql,
            cluster_identifier: self.cluster_identifier,
            secret_arn: self.secret_arn,
            db_user: self.db_user,
            database: self.database,
            with_event: self.with_event,
            statement_name: self.statement_name,
            parameters: self.parameters,
            workgroup_name: self.workgroup_name,
            client_token: self.client_token,
            session_keep_alive_seconds: self.session_keep_alive_seconds,
            session_id: self.session_id,
            result_format: self.result_format,
        })
    }
}