mypy-boto3-chime-sdk-voice Type Annotations

1.42.3 · active · verified Sat Apr 11

This library provides type annotations for the AWS boto3 Chime SDK Voice service client. It ensures that your boto3 calls for `chime-sdk-voice` are type-checked by `mypy`, preventing common runtime errors and improving developer experience with autocompletion. The current version is 1.42.3, generated by `mypy-boto3-builder` and released frequently to align with boto3/botocore updates.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to get a type-hinted ChimeSDKVoice client using `mypy-boto3-chime-sdk-voice` and perform a basic operation. The explicit type annotation `client: ChimeSDKVoiceClient` is essential for mypy to correctly apply the type information.

import boto3
from mypy_boto3_chime_sdk_voice.client import ChimeSDKVoiceClient

# It's crucial to annotate the client variable for mypy to pick up the types
client: ChimeSDKVoiceClient = boto3.client("chime-sdk-voice")

# Now, 'client' methods are type-checked and offer autocompletion
try:
    # Example: Listing voice profile domains
    response = client.list_voice_profile_domains()
    print(f"Successfully listed voice profile domains. Found {len(response['VoiceProfileDomainSummaries'])}.")
    if response['VoiceProfileDomainSummaries']:
        print(f"First domain name: {response['VoiceProfileDomainSummaries'][0]['Name']}")
except Exception as e:
    print(f"Error listing domains (this is expected if AWS credentials/permissions are missing): {e}")

# You can also import and use specific TypedDicts for request/response bodies
# from mypy_boto3_chime_sdk_voice.type_defs import CreateVoiceProfileDomainRequestRequestTypeDef
# request_params: CreateVoiceProfileDomainRequestRequestTypeDef = {
#     "Name": "MyDomain",
#     "ServerSideEncryptionConfiguration": {"KmsKeyArn": "arn:aws:kms:REGION:ACCOUNT_ID:key/KEY_ID"}
# }
# client.create_voice_profile_domain(**request_params)

view raw JSON →