{"id":3637,"library":"mypy-boto3-migration-hub-refactor-spaces","title":"mypy-boto3-migration-hub-refactor-spaces Type Stubs","description":"This package provides type annotations for the `boto3` AWS Migration Hub Refactor Spaces service (version 1.42.3), generated by the `mypy-boto3-builder`. It enables static type checking with tools like `mypy` and enhances autocompletion and error detection in IDEs for `boto3` users. The library is actively maintained, with updates typically mirroring `boto3` releases and the `mypy-boto3-builder`'s development cadence.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["boto3","aws","mypy","types","stubs","migration-hub-refactor-spaces","type-checking","cloud"],"install":[{"cmd":"pip install mypy-boto3-migration-hub-refactor-spaces boto3 mypy","lang":"bash","label":"Install with boto3 and mypy"}],"dependencies":[{"reason":"Provides the AWS SDK runtime functionality that these stubs type-check.","package":"boto3"},{"reason":"The primary static type checker for which these stubs are designed.","package":"mypy","optional":true}],"imports":[{"note":"Importing the specific client class from the stub package enables full type checking and IDE autocompletion.","wrong":"client = boto3.client('migration-hub-refactor-spaces')","symbol":"MigrationHubRefactorSpacesClient","correct":"from mypy_boto3_migration_hub_refactor_spaces.client import MigrationHubRefactorSpacesClient"},{"note":"TypeDefs provide precise type hints for API response structures.","symbol":"ListEnvironmentsOutputTypeDef","correct":"from mypy_boto3_migration_hub_refactor_spaces.type_defs import ListEnvironmentsOutputTypeDef"},{"note":"Literals provide type-checked string constants for specific API parameters.","symbol":"EnvironmentStatusType","correct":"from mypy_boto3_migration_hub_refactor_spaces.literals import EnvironmentStatusType"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_migration_hub_refactor_spaces.client import MigrationHubRefactorSpacesClient\nfrom mypy_boto3_migration_hub_refactor_spaces.type_defs import ListEnvironmentsOutputTypeDef\nfrom mypy_boto3_migration_hub_refactor_spaces.literals import EnvironmentStatusType\n\ndef get_typed_client() -> MigrationHubRefactorSpacesClient:\n    \"\"\"Returns a type-annotated Migration Hub Refactor Spaces client.\"\"\"\n    # boto3 is the actual runtime library, mypy-boto3-migration-hub-refactor-spaces provides type hints\n    client: MigrationHubRefactorSpacesClient = boto3.client(\"migration-hub-refactor-spaces\")\n    return client\n\nif __name__ == \"__main__\":\n    refactor_client = get_typed_client()\n    \n    try:\n        # Example: List environments with type-checked response\n        environments: ListEnvironmentsOutputTypeDef = refactor_client.list_environments(\n            # Add optional filters for type-checking\n            MaxResults=100\n        )\n        print(f\"Found {len(environments.get('EnvironmentSummaryList', []))} environments.\")\n\n        # Example of using a literal for a parameter\n        # This is a placeholder as list_environments doesn't have a status filter directly\n        # if environments.get('EnvironmentSummaryList'):\n        #     first_env = environments['EnvironmentSummaryList'][0]\n        #     if first_env.get('Status') == EnvironmentStatusType.ACTIVE:\n        #         print(f\"First environment '{first_env.get('Name')}' is active.\")\n\n    except refactor_client.exceptions.ResourceNotFoundException:\n        print(\"No Refactor Spaces environments found.\")\n    except Exception as e:\n        print(f\"An unexpected error occurred: {e}\")","lang":"python","description":"Demonstrates how to obtain a type-annotated `boto3` client for Migration Hub Refactor Spaces and perform a basic API call with type-checked inputs and outputs. Ensure `boto3` is installed alongside this stub package."},"warnings":[{"fix":"Upgrade Python to version 3.9 or newer.","message":"Support for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0. Users on Python 3.8 or older will need to upgrade their Python version.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0 (affects all generated stubs)"},{"fix":"Ensure your `mypy` configuration is up-to-date and that stub packages are installed in the same environment as `mypy`.","message":"The `mypy-boto3-builder` (version 8.12.0) migrated to PEP 561 compliant packages. While this is largely an internal change, it ensures better compatibility and discovery by type checkers. Older, non-compliant configurations might require updates.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0 (affects all generated stubs)"},{"fix":"Always install `boto3` alongside `mypy-boto3-migration-hub-refactor-spaces`.","message":"This package provides *only* type annotations. You must install `boto3` separately (e.g., `pip install boto3`) for your code to run at runtime. Without `boto3`, type checking will work, but runtime execution will fail.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consult the official documentation for the updated TypeDef names and adjust your import statements accordingly.","message":"TypeDef naming conventions changed in `mypy-boto3-builder` version 8.9.0. TypeDefs for packed arguments use shorter names, and conflicting `Extra` postfixes were moved. If you directly import specific TypeDefs, their names might have changed.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.9.0 (affects all generated stubs)"},{"fix":"Add explicit type hints to your `boto3` client and resource variables.","message":"While `mypy-boto3` stubs enable auto-discovery for `boto3.client()` calls, explicit type annotations for the client variable (e.g., `client: MigrationHubRefactorSpacesClient = boto3.client(...)`) are highly recommended for optimal IDE autocompletion and more robust type checking, especially in VSCode and PyCharm.","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"}