/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include #include namespace Aws { template class AmazonWebServiceResult; namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace DynamoDB { namespace Model { /** *

Represents the output of a Query operation.

See * Also:

AWS * API Reference

*/ class QueryResult { public: AWS_DYNAMODB_API QueryResult(); AWS_DYNAMODB_API QueryResult(const Aws::AmazonWebServiceResult& result); AWS_DYNAMODB_API QueryResult& operator=(const Aws::AmazonWebServiceResult& result); /** *

An array of item attributes that match the query criteria. Each element in * this array consists of an attribute name and the value for that attribute.

*/ inline const Aws::Vector>& GetItems() const{ return m_items; } /** *

An array of item attributes that match the query criteria. Each element in * this array consists of an attribute name and the value for that attribute.

*/ inline void SetItems(const Aws::Vector>& value) { m_items = value; } /** *

An array of item attributes that match the query criteria. Each element in * this array consists of an attribute name and the value for that attribute.

*/ inline void SetItems(Aws::Vector>&& value) { m_items = std::move(value); } /** *

An array of item attributes that match the query criteria. Each element in * this array consists of an attribute name and the value for that attribute.

*/ inline QueryResult& WithItems(const Aws::Vector>& value) { SetItems(value); return *this;} /** *

An array of item attributes that match the query criteria. Each element in * this array consists of an attribute name and the value for that attribute.

*/ inline QueryResult& WithItems(Aws::Vector>&& value) { SetItems(std::move(value)); return *this;} /** *

An array of item attributes that match the query criteria. Each element in * this array consists of an attribute name and the value for that attribute.

*/ inline QueryResult& AddItems(const Aws::Map& value) { m_items.push_back(value); return *this; } /** *

An array of item attributes that match the query criteria. Each element in * this array consists of an attribute name and the value for that attribute.

*/ inline QueryResult& AddItems(Aws::Map&& value) { m_items.push_back(std::move(value)); return *this; } /** *

The number of items in the response.

If you used a * QueryFilter in the request, then Count is the number * of items returned after the filter was applied, and ScannedCount is * the number of matching items before the filter was applied.

If you did * not use a filter in the request, then Count and * ScannedCount are the same.

*/ inline int GetCount() const{ return m_count; } /** *

The number of items in the response.

If you used a * QueryFilter in the request, then Count is the number * of items returned after the filter was applied, and ScannedCount is * the number of matching items before the filter was applied.

If you did * not use a filter in the request, then Count and * ScannedCount are the same.

*/ inline void SetCount(int value) { m_count = value; } /** *

The number of items in the response.

If you used a * QueryFilter in the request, then Count is the number * of items returned after the filter was applied, and ScannedCount is * the number of matching items before the filter was applied.

If you did * not use a filter in the request, then Count and * ScannedCount are the same.

*/ inline QueryResult& WithCount(int value) { SetCount(value); return *this;} /** *

The number of items evaluated, before any QueryFilter is * applied. A high ScannedCount value with few, or no, * Count results indicates an inefficient Query * operation. For more information, see Count * and ScannedCount in the Amazon DynamoDB Developer Guide.

If * you did not use a filter in the request, then ScannedCount is the * same as Count.

*/ inline int GetScannedCount() const{ return m_scannedCount; } /** *

The number of items evaluated, before any QueryFilter is * applied. A high ScannedCount value with few, or no, * Count results indicates an inefficient Query * operation. For more information, see Count * and ScannedCount in the Amazon DynamoDB Developer Guide.

If * you did not use a filter in the request, then ScannedCount is the * same as Count.

*/ inline void SetScannedCount(int value) { m_scannedCount = value; } /** *

The number of items evaluated, before any QueryFilter is * applied. A high ScannedCount value with few, or no, * Count results indicates an inefficient Query * operation. For more information, see Count * and ScannedCount in the Amazon DynamoDB Developer Guide.

If * you did not use a filter in the request, then ScannedCount is the * same as Count.

*/ inline QueryResult& WithScannedCount(int value) { SetScannedCount(value); return *this;} /** *

The primary key of the item where the operation stopped, inclusive of the * previous result set. Use this value to start a new operation, excluding this * value in the new request.

If LastEvaluatedKey is empty, then * the "last page" of results has been processed and there is no more data to be * retrieved.

If LastEvaluatedKey is not empty, it does not * necessarily mean that there is more data in the result set. The only way to know * when you have reached the end of the result set is when * LastEvaluatedKey is empty.

*/ inline const Aws::Map& GetLastEvaluatedKey() const{ return m_lastEvaluatedKey; } /** *

The primary key of the item where the operation stopped, inclusive of the * previous result set. Use this value to start a new operation, excluding this * value in the new request.

If LastEvaluatedKey is empty, then * the "last page" of results has been processed and there is no more data to be * retrieved.

If LastEvaluatedKey is not empty, it does not * necessarily mean that there is more data in the result set. The only way to know * when you have reached the end of the result set is when * LastEvaluatedKey is empty.

*/ inline void SetLastEvaluatedKey(const Aws::Map& value) { m_lastEvaluatedKey = value; } /** *

The primary key of the item where the operation stopped, inclusive of the * previous result set. Use this value to start a new operation, excluding this * value in the new request.

If LastEvaluatedKey is empty, then * the "last page" of results has been processed and there is no more data to be * retrieved.

If LastEvaluatedKey is not empty, it does not * necessarily mean that there is more data in the result set. The only way to know * when you have reached the end of the result set is when * LastEvaluatedKey is empty.

*/ inline void SetLastEvaluatedKey(Aws::Map&& value) { m_lastEvaluatedKey = std::move(value); } /** *

The primary key of the item where the operation stopped, inclusive of the * previous result set. Use this value to start a new operation, excluding this * value in the new request.

If LastEvaluatedKey is empty, then * the "last page" of results has been processed and there is no more data to be * retrieved.

If LastEvaluatedKey is not empty, it does not * necessarily mean that there is more data in the result set. The only way to know * when you have reached the end of the result set is when * LastEvaluatedKey is empty.

*/ inline QueryResult& WithLastEvaluatedKey(const Aws::Map& value) { SetLastEvaluatedKey(value); return *this;} /** *

The primary key of the item where the operation stopped, inclusive of the * previous result set. Use this value to start a new operation, excluding this * value in the new request.

If LastEvaluatedKey is empty, then * the "last page" of results has been processed and there is no more data to be * retrieved.

If LastEvaluatedKey is not empty, it does not * necessarily mean that there is more data in the result set. The only way to know * when you have reached the end of the result set is when * LastEvaluatedKey is empty.

*/ inline QueryResult& WithLastEvaluatedKey(Aws::Map&& value) { SetLastEvaluatedKey(std::move(value)); return *this;} /** *

The primary key of the item where the operation stopped, inclusive of the * previous result set. Use this value to start a new operation, excluding this * value in the new request.

If LastEvaluatedKey is empty, then * the "last page" of results has been processed and there is no more data to be * retrieved.

If LastEvaluatedKey is not empty, it does not * necessarily mean that there is more data in the result set. The only way to know * when you have reached the end of the result set is when * LastEvaluatedKey is empty.

*/ inline QueryResult& AddLastEvaluatedKey(const Aws::String& key, const AttributeValue& value) { m_lastEvaluatedKey.emplace(key, value); return *this; } /** *

The primary key of the item where the operation stopped, inclusive of the * previous result set. Use this value to start a new operation, excluding this * value in the new request.

If LastEvaluatedKey is empty, then * the "last page" of results has been processed and there is no more data to be * retrieved.

If LastEvaluatedKey is not empty, it does not * necessarily mean that there is more data in the result set. The only way to know * when you have reached the end of the result set is when * LastEvaluatedKey is empty.

*/ inline QueryResult& AddLastEvaluatedKey(Aws::String&& key, const AttributeValue& value) { m_lastEvaluatedKey.emplace(std::move(key), value); return *this; } /** *

The primary key of the item where the operation stopped, inclusive of the * previous result set. Use this value to start a new operation, excluding this * value in the new request.

If LastEvaluatedKey is empty, then * the "last page" of results has been processed and there is no more data to be * retrieved.

If LastEvaluatedKey is not empty, it does not * necessarily mean that there is more data in the result set. The only way to know * when you have reached the end of the result set is when * LastEvaluatedKey is empty.

*/ inline QueryResult& AddLastEvaluatedKey(const Aws::String& key, AttributeValue&& value) { m_lastEvaluatedKey.emplace(key, std::move(value)); return *this; } /** *

The primary key of the item where the operation stopped, inclusive of the * previous result set. Use this value to start a new operation, excluding this * value in the new request.

If LastEvaluatedKey is empty, then * the "last page" of results has been processed and there is no more data to be * retrieved.

If LastEvaluatedKey is not empty, it does not * necessarily mean that there is more data in the result set. The only way to know * when you have reached the end of the result set is when * LastEvaluatedKey is empty.

*/ inline QueryResult& AddLastEvaluatedKey(Aws::String&& key, AttributeValue&& value) { m_lastEvaluatedKey.emplace(std::move(key), std::move(value)); return *this; } /** *

The primary key of the item where the operation stopped, inclusive of the * previous result set. Use this value to start a new operation, excluding this * value in the new request.

If LastEvaluatedKey is empty, then * the "last page" of results has been processed and there is no more data to be * retrieved.

If LastEvaluatedKey is not empty, it does not * necessarily mean that there is more data in the result set. The only way to know * when you have reached the end of the result set is when * LastEvaluatedKey is empty.

*/ inline QueryResult& AddLastEvaluatedKey(const char* key, AttributeValue&& value) { m_lastEvaluatedKey.emplace(key, std::move(value)); return *this; } /** *

The primary key of the item where the operation stopped, inclusive of the * previous result set. Use this value to start a new operation, excluding this * value in the new request.

If LastEvaluatedKey is empty, then * the "last page" of results has been processed and there is no more data to be * retrieved.

If LastEvaluatedKey is not empty, it does not * necessarily mean that there is more data in the result set. The only way to know * when you have reached the end of the result set is when * LastEvaluatedKey is empty.

*/ inline QueryResult& AddLastEvaluatedKey(const char* key, const AttributeValue& value) { m_lastEvaluatedKey.emplace(key, value); return *this; } /** *

The capacity units consumed by the Query operation. The data * returned includes the total provisioned throughput consumed, along with * statistics for the table and any indexes involved in the operation. * ConsumedCapacity is only returned if the * ReturnConsumedCapacity parameter was specified. For more * information, see Provisioned * Throughput in the Amazon DynamoDB Developer Guide.

*/ inline const ConsumedCapacity& GetConsumedCapacity() const{ return m_consumedCapacity; } /** *

The capacity units consumed by the Query operation. The data * returned includes the total provisioned throughput consumed, along with * statistics for the table and any indexes involved in the operation. * ConsumedCapacity is only returned if the * ReturnConsumedCapacity parameter was specified. For more * information, see Provisioned * Throughput in the Amazon DynamoDB Developer Guide.

*/ inline void SetConsumedCapacity(const ConsumedCapacity& value) { m_consumedCapacity = value; } /** *

The capacity units consumed by the Query operation. The data * returned includes the total provisioned throughput consumed, along with * statistics for the table and any indexes involved in the operation. * ConsumedCapacity is only returned if the * ReturnConsumedCapacity parameter was specified. For more * information, see Provisioned * Throughput in the Amazon DynamoDB Developer Guide.

*/ inline void SetConsumedCapacity(ConsumedCapacity&& value) { m_consumedCapacity = std::move(value); } /** *

The capacity units consumed by the Query operation. The data * returned includes the total provisioned throughput consumed, along with * statistics for the table and any indexes involved in the operation. * ConsumedCapacity is only returned if the * ReturnConsumedCapacity parameter was specified. For more * information, see Provisioned * Throughput in the Amazon DynamoDB Developer Guide.

*/ inline QueryResult& WithConsumedCapacity(const ConsumedCapacity& value) { SetConsumedCapacity(value); return *this;} /** *

The capacity units consumed by the Query operation. The data * returned includes the total provisioned throughput consumed, along with * statistics for the table and any indexes involved in the operation. * ConsumedCapacity is only returned if the * ReturnConsumedCapacity parameter was specified. For more * information, see Provisioned * Throughput in the Amazon DynamoDB Developer Guide.

*/ inline QueryResult& WithConsumedCapacity(ConsumedCapacity&& value) { SetConsumedCapacity(std::move(value)); return *this;} inline const Aws::String& GetRequestId() const{ return m_requestId; } inline void SetRequestId(const Aws::String& value) { m_requestId = value; } inline void SetRequestId(Aws::String&& value) { m_requestId = std::move(value); } inline void SetRequestId(const char* value) { m_requestId.assign(value); } inline QueryResult& WithRequestId(const Aws::String& value) { SetRequestId(value); return *this;} inline QueryResult& WithRequestId(Aws::String&& value) { SetRequestId(std::move(value)); return *this;} inline QueryResult& WithRequestId(const char* value) { SetRequestId(value); return *this;} private: Aws::Vector> m_items; int m_count; int m_scannedCount; Aws::Map m_lastEvaluatedKey; ConsumedCapacity m_consumedCapacity; Aws::String m_requestId; }; } // namespace Model } // namespace DynamoDB } // namespace Aws