aws_sdk_dynamodb/operation/execute_transaction/_execute_transaction_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct ExecuteTransactionInput {
6 /// <p>The list of PartiQL statements representing the transaction to run.</p>
7 pub transact_statements: ::std::option::Option<::std::vec::Vec::<crate::types::ParameterizedStatement>>,
8 /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
9 pub client_request_token: ::std::option::Option<::std::string::String>,
10 /// <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>
11 pub return_consumed_capacity: ::std::option::Option<crate::types::ReturnConsumedCapacity>,
12}
13impl ExecuteTransactionInput {
14 /// <p>The list of PartiQL statements representing the transaction to run.</p>
15 ///
16 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.transact_statements.is_none()`.
17 pub fn transact_statements(&self) -> &[crate::types::ParameterizedStatement] {
18 self.transact_statements.as_deref()
19 .unwrap_or_default()
20 }
21 /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
22 pub fn client_request_token(&self) -> ::std::option::Option<&str> {
23 self.client_request_token.as_deref()
24 }
25 /// <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>
26 pub fn return_consumed_capacity(&self) -> ::std::option::Option<&crate::types::ReturnConsumedCapacity> {
27 self.return_consumed_capacity.as_ref()
28 }
29}
30impl ExecuteTransactionInput {
31 /// Creates a new builder-style object to manufacture [`ExecuteTransactionInput`](crate::operation::execute_transaction::ExecuteTransactionInput).
32 pub fn builder() -> crate::operation::execute_transaction::builders::ExecuteTransactionInputBuilder {
33 crate::operation::execute_transaction::builders::ExecuteTransactionInputBuilder::default()
34 }
35}
36
37/// A builder for [`ExecuteTransactionInput`](crate::operation::execute_transaction::ExecuteTransactionInput).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct ExecuteTransactionInputBuilder {
41 pub(crate) transact_statements: ::std::option::Option<::std::vec::Vec::<crate::types::ParameterizedStatement>>,
42 pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
43 pub(crate) return_consumed_capacity: ::std::option::Option<crate::types::ReturnConsumedCapacity>,
44}
45impl ExecuteTransactionInputBuilder {
46 /// Appends an item to `transact_statements`.
47 ///
48 /// To override the contents of this collection use [`set_transact_statements`](Self::set_transact_statements).
49 ///
50 /// <p>The list of PartiQL statements representing the transaction to run.</p>
51 pub fn transact_statements(mut self, input: crate::types::ParameterizedStatement) -> Self {
52 let mut v = self.transact_statements.unwrap_or_default();
53 v.push(input);
54 self.transact_statements = ::std::option::Option::Some(v);
55 self
56 }
57 /// <p>The list of PartiQL statements representing the transaction to run.</p>
58 pub fn set_transact_statements(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::ParameterizedStatement>>) -> Self {
59 self.transact_statements = input; self
60 }
61 /// <p>The list of PartiQL statements representing the transaction to run.</p>
62 pub fn get_transact_statements(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::ParameterizedStatement>> {
63 &self.transact_statements
64 }
65 /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
66 pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67 self.client_request_token = ::std::option::Option::Some(input.into());
68 self
69 }
70 /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
71 pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72 self.client_request_token = input; self
73 }
74 /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
75 pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
76 &self.client_request_token
77 }
78 /// <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>
79 pub fn return_consumed_capacity(mut self, input: crate::types::ReturnConsumedCapacity) -> Self {
80 self.return_consumed_capacity = ::std::option::Option::Some(input);
81 self
82 }
83 /// <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>
84 pub fn set_return_consumed_capacity(mut self, input: ::std::option::Option<crate::types::ReturnConsumedCapacity>) -> Self {
85 self.return_consumed_capacity = input; self
86 }
87 /// <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>
88 pub fn get_return_consumed_capacity(&self) -> &::std::option::Option<crate::types::ReturnConsumedCapacity> {
89 &self.return_consumed_capacity
90 }
91 /// Consumes the builder and constructs a [`ExecuteTransactionInput`](crate::operation::execute_transaction::ExecuteTransactionInput).
92 pub fn build(self) -> ::std::result::Result<crate::operation::execute_transaction::ExecuteTransactionInput, ::aws_smithy_types::error::operation::BuildError> {
93 ::std::result::Result::Ok(
94 crate::operation::execute_transaction::ExecuteTransactionInput {
95 transact_statements: self.transact_statements
96 ,
97 client_request_token: self.client_request_token
98 ,
99 return_consumed_capacity: self.return_consumed_capacity
100 ,
101 }
102 )
103 }
104}
105