aws_sdk_dynamodb/operation/transact_get_items/_transact_get_items_output.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 TransactGetItemsOutput {
6 /// <p>If the <i>ReturnConsumedCapacity</i> value was <code>TOTAL</code>, this is an array of <code>ConsumedCapacity</code> objects, one for each table addressed by <code>TransactGetItem</code> objects in the <i>TransactItems</i> parameter. These <code>ConsumedCapacity</code> objects report the read-capacity units consumed by the <code>TransactGetItems</code> call in that table.</p>
7 pub consumed_capacity: ::std::option::Option<::std::vec::Vec<crate::types::ConsumedCapacity>>,
8 /// <p>An ordered array of up to 100 <code>ItemResponse</code> objects, each of which corresponds to the <code>TransactGetItem</code> object in the same position in the <i>TransactItems</i> array. Each <code>ItemResponse</code> object contains a Map of the name-value pairs that are the projected attributes of the requested item.</p>
9 /// <p>If a requested item could not be retrieved, the corresponding <code>ItemResponse</code> object is Null, or if the requested item has no projected attributes, the corresponding <code>ItemResponse</code> object is an empty Map.</p>
10 pub responses: ::std::option::Option<::std::vec::Vec<crate::types::ItemResponse>>,
11 _request_id: Option<String>,
12}
13impl TransactGetItemsOutput {
14 /// <p>If the <i>ReturnConsumedCapacity</i> value was <code>TOTAL</code>, this is an array of <code>ConsumedCapacity</code> objects, one for each table addressed by <code>TransactGetItem</code> objects in the <i>TransactItems</i> parameter. These <code>ConsumedCapacity</code> objects report the read-capacity units consumed by the <code>TransactGetItems</code> call in that table.</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 `.consumed_capacity.is_none()`.
17 pub fn consumed_capacity(&self) -> &[crate::types::ConsumedCapacity] {
18 self.consumed_capacity.as_deref().unwrap_or_default()
19 }
20 /// <p>An ordered array of up to 100 <code>ItemResponse</code> objects, each of which corresponds to the <code>TransactGetItem</code> object in the same position in the <i>TransactItems</i> array. Each <code>ItemResponse</code> object contains a Map of the name-value pairs that are the projected attributes of the requested item.</p>
21 /// <p>If a requested item could not be retrieved, the corresponding <code>ItemResponse</code> object is Null, or if the requested item has no projected attributes, the corresponding <code>ItemResponse</code> object is an empty Map.</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 `.responses.is_none()`.
24 pub fn responses(&self) -> &[crate::types::ItemResponse] {
25 self.responses.as_deref().unwrap_or_default()
26 }
27}
28impl ::aws_types::request_id::RequestId for TransactGetItemsOutput {
29 fn request_id(&self) -> Option<&str> {
30 self._request_id.as_deref()
31 }
32}
33impl TransactGetItemsOutput {
34 /// Creates a new builder-style object to manufacture [`TransactGetItemsOutput`](crate::operation::transact_get_items::TransactGetItemsOutput).
35 pub fn builder() -> crate::operation::transact_get_items::builders::TransactGetItemsOutputBuilder {
36 crate::operation::transact_get_items::builders::TransactGetItemsOutputBuilder::default()
37 }
38}
39
40/// A builder for [`TransactGetItemsOutput`](crate::operation::transact_get_items::TransactGetItemsOutput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct TransactGetItemsOutputBuilder {
44 pub(crate) consumed_capacity: ::std::option::Option<::std::vec::Vec<crate::types::ConsumedCapacity>>,
45 pub(crate) responses: ::std::option::Option<::std::vec::Vec<crate::types::ItemResponse>>,
46 _request_id: Option<String>,
47}
48impl TransactGetItemsOutputBuilder {
49 /// Appends an item to `consumed_capacity`.
50 ///
51 /// To override the contents of this collection use [`set_consumed_capacity`](Self::set_consumed_capacity).
52 ///
53 /// <p>If the <i>ReturnConsumedCapacity</i> value was <code>TOTAL</code>, this is an array of <code>ConsumedCapacity</code> objects, one for each table addressed by <code>TransactGetItem</code> objects in the <i>TransactItems</i> parameter. These <code>ConsumedCapacity</code> objects report the read-capacity units consumed by the <code>TransactGetItems</code> call in that table.</p>
54 pub fn consumed_capacity(mut self, input: crate::types::ConsumedCapacity) -> Self {
55 let mut v = self.consumed_capacity.unwrap_or_default();
56 v.push(input);
57 self.consumed_capacity = ::std::option::Option::Some(v);
58 self
59 }
60 /// <p>If the <i>ReturnConsumedCapacity</i> value was <code>TOTAL</code>, this is an array of <code>ConsumedCapacity</code> objects, one for each table addressed by <code>TransactGetItem</code> objects in the <i>TransactItems</i> parameter. These <code>ConsumedCapacity</code> objects report the read-capacity units consumed by the <code>TransactGetItems</code> call in that table.</p>
61 pub fn set_consumed_capacity(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ConsumedCapacity>>) -> Self {
62 self.consumed_capacity = input;
63 self
64 }
65 /// <p>If the <i>ReturnConsumedCapacity</i> value was <code>TOTAL</code>, this is an array of <code>ConsumedCapacity</code> objects, one for each table addressed by <code>TransactGetItem</code> objects in the <i>TransactItems</i> parameter. These <code>ConsumedCapacity</code> objects report the read-capacity units consumed by the <code>TransactGetItems</code> call in that table.</p>
66 pub fn get_consumed_capacity(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ConsumedCapacity>> {
67 &self.consumed_capacity
68 }
69 /// Appends an item to `responses`.
70 ///
71 /// To override the contents of this collection use [`set_responses`](Self::set_responses).
72 ///
73 /// <p>An ordered array of up to 100 <code>ItemResponse</code> objects, each of which corresponds to the <code>TransactGetItem</code> object in the same position in the <i>TransactItems</i> array. Each <code>ItemResponse</code> object contains a Map of the name-value pairs that are the projected attributes of the requested item.</p>
74 /// <p>If a requested item could not be retrieved, the corresponding <code>ItemResponse</code> object is Null, or if the requested item has no projected attributes, the corresponding <code>ItemResponse</code> object is an empty Map.</p>
75 pub fn responses(mut self, input: crate::types::ItemResponse) -> Self {
76 let mut v = self.responses.unwrap_or_default();
77 v.push(input);
78 self.responses = ::std::option::Option::Some(v);
79 self
80 }
81 /// <p>An ordered array of up to 100 <code>ItemResponse</code> objects, each of which corresponds to the <code>TransactGetItem</code> object in the same position in the <i>TransactItems</i> array. Each <code>ItemResponse</code> object contains a Map of the name-value pairs that are the projected attributes of the requested item.</p>
82 /// <p>If a requested item could not be retrieved, the corresponding <code>ItemResponse</code> object is Null, or if the requested item has no projected attributes, the corresponding <code>ItemResponse</code> object is an empty Map.</p>
83 pub fn set_responses(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ItemResponse>>) -> Self {
84 self.responses = input;
85 self
86 }
87 /// <p>An ordered array of up to 100 <code>ItemResponse</code> objects, each of which corresponds to the <code>TransactGetItem</code> object in the same position in the <i>TransactItems</i> array. Each <code>ItemResponse</code> object contains a Map of the name-value pairs that are the projected attributes of the requested item.</p>
88 /// <p>If a requested item could not be retrieved, the corresponding <code>ItemResponse</code> object is Null, or if the requested item has no projected attributes, the corresponding <code>ItemResponse</code> object is an empty Map.</p>
89 pub fn get_responses(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ItemResponse>> {
90 &self.responses
91 }
92 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
93 self._request_id = Some(request_id.into());
94 self
95 }
96
97 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
98 self._request_id = request_id;
99 self
100 }
101 /// Consumes the builder and constructs a [`TransactGetItemsOutput`](crate::operation::transact_get_items::TransactGetItemsOutput).
102 pub fn build(self) -> crate::operation::transact_get_items::TransactGetItemsOutput {
103 crate::operation::transact_get_items::TransactGetItemsOutput {
104 consumed_capacity: self.consumed_capacity,
105 responses: self.responses,
106 _request_id: self._request_id,
107 }
108 }
109}