Examples#
Auto-generated documentation for Chime type annotations stubs module types-boto3-chime.
Client#
Implicit type annotations#
Can be used with types-boto3[chime]
package installed.
Write your Chime
code as usual,
type checking and code completion should work out of the box.
# ChimeClient usage example
from boto3.session import Session
session = Session()
client = session.client("chime") # (1)
result = client.associate_phone_numbers_with_voice_connector() # (2)
- client: ChimeClient
- result: AssociatePhoneNumbersWithVoiceConnectorResponseTypeDef
# ListAccountsPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("chime") # (1)
paginator = client.get_paginator("list_accounts") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: ChimeClient
- paginator: ListAccountsPaginator
- item: ListAccountsResponseTypeDef
Explicit type annotations#
With types-boto3-lite[chime]
or a standalone types_boto3_chime
package, you have to explicitly specify client: ChimeClient
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.
# ChimeClient usage example with type annotations
from boto3.session import Session
from types_boto3_chime.client import ChimeClient
from types_boto3_chime.type_defs import AssociatePhoneNumbersWithVoiceConnectorResponseTypeDef
from types_boto3_chime.type_defs import AssociatePhoneNumbersWithVoiceConnectorRequestRequestTypeDef
session = Session()
client: ChimeClient = session.client("chime")
kwargs: AssociatePhoneNumbersWithVoiceConnectorRequestRequestTypeDef = {...}
result: AssociatePhoneNumbersWithVoiceConnectorResponseTypeDef = client.associate_phone_numbers_with_voice_connector(**kwargs)
# ListAccountsPaginator usage example with type annotations
from boto3.session import Session
from types_boto3_chime.client import ChimeClient
from types_boto3_chime.paginator import ListAccountsPaginator
from types_boto3_chime.type_defs import ListAccountsResponseTypeDef
session = Session()
client: ChimeClient = session.client("chime")
paginator: ListAccountsPaginator = client.get_paginator("list_accounts")
for item in paginator.paginate(...):
item: ListAccountsResponseTypeDef
print(item)