{"id":3639,"library":"mypy-boto3-migrationhuborchestrator","title":"mypy-boto3-migrationhuborchestrator Type Annotations","description":"mypy-boto3-migrationhuborchestrator provides type annotations for the `boto3` AWS Migration Hub Orchestrator service, enhancing static analysis and IDE autocompletion for Python projects. It is generated by the `mypy-boto3-builder` and is currently at version 1.42.3, with releases closely tracking `boto3` updates to ensure compatibility and comprehensive type coverage.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["mypy","boto3","aws","typing","type-stubs","migrationhuborchestrator"],"install":[{"cmd":"pip install mypy-boto3-migrationhuborchestrator","lang":"bash","label":"Install specific service stubs"},{"cmd":"pip install 'boto3-stubs[migrationhuborchestrator]'","lang":"bash","label":"Install via boto3-stubs meta-package"}],"dependencies":[{"reason":"Runtime dependency for actual AWS interactions.","package":"boto3"},{"reason":"The static type checker that utilizes these annotations.","package":"mypy","optional":true}],"imports":[{"note":"It is best practice to guard type imports with `if TYPE_CHECKING:` to avoid introducing runtime dependencies.","symbol":"MigrationHubOrchestratorClient","correct":"from typing import TYPE_CHECKING\nif TYPE_CHECKING:\n    from mypy_boto3_migrationhuborchestrator import MigrationHubOrchestratorClient"},{"note":"Type definitions (TypedDicts) for API responses are available in the `type_defs` submodule.","symbol":"TemplateSummaryTypeDef","correct":"from typing import TYPE_CHECKING\nif TYPE_CHECKING:\n    from mypy_boto3_migrationhuborchestrator.type_defs import TemplateSummaryTypeDef"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING\n\n# Best practice: guard type imports with if TYPE_CHECKING\nif TYPE_CHECKING:\n    from mypy_boto3_migrationhuborchestrator import MigrationHubOrchestratorClient\n    from mypy_boto3_migrationhuborchestrator.type_defs import TemplateSummaryTypeDef\n\n# Initialize a boto3 client for Migration Hub Orchestrator\nclient: MigrationHubOrchestratorClient = boto3.client('migrationhuborchestrator')\n\n# Use a method and check its return type\ntry:\n    response = client.list_templates(maxResults=5)\n    templates: list[TemplateSummaryTypeDef] = response['Templates']\n    for template in templates:\n        print(f\"Template ID: {template['Id']}, Name: {template['Name']}\")\nexcept client.exceptions.AccessDeniedException:\n    print(\"Access denied. Please check your AWS credentials and permissions.\")\nexcept Exception as e:\n    print(f\"An unexpected error occurred: {e}\")\n\n# To run mypy:\n# 1. pip install mypy boto3 mypy-boto3-migrationhuborchestrator\n# 2. mypy your_script_name.py","lang":"python","description":"This quickstart demonstrates how to use the `mypy-boto3-migrationhuborchestrator` stubs with a `boto3` client to get type-checking for the `list_templates` operation. It includes the recommended `TYPE_CHECKING` guard for imports and handles potential `AccessDeniedException`."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Starting with `mypy-boto3-builder` version 8.12.0 (which generated this package), Python 3.8 is no longer supported for generated stub packages.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0 (and dependent stub packages like this one)"},{"fix":"Update your code to use the new `TypeDef` names as per the latest stub documentation. Your IDE or type checker should flag these if you are using explicit type hints.","message":"In `mypy-boto3-builder` version 8.9.0, type definition (TypeDef) naming conventions changed. This includes shorter names for packed method arguments and revised postfix handling for conflicting `TypeDef` names (e.g., `CreateDistributionExtraRequestTypeDef` became `CreateDistributionRequestExtraTypeDef`).","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0 (and dependent stub packages)"},{"fix":"Wrap your `from mypy_boto3_* import ...` statements in `if TYPE_CHECKING:` blocks. For example: `from typing import TYPE_CHECKING; if TYPE_CHECKING: from mypy_boto3_migrationhuborchestrator import MigrationHubOrchestratorClient`.","message":"Type imports from `mypy_boto3_*` packages should ideally be placed within `if TYPE_CHECKING:` blocks. This ensures that these stub packages are only used by static analysis tools (like mypy) and are not treated as runtime dependencies by your application, reducing the deployed package size.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Update your type checker (e.g., `pip install --upgrade mypy`) and ensure it's configured to recognize PEP 561-compliant stub packages.","message":"Following the migration to PEP 561 packages in `mypy-boto3-builder` 8.12.0, ensure your `mypy` or other type checker is up-to-date. Older versions might not correctly discover or utilize the stubs, leading to `Missing type stub` errors or incorrect type inference.","severity":"gotcha","affected_versions":"mypy-boto3-builder >= 8.12.0 (and dependent stub packages)"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}