Examples#
Auto-generated documentation for Account type annotations stubs module types-aiobotocore-account.
Client#
Implicit type annotations#
Can be used with types-aiobotocore[account]
package installed.
Write your Account
code as usual,
type checking and code completion should work out of the box.
# AccountClient usage example
from aiobotocore.session import get_session
session = get_session()
async with session.create_client("account") as client: # (1)
result = await client.delete_alternate_contact() # (2)
- client: AccountClient
- result: EmptyResponseMetadataTypeDef
# ListRegionsPaginator usage example
from aiobotocore.session import get_session
session = get_session()
async with session.create_client("account") as client: # (1)
paginator = client.get_paginator("list_regions") # (2)
async for item in paginator.paginate(...):
print(item) # (3)
- client: AccountClient
- paginator: ListRegionsPaginator
- item: ListRegionsResponseTypeDef
Explicit type annotations#
With types-aiobotocore-lite[account]
or a standalone types_aiobotocore_account
package, you have to explicitly specify
client: AccountClient
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.
# AccountClient usage example with type annotations
from aiobotocore.session import get_session
from types_aiobotocore_account.client import AccountClient
from types_aiobotocore_account.type_defs import EmptyResponseMetadataTypeDef
from types_aiobotocore_account.type_defs import DeleteAlternateContactRequestRequestTypeDef
session = get_session()
async with session.create_client("account") as client:
client: AccountClient
kwargs: DeleteAlternateContactRequestRequestTypeDef = {...}
result: EmptyResponseMetadataTypeDef = await client.delete_alternate_contact(**kwargs)
# ListRegionsPaginator usage example with type annotations
from aiobotocore.session import get_session
from types_aiobotocore_account.client import AccountClient
from types_aiobotocore_account.paginator import ListRegionsPaginator
from types_aiobotocore_account.type_defs import ListRegionsResponseTypeDef
session = get_session()
async with session.create_client("account") as client:
client: AccountClient
paginator: ListRegionsPaginator = client.get_paginator("list_regions")
async for item in paginator.paginate(...):
item: ListRegionsResponseTypeDef
print(item)