Examples#
Index > ManagedBlockchainQuery > Examples
Auto-generated documentation for ManagedBlockchainQuery type annotations stubs module mypy-boto3-managedblockchain-query.
Client#
Implicit type annotations#
Can be used with boto3-stubs[managedblockchain-query]
package installed.
Write your ManagedBlockchainQuery
code as usual,
type checking and code completion should work out of the box.
# ManagedBlockchainQueryClient usage example
from boto3.session import Session
session = Session()
client = session.client("managedblockchain-query") # (1)
result = client.batch_get_token_balance() # (2)
- client: ManagedBlockchainQueryClient
- result: BatchGetTokenBalanceOutputTypeDef
# ListAssetContractsPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("managedblockchain-query") # (1)
paginator = client.get_paginator("list_asset_contracts") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: ManagedBlockchainQueryClient
- paginator: ListAssetContractsPaginator
- item: ListAssetContractsOutputTypeDef
Explicit type annotations#
With boto3-stubs-lite[managedblockchain-query]
or a standalone mypy_boto3_managedblockchain_query
package, you have to explicitly specify client: ManagedBlockchainQueryClient
type annotation.
All other type annotations are optional, as types should be discovered automatically. However, these type annotations can be helpful in your functions and methods.
# ManagedBlockchainQueryClient usage example with type annotations
from boto3.session import Session
from mypy_boto3_managedblockchain_query.client import ManagedBlockchainQueryClient
from mypy_boto3_managedblockchain_query.type_defs import BatchGetTokenBalanceOutputTypeDef
from mypy_boto3_managedblockchain_query.type_defs import BatchGetTokenBalanceInputRequestTypeDef
session = Session()
client: ManagedBlockchainQueryClient = session.client("managedblockchain-query")
kwargs: BatchGetTokenBalanceInputRequestTypeDef = {...}
result: BatchGetTokenBalanceOutputTypeDef = client.batch_get_token_balance(**kwargs)
# ListAssetContractsPaginator usage example with type annotations
from boto3.session import Session
from mypy_boto3_managedblockchain_query.client import ManagedBlockchainQueryClient
from mypy_boto3_managedblockchain_query.paginator import ListAssetContractsPaginator
from mypy_boto3_managedblockchain_query.type_defs import ListAssetContractsOutputTypeDef
session = Session()
client: ManagedBlockchainQueryClient = session.client("managedblockchain-query")
paginator: ListAssetContractsPaginator = client.get_paginator("list_asset_contracts")
for item in paginator.paginate(...):
item: ListAssetContractsOutputTypeDef
print(item)