Skip to content

Examples#

Index > ManagedBlockchain > Examples

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

Client#

Implicit type annotations#

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

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

# ManagedBlockchainClient usage example

from boto3.session import Session


session = Session()

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

from boto3.session import Session


session = Session()
client = session.client("managedblockchain")  # (1)

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

Explicit type annotations#

With types-boto3-lite[managedblockchain] or a standalone types_boto3_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 boto3.session import Session

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


session = Session()

client: ManagedBlockchainClient = session.client("managedblockchain")

kwargs: CreateAccessorInputRequestTypeDef = {...}
result: CreateAccessorOutputTypeDef = client.create_accessor(**kwargs)
# ListAccessorsPaginator usage example with type annotations

from boto3.session import Session

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


session = Session()
client: ManagedBlockchainClient = session.client("managedblockchain")

paginator: ListAccessorsPaginator = client.get_paginator("list_accessors")
for item in paginator.paginate(...):
    item: ListAccessorsOutputTypeDef
    print(item)