{"id":3673,"library":"mypy-boto3-pinpoint-sms-voice-v2","title":"mypy-boto3-pinpoint-sms-voice-v2 Type Annotations","description":"mypy-boto3-pinpoint-sms-voice-v2 provides type annotations for the boto3 Pinpoint SMS Voice V2 service, generated by mypy-boto3-builder. These stubs enhance type checking for AWS SDK usage, preventing common runtime errors. The current version is 1.42.80, with releases synchronized with boto3 versions.","status":"active","version":"1.42.80","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["boto3","aws","mypy","types","type-hints","pinpoint","sms","voice"],"install":[{"cmd":"pip install mypy-boto3-pinpoint-sms-voice-v2","lang":"bash","label":"Install library"},{"cmd":"pip install boto3","lang":"bash","label":"Install runtime dependency"}],"dependencies":[{"reason":"This library provides type stubs for boto3, which is required at runtime for your application to function.","package":"boto3","optional":false}],"imports":[{"note":"Import the client type hint directly from the stub package, not from boto3 itself or the top-level mypy_boto3.","wrong":"from boto3.client import PinpointSMSVoiceV2Client","symbol":"PinpointSMSVoiceV2Client","correct":"from mypy_boto3_pinpoint_sms_voice_v2.client import PinpointSMSVoiceV2Client"},{"note":"For specific TypeDefs, import from the type_defs submodule. Be mindful of naming conventions which can vary.","wrong":"from mypy_boto3_pinpoint_sms_voice_v2.type_defs import SendVoiceMessageRequestTypeDef","symbol":"Service Resource TypeDefs","correct":"from mypy_boto3_pinpoint_sms_voice_v2.type_defs import SendVoiceMessageRequestRequestTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_pinpoint_sms_voice_v2.client import PinpointSMSVoiceV2Client\nimport os\n\n# Instantiate a boto3 session and client\n# mypy will use the installed stubs to provide type hints for 'client'\nregion = os.environ.get('AWS_REGION', 'us-east-1')\nsession = boto3.Session(region_name=region)\nclient: PinpointSMSVoiceV2Client = session.client(\"pinpoint-sms-voice-v2\")\n\n# Example of using the typed client (replace with actual values and error handling)\ntry:\n    response = client.send_voice_message(\n        DestinationPhoneNumber=\"+15551234567\", # Replace with a valid E.164 number\n        OriginationIdentity=\"MyVoiceSenderId\", # Your registered origination identity\n        MessageBody=\"Hello from mypy-boto3-pinpoint-sms-voice-v2!\",\n        ConfigurationSetName=\"Default\", # Your existing configuration set\n        CallerId=\"+15559876543\" # Optional, if you have a caller ID\n    )\n    print(f\"Voice message sent. Message ID: {response['MessageId']}\")\nexcept client.exceptions.ResourceNotFoundException as e:\n    print(f\"Error: Resource not found: {e}\")\nexcept Exception as e:\n    print(f\"An unexpected error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to initialize a boto3 client for Pinpoint SMS Voice V2 and leverage the type annotations provided by mypy-boto3-pinpoint-sms-voice-v2. It's crucial to have both `boto3` and the stub package installed. The example includes basic client usage with type hints."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Python 3.8 is no longer supported. The `mypy-boto3-builder` and all generated stub packages, including this one, removed support for Python 3.8 as of version 8.12.0.","severity":"breaking","affected_versions":">=8.12.0"},{"fix":"Ensure you run `pip install boto3` in addition to installing `mypy-boto3-pinpoint-sms-voice-v2`.","message":"This library provides *type stubs* only. You must also install the `boto3` library for your code to execute at runtime. Without `boto3` installed, your application will fail with import errors.","severity":"gotcha","affected_versions":"All"},{"fix":"Double-check your `boto3.client('SERVICE_NAME')` call and install `mypy-boto3-SERVICE_NAME` accordingly. For this package, the client name is 'pinpoint-sms-voice-v2'.","message":"AWS has multiple services related to SMS and Voice messaging (e.g., `pinpoint-sms-voice`, `sms-voice`, `pinpoint-sms-voice-v2`). Ensure you install the `mypy-boto3-*` package that precisely matches the `boto3.client()` service name you are using. Confusing service names can lead to incorrect type hints or runtime errors.","severity":"gotcha","affected_versions":"All"},{"fix":"If you explicitly import TypeDefs, verify their names against the latest stub package structure or refer to the `mypy-boto3-builder` documentation.","message":"The `mypy-boto3-builder` changed TypeDef naming conventions in version 8.9.0. Specifically, packed method arguments may use shorter names (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). This could affect explicit imports of TypeDefs.","severity":"breaking","affected_versions":">=8.9.0"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}