{"library":"mypy-boto3-apigatewayv2","title":"mypy-boto3-apigatewayv2 type annotations","description":"mypy-boto3-apigatewayv2 provides a complete set of type annotations for the boto3 ApiGatewayV2 client and associated data structures, enabling static type checking with tools like MyPy. It ensures type safety and autocompletion for AWS SDK usage. The current version is 1.42.76, aligning with the `boto3` version it targets. New versions are released frequently in sync with `mypy-boto3-builder` updates and AWS API changes.","language":"python","status":"active","last_verified":"Thu May 14","install":{"commands":["pip install boto3 mypy-boto3-apigatewayv2 mypy"],"cli":null},"imports":["from mypy_boto3_apigatewayv2.client import ApiGatewayV2Client","from mypy_boto3_apigatewayv2.type_defs import CreateApiRequestRequestTypeDef","import mypy_boto3_apigatewayv2"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import boto3\nimport mypy_boto3_apigatewayv2  # Import for MyPy to discover stubs\nfrom mypy_boto3_apigatewayv2.client import ApiGatewayV2Client\nfrom mypy_boto3_apigatewayv2.type_defs import CreateApiRequestRequestTypeDef\n\n# Instantiate a boto3 client at runtime. The stub package provides type annotations.\nclient: ApiGatewayV2Client = boto3.client(\"apigatewayv2\")\n\nprint(f\"Client type at runtime: {type(client)}\")\n\n# Example of a type-checked input dictionary for a method call\n# MyPy will validate that 'create_api_params' conforms to CreateApiRequestRequestTypeDef\ncreate_api_params: CreateApiRequestRequestTypeDef = {\n    \"Name\": \"MyExampleApiForTypes\",\n    \"ProtocolType\": \"WEBSOCKET\", # or 'HTTP'\n    \"Description\": \"API created for type demonstration\",\n    \"Tags\": {\"Project\": \"ChecklistDay\"}\n    # Add other required parameters as per AWS API Gateway V2 documentation if performing a real call\n}\n\n# Although this call will likely fail without valid AWS credentials and full required parameters,\n# it is syntactically correct and demonstrates where type-checking benefits apply.\ntry:\n    response = client.create_api(**create_api_params)\n    print(f\"Attempted to create API with ID: {response.get('ApiId', 'N/A')}\")\nexcept Exception as e:\n    print(f\"Note: API call failed, likely due to missing AWS credentials or incomplete parameters. Error: {e}\")\n\n# MyPy would ensure that 'response' is treated as a CreateApiResultTypeDef.","lang":"python","description":"This quickstart demonstrates how to use `mypy-boto3-apigatewayv2` to add type annotations to a `boto3` client. It shows both explicit type hinting for the client and for a request dictionary, which MyPy uses to provide autocompletion and detect type mismatches. Note that `boto3` must be installed alongside the stub package.","tag":null,"tag_description":null,"last_tested":"2026-04-25","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-14","installed_version":"1.43.0","pypi_latest":"1.43.0","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":5.7,"avg_import_s":0.7,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"boto3","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.61,"mem_mb":14.4,"disk_size":"115.1M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"boto3","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.67,"mem_mb":14.3,"disk_size":"110.1M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"boto3","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":6.1,"import_time_s":0.46,"mem_mb":14.4,"disk_size":"114M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"boto3","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.53,"mem_mb":14.3,"disk_size":"109M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"boto3","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.91,"mem_mb":16.1,"disk_size":"121.2M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"boto3","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":1.01,"mem_mb":16,"disk_size":"116.2M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"boto3","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5.5,"import_time_s":0.8,"mem_mb":16.1,"disk_size":"120M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"boto3","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.85,"mem_mb":16,"disk_size":"115M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"boto3","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.7,"mem_mb":15.2,"disk_size":"112.9M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"boto3","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.75,"mem_mb":15.1,"disk_size":"107.8M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"boto3","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5,"import_time_s":0.76,"mem_mb":15.2,"disk_size":"112M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"boto3","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.87,"mem_mb":15.1,"disk_size":"107M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"boto3","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.7,"mem_mb":16.4,"disk_size":"112.8M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"boto3","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.73,"mem_mb":16.2,"disk_size":"107.5M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"boto3","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":4.9,"import_time_s":0.78,"mem_mb":16.3,"disk_size":"112M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"boto3","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.89,"mem_mb":16.2,"disk_size":"107M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"boto3","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.49,"mem_mb":13.4,"disk_size":"106.6M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"boto3","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.54,"mem_mb":13.4,"disk_size":"105.9M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"boto3","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":7,"import_time_s":0.5,"mem_mb":13.4,"disk_size":"106M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"boto3","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.51,"mem_mb":13.4,"disk_size":"105M"}]}}