/**
* 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 ManagedBlockchainQuery
{
/**
* Amazon Managed Blockchain (AMB) Query provides you with convenient access to
* multi-blockchain network data, which makes it easier for you to extract
* contextual data related to blockchain activity. You can use AMB Query to read
* data from public blockchain networks, such as Bitcoin Mainnet and Ethereum
* Mainnet. You can also get information such as the current and historical
* balances of addresses, or you can get a list of blockchain transactions for a
* given time period. Additionally, you can get details of a given transaction,
* such as transaction events, which you can further analyze or use in business
* logic for your applications.
*/
class AWS_MANAGEDBLOCKCHAINQUERY_API ManagedBlockchainQueryClient : 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 ManagedBlockchainQueryClientConfiguration ClientConfigurationType;
typedef ManagedBlockchainQueryEndpointProvider 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.
*/
ManagedBlockchainQueryClient(const Aws::ManagedBlockchainQuery::ManagedBlockchainQueryClientConfiguration& clientConfiguration = Aws::ManagedBlockchainQuery::ManagedBlockchainQueryClientConfiguration(),
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.
*/
ManagedBlockchainQueryClient(const Aws::Auth::AWSCredentials& credentials,
std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG),
const Aws::ManagedBlockchainQuery::ManagedBlockchainQueryClientConfiguration& clientConfiguration = Aws::ManagedBlockchainQuery::ManagedBlockchainQueryClientConfiguration());
/**
* 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
*/
ManagedBlockchainQueryClient(const std::shared_ptr& credentialsProvider,
std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG),
const Aws::ManagedBlockchainQuery::ManagedBlockchainQueryClientConfiguration& clientConfiguration = Aws::ManagedBlockchainQuery::ManagedBlockchainQueryClientConfiguration());
/* 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.
*/
ManagedBlockchainQueryClient(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.
*/
ManagedBlockchainQueryClient(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
*/
ManagedBlockchainQueryClient(const std::shared_ptr& credentialsProvider,
const Aws::Client::ClientConfiguration& clientConfiguration);
/* End of legacy constructors due deprecation */
virtual ~ManagedBlockchainQueryClient();
/**
* Gets the token balance for a batch of tokens by using the
* GetTokenBalance
action for every token in the request.
* Only the native tokens BTC,ETH, and the ERC-20, ERC-721, and ERC 1155 token
* standards are supported.
See Also:
AWS
* API Reference
*/
virtual Model::BatchGetTokenBalanceOutcome BatchGetTokenBalance(const Model::BatchGetTokenBalanceRequest& request) const;
/**
* A Callable wrapper for BatchGetTokenBalance that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::BatchGetTokenBalanceOutcomeCallable BatchGetTokenBalanceCallable(const BatchGetTokenBalanceRequestT& request) const
{
return SubmitCallable(&ManagedBlockchainQueryClient::BatchGetTokenBalance, request);
}
/**
* An Async wrapper for BatchGetTokenBalance that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void BatchGetTokenBalanceAsync(const BatchGetTokenBalanceRequestT& request, const BatchGetTokenBalanceResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&ManagedBlockchainQueryClient::BatchGetTokenBalance, request, handler, context);
}
/**
* Gets the balance of a specific token, including native tokens, for a given
* address (wallet or contract) on the blockchain.
Only the native
* tokens BTC,ETH, and the ERC-20, ERC-721, and ERC 1155 token standards are
* supported.
See Also:
AWS
* API Reference
*/
virtual Model::GetTokenBalanceOutcome GetTokenBalance(const Model::GetTokenBalanceRequest& request) const;
/**
* A Callable wrapper for GetTokenBalance that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::GetTokenBalanceOutcomeCallable GetTokenBalanceCallable(const GetTokenBalanceRequestT& request) const
{
return SubmitCallable(&ManagedBlockchainQueryClient::GetTokenBalance, request);
}
/**
* An Async wrapper for GetTokenBalance that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void GetTokenBalanceAsync(const GetTokenBalanceRequestT& request, const GetTokenBalanceResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&ManagedBlockchainQueryClient::GetTokenBalance, request, handler, context);
}
/**
* Get the details of a transaction.
See Also:
AWS
* API Reference
*/
virtual Model::GetTransactionOutcome GetTransaction(const Model::GetTransactionRequest& request) const;
/**
* A Callable wrapper for GetTransaction that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::GetTransactionOutcomeCallable GetTransactionCallable(const GetTransactionRequestT& request) const
{
return SubmitCallable(&ManagedBlockchainQueryClient::GetTransaction, request);
}
/**
* An Async wrapper for GetTransaction that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void GetTransactionAsync(const GetTransactionRequestT& request, const GetTransactionResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&ManagedBlockchainQueryClient::GetTransaction, request, handler, context);
}
/**
* This action returns the following for a given a blockchain network:
* -
Lists all token balances owned by an address (either a contact address
* or a wallet address).
-
Lists all token balances for all tokens
* created by a contract.
-
Lists all token balances for a given
* token.
You must always specify the network property of
* the tokenFilter
when using this operation.
See
* Also:
AWS
* API Reference
*/
virtual Model::ListTokenBalancesOutcome ListTokenBalances(const Model::ListTokenBalancesRequest& request) const;
/**
* A Callable wrapper for ListTokenBalances that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::ListTokenBalancesOutcomeCallable ListTokenBalancesCallable(const ListTokenBalancesRequestT& request) const
{
return SubmitCallable(&ManagedBlockchainQueryClient::ListTokenBalances, request);
}
/**
* An Async wrapper for ListTokenBalances that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void ListTokenBalancesAsync(const ListTokenBalancesRequestT& request, const ListTokenBalancesResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&ManagedBlockchainQueryClient::ListTokenBalances, request, handler, context);
}
/**
* An array of TransactionEvent
objects. Each object contains
* details about the transaction event.
See Also:
AWS
* API Reference
*/
virtual Model::ListTransactionEventsOutcome ListTransactionEvents(const Model::ListTransactionEventsRequest& request) const;
/**
* A Callable wrapper for ListTransactionEvents that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::ListTransactionEventsOutcomeCallable ListTransactionEventsCallable(const ListTransactionEventsRequestT& request) const
{
return SubmitCallable(&ManagedBlockchainQueryClient::ListTransactionEvents, request);
}
/**
* An Async wrapper for ListTransactionEvents that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void ListTransactionEventsAsync(const ListTransactionEventsRequestT& request, const ListTransactionEventsResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&ManagedBlockchainQueryClient::ListTransactionEvents, request, handler, context);
}
/**
* Lists all of the transactions on a given wallet address or to a specific
* contract.
See Also:
AWS
* API Reference
*/
virtual Model::ListTransactionsOutcome ListTransactions(const Model::ListTransactionsRequest& request) const;
/**
* A Callable wrapper for ListTransactions that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::ListTransactionsOutcomeCallable ListTransactionsCallable(const ListTransactionsRequestT& request) const
{
return SubmitCallable(&ManagedBlockchainQueryClient::ListTransactions, request);
}
/**
* An Async wrapper for ListTransactions that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void ListTransactionsAsync(const ListTransactionsRequestT& request, const ListTransactionsResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&ManagedBlockchainQueryClient::ListTransactions, request, handler, context);
}
void OverrideEndpoint(const Aws::String& endpoint);
std::shared_ptr& accessEndpointProvider();
private:
friend class Aws::Client::ClientWithAsyncTemplateMethods;
void init(const ManagedBlockchainQueryClientConfiguration& clientConfiguration);
ManagedBlockchainQueryClientConfiguration m_clientConfiguration;
std::shared_ptr m_executor;
std::shared_ptr m_endpointProvider;
};
} // namespace ManagedBlockchainQuery
} // namespace Aws