aws-sdk-rdsdata 1.100.0

AWS SDK for AWS RDS DataService
Documentation
// 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).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
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,
        })
    }
}