AWS SDK for C++

AWS SDK for C++ Version 1.11.606

Loading...
Searching...
No Matches
GetItemRequest.h
1
6#pragma once
7#include <aws/dynamodb/DynamoDB_EXPORTS.h>
8#include <aws/dynamodb/DynamoDBRequest.h>
9#include <aws/core/utils/memory/stl/AWSString.h>
10#include <aws/core/utils/memory/stl/AWSMap.h>
11#include <aws/core/utils/memory/stl/AWSVector.h>
12#include <aws/dynamodb/model/ReturnConsumedCapacity.h>
13#include <aws/dynamodb/model/AttributeValue.h>
14#include <utility>
15
16namespace Aws
17{
18namespace DynamoDB
19{
20namespace Model
21{
22
30 {
31 public:
32 AWS_DYNAMODB_API GetItemRequest() = default;
33
34 // Service request name is the Operation name which will send this request out,
35 // each operation should has unique request name, so that we can get operation's name from this request.
36 // Note: this is not true for response, multiple operations may have the same response name,
37 // so we can not get operation's name from response.
38 inline virtual const char* GetServiceRequestName() const override { return "GetItem"; }
39
40 AWS_DYNAMODB_API Aws::String SerializePayload() const override;
41
43
47 AWS_DYNAMODB_API EndpointParameters GetEndpointContextParams() const override;
48
50
54 inline const Aws::String& GetTableName() const { return m_tableName; }
55 inline bool TableNameHasBeenSet() const { return m_tableNameHasBeenSet; }
56 template<typename TableNameT = Aws::String>
57 void SetTableName(TableNameT&& value) { m_tableNameHasBeenSet = true; m_tableName = std::forward<TableNameT>(value); }
58 template<typename TableNameT = Aws::String>
59 GetItemRequest& WithTableName(TableNameT&& value) { SetTableName(std::forward<TableNameT>(value)); return *this;}
61
63
70 inline const Aws::Map<Aws::String, AttributeValue>& GetKey() const { return m_key; }
71 inline bool KeyHasBeenSet() const { return m_keyHasBeenSet; }
72 template<typename KeyT = Aws::Map<Aws::String, AttributeValue>>
73 void SetKey(KeyT&& value) { m_keyHasBeenSet = true; m_key = std::forward<KeyT>(value); }
74 template<typename KeyT = Aws::Map<Aws::String, AttributeValue>>
75 GetItemRequest& WithKey(KeyT&& value) { SetKey(std::forward<KeyT>(value)); return *this;}
76 template<typename KeyKeyT = Aws::String, typename KeyValueT = AttributeValue>
77 GetItemRequest& AddKey(KeyKeyT&& key, KeyValueT&& value) {
78 m_keyHasBeenSet = true; m_key.emplace(std::forward<KeyKeyT>(key), std::forward<KeyValueT>(value)); return *this;
79 }
81
83
89 inline const Aws::Vector<Aws::String>& GetAttributesToGet() const { return m_attributesToGet; }
90 inline bool AttributesToGetHasBeenSet() const { return m_attributesToGetHasBeenSet; }
91 template<typename AttributesToGetT = Aws::Vector<Aws::String>>
92 void SetAttributesToGet(AttributesToGetT&& value) { m_attributesToGetHasBeenSet = true; m_attributesToGet = std::forward<AttributesToGetT>(value); }
93 template<typename AttributesToGetT = Aws::Vector<Aws::String>>
94 GetItemRequest& WithAttributesToGet(AttributesToGetT&& value) { SetAttributesToGet(std::forward<AttributesToGetT>(value)); return *this;}
95 template<typename AttributesToGetT = Aws::String>
96 GetItemRequest& AddAttributesToGet(AttributesToGetT&& value) { m_attributesToGetHasBeenSet = true; m_attributesToGet.emplace_back(std::forward<AttributesToGetT>(value)); return *this; }
98
100
105 inline bool GetConsistentRead() const { return m_consistentRead; }
106 inline bool ConsistentReadHasBeenSet() const { return m_consistentReadHasBeenSet; }
107 inline void SetConsistentRead(bool value) { m_consistentReadHasBeenSet = true; m_consistentRead = value; }
108 inline GetItemRequest& WithConsistentRead(bool value) { SetConsistentRead(value); return *this;}
110
112
113 inline ReturnConsumedCapacity GetReturnConsumedCapacity() const { return m_returnConsumedCapacity; }
114 inline bool ReturnConsumedCapacityHasBeenSet() const { return m_returnConsumedCapacityHasBeenSet; }
115 inline void SetReturnConsumedCapacity(ReturnConsumedCapacity value) { m_returnConsumedCapacityHasBeenSet = true; m_returnConsumedCapacity = value; }
118
120
130 inline const Aws::String& GetProjectionExpression() const { return m_projectionExpression; }
131 inline bool ProjectionExpressionHasBeenSet() const { return m_projectionExpressionHasBeenSet; }
132 template<typename ProjectionExpressionT = Aws::String>
133 void SetProjectionExpression(ProjectionExpressionT&& value) { m_projectionExpressionHasBeenSet = true; m_projectionExpression = std::forward<ProjectionExpressionT>(value); }
134 template<typename ProjectionExpressionT = Aws::String>
135 GetItemRequest& WithProjectionExpression(ProjectionExpressionT&& value) { SetProjectionExpression(std::forward<ProjectionExpressionT>(value)); return *this;}
137
139
164 inline const Aws::Map<Aws::String, Aws::String>& GetExpressionAttributeNames() const { return m_expressionAttributeNames; }
165 inline bool ExpressionAttributeNamesHasBeenSet() const { return m_expressionAttributeNamesHasBeenSet; }
166 template<typename ExpressionAttributeNamesT = Aws::Map<Aws::String, Aws::String>>
167 void SetExpressionAttributeNames(ExpressionAttributeNamesT&& value) { m_expressionAttributeNamesHasBeenSet = true; m_expressionAttributeNames = std::forward<ExpressionAttributeNamesT>(value); }
168 template<typename ExpressionAttributeNamesT = Aws::Map<Aws::String, Aws::String>>
169 GetItemRequest& WithExpressionAttributeNames(ExpressionAttributeNamesT&& value) { SetExpressionAttributeNames(std::forward<ExpressionAttributeNamesT>(value)); return *this;}
170 template<typename ExpressionAttributeNamesKeyT = Aws::String, typename ExpressionAttributeNamesValueT = Aws::String>
171 GetItemRequest& AddExpressionAttributeNames(ExpressionAttributeNamesKeyT&& key, ExpressionAttributeNamesValueT&& value) {
172 m_expressionAttributeNamesHasBeenSet = true; m_expressionAttributeNames.emplace(std::forward<ExpressionAttributeNamesKeyT>(key), std::forward<ExpressionAttributeNamesValueT>(value)); return *this;
173 }
175 private:
176
177 Aws::String m_tableName;
178 bool m_tableNameHasBeenSet = false;
179
181 bool m_keyHasBeenSet = false;
182
183 Aws::Vector<Aws::String> m_attributesToGet;
184 bool m_attributesToGetHasBeenSet = false;
185
186 bool m_consistentRead{false};
187 bool m_consistentReadHasBeenSet = false;
188
190 bool m_returnConsumedCapacityHasBeenSet = false;
191
192 Aws::String m_projectionExpression;
193 bool m_projectionExpressionHasBeenSet = false;
194
195 Aws::Map<Aws::String, Aws::String> m_expressionAttributeNames;
196 bool m_expressionAttributeNamesHasBeenSet = false;
197 };
198
199} // namespace Model
200} // namespace DynamoDB
201} // 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