{"id":3674,"library":"mypy-boto3-pinpoint-sms-voice","title":"mypy-boto3-pinpoint-sms-voice","description":"This library provides essential type annotations for the `boto3` Pinpoint SMS Voice service, generated by `mypy-boto3-builder`. It enables static type checking with tools like Mypy, enhancing code quality and developer experience for AWS interactions. The current version is 1.42.3, and releases are frequent, typically in sync with `boto3` and `botocore` updates.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["AWS","Boto3","Type Hinting","Mypy","Stubs","PinpointSMSVoice"],"install":[{"cmd":"pip install mypy-boto3-pinpoint-sms-voice boto3","lang":"bash","label":"Install with boto3"}],"dependencies":[{"reason":"Provides the runtime functionality that these stubs type-check. Required for actual AWS API calls.","package":"boto3"},{"reason":"Required for specific type-hinting features on Python versions older than 3.11.","package":"typing-extensions","optional":true}],"imports":[{"symbol":"PinpointSMSVoiceClient","correct":"from typing import TYPE_CHECKING\nif TYPE_CHECKING:\n    from mypy_boto3_pinpoint_sms_voice import PinpointSMSVoiceClient"},{"symbol":"SendMessagesRequestRequestTypeDef","correct":"from typing import TYPE_CHECKING\nif TYPE_CHECKING:\n    from mypy_boto3_pinpoint_sms_voice.type_defs import SendMessagesRequestRequestTypeDef"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING, cast\nimport os\n\n# This package provides type stubs for boto3.client(\"pinpoint-sms-voice\").\n# Install `mypy-boto3-pinpoint-sms-voice` and `boto3` for type checking.\n\n# --- Runtime code (runs without stubs, but benefits from them during development) ---\nprint(\"--- Runtime code ---\")\n# Ensure AWS credentials are configured (e.g., via AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY env vars)\n# or ~/.aws/credentials.\n\n# Example of creating a boto3 client at runtime\npinpoint_client = boto3.client(\n    \"pinpoint-sms-voice\", \n    region_name=os.environ.get('AWS_REGION', 'us-east-1')\n)\nprint(f\"Created boto3 client for {pinpoint_client.meta.service_model.service_name}\")\n\n# --- Type-checking specific code (only for static analysis tools like mypy) ---\nif TYPE_CHECKING:\n    from mypy_boto3_pinpoint_sms_voice import PinpointSMSVoiceClient\n    from mypy_boto3_pinpoint_sms_voice.type_defs import SendMessagesRequestRequestTypeDef\n\n    # Mypy will understand that pinpoint_client is a PinpointSMSVoiceClient\n    # after the stubs are installed. An explicit cast is often not needed,\n    # but can be used for stricter checking or clarity.\n    typed_client: PinpointSMSVoiceClient = cast(PinpointSMSVoiceClient, pinpoint_client)\n\n    # Example of using a type definition for a request payload. Mypy validates its structure.\n    send_messages_request: SendMessagesRequestRequestTypeDef = {\n        \"ApplicationId\": \"dummy-app-id\", # Replace with your actual Pinpoint Application ID\n        \"MessageRequest\": {\n            \"Addresses\": {\"+1234567890\": {\"ChannelType\": \"SMS\"}}, # Replace with real phone numbers\n            \"Message\": {\"Body\": \"Hello from checklist.day!\"},\n        },\n    }\n    print(\"\\n--- Type-checking example (mypy validates this structure) ---\")\n    print(f\"Request structure type: {type(send_messages_request)}\")\n    # In a type-checked environment, you'd get auto-completion and validation for:\n    # typed_client.send_messages(**send_messages_request)\nelse:\n    print(\"\\n--- To enable full type-checking, run `mypy your_script.py` after installation ---\")\n\nprint(\"\\nQuickstart complete. Ensure AWS credentials are configured for actual API calls.\")","lang":"python","description":"This quickstart demonstrates how to initialize a `boto3` Pinpoint SMS Voice client and how `mypy-boto3` provides type hints for both the client object and specific service request/response type definitions. Code within `if TYPE_CHECKING:` blocks is for static analysis and does not run at runtime. For actual API calls, replace dummy values and ensure AWS credentials are set up."},"warnings":[{"fix":"Update your `boto3.client('sms-voice')` calls to `boto3.client('pinpoint-sms-voice')`. If you were using an older specific `mypy-boto3-sms-voice` package, uninstall it and install `mypy-boto3-pinpoint-sms-voice`.","message":"The AWS service client name for Pinpoint SMS Voice was changed from `sms-voice` to `pinpoint-sms-voice` in `mypy-boto3-builder` version 8.11.0. Using the old name with newer `boto3` or `mypy-boto3` stubs will result in runtime errors (e.g., `ClientError` or `KeyError`).","severity":"breaking","affected_versions":"Code using `boto3.client('sms-voice')` with `mypy-boto3-builder >= 8.11.0` stubs or `boto3` versions released after this change."},{"fix":"Upgrade your Python environment to 3.9 or higher. If unable to upgrade, pin your `mypy-boto3-pinpoint-sms-voice` dependency to `<1.42.0` (e.g., `mypy-boto3-pinpoint-sms-voice<1.42.0`) to use the last compatible version.","message":"Support for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0. Consequently, `mypy-boto3-pinpoint-sms-voice` versions built with 8.12.0 or later (e.g., 1.42.x) require Python 3.9 or higher.","severity":"breaking","affected_versions":"`mypy-boto3-pinpoint-sms-voice` versions 1.42.0 and above."},{"fix":"Wrap all imports from `mypy_boto3_pinpoint_sms_voice.type_defs` (and other submodules) within an `if TYPE_CHECKING:` block, as demonstrated in the quickstart example.","message":"While `mypy-boto3` automatically provides types for `boto3.client(...)` calls, explicit imports for `TypeDef` classes (e.g., `SendMessagesRequestRequestTypeDef`) must be guarded by `if TYPE_CHECKING:` to prevent potential runtime import errors if `mypy-boto3` is not installed or when running a compiled version.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure `boto3` is installed alongside `mypy-boto3-pinpoint-sms-voice` (as shown in the `install` instructions). Understand that the stubs enhance developer tooling but do not execute or modify AWS operations.","message":"These packages provide static type stubs for `boto3`; they do not alter `boto3`'s runtime behavior. They are for compile-time type checking only. Actual AWS API calls still require `boto3` to be installed and properly configured with valid AWS credentials.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}