Examples#
Index > ImportExport > Examples
Auto-generated documentation for ImportExport type annotations stubs module types-aiobotocore-importexport.
Client#
Implicit type annotations#
Can be used with types-aioboto3[importexport]
package installed.
Write your ImportExport
code as usual,
type checking and code completion should work out of the box.
# ImportExportClient usage example
from aioboto3.session import Session
session = Session()
async with session.client("importexport") as client: # (1)
result = await client.cancel_job() # (2)
- client: ImportExportClient
- result: CancelJobOutputTypeDef
# ListJobsPaginator usage example
from aioboto3.session import Session
session = Session()
async with session.client("importexport") as client: # (1)
paginator = client.get_paginator("list_jobs") # (2)
async for item in paginator.paginate(...):
print(item) # (3)
- client: ImportExportClient
- paginator: ListJobsPaginator
- item: ListJobsOutputTypeDef
Explicit type annotations#
With types-aioboto3-lite[importexport]
or a standalone types_aiobotocore_importexport
package, you have to explicitly specify
client: ImportExportClient
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.
# ImportExportClient usage example with type annotations
from aioboto3.session import Session
from types_aiobotocore_importexport.client import ImportExportClient
from types_aiobotocore_importexport.type_defs import CancelJobOutputTypeDef
from types_aiobotocore_importexport.type_defs import CancelJobInputRequestTypeDef
session = Session()
client: ImportExportClient
async with session.client("importexport") as client: # (1)
kwargs: CancelJobInputRequestTypeDef = {...} # (2)
result: CancelJobOutputTypeDef = await client.cancel_job(**kwargs) # (3)
- client: ImportExportClient
- kwargs: CancelJobInputRequestTypeDef
- result: CancelJobOutputTypeDef
# ListJobsPaginator usage example with type annotations
from aioboto3.session import Session
from types_aiobotocore_importexport.client import ImportExportClient
from types_aiobotocore_importexport.paginator import ListJobsPaginator
from types_aiobotocore_importexport.type_defs import ListJobsOutputTypeDef
session = Session()
client: ImportExportClient
async with session.client("importexport") as client: # (1)
paginator: ListJobsPaginator = client.get_paginator("list_jobs") # (2)
async for item in paginator.paginate(...):
item: ListJobsOutputTypeDef
print(item) # (3)
- client: ImportExportClient
- paginator: ListJobsPaginator
- item: ListJobsOutputTypeDef