/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the managedblockchain-query-2023-05-04.normal.json service model.
*/
using System;
using System.Runtime.ExceptionServices;
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Net;
using Amazon.ManagedBlockchainQuery.Model;
using Amazon.ManagedBlockchainQuery.Model.Internal.MarshallTransformations;
using Amazon.ManagedBlockchainQuery.Internal;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Auth;
using Amazon.Runtime.Internal.Transform;
namespace Amazon.ManagedBlockchainQuery
{
///
/// Implementation for accessing 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.
///
public partial class AmazonManagedBlockchainQueryClient : AmazonServiceClient, IAmazonManagedBlockchainQuery
{
private static IServiceMetadata serviceMetadata = new AmazonManagedBlockchainQueryMetadata();
#region Constructors
///
/// Constructs AmazonManagedBlockchainQueryClient with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
///
/// <?xml version="1.0" encoding="utf-8" ?>
/// <configuration>
/// <appSettings>
/// <add key="AWSProfileName" value="AWS Default"/>
/// </appSettings>
/// </configuration>
///
///
///
public AmazonManagedBlockchainQueryClient()
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonManagedBlockchainQueryConfig()) { }
///
/// Constructs AmazonManagedBlockchainQueryClient with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
///
/// <?xml version="1.0" encoding="utf-8" ?>
/// <configuration>
/// <appSettings>
/// <add key="AWSProfileName" value="AWS Default"/>
/// </appSettings>
/// </configuration>
///
///
///
/// The region to connect.
public AmazonManagedBlockchainQueryClient(RegionEndpoint region)
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonManagedBlockchainQueryConfig{RegionEndpoint = region}) { }
///
/// Constructs AmazonManagedBlockchainQueryClient with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
///
/// <?xml version="1.0" encoding="utf-8" ?>
/// <configuration>
/// <appSettings>
/// <add key="AWSProfileName" value="AWS Default"/>
/// </appSettings>
/// </configuration>
///
///
///
/// The AmazonManagedBlockchainQueryClient Configuration Object
public AmazonManagedBlockchainQueryClient(AmazonManagedBlockchainQueryConfig config)
: base(FallbackCredentialsFactory.GetCredentials(config), config){}
///
/// Constructs AmazonManagedBlockchainQueryClient with AWS Credentials
///
/// AWS Credentials
public AmazonManagedBlockchainQueryClient(AWSCredentials credentials)
: this(credentials, new AmazonManagedBlockchainQueryConfig())
{
}
///
/// Constructs AmazonManagedBlockchainQueryClient with AWS Credentials
///
/// AWS Credentials
/// The region to connect.
public AmazonManagedBlockchainQueryClient(AWSCredentials credentials, RegionEndpoint region)
: this(credentials, new AmazonManagedBlockchainQueryConfig{RegionEndpoint = region})
{
}
///
/// Constructs AmazonManagedBlockchainQueryClient with AWS Credentials and an
/// AmazonManagedBlockchainQueryClient Configuration object.
///
/// AWS Credentials
/// The AmazonManagedBlockchainQueryClient Configuration Object
public AmazonManagedBlockchainQueryClient(AWSCredentials credentials, AmazonManagedBlockchainQueryConfig clientConfig)
: base(credentials, clientConfig)
{
}
///
/// Constructs AmazonManagedBlockchainQueryClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
public AmazonManagedBlockchainQueryClient(string awsAccessKeyId, string awsSecretAccessKey)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonManagedBlockchainQueryConfig())
{
}
///
/// Constructs AmazonManagedBlockchainQueryClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// The region to connect.
public AmazonManagedBlockchainQueryClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonManagedBlockchainQueryConfig() {RegionEndpoint=region})
{
}
///
/// Constructs AmazonManagedBlockchainQueryClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonManagedBlockchainQueryClient Configuration object.
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// The AmazonManagedBlockchainQueryClient Configuration Object
public AmazonManagedBlockchainQueryClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonManagedBlockchainQueryConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, clientConfig)
{
}
///
/// Constructs AmazonManagedBlockchainQueryClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
public AmazonManagedBlockchainQueryClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonManagedBlockchainQueryConfig())
{
}
///
/// Constructs AmazonManagedBlockchainQueryClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
/// The region to connect.
public AmazonManagedBlockchainQueryClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonManagedBlockchainQueryConfig{RegionEndpoint = region})
{
}
///
/// Constructs AmazonManagedBlockchainQueryClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonManagedBlockchainQueryClient Configuration object.
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
/// The AmazonManagedBlockchainQueryClient Configuration Object
public AmazonManagedBlockchainQueryClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonManagedBlockchainQueryConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig)
{
}
#endregion
#if AWS_ASYNC_ENUMERABLES_API
private IManagedBlockchainQueryPaginatorFactory _paginators;
///
/// Paginators for the service
///
public IManagedBlockchainQueryPaginatorFactory Paginators
{
get
{
if (this._paginators == null)
{
this._paginators = new ManagedBlockchainQueryPaginatorFactory(this);
}
return this._paginators;
}
}
#endif
#region Overrides
///
/// Creates the signer for the service.
///
protected override AbstractAWSSigner CreateSigner()
{
return new AWS4Signer();
}
///
/// Customizes the runtime pipeline.
///
/// Runtime pipeline for the current client.
protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
{
pipeline.RemoveHandler();
pipeline.AddHandlerAfter(new AmazonManagedBlockchainQueryEndpointResolver());
}
///
/// Capture metadata for the service.
///
protected override IServiceMetadata ServiceMetadata
{
get
{
return serviceMetadata;
}
}
#endregion
#region Dispose
///
/// Disposes the service client.
///
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}
#endregion
#region BatchGetTokenBalance
internal virtual BatchGetTokenBalanceResponse BatchGetTokenBalance(BatchGetTokenBalanceRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = BatchGetTokenBalanceRequestMarshaller.Instance;
options.ResponseUnmarshaller = BatchGetTokenBalanceResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// 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.
///
///
///
/// Container for the necessary parameters to execute the BatchGetTokenBalance service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the BatchGetTokenBalance service method, as returned by ManagedBlockchainQuery.
///
/// The Amazon Web Services account doesn’t have access to this resource.
///
///
/// The request processing has failed because of an internal error in the service.
///
///
/// The resource was not found.
///
///
/// The service quota has been exceeded for this resource.
///
///
/// The request or operation couldn't be performed because a service is throttling requests.
/// The most common source of throttling errors is when you create resources that exceed
/// your service limit for this resource type. Request a limit increase or delete unused
/// resources, if possible.
///
///
/// The resource passed is invalid.
///
/// REST API Reference for BatchGetTokenBalance Operation
public virtual Task BatchGetTokenBalanceAsync(BatchGetTokenBalanceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = BatchGetTokenBalanceRequestMarshaller.Instance;
options.ResponseUnmarshaller = BatchGetTokenBalanceResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region GetTokenBalance
internal virtual GetTokenBalanceResponse GetTokenBalance(GetTokenBalanceRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetTokenBalanceRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetTokenBalanceResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// 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.
///
///
///
/// Container for the necessary parameters to execute the GetTokenBalance service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the GetTokenBalance service method, as returned by ManagedBlockchainQuery.
///
/// The Amazon Web Services account doesn’t have access to this resource.
///
///
/// The request processing has failed because of an internal error in the service.
///
///
/// The resource was not found.
///
///
/// The service quota has been exceeded for this resource.
///
///
/// The request or operation couldn't be performed because a service is throttling requests.
/// The most common source of throttling errors is when you create resources that exceed
/// your service limit for this resource type. Request a limit increase or delete unused
/// resources, if possible.
///
///
/// The resource passed is invalid.
///
/// REST API Reference for GetTokenBalance Operation
public virtual Task GetTokenBalanceAsync(GetTokenBalanceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = GetTokenBalanceRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetTokenBalanceResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region GetTransaction
internal virtual GetTransactionResponse GetTransaction(GetTransactionRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetTransactionRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetTransactionResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Get the details of a transaction.
///
/// Container for the necessary parameters to execute the GetTransaction service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the GetTransaction service method, as returned by ManagedBlockchainQuery.
///
/// The Amazon Web Services account doesn’t have access to this resource.
///
///
/// The request processing has failed because of an internal error in the service.
///
///
/// The resource was not found.
///
///
/// The service quota has been exceeded for this resource.
///
///
/// The request or operation couldn't be performed because a service is throttling requests.
/// The most common source of throttling errors is when you create resources that exceed
/// your service limit for this resource type. Request a limit increase or delete unused
/// resources, if possible.
///
///
/// The resource passed is invalid.
///
/// REST API Reference for GetTransaction Operation
public virtual Task GetTransactionAsync(GetTransactionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = GetTransactionRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetTransactionResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region ListTokenBalances
internal virtual ListTokenBalancesResponse ListTokenBalances(ListTokenBalancesRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListTokenBalancesRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListTokenBalancesResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// 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.
///
///
///
/// Container for the necessary parameters to execute the ListTokenBalances service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the ListTokenBalances service method, as returned by ManagedBlockchainQuery.
///
/// The Amazon Web Services account doesn’t have access to this resource.
///
///
/// The request processing has failed because of an internal error in the service.
///
///
/// The service quota has been exceeded for this resource.
///
///
/// The request or operation couldn't be performed because a service is throttling requests.
/// The most common source of throttling errors is when you create resources that exceed
/// your service limit for this resource type. Request a limit increase or delete unused
/// resources, if possible.
///
///
/// The resource passed is invalid.
///
/// REST API Reference for ListTokenBalances Operation
public virtual Task ListTokenBalancesAsync(ListTokenBalancesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = ListTokenBalancesRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListTokenBalancesResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region ListTransactionEvents
internal virtual ListTransactionEventsResponse ListTransactionEvents(ListTransactionEventsRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListTransactionEventsRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListTransactionEventsResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// An array of TransactionEvent
objects. Each object contains details about
/// the transaction event.
///
/// Container for the necessary parameters to execute the ListTransactionEvents service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the ListTransactionEvents service method, as returned by ManagedBlockchainQuery.
///
/// The Amazon Web Services account doesn’t have access to this resource.
///
///
/// The request processing has failed because of an internal error in the service.
///
///
/// The service quota has been exceeded for this resource.
///
///
/// The request or operation couldn't be performed because a service is throttling requests.
/// The most common source of throttling errors is when you create resources that exceed
/// your service limit for this resource type. Request a limit increase or delete unused
/// resources, if possible.
///
///
/// The resource passed is invalid.
///
/// REST API Reference for ListTransactionEvents Operation
public virtual Task ListTransactionEventsAsync(ListTransactionEventsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = ListTransactionEventsRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListTransactionEventsResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region ListTransactions
internal virtual ListTransactionsResponse ListTransactions(ListTransactionsRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListTransactionsRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListTransactionsResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Lists all of the transactions on a given wallet address or to a specific contract.
///
/// Container for the necessary parameters to execute the ListTransactions service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the ListTransactions service method, as returned by ManagedBlockchainQuery.
///
/// The Amazon Web Services account doesn’t have access to this resource.
///
///
/// The request processing has failed because of an internal error in the service.
///
///
/// The service quota has been exceeded for this resource.
///
///
/// The request or operation couldn't be performed because a service is throttling requests.
/// The most common source of throttling errors is when you create resources that exceed
/// your service limit for this resource type. Request a limit increase or delete unused
/// resources, if possible.
///
///
/// The resource passed is invalid.
///
/// REST API Reference for ListTransactions Operation
public virtual Task ListTransactionsAsync(ListTransactionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = ListTransactionsRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListTransactionsResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
}
}