{"id":3148,"library":"mypy-boto3-sso-admin","title":"mypy-boto3-sso-admin Type Annotations","description":"mypy-boto3-sso-admin provides static type annotations for the boto3 AWS SSOAdmin service client. It is part of the mypy-boto3 family of stub packages, currently at version 1.42.41. These packages are generated frequently, aligning with boto3 and botocore releases to ensure up-to-date type definitions.","status":"active","version":"1.42.41","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","type-hints","mypy","stubs","sso-admin"],"install":[{"cmd":"pip install mypy-boto3-sso-admin mypy boto3","lang":"bash","label":"Install for type-checking"}],"dependencies":[{"reason":"Required at runtime for actual AWS API calls, as these are type stubs for boto3.","package":"boto3","optional":false},{"reason":"The static type checker for which these type stubs are primarily used.","package":"mypy","optional":false},{"reason":"This package internally depends on and installs the corresponding boto3-stubs version for PEP 561 compliance, though direct imports use the mypy_boto3_sso_admin namespace.","package":"boto3-stubs[sso-admin]","optional":false}],"imports":[{"note":"While `boto3.client` is the runtime source, `mypy-boto3-sso-admin` provides dedicated type imports for comprehensive type hints. Using the `boto3` namespace directly would typically be for `boto3-stubs` not `mypy-boto3-*` packages.","wrong":"from boto3.client import SSOAdminClient","symbol":"SSOAdminClient","correct":"from mypy_boto3_sso_admin.client import SSOAdminClient"},{"note":"TypedDicts for service responses are imported directly from the stub package's `type_defs` module.","symbol":"ListInstancesResponseTypeDef","correct":"from mypy_boto3_sso_admin.type_defs import ListInstancesResponseTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_sso_admin.client import SSOAdminClient\nfrom mypy_boto3_sso_admin.type_defs import ListInstancesResponseTypeDef\nfrom os import environ\n\n# Configure AWS credentials, e.g., via environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION)\n# or AWS CLI configuration. For this example, AWS_REGION is explicitly pulled from environment.\n\ndef get_sso_admin_client() -> SSOAdminClient:\n    \"\"\"Returns a boto3 SSO Admin client with type annotations from mypy-boto3-sso-admin.\"\"\"\n    # The actual boto3.client() call returns an untyped client at runtime.\n    # The 'SSOAdminClient' type hint provides static analysis benefits.\n    return boto3.client(\"sso-admin\", region_name=environ.get('AWS_REGION', 'us-east-1'))\n\nclient: SSOAdminClient = get_sso_admin_client()\n\ntry:\n    print(\"Attempting to list SSO Admin instances...\")\n    response: ListInstancesResponseTypeDef = client.list_instances()\n    print(\"SSO Admin Instances:\")\n    for instance in response.get(\"Instances\", []):\n        print(f\"  ARN: {instance.get('InstanceArn')}, Status: {instance.get('Status')}\")\n\nexcept Exception as e:\n    print(f\"Error listing SSO Admin instances: {e}\")\n    print(\"Ensure AWS credentials and SSO Admin permissions are correctly configured.\")\n    print(\"This code requires an AWS account with configured SSO Admin instances and appropriate permissions.\")","lang":"python","description":"This quickstart demonstrates how to initialize a boto3 SSOAdmin client and use its methods with type annotations provided by `mypy-boto3-sso-admin`. It fetches and prints AWS SSO instances."},"warnings":[{"fix":"Migrate to `boto3-stubs[sso-admin]` and import types directly from `boto3` (e.g., `from boto3.client import SSOAdminClient`).","message":"This `mypy-boto3-*` package is considered a 'legacy' stub format. The `mypy-boto3-builder` project officially recommends using the `boto3-stubs` packages (e.g., `pip install 'boto3-stubs[sso-admin]'`) for PEP 561 compliant type checking, which allows simpler imports from the standard `boto3` namespace.","severity":"deprecated","affected_versions":"All versions"},{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Starting with `mypy-boto3-builder` version 8.12.0 (which generates this stub package), support for Python 3.8 was removed for all generated packages.","severity":"breaking","affected_versions":">=1.42.41 (builder 8.12.0) and later"},{"fix":"Always install `mypy-boto3-sso-admin` (or `boto3-stubs[sso-admin]`) with a version matching your `boto3` installation as closely as possible. The version number of `mypy-boto3-sso-admin` directly corresponds to the `boto3` version it types.","message":"Type stubs are tightly coupled to the `boto3` library version. Installing `mypy-boto3-sso-admin` for a `boto3` version significantly different from `1.42.41` can lead to incorrect or incomplete type hints.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Review and update your TypeDef import names if upgrading from older stub versions generated by builder < 8.9.0.","message":"In `mypy-boto3-builder` version 8.9.0, there were breaking changes to TypeDef naming conventions. Specifically, argument TypeDefs were shortened (e.g., `RequestRequestTypeDef` -> `RequestTypeDef`) and conflicting `Extra` postfixes were moved (e.g., `ExtraRequestTypeDef` -> `RequestExtraTypeDef`).","severity":"breaking","affected_versions":"<1.42.41 (builder 8.9.0) and earlier"},{"fix":"Refer to `mypy` documentation and the `mypy-boto3-builder` README for optimal configuration. Generally, `pip install` makes stubs discoverable automatically.","message":"Although `mypy-boto3-sso-admin` imports are explicit, ensure you run `mypy` with the correct configuration to pick up third-party type stubs. For some environments, `mypy` might require `mypy_path` configuration or `enable_incomplete_feature = \"Implicit Namespace Packages\"`.","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"}