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.
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)
- client: VoiceIDClient
- 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)
- client: VoiceIDClient
- paginator: ListDomainsPaginator
- 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.
Client method usage example#
# 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 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 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)