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