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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The request parameters represent the input of a request to run one or more SQL statements.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ExecuteSqlInput {
/// <p>The ARN of the Aurora Serverless DB cluster.</p>
pub db_cluster_or_instance_arn: ::std::option::Option<::std::string::String>,
/// <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>
/// <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>
pub aws_secret_store_arn: ::std::option::Option<::std::string::String>,
/// <p>One or more SQL statements to run on the DB cluster.</p>
/// <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>
pub sql_statements: ::std::option::Option<::std::string::String>,
/// <p>The name of the database.</p>
pub database: ::std::option::Option<::std::string::String>,
/// <p>The name of the database schema.</p>
pub schema: ::std::option::Option<::std::string::String>,
}
impl ExecuteSqlInput {
/// <p>The ARN of the Aurora Serverless DB cluster.</p>
pub fn db_cluster_or_instance_arn(&self) -> ::std::option::Option<&str> {
self.db_cluster_or_instance_arn.as_deref()
}
/// <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>
/// <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>
pub fn aws_secret_store_arn(&self) -> ::std::option::Option<&str> {
self.aws_secret_store_arn.as_deref()
}
/// <p>One or more SQL statements to run on the DB cluster.</p>
/// <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>
pub fn sql_statements(&self) -> ::std::option::Option<&str> {
self.sql_statements.as_deref()
}
/// <p>The name of the database.</p>
pub fn database(&self) -> ::std::option::Option<&str> {
self.database.as_deref()
}
/// <p>The name of the database schema.</p>
pub fn schema(&self) -> ::std::option::Option<&str> {
self.schema.as_deref()
}
}
impl ExecuteSqlInput {
/// Creates a new builder-style object to manufacture [`ExecuteSqlInput`](crate::operation::execute_sql::ExecuteSqlInput).
pub fn builder() -> crate::operation::execute_sql::builders::ExecuteSqlInputBuilder {
crate::operation::execute_sql::builders::ExecuteSqlInputBuilder::default()
}
}
/// A builder for [`ExecuteSqlInput`](crate::operation::execute_sql::ExecuteSqlInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ExecuteSqlInputBuilder {
pub(crate) db_cluster_or_instance_arn: ::std::option::Option<::std::string::String>,
pub(crate) aws_secret_store_arn: ::std::option::Option<::std::string::String>,
pub(crate) sql_statements: ::std::option::Option<::std::string::String>,
pub(crate) database: ::std::option::Option<::std::string::String>,
pub(crate) schema: ::std::option::Option<::std::string::String>,
}
impl ExecuteSqlInputBuilder {
/// <p>The ARN of the Aurora Serverless DB cluster.</p>
/// This field is required.
pub fn db_cluster_or_instance_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.db_cluster_or_instance_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The ARN of the Aurora Serverless DB cluster.</p>
pub fn set_db_cluster_or_instance_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.db_cluster_or_instance_arn = input;
self
}
/// <p>The ARN of the Aurora Serverless DB cluster.</p>
pub fn get_db_cluster_or_instance_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.db_cluster_or_instance_arn
}
/// <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>
/// <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>
/// This field is required.
pub fn aws_secret_store_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.aws_secret_store_arn = ::std::option::Option::Some(input.into());
self
}
/// <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>
/// <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>
pub fn set_aws_secret_store_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.aws_secret_store_arn = input;
self
}
/// <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>
/// <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>
pub fn get_aws_secret_store_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.aws_secret_store_arn
}
/// <p>One or more SQL statements to run on the DB cluster.</p>
/// <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>
/// This field is required.
pub fn sql_statements(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.sql_statements = ::std::option::Option::Some(input.into());
self
}
/// <p>One or more SQL statements to run on the DB cluster.</p>
/// <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>
pub fn set_sql_statements(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.sql_statements = input;
self
}
/// <p>One or more SQL statements to run on the DB cluster.</p>
/// <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>
pub fn get_sql_statements(&self) -> &::std::option::Option<::std::string::String> {
&self.sql_statements
}
/// <p>The name of the database.</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.</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.</p>
pub fn get_database(&self) -> &::std::option::Option<::std::string::String> {
&self.database
}
/// <p>The name of the database schema.</p>
pub fn schema(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.schema = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the database schema.</p>
pub fn set_schema(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.schema = input;
self
}
/// <p>The name of the database schema.</p>
pub fn get_schema(&self) -> &::std::option::Option<::std::string::String> {
&self.schema
}
/// Consumes the builder and constructs a [`ExecuteSqlInput`](crate::operation::execute_sql::ExecuteSqlInput).
pub fn build(self) -> ::std::result::Result<crate::operation::execute_sql::ExecuteSqlInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::execute_sql::ExecuteSqlInput {
db_cluster_or_instance_arn: self.db_cluster_or_instance_arn,
aws_secret_store_arn: self.aws_secret_store_arn,
sql_statements: self.sql_statements,
database: self.database,
schema: self.schema,
})
}
}