AWS SDK for C++  0.12.9
AWS SDK for C++
DynamoDBClient.h
Go to the documentation of this file.
1 /*
2 * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License").
5 * You may not use this file except in compliance with the License.
6 * A copy of the License is located at
7 *
8 * http://aws.amazon.com/apache2.0
9 *
10 * or in the "license" file accompanying this file. This file is distributed
11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 * express or implied. See the License for the specific language governing
13 * permissions and limitations under the License.
14 */
15 #pragma once
39 #include <future>
40 #include <functional>
41 
42 namespace Aws
43 {
44 
45 namespace Http
46 {
47  class HttpClient;
48  class HttpClientFactory;
49 } // namespace Http
50 
51 namespace Utils
52 {
53  template< typename R, typename E> class Outcome;
54 
55 namespace Threading
56 {
57  class Executor;
58 } // namespace Threading
59 
60 namespace Json
61 {
62  class JsonValue;
63 } // namespace Json
64 } // namespace Utils
65 
66 namespace Auth
67 {
68  class AWSCredentials;
69  class AWSCredentialsProvider;
70 } // namespace Auth
71 
72 namespace Client
73 {
74  class RetryStrategy;
75 } // namespace Client
76 
77 namespace DynamoDB
78 {
79 
80 namespace Model
81 {
82  class BatchGetItemRequest;
84  class CreateTableRequest;
85  class DeleteItemRequest;
86  class DeleteTableRequest;
89  class GetItemRequest;
90  class ListTablesRequest;
91  class PutItemRequest;
92  class QueryRequest;
93  class ScanRequest;
94  class UpdateItemRequest;
96 
111 
112  typedef std::future<BatchGetItemOutcome> BatchGetItemOutcomeCallable;
113  typedef std::future<BatchWriteItemOutcome> BatchWriteItemOutcomeCallable;
114  typedef std::future<CreateTableOutcome> CreateTableOutcomeCallable;
115  typedef std::future<DeleteItemOutcome> DeleteItemOutcomeCallable;
116  typedef std::future<DeleteTableOutcome> DeleteTableOutcomeCallable;
117  typedef std::future<DescribeLimitsOutcome> DescribeLimitsOutcomeCallable;
118  typedef std::future<DescribeTableOutcome> DescribeTableOutcomeCallable;
119  typedef std::future<GetItemOutcome> GetItemOutcomeCallable;
120  typedef std::future<ListTablesOutcome> ListTablesOutcomeCallable;
121  typedef std::future<PutItemOutcome> PutItemOutcomeCallable;
122  typedef std::future<QueryOutcome> QueryOutcomeCallable;
123  typedef std::future<ScanOutcome> ScanOutcomeCallable;
124  typedef std::future<UpdateItemOutcome> UpdateItemOutcomeCallable;
125  typedef std::future<UpdateTableOutcome> UpdateTableOutcomeCallable;
126 } // namespace Model
127 
129 
130  typedef std::function<void(const DynamoDBClient*, const Model::BatchGetItemRequest&, const Model::BatchGetItemOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > BatchGetItemResponseReceivedHandler;
131  typedef std::function<void(const DynamoDBClient*, const Model::BatchWriteItemRequest&, const Model::BatchWriteItemOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > BatchWriteItemResponseReceivedHandler;
132  typedef std::function<void(const DynamoDBClient*, const Model::CreateTableRequest&, const Model::CreateTableOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateTableResponseReceivedHandler;
133  typedef std::function<void(const DynamoDBClient*, const Model::DeleteItemRequest&, const Model::DeleteItemOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteItemResponseReceivedHandler;
134  typedef std::function<void(const DynamoDBClient*, const Model::DeleteTableRequest&, const Model::DeleteTableOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteTableResponseReceivedHandler;
135  typedef std::function<void(const DynamoDBClient*, const Model::DescribeLimitsRequest&, const Model::DescribeLimitsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeLimitsResponseReceivedHandler;
136  typedef std::function<void(const DynamoDBClient*, const Model::DescribeTableRequest&, const Model::DescribeTableOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeTableResponseReceivedHandler;
137  typedef std::function<void(const DynamoDBClient*, const Model::GetItemRequest&, const Model::GetItemOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetItemResponseReceivedHandler;
138  typedef std::function<void(const DynamoDBClient*, const Model::ListTablesRequest&, const Model::ListTablesOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListTablesResponseReceivedHandler;
139  typedef std::function<void(const DynamoDBClient*, const Model::PutItemRequest&, const Model::PutItemOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > PutItemResponseReceivedHandler;
140  typedef std::function<void(const DynamoDBClient*, const Model::QueryRequest&, const Model::QueryOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > QueryResponseReceivedHandler;
141  typedef std::function<void(const DynamoDBClient*, const Model::ScanRequest&, const Model::ScanOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ScanResponseReceivedHandler;
142  typedef std::function<void(const DynamoDBClient*, const Model::UpdateItemRequest&, const Model::UpdateItemOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UpdateItemResponseReceivedHandler;
143  typedef std::function<void(const DynamoDBClient*, const Model::UpdateTableRequest&, const Model::UpdateTableOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UpdateTableResponseReceivedHandler;
144 
239  {
240  public:
242 
248 
253  DynamoDBClient(const Auth::AWSCredentials& credentials, const Client::ClientConfiguration& clientConfiguration = Client::ClientConfiguration());
254 
259  DynamoDBClient(const std::shared_ptr<Auth::AWSCredentialsProvider>& credentialsProvider,
260  const Client::ClientConfiguration& clientConfiguration = Client::ClientConfiguration());
261 
262  virtual ~DynamoDBClient();
263 
309  virtual Model::BatchGetItemOutcome BatchGetItem(const Model::BatchGetItemRequest& request) const;
310 
358  virtual Model::BatchGetItemOutcomeCallable BatchGetItemCallable(const Model::BatchGetItemRequest& request) const;
359 
407  virtual void BatchGetItemAsync(const Model::BatchGetItemRequest& request, const BatchGetItemResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
408 
465  virtual Model::BatchWriteItemOutcome BatchWriteItem(const Model::BatchWriteItemRequest& request) const;
466 
525  virtual Model::BatchWriteItemOutcomeCallable BatchWriteItemCallable(const Model::BatchWriteItemRequest& request) const;
526 
585  virtual void BatchWriteItemAsync(const Model::BatchWriteItemRequest& request, const BatchWriteItemResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
586 
603  virtual Model::CreateTableOutcome CreateTable(const Model::CreateTableRequest& request) const;
604 
623  virtual Model::CreateTableOutcomeCallable CreateTableCallable(const Model::CreateTableRequest& request) const;
624 
643  virtual void CreateTableAsync(const Model::CreateTableRequest& request, const CreateTableResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
644 
657  virtual Model::DeleteItemOutcome DeleteItem(const Model::DeleteItemRequest& request) const;
658 
673  virtual Model::DeleteItemOutcomeCallable DeleteItemCallable(const Model::DeleteItemRequest& request) const;
674 
689  virtual void DeleteItemAsync(const Model::DeleteItemRequest& request, const DeleteItemResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
690 
709  virtual Model::DeleteTableOutcome DeleteTable(const Model::DeleteTableRequest& request) const;
710 
731  virtual Model::DeleteTableOutcomeCallable DeleteTableCallable(const Model::DeleteTableRequest& request) const;
732 
753  virtual void DeleteTableAsync(const Model::DeleteTableRequest& request, const DeleteTableResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
754 
797  virtual Model::DescribeLimitsOutcome DescribeLimits(const Model::DescribeLimitsRequest& request) const;
798 
843  virtual Model::DescribeLimitsOutcomeCallable DescribeLimitsCallable(const Model::DescribeLimitsRequest& request) const;
844 
889  virtual void DescribeLimitsAsync(const Model::DescribeLimitsRequest& request, const DescribeLimitsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
890 
901  virtual Model::DescribeTableOutcome DescribeTable(const Model::DescribeTableRequest& request) const;
902 
915  virtual Model::DescribeTableOutcomeCallable DescribeTableCallable(const Model::DescribeTableRequest& request) const;
916 
929  virtual void DescribeTableAsync(const Model::DescribeTableRequest& request, const DescribeTableResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
930 
940  virtual Model::GetItemOutcome GetItem(const Model::GetItemRequest& request) const;
941 
953  virtual Model::GetItemOutcomeCallable GetItemCallable(const Model::GetItemRequest& request) const;
954 
966  virtual void GetItemAsync(const Model::GetItemRequest& request, const GetItemResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
967 
973  virtual Model::ListTablesOutcome ListTables(const Model::ListTablesRequest& request) const;
974 
982  virtual Model::ListTablesOutcomeCallable ListTablesCallable(const Model::ListTablesRequest& request) const;
983 
991  virtual void ListTablesAsync(const Model::ListTablesRequest& request, const ListTablesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
992 
1018  virtual Model::PutItemOutcome PutItem(const Model::PutItemRequest& request) const;
1019 
1047  virtual Model::PutItemOutcomeCallable PutItemCallable(const Model::PutItemRequest& request) const;
1048 
1076  virtual void PutItemAsync(const Model::PutItemRequest& request, const PutItemResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
1077 
1102  virtual Model::QueryOutcome Query(const Model::QueryRequest& request) const;
1103 
1130  virtual Model::QueryOutcomeCallable QueryCallable(const Model::QueryRequest& request) const;
1131 
1158  virtual void QueryAsync(const Model::QueryRequest& request, const QueryResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
1159 
1181  virtual Model::ScanOutcome Scan(const Model::ScanRequest& request) const;
1182 
1206  virtual Model::ScanOutcomeCallable ScanCallable(const Model::ScanRequest& request) const;
1207 
1231  virtual void ScanAsync(const Model::ScanRequest& request, const ScanResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
1232 
1242  virtual Model::UpdateItemOutcome UpdateItem(const Model::UpdateItemRequest& request) const;
1243 
1255  virtual Model::UpdateItemOutcomeCallable UpdateItemCallable(const Model::UpdateItemRequest& request) const;
1256 
1268  virtual void UpdateItemAsync(const Model::UpdateItemRequest& request, const UpdateItemResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
1269 
1284  virtual Model::UpdateTableOutcome UpdateTable(const Model::UpdateTableRequest& request) const;
1285 
1302  virtual Model::UpdateTableOutcomeCallable UpdateTableCallable(const Model::UpdateTableRequest& request) const;
1303 
1320  virtual void UpdateTableAsync(const Model::UpdateTableRequest& request, const UpdateTableResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
1321 
1322 
1323  private:
1324  void init(const Client::ClientConfiguration& clientConfiguration);
1325 
1327  void BatchGetItemAsyncHelper(const Model::BatchGetItemRequest& request, const BatchGetItemResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
1328  void BatchWriteItemAsyncHelper(const Model::BatchWriteItemRequest& request, const BatchWriteItemResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
1329  void CreateTableAsyncHelper(const Model::CreateTableRequest& request, const CreateTableResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
1330  void DeleteItemAsyncHelper(const Model::DeleteItemRequest& request, const DeleteItemResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
1331  void DeleteTableAsyncHelper(const Model::DeleteTableRequest& request, const DeleteTableResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
1332  void DescribeLimitsAsyncHelper(const Model::DescribeLimitsRequest& request, const DescribeLimitsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
1333  void DescribeTableAsyncHelper(const Model::DescribeTableRequest& request, const DescribeTableResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
1334  void GetItemAsyncHelper(const Model::GetItemRequest& request, const GetItemResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
1335  void ListTablesAsyncHelper(const Model::ListTablesRequest& request, const ListTablesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
1336  void PutItemAsyncHelper(const Model::PutItemRequest& request, const PutItemResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
1337  void QueryAsyncHelper(const Model::QueryRequest& request, const QueryResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
1338  void ScanAsyncHelper(const Model::ScanRequest& request, const ScanResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
1339  void UpdateItemAsyncHelper(const Model::UpdateItemRequest& request, const UpdateItemResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
1340  void UpdateTableAsyncHelper(const Model::UpdateTableRequest& request, const UpdateTableResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
1341 
1342  Aws::String m_uri;
1343  std::shared_ptr<Utils::Threading::Executor> m_executor;
1344  };
1345 
1346 } // namespace DynamoDB
1347 } // namespace Aws
Aws::Utils::Outcome< DescribeLimitsResult, Aws::Client::AWSError< DynamoDBErrors > > DescribeLimitsOutcome
std::future< BatchWriteItemOutcome > BatchWriteItemOutcomeCallable
Aws::Utils::Outcome< CreateTableResult, Aws::Client::AWSError< DynamoDBErrors > > CreateTableOutcome
std::future< PutItemOutcome > PutItemOutcomeCallable
std::function< void(const DynamoDBClient *, const Model::DescribeLimitsRequest &, const Model::DescribeLimitsOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > DescribeLimitsResponseReceivedHandler
Aws::Utils::Outcome< ScanResult, Aws::Client::AWSError< DynamoDBErrors > > ScanOutcome
Aws::Utils::Outcome< BatchGetItemResult, Aws::Client::AWSError< DynamoDBErrors > > BatchGetItemOutcome
std::future< UpdateItemOutcome > UpdateItemOutcomeCallable
std::future< GetItemOutcome > GetItemOutcomeCallable
std::future< CreateTableOutcome > CreateTableOutcomeCallable
std::future< DescribeTableOutcome > DescribeTableOutcomeCallable
std::future< ScanOutcome > ScanOutcomeCallable
std::future< UpdateTableOutcome > UpdateTableOutcomeCallable
std::function< void(const DynamoDBClient *, const Model::QueryRequest &, const Model::QueryOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > QueryResponseReceivedHandler
Aws::Utils::Outcome< DescribeTableResult, Aws::Client::AWSError< DynamoDBErrors > > DescribeTableOutcome
Aws::Utils::Outcome< GetItemResult, Aws::Client::AWSError< DynamoDBErrors > > GetItemOutcome
std::function< void(const DynamoDBClient *, const Model::UpdateItemRequest &, const Model::UpdateItemOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > UpdateItemResponseReceivedHandler
#define AWS_DYNAMODB_API
std::function< void(const DynamoDBClient *, const Model::DeleteItemRequest &, const Model::DeleteItemOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > DeleteItemResponseReceivedHandler
Aws::Utils::Outcome< DeleteTableResult, Aws::Client::AWSError< DynamoDBErrors > > DeleteTableOutcome
Aws::Client::AWSJsonClient BASECLASS
std::function< void(const DynamoDBClient *, const Model::ScanRequest &, const Model::ScanOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > ScanResponseReceivedHandler
Aws::Utils::Outcome< UpdateItemResult, Aws::Client::AWSError< DynamoDBErrors > > UpdateItemOutcome
std::future< DescribeLimitsOutcome > DescribeLimitsOutcomeCallable
Aws::Utils::Outcome< ListTablesResult, Aws::Client::AWSError< DynamoDBErrors > > ListTablesOutcome
std::function< void(const DynamoDBClient *, const Model::DeleteTableRequest &, const Model::DeleteTableOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > DeleteTableResponseReceivedHandler
Aws::Utils::Outcome< PutItemResult, Aws::Client::AWSError< DynamoDBErrors > > PutItemOutcome
std::future< DeleteItemOutcome > DeleteItemOutcomeCallable
std::function< void(const DynamoDBClient *, const Model::ListTablesRequest &, const Model::ListTablesOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > ListTablesResponseReceivedHandler
std::function< void(const DynamoDBClient *, const Model::UpdateTableRequest &, const Model::UpdateTableOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > UpdateTableResponseReceivedHandler
std::function< void(const DynamoDBClient *, const Model::GetItemRequest &, const Model::GetItemOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > GetItemResponseReceivedHandler
std::future< QueryOutcome > QueryOutcomeCallable
Aws::Utils::Outcome< BatchWriteItemResult, Aws::Client::AWSError< DynamoDBErrors > > BatchWriteItemOutcome
std::future< BatchGetItemOutcome > BatchGetItemOutcomeCallable
std::function< void(const DynamoDBClient *, const Model::BatchWriteItemRequest &, const Model::BatchWriteItemOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > BatchWriteItemResponseReceivedHandler
Aws::Utils::Outcome< UpdateTableResult, Aws::Client::AWSError< DynamoDBErrors > > UpdateTableOutcome
std::function< void(const DynamoDBClient *, const Model::CreateTableRequest &, const Model::CreateTableOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > CreateTableResponseReceivedHandler
std::function< void(const DynamoDBClient *, const Model::BatchGetItemRequest &, const Model::BatchGetItemOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > BatchGetItemResponseReceivedHandler
std::future< DeleteTableOutcome > DeleteTableOutcomeCallable
Aws::Utils::Outcome< DeleteItemResult, Aws::Client::AWSError< DynamoDBErrors > > DeleteItemOutcome
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition: AWSString.h:97
std::function< void(const DynamoDBClient *, const Model::DescribeTableRequest &, const Model::DescribeTableOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > DescribeTableResponseReceivedHandler
std::function< void(const DynamoDBClient *, const Model::PutItemRequest &, const Model::PutItemOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > PutItemResponseReceivedHandler
std::future< ListTablesOutcome > ListTablesOutcomeCallable
Aws::Utils::Outcome< QueryResult, Aws::Client::AWSError< DynamoDBErrors > > QueryOutcome
JSON (JavaScript Object Notation).