{"id":3382,"library":"mypy-boto3-workmailmessageflow","title":"mypy-boto3-workmailmessageflow Type Annotations","description":"mypy-boto3-workmailmessageflow provides type annotations (stubs) for the boto3 WorkMailMessageFlow service. These stubs enhance static analysis, autocomplete, and type checking in IDEs and tools like MyPy. The package is currently at version 1.42.3, generated by mypy-boto3-builder 8.12.0, and typically releases updates in alignment with new boto3 and botocore versions.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["mypy","boto3","aws","type-hints","workmailmessageflow","type-stubs","static-analysis"],"install":[{"cmd":"pip install mypy-boto3-workmailmessageflow boto3","lang":"bash","label":"Install with boto3"}],"dependencies":[{"reason":"Provides the AWS SDK runtime functionality that these type stubs annotate.","package":"boto3","optional":false},{"reason":"The primary static type checker for which these annotations are designed.","package":"mypy","optional":true}],"imports":[{"note":"Type stubs are imported from the mypy_boto3_ service-specific package, not directly from boto3 or botocore.","wrong":"from boto3.client import WorkMailMessageFlowClient","symbol":"WorkMailMessageFlowClient","correct":"from mypy_boto3_workmailmessageflow import WorkMailMessageFlowClient"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_workmailmessageflow import WorkMailMessageFlowClient\nfrom os import environ\n\n# Instantiate a WorkMailMessageFlow client with type hints\nclient: WorkMailMessageFlowClient = boto3.client(\n    \"workmailmessageflow\",\n    region_name=environ.get(\"AWS_REGION\", \"us-east-1\"),\n    aws_access_key_id=environ.get(\"AWS_ACCESS_KEY_ID\", \"\"),\n    aws_secret_access_key=environ.get(\"AWS_SECRET_ACCESS_KEY\", \"\")\n)\n\n# Example usage: Get raw message content (requires an existing message ID)\n# Replace 'your-message-id' with an actual message ID from WorkMailMessageFlow\ntry:\n    message_id = environ.get(\"WORKMAIL_MESSAGE_ID\", \"your-message-id\")\n    response = client.get_raw_message_content(\n        messageId=message_id\n    )\n    print(f\"Successfully retrieved message content for ID: {message_id}\")\n    # The Body is a StreamingBody, read its content\n    # with response['messageContent']._raw_stream as stream:\n    #    print(stream.read().decode('utf-8'))\nexcept client.exceptions.MessageNotFoundException:\n    print(f\"Message with ID '{message_id}' not found.\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n","lang":"python","description":"This example demonstrates how to initialize a WorkMailMessageFlow client with type annotations and call a method to retrieve raw message content. It uses environment variables for AWS credentials and region, falling back to placeholders for demonstration purposes. Note that `mypy-boto3-workmailmessageflow` only provides type information, so `boto3` must be installed separately."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer. The `requires_python` metadata is `>=3.9`.","message":"As of mypy-boto3-builder version 8.12.0, support for Python 3.8 has been removed across all generated `mypy-boto3` packages, including `mypy-boto3-workmailmessageflow`. Projects using Python 3.8 will encounter issues.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0"},{"fix":"Ensure your `mypy` and IDE configurations are up-to-date and correctly detect PEP 561 packages. For `mypy`, this usually works automatically with `pip install`.","message":"The `mypy-boto3-builder` (version 8.12.0) migrated to PEP 561 compliant stub-only packages. This might affect how type checkers locate and interpret stubs if your tooling or project setup relies on older assumptions about stub package structure.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0"},{"fix":"Review and update explicit `TypeDef` imports and references in your code to match the new naming conventions. Consult the `mypy-boto3-workmailmessageflow.type_defs` module for current names.","message":"In `mypy-boto3-builder` version 8.9.0, TypeDef naming conventions changed for packed method arguments (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`) and the `Extra` postfix for conflicting TypeDefs was moved. This could break type checking for code explicitly importing or referencing these generated type definitions.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.9.0"},{"fix":"Ensure `boto3` is installed in your environment: `pip install boto3`.","message":"`mypy-boto3-workmailmessageflow` provides *only* type annotations, not the `boto3` library itself. You must install `boto3` separately for your code to run at runtime.","severity":"gotcha","affected_versions":"All"},{"fix":"Add explicit type annotations for `boto3` client and resource objects in your code.","message":"While some IDEs and `mypy` might infer types, explicitly annotating `boto3.client` calls (e.g., `client: WorkMailMessageFlowClient = boto3.client(\"workmailmessageflow\")`) is highly recommended for optimal autocomplete and precise type checking.","severity":"gotcha","affected_versions":"All"},{"fix":"Consider installing `mypy-boto3-workmailmessageflow-lite` instead: `pip install mypy-boto3-workmailmessageflow-lite`.","message":"PyCharm users might experience slow performance with `Literal` overloads due to a known IDE issue (PY-40997). For resource-constrained environments or performance-sensitive setups, `boto3-stubs-lite` is recommended as an alternative.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}