aws_sdk_rdsdata/operation/begin_transaction/
_begin_transaction_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 start a SQL transaction.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct BeginTransactionInput {
7    /// <p>The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.</p>
8    pub resource_arn: ::std::option::Option<::std::string::String>,
9    /// <p>The name or ARN of the secret that enables access to the DB cluster.</p>
10    pub secret_arn: ::std::option::Option<::std::string::String>,
11    /// <p>The name of the database.</p>
12    pub database: ::std::option::Option<::std::string::String>,
13    /// <p>The name of the database schema.</p>
14    pub schema: ::std::option::Option<::std::string::String>,
15}
16impl BeginTransactionInput {
17    /// <p>The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.</p>
18    pub fn resource_arn(&self) -> ::std::option::Option<&str> {
19        self.resource_arn.as_deref()
20    }
21    /// <p>The name or ARN of the secret that enables access to the DB cluster.</p>
22    pub fn secret_arn(&self) -> ::std::option::Option<&str> {
23        self.secret_arn.as_deref()
24    }
25    /// <p>The name of the database.</p>
26    pub fn database(&self) -> ::std::option::Option<&str> {
27        self.database.as_deref()
28    }
29    /// <p>The name of the database schema.</p>
30    pub fn schema(&self) -> ::std::option::Option<&str> {
31        self.schema.as_deref()
32    }
33}
34impl BeginTransactionInput {
35    /// Creates a new builder-style object to manufacture [`BeginTransactionInput`](crate::operation::begin_transaction::BeginTransactionInput).
36    pub fn builder() -> crate::operation::begin_transaction::builders::BeginTransactionInputBuilder {
37        crate::operation::begin_transaction::builders::BeginTransactionInputBuilder::default()
38    }
39}
40
41/// A builder for [`BeginTransactionInput`](crate::operation::begin_transaction::BeginTransactionInput).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct BeginTransactionInputBuilder {
45    pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
46    pub(crate) secret_arn: ::std::option::Option<::std::string::String>,
47    pub(crate) database: ::std::option::Option<::std::string::String>,
48    pub(crate) schema: ::std::option::Option<::std::string::String>,
49}
50impl BeginTransactionInputBuilder {
51    /// <p>The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.</p>
52    /// This field is required.
53    pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
54        self.resource_arn = ::std::option::Option::Some(input.into());
55        self
56    }
57    /// <p>The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.</p>
58    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
59        self.resource_arn = input;
60        self
61    }
62    /// <p>The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.</p>
63    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
64        &self.resource_arn
65    }
66    /// <p>The name or ARN of the secret that enables access to the DB cluster.</p>
67    /// This field is required.
68    pub fn secret_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.secret_arn = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>The name or ARN of the secret that enables access to the DB cluster.</p>
73    pub fn set_secret_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.secret_arn = input;
75        self
76    }
77    /// <p>The name or ARN of the secret that enables access to the DB cluster.</p>
78    pub fn get_secret_arn(&self) -> &::std::option::Option<::std::string::String> {
79        &self.secret_arn
80    }
81    /// <p>The name of the database.</p>
82    pub fn database(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83        self.database = ::std::option::Option::Some(input.into());
84        self
85    }
86    /// <p>The name of the database.</p>
87    pub fn set_database(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88        self.database = input;
89        self
90    }
91    /// <p>The name of the database.</p>
92    pub fn get_database(&self) -> &::std::option::Option<::std::string::String> {
93        &self.database
94    }
95    /// <p>The name of the database schema.</p>
96    pub fn schema(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.schema = ::std::option::Option::Some(input.into());
98        self
99    }
100    /// <p>The name of the database schema.</p>
101    pub fn set_schema(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.schema = input;
103        self
104    }
105    /// <p>The name of the database schema.</p>
106    pub fn get_schema(&self) -> &::std::option::Option<::std::string::String> {
107        &self.schema
108    }
109    /// Consumes the builder and constructs a [`BeginTransactionInput`](crate::operation::begin_transaction::BeginTransactionInput).
110    pub fn build(
111        self,
112    ) -> ::std::result::Result<crate::operation::begin_transaction::BeginTransactionInput, ::aws_smithy_types::error::operation::BuildError> {
113        ::std::result::Result::Ok(crate::operation::begin_transaction::BeginTransactionInput {
114            resource_arn: self.resource_arn,
115            secret_arn: self.secret_arn,
116            database: self.database,
117            schema: self.schema,
118        })
119    }
120}