aws_sdk_dynamodb/operation/delete_item/
_delete_item_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the output of a <code>DeleteItem</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DeleteItemOutput {
7    /// <p>A map of attribute names to <code>AttributeValue</code> objects, representing the item as it appeared before the <code>DeleteItem</code> operation. This map appears in the response only if <code>ReturnValues</code> was specified as <code>ALL_OLD</code> in the request.</p>
8    pub attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
9    /// <p>The capacity units consumed by the <code>DeleteItem</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/provisioned-capacity-mode.html">Provisioned capacity mode</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
10    pub consumed_capacity: ::std::option::Option<crate::types::ConsumedCapacity>,
11    /// <p>Information about item collections, if any, that were affected by the <code>DeleteItem</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>
12    /// <p>Each <code>ItemCollectionMetrics</code> element consists of:</p>
13    /// <ul>
14    /// <li>
15    /// <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>
16    /// <li>
17    /// <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>
18    /// <p>The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.</p></li>
19    /// </ul>
20    pub item_collection_metrics: ::std::option::Option<crate::types::ItemCollectionMetrics>,
21    _request_id: Option<String>,
22}
23impl DeleteItemOutput {
24    /// <p>A map of attribute names to <code>AttributeValue</code> objects, representing the item as it appeared before the <code>DeleteItem</code> operation. This map appears in the response only if <code>ReturnValues</code> was specified as <code>ALL_OLD</code> in the request.</p>
25    pub fn attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> {
26        self.attributes.as_ref()
27    }
28    /// <p>The capacity units consumed by the <code>DeleteItem</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/provisioned-capacity-mode.html">Provisioned capacity mode</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
29    pub fn consumed_capacity(&self) -> ::std::option::Option<&crate::types::ConsumedCapacity> {
30        self.consumed_capacity.as_ref()
31    }
32    /// <p>Information about item collections, if any, that were affected by the <code>DeleteItem</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>
33    /// <p>Each <code>ItemCollectionMetrics</code> element consists of:</p>
34    /// <ul>
35    /// <li>
36    /// <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>
37    /// <li>
38    /// <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>
39    /// <p>The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.</p></li>
40    /// </ul>
41    pub fn item_collection_metrics(&self) -> ::std::option::Option<&crate::types::ItemCollectionMetrics> {
42        self.item_collection_metrics.as_ref()
43    }
44}
45impl ::aws_types::request_id::RequestId for DeleteItemOutput {
46    fn request_id(&self) -> Option<&str> {
47        self._request_id.as_deref()
48    }
49}
50impl DeleteItemOutput {
51    /// Creates a new builder-style object to manufacture [`DeleteItemOutput`](crate::operation::delete_item::DeleteItemOutput).
52    pub fn builder() -> crate::operation::delete_item::builders::DeleteItemOutputBuilder {
53        crate::operation::delete_item::builders::DeleteItemOutputBuilder::default()
54    }
55}
56
57/// A builder for [`DeleteItemOutput`](crate::operation::delete_item::DeleteItemOutput).
58#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
59#[non_exhaustive]
60pub struct DeleteItemOutputBuilder {
61    pub(crate) attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
62    pub(crate) consumed_capacity: ::std::option::Option<crate::types::ConsumedCapacity>,
63    pub(crate) item_collection_metrics: ::std::option::Option<crate::types::ItemCollectionMetrics>,
64    _request_id: Option<String>,
65}
66impl DeleteItemOutputBuilder {
67    /// Adds a key-value pair to `attributes`.
68    ///
69    /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
70    ///
71    /// <p>A map of attribute names to <code>AttributeValue</code> objects, representing the item as it appeared before the <code>DeleteItem</code> operation. This map appears in the response only if <code>ReturnValues</code> was specified as <code>ALL_OLD</code> in the request.</p>
72    pub fn attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
73        let mut hash_map = self.attributes.unwrap_or_default();
74        hash_map.insert(k.into(), v);
75        self.attributes = ::std::option::Option::Some(hash_map);
76        self
77    }
78    /// <p>A map of attribute names to <code>AttributeValue</code> objects, representing the item as it appeared before the <code>DeleteItem</code> operation. This map appears in the response only if <code>ReturnValues</code> was specified as <code>ALL_OLD</code> in the request.</p>
79    pub fn set_attributes(
80        mut self,
81        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
82    ) -> Self {
83        self.attributes = input;
84        self
85    }
86    /// <p>A map of attribute names to <code>AttributeValue</code> objects, representing the item as it appeared before the <code>DeleteItem</code> operation. This map appears in the response only if <code>ReturnValues</code> was specified as <code>ALL_OLD</code> in the request.</p>
87    pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> {
88        &self.attributes
89    }
90    /// <p>The capacity units consumed by the <code>DeleteItem</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/provisioned-capacity-mode.html">Provisioned capacity mode</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
91    pub fn consumed_capacity(mut self, input: crate::types::ConsumedCapacity) -> Self {
92        self.consumed_capacity = ::std::option::Option::Some(input);
93        self
94    }
95    /// <p>The capacity units consumed by the <code>DeleteItem</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/provisioned-capacity-mode.html">Provisioned capacity mode</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
96    pub fn set_consumed_capacity(mut self, input: ::std::option::Option<crate::types::ConsumedCapacity>) -> Self {
97        self.consumed_capacity = input;
98        self
99    }
100    /// <p>The capacity units consumed by the <code>DeleteItem</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/provisioned-capacity-mode.html">Provisioned capacity mode</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>DeleteItem</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>DeleteItem</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;
128        self
129    }
130    /// <p>Information about item collections, if any, that were affected by the <code>DeleteItem</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>
131    /// <p>Each <code>ItemCollectionMetrics</code> element consists of:</p>
132    /// <ul>
133    /// <li>
134    /// <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>
135    /// <li>
136    /// <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>
137    /// <p>The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.</p></li>
138    /// </ul>
139    pub fn get_item_collection_metrics(&self) -> &::std::option::Option<crate::types::ItemCollectionMetrics> {
140        &self.item_collection_metrics
141    }
142    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
143        self._request_id = Some(request_id.into());
144        self
145    }
146
147    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
148        self._request_id = request_id;
149        self
150    }
151    /// Consumes the builder and constructs a [`DeleteItemOutput`](crate::operation::delete_item::DeleteItemOutput).
152    pub fn build(self) -> crate::operation::delete_item::DeleteItemOutput {
153        crate::operation::delete_item::DeleteItemOutput {
154            attributes: self.attributes,
155            consumed_capacity: self.consumed_capacity,
156            item_collection_metrics: self.item_collection_metrics,
157            _request_id: self._request_id,
158        }
159    }
160}