AWS SDK for C++

AWS SDK for C++ Version 1.11.743

Loading...
Searching...
No Matches
QueryRequest.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/Condition.h>
14#include <aws/dynamodb/model/ConditionalOperator.h>
15#include <aws/dynamodb/model/ReturnConsumedCapacity.h>
16#include <aws/dynamodb/model/Select.h>
17
18#include <utility>
19
20namespace Aws {
21namespace DynamoDB {
22namespace Model {
23
31 public:
32 AWS_DYNAMODB_API QueryRequest() = 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 "Query"; }
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) {
58 m_tableNameHasBeenSet = true;
59 m_tableName = std::forward<TableNameT>(value);
60 }
61 template <typename TableNameT = Aws::String>
62 QueryRequest& WithTableName(TableNameT&& value) {
63 SetTableName(std::forward<TableNameT>(value));
64 return *this;
65 }
67
69
75 inline const Aws::String& GetIndexName() const { return m_indexName; }
76 inline bool IndexNameHasBeenSet() const { return m_indexNameHasBeenSet; }
77 template <typename IndexNameT = Aws::String>
78 void SetIndexName(IndexNameT&& value) {
79 m_indexNameHasBeenSet = true;
80 m_indexName = std::forward<IndexNameT>(value);
81 }
82 template <typename IndexNameT = Aws::String>
83 QueryRequest& WithIndexName(IndexNameT&& value) {
84 SetIndexName(std::forward<IndexNameT>(value));
85 return *this;
86 }
88
90
130 inline Select GetSelect() const { return m_select; }
131 inline bool SelectHasBeenSet() const { return m_selectHasBeenSet; }
132 inline void SetSelect(Select value) {
133 m_selectHasBeenSet = true;
134 m_select = value;
135 }
137 SetSelect(value);
138 return *this;
139 }
141
143
149 inline const Aws::Vector<Aws::String>& GetAttributesToGet() const { return m_attributesToGet; }
150 inline bool AttributesToGetHasBeenSet() const { return m_attributesToGetHasBeenSet; }
151 template <typename AttributesToGetT = Aws::Vector<Aws::String>>
152 void SetAttributesToGet(AttributesToGetT&& value) {
153 m_attributesToGetHasBeenSet = true;
154 m_attributesToGet = std::forward<AttributesToGetT>(value);
155 }
156 template <typename AttributesToGetT = Aws::Vector<Aws::String>>
157 QueryRequest& WithAttributesToGet(AttributesToGetT&& value) {
158 SetAttributesToGet(std::forward<AttributesToGetT>(value));
159 return *this;
160 }
161 template <typename AttributesToGetT = Aws::String>
162 QueryRequest& AddAttributesToGet(AttributesToGetT&& value) {
163 m_attributesToGetHasBeenSet = true;
164 m_attributesToGet.emplace_back(std::forward<AttributesToGetT>(value));
165 return *this;
166 }
168
170
183 inline int GetLimit() const { return m_limit; }
184 inline bool LimitHasBeenSet() const { return m_limitHasBeenSet; }
185 inline void SetLimit(int value) {
186 m_limitHasBeenSet = true;
187 m_limit = value;
188 }
189 inline QueryRequest& WithLimit(int value) {
190 SetLimit(value);
191 return *this;
192 }
194
196
204 inline bool GetConsistentRead() const { return m_consistentRead; }
205 inline bool ConsistentReadHasBeenSet() const { return m_consistentReadHasBeenSet; }
206 inline void SetConsistentRead(bool value) {
207 m_consistentReadHasBeenSet = true;
208 m_consistentRead = value;
209 }
210 inline QueryRequest& WithConsistentRead(bool value) {
211 SetConsistentRead(value);
212 return *this;
213 }
215
217
223 inline const Aws::Map<Aws::String, Condition>& GetKeyConditions() const { return m_keyConditions; }
224 inline bool KeyConditionsHasBeenSet() const { return m_keyConditionsHasBeenSet; }
225 template <typename KeyConditionsT = Aws::Map<Aws::String, Condition>>
226 void SetKeyConditions(KeyConditionsT&& value) {
227 m_keyConditionsHasBeenSet = true;
228 m_keyConditions = std::forward<KeyConditionsT>(value);
229 }
230 template <typename KeyConditionsT = Aws::Map<Aws::String, Condition>>
231 QueryRequest& WithKeyConditions(KeyConditionsT&& value) {
232 SetKeyConditions(std::forward<KeyConditionsT>(value));
233 return *this;
234 }
235 template <typename KeyConditionsKeyT = Aws::String, typename KeyConditionsValueT = Condition>
236 QueryRequest& AddKeyConditions(KeyConditionsKeyT&& key, KeyConditionsValueT&& value) {
237 m_keyConditionsHasBeenSet = true;
238 m_keyConditions.emplace(std::forward<KeyConditionsKeyT>(key), std::forward<KeyConditionsValueT>(value));
239 return *this;
240 }
242
244
250 inline const Aws::Map<Aws::String, Condition>& GetQueryFilter() const { return m_queryFilter; }
251 inline bool QueryFilterHasBeenSet() const { return m_queryFilterHasBeenSet; }
252 template <typename QueryFilterT = Aws::Map<Aws::String, Condition>>
253 void SetQueryFilter(QueryFilterT&& value) {
254 m_queryFilterHasBeenSet = true;
255 m_queryFilter = std::forward<QueryFilterT>(value);
256 }
257 template <typename QueryFilterT = Aws::Map<Aws::String, Condition>>
258 QueryRequest& WithQueryFilter(QueryFilterT&& value) {
259 SetQueryFilter(std::forward<QueryFilterT>(value));
260 return *this;
261 }
262 template <typename QueryFilterKeyT = Aws::String, typename QueryFilterValueT = Condition>
263 QueryRequest& AddQueryFilter(QueryFilterKeyT&& key, QueryFilterValueT&& value) {
264 m_queryFilterHasBeenSet = true;
265 m_queryFilter.emplace(std::forward<QueryFilterKeyT>(key), std::forward<QueryFilterValueT>(value));
266 return *this;
267 }
269
271
277 inline ConditionalOperator GetConditionalOperator() const { return m_conditionalOperator; }
278 inline bool ConditionalOperatorHasBeenSet() const { return m_conditionalOperatorHasBeenSet; }
280 m_conditionalOperatorHasBeenSet = true;
281 m_conditionalOperator = value;
282 }
285 return *this;
286 }
288
290
304 inline bool GetScanIndexForward() const { return m_scanIndexForward; }
305 inline bool ScanIndexForwardHasBeenSet() const { return m_scanIndexForwardHasBeenSet; }
306 inline void SetScanIndexForward(bool value) {
307 m_scanIndexForwardHasBeenSet = true;
308 m_scanIndexForward = value;
309 }
310 inline QueryRequest& WithScanIndexForward(bool value) {
311 SetScanIndexForward(value);
312 return *this;
313 }
315
317
323 inline const Aws::Map<Aws::String, AttributeValue>& GetExclusiveStartKey() const { return m_exclusiveStartKey; }
324 inline bool ExclusiveStartKeyHasBeenSet() const { return m_exclusiveStartKeyHasBeenSet; }
325 template <typename ExclusiveStartKeyT = Aws::Map<Aws::String, AttributeValue>>
326 void SetExclusiveStartKey(ExclusiveStartKeyT&& value) {
327 m_exclusiveStartKeyHasBeenSet = true;
328 m_exclusiveStartKey = std::forward<ExclusiveStartKeyT>(value);
329 }
330 template <typename ExclusiveStartKeyT = Aws::Map<Aws::String, AttributeValue>>
331 QueryRequest& WithExclusiveStartKey(ExclusiveStartKeyT&& value) {
332 SetExclusiveStartKey(std::forward<ExclusiveStartKeyT>(value));
333 return *this;
334 }
335 template <typename ExclusiveStartKeyKeyT = Aws::String, typename ExclusiveStartKeyValueT = AttributeValue>
336 QueryRequest& AddExclusiveStartKey(ExclusiveStartKeyKeyT&& key, ExclusiveStartKeyValueT&& value) {
337 m_exclusiveStartKeyHasBeenSet = true;
338 m_exclusiveStartKey.emplace(std::forward<ExclusiveStartKeyKeyT>(key), std::forward<ExclusiveStartKeyValueT>(value));
339 return *this;
340 }
342
344
345 inline ReturnConsumedCapacity GetReturnConsumedCapacity() const { return m_returnConsumedCapacity; }
346 inline bool ReturnConsumedCapacityHasBeenSet() const { return m_returnConsumedCapacityHasBeenSet; }
348 m_returnConsumedCapacityHasBeenSet = true;
349 m_returnConsumedCapacity = value;
350 }
353 return *this;
354 }
356
358
368 inline const Aws::String& GetProjectionExpression() const { return m_projectionExpression; }
369 inline bool ProjectionExpressionHasBeenSet() const { return m_projectionExpressionHasBeenSet; }
370 template <typename ProjectionExpressionT = Aws::String>
371 void SetProjectionExpression(ProjectionExpressionT&& value) {
372 m_projectionExpressionHasBeenSet = true;
373 m_projectionExpression = std::forward<ProjectionExpressionT>(value);
374 }
375 template <typename ProjectionExpressionT = Aws::String>
376 QueryRequest& WithProjectionExpression(ProjectionExpressionT&& value) {
377 SetProjectionExpression(std::forward<ProjectionExpressionT>(value));
378 return *this;
379 }
381
383
395 inline const Aws::String& GetFilterExpression() const { return m_filterExpression; }
396 inline bool FilterExpressionHasBeenSet() const { return m_filterExpressionHasBeenSet; }
397 template <typename FilterExpressionT = Aws::String>
398 void SetFilterExpression(FilterExpressionT&& value) {
399 m_filterExpressionHasBeenSet = true;
400 m_filterExpression = std::forward<FilterExpressionT>(value);
401 }
402 template <typename FilterExpressionT = Aws::String>
403 QueryRequest& WithFilterExpression(FilterExpressionT&& value) {
404 SetFilterExpression(std::forward<FilterExpressionT>(value));
405 return *this;
406 }
408
410
466 inline const Aws::String& GetKeyConditionExpression() const { return m_keyConditionExpression; }
467 inline bool KeyConditionExpressionHasBeenSet() const { return m_keyConditionExpressionHasBeenSet; }
468 template <typename KeyConditionExpressionT = Aws::String>
469 void SetKeyConditionExpression(KeyConditionExpressionT&& value) {
470 m_keyConditionExpressionHasBeenSet = true;
471 m_keyConditionExpression = std::forward<KeyConditionExpressionT>(value);
472 }
473 template <typename KeyConditionExpressionT = Aws::String>
474 QueryRequest& WithKeyConditionExpression(KeyConditionExpressionT&& value) {
475 SetKeyConditionExpression(std::forward<KeyConditionExpressionT>(value));
476 return *this;
477 }
479
481
506 inline const Aws::Map<Aws::String, Aws::String>& GetExpressionAttributeNames() const { return m_expressionAttributeNames; }
507 inline bool ExpressionAttributeNamesHasBeenSet() const { return m_expressionAttributeNamesHasBeenSet; }
508 template <typename ExpressionAttributeNamesT = Aws::Map<Aws::String, Aws::String>>
509 void SetExpressionAttributeNames(ExpressionAttributeNamesT&& value) {
510 m_expressionAttributeNamesHasBeenSet = true;
511 m_expressionAttributeNames = std::forward<ExpressionAttributeNamesT>(value);
512 }
513 template <typename ExpressionAttributeNamesT = Aws::Map<Aws::String, Aws::String>>
514 QueryRequest& WithExpressionAttributeNames(ExpressionAttributeNamesT&& value) {
515 SetExpressionAttributeNames(std::forward<ExpressionAttributeNamesT>(value));
516 return *this;
517 }
518 template <typename ExpressionAttributeNamesKeyT = Aws::String, typename ExpressionAttributeNamesValueT = Aws::String>
519 QueryRequest& AddExpressionAttributeNames(ExpressionAttributeNamesKeyT&& key, ExpressionAttributeNamesValueT&& value) {
520 m_expressionAttributeNamesHasBeenSet = true;
521 m_expressionAttributeNames.emplace(std::forward<ExpressionAttributeNamesKeyT>(key),
522 std::forward<ExpressionAttributeNamesValueT>(value));
523 return *this;
524 }
526
528
543 inline const Aws::Map<Aws::String, AttributeValue>& GetExpressionAttributeValues() const { return m_expressionAttributeValues; }
544 inline bool ExpressionAttributeValuesHasBeenSet() const { return m_expressionAttributeValuesHasBeenSet; }
545 template <typename ExpressionAttributeValuesT = Aws::Map<Aws::String, AttributeValue>>
546 void SetExpressionAttributeValues(ExpressionAttributeValuesT&& value) {
547 m_expressionAttributeValuesHasBeenSet = true;
548 m_expressionAttributeValues = std::forward<ExpressionAttributeValuesT>(value);
549 }
550 template <typename ExpressionAttributeValuesT = Aws::Map<Aws::String, AttributeValue>>
551 QueryRequest& WithExpressionAttributeValues(ExpressionAttributeValuesT&& value) {
552 SetExpressionAttributeValues(std::forward<ExpressionAttributeValuesT>(value));
553 return *this;
554 }
555 template <typename ExpressionAttributeValuesKeyT = Aws::String, typename ExpressionAttributeValuesValueT = AttributeValue>
556 QueryRequest& AddExpressionAttributeValues(ExpressionAttributeValuesKeyT&& key, ExpressionAttributeValuesValueT&& value) {
557 m_expressionAttributeValuesHasBeenSet = true;
558 m_expressionAttributeValues.emplace(std::forward<ExpressionAttributeValuesKeyT>(key),
559 std::forward<ExpressionAttributeValuesValueT>(value));
560 return *this;
561 }
563 private:
564 Aws::String m_tableName;
565
566 Aws::String m_indexName;
567
568 Select m_select{Select::NOT_SET};
569
570 Aws::Vector<Aws::String> m_attributesToGet;
571
572 int m_limit{0};
573
574 bool m_consistentRead{false};
575
576 Aws::Map<Aws::String, Condition> m_keyConditions;
577
579
581
582 bool m_scanIndexForward{false};
583
584 Aws::Map<Aws::String, AttributeValue> m_exclusiveStartKey;
585
587
588 Aws::String m_projectionExpression;
589
590 Aws::String m_filterExpression;
591
592 Aws::String m_keyConditionExpression;
593
594 Aws::Map<Aws::String, Aws::String> m_expressionAttributeNames;
595
596 Aws::Map<Aws::String, AttributeValue> m_expressionAttributeValues;
597 bool m_tableNameHasBeenSet = false;
598 bool m_indexNameHasBeenSet = false;
599 bool m_selectHasBeenSet = false;
600 bool m_attributesToGetHasBeenSet = false;
601 bool m_limitHasBeenSet = false;
602 bool m_consistentReadHasBeenSet = false;
603 bool m_keyConditionsHasBeenSet = false;
604 bool m_queryFilterHasBeenSet = false;
605 bool m_conditionalOperatorHasBeenSet = false;
606 bool m_scanIndexForwardHasBeenSet = false;
607 bool m_exclusiveStartKeyHasBeenSet = false;
608 bool m_returnConsumedCapacityHasBeenSet = false;
609 bool m_projectionExpressionHasBeenSet = false;
610 bool m_filterExpressionHasBeenSet = false;
611 bool m_keyConditionExpressionHasBeenSet = false;
612 bool m_expressionAttributeNamesHasBeenSet = false;
613 bool m_expressionAttributeValuesHasBeenSet = false;
614};
615
616} // namespace Model
617} // namespace DynamoDB
618} // namespace Aws
Aws::Endpoint::EndpointParameters EndpointParameters
void SetKeyConditionExpression(KeyConditionExpressionT &&value)
ConditionalOperator GetConditionalOperator() const
QueryRequest & WithLimit(int value)
const Aws::String & GetKeyConditionExpression() const
QueryRequest & AddExpressionAttributeValues(ExpressionAttributeValuesKeyT &&key, ExpressionAttributeValuesValueT &&value)
const Aws::Map< Aws::String, AttributeValue > & GetExclusiveStartKey() const
AWS_DYNAMODB_API EndpointParameters GetEndpointContextParams() const override
QueryRequest & WithExpressionAttributeNames(ExpressionAttributeNamesT &&value)
QueryRequest & WithFilterExpression(FilterExpressionT &&value)
QueryRequest & WithScanIndexForward(bool value)
void SetAttributesToGet(AttributesToGetT &&value)
QueryRequest & WithReturnConsumedCapacity(ReturnConsumedCapacity value)
QueryRequest & WithExclusiveStartKey(ExclusiveStartKeyT &&value)
void SetConditionalOperator(ConditionalOperator value)
void SetTableName(TableNameT &&value)
void SetQueryFilter(QueryFilterT &&value)
QueryRequest & AddExpressionAttributeNames(ExpressionAttributeNamesKeyT &&key, ExpressionAttributeNamesValueT &&value)
QueryRequest & WithQueryFilter(QueryFilterT &&value)
void SetKeyConditions(KeyConditionsT &&value)
void SetExclusiveStartKey(ExclusiveStartKeyT &&value)
void SetReturnConsumedCapacity(ReturnConsumedCapacity value)
QueryRequest & AddAttributesToGet(AttributesToGetT &&value)
QueryRequest & AddQueryFilter(QueryFilterKeyT &&key, QueryFilterValueT &&value)
QueryRequest & WithAttributesToGet(AttributesToGetT &&value)
QueryRequest & WithSelect(Select value)
virtual const char * GetServiceRequestName() const override
void SetExpressionAttributeNames(ExpressionAttributeNamesT &&value)
QueryRequest & WithProjectionExpression(ProjectionExpressionT &&value)
QueryRequest & WithTableName(TableNameT &&value)
QueryRequest & WithKeyConditionExpression(KeyConditionExpressionT &&value)
QueryRequest & AddKeyConditions(KeyConditionsKeyT &&key, KeyConditionsValueT &&value)
AWS_DYNAMODB_API Aws::String SerializePayload() const override
void SetIndexName(IndexNameT &&value)
QueryRequest & AddExclusiveStartKey(ExclusiveStartKeyKeyT &&key, ExclusiveStartKeyValueT &&value)
const Aws::Map< Aws::String, Aws::String > & GetExpressionAttributeNames() const
AWS_DYNAMODB_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override
QueryRequest & WithConsistentRead(bool value)
QueryRequest & WithKeyConditions(KeyConditionsT &&value)
const Aws::Map< Aws::String, AttributeValue > & GetExpressionAttributeValues() const
const Aws::String & GetProjectionExpression() const
QueryRequest & WithExpressionAttributeValues(ExpressionAttributeValuesT &&value)
const Aws::Vector< Aws::String > & GetAttributesToGet() const
const Aws::String & GetFilterExpression() const
QueryRequest & WithConditionalOperator(ConditionalOperator value)
ReturnConsumedCapacity GetReturnConsumedCapacity() const
QueryRequest & WithIndexName(IndexNameT &&value)
const Aws::Map< Aws::String, Condition > & GetKeyConditions() const
const Aws::String & GetIndexName() const
const Aws::String & GetTableName() const
const Aws::Map< Aws::String, Condition > & GetQueryFilter() const
void SetProjectionExpression(ProjectionExpressionT &&value)
void SetExpressionAttributeValues(ExpressionAttributeValuesT &&value)
void SetFilterExpression(FilterExpressionT &&value)
AWS_DYNAMODB_API QueryRequest()=default
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