Skip to content

Examples#

Index > VoiceID > Examples

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

Client#

Implicit type annotations#

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

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

Client method usage example#

# 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

Paginator usage example#

# 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 types-boto3-lite[voice-id] or a standalone types_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.

Client method usage example#

# VoiceIDClient usage example with type annotations

from boto3.session import Session

from types_boto3_voice_id.client import VoiceIDClient
from types_boto3_voice_id.type_defs import AssociateFraudsterResponseTypeDef
from types_boto3_voice_id.type_defs import AssociateFraudsterRequestTypeDef


session = Session()

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

kwargs: AssociateFraudsterRequestTypeDef = {...}
result: AssociateFraudsterResponseTypeDef = client.associate_fraudster(**kwargs)

Paginator usage example#

# ListDomainsPaginator usage example with type annotations

from boto3.session import Session

from types_boto3_voice_id.client import VoiceIDClient
from types_boto3_voice_id.paginator import ListDomainsPaginator
from types_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)