aws_sdk_dynamodb/operation/update_item/_update_item_output.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the output of an <code>UpdateItem</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateItemOutput {
7 /// <p>A map of attribute values as they appear before or after the <code>UpdateItem</code> operation, as determined by the <code>ReturnValues</code> parameter.</p>
8 /// <p>The <code>Attributes</code> map is only present if the update was successful and <code>ReturnValues</code> was specified as something other than <code>NONE</code> in the request. Each element represents one attribute.</p>
9 pub attributes: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>,
10 /// <p>The capacity units consumed by the <code>UpdateItem</code> operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation. <code>ConsumedCapacity</code> is only returned if the <code>ReturnConsumedCapacity</code> parameter was specified. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/read-write-operations.html#write-operation-consumption">Capacity unity consumption for write operations</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
11 pub consumed_capacity: ::std::option::Option<crate::types::ConsumedCapacity>,
12 /// <p>Information about item collections, if any, that were affected by the <code>UpdateItem</code> operation. <code>ItemCollectionMetrics</code> is only returned if the <code>ReturnItemCollectionMetrics</code> parameter was specified. If the table does not have any local secondary indexes, this information is not returned in the response.</p>
13 /// <p>Each <code>ItemCollectionMetrics</code> element consists of:</p>
14 /// <ul>
15 /// <li>
16 /// <p><code>ItemCollectionKey</code> - The partition key value of the item collection. This is the same as the partition key value of the item itself.</p></li>
17 /// <li>
18 /// <p><code>SizeEstimateRangeGB</code> - An estimate of item collection size, in gigabytes. This value is a two-element array containing a lower bound and an upper bound for the estimate. The estimate includes the size of all the items in the table, plus the size of all attributes projected into all of the local secondary indexes on that table. Use this estimate to measure whether a local secondary index is approaching its size limit.</p>
19 /// <p>The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.</p></li>
20 /// </ul>
21 pub item_collection_metrics: ::std::option::Option<crate::types::ItemCollectionMetrics>,
22 _request_id: Option<String>,
23}
24impl UpdateItemOutput {
25 /// <p>A map of attribute values as they appear before or after the <code>UpdateItem</code> operation, as determined by the <code>ReturnValues</code> parameter.</p>
26 /// <p>The <code>Attributes</code> map is only present if the update was successful and <code>ReturnValues</code> was specified as something other than <code>NONE</code> in the request. Each element represents one attribute.</p>
27 pub fn attributes(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>> {
28 self.attributes.as_ref()
29 }
30 /// <p>The capacity units consumed by the <code>UpdateItem</code> operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation. <code>ConsumedCapacity</code> is only returned if the <code>ReturnConsumedCapacity</code> parameter was specified. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/read-write-operations.html#write-operation-consumption">Capacity unity consumption for write operations</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
31 pub fn consumed_capacity(&self) -> ::std::option::Option<&crate::types::ConsumedCapacity> {
32 self.consumed_capacity.as_ref()
33 }
34 /// <p>Information about item collections, if any, that were affected by the <code>UpdateItem</code> operation. <code>ItemCollectionMetrics</code> is only returned if the <code>ReturnItemCollectionMetrics</code> parameter was specified. If the table does not have any local secondary indexes, this information is not returned in the response.</p>
35 /// <p>Each <code>ItemCollectionMetrics</code> element consists of:</p>
36 /// <ul>
37 /// <li>
38 /// <p><code>ItemCollectionKey</code> - The partition key value of the item collection. This is the same as the partition key value of the item itself.</p></li>
39 /// <li>
40 /// <p><code>SizeEstimateRangeGB</code> - An estimate of item collection size, in gigabytes. This value is a two-element array containing a lower bound and an upper bound for the estimate. The estimate includes the size of all the items in the table, plus the size of all attributes projected into all of the local secondary indexes on that table. Use this estimate to measure whether a local secondary index is approaching its size limit.</p>
41 /// <p>The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.</p></li>
42 /// </ul>
43 pub fn item_collection_metrics(&self) -> ::std::option::Option<&crate::types::ItemCollectionMetrics> {
44 self.item_collection_metrics.as_ref()
45 }
46}
47impl ::aws_types::request_id::RequestId for UpdateItemOutput {
48 fn request_id(&self) -> Option<&str> {
49 self._request_id.as_deref()
50 }
51 }
52impl UpdateItemOutput {
53 /// Creates a new builder-style object to manufacture [`UpdateItemOutput`](crate::operation::update_item::UpdateItemOutput).
54 pub fn builder() -> crate::operation::update_item::builders::UpdateItemOutputBuilder {
55 crate::operation::update_item::builders::UpdateItemOutputBuilder::default()
56 }
57}
58
59/// A builder for [`UpdateItemOutput`](crate::operation::update_item::UpdateItemOutput).
60#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
61#[non_exhaustive]
62pub struct UpdateItemOutputBuilder {
63 pub(crate) attributes: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>,
64 pub(crate) consumed_capacity: ::std::option::Option<crate::types::ConsumedCapacity>,
65 pub(crate) item_collection_metrics: ::std::option::Option<crate::types::ItemCollectionMetrics>,
66 _request_id: Option<String>,
67}
68impl UpdateItemOutputBuilder {
69 /// Adds a key-value pair to `attributes`.
70 ///
71 /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
72 ///
73 /// <p>A map of attribute values as they appear before or after the <code>UpdateItem</code> operation, as determined by the <code>ReturnValues</code> parameter.</p>
74 /// <p>The <code>Attributes</code> map is only present if the update was successful and <code>ReturnValues</code> was specified as something other than <code>NONE</code> in the request. Each element represents one attribute.</p>
75 pub fn attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
76 let mut hash_map = self.attributes.unwrap_or_default();
77 hash_map.insert(k.into(), v);
78 self.attributes = ::std::option::Option::Some(hash_map);
79 self
80 }
81 /// <p>A map of attribute values as they appear before or after the <code>UpdateItem</code> operation, as determined by the <code>ReturnValues</code> parameter.</p>
82 /// <p>The <code>Attributes</code> map is only present if the update was successful and <code>ReturnValues</code> was specified as something other than <code>NONE</code> in the request. Each element represents one attribute.</p>
83 pub fn set_attributes(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>) -> Self {
84 self.attributes = input; self
85 }
86 /// <p>A map of attribute values as they appear before or after the <code>UpdateItem</code> operation, as determined by the <code>ReturnValues</code> parameter.</p>
87 /// <p>The <code>Attributes</code> map is only present if the update was successful and <code>ReturnValues</code> was specified as something other than <code>NONE</code> in the request. Each element represents one attribute.</p>
88 pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>> {
89 &self.attributes
90 }
91 /// <p>The capacity units consumed by the <code>UpdateItem</code> operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation. <code>ConsumedCapacity</code> is only returned if the <code>ReturnConsumedCapacity</code> parameter was specified. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/read-write-operations.html#write-operation-consumption">Capacity unity consumption for write operations</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
92 pub fn consumed_capacity(mut self, input: crate::types::ConsumedCapacity) -> Self {
93 self.consumed_capacity = ::std::option::Option::Some(input);
94 self
95 }
96 /// <p>The capacity units consumed by the <code>UpdateItem</code> operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation. <code>ConsumedCapacity</code> is only returned if the <code>ReturnConsumedCapacity</code> parameter was specified. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/read-write-operations.html#write-operation-consumption">Capacity unity consumption for write operations</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
97 pub fn set_consumed_capacity(mut self, input: ::std::option::Option<crate::types::ConsumedCapacity>) -> Self {
98 self.consumed_capacity = input; self
99 }
100 /// <p>The capacity units consumed by the <code>UpdateItem</code> operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation. <code>ConsumedCapacity</code> is only returned if the <code>ReturnConsumedCapacity</code> parameter was specified. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/read-write-operations.html#write-operation-consumption">Capacity unity consumption for write operations</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
101 pub fn get_consumed_capacity(&self) -> &::std::option::Option<crate::types::ConsumedCapacity> {
102 &self.consumed_capacity
103 }
104 /// <p>Information about item collections, if any, that were affected by the <code>UpdateItem</code> operation. <code>ItemCollectionMetrics</code> is only returned if the <code>ReturnItemCollectionMetrics</code> parameter was specified. If the table does not have any local secondary indexes, this information is not returned in the response.</p>
105 /// <p>Each <code>ItemCollectionMetrics</code> element consists of:</p>
106 /// <ul>
107 /// <li>
108 /// <p><code>ItemCollectionKey</code> - The partition key value of the item collection. This is the same as the partition key value of the item itself.</p></li>
109 /// <li>
110 /// <p><code>SizeEstimateRangeGB</code> - An estimate of item collection size, in gigabytes. This value is a two-element array containing a lower bound and an upper bound for the estimate. The estimate includes the size of all the items in the table, plus the size of all attributes projected into all of the local secondary indexes on that table. Use this estimate to measure whether a local secondary index is approaching its size limit.</p>
111 /// <p>The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.</p></li>
112 /// </ul>
113 pub fn item_collection_metrics(mut self, input: crate::types::ItemCollectionMetrics) -> Self {
114 self.item_collection_metrics = ::std::option::Option::Some(input);
115 self
116 }
117 /// <p>Information about item collections, if any, that were affected by the <code>UpdateItem</code> operation. <code>ItemCollectionMetrics</code> is only returned if the <code>ReturnItemCollectionMetrics</code> parameter was specified. If the table does not have any local secondary indexes, this information is not returned in the response.</p>
118 /// <p>Each <code>ItemCollectionMetrics</code> element consists of:</p>
119 /// <ul>
120 /// <li>
121 /// <p><code>ItemCollectionKey</code> - The partition key value of the item collection. This is the same as the partition key value of the item itself.</p></li>
122 /// <li>
123 /// <p><code>SizeEstimateRangeGB</code> - An estimate of item collection size, in gigabytes. This value is a two-element array containing a lower bound and an upper bound for the estimate. The estimate includes the size of all the items in the table, plus the size of all attributes projected into all of the local secondary indexes on that table. Use this estimate to measure whether a local secondary index is approaching its size limit.</p>
124 /// <p>The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.</p></li>
125 /// </ul>
126 pub fn set_item_collection_metrics(mut self, input: ::std::option::Option<crate::types::ItemCollectionMetrics>) -> Self {
127 self.item_collection_metrics = input; self
128 }
129 /// <p>Information about item collections, if any, that were affected by the <code>UpdateItem</code> operation. <code>ItemCollectionMetrics</code> is only returned if the <code>ReturnItemCollectionMetrics</code> parameter was specified. If the table does not have any local secondary indexes, this information is not returned in the response.</p>
130 /// <p>Each <code>ItemCollectionMetrics</code> element consists of:</p>
131 /// <ul>
132 /// <li>
133 /// <p><code>ItemCollectionKey</code> - The partition key value of the item collection. This is the same as the partition key value of the item itself.</p></li>
134 /// <li>
135 /// <p><code>SizeEstimateRangeGB</code> - An estimate of item collection size, in gigabytes. This value is a two-element array containing a lower bound and an upper bound for the estimate. The estimate includes the size of all the items in the table, plus the size of all attributes projected into all of the local secondary indexes on that table. Use this estimate to measure whether a local secondary index is approaching its size limit.</p>
136 /// <p>The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.</p></li>
137 /// </ul>
138 pub fn get_item_collection_metrics(&self) -> &::std::option::Option<crate::types::ItemCollectionMetrics> {
139 &self.item_collection_metrics
140 }
141 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
142 self._request_id = Some(request_id.into());
143 self
144 }
145
146 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
147 self._request_id = request_id;
148 self
149 }
150 /// Consumes the builder and constructs a [`UpdateItemOutput`](crate::operation::update_item::UpdateItemOutput).
151 pub fn build(self) -> crate::operation::update_item::UpdateItemOutput {
152 crate::operation::update_item::UpdateItemOutput {
153 attributes: self.attributes
154 ,
155 consumed_capacity: self.consumed_capacity
156 ,
157 item_collection_metrics: self.item_collection_metrics
158 ,
159 _request_id: self._request_id,
160 }
161 }
162}
163