aws_sdk_rdsdata/operation/execute_sql/
_execute_sql_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The request parameters represent the input of a request to run one or more SQL statements.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ExecuteSqlInput {
7    /// <p>The ARN of the Aurora Serverless DB cluster.</p>
8    pub db_cluster_or_instance_arn: ::std::option::Option<::std::string::String>,
9    /// <p>The Amazon Resource Name (ARN) of the secret that enables access to the DB cluster. Enter the database user name and password for the credentials in the secret.</p>
10    /// <p>For information about creating the secret, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/create_database_secret.html">Create a database secret</a>.</p>
11    pub aws_secret_store_arn: ::std::option::Option<::std::string::String>,
12    /// <p>One or more SQL statements to run on the DB cluster.</p>
13    /// <p>You can separate SQL statements from each other with a semicolon (;). Any valid SQL statement is permitted, including data definition, data manipulation, and commit statements.</p>
14    pub sql_statements: ::std::option::Option<::std::string::String>,
15    /// <p>The name of the database.</p>
16    pub database: ::std::option::Option<::std::string::String>,
17    /// <p>The name of the database schema.</p>
18    pub schema: ::std::option::Option<::std::string::String>,
19}
20impl ExecuteSqlInput {
21    /// <p>The ARN of the Aurora Serverless DB cluster.</p>
22    pub fn db_cluster_or_instance_arn(&self) -> ::std::option::Option<&str> {
23        self.db_cluster_or_instance_arn.as_deref()
24    }
25    /// <p>The Amazon Resource Name (ARN) of the secret that enables access to the DB cluster. Enter the database user name and password for the credentials in the secret.</p>
26    /// <p>For information about creating the secret, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/create_database_secret.html">Create a database secret</a>.</p>
27    pub fn aws_secret_store_arn(&self) -> ::std::option::Option<&str> {
28        self.aws_secret_store_arn.as_deref()
29    }
30    /// <p>One or more SQL statements to run on the DB cluster.</p>
31    /// <p>You can separate SQL statements from each other with a semicolon (;). Any valid SQL statement is permitted, including data definition, data manipulation, and commit statements.</p>
32    pub fn sql_statements(&self) -> ::std::option::Option<&str> {
33        self.sql_statements.as_deref()
34    }
35    /// <p>The name of the database.</p>
36    pub fn database(&self) -> ::std::option::Option<&str> {
37        self.database.as_deref()
38    }
39    /// <p>The name of the database schema.</p>
40    pub fn schema(&self) -> ::std::option::Option<&str> {
41        self.schema.as_deref()
42    }
43}
44impl ExecuteSqlInput {
45    /// Creates a new builder-style object to manufacture [`ExecuteSqlInput`](crate::operation::execute_sql::ExecuteSqlInput).
46    pub fn builder() -> crate::operation::execute_sql::builders::ExecuteSqlInputBuilder {
47        crate::operation::execute_sql::builders::ExecuteSqlInputBuilder::default()
48    }
49}
50
51/// A builder for [`ExecuteSqlInput`](crate::operation::execute_sql::ExecuteSqlInput).
52#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
53#[non_exhaustive]
54pub struct ExecuteSqlInputBuilder {
55    pub(crate) db_cluster_or_instance_arn: ::std::option::Option<::std::string::String>,
56    pub(crate) aws_secret_store_arn: ::std::option::Option<::std::string::String>,
57    pub(crate) sql_statements: ::std::option::Option<::std::string::String>,
58    pub(crate) database: ::std::option::Option<::std::string::String>,
59    pub(crate) schema: ::std::option::Option<::std::string::String>,
60}
61impl ExecuteSqlInputBuilder {
62    /// <p>The ARN of the Aurora Serverless DB cluster.</p>
63    /// This field is required.
64    pub fn db_cluster_or_instance_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
65        self.db_cluster_or_instance_arn = ::std::option::Option::Some(input.into());
66        self
67    }
68    /// <p>The ARN of the Aurora Serverless DB cluster.</p>
69    pub fn set_db_cluster_or_instance_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
70        self.db_cluster_or_instance_arn = input;
71        self
72    }
73    /// <p>The ARN of the Aurora Serverless DB cluster.</p>
74    pub fn get_db_cluster_or_instance_arn(&self) -> &::std::option::Option<::std::string::String> {
75        &self.db_cluster_or_instance_arn
76    }
77    /// <p>The Amazon Resource Name (ARN) of the secret that enables access to the DB cluster. Enter the database user name and password for the credentials in the secret.</p>
78    /// <p>For information about creating the secret, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/create_database_secret.html">Create a database secret</a>.</p>
79    /// This field is required.
80    pub fn aws_secret_store_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.aws_secret_store_arn = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The Amazon Resource Name (ARN) of the secret that enables access to the DB cluster. Enter the database user name and password for the credentials in the secret.</p>
85    /// <p>For information about creating the secret, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/create_database_secret.html">Create a database secret</a>.</p>
86    pub fn set_aws_secret_store_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.aws_secret_store_arn = input;
88        self
89    }
90    /// <p>The Amazon Resource Name (ARN) of the secret that enables access to the DB cluster. Enter the database user name and password for the credentials in the secret.</p>
91    /// <p>For information about creating the secret, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/create_database_secret.html">Create a database secret</a>.</p>
92    pub fn get_aws_secret_store_arn(&self) -> &::std::option::Option<::std::string::String> {
93        &self.aws_secret_store_arn
94    }
95    /// <p>One or more SQL statements to run on the DB cluster.</p>
96    /// <p>You can separate SQL statements from each other with a semicolon (;). Any valid SQL statement is permitted, including data definition, data manipulation, and commit statements.</p>
97    /// This field is required.
98    pub fn sql_statements(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
99        self.sql_statements = ::std::option::Option::Some(input.into());
100        self
101    }
102    /// <p>One or more SQL statements to run on the DB cluster.</p>
103    /// <p>You can separate SQL statements from each other with a semicolon (;). Any valid SQL statement is permitted, including data definition, data manipulation, and commit statements.</p>
104    pub fn set_sql_statements(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
105        self.sql_statements = input;
106        self
107    }
108    /// <p>One or more SQL statements to run on the DB cluster.</p>
109    /// <p>You can separate SQL statements from each other with a semicolon (;). Any valid SQL statement is permitted, including data definition, data manipulation, and commit statements.</p>
110    pub fn get_sql_statements(&self) -> &::std::option::Option<::std::string::String> {
111        &self.sql_statements
112    }
113    /// <p>The name of the database.</p>
114    pub fn database(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.database = ::std::option::Option::Some(input.into());
116        self
117    }
118    /// <p>The name of the database.</p>
119    pub fn set_database(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.database = input;
121        self
122    }
123    /// <p>The name of the database.</p>
124    pub fn get_database(&self) -> &::std::option::Option<::std::string::String> {
125        &self.database
126    }
127    /// <p>The name of the database schema.</p>
128    pub fn schema(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.schema = ::std::option::Option::Some(input.into());
130        self
131    }
132    /// <p>The name of the database schema.</p>
133    pub fn set_schema(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.schema = input;
135        self
136    }
137    /// <p>The name of the database schema.</p>
138    pub fn get_schema(&self) -> &::std::option::Option<::std::string::String> {
139        &self.schema
140    }
141    /// Consumes the builder and constructs a [`ExecuteSqlInput`](crate::operation::execute_sql::ExecuteSqlInput).
142    pub fn build(self) -> ::std::result::Result<crate::operation::execute_sql::ExecuteSqlInput, ::aws_smithy_types::error::operation::BuildError> {
143        ::std::result::Result::Ok(crate::operation::execute_sql::ExecuteSqlInput {
144            db_cluster_or_instance_arn: self.db_cluster_or_instance_arn,
145            aws_secret_store_arn: self.aws_secret_store_arn,
146            sql_statements: self.sql_statements,
147            database: self.database,
148            schema: self.schema,
149        })
150    }
151}