{"id":3024,"library":"mypy-boto3-appstream","title":"mypy-boto3-appstream Type Annotations","description":"mypy-boto3-appstream provides comprehensive type annotations for the `boto3` AWS AppStream service, enhancing static analysis with tools like Mypy, Pyright, VSCode, and PyCharm. It is automatically generated by the `mypy-boto3-builder` and aims to keep pace with `boto3` updates, typically releasing new versions in alignment with `boto3`'s release cadence. The current version is 1.42.82.","status":"active","version":"1.42.82","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["type-hinting","boto3","aws","mypy","stubs","appstream","static-analysis"],"install":[{"cmd":"pip install mypy-boto3-appstream boto3","lang":"bash","label":"Install specific service stubs"},{"cmd":"pip install 'boto3-stubs[appstream]' boto3","lang":"bash","label":"Install via boto3-stubs extras"}],"dependencies":[{"reason":"Provides the AWS SDK for Python that these stubs type-hint.","package":"boto3"},{"reason":"Requires Python 3.9 or higher. Support for Python 3.8 was removed in mypy-boto3-builder v8.12.0.","package":"python","version":">=3.9"},{"reason":"The primary static type checker these stubs are designed for.","package":"mypy","optional":true}],"imports":[{"symbol":"AppStreamClient","correct":"from mypy_boto3_appstream import AppStreamClient"},{"symbol":"AccessEndpointTypeDef","correct":"from mypy_boto3_appstream.type_defs import AccessEndpointTypeDef"},{"symbol":"AccessEndpointTypeType","correct":"from mypy_boto3_appstream.literals import AccessEndpointTypeType"},{"symbol":"FleetStartedWaiter","correct":"from mypy_boto3_appstream.waiter import FleetStartedWaiter"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_appstream import AppStreamClient\nfrom mypy_boto3_appstream.type_defs import DescribeFleetsResultTypeDef\n\ndef get_appstream_fleets() -> DescribeFleetsResultTypeDef:\n    client: AppStreamClient = boto3.client('appstream')\n    response = client.describe_fleets()\n    print(f\"Found {len(response['Fleets'])} AppStream fleets.\")\n    return response\n\nif __name__ == '__main__':\n    # This quickstart assumes AWS credentials are configured (e.g., via AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION_NAME env vars)\n    # or ~/.aws/credentials and ~/.aws/config files.\n    # Replace with actual usage or mock for testing if needed.\n    # Example of using environment variables for auth (for demonstration, actual auth depends on boto3 setup):\n    # import os\n    # if not os.environ.get('AWS_ACCESS_KEY_ID'):\n    #     os.environ['AWS_ACCESS_KEY_ID'] = 'AKIA...'\n    # if not os.environ.get('AWS_SECRET_ACCESS_KEY'):\n    #     os.environ['AWS_SECRET_ACCESS_KEY'] = 'secret...'\n    # if not os.environ.get('AWS_REGION_NAME'):\n    #     os.environ['AWS_REGION_NAME'] = 'us-east-1'\n\n    try:\n        fleets_data = get_appstream_fleets()\n        # Further processing with type-hinted data, e.g., fleets_data['Fleets'][0]['DisplayName']\n    except Exception as e:\n        print(f\"Error fetching AppStream fleets: {e}\")","lang":"python","description":"This example demonstrates how to initialize an AppStream client with type annotations and use a type-hinted `TypeDef` for the response. It queries existing AppStream fleets."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer. The `requires_python` metadata is `^3.9`.","message":"Support for Python 3.8 was removed from `mypy-boto3-builder` (which generates these stubs). Using `mypy-boto3-appstream` with Python 3.8 will no longer receive updates or guaranteed compatibility.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0"},{"fix":"Review your code for explicit `TypeDef` imports and adjust names according to the latest documentation or builder output.","message":"Type definition (TypeDef) names for packed method arguments may have changed for some services, using shorter names (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`). While not specific to `AppStream` in the reported changes, this indicates a pattern for future breaking changes across services.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0"},{"fix":"Use `from typing import TYPE_CHECKING; if TYPE_CHECKING: from mypy_boto3_appstream import AppStreamClient else: AppStreamClient = object` or similar patterns.","message":"For Pylint compatibility, if you use `mypy-boto3` stubs with `pylint`, you might encounter false positives (e.g., undefined variables). It is recommended to wrap stub imports or type assignments in a `TYPE_CHECKING` block to avoid these errors in runtime code.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Explicitly add type hints to your client objects, e.g., `client: AppStreamClient = boto3.client('appstream')`.","message":"While PyCharm and Mypy often automatically discover types for `boto3.client()` calls, VSCode users might need to explicitly annotate the client variable for full auto-completion and type inference support.","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"}