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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ExecuteTransactionInput {
    /// <p>The list of PartiQL statements representing the transaction to run.</p>
    #[doc(hidden)]
    pub transact_statements:
        std::option::Option<std::vec::Vec<crate::types::ParameterizedStatement>>,
    /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
    #[doc(hidden)]
    pub client_request_token: std::option::Option<std::string::String>,
    /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactGetItems.html">TransactGetItems</a> and <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactWriteItems.html">TransactWriteItems</a>.</p>
    #[doc(hidden)]
    pub return_consumed_capacity: std::option::Option<crate::types::ReturnConsumedCapacity>,
}
impl ExecuteTransactionInput {
    /// <p>The list of PartiQL statements representing the transaction to run.</p>
    pub fn transact_statements(
        &self,
    ) -> std::option::Option<&[crate::types::ParameterizedStatement]> {
        self.transact_statements.as_deref()
    }
    /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
    pub fn client_request_token(&self) -> std::option::Option<&str> {
        self.client_request_token.as_deref()
    }
    /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactGetItems.html">TransactGetItems</a> and <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactWriteItems.html">TransactWriteItems</a>.</p>
    pub fn return_consumed_capacity(
        &self,
    ) -> std::option::Option<&crate::types::ReturnConsumedCapacity> {
        self.return_consumed_capacity.as_ref()
    }
}
impl ExecuteTransactionInput {
    /// Creates a new builder-style object to manufacture [`ExecuteTransactionInput`](crate::operation::execute_transaction::ExecuteTransactionInput).
    pub fn builder(
    ) -> crate::operation::execute_transaction::builders::ExecuteTransactionInputBuilder {
        crate::operation::execute_transaction::builders::ExecuteTransactionInputBuilder::default()
    }
}

/// A builder for [`ExecuteTransactionInput`](crate::operation::execute_transaction::ExecuteTransactionInput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct ExecuteTransactionInputBuilder {
    pub(crate) transact_statements:
        std::option::Option<std::vec::Vec<crate::types::ParameterizedStatement>>,
    pub(crate) client_request_token: std::option::Option<std::string::String>,
    pub(crate) return_consumed_capacity: std::option::Option<crate::types::ReturnConsumedCapacity>,
}
impl ExecuteTransactionInputBuilder {
    /// Appends an item to `transact_statements`.
    ///
    /// To override the contents of this collection use [`set_transact_statements`](Self::set_transact_statements).
    ///
    /// <p>The list of PartiQL statements representing the transaction to run.</p>
    pub fn transact_statements(mut self, input: crate::types::ParameterizedStatement) -> Self {
        let mut v = self.transact_statements.unwrap_or_default();
        v.push(input);
        self.transact_statements = Some(v);
        self
    }
    /// <p>The list of PartiQL statements representing the transaction to run.</p>
    pub fn set_transact_statements(
        mut self,
        input: std::option::Option<std::vec::Vec<crate::types::ParameterizedStatement>>,
    ) -> Self {
        self.transact_statements = input;
        self
    }
    /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
    pub fn client_request_token(mut self, input: impl Into<std::string::String>) -> Self {
        self.client_request_token = Some(input.into());
        self
    }
    /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
    pub fn set_client_request_token(
        mut self,
        input: std::option::Option<std::string::String>,
    ) -> Self {
        self.client_request_token = input;
        self
    }
    /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactGetItems.html">TransactGetItems</a> and <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactWriteItems.html">TransactWriteItems</a>.</p>
    pub fn return_consumed_capacity(mut self, input: crate::types::ReturnConsumedCapacity) -> Self {
        self.return_consumed_capacity = Some(input);
        self
    }
    /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactGetItems.html">TransactGetItems</a> and <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactWriteItems.html">TransactWriteItems</a>.</p>
    pub fn set_return_consumed_capacity(
        mut self,
        input: std::option::Option<crate::types::ReturnConsumedCapacity>,
    ) -> Self {
        self.return_consumed_capacity = input;
        self
    }
    /// Consumes the builder and constructs a [`ExecuteTransactionInput`](crate::operation::execute_transaction::ExecuteTransactionInput).
    pub fn build(
        self,
    ) -> Result<
        crate::operation::execute_transaction::ExecuteTransactionInput,
        aws_smithy_http::operation::error::BuildError,
    > {
        Ok(
            crate::operation::execute_transaction::ExecuteTransactionInput {
                transact_statements: self.transact_statements,
                client_request_token: self.client_request_token,
                return_consumed_capacity: self.return_consumed_capacity,
            },
        )
    }
}