{"id":6729,"library":"mypy-boto3-connecthealth","title":"mypy-boto3-connecthealth","description":"mypy-boto3-connecthealth provides static type annotations for the `boto3` AWS SDK's ConnectHealth service. Generated with `mypy-boto3-builder` (version 8.12.0 for the current package version), it enhances developer experience by enabling comprehensive type checking, improved IDE auto-completion, and early error detection for `boto3` code interacting with AWS ConnectHealth. The library is actively maintained with frequent updates reflecting `boto3` releases and new AWS services.","status":"active","version":"1.42.62","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","type-stubs","connecthealth","types","static-analysis"],"install":[{"cmd":"pip install mypy-boto3-connecthealth boto3","lang":"bash","label":"Install with boto3 runtime"},{"cmd":"pip install 'boto3-stubs[connecthealth]' boto3","lang":"bash","label":"Install via boto3-stubs meta-package"}],"dependencies":[{"reason":"Runtime dependency for interacting with AWS services.","package":"boto3","optional":false},{"reason":"Static type checker to utilize the provided type annotations.","package":"mypy","optional":true}],"imports":[{"symbol":"ConnectHealthClient","correct":"from mypy_boto3_connecthealth.client import ConnectHealthClient"},{"symbol":"DescribeEventsPaginator","correct":"from mypy_boto3_connecthealth.paginator import DescribeEventsPaginator"},{"symbol":"EventTypeDef","correct":"from mypy_boto3_connecthealth.type_defs import EventTypeDef"}],"quickstart":{"code":"from typing import TYPE_CHECKING\nimport boto3\nimport os\n\nif TYPE_CHECKING:\n    from mypy_boto3_connecthealth.client import ConnectHealthClient\n    from mypy_boto3_connecthealth.type_defs import EventTypeDef\n\n\ndef get_connect_health_events(region_name: str) -> list[\"EventTypeDef\"]:\n    # boto3 client creation without explicit type hint will still work\n    # but explicit type hints provide better IDE support and type checking\n    client: ConnectHealthClient = boto3.client(\n        \"connect-health\",\n        region_name=region_name,\n        aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', ''),\n        aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', ''),\n        aws_session_token=os.environ.get('AWS_SESSION_TOKEN', '')\n    )\n\n    # Example: Describe events (Connect Health operations might require specific permissions)\n    try:\n        response = client.describe_events(\n            Filter={\n                'EventType': {'Values': ['AWS_HEALTH_EVENT']}\n            }\n        )\n        return response['Events']\n    except client.exceptions.InvalidRequestException as e:\n        print(f\"Error describing events: {e}\")\n        return []\n\nif __name__ == \"__main__\":\n    events = get_connect_health_events(\"us-east-1\")\n    print(f\"Found {len(events)} Connect Health events.\")\n    for event in events:\n        print(f\"  - Event ARN: {event['eventArn']}\")\n","lang":"python","description":"This quickstart demonstrates how to initialize a `boto3` ConnectHealth client with type annotations and fetch events. It includes explicit type hints for `ConnectHealthClient` and `EventTypeDef` to leverage static analysis. Ensure `boto3` is installed alongside `mypy-boto3-connecthealth`."},"warnings":[{"fix":"Upgrade your Python environment to version 3.9 or newer.","message":"Support for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0 (November 2025). This affects all generated `mypy-boto3` stub packages, including `mypy-boto3-connecthealth` versions 1.42.x and newer. Projects using Python 3.8 or older will encounter compatibility issues.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0, mypy-boto3-connecthealth >= 1.42.x"},{"fix":"Review your codebase for explicit `TypeDef` annotations and update them to reflect the new naming conventions, consulting the `mypy_boto3_connecthealth.type_defs` module for the correct names.","message":"Type definition (TypeDef) naming conventions changed in `mypy-boto3-builder` version 8.9.0 (November 2025). Type definition names for method arguments and conflicting types may have been shortened or rearranged (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`). This could break existing explicit type annotations in your codebase that referenced the old names.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0, mypy-boto3-connecthealth >= 1.42.x (packages generated with 8.9.0+)"},{"fix":"Always ensure `boto3` is installed in your runtime environment (e.g., `pip install boto3`).","message":"`mypy-boto3-connecthealth` is a stub-only package and does not include the actual `boto3` runtime. Your application must have `boto3` installed to function at runtime. The type stubs are solely for static analysis.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Update your type checker (e.g., `pip install --upgrade mypy`) and ensure it's configured to recognize PEP 561-compliant stub packages.","message":"Following the migration to PEP 561 compliant packages in `mypy-boto3-builder` 8.12.0, ensure your `mypy` or other type checker is up-to-date. Older versions might not correctly discover or utilize the stubs, leading to `Missing type stub` errors or incorrect type inference.","severity":"gotcha","affected_versions":"mypy-boto3-builder >= 8.12.0, mypy-boto3-connecthealth >= 1.42.x"},{"fix":"Wrap your `from mypy_boto3_SERVICE import ...` statements in `if TYPE_CHECKING:` blocks.","message":"For optimal performance and to avoid runtime dependencies, type imports from `mypy_boto3_*` packages should ideally be placed within `if TYPE_CHECKING:` blocks. This ensures that these stub packages are only used by static analysis tools and are not treated as runtime dependencies.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consider installing the `boto3-stubs-lite` version (e.g., `pip install 'boto3-stubs-lite[connecthealth]'`) which is more RAM-friendly but requires explicit type annotations. Alternatively, disable PyCharm's internal type checker and use `mypy` or `pyright` instead.","message":"PyCharm users might experience slow performance and high CPU usage due to a known issue with Literal overloads (issue PY-40997) when using `boto3-stubs`.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}