aws_sdk_dynamodb/operation/transact_write_items/_transact_write_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 TransactWriteItemsOutput {
6 /// <p>The capacity units consumed by the entire <code>TransactWriteItems</code> operation. The values of the list are ordered according to the ordering of the <code>TransactItems</code> request parameter.</p>
7 pub consumed_capacity: ::std::option::Option<::std::vec::Vec<crate::types::ConsumedCapacity>>,
8 /// <p>A list of tables that were processed by <code>TransactWriteItems</code> and, for each table, information about any item collections that were affected by individual <code>UpdateItem</code>, <code>PutItem</code>, or <code>DeleteItem</code> operations.</p>
9 pub item_collection_metrics:
10 ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::ItemCollectionMetrics>>>,
11 _request_id: Option<String>,
12}
13impl TransactWriteItemsOutput {
14 /// <p>The capacity units consumed by the entire <code>TransactWriteItems</code> operation. The values of the list are ordered according to the ordering of the <code>TransactItems</code> request parameter.</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>A list of tables that were processed by <code>TransactWriteItems</code> and, for each table, information about any item collections that were affected by individual <code>UpdateItem</code>, <code>PutItem</code>, or <code>DeleteItem</code> operations.</p>
21 pub fn item_collection_metrics(
22 &self,
23 ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::ItemCollectionMetrics>>> {
24 self.item_collection_metrics.as_ref()
25 }
26}
27impl ::aws_types::request_id::RequestId for TransactWriteItemsOutput {
28 fn request_id(&self) -> Option<&str> {
29 self._request_id.as_deref()
30 }
31}
32impl TransactWriteItemsOutput {
33 /// Creates a new builder-style object to manufacture [`TransactWriteItemsOutput`](crate::operation::transact_write_items::TransactWriteItemsOutput).
34 pub fn builder() -> crate::operation::transact_write_items::builders::TransactWriteItemsOutputBuilder {
35 crate::operation::transact_write_items::builders::TransactWriteItemsOutputBuilder::default()
36 }
37}
38
39/// A builder for [`TransactWriteItemsOutput`](crate::operation::transact_write_items::TransactWriteItemsOutput).
40#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
41#[non_exhaustive]
42pub struct TransactWriteItemsOutputBuilder {
43 pub(crate) consumed_capacity: ::std::option::Option<::std::vec::Vec<crate::types::ConsumedCapacity>>,
44 pub(crate) item_collection_metrics:
45 ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::ItemCollectionMetrics>>>,
46 _request_id: Option<String>,
47}
48impl TransactWriteItemsOutputBuilder {
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>The capacity units consumed by the entire <code>TransactWriteItems</code> operation. The values of the list are ordered according to the ordering of the <code>TransactItems</code> request parameter.</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>The capacity units consumed by the entire <code>TransactWriteItems</code> operation. The values of the list are ordered according to the ordering of the <code>TransactItems</code> request parameter.</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>The capacity units consumed by the entire <code>TransactWriteItems</code> operation. The values of the list are ordered according to the ordering of the <code>TransactItems</code> request parameter.</p>
66 pub fn get_consumed_capacity(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ConsumedCapacity>> {
67 &self.consumed_capacity
68 }
69 /// Adds a key-value pair to `item_collection_metrics`.
70 ///
71 /// To override the contents of this collection use [`set_item_collection_metrics`](Self::set_item_collection_metrics).
72 ///
73 /// <p>A list of tables that were processed by <code>TransactWriteItems</code> and, for each table, information about any item collections that were affected by individual <code>UpdateItem</code>, <code>PutItem</code>, or <code>DeleteItem</code> operations.</p>
74 pub fn item_collection_metrics(
75 mut self,
76 k: impl ::std::convert::Into<::std::string::String>,
77 v: ::std::vec::Vec<crate::types::ItemCollectionMetrics>,
78 ) -> Self {
79 let mut hash_map = self.item_collection_metrics.unwrap_or_default();
80 hash_map.insert(k.into(), v);
81 self.item_collection_metrics = ::std::option::Option::Some(hash_map);
82 self
83 }
84 /// <p>A list of tables that were processed by <code>TransactWriteItems</code> and, for each table, information about any item collections that were affected by individual <code>UpdateItem</code>, <code>PutItem</code>, or <code>DeleteItem</code> operations.</p>
85 pub fn set_item_collection_metrics(
86 mut self,
87 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::ItemCollectionMetrics>>>,
88 ) -> Self {
89 self.item_collection_metrics = input;
90 self
91 }
92 /// <p>A list of tables that were processed by <code>TransactWriteItems</code> and, for each table, information about any item collections that were affected by individual <code>UpdateItem</code>, <code>PutItem</code>, or <code>DeleteItem</code> operations.</p>
93 pub fn get_item_collection_metrics(
94 &self,
95 ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::ItemCollectionMetrics>>> {
96 &self.item_collection_metrics
97 }
98 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
99 self._request_id = Some(request_id.into());
100 self
101 }
102
103 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
104 self._request_id = request_id;
105 self
106 }
107 /// Consumes the builder and constructs a [`TransactWriteItemsOutput`](crate::operation::transact_write_items::TransactWriteItemsOutput).
108 pub fn build(self) -> crate::operation::transact_write_items::TransactWriteItemsOutput {
109 crate::operation::transact_write_items::TransactWriteItemsOutput {
110 consumed_capacity: self.consumed_capacity,
111 item_collection_metrics: self.item_collection_metrics,
112 _request_id: self._request_id,
113 }
114 }
115}