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