AWS SDK for C++

AWS SDK for C++ Version 1.11.744

Loading...
Searching...
No Matches
GetItemRequest.h
1
6#pragma once
7#include <aws/core/utils/memory/stl/AWSMap.h>
8#include <aws/core/utils/memory/stl/AWSString.h>
9#include <aws/core/utils/memory/stl/AWSVector.h>
10#include <aws/dynamodb/DynamoDBRequest.h>
11#include <aws/dynamodb/DynamoDB_EXPORTS.h>
12#include <aws/dynamodb/model/AttributeValue.h>
13#include <aws/dynamodb/model/ReturnConsumedCapacity.h>
14
15#include <utility>
16
17namespace Aws {
18namespace DynamoDB {
19namespace Model {
20
28 public:
29 AWS_DYNAMODB_API GetItemRequest() = default;
30
31 // Service request name is the Operation name which will send this request out,
32 // each operation should has unique request name, so that we can get operation's name from this request.
33 // Note: this is not true for response, multiple operations may have the same response name,
34 // so we can not get operation's name from response.
35 inline virtual const char* GetServiceRequestName() const override { return "GetItem"; }
36
37 AWS_DYNAMODB_API Aws::String SerializePayload() const override;
38
40
44 AWS_DYNAMODB_API EndpointParameters GetEndpointContextParams() const override;
45
47
51 inline const Aws::String& GetTableName() const { return m_tableName; }
52 inline bool TableNameHasBeenSet() const { return m_tableNameHasBeenSet; }
53 template <typename TableNameT = Aws::String>
54 void SetTableName(TableNameT&& value) {
55 m_tableNameHasBeenSet = true;
56 m_tableName = std::forward<TableNameT>(value);
57 }
58 template <typename TableNameT = Aws::String>
59 GetItemRequest& WithTableName(TableNameT&& value) {
60 SetTableName(std::forward<TableNameT>(value));
61 return *this;
62 }
64
66
73 inline const Aws::Map<Aws::String, AttributeValue>& GetKey() const { return m_key; }
74 inline bool KeyHasBeenSet() const { return m_keyHasBeenSet; }
75 template <typename KeyT = Aws::Map<Aws::String, AttributeValue>>
76 void SetKey(KeyT&& value) {
77 m_keyHasBeenSet = true;
78 m_key = std::forward<KeyT>(value);
79 }
80 template <typename KeyT = Aws::Map<Aws::String, AttributeValue>>
81 GetItemRequest& WithKey(KeyT&& value) {
82 SetKey(std::forward<KeyT>(value));
83 return *this;
84 }
85 template <typename KeyKeyT = Aws::String, typename KeyValueT = AttributeValue>
86 GetItemRequest& AddKey(KeyKeyT&& key, KeyValueT&& value) {
87 m_keyHasBeenSet = true;
88 m_key.emplace(std::forward<KeyKeyT>(key), std::forward<KeyValueT>(value));
89 return *this;
90 }
92
94
100 inline const Aws::Vector<Aws::String>& GetAttributesToGet() const { return m_attributesToGet; }
101 inline bool AttributesToGetHasBeenSet() const { return m_attributesToGetHasBeenSet; }
102 template <typename AttributesToGetT = Aws::Vector<Aws::String>>
103 void SetAttributesToGet(AttributesToGetT&& value) {
104 m_attributesToGetHasBeenSet = true;
105 m_attributesToGet = std::forward<AttributesToGetT>(value);
106 }
107 template <typename AttributesToGetT = Aws::Vector<Aws::String>>
108 GetItemRequest& WithAttributesToGet(AttributesToGetT&& value) {
109 SetAttributesToGet(std::forward<AttributesToGetT>(value));
110 return *this;
111 }
112 template <typename AttributesToGetT = Aws::String>
113 GetItemRequest& AddAttributesToGet(AttributesToGetT&& value) {
114 m_attributesToGetHasBeenSet = true;
115 m_attributesToGet.emplace_back(std::forward<AttributesToGetT>(value));
116 return *this;
117 }
119
121
126 inline bool GetConsistentRead() const { return m_consistentRead; }
127 inline bool ConsistentReadHasBeenSet() const { return m_consistentReadHasBeenSet; }
128 inline void SetConsistentRead(bool value) {
129 m_consistentReadHasBeenSet = true;
130 m_consistentRead = value;
131 }
132 inline GetItemRequest& WithConsistentRead(bool value) {
133 SetConsistentRead(value);
134 return *this;
135 }
137
139
140 inline ReturnConsumedCapacity GetReturnConsumedCapacity() const { return m_returnConsumedCapacity; }
141 inline bool ReturnConsumedCapacityHasBeenSet() const { return m_returnConsumedCapacityHasBeenSet; }
143 m_returnConsumedCapacityHasBeenSet = true;
144 m_returnConsumedCapacity = value;
145 }
148 return *this;
149 }
151
153
163 inline const Aws::String& GetProjectionExpression() const { return m_projectionExpression; }
164 inline bool ProjectionExpressionHasBeenSet() const { return m_projectionExpressionHasBeenSet; }
165 template <typename ProjectionExpressionT = Aws::String>
166 void SetProjectionExpression(ProjectionExpressionT&& value) {
167 m_projectionExpressionHasBeenSet = true;
168 m_projectionExpression = std::forward<ProjectionExpressionT>(value);
169 }
170 template <typename ProjectionExpressionT = Aws::String>
171 GetItemRequest& WithProjectionExpression(ProjectionExpressionT&& value) {
172 SetProjectionExpression(std::forward<ProjectionExpressionT>(value));
173 return *this;
174 }
176
178
203 inline const Aws::Map<Aws::String, Aws::String>& GetExpressionAttributeNames() const { return m_expressionAttributeNames; }
204 inline bool ExpressionAttributeNamesHasBeenSet() const { return m_expressionAttributeNamesHasBeenSet; }
205 template <typename ExpressionAttributeNamesT = Aws::Map<Aws::String, Aws::String>>
206 void SetExpressionAttributeNames(ExpressionAttributeNamesT&& value) {
207 m_expressionAttributeNamesHasBeenSet = true;
208 m_expressionAttributeNames = std::forward<ExpressionAttributeNamesT>(value);
209 }
210 template <typename ExpressionAttributeNamesT = Aws::Map<Aws::String, Aws::String>>
211 GetItemRequest& WithExpressionAttributeNames(ExpressionAttributeNamesT&& value) {
212 SetExpressionAttributeNames(std::forward<ExpressionAttributeNamesT>(value));
213 return *this;
214 }
215 template <typename ExpressionAttributeNamesKeyT = Aws::String, typename ExpressionAttributeNamesValueT = Aws::String>
216 GetItemRequest& AddExpressionAttributeNames(ExpressionAttributeNamesKeyT&& key, ExpressionAttributeNamesValueT&& value) {
217 m_expressionAttributeNamesHasBeenSet = true;
218 m_expressionAttributeNames.emplace(std::forward<ExpressionAttributeNamesKeyT>(key),
219 std::forward<ExpressionAttributeNamesValueT>(value));
220 return *this;
221 }
223 private:
224 Aws::String m_tableName;
225
227
228 Aws::Vector<Aws::String> m_attributesToGet;
229
230 bool m_consistentRead{false};
231
233
234 Aws::String m_projectionExpression;
235
236 Aws::Map<Aws::String, Aws::String> m_expressionAttributeNames;
237 bool m_tableNameHasBeenSet = false;
238 bool m_keyHasBeenSet = false;
239 bool m_attributesToGetHasBeenSet = false;
240 bool m_consistentReadHasBeenSet = false;
241 bool m_returnConsumedCapacityHasBeenSet = false;
242 bool m_projectionExpressionHasBeenSet = false;
243 bool m_expressionAttributeNamesHasBeenSet = false;
244};
245
246} // namespace Model
247} // namespace DynamoDB
248} // namespace Aws
Aws::Endpoint::EndpointParameters EndpointParameters
void SetExpressionAttributeNames(ExpressionAttributeNamesT &&value)
GetItemRequest & WithProjectionExpression(ProjectionExpressionT &&value)
const Aws::Map< Aws::String, AttributeValue > & GetKey() const
GetItemRequest & WithConsistentRead(bool value)
AWS_DYNAMODB_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override
GetItemRequest & WithKey(KeyT &&value)
GetItemRequest & WithExpressionAttributeNames(ExpressionAttributeNamesT &&value)
AWS_DYNAMODB_API EndpointParameters GetEndpointContextParams() const override
void SetReturnConsumedCapacity(ReturnConsumedCapacity value)
GetItemRequest & AddAttributesToGet(AttributesToGetT &&value)
GetItemRequest & WithTableName(TableNameT &&value)
void SetProjectionExpression(ProjectionExpressionT &&value)
AWS_DYNAMODB_API GetItemRequest()=default
virtual const char * GetServiceRequestName() const override
void SetAttributesToGet(AttributesToGetT &&value)
GetItemRequest & AddKey(KeyKeyT &&key, KeyValueT &&value)
const Aws::String & GetProjectionExpression() const
GetItemRequest & WithReturnConsumedCapacity(ReturnConsumedCapacity value)
GetItemRequest & AddExpressionAttributeNames(ExpressionAttributeNamesKeyT &&key, ExpressionAttributeNamesValueT &&value)
const Aws::String & GetTableName() const
GetItemRequest & WithAttributesToGet(AttributesToGetT &&value)
void SetTableName(TableNameT &&value)
ReturnConsumedCapacity GetReturnConsumedCapacity() const
const Aws::Vector< Aws::String > & GetAttributesToGet() const
AWS_DYNAMODB_API Aws::String SerializePayload() const override
const Aws::Map< Aws::String, Aws::String > & GetExpressionAttributeNames() const
Aws::Map< Aws::String, Aws::String > HeaderValueCollection
std::map< K, V, std::less< K >, Aws::Allocator< std::pair< const K, V > > > Map
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector