Skip to content

Examples#

Index > VoiceID > Examples

Auto-generated documentation for VoiceID type annotations stubs module mypy-boto3-voice-id.

Client#

Implicit type annotations#

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

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

# VoiceIDClient usage example

from boto3.session import Session


session = Session()

client = session.client("voice-id")  # (1)
result = client.associate_fraudster()  # (2)
  1. client: VoiceIDClient
  2. result: AssociateFraudsterResponseTypeDef
# ListDomainsPaginator usage example

from boto3.session import Session


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

paginator = client.get_paginator("list_domains")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: VoiceIDClient
  2. paginator: ListDomainsPaginator
  3. item: ListDomainsResponseTypeDef

Explicit type annotations#

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

# VoiceIDClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_voice_id.client import VoiceIDClient
from mypy_boto3_voice_id.type_defs import AssociateFraudsterResponseTypeDef
from mypy_boto3_voice_id.type_defs import AssociateFraudsterRequestRequestTypeDef


session = Session()

client: VoiceIDClient = session.client("voice-id")

kwargs: AssociateFraudsterRequestRequestTypeDef = {...}
result: AssociateFraudsterResponseTypeDef = client.associate_fraudster(**kwargs)
# ListDomainsPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_voice_id.client import VoiceIDClient
from mypy_boto3_voice_id.paginator import ListDomainsPaginator
from mypy_boto3_voice_id.type_defs import ListDomainsResponseTypeDef


session = Session()
client: VoiceIDClient = session.client("voice-id")

paginator: ListDomainsPaginator = client.get_paginator("list_domains")
for item in paginator.paginate(...):
    item: ListDomainsResponseTypeDef
    print(item)