aws_sdk_dynamodb/operation/batch_execute_statement/_batch_execute_statement_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 BatchExecuteStatementInput {
6 /// <p>The list of PartiQL statements representing the batch to run.</p>
7 pub statements: ::std::option::Option<::std::vec::Vec<crate::types::BatchStatementRequest>>,
8 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
9 /// <ul>
10 /// <li>
11 /// <p><code>INDEXES</code> - The response includes the aggregate <code>ConsumedCapacity</code> for the operation, together with <code>ConsumedCapacity</code> for each table and secondary index that was accessed.</p>
12 /// <p>Note that some operations, such as <code>GetItem</code> and <code>BatchGetItem</code>, do not access any indexes at all. In these cases, specifying <code>INDEXES</code> will only return <code>ConsumedCapacity</code> information for table(s).</p></li>
13 /// <li>
14 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
15 /// <li>
16 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
17 /// </ul>
18 pub return_consumed_capacity: ::std::option::Option<crate::types::ReturnConsumedCapacity>,
19}
20impl BatchExecuteStatementInput {
21 /// <p>The list of PartiQL statements representing the batch to run.</p>
22 ///
23 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.statements.is_none()`.
24 pub fn statements(&self) -> &[crate::types::BatchStatementRequest] {
25 self.statements.as_deref().unwrap_or_default()
26 }
27 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
28 /// <ul>
29 /// <li>
30 /// <p><code>INDEXES</code> - The response includes the aggregate <code>ConsumedCapacity</code> for the operation, together with <code>ConsumedCapacity</code> for each table and secondary index that was accessed.</p>
31 /// <p>Note that some operations, such as <code>GetItem</code> and <code>BatchGetItem</code>, do not access any indexes at all. In these cases, specifying <code>INDEXES</code> will only return <code>ConsumedCapacity</code> information for table(s).</p></li>
32 /// <li>
33 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
34 /// <li>
35 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
36 /// </ul>
37 pub fn return_consumed_capacity(&self) -> ::std::option::Option<&crate::types::ReturnConsumedCapacity> {
38 self.return_consumed_capacity.as_ref()
39 }
40}
41impl BatchExecuteStatementInput {
42 /// Creates a new builder-style object to manufacture [`BatchExecuteStatementInput`](crate::operation::batch_execute_statement::BatchExecuteStatementInput).
43 pub fn builder() -> crate::operation::batch_execute_statement::builders::BatchExecuteStatementInputBuilder {
44 crate::operation::batch_execute_statement::builders::BatchExecuteStatementInputBuilder::default()
45 }
46}
47
48/// A builder for [`BatchExecuteStatementInput`](crate::operation::batch_execute_statement::BatchExecuteStatementInput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct BatchExecuteStatementInputBuilder {
52 pub(crate) statements: ::std::option::Option<::std::vec::Vec<crate::types::BatchStatementRequest>>,
53 pub(crate) return_consumed_capacity: ::std::option::Option<crate::types::ReturnConsumedCapacity>,
54}
55impl BatchExecuteStatementInputBuilder {
56 /// Appends an item to `statements`.
57 ///
58 /// To override the contents of this collection use [`set_statements`](Self::set_statements).
59 ///
60 /// <p>The list of PartiQL statements representing the batch to run.</p>
61 pub fn statements(mut self, input: crate::types::BatchStatementRequest) -> Self {
62 let mut v = self.statements.unwrap_or_default();
63 v.push(input);
64 self.statements = ::std::option::Option::Some(v);
65 self
66 }
67 /// <p>The list of PartiQL statements representing the batch to run.</p>
68 pub fn set_statements(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BatchStatementRequest>>) -> Self {
69 self.statements = input;
70 self
71 }
72 /// <p>The list of PartiQL statements representing the batch to run.</p>
73 pub fn get_statements(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BatchStatementRequest>> {
74 &self.statements
75 }
76 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
77 /// <ul>
78 /// <li>
79 /// <p><code>INDEXES</code> - The response includes the aggregate <code>ConsumedCapacity</code> for the operation, together with <code>ConsumedCapacity</code> for each table and secondary index that was accessed.</p>
80 /// <p>Note that some operations, such as <code>GetItem</code> and <code>BatchGetItem</code>, do not access any indexes at all. In these cases, specifying <code>INDEXES</code> will only return <code>ConsumedCapacity</code> information for table(s).</p></li>
81 /// <li>
82 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
83 /// <li>
84 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
85 /// </ul>
86 pub fn return_consumed_capacity(mut self, input: crate::types::ReturnConsumedCapacity) -> Self {
87 self.return_consumed_capacity = ::std::option::Option::Some(input);
88 self
89 }
90 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
91 /// <ul>
92 /// <li>
93 /// <p><code>INDEXES</code> - The response includes the aggregate <code>ConsumedCapacity</code> for the operation, together with <code>ConsumedCapacity</code> for each table and secondary index that was accessed.</p>
94 /// <p>Note that some operations, such as <code>GetItem</code> and <code>BatchGetItem</code>, do not access any indexes at all. In these cases, specifying <code>INDEXES</code> will only return <code>ConsumedCapacity</code> information for table(s).</p></li>
95 /// <li>
96 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
97 /// <li>
98 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
99 /// </ul>
100 pub fn set_return_consumed_capacity(mut self, input: ::std::option::Option<crate::types::ReturnConsumedCapacity>) -> Self {
101 self.return_consumed_capacity = input;
102 self
103 }
104 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
105 /// <ul>
106 /// <li>
107 /// <p><code>INDEXES</code> - The response includes the aggregate <code>ConsumedCapacity</code> for the operation, together with <code>ConsumedCapacity</code> for each table and secondary index that was accessed.</p>
108 /// <p>Note that some operations, such as <code>GetItem</code> and <code>BatchGetItem</code>, do not access any indexes at all. In these cases, specifying <code>INDEXES</code> will only return <code>ConsumedCapacity</code> information for table(s).</p></li>
109 /// <li>
110 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
111 /// <li>
112 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
113 /// </ul>
114 pub fn get_return_consumed_capacity(&self) -> &::std::option::Option<crate::types::ReturnConsumedCapacity> {
115 &self.return_consumed_capacity
116 }
117 /// Consumes the builder and constructs a [`BatchExecuteStatementInput`](crate::operation::batch_execute_statement::BatchExecuteStatementInput).
118 pub fn build(
119 self,
120 ) -> ::std::result::Result<crate::operation::batch_execute_statement::BatchExecuteStatementInput, ::aws_smithy_types::error::operation::BuildError>
121 {
122 ::std::result::Result::Ok(crate::operation::batch_execute_statement::BatchExecuteStatementInput {
123 statements: self.statements,
124 return_consumed_capacity: self.return_consumed_capacity,
125 })
126 }
127}