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 start a SQL transaction.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct BeginTransactionInput {
    /// <p>The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.</p>
    pub resource_arn: ::std::option::Option<::std::string::String>,
    /// <p>The name or ARN of the secret that enables access to the DB cluster.</p>
    pub secret_arn: ::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 BeginTransactionInput {
    /// <p>The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.</p>
    pub fn resource_arn(&self) -> ::std::option::Option<&str> {
        self.resource_arn.as_deref()
    }
    /// <p>The name or ARN of the secret that enables access to the DB cluster.</p>
    pub fn secret_arn(&self) -> ::std::option::Option<&str> {
        self.secret_arn.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 BeginTransactionInput {
    /// Creates a new builder-style object to manufacture [`BeginTransactionInput`](crate::operation::begin_transaction::BeginTransactionInput).
    pub fn builder() -> crate::operation::begin_transaction::builders::BeginTransactionInputBuilder {
        crate::operation::begin_transaction::builders::BeginTransactionInputBuilder::default()
    }
}

/// A builder for [`BeginTransactionInput`](crate::operation::begin_transaction::BeginTransactionInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct BeginTransactionInputBuilder {
    pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
    pub(crate) secret_arn: ::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 BeginTransactionInputBuilder {
    /// <p>The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.</p>
    /// This field is required.
    pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.resource_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.</p>
    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.resource_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.</p>
    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.resource_arn
    }
    /// <p>The name or ARN of the secret that enables access to the DB cluster.</p>
    /// This field is required.
    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 DB cluster.</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 DB cluster.</p>
    pub fn get_secret_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.secret_arn
    }
    /// <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 [`BeginTransactionInput`](crate::operation::begin_transaction::BeginTransactionInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::begin_transaction::BeginTransactionInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::begin_transaction::BeginTransactionInput {
            resource_arn: self.resource_arn,
            secret_arn: self.secret_arn,
            database: self.database,
            schema: self.schema,
        })
    }
}