1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #pragma once
7 #include <aws/dynamodb/DynamoDB_EXPORTS.h>
8 #include <aws/core/utils/memory/stl/AWSMap.h>
9 #include <aws/dynamodb/model/ConsumedCapacity.h>
10 #include <aws/dynamodb/model/ItemCollectionMetrics.h>
11 #include <aws/core/utils/memory/stl/AWSString.h>
12 #include <aws/dynamodb/model/AttributeValue.h>
13 #include <utility>
14 
15 namespace Aws
16 {
17 template<typename RESULT_TYPE>
18 class AmazonWebServiceResult;
19 
20 namespace Utils
21 {
22 namespace Json
23 {
24   class JsonValue;
25 } // namespace Json
26 } // namespace Utils
27 namespace DynamoDB
28 {
29 namespace Model
30 {
31   /**
32    * <p>Represents the output of a <code>PutItem</code> operation.</p><p><h3>See
33    * Also:</h3>   <a
34    * href="http://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/PutItemOutput">AWS
35    * API Reference</a></p>
36    */
37   class AWS_DYNAMODB_API PutItemResult
38   {
39   public:
40     PutItemResult();
41     PutItemResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
42     PutItemResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
43 
44 
45     /**
46      * <p>The attribute values as they appeared before the <code>PutItem</code>
47      * operation, but only if <code>ReturnValues</code> is specified as
48      * <code>ALL_OLD</code> in the request. Each element consists of an attribute name
49      * and an attribute value.</p>
50      */
GetAttributes()51     inline const Aws::Map<Aws::String, AttributeValue>& GetAttributes() const{ return m_attributes; }
52 
53     /**
54      * <p>The attribute values as they appeared before the <code>PutItem</code>
55      * operation, but only if <code>ReturnValues</code> is specified as
56      * <code>ALL_OLD</code> in the request. Each element consists of an attribute name
57      * and an attribute value.</p>
58      */
SetAttributes(const Aws::Map<Aws::String,AttributeValue> & value)59     inline void SetAttributes(const Aws::Map<Aws::String, AttributeValue>& value) { m_attributes = value; }
60 
61     /**
62      * <p>The attribute values as they appeared before the <code>PutItem</code>
63      * operation, but only if <code>ReturnValues</code> is specified as
64      * <code>ALL_OLD</code> in the request. Each element consists of an attribute name
65      * and an attribute value.</p>
66      */
SetAttributes(Aws::Map<Aws::String,AttributeValue> && value)67     inline void SetAttributes(Aws::Map<Aws::String, AttributeValue>&& value) { m_attributes = std::move(value); }
68 
69     /**
70      * <p>The attribute values as they appeared before the <code>PutItem</code>
71      * operation, but only if <code>ReturnValues</code> is specified as
72      * <code>ALL_OLD</code> in the request. Each element consists of an attribute name
73      * and an attribute value.</p>
74      */
WithAttributes(const Aws::Map<Aws::String,AttributeValue> & value)75     inline PutItemResult& WithAttributes(const Aws::Map<Aws::String, AttributeValue>& value) { SetAttributes(value); return *this;}
76 
77     /**
78      * <p>The attribute values as they appeared before the <code>PutItem</code>
79      * operation, but only if <code>ReturnValues</code> is specified as
80      * <code>ALL_OLD</code> in the request. Each element consists of an attribute name
81      * and an attribute value.</p>
82      */
WithAttributes(Aws::Map<Aws::String,AttributeValue> && value)83     inline PutItemResult& WithAttributes(Aws::Map<Aws::String, AttributeValue>&& value) { SetAttributes(std::move(value)); return *this;}
84 
85     /**
86      * <p>The attribute values as they appeared before the <code>PutItem</code>
87      * operation, but only if <code>ReturnValues</code> is specified as
88      * <code>ALL_OLD</code> in the request. Each element consists of an attribute name
89      * and an attribute value.</p>
90      */
AddAttributes(const Aws::String & key,const AttributeValue & value)91     inline PutItemResult& AddAttributes(const Aws::String& key, const AttributeValue& value) { m_attributes.emplace(key, value); return *this; }
92 
93     /**
94      * <p>The attribute values as they appeared before the <code>PutItem</code>
95      * operation, but only if <code>ReturnValues</code> is specified as
96      * <code>ALL_OLD</code> in the request. Each element consists of an attribute name
97      * and an attribute value.</p>
98      */
AddAttributes(Aws::String && key,const AttributeValue & value)99     inline PutItemResult& AddAttributes(Aws::String&& key, const AttributeValue& value) { m_attributes.emplace(std::move(key), value); return *this; }
100 
101     /**
102      * <p>The attribute values as they appeared before the <code>PutItem</code>
103      * operation, but only if <code>ReturnValues</code> is specified as
104      * <code>ALL_OLD</code> in the request. Each element consists of an attribute name
105      * and an attribute value.</p>
106      */
AddAttributes(const Aws::String & key,AttributeValue && value)107     inline PutItemResult& AddAttributes(const Aws::String& key, AttributeValue&& value) { m_attributes.emplace(key, std::move(value)); return *this; }
108 
109     /**
110      * <p>The attribute values as they appeared before the <code>PutItem</code>
111      * operation, but only if <code>ReturnValues</code> is specified as
112      * <code>ALL_OLD</code> in the request. Each element consists of an attribute name
113      * and an attribute value.</p>
114      */
AddAttributes(Aws::String && key,AttributeValue && value)115     inline PutItemResult& AddAttributes(Aws::String&& key, AttributeValue&& value) { m_attributes.emplace(std::move(key), std::move(value)); return *this; }
116 
117     /**
118      * <p>The attribute values as they appeared before the <code>PutItem</code>
119      * operation, but only if <code>ReturnValues</code> is specified as
120      * <code>ALL_OLD</code> in the request. Each element consists of an attribute name
121      * and an attribute value.</p>
122      */
AddAttributes(const char * key,AttributeValue && value)123     inline PutItemResult& AddAttributes(const char* key, AttributeValue&& value) { m_attributes.emplace(key, std::move(value)); return *this; }
124 
125     /**
126      * <p>The attribute values as they appeared before the <code>PutItem</code>
127      * operation, but only if <code>ReturnValues</code> is specified as
128      * <code>ALL_OLD</code> in the request. Each element consists of an attribute name
129      * and an attribute value.</p>
130      */
AddAttributes(const char * key,const AttributeValue & value)131     inline PutItemResult& AddAttributes(const char* key, const AttributeValue& value) { m_attributes.emplace(key, value); return *this; }
132 
133 
134     /**
135      * <p>The capacity units consumed by the <code>PutItem</code> operation. The data
136      * returned includes the total provisioned throughput consumed, along with
137      * statistics for the table and any indexes involved in the operation.
138      * <code>ConsumedCapacity</code> is only returned if the
139      * <code>ReturnConsumedCapacity</code> parameter was specified. For more
140      * information, see <a
141      * href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html">Read/Write
142      * Capacity Mode</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
143      */
GetConsumedCapacity()144     inline const ConsumedCapacity& GetConsumedCapacity() const{ return m_consumedCapacity; }
145 
146     /**
147      * <p>The capacity units consumed by the <code>PutItem</code> operation. The data
148      * returned includes the total provisioned throughput consumed, along with
149      * statistics for the table and any indexes involved in the operation.
150      * <code>ConsumedCapacity</code> is only returned if the
151      * <code>ReturnConsumedCapacity</code> parameter was specified. For more
152      * information, see <a
153      * href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html">Read/Write
154      * Capacity Mode</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
155      */
SetConsumedCapacity(const ConsumedCapacity & value)156     inline void SetConsumedCapacity(const ConsumedCapacity& value) { m_consumedCapacity = value; }
157 
158     /**
159      * <p>The capacity units consumed by the <code>PutItem</code> operation. The data
160      * returned includes the total provisioned throughput consumed, along with
161      * statistics for the table and any indexes involved in the operation.
162      * <code>ConsumedCapacity</code> is only returned if the
163      * <code>ReturnConsumedCapacity</code> parameter was specified. For more
164      * information, see <a
165      * href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html">Read/Write
166      * Capacity Mode</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
167      */
SetConsumedCapacity(ConsumedCapacity && value)168     inline void SetConsumedCapacity(ConsumedCapacity&& value) { m_consumedCapacity = std::move(value); }
169 
170     /**
171      * <p>The capacity units consumed by the <code>PutItem</code> operation. The data
172      * returned includes the total provisioned throughput consumed, along with
173      * statistics for the table and any indexes involved in the operation.
174      * <code>ConsumedCapacity</code> is only returned if the
175      * <code>ReturnConsumedCapacity</code> parameter was specified. For more
176      * information, see <a
177      * href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html">Read/Write
178      * Capacity Mode</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
179      */
WithConsumedCapacity(const ConsumedCapacity & value)180     inline PutItemResult& WithConsumedCapacity(const ConsumedCapacity& value) { SetConsumedCapacity(value); return *this;}
181 
182     /**
183      * <p>The capacity units consumed by the <code>PutItem</code> operation. The data
184      * returned includes the total provisioned throughput consumed, along with
185      * statistics for the table and any indexes involved in the operation.
186      * <code>ConsumedCapacity</code> is only returned if the
187      * <code>ReturnConsumedCapacity</code> parameter was specified. For more
188      * information, see <a
189      * href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html">Read/Write
190      * Capacity Mode</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
191      */
WithConsumedCapacity(ConsumedCapacity && value)192     inline PutItemResult& WithConsumedCapacity(ConsumedCapacity&& value) { SetConsumedCapacity(std::move(value)); return *this;}
193 
194 
195     /**
196      * <p>Information about item collections, if any, that were affected by the
197      * <code>PutItem</code> operation. <code>ItemCollectionMetrics</code> is only
198      * returned if the <code>ReturnItemCollectionMetrics</code> parameter was
199      * specified. If the table does not have any local secondary indexes, this
200      * information is not returned in the response.</p> <p>Each
201      * <code>ItemCollectionMetrics</code> element consists of:</p> <ul> <li> <p>
202      * <code>ItemCollectionKey</code> - The partition key value of the item collection.
203      * This is the same as the partition key value of the item itself.</p> </li> <li>
204      * <p> <code>SizeEstimateRangeGB</code> - An estimate of item collection size, in
205      * gigabytes. This value is a two-element array containing a lower bound and an
206      * upper bound for the estimate. The estimate includes the size of all the items in
207      * the table, plus the size of all attributes projected into all of the local
208      * secondary indexes on that table. Use this estimate to measure whether a local
209      * secondary index is approaching its size limit.</p> <p>The estimate is subject to
210      * change over time; therefore, do not rely on the precision or accuracy of the
211      * estimate.</p> </li> </ul>
212      */
GetItemCollectionMetrics()213     inline const ItemCollectionMetrics& GetItemCollectionMetrics() const{ return m_itemCollectionMetrics; }
214 
215     /**
216      * <p>Information about item collections, if any, that were affected by the
217      * <code>PutItem</code> operation. <code>ItemCollectionMetrics</code> is only
218      * returned if the <code>ReturnItemCollectionMetrics</code> parameter was
219      * specified. If the table does not have any local secondary indexes, this
220      * information is not returned in the response.</p> <p>Each
221      * <code>ItemCollectionMetrics</code> element consists of:</p> <ul> <li> <p>
222      * <code>ItemCollectionKey</code> - The partition key value of the item collection.
223      * This is the same as the partition key value of the item itself.</p> </li> <li>
224      * <p> <code>SizeEstimateRangeGB</code> - An estimate of item collection size, in
225      * gigabytes. This value is a two-element array containing a lower bound and an
226      * upper bound for the estimate. The estimate includes the size of all the items in
227      * the table, plus the size of all attributes projected into all of the local
228      * secondary indexes on that table. Use this estimate to measure whether a local
229      * secondary index is approaching its size limit.</p> <p>The estimate is subject to
230      * change over time; therefore, do not rely on the precision or accuracy of the
231      * estimate.</p> </li> </ul>
232      */
SetItemCollectionMetrics(const ItemCollectionMetrics & value)233     inline void SetItemCollectionMetrics(const ItemCollectionMetrics& value) { m_itemCollectionMetrics = value; }
234 
235     /**
236      * <p>Information about item collections, if any, that were affected by the
237      * <code>PutItem</code> operation. <code>ItemCollectionMetrics</code> is only
238      * returned if the <code>ReturnItemCollectionMetrics</code> parameter was
239      * specified. If the table does not have any local secondary indexes, this
240      * information is not returned in the response.</p> <p>Each
241      * <code>ItemCollectionMetrics</code> element consists of:</p> <ul> <li> <p>
242      * <code>ItemCollectionKey</code> - The partition key value of the item collection.
243      * This is the same as the partition key value of the item itself.</p> </li> <li>
244      * <p> <code>SizeEstimateRangeGB</code> - An estimate of item collection size, in
245      * gigabytes. This value is a two-element array containing a lower bound and an
246      * upper bound for the estimate. The estimate includes the size of all the items in
247      * the table, plus the size of all attributes projected into all of the local
248      * secondary indexes on that table. Use this estimate to measure whether a local
249      * secondary index is approaching its size limit.</p> <p>The estimate is subject to
250      * change over time; therefore, do not rely on the precision or accuracy of the
251      * estimate.</p> </li> </ul>
252      */
SetItemCollectionMetrics(ItemCollectionMetrics && value)253     inline void SetItemCollectionMetrics(ItemCollectionMetrics&& value) { m_itemCollectionMetrics = std::move(value); }
254 
255     /**
256      * <p>Information about item collections, if any, that were affected by the
257      * <code>PutItem</code> operation. <code>ItemCollectionMetrics</code> is only
258      * returned if the <code>ReturnItemCollectionMetrics</code> parameter was
259      * specified. If the table does not have any local secondary indexes, this
260      * information is not returned in the response.</p> <p>Each
261      * <code>ItemCollectionMetrics</code> element consists of:</p> <ul> <li> <p>
262      * <code>ItemCollectionKey</code> - The partition key value of the item collection.
263      * This is the same as the partition key value of the item itself.</p> </li> <li>
264      * <p> <code>SizeEstimateRangeGB</code> - An estimate of item collection size, in
265      * gigabytes. This value is a two-element array containing a lower bound and an
266      * upper bound for the estimate. The estimate includes the size of all the items in
267      * the table, plus the size of all attributes projected into all of the local
268      * secondary indexes on that table. Use this estimate to measure whether a local
269      * secondary index is approaching its size limit.</p> <p>The estimate is subject to
270      * change over time; therefore, do not rely on the precision or accuracy of the
271      * estimate.</p> </li> </ul>
272      */
WithItemCollectionMetrics(const ItemCollectionMetrics & value)273     inline PutItemResult& WithItemCollectionMetrics(const ItemCollectionMetrics& value) { SetItemCollectionMetrics(value); return *this;}
274 
275     /**
276      * <p>Information about item collections, if any, that were affected by the
277      * <code>PutItem</code> operation. <code>ItemCollectionMetrics</code> is only
278      * returned if the <code>ReturnItemCollectionMetrics</code> parameter was
279      * specified. If the table does not have any local secondary indexes, this
280      * information is not returned in the response.</p> <p>Each
281      * <code>ItemCollectionMetrics</code> element consists of:</p> <ul> <li> <p>
282      * <code>ItemCollectionKey</code> - The partition key value of the item collection.
283      * This is the same as the partition key value of the item itself.</p> </li> <li>
284      * <p> <code>SizeEstimateRangeGB</code> - An estimate of item collection size, in
285      * gigabytes. This value is a two-element array containing a lower bound and an
286      * upper bound for the estimate. The estimate includes the size of all the items in
287      * the table, plus the size of all attributes projected into all of the local
288      * secondary indexes on that table. Use this estimate to measure whether a local
289      * secondary index is approaching its size limit.</p> <p>The estimate is subject to
290      * change over time; therefore, do not rely on the precision or accuracy of the
291      * estimate.</p> </li> </ul>
292      */
WithItemCollectionMetrics(ItemCollectionMetrics && value)293     inline PutItemResult& WithItemCollectionMetrics(ItemCollectionMetrics&& value) { SetItemCollectionMetrics(std::move(value)); return *this;}
294 
295   private:
296 
297     Aws::Map<Aws::String, AttributeValue> m_attributes;
298 
299     ConsumedCapacity m_consumedCapacity;
300 
301     ItemCollectionMetrics m_itemCollectionMetrics;
302   };
303 
304 } // namespace Model
305 } // namespace DynamoDB
306 } // namespace Aws
307