/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include namespace Aws { namespace DynamoDBStreams { /** * Amazon DynamoDB

Amazon DynamoDB Streams provides API * actions for accessing streams and processing stream records. To learn more about * application development with Streams, see Capturing * Table Activity with DynamoDB Streams in the Amazon DynamoDB Developer * Guide.

*/ class AWS_DYNAMODBSTREAMS_API DynamoDBStreamsClient : public Aws::Client::AWSJsonClient, public Aws::Client::ClientWithAsyncTemplateMethods { public: typedef Aws::Client::AWSJsonClient BASECLASS; static const char* SERVICE_NAME; static const char* ALLOCATION_TAG; typedef DynamoDBStreamsClientConfiguration ClientConfigurationType; typedef DynamoDBStreamsEndpointProvider EndpointProviderType; /** * Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ DynamoDBStreamsClient(const Aws::DynamoDBStreams::DynamoDBStreamsClientConfiguration& clientConfiguration = Aws::DynamoDBStreams::DynamoDBStreamsClientConfiguration(), std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG)); /** * Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ DynamoDBStreamsClient(const Aws::Auth::AWSCredentials& credentials, std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG), const Aws::DynamoDBStreams::DynamoDBStreamsClientConfiguration& clientConfiguration = Aws::DynamoDBStreams::DynamoDBStreamsClientConfiguration()); /** * Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied, * the default http client factory will be used */ DynamoDBStreamsClient(const std::shared_ptr& credentialsProvider, std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG), const Aws::DynamoDBStreams::DynamoDBStreamsClientConfiguration& clientConfiguration = Aws::DynamoDBStreams::DynamoDBStreamsClientConfiguration()); /* Legacy constructors due deprecation */ /** * Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ DynamoDBStreamsClient(const Aws::Client::ClientConfiguration& clientConfiguration); /** * Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ DynamoDBStreamsClient(const Aws::Auth::AWSCredentials& credentials, const Aws::Client::ClientConfiguration& clientConfiguration); /** * Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied, * the default http client factory will be used */ DynamoDBStreamsClient(const std::shared_ptr& credentialsProvider, const Aws::Client::ClientConfiguration& clientConfiguration); /* End of legacy constructors due deprecation */ virtual ~DynamoDBStreamsClient(); /** *

Returns information about a stream, including the current status of the * stream, its Amazon Resource Name (ARN), the composition of its shards, and its * corresponding DynamoDB table.

You can call * DescribeStream at a maximum rate of 10 times per second.

*

Each shard in the stream has a SequenceNumberRange * associated with it. If the SequenceNumberRange has a * StartingSequenceNumber but no EndingSequenceNumber, * then the shard is still open (able to receive more stream records). If both * StartingSequenceNumber and EndingSequenceNumber are * present, then that shard is closed and can no longer receive more * data.

See Also:

AWS * API Reference

*/ virtual Model::DescribeStreamOutcome DescribeStream(const Model::DescribeStreamRequest& request) const; /** * A Callable wrapper for DescribeStream that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::DescribeStreamOutcomeCallable DescribeStreamCallable(const DescribeStreamRequestT& request) const { return SubmitCallable(&DynamoDBStreamsClient::DescribeStream, request); } /** * An Async wrapper for DescribeStream that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void DescribeStreamAsync(const DescribeStreamRequestT& request, const DescribeStreamResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&DynamoDBStreamsClient::DescribeStream, request, handler, context); } /** *

Retrieves the stream records from a given shard.

Specify a shard * iterator using the ShardIterator parameter. The shard iterator * specifies the position in the shard from which you want to start reading stream * records sequentially. If there are no stream records available in the portion of * the shard that the iterator points to, GetRecords returns an empty * list. Note that it might take multiple calls to get to a portion of the shard * that contains stream records.

GetRecords can * retrieve a maximum of 1 MB of data or 1000 stream records, whichever comes * first.

See Also:

AWS * API Reference

*/ virtual Model::GetRecordsOutcome GetRecords(const Model::GetRecordsRequest& request) const; /** * A Callable wrapper for GetRecords that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::GetRecordsOutcomeCallable GetRecordsCallable(const GetRecordsRequestT& request) const { return SubmitCallable(&DynamoDBStreamsClient::GetRecords, request); } /** * An Async wrapper for GetRecords that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void GetRecordsAsync(const GetRecordsRequestT& request, const GetRecordsResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&DynamoDBStreamsClient::GetRecords, request, handler, context); } /** *

Returns a shard iterator. A shard iterator provides information about how to * retrieve the stream records from within a shard. Use the shard iterator in a * subsequent GetRecords request to read the stream records from the * shard.

A shard iterator expires 15 minutes after it is returned to * the requester.

See Also:

AWS * API Reference

*/ virtual Model::GetShardIteratorOutcome GetShardIterator(const Model::GetShardIteratorRequest& request) const; /** * A Callable wrapper for GetShardIterator that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::GetShardIteratorOutcomeCallable GetShardIteratorCallable(const GetShardIteratorRequestT& request) const { return SubmitCallable(&DynamoDBStreamsClient::GetShardIterator, request); } /** * An Async wrapper for GetShardIterator that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void GetShardIteratorAsync(const GetShardIteratorRequestT& request, const GetShardIteratorResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&DynamoDBStreamsClient::GetShardIterator, request, handler, context); } /** *

Returns an array of stream ARNs associated with the current account and * endpoint. If the TableName parameter is present, then * ListStreams will return only the streams ARNs for that table.

*

You can call ListStreams at a maximum rate of 5 times per * second.

See Also:

AWS * API Reference

*/ virtual Model::ListStreamsOutcome ListStreams(const Model::ListStreamsRequest& request) const; /** * A Callable wrapper for ListStreams that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::ListStreamsOutcomeCallable ListStreamsCallable(const ListStreamsRequestT& request) const { return SubmitCallable(&DynamoDBStreamsClient::ListStreams, request); } /** * An Async wrapper for ListStreams that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void ListStreamsAsync(const ListStreamsRequestT& request, const ListStreamsResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&DynamoDBStreamsClient::ListStreams, request, handler, context); } void OverrideEndpoint(const Aws::String& endpoint); std::shared_ptr& accessEndpointProvider(); private: friend class Aws::Client::ClientWithAsyncTemplateMethods; void init(const DynamoDBStreamsClientConfiguration& clientConfiguration); DynamoDBStreamsClientConfiguration m_clientConfiguration; std::shared_ptr m_executor; std::shared_ptr m_endpointProvider; }; } // namespace DynamoDBStreams } // namespace Aws