Examples#
Auto-generated documentation for B2BI type annotations stubs module mypy-boto3-b2bi.
Client#
Implicit type annotations#
Can be used with boto3-stubs[b2bi]
package installed.
Write your B2BI
code as usual,
type checking and code completion should work out of the box.
# B2BIClient usage example
from boto3.session import Session
session = Session()
client = session.client("b2bi") # (1)
result = client.create_capability() # (2)
- client: B2BIClient
- result: CreateCapabilityResponseTypeDef
# ListCapabilitiesPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("b2bi") # (1)
paginator = client.get_paginator("list_capabilities") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: B2BIClient
- paginator: ListCapabilitiesPaginator
- item: ListCapabilitiesResponseTypeDef
Explicit type annotations#
With boto3-stubs-lite[b2bi]
or a standalone mypy_boto3_b2bi
package, you have to explicitly specify client: B2BIClient
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.
# B2BIClient usage example with type annotations
from boto3.session import Session
from mypy_boto3_b2bi.client import B2BIClient
from mypy_boto3_b2bi.type_defs import CreateCapabilityResponseTypeDef
from mypy_boto3_b2bi.type_defs import CreateCapabilityRequestRequestTypeDef
session = Session()
client: B2BIClient = session.client("b2bi")
kwargs: CreateCapabilityRequestRequestTypeDef = {...}
result: CreateCapabilityResponseTypeDef = client.create_capability(**kwargs)
# ListCapabilitiesPaginator usage example with type annotations
from boto3.session import Session
from mypy_boto3_b2bi.client import B2BIClient
from mypy_boto3_b2bi.paginator import ListCapabilitiesPaginator
from mypy_boto3_b2bi.type_defs import ListCapabilitiesResponseTypeDef
session = Session()
client: B2BIClient = session.client("b2bi")
paginator: ListCapabilitiesPaginator = client.get_paginator("list_capabilities")
for item in paginator.paginate(...):
item: ListCapabilitiesResponseTypeDef
print(item)