1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #pragma once
7 #include <aws/rds-data/RDSDataService_EXPORTS.h>
8 #include <aws/rds-data/RDSDataServiceRequest.h>
9 #include <aws/core/utils/memory/stl/AWSString.h>
10 #include <aws/core/utils/memory/stl/AWSVector.h>
11 #include <aws/rds-data/model/ResultSetOptions.h>
12 #include <aws/rds-data/model/SqlParameter.h>
13 #include <utility>
14 
15 namespace Aws
16 {
17 namespace RDSDataService
18 {
19 namespace Model
20 {
21 
22   /**
23    * <p>The request parameters represent the input of a request to run a SQL
24    * statement against a database.</p><p><h3>See Also:</h3>   <a
25    * href="http://docs.aws.amazon.com/goto/WebAPI/rds-data-2018-08-01/ExecuteStatementRequest">AWS
26    * API Reference</a></p>
27    */
28   class AWS_RDSDATASERVICE_API ExecuteStatementRequest : public RDSDataServiceRequest
29   {
30   public:
31     ExecuteStatementRequest();
32 
33     // Service request name is the Operation name which will send this request out,
34     // each operation should has unique request name, so that we can get operation's name from this request.
35     // Note: this is not true for response, multiple operations may have the same response name,
36     // so we can not get operation's name from response.
GetServiceRequestName()37     inline virtual const char* GetServiceRequestName() const override { return "ExecuteStatement"; }
38 
39     Aws::String SerializePayload() const override;
40 
41 
42     /**
43      * <p>A value that indicates whether to continue running the statement after the
44      * call times out. By default, the statement stops running when the call times
45      * out.</p>  <p>For DDL statements, we recommend continuing to run the
46      * statement after the call times out. When a DDL statement terminates before it is
47      * finished running, it can result in errors and possibly corrupted data
48      * structures.</p>
49      */
GetContinueAfterTimeout()50     inline bool GetContinueAfterTimeout() const{ return m_continueAfterTimeout; }
51 
52     /**
53      * <p>A value that indicates whether to continue running the statement after the
54      * call times out. By default, the statement stops running when the call times
55      * out.</p>  <p>For DDL statements, we recommend continuing to run the
56      * statement after the call times out. When a DDL statement terminates before it is
57      * finished running, it can result in errors and possibly corrupted data
58      * structures.</p>
59      */
ContinueAfterTimeoutHasBeenSet()60     inline bool ContinueAfterTimeoutHasBeenSet() const { return m_continueAfterTimeoutHasBeenSet; }
61 
62     /**
63      * <p>A value that indicates whether to continue running the statement after the
64      * call times out. By default, the statement stops running when the call times
65      * out.</p>  <p>For DDL statements, we recommend continuing to run the
66      * statement after the call times out. When a DDL statement terminates before it is
67      * finished running, it can result in errors and possibly corrupted data
68      * structures.</p>
69      */
SetContinueAfterTimeout(bool value)70     inline void SetContinueAfterTimeout(bool value) { m_continueAfterTimeoutHasBeenSet = true; m_continueAfterTimeout = value; }
71 
72     /**
73      * <p>A value that indicates whether to continue running the statement after the
74      * call times out. By default, the statement stops running when the call times
75      * out.</p>  <p>For DDL statements, we recommend continuing to run the
76      * statement after the call times out. When a DDL statement terminates before it is
77      * finished running, it can result in errors and possibly corrupted data
78      * structures.</p>
79      */
WithContinueAfterTimeout(bool value)80     inline ExecuteStatementRequest& WithContinueAfterTimeout(bool value) { SetContinueAfterTimeout(value); return *this;}
81 
82 
83     /**
84      * <p>The name of the database.</p>
85      */
GetDatabase()86     inline const Aws::String& GetDatabase() const{ return m_database; }
87 
88     /**
89      * <p>The name of the database.</p>
90      */
DatabaseHasBeenSet()91     inline bool DatabaseHasBeenSet() const { return m_databaseHasBeenSet; }
92 
93     /**
94      * <p>The name of the database.</p>
95      */
SetDatabase(const Aws::String & value)96     inline void SetDatabase(const Aws::String& value) { m_databaseHasBeenSet = true; m_database = value; }
97 
98     /**
99      * <p>The name of the database.</p>
100      */
SetDatabase(Aws::String && value)101     inline void SetDatabase(Aws::String&& value) { m_databaseHasBeenSet = true; m_database = std::move(value); }
102 
103     /**
104      * <p>The name of the database.</p>
105      */
SetDatabase(const char * value)106     inline void SetDatabase(const char* value) { m_databaseHasBeenSet = true; m_database.assign(value); }
107 
108     /**
109      * <p>The name of the database.</p>
110      */
WithDatabase(const Aws::String & value)111     inline ExecuteStatementRequest& WithDatabase(const Aws::String& value) { SetDatabase(value); return *this;}
112 
113     /**
114      * <p>The name of the database.</p>
115      */
WithDatabase(Aws::String && value)116     inline ExecuteStatementRequest& WithDatabase(Aws::String&& value) { SetDatabase(std::move(value)); return *this;}
117 
118     /**
119      * <p>The name of the database.</p>
120      */
WithDatabase(const char * value)121     inline ExecuteStatementRequest& WithDatabase(const char* value) { SetDatabase(value); return *this;}
122 
123 
124     /**
125      * <p>A value that indicates whether to include metadata in the results.</p>
126      */
GetIncludeResultMetadata()127     inline bool GetIncludeResultMetadata() const{ return m_includeResultMetadata; }
128 
129     /**
130      * <p>A value that indicates whether to include metadata in the results.</p>
131      */
IncludeResultMetadataHasBeenSet()132     inline bool IncludeResultMetadataHasBeenSet() const { return m_includeResultMetadataHasBeenSet; }
133 
134     /**
135      * <p>A value that indicates whether to include metadata in the results.</p>
136      */
SetIncludeResultMetadata(bool value)137     inline void SetIncludeResultMetadata(bool value) { m_includeResultMetadataHasBeenSet = true; m_includeResultMetadata = value; }
138 
139     /**
140      * <p>A value that indicates whether to include metadata in the results.</p>
141      */
WithIncludeResultMetadata(bool value)142     inline ExecuteStatementRequest& WithIncludeResultMetadata(bool value) { SetIncludeResultMetadata(value); return *this;}
143 
144 
145     /**
146      * <p>The parameters for the SQL statement.</p>  <p>Array parameters are not
147      * supported.</p>
148      */
GetParameters()149     inline const Aws::Vector<SqlParameter>& GetParameters() const{ return m_parameters; }
150 
151     /**
152      * <p>The parameters for the SQL statement.</p>  <p>Array parameters are not
153      * supported.</p>
154      */
ParametersHasBeenSet()155     inline bool ParametersHasBeenSet() const { return m_parametersHasBeenSet; }
156 
157     /**
158      * <p>The parameters for the SQL statement.</p>  <p>Array parameters are not
159      * supported.</p>
160      */
SetParameters(const Aws::Vector<SqlParameter> & value)161     inline void SetParameters(const Aws::Vector<SqlParameter>& value) { m_parametersHasBeenSet = true; m_parameters = value; }
162 
163     /**
164      * <p>The parameters for the SQL statement.</p>  <p>Array parameters are not
165      * supported.</p>
166      */
SetParameters(Aws::Vector<SqlParameter> && value)167     inline void SetParameters(Aws::Vector<SqlParameter>&& value) { m_parametersHasBeenSet = true; m_parameters = std::move(value); }
168 
169     /**
170      * <p>The parameters for the SQL statement.</p>  <p>Array parameters are not
171      * supported.</p>
172      */
WithParameters(const Aws::Vector<SqlParameter> & value)173     inline ExecuteStatementRequest& WithParameters(const Aws::Vector<SqlParameter>& value) { SetParameters(value); return *this;}
174 
175     /**
176      * <p>The parameters for the SQL statement.</p>  <p>Array parameters are not
177      * supported.</p>
178      */
WithParameters(Aws::Vector<SqlParameter> && value)179     inline ExecuteStatementRequest& WithParameters(Aws::Vector<SqlParameter>&& value) { SetParameters(std::move(value)); return *this;}
180 
181     /**
182      * <p>The parameters for the SQL statement.</p>  <p>Array parameters are not
183      * supported.</p>
184      */
AddParameters(const SqlParameter & value)185     inline ExecuteStatementRequest& AddParameters(const SqlParameter& value) { m_parametersHasBeenSet = true; m_parameters.push_back(value); return *this; }
186 
187     /**
188      * <p>The parameters for the SQL statement.</p>  <p>Array parameters are not
189      * supported.</p>
190      */
AddParameters(SqlParameter && value)191     inline ExecuteStatementRequest& AddParameters(SqlParameter&& value) { m_parametersHasBeenSet = true; m_parameters.push_back(std::move(value)); return *this; }
192 
193 
194     /**
195      * <p>The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.</p>
196      */
GetResourceArn()197     inline const Aws::String& GetResourceArn() const{ return m_resourceArn; }
198 
199     /**
200      * <p>The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.</p>
201      */
ResourceArnHasBeenSet()202     inline bool ResourceArnHasBeenSet() const { return m_resourceArnHasBeenSet; }
203 
204     /**
205      * <p>The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.</p>
206      */
SetResourceArn(const Aws::String & value)207     inline void SetResourceArn(const Aws::String& value) { m_resourceArnHasBeenSet = true; m_resourceArn = value; }
208 
209     /**
210      * <p>The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.</p>
211      */
SetResourceArn(Aws::String && value)212     inline void SetResourceArn(Aws::String&& value) { m_resourceArnHasBeenSet = true; m_resourceArn = std::move(value); }
213 
214     /**
215      * <p>The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.</p>
216      */
SetResourceArn(const char * value)217     inline void SetResourceArn(const char* value) { m_resourceArnHasBeenSet = true; m_resourceArn.assign(value); }
218 
219     /**
220      * <p>The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.</p>
221      */
WithResourceArn(const Aws::String & value)222     inline ExecuteStatementRequest& WithResourceArn(const Aws::String& value) { SetResourceArn(value); return *this;}
223 
224     /**
225      * <p>The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.</p>
226      */
WithResourceArn(Aws::String && value)227     inline ExecuteStatementRequest& WithResourceArn(Aws::String&& value) { SetResourceArn(std::move(value)); return *this;}
228 
229     /**
230      * <p>The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.</p>
231      */
WithResourceArn(const char * value)232     inline ExecuteStatementRequest& WithResourceArn(const char* value) { SetResourceArn(value); return *this;}
233 
234 
235     /**
236      * <p>Options that control how the result set is returned.</p>
237      */
GetResultSetOptions()238     inline const ResultSetOptions& GetResultSetOptions() const{ return m_resultSetOptions; }
239 
240     /**
241      * <p>Options that control how the result set is returned.</p>
242      */
ResultSetOptionsHasBeenSet()243     inline bool ResultSetOptionsHasBeenSet() const { return m_resultSetOptionsHasBeenSet; }
244 
245     /**
246      * <p>Options that control how the result set is returned.</p>
247      */
SetResultSetOptions(const ResultSetOptions & value)248     inline void SetResultSetOptions(const ResultSetOptions& value) { m_resultSetOptionsHasBeenSet = true; m_resultSetOptions = value; }
249 
250     /**
251      * <p>Options that control how the result set is returned.</p>
252      */
SetResultSetOptions(ResultSetOptions && value)253     inline void SetResultSetOptions(ResultSetOptions&& value) { m_resultSetOptionsHasBeenSet = true; m_resultSetOptions = std::move(value); }
254 
255     /**
256      * <p>Options that control how the result set is returned.</p>
257      */
WithResultSetOptions(const ResultSetOptions & value)258     inline ExecuteStatementRequest& WithResultSetOptions(const ResultSetOptions& value) { SetResultSetOptions(value); return *this;}
259 
260     /**
261      * <p>Options that control how the result set is returned.</p>
262      */
WithResultSetOptions(ResultSetOptions && value)263     inline ExecuteStatementRequest& WithResultSetOptions(ResultSetOptions&& value) { SetResultSetOptions(std::move(value)); return *this;}
264 
265 
266     /**
267      * <p>The name of the database schema.</p>  <p>Currently, the
268      * <code>schema</code> parameter isn't supported.</p>
269      */
GetSchema()270     inline const Aws::String& GetSchema() const{ return m_schema; }
271 
272     /**
273      * <p>The name of the database schema.</p>  <p>Currently, the
274      * <code>schema</code> parameter isn't supported.</p>
275      */
SchemaHasBeenSet()276     inline bool SchemaHasBeenSet() const { return m_schemaHasBeenSet; }
277 
278     /**
279      * <p>The name of the database schema.</p>  <p>Currently, the
280      * <code>schema</code> parameter isn't supported.</p>
281      */
SetSchema(const Aws::String & value)282     inline void SetSchema(const Aws::String& value) { m_schemaHasBeenSet = true; m_schema = value; }
283 
284     /**
285      * <p>The name of the database schema.</p>  <p>Currently, the
286      * <code>schema</code> parameter isn't supported.</p>
287      */
SetSchema(Aws::String && value)288     inline void SetSchema(Aws::String&& value) { m_schemaHasBeenSet = true; m_schema = std::move(value); }
289 
290     /**
291      * <p>The name of the database schema.</p>  <p>Currently, the
292      * <code>schema</code> parameter isn't supported.</p>
293      */
SetSchema(const char * value)294     inline void SetSchema(const char* value) { m_schemaHasBeenSet = true; m_schema.assign(value); }
295 
296     /**
297      * <p>The name of the database schema.</p>  <p>Currently, the
298      * <code>schema</code> parameter isn't supported.</p>
299      */
WithSchema(const Aws::String & value)300     inline ExecuteStatementRequest& WithSchema(const Aws::String& value) { SetSchema(value); return *this;}
301 
302     /**
303      * <p>The name of the database schema.</p>  <p>Currently, the
304      * <code>schema</code> parameter isn't supported.</p>
305      */
WithSchema(Aws::String && value)306     inline ExecuteStatementRequest& WithSchema(Aws::String&& value) { SetSchema(std::move(value)); return *this;}
307 
308     /**
309      * <p>The name of the database schema.</p>  <p>Currently, the
310      * <code>schema</code> parameter isn't supported.</p>
311      */
WithSchema(const char * value)312     inline ExecuteStatementRequest& WithSchema(const char* value) { SetSchema(value); return *this;}
313 
314 
315     /**
316      * <p>The name or ARN of the secret that enables access to the DB cluster.</p>
317      */
GetSecretArn()318     inline const Aws::String& GetSecretArn() const{ return m_secretArn; }
319 
320     /**
321      * <p>The name or ARN of the secret that enables access to the DB cluster.</p>
322      */
SecretArnHasBeenSet()323     inline bool SecretArnHasBeenSet() const { return m_secretArnHasBeenSet; }
324 
325     /**
326      * <p>The name or ARN of the secret that enables access to the DB cluster.</p>
327      */
SetSecretArn(const Aws::String & value)328     inline void SetSecretArn(const Aws::String& value) { m_secretArnHasBeenSet = true; m_secretArn = value; }
329 
330     /**
331      * <p>The name or ARN of the secret that enables access to the DB cluster.</p>
332      */
SetSecretArn(Aws::String && value)333     inline void SetSecretArn(Aws::String&& value) { m_secretArnHasBeenSet = true; m_secretArn = std::move(value); }
334 
335     /**
336      * <p>The name or ARN of the secret that enables access to the DB cluster.</p>
337      */
SetSecretArn(const char * value)338     inline void SetSecretArn(const char* value) { m_secretArnHasBeenSet = true; m_secretArn.assign(value); }
339 
340     /**
341      * <p>The name or ARN of the secret that enables access to the DB cluster.</p>
342      */
WithSecretArn(const Aws::String & value)343     inline ExecuteStatementRequest& WithSecretArn(const Aws::String& value) { SetSecretArn(value); return *this;}
344 
345     /**
346      * <p>The name or ARN of the secret that enables access to the DB cluster.</p>
347      */
WithSecretArn(Aws::String && value)348     inline ExecuteStatementRequest& WithSecretArn(Aws::String&& value) { SetSecretArn(std::move(value)); return *this;}
349 
350     /**
351      * <p>The name or ARN of the secret that enables access to the DB cluster.</p>
352      */
WithSecretArn(const char * value)353     inline ExecuteStatementRequest& WithSecretArn(const char* value) { SetSecretArn(value); return *this;}
354 
355 
356     /**
357      * <p>The SQL statement to run.</p>
358      */
GetSql()359     inline const Aws::String& GetSql() const{ return m_sql; }
360 
361     /**
362      * <p>The SQL statement to run.</p>
363      */
SqlHasBeenSet()364     inline bool SqlHasBeenSet() const { return m_sqlHasBeenSet; }
365 
366     /**
367      * <p>The SQL statement to run.</p>
368      */
SetSql(const Aws::String & value)369     inline void SetSql(const Aws::String& value) { m_sqlHasBeenSet = true; m_sql = value; }
370 
371     /**
372      * <p>The SQL statement to run.</p>
373      */
SetSql(Aws::String && value)374     inline void SetSql(Aws::String&& value) { m_sqlHasBeenSet = true; m_sql = std::move(value); }
375 
376     /**
377      * <p>The SQL statement to run.</p>
378      */
SetSql(const char * value)379     inline void SetSql(const char* value) { m_sqlHasBeenSet = true; m_sql.assign(value); }
380 
381     /**
382      * <p>The SQL statement to run.</p>
383      */
WithSql(const Aws::String & value)384     inline ExecuteStatementRequest& WithSql(const Aws::String& value) { SetSql(value); return *this;}
385 
386     /**
387      * <p>The SQL statement to run.</p>
388      */
WithSql(Aws::String && value)389     inline ExecuteStatementRequest& WithSql(Aws::String&& value) { SetSql(std::move(value)); return *this;}
390 
391     /**
392      * <p>The SQL statement to run.</p>
393      */
WithSql(const char * value)394     inline ExecuteStatementRequest& WithSql(const char* value) { SetSql(value); return *this;}
395 
396 
397     /**
398      * <p>The identifier of a transaction that was started by using the
399      * <code>BeginTransaction</code> operation. Specify the transaction ID of the
400      * transaction that you want to include the SQL statement in.</p> <p>If the SQL
401      * statement is not part of a transaction, don't set this parameter.</p>
402      */
GetTransactionId()403     inline const Aws::String& GetTransactionId() const{ return m_transactionId; }
404 
405     /**
406      * <p>The identifier of a transaction that was started by using the
407      * <code>BeginTransaction</code> operation. Specify the transaction ID of the
408      * transaction that you want to include the SQL statement in.</p> <p>If the SQL
409      * statement is not part of a transaction, don't set this parameter.</p>
410      */
TransactionIdHasBeenSet()411     inline bool TransactionIdHasBeenSet() const { return m_transactionIdHasBeenSet; }
412 
413     /**
414      * <p>The identifier of a transaction that was started by using the
415      * <code>BeginTransaction</code> operation. Specify the transaction ID of the
416      * transaction that you want to include the SQL statement in.</p> <p>If the SQL
417      * statement is not part of a transaction, don't set this parameter.</p>
418      */
SetTransactionId(const Aws::String & value)419     inline void SetTransactionId(const Aws::String& value) { m_transactionIdHasBeenSet = true; m_transactionId = value; }
420 
421     /**
422      * <p>The identifier of a transaction that was started by using the
423      * <code>BeginTransaction</code> operation. Specify the transaction ID of the
424      * transaction that you want to include the SQL statement in.</p> <p>If the SQL
425      * statement is not part of a transaction, don't set this parameter.</p>
426      */
SetTransactionId(Aws::String && value)427     inline void SetTransactionId(Aws::String&& value) { m_transactionIdHasBeenSet = true; m_transactionId = std::move(value); }
428 
429     /**
430      * <p>The identifier of a transaction that was started by using the
431      * <code>BeginTransaction</code> operation. Specify the transaction ID of the
432      * transaction that you want to include the SQL statement in.</p> <p>If the SQL
433      * statement is not part of a transaction, don't set this parameter.</p>
434      */
SetTransactionId(const char * value)435     inline void SetTransactionId(const char* value) { m_transactionIdHasBeenSet = true; m_transactionId.assign(value); }
436 
437     /**
438      * <p>The identifier of a transaction that was started by using the
439      * <code>BeginTransaction</code> operation. Specify the transaction ID of the
440      * transaction that you want to include the SQL statement in.</p> <p>If the SQL
441      * statement is not part of a transaction, don't set this parameter.</p>
442      */
WithTransactionId(const Aws::String & value)443     inline ExecuteStatementRequest& WithTransactionId(const Aws::String& value) { SetTransactionId(value); return *this;}
444 
445     /**
446      * <p>The identifier of a transaction that was started by using the
447      * <code>BeginTransaction</code> operation. Specify the transaction ID of the
448      * transaction that you want to include the SQL statement in.</p> <p>If the SQL
449      * statement is not part of a transaction, don't set this parameter.</p>
450      */
WithTransactionId(Aws::String && value)451     inline ExecuteStatementRequest& WithTransactionId(Aws::String&& value) { SetTransactionId(std::move(value)); return *this;}
452 
453     /**
454      * <p>The identifier of a transaction that was started by using the
455      * <code>BeginTransaction</code> operation. Specify the transaction ID of the
456      * transaction that you want to include the SQL statement in.</p> <p>If the SQL
457      * statement is not part of a transaction, don't set this parameter.</p>
458      */
WithTransactionId(const char * value)459     inline ExecuteStatementRequest& WithTransactionId(const char* value) { SetTransactionId(value); return *this;}
460 
461   private:
462 
463     bool m_continueAfterTimeout;
464     bool m_continueAfterTimeoutHasBeenSet;
465 
466     Aws::String m_database;
467     bool m_databaseHasBeenSet;
468 
469     bool m_includeResultMetadata;
470     bool m_includeResultMetadataHasBeenSet;
471 
472     Aws::Vector<SqlParameter> m_parameters;
473     bool m_parametersHasBeenSet;
474 
475     Aws::String m_resourceArn;
476     bool m_resourceArnHasBeenSet;
477 
478     ResultSetOptions m_resultSetOptions;
479     bool m_resultSetOptionsHasBeenSet;
480 
481     Aws::String m_schema;
482     bool m_schemaHasBeenSet;
483 
484     Aws::String m_secretArn;
485     bool m_secretArnHasBeenSet;
486 
487     Aws::String m_sql;
488     bool m_sqlHasBeenSet;
489 
490     Aws::String m_transactionId;
491     bool m_transactionIdHasBeenSet;
492   };
493 
494 } // namespace Model
495 } // namespace RDSDataService
496 } // namespace Aws
497