{"id":3686,"library":"mypy-boto3-route53-recovery-cluster","title":"Type Annotations for boto3 Route53RecoveryCluster","description":"This library provides comprehensive type annotations for the `boto3` AWS SDK's Route53RecoveryCluster service (version 1.42.3), generated by `mypy-boto3-builder` 8.12.0. It enhances development with static type checking, autocompletion, and early error detection for `boto3` calls related to Route53RecoveryCluster. The project is actively maintained, with new versions frequently released, often in sync with `boto3` updates and `mypy-boto3-builder` enhancements.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["AWS","boto3","mypy","type-hinting","static-analysis","cloud","Route53RecoveryCluster"],"install":[{"cmd":"pip install mypy-boto3-route53-recovery-cluster","lang":"bash","label":"Install package"}],"dependencies":[{"reason":"Provides the underlying AWS SDK functionality that these type annotations describe.","package":"boto3"},{"reason":"The primary static type checker for which these annotations are designed.","package":"mypy","optional":true},{"reason":"May be required for compatibility with certain Python versions or advanced `typing` features, though often resolved by `install_requires` in modern builder versions (Python 3.9+).","package":"typing-extensions","optional":true}],"imports":[{"symbol":"Route53RecoveryClusterClient","correct":"from mypy_boto3_route53_recovery_cluster.client import Route53RecoveryClusterClient"},{"note":"Example of importing a TypeDef for request/response bodies.","symbol":"DescribeRecoveryGroupResponseTypeDef","correct":"from mypy_boto3_route53_recovery_cluster.type_defs import DescribeRecoveryGroupResponseTypeDef"},{"note":"Import literals for service names, paginators, or waiters for improved type safety.","symbol":"Route53RecoveryClusterServiceName","correct":"from mypy_boto3_route53_recovery_cluster.literals import Route53RecoveryClusterServiceName"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n    from mypy_boto3_route53_recovery_cluster.client import Route53RecoveryClusterClient\n    from mypy_boto3_route53_recovery_cluster.type_defs import ListClustersResponseTypeDef\n\n\ndef get_recovery_cluster_info() -> ListClustersResponseTypeDef:\n    # It's recommended to explicitly type the client for best autocompletion and type checking.\n    client: Route53RecoveryClusterClient = boto3.client(\n        \"route53-recovery-cluster\",\n        region_name=\"us-east-1\", # Replace with your region\n        aws_access_key_id=\"AKIATEST\", # Use os.environ.get('AWS_ACCESS_KEY_ID', '') in real code\n        aws_secret_access_key=\"SECRETLONGKEY\", # Use os.environ.get('AWS_SECRET_ACCESS_KEY', '')\n        aws_session_token=\"SESSIONTOKEN\" # Use os.environ.get('AWS_SESSION_TOKEN', '') if applicable\n    )\n\n    response = client.list_clusters()\n    print(f\"Clusters: {response.get('Clusters')}\")\n    return response\n\nif __name__ == \"__main__\":\n    # This part would typically run in a properly configured AWS environment\n    # For this example, we'll just print a placeholder as credentials are not live\n    print(\"--- Mocking AWS client call for quickstart ---\")\n    if TYPE_CHECKING:\n        result = get_recovery_cluster_info()\n        print(f\"Mocked Cluster List (Type-checked): {result.get('Clusters')}\")\n    else:\n        print(\"Run mypy to check types. Actual execution requires AWS credentials.\")","lang":"python","description":"This quickstart demonstrates how to initialize a type-hinted `Route53RecoveryClusterClient` and call a basic operation like `list_clusters`. The `TYPE_CHECKING` block ensures that `mypy` can use the specific client type for robust static analysis, while allowing the code to run without `mypy-boto3` dependencies in production. Remember to replace placeholder credentials with actual AWS configuration or environment variables."},"warnings":[{"fix":"Upgrade your Python environment to version 3.9 or newer.","message":"Python 3.8 support was removed with `mypy-boto3-builder` version 8.12.0. Users on Python 3.8 or older must upgrade their Python environment to `3.9` or higher to continue receiving updates for `mypy-boto3` packages.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0"},{"fix":"Ensure your type checker (e.g., `mypy`) is configured to correctly discover PEP 561 compliant stub packages. Most standard setups should handle this automatically.","message":"`mypy-boto3-builder` (from which this package is generated) migrated to PEP 561 compliant packages in version 8.12.0. This changes how stub files are distributed and discovered, potentially impacting complex build setups or custom stub path configurations.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0"},{"fix":"Review your code for direct imports of `TypeDef`s and update their names according to the new conventions as indicated by your type checker's errors.","message":"Starting with `mypy-boto3-builder` 8.9.0, `TypeDef` naming conventions changed. This includes shortening names for packed method arguments (e.g., `RequestRequestTypeDef` -> `RequestTypeDef`) and moving `Extra` postfixes. This can lead to `NameError` or incorrect type hints if you directly import or refer to these `TypeDef`s by their old names.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0"},{"fix":"Add explicit type annotations to your `boto3` client and resource objects, importing the specific client/resource type from `mypy_boto3_SERVICE.client` or `mypy_boto3_SERVICE.service_resource`.","message":"For optimal autocompletion and robust type checking, especially within IDEs like VSCode or PyCharm, it's often recommended to explicitly annotate the type of the `boto3` client (e.g., `client: Route53RecoveryClusterClient = boto3.client(...)`) rather than relying solely on implicit type inference.","severity":"gotcha","affected_versions":"All versions"},{"fix":"To resolve this, assign `object` to the type symbols in the `else` branch of your `TYPE_CHECKING` block. Example: `else: Route53RecoveryClusterClient = object`.","message":"When conditionally importing `mypy-boto3` types using `if TYPE_CHECKING:`, `pylint` might report 'Undefined variable' errors in the `else` branch.","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"}