Skip to content

Examples#

Index > ChimeSDKVoice > Examples

Auto-generated documentation for ChimeSDKVoice type annotations stubs module mypy-boto3-chime-sdk-voice.

Client#

Implicit type annotations#

Can be used with boto3-stubs[chime-sdk-voice] package installed.

Write your ChimeSDKVoice code as usual, type checking and code completion should work out of the box.

# ChimeSDKVoiceClient usage example

from boto3.session import Session


session = Session()

client = session.client("chime-sdk-voice")  # (1)
result = client.associate_phone_numbers_with_voice_connector()  # (2)
  1. client: ChimeSDKVoiceClient
  2. result: AssociatePhoneNumbersWithVoiceConnectorResponseTypeDef
# ListSipMediaApplicationsPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("chime-sdk-voice")  # (1)

paginator = client.get_paginator("list_sip_media_applications")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: ChimeSDKVoiceClient
  2. paginator: ListSipMediaApplicationsPaginator
  3. item: ListSipMediaApplicationsResponseTypeDef

Explicit type annotations#

With boto3-stubs-lite[chime-sdk-voice] or a standalone mypy_boto3_chime_sdk_voice package, you have to explicitly specify client: ChimeSDKVoiceClient 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.

# ChimeSDKVoiceClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_chime_sdk_voice.client import ChimeSDKVoiceClient
from mypy_boto3_chime_sdk_voice.type_defs import AssociatePhoneNumbersWithVoiceConnectorResponseTypeDef
from mypy_boto3_chime_sdk_voice.type_defs import AssociatePhoneNumbersWithVoiceConnectorRequestRequestTypeDef


session = Session()

client: ChimeSDKVoiceClient = session.client("chime-sdk-voice")

kwargs: AssociatePhoneNumbersWithVoiceConnectorRequestRequestTypeDef = {...}
result: AssociatePhoneNumbersWithVoiceConnectorResponseTypeDef = client.associate_phone_numbers_with_voice_connector(**kwargs)
# ListSipMediaApplicationsPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_chime_sdk_voice.client import ChimeSDKVoiceClient
from mypy_boto3_chime_sdk_voice.paginator import ListSipMediaApplicationsPaginator
from mypy_boto3_chime_sdk_voice.type_defs import ListSipMediaApplicationsResponseTypeDef


session = Session()
client: ChimeSDKVoiceClient = session.client("chime-sdk-voice")

paginator: ListSipMediaApplicationsPaginator = client.get_paginator("list_sip_media_applications")
for item in paginator.paginate(...):
    item: ListSipMediaApplicationsResponseTypeDef
    print(item)