/** * 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 QLDBSession { /** *

The transactional data APIs for Amazon QLDB

Instead of * interacting directly with this API, we recommend using the QLDB driver or the * QLDB shell to execute data transactions on a ledger.

  • If you are * working with an AWS SDK, use the QLDB driver. The driver provides a high-level * abstraction layer above this QLDB Session data plane and manages * SendCommand API calls for you. For information and a list of * supported programming languages, see Getting * started with the driver in the Amazon QLDB Developer Guide.

  • *
  • If you are working with the AWS Command Line Interface (AWS CLI), use * the QLDB shell. The shell is a command line interface that uses the QLDB driver * to interact with a ledger. For information, see Accessing * Amazon QLDB using the QLDB shell.

*/ class AWS_QLDBSESSION_API QLDBSessionClient : 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 QLDBSessionClientConfiguration ClientConfigurationType; typedef QLDBSessionEndpointProvider 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. */ QLDBSessionClient(const Aws::QLDBSession::QLDBSessionClientConfiguration& clientConfiguration = Aws::QLDBSession::QLDBSessionClientConfiguration(), 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. */ QLDBSessionClient(const Aws::Auth::AWSCredentials& credentials, std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG), const Aws::QLDBSession::QLDBSessionClientConfiguration& clientConfiguration = Aws::QLDBSession::QLDBSessionClientConfiguration()); /** * 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 */ QLDBSessionClient(const std::shared_ptr& credentialsProvider, std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG), const Aws::QLDBSession::QLDBSessionClientConfiguration& clientConfiguration = Aws::QLDBSession::QLDBSessionClientConfiguration()); /* 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. */ QLDBSessionClient(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. */ QLDBSessionClient(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 */ QLDBSessionClient(const std::shared_ptr& credentialsProvider, const Aws::Client::ClientConfiguration& clientConfiguration); /* End of legacy constructors due deprecation */ virtual ~QLDBSessionClient(); /** *

Sends a command to an Amazon QLDB ledger.

Instead of * interacting directly with this API, we recommend using the QLDB driver or the * QLDB shell to execute data transactions on a ledger.

  • If you are * working with an AWS SDK, use the QLDB driver. The driver provides a high-level * abstraction layer above this QLDB Session data plane and manages * SendCommand API calls for you. For information and a list of * supported programming languages, see Getting * started with the driver in the Amazon QLDB Developer Guide.

  • *
  • If you are working with the AWS Command Line Interface (AWS CLI), use * the QLDB shell. The shell is a command line interface that uses the QLDB driver * to interact with a ledger. For information, see Accessing * Amazon QLDB using the QLDB shell.

See * Also:

AWS * API Reference

*/ virtual Model::SendCommandOutcome SendCommand(const Model::SendCommandRequest& request) const; /** * A Callable wrapper for SendCommand that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::SendCommandOutcomeCallable SendCommandCallable(const SendCommandRequestT& request) const { return SubmitCallable(&QLDBSessionClient::SendCommand, request); } /** * An Async wrapper for SendCommand that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void SendCommandAsync(const SendCommandRequestT& request, const SendCommandResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&QLDBSessionClient::SendCommand, request, handler, context); } void OverrideEndpoint(const Aws::String& endpoint); std::shared_ptr& accessEndpointProvider(); private: friend class Aws::Client::ClientWithAsyncTemplateMethods; void init(const QLDBSessionClientConfiguration& clientConfiguration); QLDBSessionClientConfiguration m_clientConfiguration; std::shared_ptr m_executor; std::shared_ptr m_endpointProvider; }; } // namespace QLDBSession } // namespace Aws