{"id":3621,"library":"mypy-boto3-mailmanager","title":"mypy-boto3-mailmanager","description":"mypy-boto3-mailmanager provides type annotations for the `boto3` MailManager service, enabling static type checking with tools like MyPy and enhanced IDE auto-completion. It is part of the `mypy-boto3` ecosystem, automatically generated by `mypy-boto3-builder 8.12.0`, and keeps pace with `boto3` updates to ensure all available MailManager service methods, clients, paginators, literals, and type definitions are fully type-annotated. The current version is 1.42.80.","status":"active","version":"1.42.80","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["mypy","boto3","aws","types","stubs","type-checking","mailmanager"],"install":[{"cmd":"pip install mypy-boto3-mailmanager boto3","lang":"bash","label":"Install standalone stub and boto3"},{"cmd":"pip install 'boto3-stubs[mailmanager]' boto3","lang":"bash","label":"Install stub as part of boto3-stubs collection"}],"dependencies":[{"reason":"Provides the AWS SDK for Python at runtime, which these stubs type-check.","package":"boto3"},{"reason":"Required for compatibility with older Python versions, though current library requires Python >=3.9, it is listed as a dependency on PyPI.","package":"typing-extensions","optional":true}],"imports":[{"note":"The MailManagerClient type is provided by the stub package, not directly from the runtime `boto3` library.","wrong":"from boto3.client import MailManagerClient","symbol":"MailManagerClient","correct":"from mypy_boto3_mailmanager import MailManagerClient"}],"quickstart":{"code":"from typing import TYPE_CHECKING\nimport boto3\nimport os\n\nif TYPE_CHECKING:\n    from mypy_boto3_mailmanager import MailManagerClient\n    from mypy_boto3_mailmanager.type_defs import CreateAddonResponseTypeDef\n\n\ndef create_mail_manager_client() -> 'MailManagerClient':\n    \"\"\"Creates a typed MailManager client.\"\"\"\n    session = boto3.session.Session(\n        aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', 'DUMMY_KEY'),\n        aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', 'DUMMY_SECRET'),\n        region_name=os.environ.get('AWS_REGION', 'us-east-1')\n    )\n    # Explicit type annotation helps mypy and IDEs\n    client: MailManagerClient = session.client('mailmanager')\n    return client\n\n\ndef list_mail_manager_addons():\n    \"\"\"Lists MailManager addons with type-checked client.\"\"\"\n    client = create_mail_manager_client()\n    try:\n        response = client.list_addons(PageSize=10)\n        # Using TypeDef for response provides further type safety\n        addons: list[dict] = response.get('Addons', [])\n        print(f\"Found {len(addons)} MailManager addons.\")\n        for addon in addons:\n            print(f\"  Addon ID: {addon.get('AddonId')}\")\n    except client.exceptions.ClientError as e:\n        print(f\"Error listing addons: {e}\")\n\nif __name__ == '__main__':\n    list_mail_manager_addons()\n","lang":"python","description":"This example demonstrates how to initialize a `boto3` MailManager client with explicit type annotations from `mypy-boto3-mailmanager`. It includes a basic operation (listing addons) and showcases the use of `TYPE_CHECKING` for conditional imports to maintain runtime efficiency. Remember to replace placeholder AWS credentials with actual environment variables or configuration."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Support for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0, which generated this package. `mypy-boto3-mailmanager` now requires Python 3.9 or higher.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0, mypy-boto3-mailmanager >=1.42.80"},{"fix":"Ensure `mypy-boto3-mailmanager` is correctly installed in your type-checking environment. MyPy should automatically discover it, but verify your MyPy configuration to include installed packages.","message":"The `mypy-boto3` ecosystem migrated to PEP 561-compatible packages in `mypy-boto3-builder` 8.12.0. This change affects how type checkers discover and prioritize type information. Stub-only packages are now the standard, superseding any inline types in the runtime library if present.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0, mypy-boto3-mailmanager >=1.42.80"},{"fix":"Review your code for any custom type annotations using `mypy_boto3_mailmanager.type_defs` and update TypeDef names if they no longer match.","message":"In `mypy-boto3-builder` 8.9.0, a breaking change was introduced for TypeDef naming conventions. Some packed method arguments or conflicting TypeDefs had their names shortened or adjusted (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). This *could* affect TypeDefs within MailManager if it had similarly named long type definitions.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.9.0, mypy-boto3-mailmanager >=1.34.0 (approximate)"},{"fix":"Always install `boto3` alongside `mypy-boto3-mailmanager` (e.g., `pip install boto3 mypy-boto3-mailmanager`).","message":"`mypy-boto3-mailmanager` provides *only* type stubs. It does not include the `boto3` runtime library itself. `boto3` must be installed separately in your project for your code to function.","severity":"gotcha","affected_versions":"All"},{"fix":"Annotate your client variables, e.g., `client: MailManagerClient = session.client('mailmanager')`.","message":"For optimal type checking and IDE auto-completion, especially with `boto3.client()` and `boto3.session.client()`, it is highly recommended to use explicit type annotations for your client objects.","severity":"gotcha","affected_versions":"All"},{"fix":"Wrap your `from mypy_boto3_mailmanager import ...` statements with `from typing import TYPE_CHECKING` and an `if TYPE_CHECKING:` block.","message":"To prevent `mypy-boto3-mailmanager` from becoming a runtime dependency in production environments, encapsulate its imports within a `if TYPE_CHECKING:` block. This ensures the imports are only processed by type checkers and ignored at runtime.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}