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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
// 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 TransactWriteItemsOutput {
    /// <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>
    #[doc(hidden)]
    pub consumed_capacity: ::std::option::Option<::std::vec::Vec<crate::types::ConsumedCapacity>>,
    /// <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>
    #[doc(hidden)]
    pub item_collection_metrics: ::std::option::Option<
        ::std::collections::HashMap<
            ::std::string::String,
            ::std::vec::Vec<crate::types::ItemCollectionMetrics>,
        >,
    >,
    _request_id: Option<String>,
}
impl TransactWriteItemsOutput {
    /// <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>
    pub fn consumed_capacity(&self) -> ::std::option::Option<&[crate::types::ConsumedCapacity]> {
        self.consumed_capacity.as_deref()
    }
    /// <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>
    pub fn item_collection_metrics(
        &self,
    ) -> ::std::option::Option<
        &::std::collections::HashMap<
            ::std::string::String,
            ::std::vec::Vec<crate::types::ItemCollectionMetrics>,
        >,
    > {
        self.item_collection_metrics.as_ref()
    }
}
impl ::aws_http::request_id::RequestId for TransactWriteItemsOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl TransactWriteItemsOutput {
    /// Creates a new builder-style object to manufacture [`TransactWriteItemsOutput`](crate::operation::transact_write_items::TransactWriteItemsOutput).
    pub fn builder(
    ) -> crate::operation::transact_write_items::builders::TransactWriteItemsOutputBuilder {
        crate::operation::transact_write_items::builders::TransactWriteItemsOutputBuilder::default()
    }
}

/// A builder for [`TransactWriteItemsOutput`](crate::operation::transact_write_items::TransactWriteItemsOutput).
#[non_exhaustive]
#[derive(
    ::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug,
)]
pub struct TransactWriteItemsOutputBuilder {
    pub(crate) consumed_capacity:
        ::std::option::Option<::std::vec::Vec<crate::types::ConsumedCapacity>>,
    pub(crate) item_collection_metrics: ::std::option::Option<
        ::std::collections::HashMap<
            ::std::string::String,
            ::std::vec::Vec<crate::types::ItemCollectionMetrics>,
        >,
    >,
    _request_id: Option<String>,
}
impl TransactWriteItemsOutputBuilder {
    /// Appends an item to `consumed_capacity`.
    ///
    /// To override the contents of this collection use [`set_consumed_capacity`](Self::set_consumed_capacity).
    ///
    /// <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>
    pub fn consumed_capacity(mut self, input: crate::types::ConsumedCapacity) -> Self {
        let mut v = self.consumed_capacity.unwrap_or_default();
        v.push(input);
        self.consumed_capacity = ::std::option::Option::Some(v);
        self
    }
    /// <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>
    pub fn set_consumed_capacity(
        mut self,
        input: ::std::option::Option<::std::vec::Vec<crate::types::ConsumedCapacity>>,
    ) -> Self {
        self.consumed_capacity = input;
        self
    }
    /// Adds a key-value pair to `item_collection_metrics`.
    ///
    /// To override the contents of this collection use [`set_item_collection_metrics`](Self::set_item_collection_metrics).
    ///
    /// <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>
    pub fn item_collection_metrics(
        mut self,
        k: impl ::std::convert::Into<::std::string::String>,
        v: ::std::vec::Vec<crate::types::ItemCollectionMetrics>,
    ) -> Self {
        let mut hash_map = self.item_collection_metrics.unwrap_or_default();
        hash_map.insert(k.into(), v);
        self.item_collection_metrics = ::std::option::Option::Some(hash_map);
        self
    }
    /// <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>
    pub fn set_item_collection_metrics(
        mut self,
        input: ::std::option::Option<
            ::std::collections::HashMap<
                ::std::string::String,
                ::std::vec::Vec<crate::types::ItemCollectionMetrics>,
            >,
        >,
    ) -> Self {
        self.item_collection_metrics = input;
        self
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`TransactWriteItemsOutput`](crate::operation::transact_write_items::TransactWriteItemsOutput).
    pub fn build(self) -> crate::operation::transact_write_items::TransactWriteItemsOutput {
        crate::operation::transact_write_items::TransactWriteItemsOutput {
            consumed_capacity: self.consumed_capacity,
            item_collection_metrics: self.item_collection_metrics,
            _request_id: self._request_id,
        }
    }
}