1 /**
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0.
4 */
5
6 #include <aws/core/utils/Outcome.h>
7 #include <aws/core/auth/AWSAuthSigner.h>
8 #include <aws/core/client/CoreErrors.h>
9 #include <aws/core/client/RetryStrategy.h>
10 #include <aws/core/http/HttpClient.h>
11 #include <aws/core/http/HttpResponse.h>
12 #include <aws/core/http/HttpClientFactory.h>
13 #include <aws/core/auth/AWSCredentialsProviderChain.h>
14 #include <aws/core/utils/json/JsonSerializer.h>
15 #include <aws/core/utils/memory/stl/AWSStringStream.h>
16 #include <aws/core/utils/threading/Executor.h>
17 #include <aws/core/utils/DNS.h>
18 #include <aws/core/utils/logging/LogMacros.h>
19 #include <aws/core/platform/Environment.h>
20
21 #include <aws/dynamodb/DynamoDBClient.h>
22 #include <aws/dynamodb/DynamoDBEndpoint.h>
23 #include <aws/dynamodb/DynamoDBErrorMarshaller.h>
24 #include <aws/dynamodb/model/BatchExecuteStatementRequest.h>
25 #include <aws/dynamodb/model/BatchGetItemRequest.h>
26 #include <aws/dynamodb/model/BatchWriteItemRequest.h>
27 #include <aws/dynamodb/model/CreateBackupRequest.h>
28 #include <aws/dynamodb/model/CreateGlobalTableRequest.h>
29 #include <aws/dynamodb/model/CreateTableRequest.h>
30 #include <aws/dynamodb/model/DeleteBackupRequest.h>
31 #include <aws/dynamodb/model/DeleteItemRequest.h>
32 #include <aws/dynamodb/model/DeleteTableRequest.h>
33 #include <aws/dynamodb/model/DescribeBackupRequest.h>
34 #include <aws/dynamodb/model/DescribeContinuousBackupsRequest.h>
35 #include <aws/dynamodb/model/DescribeContributorInsightsRequest.h>
36 #include <aws/dynamodb/model/DescribeEndpointsRequest.h>
37 #include <aws/dynamodb/model/DescribeExportRequest.h>
38 #include <aws/dynamodb/model/DescribeGlobalTableRequest.h>
39 #include <aws/dynamodb/model/DescribeGlobalTableSettingsRequest.h>
40 #include <aws/dynamodb/model/DescribeKinesisStreamingDestinationRequest.h>
41 #include <aws/dynamodb/model/DescribeLimitsRequest.h>
42 #include <aws/dynamodb/model/DescribeTableRequest.h>
43 #include <aws/dynamodb/model/DescribeTableReplicaAutoScalingRequest.h>
44 #include <aws/dynamodb/model/DescribeTimeToLiveRequest.h>
45 #include <aws/dynamodb/model/DisableKinesisStreamingDestinationRequest.h>
46 #include <aws/dynamodb/model/EnableKinesisStreamingDestinationRequest.h>
47 #include <aws/dynamodb/model/ExecuteStatementRequest.h>
48 #include <aws/dynamodb/model/ExecuteTransactionRequest.h>
49 #include <aws/dynamodb/model/ExportTableToPointInTimeRequest.h>
50 #include <aws/dynamodb/model/GetItemRequest.h>
51 #include <aws/dynamodb/model/ListBackupsRequest.h>
52 #include <aws/dynamodb/model/ListContributorInsightsRequest.h>
53 #include <aws/dynamodb/model/ListExportsRequest.h>
54 #include <aws/dynamodb/model/ListGlobalTablesRequest.h>
55 #include <aws/dynamodb/model/ListTablesRequest.h>
56 #include <aws/dynamodb/model/ListTagsOfResourceRequest.h>
57 #include <aws/dynamodb/model/PutItemRequest.h>
58 #include <aws/dynamodb/model/QueryRequest.h>
59 #include <aws/dynamodb/model/RestoreTableFromBackupRequest.h>
60 #include <aws/dynamodb/model/RestoreTableToPointInTimeRequest.h>
61 #include <aws/dynamodb/model/ScanRequest.h>
62 #include <aws/dynamodb/model/TagResourceRequest.h>
63 #include <aws/dynamodb/model/TransactGetItemsRequest.h>
64 #include <aws/dynamodb/model/TransactWriteItemsRequest.h>
65 #include <aws/dynamodb/model/UntagResourceRequest.h>
66 #include <aws/dynamodb/model/UpdateContinuousBackupsRequest.h>
67 #include <aws/dynamodb/model/UpdateContributorInsightsRequest.h>
68 #include <aws/dynamodb/model/UpdateGlobalTableRequest.h>
69 #include <aws/dynamodb/model/UpdateGlobalTableSettingsRequest.h>
70 #include <aws/dynamodb/model/UpdateItemRequest.h>
71 #include <aws/dynamodb/model/UpdateTableRequest.h>
72 #include <aws/dynamodb/model/UpdateTableReplicaAutoScalingRequest.h>
73 #include <aws/dynamodb/model/UpdateTimeToLiveRequest.h>
74
75 using namespace Aws;
76 using namespace Aws::Auth;
77 using namespace Aws::Client;
78 using namespace Aws::DynamoDB;
79 using namespace Aws::DynamoDB::Model;
80 using namespace Aws::Http;
81 using namespace Aws::Utils::Json;
82
83 static const char* SERVICE_NAME = "dynamodb";
84 static const char* ALLOCATION_TAG = "DynamoDBClient";
85
86
DynamoDBClient(const Client::ClientConfiguration & clientConfiguration)87 DynamoDBClient::DynamoDBClient(const Client::ClientConfiguration& clientConfiguration) :
88 BASECLASS(clientConfiguration,
89 Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, Aws::MakeShared<DefaultAWSCredentialsProviderChain>(ALLOCATION_TAG),
90 SERVICE_NAME, Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
91 Aws::MakeShared<DynamoDBErrorMarshaller>(ALLOCATION_TAG)),
92 m_executor(clientConfiguration.executor)
93 {
94 init(clientConfiguration);
95 }
96
DynamoDBClient(const AWSCredentials & credentials,const Client::ClientConfiguration & clientConfiguration)97 DynamoDBClient::DynamoDBClient(const AWSCredentials& credentials, const Client::ClientConfiguration& clientConfiguration) :
98 BASECLASS(clientConfiguration,
99 Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, Aws::MakeShared<SimpleAWSCredentialsProvider>(ALLOCATION_TAG, credentials),
100 SERVICE_NAME, Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
101 Aws::MakeShared<DynamoDBErrorMarshaller>(ALLOCATION_TAG)),
102 m_executor(clientConfiguration.executor)
103 {
104 init(clientConfiguration);
105 }
106
DynamoDBClient(const std::shared_ptr<AWSCredentialsProvider> & credentialsProvider,const Client::ClientConfiguration & clientConfiguration)107 DynamoDBClient::DynamoDBClient(const std::shared_ptr<AWSCredentialsProvider>& credentialsProvider,
108 const Client::ClientConfiguration& clientConfiguration) :
109 BASECLASS(clientConfiguration,
110 Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, credentialsProvider,
111 SERVICE_NAME, Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
112 Aws::MakeShared<DynamoDBErrorMarshaller>(ALLOCATION_TAG)),
113 m_executor(clientConfiguration.executor)
114 {
115 init(clientConfiguration);
116 }
117
~DynamoDBClient()118 DynamoDBClient::~DynamoDBClient()
119 {
120 }
121
init(const Client::ClientConfiguration & config)122 void DynamoDBClient::init(const Client::ClientConfiguration& config)
123 {
124 SetServiceClientName("DynamoDB");
125 LoadDynamoDBSpecificConfig(config);
126 m_configScheme = SchemeMapper::ToString(config.scheme);
127 if (config.endpointOverride.empty())
128 {
129 m_uri = m_configScheme + "://" + DynamoDBEndpoint::ForRegion(config.region, config.useDualStack);
130 }
131 else
132 {
133 OverrideEndpoint(config.endpointOverride);
134 }
135 }
136
LoadDynamoDBSpecificConfig(const Aws::Client::ClientConfiguration & clientConfiguration)137 void DynamoDBClient::LoadDynamoDBSpecificConfig(const Aws::Client::ClientConfiguration& clientConfiguration)
138 {
139 if (!clientConfiguration.endpointOverride.empty())
140 {
141 m_enableEndpointDiscovery = false;
142 }
143 else if (clientConfiguration.enableEndpointDiscovery)
144 {
145 m_enableEndpointDiscovery = clientConfiguration.enableEndpointDiscovery.value();
146 }
147 else
148 {
149 m_enableEndpointDiscovery = false;
150
151 Aws::String enableEndpointDiscovery = Aws::Environment::GetEnv("AWS_ENABLE_ENDPOINT_DISCOVERY");
152 if (enableEndpointDiscovery.empty())
153 {
154 enableEndpointDiscovery = Aws::Config::GetCachedConfigValue(clientConfiguration.profileName, "endpoint_discovery_enabled");
155 }
156
157 if (enableEndpointDiscovery == "true")
158 {
159 m_enableEndpointDiscovery = true;
160 }
161 else if (enableEndpointDiscovery == "false")
162 {
163 m_enableEndpointDiscovery = false;
164 }
165 else if (!enableEndpointDiscovery.empty())
166 {
167 AWS_LOGSTREAM_WARN("DynamoDBClient", R"(Using the SDK default configuration for Endpoint Discovery. )"
168 R"(Make sure your environment variable "AWS_ENABLE_ENDPOINT_DISCOVERY" or )"
169 R"(your config file's variable "endpoint_discovery_enabled" are explicitly set to "true" or "false" (case-sensitive) or not set at all.)");
170 }
171 }
172 }
173
OverrideEndpoint(const Aws::String & endpoint)174 void DynamoDBClient::OverrideEndpoint(const Aws::String& endpoint)
175 {
176 if (endpoint.compare(0, 7, "http://") == 0 || endpoint.compare(0, 8, "https://") == 0)
177 {
178 m_uri = endpoint;
179 }
180 else
181 {
182 m_uri = m_configScheme + "://" + endpoint;
183 }
184 m_enableEndpointDiscovery = false;
185 }
186
BatchExecuteStatement(const BatchExecuteStatementRequest & request) const187 BatchExecuteStatementOutcome DynamoDBClient::BatchExecuteStatement(const BatchExecuteStatementRequest& request) const
188 {
189 Aws::Http::URI uri = m_uri;
190 return BatchExecuteStatementOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
191 }
192
BatchExecuteStatementCallable(const BatchExecuteStatementRequest & request) const193 BatchExecuteStatementOutcomeCallable DynamoDBClient::BatchExecuteStatementCallable(const BatchExecuteStatementRequest& request) const
194 {
195 auto task = Aws::MakeShared< std::packaged_task< BatchExecuteStatementOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->BatchExecuteStatement(request); } );
196 auto packagedFunction = [task]() { (*task)(); };
197 m_executor->Submit(packagedFunction);
198 return task->get_future();
199 }
200
BatchExecuteStatementAsync(const BatchExecuteStatementRequest & request,const BatchExecuteStatementResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const201 void DynamoDBClient::BatchExecuteStatementAsync(const BatchExecuteStatementRequest& request, const BatchExecuteStatementResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
202 {
203 m_executor->Submit( [this, request, handler, context](){ this->BatchExecuteStatementAsyncHelper( request, handler, context ); } );
204 }
205
BatchExecuteStatementAsyncHelper(const BatchExecuteStatementRequest & request,const BatchExecuteStatementResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const206 void DynamoDBClient::BatchExecuteStatementAsyncHelper(const BatchExecuteStatementRequest& request, const BatchExecuteStatementResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
207 {
208 handler(this, request, BatchExecuteStatement(request), context);
209 }
210
BatchGetItem(const BatchGetItemRequest & request) const211 BatchGetItemOutcome DynamoDBClient::BatchGetItem(const BatchGetItemRequest& request) const
212 {
213 Aws::Http::URI uri = m_uri;
214 if (m_enableEndpointDiscovery)
215 {
216 Aws::String endpointKey = "Shared";
217 Aws::String endpoint;
218 if (m_endpointsCache.Get(endpointKey, endpoint))
219 {
220 AWS_LOGSTREAM_TRACE("BatchGetItem", "Making request to cached endpoint: " << endpoint);
221 uri = m_configScheme + "://" + endpoint;
222 }
223 else
224 {
225 AWS_LOGSTREAM_TRACE("BatchGetItem", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
226 DescribeEndpointsRequest endpointRequest;
227 auto endpointOutcome = DescribeEndpoints(endpointRequest);
228 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
229 {
230 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
231 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
232 uri = m_configScheme + "://" + item.GetAddress();
233 AWS_LOGSTREAM_TRACE("BatchGetItem", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
234 }
235 else
236 {
237 AWS_LOGSTREAM_ERROR("BatchGetItem", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
238 }
239 }
240 }
241 return BatchGetItemOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
242 }
243
BatchGetItemCallable(const BatchGetItemRequest & request) const244 BatchGetItemOutcomeCallable DynamoDBClient::BatchGetItemCallable(const BatchGetItemRequest& request) const
245 {
246 auto task = Aws::MakeShared< std::packaged_task< BatchGetItemOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->BatchGetItem(request); } );
247 auto packagedFunction = [task]() { (*task)(); };
248 m_executor->Submit(packagedFunction);
249 return task->get_future();
250 }
251
BatchGetItemAsync(const BatchGetItemRequest & request,const BatchGetItemResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const252 void DynamoDBClient::BatchGetItemAsync(const BatchGetItemRequest& request, const BatchGetItemResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
253 {
254 m_executor->Submit( [this, request, handler, context](){ this->BatchGetItemAsyncHelper( request, handler, context ); } );
255 }
256
BatchGetItemAsyncHelper(const BatchGetItemRequest & request,const BatchGetItemResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const257 void DynamoDBClient::BatchGetItemAsyncHelper(const BatchGetItemRequest& request, const BatchGetItemResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
258 {
259 handler(this, request, BatchGetItem(request), context);
260 }
261
BatchWriteItem(const BatchWriteItemRequest & request) const262 BatchWriteItemOutcome DynamoDBClient::BatchWriteItem(const BatchWriteItemRequest& request) const
263 {
264 Aws::Http::URI uri = m_uri;
265 if (m_enableEndpointDiscovery)
266 {
267 Aws::String endpointKey = "Shared";
268 Aws::String endpoint;
269 if (m_endpointsCache.Get(endpointKey, endpoint))
270 {
271 AWS_LOGSTREAM_TRACE("BatchWriteItem", "Making request to cached endpoint: " << endpoint);
272 uri = m_configScheme + "://" + endpoint;
273 }
274 else
275 {
276 AWS_LOGSTREAM_TRACE("BatchWriteItem", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
277 DescribeEndpointsRequest endpointRequest;
278 auto endpointOutcome = DescribeEndpoints(endpointRequest);
279 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
280 {
281 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
282 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
283 uri = m_configScheme + "://" + item.GetAddress();
284 AWS_LOGSTREAM_TRACE("BatchWriteItem", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
285 }
286 else
287 {
288 AWS_LOGSTREAM_ERROR("BatchWriteItem", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
289 }
290 }
291 }
292 return BatchWriteItemOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
293 }
294
BatchWriteItemCallable(const BatchWriteItemRequest & request) const295 BatchWriteItemOutcomeCallable DynamoDBClient::BatchWriteItemCallable(const BatchWriteItemRequest& request) const
296 {
297 auto task = Aws::MakeShared< std::packaged_task< BatchWriteItemOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->BatchWriteItem(request); } );
298 auto packagedFunction = [task]() { (*task)(); };
299 m_executor->Submit(packagedFunction);
300 return task->get_future();
301 }
302
BatchWriteItemAsync(const BatchWriteItemRequest & request,const BatchWriteItemResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const303 void DynamoDBClient::BatchWriteItemAsync(const BatchWriteItemRequest& request, const BatchWriteItemResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
304 {
305 m_executor->Submit( [this, request, handler, context](){ this->BatchWriteItemAsyncHelper( request, handler, context ); } );
306 }
307
BatchWriteItemAsyncHelper(const BatchWriteItemRequest & request,const BatchWriteItemResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const308 void DynamoDBClient::BatchWriteItemAsyncHelper(const BatchWriteItemRequest& request, const BatchWriteItemResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
309 {
310 handler(this, request, BatchWriteItem(request), context);
311 }
312
CreateBackup(const CreateBackupRequest & request) const313 CreateBackupOutcome DynamoDBClient::CreateBackup(const CreateBackupRequest& request) const
314 {
315 Aws::Http::URI uri = m_uri;
316 if (m_enableEndpointDiscovery)
317 {
318 Aws::String endpointKey = "Shared";
319 Aws::String endpoint;
320 if (m_endpointsCache.Get(endpointKey, endpoint))
321 {
322 AWS_LOGSTREAM_TRACE("CreateBackup", "Making request to cached endpoint: " << endpoint);
323 uri = m_configScheme + "://" + endpoint;
324 }
325 else
326 {
327 AWS_LOGSTREAM_TRACE("CreateBackup", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
328 DescribeEndpointsRequest endpointRequest;
329 auto endpointOutcome = DescribeEndpoints(endpointRequest);
330 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
331 {
332 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
333 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
334 uri = m_configScheme + "://" + item.GetAddress();
335 AWS_LOGSTREAM_TRACE("CreateBackup", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
336 }
337 else
338 {
339 AWS_LOGSTREAM_ERROR("CreateBackup", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
340 }
341 }
342 }
343 return CreateBackupOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
344 }
345
CreateBackupCallable(const CreateBackupRequest & request) const346 CreateBackupOutcomeCallable DynamoDBClient::CreateBackupCallable(const CreateBackupRequest& request) const
347 {
348 auto task = Aws::MakeShared< std::packaged_task< CreateBackupOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->CreateBackup(request); } );
349 auto packagedFunction = [task]() { (*task)(); };
350 m_executor->Submit(packagedFunction);
351 return task->get_future();
352 }
353
CreateBackupAsync(const CreateBackupRequest & request,const CreateBackupResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const354 void DynamoDBClient::CreateBackupAsync(const CreateBackupRequest& request, const CreateBackupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
355 {
356 m_executor->Submit( [this, request, handler, context](){ this->CreateBackupAsyncHelper( request, handler, context ); } );
357 }
358
CreateBackupAsyncHelper(const CreateBackupRequest & request,const CreateBackupResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const359 void DynamoDBClient::CreateBackupAsyncHelper(const CreateBackupRequest& request, const CreateBackupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
360 {
361 handler(this, request, CreateBackup(request), context);
362 }
363
CreateGlobalTable(const CreateGlobalTableRequest & request) const364 CreateGlobalTableOutcome DynamoDBClient::CreateGlobalTable(const CreateGlobalTableRequest& request) const
365 {
366 Aws::Http::URI uri = m_uri;
367 if (m_enableEndpointDiscovery)
368 {
369 Aws::String endpointKey = "Shared";
370 Aws::String endpoint;
371 if (m_endpointsCache.Get(endpointKey, endpoint))
372 {
373 AWS_LOGSTREAM_TRACE("CreateGlobalTable", "Making request to cached endpoint: " << endpoint);
374 uri = m_configScheme + "://" + endpoint;
375 }
376 else
377 {
378 AWS_LOGSTREAM_TRACE("CreateGlobalTable", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
379 DescribeEndpointsRequest endpointRequest;
380 auto endpointOutcome = DescribeEndpoints(endpointRequest);
381 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
382 {
383 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
384 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
385 uri = m_configScheme + "://" + item.GetAddress();
386 AWS_LOGSTREAM_TRACE("CreateGlobalTable", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
387 }
388 else
389 {
390 AWS_LOGSTREAM_ERROR("CreateGlobalTable", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
391 }
392 }
393 }
394 return CreateGlobalTableOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
395 }
396
CreateGlobalTableCallable(const CreateGlobalTableRequest & request) const397 CreateGlobalTableOutcomeCallable DynamoDBClient::CreateGlobalTableCallable(const CreateGlobalTableRequest& request) const
398 {
399 auto task = Aws::MakeShared< std::packaged_task< CreateGlobalTableOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->CreateGlobalTable(request); } );
400 auto packagedFunction = [task]() { (*task)(); };
401 m_executor->Submit(packagedFunction);
402 return task->get_future();
403 }
404
CreateGlobalTableAsync(const CreateGlobalTableRequest & request,const CreateGlobalTableResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const405 void DynamoDBClient::CreateGlobalTableAsync(const CreateGlobalTableRequest& request, const CreateGlobalTableResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
406 {
407 m_executor->Submit( [this, request, handler, context](){ this->CreateGlobalTableAsyncHelper( request, handler, context ); } );
408 }
409
CreateGlobalTableAsyncHelper(const CreateGlobalTableRequest & request,const CreateGlobalTableResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const410 void DynamoDBClient::CreateGlobalTableAsyncHelper(const CreateGlobalTableRequest& request, const CreateGlobalTableResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
411 {
412 handler(this, request, CreateGlobalTable(request), context);
413 }
414
CreateTable(const CreateTableRequest & request) const415 CreateTableOutcome DynamoDBClient::CreateTable(const CreateTableRequest& request) const
416 {
417 Aws::Http::URI uri = m_uri;
418 if (m_enableEndpointDiscovery)
419 {
420 Aws::String endpointKey = "Shared";
421 Aws::String endpoint;
422 if (m_endpointsCache.Get(endpointKey, endpoint))
423 {
424 AWS_LOGSTREAM_TRACE("CreateTable", "Making request to cached endpoint: " << endpoint);
425 uri = m_configScheme + "://" + endpoint;
426 }
427 else
428 {
429 AWS_LOGSTREAM_TRACE("CreateTable", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
430 DescribeEndpointsRequest endpointRequest;
431 auto endpointOutcome = DescribeEndpoints(endpointRequest);
432 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
433 {
434 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
435 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
436 uri = m_configScheme + "://" + item.GetAddress();
437 AWS_LOGSTREAM_TRACE("CreateTable", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
438 }
439 else
440 {
441 AWS_LOGSTREAM_ERROR("CreateTable", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
442 }
443 }
444 }
445 return CreateTableOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
446 }
447
CreateTableCallable(const CreateTableRequest & request) const448 CreateTableOutcomeCallable DynamoDBClient::CreateTableCallable(const CreateTableRequest& request) const
449 {
450 auto task = Aws::MakeShared< std::packaged_task< CreateTableOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->CreateTable(request); } );
451 auto packagedFunction = [task]() { (*task)(); };
452 m_executor->Submit(packagedFunction);
453 return task->get_future();
454 }
455
CreateTableAsync(const CreateTableRequest & request,const CreateTableResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const456 void DynamoDBClient::CreateTableAsync(const CreateTableRequest& request, const CreateTableResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
457 {
458 m_executor->Submit( [this, request, handler, context](){ this->CreateTableAsyncHelper( request, handler, context ); } );
459 }
460
CreateTableAsyncHelper(const CreateTableRequest & request,const CreateTableResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const461 void DynamoDBClient::CreateTableAsyncHelper(const CreateTableRequest& request, const CreateTableResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
462 {
463 handler(this, request, CreateTable(request), context);
464 }
465
DeleteBackup(const DeleteBackupRequest & request) const466 DeleteBackupOutcome DynamoDBClient::DeleteBackup(const DeleteBackupRequest& request) const
467 {
468 Aws::Http::URI uri = m_uri;
469 if (m_enableEndpointDiscovery)
470 {
471 Aws::String endpointKey = "Shared";
472 Aws::String endpoint;
473 if (m_endpointsCache.Get(endpointKey, endpoint))
474 {
475 AWS_LOGSTREAM_TRACE("DeleteBackup", "Making request to cached endpoint: " << endpoint);
476 uri = m_configScheme + "://" + endpoint;
477 }
478 else
479 {
480 AWS_LOGSTREAM_TRACE("DeleteBackup", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
481 DescribeEndpointsRequest endpointRequest;
482 auto endpointOutcome = DescribeEndpoints(endpointRequest);
483 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
484 {
485 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
486 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
487 uri = m_configScheme + "://" + item.GetAddress();
488 AWS_LOGSTREAM_TRACE("DeleteBackup", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
489 }
490 else
491 {
492 AWS_LOGSTREAM_ERROR("DeleteBackup", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
493 }
494 }
495 }
496 return DeleteBackupOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
497 }
498
DeleteBackupCallable(const DeleteBackupRequest & request) const499 DeleteBackupOutcomeCallable DynamoDBClient::DeleteBackupCallable(const DeleteBackupRequest& request) const
500 {
501 auto task = Aws::MakeShared< std::packaged_task< DeleteBackupOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DeleteBackup(request); } );
502 auto packagedFunction = [task]() { (*task)(); };
503 m_executor->Submit(packagedFunction);
504 return task->get_future();
505 }
506
DeleteBackupAsync(const DeleteBackupRequest & request,const DeleteBackupResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const507 void DynamoDBClient::DeleteBackupAsync(const DeleteBackupRequest& request, const DeleteBackupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
508 {
509 m_executor->Submit( [this, request, handler, context](){ this->DeleteBackupAsyncHelper( request, handler, context ); } );
510 }
511
DeleteBackupAsyncHelper(const DeleteBackupRequest & request,const DeleteBackupResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const512 void DynamoDBClient::DeleteBackupAsyncHelper(const DeleteBackupRequest& request, const DeleteBackupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
513 {
514 handler(this, request, DeleteBackup(request), context);
515 }
516
DeleteItem(const DeleteItemRequest & request) const517 DeleteItemOutcome DynamoDBClient::DeleteItem(const DeleteItemRequest& request) const
518 {
519 Aws::Http::URI uri = m_uri;
520 if (m_enableEndpointDiscovery)
521 {
522 Aws::String endpointKey = "Shared";
523 Aws::String endpoint;
524 if (m_endpointsCache.Get(endpointKey, endpoint))
525 {
526 AWS_LOGSTREAM_TRACE("DeleteItem", "Making request to cached endpoint: " << endpoint);
527 uri = m_configScheme + "://" + endpoint;
528 }
529 else
530 {
531 AWS_LOGSTREAM_TRACE("DeleteItem", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
532 DescribeEndpointsRequest endpointRequest;
533 auto endpointOutcome = DescribeEndpoints(endpointRequest);
534 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
535 {
536 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
537 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
538 uri = m_configScheme + "://" + item.GetAddress();
539 AWS_LOGSTREAM_TRACE("DeleteItem", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
540 }
541 else
542 {
543 AWS_LOGSTREAM_ERROR("DeleteItem", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
544 }
545 }
546 }
547 return DeleteItemOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
548 }
549
DeleteItemCallable(const DeleteItemRequest & request) const550 DeleteItemOutcomeCallable DynamoDBClient::DeleteItemCallable(const DeleteItemRequest& request) const
551 {
552 auto task = Aws::MakeShared< std::packaged_task< DeleteItemOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DeleteItem(request); } );
553 auto packagedFunction = [task]() { (*task)(); };
554 m_executor->Submit(packagedFunction);
555 return task->get_future();
556 }
557
DeleteItemAsync(const DeleteItemRequest & request,const DeleteItemResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const558 void DynamoDBClient::DeleteItemAsync(const DeleteItemRequest& request, const DeleteItemResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
559 {
560 m_executor->Submit( [this, request, handler, context](){ this->DeleteItemAsyncHelper( request, handler, context ); } );
561 }
562
DeleteItemAsyncHelper(const DeleteItemRequest & request,const DeleteItemResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const563 void DynamoDBClient::DeleteItemAsyncHelper(const DeleteItemRequest& request, const DeleteItemResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
564 {
565 handler(this, request, DeleteItem(request), context);
566 }
567
DeleteTable(const DeleteTableRequest & request) const568 DeleteTableOutcome DynamoDBClient::DeleteTable(const DeleteTableRequest& request) const
569 {
570 Aws::Http::URI uri = m_uri;
571 if (m_enableEndpointDiscovery)
572 {
573 Aws::String endpointKey = "Shared";
574 Aws::String endpoint;
575 if (m_endpointsCache.Get(endpointKey, endpoint))
576 {
577 AWS_LOGSTREAM_TRACE("DeleteTable", "Making request to cached endpoint: " << endpoint);
578 uri = m_configScheme + "://" + endpoint;
579 }
580 else
581 {
582 AWS_LOGSTREAM_TRACE("DeleteTable", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
583 DescribeEndpointsRequest endpointRequest;
584 auto endpointOutcome = DescribeEndpoints(endpointRequest);
585 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
586 {
587 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
588 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
589 uri = m_configScheme + "://" + item.GetAddress();
590 AWS_LOGSTREAM_TRACE("DeleteTable", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
591 }
592 else
593 {
594 AWS_LOGSTREAM_ERROR("DeleteTable", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
595 }
596 }
597 }
598 return DeleteTableOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
599 }
600
DeleteTableCallable(const DeleteTableRequest & request) const601 DeleteTableOutcomeCallable DynamoDBClient::DeleteTableCallable(const DeleteTableRequest& request) const
602 {
603 auto task = Aws::MakeShared< std::packaged_task< DeleteTableOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DeleteTable(request); } );
604 auto packagedFunction = [task]() { (*task)(); };
605 m_executor->Submit(packagedFunction);
606 return task->get_future();
607 }
608
DeleteTableAsync(const DeleteTableRequest & request,const DeleteTableResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const609 void DynamoDBClient::DeleteTableAsync(const DeleteTableRequest& request, const DeleteTableResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
610 {
611 m_executor->Submit( [this, request, handler, context](){ this->DeleteTableAsyncHelper( request, handler, context ); } );
612 }
613
DeleteTableAsyncHelper(const DeleteTableRequest & request,const DeleteTableResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const614 void DynamoDBClient::DeleteTableAsyncHelper(const DeleteTableRequest& request, const DeleteTableResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
615 {
616 handler(this, request, DeleteTable(request), context);
617 }
618
DescribeBackup(const DescribeBackupRequest & request) const619 DescribeBackupOutcome DynamoDBClient::DescribeBackup(const DescribeBackupRequest& request) const
620 {
621 Aws::Http::URI uri = m_uri;
622 if (m_enableEndpointDiscovery)
623 {
624 Aws::String endpointKey = "Shared";
625 Aws::String endpoint;
626 if (m_endpointsCache.Get(endpointKey, endpoint))
627 {
628 AWS_LOGSTREAM_TRACE("DescribeBackup", "Making request to cached endpoint: " << endpoint);
629 uri = m_configScheme + "://" + endpoint;
630 }
631 else
632 {
633 AWS_LOGSTREAM_TRACE("DescribeBackup", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
634 DescribeEndpointsRequest endpointRequest;
635 auto endpointOutcome = DescribeEndpoints(endpointRequest);
636 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
637 {
638 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
639 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
640 uri = m_configScheme + "://" + item.GetAddress();
641 AWS_LOGSTREAM_TRACE("DescribeBackup", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
642 }
643 else
644 {
645 AWS_LOGSTREAM_ERROR("DescribeBackup", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
646 }
647 }
648 }
649 return DescribeBackupOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
650 }
651
DescribeBackupCallable(const DescribeBackupRequest & request) const652 DescribeBackupOutcomeCallable DynamoDBClient::DescribeBackupCallable(const DescribeBackupRequest& request) const
653 {
654 auto task = Aws::MakeShared< std::packaged_task< DescribeBackupOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeBackup(request); } );
655 auto packagedFunction = [task]() { (*task)(); };
656 m_executor->Submit(packagedFunction);
657 return task->get_future();
658 }
659
DescribeBackupAsync(const DescribeBackupRequest & request,const DescribeBackupResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const660 void DynamoDBClient::DescribeBackupAsync(const DescribeBackupRequest& request, const DescribeBackupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
661 {
662 m_executor->Submit( [this, request, handler, context](){ this->DescribeBackupAsyncHelper( request, handler, context ); } );
663 }
664
DescribeBackupAsyncHelper(const DescribeBackupRequest & request,const DescribeBackupResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const665 void DynamoDBClient::DescribeBackupAsyncHelper(const DescribeBackupRequest& request, const DescribeBackupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
666 {
667 handler(this, request, DescribeBackup(request), context);
668 }
669
DescribeContinuousBackups(const DescribeContinuousBackupsRequest & request) const670 DescribeContinuousBackupsOutcome DynamoDBClient::DescribeContinuousBackups(const DescribeContinuousBackupsRequest& request) const
671 {
672 Aws::Http::URI uri = m_uri;
673 if (m_enableEndpointDiscovery)
674 {
675 Aws::String endpointKey = "Shared";
676 Aws::String endpoint;
677 if (m_endpointsCache.Get(endpointKey, endpoint))
678 {
679 AWS_LOGSTREAM_TRACE("DescribeContinuousBackups", "Making request to cached endpoint: " << endpoint);
680 uri = m_configScheme + "://" + endpoint;
681 }
682 else
683 {
684 AWS_LOGSTREAM_TRACE("DescribeContinuousBackups", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
685 DescribeEndpointsRequest endpointRequest;
686 auto endpointOutcome = DescribeEndpoints(endpointRequest);
687 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
688 {
689 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
690 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
691 uri = m_configScheme + "://" + item.GetAddress();
692 AWS_LOGSTREAM_TRACE("DescribeContinuousBackups", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
693 }
694 else
695 {
696 AWS_LOGSTREAM_ERROR("DescribeContinuousBackups", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
697 }
698 }
699 }
700 return DescribeContinuousBackupsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
701 }
702
DescribeContinuousBackupsCallable(const DescribeContinuousBackupsRequest & request) const703 DescribeContinuousBackupsOutcomeCallable DynamoDBClient::DescribeContinuousBackupsCallable(const DescribeContinuousBackupsRequest& request) const
704 {
705 auto task = Aws::MakeShared< std::packaged_task< DescribeContinuousBackupsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeContinuousBackups(request); } );
706 auto packagedFunction = [task]() { (*task)(); };
707 m_executor->Submit(packagedFunction);
708 return task->get_future();
709 }
710
DescribeContinuousBackupsAsync(const DescribeContinuousBackupsRequest & request,const DescribeContinuousBackupsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const711 void DynamoDBClient::DescribeContinuousBackupsAsync(const DescribeContinuousBackupsRequest& request, const DescribeContinuousBackupsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
712 {
713 m_executor->Submit( [this, request, handler, context](){ this->DescribeContinuousBackupsAsyncHelper( request, handler, context ); } );
714 }
715
DescribeContinuousBackupsAsyncHelper(const DescribeContinuousBackupsRequest & request,const DescribeContinuousBackupsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const716 void DynamoDBClient::DescribeContinuousBackupsAsyncHelper(const DescribeContinuousBackupsRequest& request, const DescribeContinuousBackupsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
717 {
718 handler(this, request, DescribeContinuousBackups(request), context);
719 }
720
DescribeContributorInsights(const DescribeContributorInsightsRequest & request) const721 DescribeContributorInsightsOutcome DynamoDBClient::DescribeContributorInsights(const DescribeContributorInsightsRequest& request) const
722 {
723 Aws::Http::URI uri = m_uri;
724 return DescribeContributorInsightsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
725 }
726
DescribeContributorInsightsCallable(const DescribeContributorInsightsRequest & request) const727 DescribeContributorInsightsOutcomeCallable DynamoDBClient::DescribeContributorInsightsCallable(const DescribeContributorInsightsRequest& request) const
728 {
729 auto task = Aws::MakeShared< std::packaged_task< DescribeContributorInsightsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeContributorInsights(request); } );
730 auto packagedFunction = [task]() { (*task)(); };
731 m_executor->Submit(packagedFunction);
732 return task->get_future();
733 }
734
DescribeContributorInsightsAsync(const DescribeContributorInsightsRequest & request,const DescribeContributorInsightsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const735 void DynamoDBClient::DescribeContributorInsightsAsync(const DescribeContributorInsightsRequest& request, const DescribeContributorInsightsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
736 {
737 m_executor->Submit( [this, request, handler, context](){ this->DescribeContributorInsightsAsyncHelper( request, handler, context ); } );
738 }
739
DescribeContributorInsightsAsyncHelper(const DescribeContributorInsightsRequest & request,const DescribeContributorInsightsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const740 void DynamoDBClient::DescribeContributorInsightsAsyncHelper(const DescribeContributorInsightsRequest& request, const DescribeContributorInsightsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
741 {
742 handler(this, request, DescribeContributorInsights(request), context);
743 }
744
DescribeEndpoints(const DescribeEndpointsRequest & request) const745 DescribeEndpointsOutcome DynamoDBClient::DescribeEndpoints(const DescribeEndpointsRequest& request) const
746 {
747 Aws::Http::URI uri = m_uri;
748 return DescribeEndpointsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
749 }
750
DescribeEndpointsCallable(const DescribeEndpointsRequest & request) const751 DescribeEndpointsOutcomeCallable DynamoDBClient::DescribeEndpointsCallable(const DescribeEndpointsRequest& request) const
752 {
753 auto task = Aws::MakeShared< std::packaged_task< DescribeEndpointsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeEndpoints(request); } );
754 auto packagedFunction = [task]() { (*task)(); };
755 m_executor->Submit(packagedFunction);
756 return task->get_future();
757 }
758
DescribeEndpointsAsync(const DescribeEndpointsRequest & request,const DescribeEndpointsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const759 void DynamoDBClient::DescribeEndpointsAsync(const DescribeEndpointsRequest& request, const DescribeEndpointsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
760 {
761 m_executor->Submit( [this, request, handler, context](){ this->DescribeEndpointsAsyncHelper( request, handler, context ); } );
762 }
763
DescribeEndpointsAsyncHelper(const DescribeEndpointsRequest & request,const DescribeEndpointsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const764 void DynamoDBClient::DescribeEndpointsAsyncHelper(const DescribeEndpointsRequest& request, const DescribeEndpointsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
765 {
766 handler(this, request, DescribeEndpoints(request), context);
767 }
768
DescribeExport(const DescribeExportRequest & request) const769 DescribeExportOutcome DynamoDBClient::DescribeExport(const DescribeExportRequest& request) const
770 {
771 Aws::Http::URI uri = m_uri;
772 return DescribeExportOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
773 }
774
DescribeExportCallable(const DescribeExportRequest & request) const775 DescribeExportOutcomeCallable DynamoDBClient::DescribeExportCallable(const DescribeExportRequest& request) const
776 {
777 auto task = Aws::MakeShared< std::packaged_task< DescribeExportOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeExport(request); } );
778 auto packagedFunction = [task]() { (*task)(); };
779 m_executor->Submit(packagedFunction);
780 return task->get_future();
781 }
782
DescribeExportAsync(const DescribeExportRequest & request,const DescribeExportResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const783 void DynamoDBClient::DescribeExportAsync(const DescribeExportRequest& request, const DescribeExportResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
784 {
785 m_executor->Submit( [this, request, handler, context](){ this->DescribeExportAsyncHelper( request, handler, context ); } );
786 }
787
DescribeExportAsyncHelper(const DescribeExportRequest & request,const DescribeExportResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const788 void DynamoDBClient::DescribeExportAsyncHelper(const DescribeExportRequest& request, const DescribeExportResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
789 {
790 handler(this, request, DescribeExport(request), context);
791 }
792
DescribeGlobalTable(const DescribeGlobalTableRequest & request) const793 DescribeGlobalTableOutcome DynamoDBClient::DescribeGlobalTable(const DescribeGlobalTableRequest& request) const
794 {
795 Aws::Http::URI uri = m_uri;
796 if (m_enableEndpointDiscovery)
797 {
798 Aws::String endpointKey = "Shared";
799 Aws::String endpoint;
800 if (m_endpointsCache.Get(endpointKey, endpoint))
801 {
802 AWS_LOGSTREAM_TRACE("DescribeGlobalTable", "Making request to cached endpoint: " << endpoint);
803 uri = m_configScheme + "://" + endpoint;
804 }
805 else
806 {
807 AWS_LOGSTREAM_TRACE("DescribeGlobalTable", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
808 DescribeEndpointsRequest endpointRequest;
809 auto endpointOutcome = DescribeEndpoints(endpointRequest);
810 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
811 {
812 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
813 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
814 uri = m_configScheme + "://" + item.GetAddress();
815 AWS_LOGSTREAM_TRACE("DescribeGlobalTable", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
816 }
817 else
818 {
819 AWS_LOGSTREAM_ERROR("DescribeGlobalTable", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
820 }
821 }
822 }
823 return DescribeGlobalTableOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
824 }
825
DescribeGlobalTableCallable(const DescribeGlobalTableRequest & request) const826 DescribeGlobalTableOutcomeCallable DynamoDBClient::DescribeGlobalTableCallable(const DescribeGlobalTableRequest& request) const
827 {
828 auto task = Aws::MakeShared< std::packaged_task< DescribeGlobalTableOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeGlobalTable(request); } );
829 auto packagedFunction = [task]() { (*task)(); };
830 m_executor->Submit(packagedFunction);
831 return task->get_future();
832 }
833
DescribeGlobalTableAsync(const DescribeGlobalTableRequest & request,const DescribeGlobalTableResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const834 void DynamoDBClient::DescribeGlobalTableAsync(const DescribeGlobalTableRequest& request, const DescribeGlobalTableResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
835 {
836 m_executor->Submit( [this, request, handler, context](){ this->DescribeGlobalTableAsyncHelper( request, handler, context ); } );
837 }
838
DescribeGlobalTableAsyncHelper(const DescribeGlobalTableRequest & request,const DescribeGlobalTableResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const839 void DynamoDBClient::DescribeGlobalTableAsyncHelper(const DescribeGlobalTableRequest& request, const DescribeGlobalTableResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
840 {
841 handler(this, request, DescribeGlobalTable(request), context);
842 }
843
DescribeGlobalTableSettings(const DescribeGlobalTableSettingsRequest & request) const844 DescribeGlobalTableSettingsOutcome DynamoDBClient::DescribeGlobalTableSettings(const DescribeGlobalTableSettingsRequest& request) const
845 {
846 Aws::Http::URI uri = m_uri;
847 if (m_enableEndpointDiscovery)
848 {
849 Aws::String endpointKey = "Shared";
850 Aws::String endpoint;
851 if (m_endpointsCache.Get(endpointKey, endpoint))
852 {
853 AWS_LOGSTREAM_TRACE("DescribeGlobalTableSettings", "Making request to cached endpoint: " << endpoint);
854 uri = m_configScheme + "://" + endpoint;
855 }
856 else
857 {
858 AWS_LOGSTREAM_TRACE("DescribeGlobalTableSettings", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
859 DescribeEndpointsRequest endpointRequest;
860 auto endpointOutcome = DescribeEndpoints(endpointRequest);
861 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
862 {
863 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
864 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
865 uri = m_configScheme + "://" + item.GetAddress();
866 AWS_LOGSTREAM_TRACE("DescribeGlobalTableSettings", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
867 }
868 else
869 {
870 AWS_LOGSTREAM_ERROR("DescribeGlobalTableSettings", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
871 }
872 }
873 }
874 return DescribeGlobalTableSettingsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
875 }
876
DescribeGlobalTableSettingsCallable(const DescribeGlobalTableSettingsRequest & request) const877 DescribeGlobalTableSettingsOutcomeCallable DynamoDBClient::DescribeGlobalTableSettingsCallable(const DescribeGlobalTableSettingsRequest& request) const
878 {
879 auto task = Aws::MakeShared< std::packaged_task< DescribeGlobalTableSettingsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeGlobalTableSettings(request); } );
880 auto packagedFunction = [task]() { (*task)(); };
881 m_executor->Submit(packagedFunction);
882 return task->get_future();
883 }
884
DescribeGlobalTableSettingsAsync(const DescribeGlobalTableSettingsRequest & request,const DescribeGlobalTableSettingsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const885 void DynamoDBClient::DescribeGlobalTableSettingsAsync(const DescribeGlobalTableSettingsRequest& request, const DescribeGlobalTableSettingsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
886 {
887 m_executor->Submit( [this, request, handler, context](){ this->DescribeGlobalTableSettingsAsyncHelper( request, handler, context ); } );
888 }
889
DescribeGlobalTableSettingsAsyncHelper(const DescribeGlobalTableSettingsRequest & request,const DescribeGlobalTableSettingsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const890 void DynamoDBClient::DescribeGlobalTableSettingsAsyncHelper(const DescribeGlobalTableSettingsRequest& request, const DescribeGlobalTableSettingsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
891 {
892 handler(this, request, DescribeGlobalTableSettings(request), context);
893 }
894
DescribeKinesisStreamingDestination(const DescribeKinesisStreamingDestinationRequest & request) const895 DescribeKinesisStreamingDestinationOutcome DynamoDBClient::DescribeKinesisStreamingDestination(const DescribeKinesisStreamingDestinationRequest& request) const
896 {
897 Aws::Http::URI uri = m_uri;
898 if (m_enableEndpointDiscovery)
899 {
900 Aws::String endpointKey = "Shared";
901 Aws::String endpoint;
902 if (m_endpointsCache.Get(endpointKey, endpoint))
903 {
904 AWS_LOGSTREAM_TRACE("DescribeKinesisStreamingDestination", "Making request to cached endpoint: " << endpoint);
905 uri = m_configScheme + "://" + endpoint;
906 }
907 else
908 {
909 AWS_LOGSTREAM_TRACE("DescribeKinesisStreamingDestination", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
910 DescribeEndpointsRequest endpointRequest;
911 auto endpointOutcome = DescribeEndpoints(endpointRequest);
912 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
913 {
914 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
915 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
916 uri = m_configScheme + "://" + item.GetAddress();
917 AWS_LOGSTREAM_TRACE("DescribeKinesisStreamingDestination", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
918 }
919 else
920 {
921 AWS_LOGSTREAM_ERROR("DescribeKinesisStreamingDestination", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
922 }
923 }
924 }
925 return DescribeKinesisStreamingDestinationOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
926 }
927
DescribeKinesisStreamingDestinationCallable(const DescribeKinesisStreamingDestinationRequest & request) const928 DescribeKinesisStreamingDestinationOutcomeCallable DynamoDBClient::DescribeKinesisStreamingDestinationCallable(const DescribeKinesisStreamingDestinationRequest& request) const
929 {
930 auto task = Aws::MakeShared< std::packaged_task< DescribeKinesisStreamingDestinationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeKinesisStreamingDestination(request); } );
931 auto packagedFunction = [task]() { (*task)(); };
932 m_executor->Submit(packagedFunction);
933 return task->get_future();
934 }
935
DescribeKinesisStreamingDestinationAsync(const DescribeKinesisStreamingDestinationRequest & request,const DescribeKinesisStreamingDestinationResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const936 void DynamoDBClient::DescribeKinesisStreamingDestinationAsync(const DescribeKinesisStreamingDestinationRequest& request, const DescribeKinesisStreamingDestinationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
937 {
938 m_executor->Submit( [this, request, handler, context](){ this->DescribeKinesisStreamingDestinationAsyncHelper( request, handler, context ); } );
939 }
940
DescribeKinesisStreamingDestinationAsyncHelper(const DescribeKinesisStreamingDestinationRequest & request,const DescribeKinesisStreamingDestinationResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const941 void DynamoDBClient::DescribeKinesisStreamingDestinationAsyncHelper(const DescribeKinesisStreamingDestinationRequest& request, const DescribeKinesisStreamingDestinationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
942 {
943 handler(this, request, DescribeKinesisStreamingDestination(request), context);
944 }
945
DescribeLimits(const DescribeLimitsRequest & request) const946 DescribeLimitsOutcome DynamoDBClient::DescribeLimits(const DescribeLimitsRequest& request) const
947 {
948 Aws::Http::URI uri = m_uri;
949 if (m_enableEndpointDiscovery)
950 {
951 Aws::String endpointKey = "Shared";
952 Aws::String endpoint;
953 if (m_endpointsCache.Get(endpointKey, endpoint))
954 {
955 AWS_LOGSTREAM_TRACE("DescribeLimits", "Making request to cached endpoint: " << endpoint);
956 uri = m_configScheme + "://" + endpoint;
957 }
958 else
959 {
960 AWS_LOGSTREAM_TRACE("DescribeLimits", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
961 DescribeEndpointsRequest endpointRequest;
962 auto endpointOutcome = DescribeEndpoints(endpointRequest);
963 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
964 {
965 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
966 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
967 uri = m_configScheme + "://" + item.GetAddress();
968 AWS_LOGSTREAM_TRACE("DescribeLimits", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
969 }
970 else
971 {
972 AWS_LOGSTREAM_ERROR("DescribeLimits", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
973 }
974 }
975 }
976 return DescribeLimitsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
977 }
978
DescribeLimitsCallable(const DescribeLimitsRequest & request) const979 DescribeLimitsOutcomeCallable DynamoDBClient::DescribeLimitsCallable(const DescribeLimitsRequest& request) const
980 {
981 auto task = Aws::MakeShared< std::packaged_task< DescribeLimitsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeLimits(request); } );
982 auto packagedFunction = [task]() { (*task)(); };
983 m_executor->Submit(packagedFunction);
984 return task->get_future();
985 }
986
DescribeLimitsAsync(const DescribeLimitsRequest & request,const DescribeLimitsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const987 void DynamoDBClient::DescribeLimitsAsync(const DescribeLimitsRequest& request, const DescribeLimitsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
988 {
989 m_executor->Submit( [this, request, handler, context](){ this->DescribeLimitsAsyncHelper( request, handler, context ); } );
990 }
991
DescribeLimitsAsyncHelper(const DescribeLimitsRequest & request,const DescribeLimitsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const992 void DynamoDBClient::DescribeLimitsAsyncHelper(const DescribeLimitsRequest& request, const DescribeLimitsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
993 {
994 handler(this, request, DescribeLimits(request), context);
995 }
996
DescribeTable(const DescribeTableRequest & request) const997 DescribeTableOutcome DynamoDBClient::DescribeTable(const DescribeTableRequest& request) const
998 {
999 Aws::Http::URI uri = m_uri;
1000 if (m_enableEndpointDiscovery)
1001 {
1002 Aws::String endpointKey = "Shared";
1003 Aws::String endpoint;
1004 if (m_endpointsCache.Get(endpointKey, endpoint))
1005 {
1006 AWS_LOGSTREAM_TRACE("DescribeTable", "Making request to cached endpoint: " << endpoint);
1007 uri = m_configScheme + "://" + endpoint;
1008 }
1009 else
1010 {
1011 AWS_LOGSTREAM_TRACE("DescribeTable", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
1012 DescribeEndpointsRequest endpointRequest;
1013 auto endpointOutcome = DescribeEndpoints(endpointRequest);
1014 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
1015 {
1016 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
1017 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
1018 uri = m_configScheme + "://" + item.GetAddress();
1019 AWS_LOGSTREAM_TRACE("DescribeTable", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
1020 }
1021 else
1022 {
1023 AWS_LOGSTREAM_ERROR("DescribeTable", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
1024 }
1025 }
1026 }
1027 return DescribeTableOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
1028 }
1029
DescribeTableCallable(const DescribeTableRequest & request) const1030 DescribeTableOutcomeCallable DynamoDBClient::DescribeTableCallable(const DescribeTableRequest& request) const
1031 {
1032 auto task = Aws::MakeShared< std::packaged_task< DescribeTableOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeTable(request); } );
1033 auto packagedFunction = [task]() { (*task)(); };
1034 m_executor->Submit(packagedFunction);
1035 return task->get_future();
1036 }
1037
DescribeTableAsync(const DescribeTableRequest & request,const DescribeTableResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1038 void DynamoDBClient::DescribeTableAsync(const DescribeTableRequest& request, const DescribeTableResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1039 {
1040 m_executor->Submit( [this, request, handler, context](){ this->DescribeTableAsyncHelper( request, handler, context ); } );
1041 }
1042
DescribeTableAsyncHelper(const DescribeTableRequest & request,const DescribeTableResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1043 void DynamoDBClient::DescribeTableAsyncHelper(const DescribeTableRequest& request, const DescribeTableResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1044 {
1045 handler(this, request, DescribeTable(request), context);
1046 }
1047
DescribeTableReplicaAutoScaling(const DescribeTableReplicaAutoScalingRequest & request) const1048 DescribeTableReplicaAutoScalingOutcome DynamoDBClient::DescribeTableReplicaAutoScaling(const DescribeTableReplicaAutoScalingRequest& request) const
1049 {
1050 Aws::Http::URI uri = m_uri;
1051 return DescribeTableReplicaAutoScalingOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
1052 }
1053
DescribeTableReplicaAutoScalingCallable(const DescribeTableReplicaAutoScalingRequest & request) const1054 DescribeTableReplicaAutoScalingOutcomeCallable DynamoDBClient::DescribeTableReplicaAutoScalingCallable(const DescribeTableReplicaAutoScalingRequest& request) const
1055 {
1056 auto task = Aws::MakeShared< std::packaged_task< DescribeTableReplicaAutoScalingOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeTableReplicaAutoScaling(request); } );
1057 auto packagedFunction = [task]() { (*task)(); };
1058 m_executor->Submit(packagedFunction);
1059 return task->get_future();
1060 }
1061
DescribeTableReplicaAutoScalingAsync(const DescribeTableReplicaAutoScalingRequest & request,const DescribeTableReplicaAutoScalingResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1062 void DynamoDBClient::DescribeTableReplicaAutoScalingAsync(const DescribeTableReplicaAutoScalingRequest& request, const DescribeTableReplicaAutoScalingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1063 {
1064 m_executor->Submit( [this, request, handler, context](){ this->DescribeTableReplicaAutoScalingAsyncHelper( request, handler, context ); } );
1065 }
1066
DescribeTableReplicaAutoScalingAsyncHelper(const DescribeTableReplicaAutoScalingRequest & request,const DescribeTableReplicaAutoScalingResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1067 void DynamoDBClient::DescribeTableReplicaAutoScalingAsyncHelper(const DescribeTableReplicaAutoScalingRequest& request, const DescribeTableReplicaAutoScalingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1068 {
1069 handler(this, request, DescribeTableReplicaAutoScaling(request), context);
1070 }
1071
DescribeTimeToLive(const DescribeTimeToLiveRequest & request) const1072 DescribeTimeToLiveOutcome DynamoDBClient::DescribeTimeToLive(const DescribeTimeToLiveRequest& request) const
1073 {
1074 Aws::Http::URI uri = m_uri;
1075 if (m_enableEndpointDiscovery)
1076 {
1077 Aws::String endpointKey = "Shared";
1078 Aws::String endpoint;
1079 if (m_endpointsCache.Get(endpointKey, endpoint))
1080 {
1081 AWS_LOGSTREAM_TRACE("DescribeTimeToLive", "Making request to cached endpoint: " << endpoint);
1082 uri = m_configScheme + "://" + endpoint;
1083 }
1084 else
1085 {
1086 AWS_LOGSTREAM_TRACE("DescribeTimeToLive", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
1087 DescribeEndpointsRequest endpointRequest;
1088 auto endpointOutcome = DescribeEndpoints(endpointRequest);
1089 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
1090 {
1091 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
1092 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
1093 uri = m_configScheme + "://" + item.GetAddress();
1094 AWS_LOGSTREAM_TRACE("DescribeTimeToLive", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
1095 }
1096 else
1097 {
1098 AWS_LOGSTREAM_ERROR("DescribeTimeToLive", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
1099 }
1100 }
1101 }
1102 return DescribeTimeToLiveOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
1103 }
1104
DescribeTimeToLiveCallable(const DescribeTimeToLiveRequest & request) const1105 DescribeTimeToLiveOutcomeCallable DynamoDBClient::DescribeTimeToLiveCallable(const DescribeTimeToLiveRequest& request) const
1106 {
1107 auto task = Aws::MakeShared< std::packaged_task< DescribeTimeToLiveOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeTimeToLive(request); } );
1108 auto packagedFunction = [task]() { (*task)(); };
1109 m_executor->Submit(packagedFunction);
1110 return task->get_future();
1111 }
1112
DescribeTimeToLiveAsync(const DescribeTimeToLiveRequest & request,const DescribeTimeToLiveResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1113 void DynamoDBClient::DescribeTimeToLiveAsync(const DescribeTimeToLiveRequest& request, const DescribeTimeToLiveResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1114 {
1115 m_executor->Submit( [this, request, handler, context](){ this->DescribeTimeToLiveAsyncHelper( request, handler, context ); } );
1116 }
1117
DescribeTimeToLiveAsyncHelper(const DescribeTimeToLiveRequest & request,const DescribeTimeToLiveResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1118 void DynamoDBClient::DescribeTimeToLiveAsyncHelper(const DescribeTimeToLiveRequest& request, const DescribeTimeToLiveResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1119 {
1120 handler(this, request, DescribeTimeToLive(request), context);
1121 }
1122
DisableKinesisStreamingDestination(const DisableKinesisStreamingDestinationRequest & request) const1123 DisableKinesisStreamingDestinationOutcome DynamoDBClient::DisableKinesisStreamingDestination(const DisableKinesisStreamingDestinationRequest& request) const
1124 {
1125 Aws::Http::URI uri = m_uri;
1126 if (m_enableEndpointDiscovery)
1127 {
1128 Aws::String endpointKey = "Shared";
1129 Aws::String endpoint;
1130 if (m_endpointsCache.Get(endpointKey, endpoint))
1131 {
1132 AWS_LOGSTREAM_TRACE("DisableKinesisStreamingDestination", "Making request to cached endpoint: " << endpoint);
1133 uri = m_configScheme + "://" + endpoint;
1134 }
1135 else
1136 {
1137 AWS_LOGSTREAM_TRACE("DisableKinesisStreamingDestination", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
1138 DescribeEndpointsRequest endpointRequest;
1139 auto endpointOutcome = DescribeEndpoints(endpointRequest);
1140 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
1141 {
1142 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
1143 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
1144 uri = m_configScheme + "://" + item.GetAddress();
1145 AWS_LOGSTREAM_TRACE("DisableKinesisStreamingDestination", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
1146 }
1147 else
1148 {
1149 AWS_LOGSTREAM_ERROR("DisableKinesisStreamingDestination", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
1150 }
1151 }
1152 }
1153 return DisableKinesisStreamingDestinationOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
1154 }
1155
DisableKinesisStreamingDestinationCallable(const DisableKinesisStreamingDestinationRequest & request) const1156 DisableKinesisStreamingDestinationOutcomeCallable DynamoDBClient::DisableKinesisStreamingDestinationCallable(const DisableKinesisStreamingDestinationRequest& request) const
1157 {
1158 auto task = Aws::MakeShared< std::packaged_task< DisableKinesisStreamingDestinationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DisableKinesisStreamingDestination(request); } );
1159 auto packagedFunction = [task]() { (*task)(); };
1160 m_executor->Submit(packagedFunction);
1161 return task->get_future();
1162 }
1163
DisableKinesisStreamingDestinationAsync(const DisableKinesisStreamingDestinationRequest & request,const DisableKinesisStreamingDestinationResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1164 void DynamoDBClient::DisableKinesisStreamingDestinationAsync(const DisableKinesisStreamingDestinationRequest& request, const DisableKinesisStreamingDestinationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1165 {
1166 m_executor->Submit( [this, request, handler, context](){ this->DisableKinesisStreamingDestinationAsyncHelper( request, handler, context ); } );
1167 }
1168
DisableKinesisStreamingDestinationAsyncHelper(const DisableKinesisStreamingDestinationRequest & request,const DisableKinesisStreamingDestinationResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1169 void DynamoDBClient::DisableKinesisStreamingDestinationAsyncHelper(const DisableKinesisStreamingDestinationRequest& request, const DisableKinesisStreamingDestinationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1170 {
1171 handler(this, request, DisableKinesisStreamingDestination(request), context);
1172 }
1173
EnableKinesisStreamingDestination(const EnableKinesisStreamingDestinationRequest & request) const1174 EnableKinesisStreamingDestinationOutcome DynamoDBClient::EnableKinesisStreamingDestination(const EnableKinesisStreamingDestinationRequest& request) const
1175 {
1176 Aws::Http::URI uri = m_uri;
1177 if (m_enableEndpointDiscovery)
1178 {
1179 Aws::String endpointKey = "Shared";
1180 Aws::String endpoint;
1181 if (m_endpointsCache.Get(endpointKey, endpoint))
1182 {
1183 AWS_LOGSTREAM_TRACE("EnableKinesisStreamingDestination", "Making request to cached endpoint: " << endpoint);
1184 uri = m_configScheme + "://" + endpoint;
1185 }
1186 else
1187 {
1188 AWS_LOGSTREAM_TRACE("EnableKinesisStreamingDestination", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
1189 DescribeEndpointsRequest endpointRequest;
1190 auto endpointOutcome = DescribeEndpoints(endpointRequest);
1191 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
1192 {
1193 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
1194 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
1195 uri = m_configScheme + "://" + item.GetAddress();
1196 AWS_LOGSTREAM_TRACE("EnableKinesisStreamingDestination", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
1197 }
1198 else
1199 {
1200 AWS_LOGSTREAM_ERROR("EnableKinesisStreamingDestination", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
1201 }
1202 }
1203 }
1204 return EnableKinesisStreamingDestinationOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
1205 }
1206
EnableKinesisStreamingDestinationCallable(const EnableKinesisStreamingDestinationRequest & request) const1207 EnableKinesisStreamingDestinationOutcomeCallable DynamoDBClient::EnableKinesisStreamingDestinationCallable(const EnableKinesisStreamingDestinationRequest& request) const
1208 {
1209 auto task = Aws::MakeShared< std::packaged_task< EnableKinesisStreamingDestinationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->EnableKinesisStreamingDestination(request); } );
1210 auto packagedFunction = [task]() { (*task)(); };
1211 m_executor->Submit(packagedFunction);
1212 return task->get_future();
1213 }
1214
EnableKinesisStreamingDestinationAsync(const EnableKinesisStreamingDestinationRequest & request,const EnableKinesisStreamingDestinationResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1215 void DynamoDBClient::EnableKinesisStreamingDestinationAsync(const EnableKinesisStreamingDestinationRequest& request, const EnableKinesisStreamingDestinationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1216 {
1217 m_executor->Submit( [this, request, handler, context](){ this->EnableKinesisStreamingDestinationAsyncHelper( request, handler, context ); } );
1218 }
1219
EnableKinesisStreamingDestinationAsyncHelper(const EnableKinesisStreamingDestinationRequest & request,const EnableKinesisStreamingDestinationResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1220 void DynamoDBClient::EnableKinesisStreamingDestinationAsyncHelper(const EnableKinesisStreamingDestinationRequest& request, const EnableKinesisStreamingDestinationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1221 {
1222 handler(this, request, EnableKinesisStreamingDestination(request), context);
1223 }
1224
ExecuteStatement(const ExecuteStatementRequest & request) const1225 ExecuteStatementOutcome DynamoDBClient::ExecuteStatement(const ExecuteStatementRequest& request) const
1226 {
1227 Aws::Http::URI uri = m_uri;
1228 return ExecuteStatementOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
1229 }
1230
ExecuteStatementCallable(const ExecuteStatementRequest & request) const1231 ExecuteStatementOutcomeCallable DynamoDBClient::ExecuteStatementCallable(const ExecuteStatementRequest& request) const
1232 {
1233 auto task = Aws::MakeShared< std::packaged_task< ExecuteStatementOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ExecuteStatement(request); } );
1234 auto packagedFunction = [task]() { (*task)(); };
1235 m_executor->Submit(packagedFunction);
1236 return task->get_future();
1237 }
1238
ExecuteStatementAsync(const ExecuteStatementRequest & request,const ExecuteStatementResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1239 void DynamoDBClient::ExecuteStatementAsync(const ExecuteStatementRequest& request, const ExecuteStatementResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1240 {
1241 m_executor->Submit( [this, request, handler, context](){ this->ExecuteStatementAsyncHelper( request, handler, context ); } );
1242 }
1243
ExecuteStatementAsyncHelper(const ExecuteStatementRequest & request,const ExecuteStatementResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1244 void DynamoDBClient::ExecuteStatementAsyncHelper(const ExecuteStatementRequest& request, const ExecuteStatementResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1245 {
1246 handler(this, request, ExecuteStatement(request), context);
1247 }
1248
ExecuteTransaction(const ExecuteTransactionRequest & request) const1249 ExecuteTransactionOutcome DynamoDBClient::ExecuteTransaction(const ExecuteTransactionRequest& request) const
1250 {
1251 Aws::Http::URI uri = m_uri;
1252 return ExecuteTransactionOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
1253 }
1254
ExecuteTransactionCallable(const ExecuteTransactionRequest & request) const1255 ExecuteTransactionOutcomeCallable DynamoDBClient::ExecuteTransactionCallable(const ExecuteTransactionRequest& request) const
1256 {
1257 auto task = Aws::MakeShared< std::packaged_task< ExecuteTransactionOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ExecuteTransaction(request); } );
1258 auto packagedFunction = [task]() { (*task)(); };
1259 m_executor->Submit(packagedFunction);
1260 return task->get_future();
1261 }
1262
ExecuteTransactionAsync(const ExecuteTransactionRequest & request,const ExecuteTransactionResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1263 void DynamoDBClient::ExecuteTransactionAsync(const ExecuteTransactionRequest& request, const ExecuteTransactionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1264 {
1265 m_executor->Submit( [this, request, handler, context](){ this->ExecuteTransactionAsyncHelper( request, handler, context ); } );
1266 }
1267
ExecuteTransactionAsyncHelper(const ExecuteTransactionRequest & request,const ExecuteTransactionResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1268 void DynamoDBClient::ExecuteTransactionAsyncHelper(const ExecuteTransactionRequest& request, const ExecuteTransactionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1269 {
1270 handler(this, request, ExecuteTransaction(request), context);
1271 }
1272
ExportTableToPointInTime(const ExportTableToPointInTimeRequest & request) const1273 ExportTableToPointInTimeOutcome DynamoDBClient::ExportTableToPointInTime(const ExportTableToPointInTimeRequest& request) const
1274 {
1275 Aws::Http::URI uri = m_uri;
1276 return ExportTableToPointInTimeOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
1277 }
1278
ExportTableToPointInTimeCallable(const ExportTableToPointInTimeRequest & request) const1279 ExportTableToPointInTimeOutcomeCallable DynamoDBClient::ExportTableToPointInTimeCallable(const ExportTableToPointInTimeRequest& request) const
1280 {
1281 auto task = Aws::MakeShared< std::packaged_task< ExportTableToPointInTimeOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ExportTableToPointInTime(request); } );
1282 auto packagedFunction = [task]() { (*task)(); };
1283 m_executor->Submit(packagedFunction);
1284 return task->get_future();
1285 }
1286
ExportTableToPointInTimeAsync(const ExportTableToPointInTimeRequest & request,const ExportTableToPointInTimeResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1287 void DynamoDBClient::ExportTableToPointInTimeAsync(const ExportTableToPointInTimeRequest& request, const ExportTableToPointInTimeResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1288 {
1289 m_executor->Submit( [this, request, handler, context](){ this->ExportTableToPointInTimeAsyncHelper( request, handler, context ); } );
1290 }
1291
ExportTableToPointInTimeAsyncHelper(const ExportTableToPointInTimeRequest & request,const ExportTableToPointInTimeResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1292 void DynamoDBClient::ExportTableToPointInTimeAsyncHelper(const ExportTableToPointInTimeRequest& request, const ExportTableToPointInTimeResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1293 {
1294 handler(this, request, ExportTableToPointInTime(request), context);
1295 }
1296
GetItem(const GetItemRequest & request) const1297 GetItemOutcome DynamoDBClient::GetItem(const GetItemRequest& request) const
1298 {
1299 Aws::Http::URI uri = m_uri;
1300 if (m_enableEndpointDiscovery)
1301 {
1302 Aws::String endpointKey = "Shared";
1303 Aws::String endpoint;
1304 if (m_endpointsCache.Get(endpointKey, endpoint))
1305 {
1306 AWS_LOGSTREAM_TRACE("GetItem", "Making request to cached endpoint: " << endpoint);
1307 uri = m_configScheme + "://" + endpoint;
1308 }
1309 else
1310 {
1311 AWS_LOGSTREAM_TRACE("GetItem", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
1312 DescribeEndpointsRequest endpointRequest;
1313 auto endpointOutcome = DescribeEndpoints(endpointRequest);
1314 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
1315 {
1316 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
1317 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
1318 uri = m_configScheme + "://" + item.GetAddress();
1319 AWS_LOGSTREAM_TRACE("GetItem", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
1320 }
1321 else
1322 {
1323 AWS_LOGSTREAM_ERROR("GetItem", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
1324 }
1325 }
1326 }
1327 return GetItemOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
1328 }
1329
GetItemCallable(const GetItemRequest & request) const1330 GetItemOutcomeCallable DynamoDBClient::GetItemCallable(const GetItemRequest& request) const
1331 {
1332 auto task = Aws::MakeShared< std::packaged_task< GetItemOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetItem(request); } );
1333 auto packagedFunction = [task]() { (*task)(); };
1334 m_executor->Submit(packagedFunction);
1335 return task->get_future();
1336 }
1337
GetItemAsync(const GetItemRequest & request,const GetItemResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1338 void DynamoDBClient::GetItemAsync(const GetItemRequest& request, const GetItemResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1339 {
1340 m_executor->Submit( [this, request, handler, context](){ this->GetItemAsyncHelper( request, handler, context ); } );
1341 }
1342
GetItemAsyncHelper(const GetItemRequest & request,const GetItemResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1343 void DynamoDBClient::GetItemAsyncHelper(const GetItemRequest& request, const GetItemResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1344 {
1345 handler(this, request, GetItem(request), context);
1346 }
1347
ListBackups(const ListBackupsRequest & request) const1348 ListBackupsOutcome DynamoDBClient::ListBackups(const ListBackupsRequest& request) const
1349 {
1350 Aws::Http::URI uri = m_uri;
1351 if (m_enableEndpointDiscovery)
1352 {
1353 Aws::String endpointKey = "Shared";
1354 Aws::String endpoint;
1355 if (m_endpointsCache.Get(endpointKey, endpoint))
1356 {
1357 AWS_LOGSTREAM_TRACE("ListBackups", "Making request to cached endpoint: " << endpoint);
1358 uri = m_configScheme + "://" + endpoint;
1359 }
1360 else
1361 {
1362 AWS_LOGSTREAM_TRACE("ListBackups", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
1363 DescribeEndpointsRequest endpointRequest;
1364 auto endpointOutcome = DescribeEndpoints(endpointRequest);
1365 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
1366 {
1367 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
1368 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
1369 uri = m_configScheme + "://" + item.GetAddress();
1370 AWS_LOGSTREAM_TRACE("ListBackups", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
1371 }
1372 else
1373 {
1374 AWS_LOGSTREAM_ERROR("ListBackups", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
1375 }
1376 }
1377 }
1378 return ListBackupsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
1379 }
1380
ListBackupsCallable(const ListBackupsRequest & request) const1381 ListBackupsOutcomeCallable DynamoDBClient::ListBackupsCallable(const ListBackupsRequest& request) const
1382 {
1383 auto task = Aws::MakeShared< std::packaged_task< ListBackupsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListBackups(request); } );
1384 auto packagedFunction = [task]() { (*task)(); };
1385 m_executor->Submit(packagedFunction);
1386 return task->get_future();
1387 }
1388
ListBackupsAsync(const ListBackupsRequest & request,const ListBackupsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1389 void DynamoDBClient::ListBackupsAsync(const ListBackupsRequest& request, const ListBackupsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1390 {
1391 m_executor->Submit( [this, request, handler, context](){ this->ListBackupsAsyncHelper( request, handler, context ); } );
1392 }
1393
ListBackupsAsyncHelper(const ListBackupsRequest & request,const ListBackupsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1394 void DynamoDBClient::ListBackupsAsyncHelper(const ListBackupsRequest& request, const ListBackupsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1395 {
1396 handler(this, request, ListBackups(request), context);
1397 }
1398
ListContributorInsights(const ListContributorInsightsRequest & request) const1399 ListContributorInsightsOutcome DynamoDBClient::ListContributorInsights(const ListContributorInsightsRequest& request) const
1400 {
1401 Aws::Http::URI uri = m_uri;
1402 return ListContributorInsightsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
1403 }
1404
ListContributorInsightsCallable(const ListContributorInsightsRequest & request) const1405 ListContributorInsightsOutcomeCallable DynamoDBClient::ListContributorInsightsCallable(const ListContributorInsightsRequest& request) const
1406 {
1407 auto task = Aws::MakeShared< std::packaged_task< ListContributorInsightsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListContributorInsights(request); } );
1408 auto packagedFunction = [task]() { (*task)(); };
1409 m_executor->Submit(packagedFunction);
1410 return task->get_future();
1411 }
1412
ListContributorInsightsAsync(const ListContributorInsightsRequest & request,const ListContributorInsightsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1413 void DynamoDBClient::ListContributorInsightsAsync(const ListContributorInsightsRequest& request, const ListContributorInsightsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1414 {
1415 m_executor->Submit( [this, request, handler, context](){ this->ListContributorInsightsAsyncHelper( request, handler, context ); } );
1416 }
1417
ListContributorInsightsAsyncHelper(const ListContributorInsightsRequest & request,const ListContributorInsightsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1418 void DynamoDBClient::ListContributorInsightsAsyncHelper(const ListContributorInsightsRequest& request, const ListContributorInsightsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1419 {
1420 handler(this, request, ListContributorInsights(request), context);
1421 }
1422
ListExports(const ListExportsRequest & request) const1423 ListExportsOutcome DynamoDBClient::ListExports(const ListExportsRequest& request) const
1424 {
1425 Aws::Http::URI uri = m_uri;
1426 return ListExportsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
1427 }
1428
ListExportsCallable(const ListExportsRequest & request) const1429 ListExportsOutcomeCallable DynamoDBClient::ListExportsCallable(const ListExportsRequest& request) const
1430 {
1431 auto task = Aws::MakeShared< std::packaged_task< ListExportsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListExports(request); } );
1432 auto packagedFunction = [task]() { (*task)(); };
1433 m_executor->Submit(packagedFunction);
1434 return task->get_future();
1435 }
1436
ListExportsAsync(const ListExportsRequest & request,const ListExportsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1437 void DynamoDBClient::ListExportsAsync(const ListExportsRequest& request, const ListExportsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1438 {
1439 m_executor->Submit( [this, request, handler, context](){ this->ListExportsAsyncHelper( request, handler, context ); } );
1440 }
1441
ListExportsAsyncHelper(const ListExportsRequest & request,const ListExportsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1442 void DynamoDBClient::ListExportsAsyncHelper(const ListExportsRequest& request, const ListExportsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1443 {
1444 handler(this, request, ListExports(request), context);
1445 }
1446
ListGlobalTables(const ListGlobalTablesRequest & request) const1447 ListGlobalTablesOutcome DynamoDBClient::ListGlobalTables(const ListGlobalTablesRequest& request) const
1448 {
1449 Aws::Http::URI uri = m_uri;
1450 if (m_enableEndpointDiscovery)
1451 {
1452 Aws::String endpointKey = "Shared";
1453 Aws::String endpoint;
1454 if (m_endpointsCache.Get(endpointKey, endpoint))
1455 {
1456 AWS_LOGSTREAM_TRACE("ListGlobalTables", "Making request to cached endpoint: " << endpoint);
1457 uri = m_configScheme + "://" + endpoint;
1458 }
1459 else
1460 {
1461 AWS_LOGSTREAM_TRACE("ListGlobalTables", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
1462 DescribeEndpointsRequest endpointRequest;
1463 auto endpointOutcome = DescribeEndpoints(endpointRequest);
1464 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
1465 {
1466 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
1467 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
1468 uri = m_configScheme + "://" + item.GetAddress();
1469 AWS_LOGSTREAM_TRACE("ListGlobalTables", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
1470 }
1471 else
1472 {
1473 AWS_LOGSTREAM_ERROR("ListGlobalTables", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
1474 }
1475 }
1476 }
1477 return ListGlobalTablesOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
1478 }
1479
ListGlobalTablesCallable(const ListGlobalTablesRequest & request) const1480 ListGlobalTablesOutcomeCallable DynamoDBClient::ListGlobalTablesCallable(const ListGlobalTablesRequest& request) const
1481 {
1482 auto task = Aws::MakeShared< std::packaged_task< ListGlobalTablesOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListGlobalTables(request); } );
1483 auto packagedFunction = [task]() { (*task)(); };
1484 m_executor->Submit(packagedFunction);
1485 return task->get_future();
1486 }
1487
ListGlobalTablesAsync(const ListGlobalTablesRequest & request,const ListGlobalTablesResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1488 void DynamoDBClient::ListGlobalTablesAsync(const ListGlobalTablesRequest& request, const ListGlobalTablesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1489 {
1490 m_executor->Submit( [this, request, handler, context](){ this->ListGlobalTablesAsyncHelper( request, handler, context ); } );
1491 }
1492
ListGlobalTablesAsyncHelper(const ListGlobalTablesRequest & request,const ListGlobalTablesResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1493 void DynamoDBClient::ListGlobalTablesAsyncHelper(const ListGlobalTablesRequest& request, const ListGlobalTablesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1494 {
1495 handler(this, request, ListGlobalTables(request), context);
1496 }
1497
ListTables(const ListTablesRequest & request) const1498 ListTablesOutcome DynamoDBClient::ListTables(const ListTablesRequest& request) const
1499 {
1500 Aws::Http::URI uri = m_uri;
1501 if (m_enableEndpointDiscovery)
1502 {
1503 Aws::String endpointKey = "Shared";
1504 Aws::String endpoint;
1505 if (m_endpointsCache.Get(endpointKey, endpoint))
1506 {
1507 AWS_LOGSTREAM_TRACE("ListTables", "Making request to cached endpoint: " << endpoint);
1508 uri = m_configScheme + "://" + endpoint;
1509 }
1510 else
1511 {
1512 AWS_LOGSTREAM_TRACE("ListTables", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
1513 DescribeEndpointsRequest endpointRequest;
1514 auto endpointOutcome = DescribeEndpoints(endpointRequest);
1515 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
1516 {
1517 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
1518 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
1519 uri = m_configScheme + "://" + item.GetAddress();
1520 AWS_LOGSTREAM_TRACE("ListTables", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
1521 }
1522 else
1523 {
1524 AWS_LOGSTREAM_ERROR("ListTables", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
1525 }
1526 }
1527 }
1528 return ListTablesOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
1529 }
1530
ListTablesCallable(const ListTablesRequest & request) const1531 ListTablesOutcomeCallable DynamoDBClient::ListTablesCallable(const ListTablesRequest& request) const
1532 {
1533 auto task = Aws::MakeShared< std::packaged_task< ListTablesOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListTables(request); } );
1534 auto packagedFunction = [task]() { (*task)(); };
1535 m_executor->Submit(packagedFunction);
1536 return task->get_future();
1537 }
1538
ListTablesAsync(const ListTablesRequest & request,const ListTablesResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1539 void DynamoDBClient::ListTablesAsync(const ListTablesRequest& request, const ListTablesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1540 {
1541 m_executor->Submit( [this, request, handler, context](){ this->ListTablesAsyncHelper( request, handler, context ); } );
1542 }
1543
ListTablesAsyncHelper(const ListTablesRequest & request,const ListTablesResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1544 void DynamoDBClient::ListTablesAsyncHelper(const ListTablesRequest& request, const ListTablesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1545 {
1546 handler(this, request, ListTables(request), context);
1547 }
1548
ListTagsOfResource(const ListTagsOfResourceRequest & request) const1549 ListTagsOfResourceOutcome DynamoDBClient::ListTagsOfResource(const ListTagsOfResourceRequest& request) const
1550 {
1551 Aws::Http::URI uri = m_uri;
1552 if (m_enableEndpointDiscovery)
1553 {
1554 Aws::String endpointKey = "Shared";
1555 Aws::String endpoint;
1556 if (m_endpointsCache.Get(endpointKey, endpoint))
1557 {
1558 AWS_LOGSTREAM_TRACE("ListTagsOfResource", "Making request to cached endpoint: " << endpoint);
1559 uri = m_configScheme + "://" + endpoint;
1560 }
1561 else
1562 {
1563 AWS_LOGSTREAM_TRACE("ListTagsOfResource", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
1564 DescribeEndpointsRequest endpointRequest;
1565 auto endpointOutcome = DescribeEndpoints(endpointRequest);
1566 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
1567 {
1568 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
1569 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
1570 uri = m_configScheme + "://" + item.GetAddress();
1571 AWS_LOGSTREAM_TRACE("ListTagsOfResource", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
1572 }
1573 else
1574 {
1575 AWS_LOGSTREAM_ERROR("ListTagsOfResource", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
1576 }
1577 }
1578 }
1579 return ListTagsOfResourceOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
1580 }
1581
ListTagsOfResourceCallable(const ListTagsOfResourceRequest & request) const1582 ListTagsOfResourceOutcomeCallable DynamoDBClient::ListTagsOfResourceCallable(const ListTagsOfResourceRequest& request) const
1583 {
1584 auto task = Aws::MakeShared< std::packaged_task< ListTagsOfResourceOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListTagsOfResource(request); } );
1585 auto packagedFunction = [task]() { (*task)(); };
1586 m_executor->Submit(packagedFunction);
1587 return task->get_future();
1588 }
1589
ListTagsOfResourceAsync(const ListTagsOfResourceRequest & request,const ListTagsOfResourceResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1590 void DynamoDBClient::ListTagsOfResourceAsync(const ListTagsOfResourceRequest& request, const ListTagsOfResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1591 {
1592 m_executor->Submit( [this, request, handler, context](){ this->ListTagsOfResourceAsyncHelper( request, handler, context ); } );
1593 }
1594
ListTagsOfResourceAsyncHelper(const ListTagsOfResourceRequest & request,const ListTagsOfResourceResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1595 void DynamoDBClient::ListTagsOfResourceAsyncHelper(const ListTagsOfResourceRequest& request, const ListTagsOfResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1596 {
1597 handler(this, request, ListTagsOfResource(request), context);
1598 }
1599
PutItem(const PutItemRequest & request) const1600 PutItemOutcome DynamoDBClient::PutItem(const PutItemRequest& request) const
1601 {
1602 Aws::Http::URI uri = m_uri;
1603 if (m_enableEndpointDiscovery)
1604 {
1605 Aws::String endpointKey = "Shared";
1606 Aws::String endpoint;
1607 if (m_endpointsCache.Get(endpointKey, endpoint))
1608 {
1609 AWS_LOGSTREAM_TRACE("PutItem", "Making request to cached endpoint: " << endpoint);
1610 uri = m_configScheme + "://" + endpoint;
1611 }
1612 else
1613 {
1614 AWS_LOGSTREAM_TRACE("PutItem", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
1615 DescribeEndpointsRequest endpointRequest;
1616 auto endpointOutcome = DescribeEndpoints(endpointRequest);
1617 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
1618 {
1619 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
1620 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
1621 uri = m_configScheme + "://" + item.GetAddress();
1622 AWS_LOGSTREAM_TRACE("PutItem", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
1623 }
1624 else
1625 {
1626 AWS_LOGSTREAM_ERROR("PutItem", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
1627 }
1628 }
1629 }
1630 return PutItemOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
1631 }
1632
PutItemCallable(const PutItemRequest & request) const1633 PutItemOutcomeCallable DynamoDBClient::PutItemCallable(const PutItemRequest& request) const
1634 {
1635 auto task = Aws::MakeShared< std::packaged_task< PutItemOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutItem(request); } );
1636 auto packagedFunction = [task]() { (*task)(); };
1637 m_executor->Submit(packagedFunction);
1638 return task->get_future();
1639 }
1640
PutItemAsync(const PutItemRequest & request,const PutItemResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1641 void DynamoDBClient::PutItemAsync(const PutItemRequest& request, const PutItemResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1642 {
1643 m_executor->Submit( [this, request, handler, context](){ this->PutItemAsyncHelper( request, handler, context ); } );
1644 }
1645
PutItemAsyncHelper(const PutItemRequest & request,const PutItemResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1646 void DynamoDBClient::PutItemAsyncHelper(const PutItemRequest& request, const PutItemResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1647 {
1648 handler(this, request, PutItem(request), context);
1649 }
1650
Query(const QueryRequest & request) const1651 QueryOutcome DynamoDBClient::Query(const QueryRequest& request) const
1652 {
1653 Aws::Http::URI uri = m_uri;
1654 if (m_enableEndpointDiscovery)
1655 {
1656 Aws::String endpointKey = "Shared";
1657 Aws::String endpoint;
1658 if (m_endpointsCache.Get(endpointKey, endpoint))
1659 {
1660 AWS_LOGSTREAM_TRACE("Query", "Making request to cached endpoint: " << endpoint);
1661 uri = m_configScheme + "://" + endpoint;
1662 }
1663 else
1664 {
1665 AWS_LOGSTREAM_TRACE("Query", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
1666 DescribeEndpointsRequest endpointRequest;
1667 auto endpointOutcome = DescribeEndpoints(endpointRequest);
1668 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
1669 {
1670 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
1671 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
1672 uri = m_configScheme + "://" + item.GetAddress();
1673 AWS_LOGSTREAM_TRACE("Query", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
1674 }
1675 else
1676 {
1677 AWS_LOGSTREAM_ERROR("Query", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
1678 }
1679 }
1680 }
1681 return QueryOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
1682 }
1683
QueryCallable(const QueryRequest & request) const1684 QueryOutcomeCallable DynamoDBClient::QueryCallable(const QueryRequest& request) const
1685 {
1686 auto task = Aws::MakeShared< std::packaged_task< QueryOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->Query(request); } );
1687 auto packagedFunction = [task]() { (*task)(); };
1688 m_executor->Submit(packagedFunction);
1689 return task->get_future();
1690 }
1691
QueryAsync(const QueryRequest & request,const QueryResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1692 void DynamoDBClient::QueryAsync(const QueryRequest& request, const QueryResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1693 {
1694 m_executor->Submit( [this, request, handler, context](){ this->QueryAsyncHelper( request, handler, context ); } );
1695 }
1696
QueryAsyncHelper(const QueryRequest & request,const QueryResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1697 void DynamoDBClient::QueryAsyncHelper(const QueryRequest& request, const QueryResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1698 {
1699 handler(this, request, Query(request), context);
1700 }
1701
RestoreTableFromBackup(const RestoreTableFromBackupRequest & request) const1702 RestoreTableFromBackupOutcome DynamoDBClient::RestoreTableFromBackup(const RestoreTableFromBackupRequest& request) const
1703 {
1704 Aws::Http::URI uri = m_uri;
1705 if (m_enableEndpointDiscovery)
1706 {
1707 Aws::String endpointKey = "Shared";
1708 Aws::String endpoint;
1709 if (m_endpointsCache.Get(endpointKey, endpoint))
1710 {
1711 AWS_LOGSTREAM_TRACE("RestoreTableFromBackup", "Making request to cached endpoint: " << endpoint);
1712 uri = m_configScheme + "://" + endpoint;
1713 }
1714 else
1715 {
1716 AWS_LOGSTREAM_TRACE("RestoreTableFromBackup", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
1717 DescribeEndpointsRequest endpointRequest;
1718 auto endpointOutcome = DescribeEndpoints(endpointRequest);
1719 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
1720 {
1721 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
1722 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
1723 uri = m_configScheme + "://" + item.GetAddress();
1724 AWS_LOGSTREAM_TRACE("RestoreTableFromBackup", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
1725 }
1726 else
1727 {
1728 AWS_LOGSTREAM_ERROR("RestoreTableFromBackup", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
1729 }
1730 }
1731 }
1732 return RestoreTableFromBackupOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
1733 }
1734
RestoreTableFromBackupCallable(const RestoreTableFromBackupRequest & request) const1735 RestoreTableFromBackupOutcomeCallable DynamoDBClient::RestoreTableFromBackupCallable(const RestoreTableFromBackupRequest& request) const
1736 {
1737 auto task = Aws::MakeShared< std::packaged_task< RestoreTableFromBackupOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->RestoreTableFromBackup(request); } );
1738 auto packagedFunction = [task]() { (*task)(); };
1739 m_executor->Submit(packagedFunction);
1740 return task->get_future();
1741 }
1742
RestoreTableFromBackupAsync(const RestoreTableFromBackupRequest & request,const RestoreTableFromBackupResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1743 void DynamoDBClient::RestoreTableFromBackupAsync(const RestoreTableFromBackupRequest& request, const RestoreTableFromBackupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1744 {
1745 m_executor->Submit( [this, request, handler, context](){ this->RestoreTableFromBackupAsyncHelper( request, handler, context ); } );
1746 }
1747
RestoreTableFromBackupAsyncHelper(const RestoreTableFromBackupRequest & request,const RestoreTableFromBackupResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1748 void DynamoDBClient::RestoreTableFromBackupAsyncHelper(const RestoreTableFromBackupRequest& request, const RestoreTableFromBackupResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1749 {
1750 handler(this, request, RestoreTableFromBackup(request), context);
1751 }
1752
RestoreTableToPointInTime(const RestoreTableToPointInTimeRequest & request) const1753 RestoreTableToPointInTimeOutcome DynamoDBClient::RestoreTableToPointInTime(const RestoreTableToPointInTimeRequest& request) const
1754 {
1755 Aws::Http::URI uri = m_uri;
1756 if (m_enableEndpointDiscovery)
1757 {
1758 Aws::String endpointKey = "Shared";
1759 Aws::String endpoint;
1760 if (m_endpointsCache.Get(endpointKey, endpoint))
1761 {
1762 AWS_LOGSTREAM_TRACE("RestoreTableToPointInTime", "Making request to cached endpoint: " << endpoint);
1763 uri = m_configScheme + "://" + endpoint;
1764 }
1765 else
1766 {
1767 AWS_LOGSTREAM_TRACE("RestoreTableToPointInTime", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
1768 DescribeEndpointsRequest endpointRequest;
1769 auto endpointOutcome = DescribeEndpoints(endpointRequest);
1770 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
1771 {
1772 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
1773 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
1774 uri = m_configScheme + "://" + item.GetAddress();
1775 AWS_LOGSTREAM_TRACE("RestoreTableToPointInTime", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
1776 }
1777 else
1778 {
1779 AWS_LOGSTREAM_ERROR("RestoreTableToPointInTime", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
1780 }
1781 }
1782 }
1783 return RestoreTableToPointInTimeOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
1784 }
1785
RestoreTableToPointInTimeCallable(const RestoreTableToPointInTimeRequest & request) const1786 RestoreTableToPointInTimeOutcomeCallable DynamoDBClient::RestoreTableToPointInTimeCallable(const RestoreTableToPointInTimeRequest& request) const
1787 {
1788 auto task = Aws::MakeShared< std::packaged_task< RestoreTableToPointInTimeOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->RestoreTableToPointInTime(request); } );
1789 auto packagedFunction = [task]() { (*task)(); };
1790 m_executor->Submit(packagedFunction);
1791 return task->get_future();
1792 }
1793
RestoreTableToPointInTimeAsync(const RestoreTableToPointInTimeRequest & request,const RestoreTableToPointInTimeResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1794 void DynamoDBClient::RestoreTableToPointInTimeAsync(const RestoreTableToPointInTimeRequest& request, const RestoreTableToPointInTimeResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1795 {
1796 m_executor->Submit( [this, request, handler, context](){ this->RestoreTableToPointInTimeAsyncHelper( request, handler, context ); } );
1797 }
1798
RestoreTableToPointInTimeAsyncHelper(const RestoreTableToPointInTimeRequest & request,const RestoreTableToPointInTimeResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1799 void DynamoDBClient::RestoreTableToPointInTimeAsyncHelper(const RestoreTableToPointInTimeRequest& request, const RestoreTableToPointInTimeResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1800 {
1801 handler(this, request, RestoreTableToPointInTime(request), context);
1802 }
1803
Scan(const ScanRequest & request) const1804 ScanOutcome DynamoDBClient::Scan(const ScanRequest& request) const
1805 {
1806 Aws::Http::URI uri = m_uri;
1807 if (m_enableEndpointDiscovery)
1808 {
1809 Aws::String endpointKey = "Shared";
1810 Aws::String endpoint;
1811 if (m_endpointsCache.Get(endpointKey, endpoint))
1812 {
1813 AWS_LOGSTREAM_TRACE("Scan", "Making request to cached endpoint: " << endpoint);
1814 uri = m_configScheme + "://" + endpoint;
1815 }
1816 else
1817 {
1818 AWS_LOGSTREAM_TRACE("Scan", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
1819 DescribeEndpointsRequest endpointRequest;
1820 auto endpointOutcome = DescribeEndpoints(endpointRequest);
1821 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
1822 {
1823 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
1824 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
1825 uri = m_configScheme + "://" + item.GetAddress();
1826 AWS_LOGSTREAM_TRACE("Scan", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
1827 }
1828 else
1829 {
1830 AWS_LOGSTREAM_ERROR("Scan", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
1831 }
1832 }
1833 }
1834 return ScanOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
1835 }
1836
ScanCallable(const ScanRequest & request) const1837 ScanOutcomeCallable DynamoDBClient::ScanCallable(const ScanRequest& request) const
1838 {
1839 auto task = Aws::MakeShared< std::packaged_task< ScanOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->Scan(request); } );
1840 auto packagedFunction = [task]() { (*task)(); };
1841 m_executor->Submit(packagedFunction);
1842 return task->get_future();
1843 }
1844
ScanAsync(const ScanRequest & request,const ScanResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1845 void DynamoDBClient::ScanAsync(const ScanRequest& request, const ScanResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1846 {
1847 m_executor->Submit( [this, request, handler, context](){ this->ScanAsyncHelper( request, handler, context ); } );
1848 }
1849
ScanAsyncHelper(const ScanRequest & request,const ScanResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1850 void DynamoDBClient::ScanAsyncHelper(const ScanRequest& request, const ScanResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1851 {
1852 handler(this, request, Scan(request), context);
1853 }
1854
TagResource(const TagResourceRequest & request) const1855 TagResourceOutcome DynamoDBClient::TagResource(const TagResourceRequest& request) const
1856 {
1857 Aws::Http::URI uri = m_uri;
1858 if (m_enableEndpointDiscovery)
1859 {
1860 Aws::String endpointKey = "Shared";
1861 Aws::String endpoint;
1862 if (m_endpointsCache.Get(endpointKey, endpoint))
1863 {
1864 AWS_LOGSTREAM_TRACE("TagResource", "Making request to cached endpoint: " << endpoint);
1865 uri = m_configScheme + "://" + endpoint;
1866 }
1867 else
1868 {
1869 AWS_LOGSTREAM_TRACE("TagResource", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
1870 DescribeEndpointsRequest endpointRequest;
1871 auto endpointOutcome = DescribeEndpoints(endpointRequest);
1872 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
1873 {
1874 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
1875 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
1876 uri = m_configScheme + "://" + item.GetAddress();
1877 AWS_LOGSTREAM_TRACE("TagResource", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
1878 }
1879 else
1880 {
1881 AWS_LOGSTREAM_ERROR("TagResource", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
1882 }
1883 }
1884 }
1885 return TagResourceOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
1886 }
1887
TagResourceCallable(const TagResourceRequest & request) const1888 TagResourceOutcomeCallable DynamoDBClient::TagResourceCallable(const TagResourceRequest& request) const
1889 {
1890 auto task = Aws::MakeShared< std::packaged_task< TagResourceOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->TagResource(request); } );
1891 auto packagedFunction = [task]() { (*task)(); };
1892 m_executor->Submit(packagedFunction);
1893 return task->get_future();
1894 }
1895
TagResourceAsync(const TagResourceRequest & request,const TagResourceResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1896 void DynamoDBClient::TagResourceAsync(const TagResourceRequest& request, const TagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1897 {
1898 m_executor->Submit( [this, request, handler, context](){ this->TagResourceAsyncHelper( request, handler, context ); } );
1899 }
1900
TagResourceAsyncHelper(const TagResourceRequest & request,const TagResourceResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1901 void DynamoDBClient::TagResourceAsyncHelper(const TagResourceRequest& request, const TagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1902 {
1903 handler(this, request, TagResource(request), context);
1904 }
1905
TransactGetItems(const TransactGetItemsRequest & request) const1906 TransactGetItemsOutcome DynamoDBClient::TransactGetItems(const TransactGetItemsRequest& request) const
1907 {
1908 Aws::Http::URI uri = m_uri;
1909 if (m_enableEndpointDiscovery)
1910 {
1911 Aws::String endpointKey = "Shared";
1912 Aws::String endpoint;
1913 if (m_endpointsCache.Get(endpointKey, endpoint))
1914 {
1915 AWS_LOGSTREAM_TRACE("TransactGetItems", "Making request to cached endpoint: " << endpoint);
1916 uri = m_configScheme + "://" + endpoint;
1917 }
1918 else
1919 {
1920 AWS_LOGSTREAM_TRACE("TransactGetItems", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
1921 DescribeEndpointsRequest endpointRequest;
1922 auto endpointOutcome = DescribeEndpoints(endpointRequest);
1923 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
1924 {
1925 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
1926 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
1927 uri = m_configScheme + "://" + item.GetAddress();
1928 AWS_LOGSTREAM_TRACE("TransactGetItems", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
1929 }
1930 else
1931 {
1932 AWS_LOGSTREAM_ERROR("TransactGetItems", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
1933 }
1934 }
1935 }
1936 return TransactGetItemsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
1937 }
1938
TransactGetItemsCallable(const TransactGetItemsRequest & request) const1939 TransactGetItemsOutcomeCallable DynamoDBClient::TransactGetItemsCallable(const TransactGetItemsRequest& request) const
1940 {
1941 auto task = Aws::MakeShared< std::packaged_task< TransactGetItemsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->TransactGetItems(request); } );
1942 auto packagedFunction = [task]() { (*task)(); };
1943 m_executor->Submit(packagedFunction);
1944 return task->get_future();
1945 }
1946
TransactGetItemsAsync(const TransactGetItemsRequest & request,const TransactGetItemsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1947 void DynamoDBClient::TransactGetItemsAsync(const TransactGetItemsRequest& request, const TransactGetItemsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1948 {
1949 m_executor->Submit( [this, request, handler, context](){ this->TransactGetItemsAsyncHelper( request, handler, context ); } );
1950 }
1951
TransactGetItemsAsyncHelper(const TransactGetItemsRequest & request,const TransactGetItemsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1952 void DynamoDBClient::TransactGetItemsAsyncHelper(const TransactGetItemsRequest& request, const TransactGetItemsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1953 {
1954 handler(this, request, TransactGetItems(request), context);
1955 }
1956
TransactWriteItems(const TransactWriteItemsRequest & request) const1957 TransactWriteItemsOutcome DynamoDBClient::TransactWriteItems(const TransactWriteItemsRequest& request) const
1958 {
1959 Aws::Http::URI uri = m_uri;
1960 if (m_enableEndpointDiscovery)
1961 {
1962 Aws::String endpointKey = "Shared";
1963 Aws::String endpoint;
1964 if (m_endpointsCache.Get(endpointKey, endpoint))
1965 {
1966 AWS_LOGSTREAM_TRACE("TransactWriteItems", "Making request to cached endpoint: " << endpoint);
1967 uri = m_configScheme + "://" + endpoint;
1968 }
1969 else
1970 {
1971 AWS_LOGSTREAM_TRACE("TransactWriteItems", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
1972 DescribeEndpointsRequest endpointRequest;
1973 auto endpointOutcome = DescribeEndpoints(endpointRequest);
1974 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
1975 {
1976 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
1977 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
1978 uri = m_configScheme + "://" + item.GetAddress();
1979 AWS_LOGSTREAM_TRACE("TransactWriteItems", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
1980 }
1981 else
1982 {
1983 AWS_LOGSTREAM_ERROR("TransactWriteItems", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
1984 }
1985 }
1986 }
1987 return TransactWriteItemsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
1988 }
1989
TransactWriteItemsCallable(const TransactWriteItemsRequest & request) const1990 TransactWriteItemsOutcomeCallable DynamoDBClient::TransactWriteItemsCallable(const TransactWriteItemsRequest& request) const
1991 {
1992 auto task = Aws::MakeShared< std::packaged_task< TransactWriteItemsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->TransactWriteItems(request); } );
1993 auto packagedFunction = [task]() { (*task)(); };
1994 m_executor->Submit(packagedFunction);
1995 return task->get_future();
1996 }
1997
TransactWriteItemsAsync(const TransactWriteItemsRequest & request,const TransactWriteItemsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const1998 void DynamoDBClient::TransactWriteItemsAsync(const TransactWriteItemsRequest& request, const TransactWriteItemsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
1999 {
2000 m_executor->Submit( [this, request, handler, context](){ this->TransactWriteItemsAsyncHelper( request, handler, context ); } );
2001 }
2002
TransactWriteItemsAsyncHelper(const TransactWriteItemsRequest & request,const TransactWriteItemsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const2003 void DynamoDBClient::TransactWriteItemsAsyncHelper(const TransactWriteItemsRequest& request, const TransactWriteItemsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
2004 {
2005 handler(this, request, TransactWriteItems(request), context);
2006 }
2007
UntagResource(const UntagResourceRequest & request) const2008 UntagResourceOutcome DynamoDBClient::UntagResource(const UntagResourceRequest& request) const
2009 {
2010 Aws::Http::URI uri = m_uri;
2011 if (m_enableEndpointDiscovery)
2012 {
2013 Aws::String endpointKey = "Shared";
2014 Aws::String endpoint;
2015 if (m_endpointsCache.Get(endpointKey, endpoint))
2016 {
2017 AWS_LOGSTREAM_TRACE("UntagResource", "Making request to cached endpoint: " << endpoint);
2018 uri = m_configScheme + "://" + endpoint;
2019 }
2020 else
2021 {
2022 AWS_LOGSTREAM_TRACE("UntagResource", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
2023 DescribeEndpointsRequest endpointRequest;
2024 auto endpointOutcome = DescribeEndpoints(endpointRequest);
2025 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
2026 {
2027 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
2028 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
2029 uri = m_configScheme + "://" + item.GetAddress();
2030 AWS_LOGSTREAM_TRACE("UntagResource", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
2031 }
2032 else
2033 {
2034 AWS_LOGSTREAM_ERROR("UntagResource", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
2035 }
2036 }
2037 }
2038 return UntagResourceOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
2039 }
2040
UntagResourceCallable(const UntagResourceRequest & request) const2041 UntagResourceOutcomeCallable DynamoDBClient::UntagResourceCallable(const UntagResourceRequest& request) const
2042 {
2043 auto task = Aws::MakeShared< std::packaged_task< UntagResourceOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->UntagResource(request); } );
2044 auto packagedFunction = [task]() { (*task)(); };
2045 m_executor->Submit(packagedFunction);
2046 return task->get_future();
2047 }
2048
UntagResourceAsync(const UntagResourceRequest & request,const UntagResourceResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const2049 void DynamoDBClient::UntagResourceAsync(const UntagResourceRequest& request, const UntagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
2050 {
2051 m_executor->Submit( [this, request, handler, context](){ this->UntagResourceAsyncHelper( request, handler, context ); } );
2052 }
2053
UntagResourceAsyncHelper(const UntagResourceRequest & request,const UntagResourceResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const2054 void DynamoDBClient::UntagResourceAsyncHelper(const UntagResourceRequest& request, const UntagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
2055 {
2056 handler(this, request, UntagResource(request), context);
2057 }
2058
UpdateContinuousBackups(const UpdateContinuousBackupsRequest & request) const2059 UpdateContinuousBackupsOutcome DynamoDBClient::UpdateContinuousBackups(const UpdateContinuousBackupsRequest& request) const
2060 {
2061 Aws::Http::URI uri = m_uri;
2062 if (m_enableEndpointDiscovery)
2063 {
2064 Aws::String endpointKey = "Shared";
2065 Aws::String endpoint;
2066 if (m_endpointsCache.Get(endpointKey, endpoint))
2067 {
2068 AWS_LOGSTREAM_TRACE("UpdateContinuousBackups", "Making request to cached endpoint: " << endpoint);
2069 uri = m_configScheme + "://" + endpoint;
2070 }
2071 else
2072 {
2073 AWS_LOGSTREAM_TRACE("UpdateContinuousBackups", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
2074 DescribeEndpointsRequest endpointRequest;
2075 auto endpointOutcome = DescribeEndpoints(endpointRequest);
2076 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
2077 {
2078 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
2079 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
2080 uri = m_configScheme + "://" + item.GetAddress();
2081 AWS_LOGSTREAM_TRACE("UpdateContinuousBackups", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
2082 }
2083 else
2084 {
2085 AWS_LOGSTREAM_ERROR("UpdateContinuousBackups", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
2086 }
2087 }
2088 }
2089 return UpdateContinuousBackupsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
2090 }
2091
UpdateContinuousBackupsCallable(const UpdateContinuousBackupsRequest & request) const2092 UpdateContinuousBackupsOutcomeCallable DynamoDBClient::UpdateContinuousBackupsCallable(const UpdateContinuousBackupsRequest& request) const
2093 {
2094 auto task = Aws::MakeShared< std::packaged_task< UpdateContinuousBackupsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->UpdateContinuousBackups(request); } );
2095 auto packagedFunction = [task]() { (*task)(); };
2096 m_executor->Submit(packagedFunction);
2097 return task->get_future();
2098 }
2099
UpdateContinuousBackupsAsync(const UpdateContinuousBackupsRequest & request,const UpdateContinuousBackupsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const2100 void DynamoDBClient::UpdateContinuousBackupsAsync(const UpdateContinuousBackupsRequest& request, const UpdateContinuousBackupsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
2101 {
2102 m_executor->Submit( [this, request, handler, context](){ this->UpdateContinuousBackupsAsyncHelper( request, handler, context ); } );
2103 }
2104
UpdateContinuousBackupsAsyncHelper(const UpdateContinuousBackupsRequest & request,const UpdateContinuousBackupsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const2105 void DynamoDBClient::UpdateContinuousBackupsAsyncHelper(const UpdateContinuousBackupsRequest& request, const UpdateContinuousBackupsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
2106 {
2107 handler(this, request, UpdateContinuousBackups(request), context);
2108 }
2109
UpdateContributorInsights(const UpdateContributorInsightsRequest & request) const2110 UpdateContributorInsightsOutcome DynamoDBClient::UpdateContributorInsights(const UpdateContributorInsightsRequest& request) const
2111 {
2112 Aws::Http::URI uri = m_uri;
2113 return UpdateContributorInsightsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
2114 }
2115
UpdateContributorInsightsCallable(const UpdateContributorInsightsRequest & request) const2116 UpdateContributorInsightsOutcomeCallable DynamoDBClient::UpdateContributorInsightsCallable(const UpdateContributorInsightsRequest& request) const
2117 {
2118 auto task = Aws::MakeShared< std::packaged_task< UpdateContributorInsightsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->UpdateContributorInsights(request); } );
2119 auto packagedFunction = [task]() { (*task)(); };
2120 m_executor->Submit(packagedFunction);
2121 return task->get_future();
2122 }
2123
UpdateContributorInsightsAsync(const UpdateContributorInsightsRequest & request,const UpdateContributorInsightsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const2124 void DynamoDBClient::UpdateContributorInsightsAsync(const UpdateContributorInsightsRequest& request, const UpdateContributorInsightsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
2125 {
2126 m_executor->Submit( [this, request, handler, context](){ this->UpdateContributorInsightsAsyncHelper( request, handler, context ); } );
2127 }
2128
UpdateContributorInsightsAsyncHelper(const UpdateContributorInsightsRequest & request,const UpdateContributorInsightsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const2129 void DynamoDBClient::UpdateContributorInsightsAsyncHelper(const UpdateContributorInsightsRequest& request, const UpdateContributorInsightsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
2130 {
2131 handler(this, request, UpdateContributorInsights(request), context);
2132 }
2133
UpdateGlobalTable(const UpdateGlobalTableRequest & request) const2134 UpdateGlobalTableOutcome DynamoDBClient::UpdateGlobalTable(const UpdateGlobalTableRequest& request) const
2135 {
2136 Aws::Http::URI uri = m_uri;
2137 if (m_enableEndpointDiscovery)
2138 {
2139 Aws::String endpointKey = "Shared";
2140 Aws::String endpoint;
2141 if (m_endpointsCache.Get(endpointKey, endpoint))
2142 {
2143 AWS_LOGSTREAM_TRACE("UpdateGlobalTable", "Making request to cached endpoint: " << endpoint);
2144 uri = m_configScheme + "://" + endpoint;
2145 }
2146 else
2147 {
2148 AWS_LOGSTREAM_TRACE("UpdateGlobalTable", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
2149 DescribeEndpointsRequest endpointRequest;
2150 auto endpointOutcome = DescribeEndpoints(endpointRequest);
2151 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
2152 {
2153 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
2154 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
2155 uri = m_configScheme + "://" + item.GetAddress();
2156 AWS_LOGSTREAM_TRACE("UpdateGlobalTable", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
2157 }
2158 else
2159 {
2160 AWS_LOGSTREAM_ERROR("UpdateGlobalTable", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
2161 }
2162 }
2163 }
2164 return UpdateGlobalTableOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
2165 }
2166
UpdateGlobalTableCallable(const UpdateGlobalTableRequest & request) const2167 UpdateGlobalTableOutcomeCallable DynamoDBClient::UpdateGlobalTableCallable(const UpdateGlobalTableRequest& request) const
2168 {
2169 auto task = Aws::MakeShared< std::packaged_task< UpdateGlobalTableOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->UpdateGlobalTable(request); } );
2170 auto packagedFunction = [task]() { (*task)(); };
2171 m_executor->Submit(packagedFunction);
2172 return task->get_future();
2173 }
2174
UpdateGlobalTableAsync(const UpdateGlobalTableRequest & request,const UpdateGlobalTableResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const2175 void DynamoDBClient::UpdateGlobalTableAsync(const UpdateGlobalTableRequest& request, const UpdateGlobalTableResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
2176 {
2177 m_executor->Submit( [this, request, handler, context](){ this->UpdateGlobalTableAsyncHelper( request, handler, context ); } );
2178 }
2179
UpdateGlobalTableAsyncHelper(const UpdateGlobalTableRequest & request,const UpdateGlobalTableResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const2180 void DynamoDBClient::UpdateGlobalTableAsyncHelper(const UpdateGlobalTableRequest& request, const UpdateGlobalTableResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
2181 {
2182 handler(this, request, UpdateGlobalTable(request), context);
2183 }
2184
UpdateGlobalTableSettings(const UpdateGlobalTableSettingsRequest & request) const2185 UpdateGlobalTableSettingsOutcome DynamoDBClient::UpdateGlobalTableSettings(const UpdateGlobalTableSettingsRequest& request) const
2186 {
2187 Aws::Http::URI uri = m_uri;
2188 if (m_enableEndpointDiscovery)
2189 {
2190 Aws::String endpointKey = "Shared";
2191 Aws::String endpoint;
2192 if (m_endpointsCache.Get(endpointKey, endpoint))
2193 {
2194 AWS_LOGSTREAM_TRACE("UpdateGlobalTableSettings", "Making request to cached endpoint: " << endpoint);
2195 uri = m_configScheme + "://" + endpoint;
2196 }
2197 else
2198 {
2199 AWS_LOGSTREAM_TRACE("UpdateGlobalTableSettings", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
2200 DescribeEndpointsRequest endpointRequest;
2201 auto endpointOutcome = DescribeEndpoints(endpointRequest);
2202 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
2203 {
2204 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
2205 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
2206 uri = m_configScheme + "://" + item.GetAddress();
2207 AWS_LOGSTREAM_TRACE("UpdateGlobalTableSettings", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
2208 }
2209 else
2210 {
2211 AWS_LOGSTREAM_ERROR("UpdateGlobalTableSettings", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
2212 }
2213 }
2214 }
2215 return UpdateGlobalTableSettingsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
2216 }
2217
UpdateGlobalTableSettingsCallable(const UpdateGlobalTableSettingsRequest & request) const2218 UpdateGlobalTableSettingsOutcomeCallable DynamoDBClient::UpdateGlobalTableSettingsCallable(const UpdateGlobalTableSettingsRequest& request) const
2219 {
2220 auto task = Aws::MakeShared< std::packaged_task< UpdateGlobalTableSettingsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->UpdateGlobalTableSettings(request); } );
2221 auto packagedFunction = [task]() { (*task)(); };
2222 m_executor->Submit(packagedFunction);
2223 return task->get_future();
2224 }
2225
UpdateGlobalTableSettingsAsync(const UpdateGlobalTableSettingsRequest & request,const UpdateGlobalTableSettingsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const2226 void DynamoDBClient::UpdateGlobalTableSettingsAsync(const UpdateGlobalTableSettingsRequest& request, const UpdateGlobalTableSettingsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
2227 {
2228 m_executor->Submit( [this, request, handler, context](){ this->UpdateGlobalTableSettingsAsyncHelper( request, handler, context ); } );
2229 }
2230
UpdateGlobalTableSettingsAsyncHelper(const UpdateGlobalTableSettingsRequest & request,const UpdateGlobalTableSettingsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const2231 void DynamoDBClient::UpdateGlobalTableSettingsAsyncHelper(const UpdateGlobalTableSettingsRequest& request, const UpdateGlobalTableSettingsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
2232 {
2233 handler(this, request, UpdateGlobalTableSettings(request), context);
2234 }
2235
UpdateItem(const UpdateItemRequest & request) const2236 UpdateItemOutcome DynamoDBClient::UpdateItem(const UpdateItemRequest& request) const
2237 {
2238 Aws::Http::URI uri = m_uri;
2239 if (m_enableEndpointDiscovery)
2240 {
2241 Aws::String endpointKey = "Shared";
2242 Aws::String endpoint;
2243 if (m_endpointsCache.Get(endpointKey, endpoint))
2244 {
2245 AWS_LOGSTREAM_TRACE("UpdateItem", "Making request to cached endpoint: " << endpoint);
2246 uri = m_configScheme + "://" + endpoint;
2247 }
2248 else
2249 {
2250 AWS_LOGSTREAM_TRACE("UpdateItem", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
2251 DescribeEndpointsRequest endpointRequest;
2252 auto endpointOutcome = DescribeEndpoints(endpointRequest);
2253 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
2254 {
2255 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
2256 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
2257 uri = m_configScheme + "://" + item.GetAddress();
2258 AWS_LOGSTREAM_TRACE("UpdateItem", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
2259 }
2260 else
2261 {
2262 AWS_LOGSTREAM_ERROR("UpdateItem", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
2263 }
2264 }
2265 }
2266 return UpdateItemOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
2267 }
2268
UpdateItemCallable(const UpdateItemRequest & request) const2269 UpdateItemOutcomeCallable DynamoDBClient::UpdateItemCallable(const UpdateItemRequest& request) const
2270 {
2271 auto task = Aws::MakeShared< std::packaged_task< UpdateItemOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->UpdateItem(request); } );
2272 auto packagedFunction = [task]() { (*task)(); };
2273 m_executor->Submit(packagedFunction);
2274 return task->get_future();
2275 }
2276
UpdateItemAsync(const UpdateItemRequest & request,const UpdateItemResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const2277 void DynamoDBClient::UpdateItemAsync(const UpdateItemRequest& request, const UpdateItemResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
2278 {
2279 m_executor->Submit( [this, request, handler, context](){ this->UpdateItemAsyncHelper( request, handler, context ); } );
2280 }
2281
UpdateItemAsyncHelper(const UpdateItemRequest & request,const UpdateItemResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const2282 void DynamoDBClient::UpdateItemAsyncHelper(const UpdateItemRequest& request, const UpdateItemResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
2283 {
2284 handler(this, request, UpdateItem(request), context);
2285 }
2286
UpdateTable(const UpdateTableRequest & request) const2287 UpdateTableOutcome DynamoDBClient::UpdateTable(const UpdateTableRequest& request) const
2288 {
2289 Aws::Http::URI uri = m_uri;
2290 if (m_enableEndpointDiscovery)
2291 {
2292 Aws::String endpointKey = "Shared";
2293 Aws::String endpoint;
2294 if (m_endpointsCache.Get(endpointKey, endpoint))
2295 {
2296 AWS_LOGSTREAM_TRACE("UpdateTable", "Making request to cached endpoint: " << endpoint);
2297 uri = m_configScheme + "://" + endpoint;
2298 }
2299 else
2300 {
2301 AWS_LOGSTREAM_TRACE("UpdateTable", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
2302 DescribeEndpointsRequest endpointRequest;
2303 auto endpointOutcome = DescribeEndpoints(endpointRequest);
2304 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
2305 {
2306 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
2307 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
2308 uri = m_configScheme + "://" + item.GetAddress();
2309 AWS_LOGSTREAM_TRACE("UpdateTable", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
2310 }
2311 else
2312 {
2313 AWS_LOGSTREAM_ERROR("UpdateTable", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
2314 }
2315 }
2316 }
2317 return UpdateTableOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
2318 }
2319
UpdateTableCallable(const UpdateTableRequest & request) const2320 UpdateTableOutcomeCallable DynamoDBClient::UpdateTableCallable(const UpdateTableRequest& request) const
2321 {
2322 auto task = Aws::MakeShared< std::packaged_task< UpdateTableOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->UpdateTable(request); } );
2323 auto packagedFunction = [task]() { (*task)(); };
2324 m_executor->Submit(packagedFunction);
2325 return task->get_future();
2326 }
2327
UpdateTableAsync(const UpdateTableRequest & request,const UpdateTableResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const2328 void DynamoDBClient::UpdateTableAsync(const UpdateTableRequest& request, const UpdateTableResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
2329 {
2330 m_executor->Submit( [this, request, handler, context](){ this->UpdateTableAsyncHelper( request, handler, context ); } );
2331 }
2332
UpdateTableAsyncHelper(const UpdateTableRequest & request,const UpdateTableResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const2333 void DynamoDBClient::UpdateTableAsyncHelper(const UpdateTableRequest& request, const UpdateTableResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
2334 {
2335 handler(this, request, UpdateTable(request), context);
2336 }
2337
UpdateTableReplicaAutoScaling(const UpdateTableReplicaAutoScalingRequest & request) const2338 UpdateTableReplicaAutoScalingOutcome DynamoDBClient::UpdateTableReplicaAutoScaling(const UpdateTableReplicaAutoScalingRequest& request) const
2339 {
2340 Aws::Http::URI uri = m_uri;
2341 return UpdateTableReplicaAutoScalingOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
2342 }
2343
UpdateTableReplicaAutoScalingCallable(const UpdateTableReplicaAutoScalingRequest & request) const2344 UpdateTableReplicaAutoScalingOutcomeCallable DynamoDBClient::UpdateTableReplicaAutoScalingCallable(const UpdateTableReplicaAutoScalingRequest& request) const
2345 {
2346 auto task = Aws::MakeShared< std::packaged_task< UpdateTableReplicaAutoScalingOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->UpdateTableReplicaAutoScaling(request); } );
2347 auto packagedFunction = [task]() { (*task)(); };
2348 m_executor->Submit(packagedFunction);
2349 return task->get_future();
2350 }
2351
UpdateTableReplicaAutoScalingAsync(const UpdateTableReplicaAutoScalingRequest & request,const UpdateTableReplicaAutoScalingResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const2352 void DynamoDBClient::UpdateTableReplicaAutoScalingAsync(const UpdateTableReplicaAutoScalingRequest& request, const UpdateTableReplicaAutoScalingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
2353 {
2354 m_executor->Submit( [this, request, handler, context](){ this->UpdateTableReplicaAutoScalingAsyncHelper( request, handler, context ); } );
2355 }
2356
UpdateTableReplicaAutoScalingAsyncHelper(const UpdateTableReplicaAutoScalingRequest & request,const UpdateTableReplicaAutoScalingResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const2357 void DynamoDBClient::UpdateTableReplicaAutoScalingAsyncHelper(const UpdateTableReplicaAutoScalingRequest& request, const UpdateTableReplicaAutoScalingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
2358 {
2359 handler(this, request, UpdateTableReplicaAutoScaling(request), context);
2360 }
2361
UpdateTimeToLive(const UpdateTimeToLiveRequest & request) const2362 UpdateTimeToLiveOutcome DynamoDBClient::UpdateTimeToLive(const UpdateTimeToLiveRequest& request) const
2363 {
2364 Aws::Http::URI uri = m_uri;
2365 if (m_enableEndpointDiscovery)
2366 {
2367 Aws::String endpointKey = "Shared";
2368 Aws::String endpoint;
2369 if (m_endpointsCache.Get(endpointKey, endpoint))
2370 {
2371 AWS_LOGSTREAM_TRACE("UpdateTimeToLive", "Making request to cached endpoint: " << endpoint);
2372 uri = m_configScheme + "://" + endpoint;
2373 }
2374 else
2375 {
2376 AWS_LOGSTREAM_TRACE("UpdateTimeToLive", "Endpoint discovery is enabled and there is no usable endpoint in cache. Discovering endpoints from service...");
2377 DescribeEndpointsRequest endpointRequest;
2378 auto endpointOutcome = DescribeEndpoints(endpointRequest);
2379 if (endpointOutcome.IsSuccess() && !endpointOutcome.GetResult().GetEndpoints().empty())
2380 {
2381 const auto& item = endpointOutcome.GetResult().GetEndpoints()[0];
2382 m_endpointsCache.Put(endpointKey, item.GetAddress(), std::chrono::minutes(item.GetCachePeriodInMinutes()));
2383 uri = m_configScheme + "://" + item.GetAddress();
2384 AWS_LOGSTREAM_TRACE("UpdateTimeToLive", "Endpoints cache updated. Address: " << item.GetAddress() << ". Valid in: " << item.GetCachePeriodInMinutes() << " minutes. Making request to newly discovered endpoint.");
2385 }
2386 else
2387 {
2388 AWS_LOGSTREAM_ERROR("UpdateTimeToLive", "Failed to discover endpoints " << endpointOutcome.GetError() << "\n Endpoint discovery is not required for this operation, falling back to the regional endpoint.");
2389 }
2390 }
2391 }
2392 return UpdateTimeToLiveOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
2393 }
2394
UpdateTimeToLiveCallable(const UpdateTimeToLiveRequest & request) const2395 UpdateTimeToLiveOutcomeCallable DynamoDBClient::UpdateTimeToLiveCallable(const UpdateTimeToLiveRequest& request) const
2396 {
2397 auto task = Aws::MakeShared< std::packaged_task< UpdateTimeToLiveOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->UpdateTimeToLive(request); } );
2398 auto packagedFunction = [task]() { (*task)(); };
2399 m_executor->Submit(packagedFunction);
2400 return task->get_future();
2401 }
2402
UpdateTimeToLiveAsync(const UpdateTimeToLiveRequest & request,const UpdateTimeToLiveResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const2403 void DynamoDBClient::UpdateTimeToLiveAsync(const UpdateTimeToLiveRequest& request, const UpdateTimeToLiveResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
2404 {
2405 m_executor->Submit( [this, request, handler, context](){ this->UpdateTimeToLiveAsyncHelper( request, handler, context ); } );
2406 }
2407
UpdateTimeToLiveAsyncHelper(const UpdateTimeToLiveRequest & request,const UpdateTimeToLiveResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const2408 void DynamoDBClient::UpdateTimeToLiveAsyncHelper(const UpdateTimeToLiveRequest& request, const UpdateTimeToLiveResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
2409 {
2410 handler(this, request, UpdateTimeToLive(request), context);
2411 }
2412
2413