{"id":3041,"library":"mypy-boto3-cloud9","title":"mypy-boto3-cloud9 Type Annotations","description":"Provides type annotations for the `boto3` Cloud9 service, enabling static type checking with tools like `mypy`, as well as enhanced auto-completion in IDEs. It is part of the `mypy-boto3-builder` ecosystem, with versions typically aligning with `boto3` releases, ensuring up-to-date type stubs for AWS services.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["type-hints","mypy","boto3","aws","cloud9","stubs","static-analysis"],"install":[{"cmd":"pip install mypy-boto3-cloud9 boto3 mypy","lang":"bash","label":"Install standalone package with boto3 and mypy"},{"cmd":"pip install 'boto3-stubs[cloud9]' boto3 mypy","lang":"bash","label":"Install via boto3-stubs meta-package"}],"dependencies":[{"reason":"Runtime dependency for the AWS SDK being type-annotated.","package":"boto3"},{"reason":"Static type checker that consumes these annotations.","package":"mypy"},{"reason":"Requires Python 3.9 or newer.","package":"python","optional":false}],"imports":[{"note":"The primary client type for Cloud9 operations.","symbol":"Cloud9Client","correct":"from mypy_boto3_cloud9.client import Cloud9Client"},{"note":"Example of a type definition for a specific API response.","symbol":"ListEnvironmentsResultTypeDef","correct":"from mypy_boto3_cloud9.type_defs import ListEnvironmentsResultTypeDef"},{"note":"Literal type for 'cloud9' service name, useful for explicit client typing with boto3-stubs.","wrong":"from mypy_boto3_cloud9.client import Cloud9ServiceName","symbol":"Cloud9ServiceName","correct":"from mypy_boto3_cloud9.literals import Cloud9ServiceName"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_cloud9.client import Cloud9Client\nfrom mypy_boto3_cloud9.type_defs import ListEnvironmentsResultTypeDef\n\ndef get_cloud9_environments(region: str) -> ListEnvironmentsResultTypeDef:\n    \"\"\"Lists AWS Cloud9 environments with type annotations.\"\"\"\n    client: Cloud9Client = boto3.client(\"cloud9\", region_name=region)\n    response: ListEnvironmentsResultTypeDef = client.list_environments()\n    return response\n\nif __name__ == \"__main__\":\n    # Replace with your desired region, or use environment variable/config\n    aws_region = \"us-east-1\"\n    try:\n        environments = get_cloud9_environments(aws_region)\n        print(f\"Cloud9 environments in {aws_region}:\")\n        for env_id in environments.get(\"environmentIds\", []):\n            print(f\"- {env_id}\")\n    except Exception as e:\n        print(f\"Error listing environments: {e}\")\n\n# To run with mypy:\n# save as cloud9_example.py\n# mypy cloud9_example.py\n","lang":"python","description":"This example demonstrates how to use `mypy-boto3-cloud9` to type-hint a `boto3` Cloud9 client and its response. It lists the available Cloud9 environments in a specified AWS region. Run `mypy cloud9_example.py` to check for type errors."},"warnings":[{"fix":"Upgrade Python to 3.9 or a later version.","message":"Support for Python 3.8 was officially removed starting with `mypy-boto3-builder` version 8.12.0. Users on Python 3.8 will need to upgrade their Python version to 3.9 or newer.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0 (equivalent to mypy-boto3-cloud9 >= 1.42.3)"},{"fix":"Review and update `TypeDef` import names and usages based on the new convention.","message":"TypeDef naming conventions were changed in `mypy-boto3-builder` version 8.9.0. This might lead to breaking changes for explicit `TypeDef` imports, where names like `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0 (equivalent to mypy-boto3-cloud9 >= 1.42.3)"},{"fix":"Update `pip` and other package management tools to their latest versions. Verify `mypy` is configured to find stub packages correctly.","message":"The `mypy-boto3` ecosystem migrated to PEP 561 compliant packages in `mypy-boto3-builder` version 8.12.0. While this generally improves compatibility, ensure your tooling (e.g., `setuptools`, `pip`) is up-to-date to correctly recognize and utilize these new package structures.","severity":"gotcha","affected_versions":"mypy-boto3-builder >= 8.12.0 (equivalent to mypy-boto3-cloud9 >= 1.42.3)"},{"fix":"Consider installing `boto3-stubs` with the desired service extras, or explicitly annotate the return type of `boto3.client()` calls (e.g., `client: Cloud9Client = boto3.client(\"cloud9\")`).","message":"While `mypy-boto3-cloud9` provides standalone stubs, for comprehensive type-hinting of `boto3.client` and `boto3.resource` calls, using the `boto3-stubs` meta-package (e.g., `pip install 'boto3-stubs[cloud9]'`) is often recommended. Standalone packages might require more explicit type annotations for `boto3.client` return values.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consult the `mypy-boto3-builder` changelog or documentation for service-specific updates if type stubs for a particular AWS service are not found or cause issues.","message":"AWS services can be renamed or deprecated, leading to corresponding changes in `mypy-boto3` packages. For example, `sms-voice` was excluded in `mypy-boto3-builder` 8.11.0, recommending `pinpoint-sms-voice` instead. Always check release notes if a service package seems to be missing or misbehaving.","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"}