Skip to content

Examples#

Index > ManagedBlockchain > Examples

Auto-generated documentation for ManagedBlockchain type annotations stubs module types-aiobotocore-managedblockchain.

Client#

Implicit type annotations#

Can be used with types-aioboto3[managedblockchain] package installed.

Write your ManagedBlockchain code as usual, type checking and code completion should work out of the box.

# ManagedBlockchainClient usage example

from aioboto3.session import Session


session = Session()

async with session.client("managedblockchain") as client:  # (1)
    result = await client.create_accessor()  # (2)
  1. client: ManagedBlockchainClient
  2. result: CreateAccessorOutputTypeDef
# ListAccessorsPaginator usage example

from aioboto3.session import Session


session = Session()

async with session.client("managedblockchain") as client:  # (1)
    paginator = client.get_paginator("list_accessors")  # (2)
    async for item in paginator.paginate(...):
        print(item)  # (3)
  1. client: ManagedBlockchainClient
  2. paginator: ListAccessorsPaginator
  3. item: ListAccessorsOutputTypeDef

Explicit type annotations#

With types-aioboto3-lite[managedblockchain] or a standalone types_aiobotocore_managedblockchain package, you have to explicitly specify client: ManagedBlockchainClient 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.

# ManagedBlockchainClient usage example with type annotations

from aioboto3.session import Session

from types_aiobotocore_managedblockchain.client import ManagedBlockchainClient
from types_aiobotocore_managedblockchain.type_defs import CreateAccessorOutputTypeDef
from types_aiobotocore_managedblockchain.type_defs import CreateAccessorInputRequestTypeDef


session = Session()

client: ManagedBlockchainClient
async with session.client("managedblockchain") as client:  # (1)
    kwargs: CreateAccessorInputRequestTypeDef = {...}  # (2)
    result: CreateAccessorOutputTypeDef = await client.create_accessor(**kwargs)  # (3)
  1. client: ManagedBlockchainClient
  2. kwargs: CreateAccessorInputRequestTypeDef
  3. result: CreateAccessorOutputTypeDef
# ListAccessorsPaginator usage example with type annotations

from aioboto3.session import Session

from types_aiobotocore_managedblockchain.client import ManagedBlockchainClient
from types_aiobotocore_managedblockchain.paginator import ListAccessorsPaginator
from types_aiobotocore_managedblockchain.type_defs import ListAccessorsOutputTypeDef


session = Session()

client: ManagedBlockchainClient
async with session.client("managedblockchain") as client:  # (1)
    paginator: ListAccessorsPaginator = client.get_paginator("list_accessors")  # (2)
    async for item in paginator.paginate(...):
        item: ListAccessorsOutputTypeDef
        print(item)  # (3)
  1. client: ManagedBlockchainClient
  2. paginator: ListAccessorsPaginator
  3. item: ListAccessorsOutputTypeDef