{"id":3337,"library":"mypy-boto3-backup-gateway","title":"mypy-boto3-backup-gateway","description":"mypy-boto3-backup-gateway provides high-quality type annotations for the boto3 BackupGateway service, ensuring better code completion, static analysis, and error detection in development environments. It is part of the larger `mypy-boto3` ecosystem, generated by `mypy-boto3-builder`. The current version is 1.42.58, and it is frequently updated to align with `boto3` releases and schema changes.","status":"active","version":"1.42.58","language":"python","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","type-hints","stubs","backup-gateway","typed"],"install":[{"cmd":"pip install mypy-boto3-backup-gateway","lang":"bash","label":"Install package"}],"dependencies":[{"reason":"This package provides type annotations for boto3; boto3 itself must be installed to use the annotated AWS SDK client.","package":"boto3","optional":false}],"imports":[{"wrong":"from mypy_boto3_backup_gateway import BackupGatewayClient","symbol":"BackupGatewayClient","correct":"from mypy_boto3_backup_gateway import BackupGatewayClient"}],"quickstart":{"code":"import boto3\nfrom boto3.session import Session\nfrom mypy_boto3_backup_gateway.client import BackupGatewayClient\nfrom mypy_boto3_backup_gateway.type_defs import ListGatewaysOutputTypeDef\n\ndef get_backup_gateway_client() -> BackupGatewayClient:\n    \"\"\"Initializes and returns a type-hinted BackupGateway client.\"\"\"\n    # A real application would configure AWS credentials via environment variables or ~/.aws/credentials\n    session = Session(region_name='us-east-1')\n    client: BackupGatewayClient = session.client('backup-gateway')\n    return client\n\ndef list_all_gateways() -> ListGatewaysOutputTypeDef:\n    \"\"\"Lists all Backup Gateways and returns the typed response.\"\"\"\n    client = get_backup_gateway_client()\n    response: ListGatewaysOutputTypeDef = client.list_gateways()\n    print(f\"Found {len(response['Gateways'])} gateways.\")\n    return response\n\nif __name__ == '__main__':\n    gateways_data = list_all_gateways()\n    # Mypy will now correctly infer types for gateways_data, e.g., gateways_data['Gateways']\n    # without needing runtime checks.\n    for gateway in gateways_data.get('Gateways', []):\n        print(f\"Gateway ARN: {gateway['GatewayArn']}, Name: {gateway['GatewayDisplayName']}\")","lang":"python","description":"This quickstart demonstrates how to initialize a `BackupGatewayClient` with type hints and use a basic operation like `list_gateways`. The `mypy-boto3-backup-gateway` package provides the necessary type definitions for the client and its responses, enabling static type checking with tools like MyPy."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or a newer supported version.","message":"Support for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0. All `mypy-boto3` packages, including `mypy-boto3-backup-gateway`, now require Python 3.9 or newer.","severity":"breaking","affected_versions":">=8.12.0 (builder), >=1.42.x (package)"},{"fix":"Ensure your `mypy` or `pyright` setup is up-to-date and correctly configured to find installed stub packages. In most cases, a standard `pip install` should work, but older or custom setups might need adjustment.","message":"The `mypy-boto3` ecosystem migrated to PEP 561-compliant packaging in `mypy-boto3-builder` version 8.12.0. This might require updating older type checker configurations or virtual environments to correctly discover stubs, though it generally improves compatibility with modern tooling.","severity":"breaking","affected_versions":">=8.12.0 (builder), >=1.42.x (package)"},{"fix":"Review your code for any custom `TypeDef` imports and update the names according to the new conventions.","message":"In `mypy-boto3-builder` version 8.9.0, certain TypeDef names were refactored for clarity and consistency. Specifically, TypeDefs for packed method arguments use shorter names (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`) and conflicting `Extra` postfixes were moved to the end (e.g., `CreateDistributionExtraRequestTypeDef` -> `CreateDistributionRequestExtraTypeDef`).","severity":"breaking","affected_versions":">=8.9.0 (builder), corresponding package versions"},{"fix":"Explicitly add type annotations to your `boto3` client and resource assignments for improved IDE experience.","message":"While `mypy-boto3` strives for implicit type inference, some IDEs (like VSCode with older Python extensions or PyCharm) may still benefit from explicit type annotations for `boto3.client` and `session.client` calls to provide optimal auto-completion and type checking. For example, `client: BackupGatewayClient = session.client('backup-gateway')`.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'1.42.58':54 'align':61 'analysi':27 'annot':16 'aw':68 'backup':4,9,76 'backup-gateway':75 'backupgateway':20 'better':23 'boto3':3,8,19,42,48,63,69 'builder':49 'chang':67 'code':24 'complet':25 'current':51 'detect':30 'develop':32 'ecosystem':43 'ensur':22 'environ':33 'error':29 'frequent':58 'gateway':5,10,77 'generat':44 'high':13 'high-qual':12 'hint':73 'larger':39 'mypi':2,7,41,47,70 'mypy-boto3':40 'mypy-boto3-backup-gateway':1,6 'mypy-boto3-builder':46 'part':36 'provid':11 'qualiti':14 'releas':64 'schema':66 'servic':21 'static':26 'stub':74 'type':15,72,78 'type-hint':71 'updat':59 'version':52","created_at":"2026-04-11T12:36:14.362966+00:00","updated_at":"2026-04-16T16:46:55.522975+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmptr8bqieb/venv/lib/python3.12/site-packages/mypy_boto3_backup_gateway/__init__.py\", line 29, in <module>\n    from .client import BackupGatewayClient\n  File \"/tmp/tmptr8bqieb/venv/lib/python3.12/site-packages/myp"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.43.55","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/youtype/mypy_boto3_builder","docs":"https://youtype.github.io/boto3_stubs_docs/mypy_boto3_backup_gateway/","changelog":null,"pypi":"https://pypi.org/project/mypy-boto3-backup-gateway/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["type-stubs","aws"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-08-29","next_check":"2026-07-10","install_tag":null}}