{"id":3170,"library":"mypy-boto3-workdocs","title":"mypy-boto3-workdocs Type Annotations","description":"mypy-boto3-workdocs provides type annotations for the boto3 WorkDocs service, ensuring static type checking compatibility with tools like mypy, VSCode, and PyCharm. It's automatically generated with mypy-boto3-builder, currently at version 1.42.3, and typically releases in sync with new boto3 and botocore versions.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["mypy","boto3","aws","type-hints","stubs","workdocs"],"install":[{"cmd":"pip install mypy-boto3-workdocs boto3 mypy","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Provides the AWS SDK for Python, for which this library offers type stubs.","package":"boto3"},{"reason":"The static type checker that utilizes these annotations.","package":"mypy","optional":true},{"reason":"Requires Python 3.9 or newer.","package":"python","version":">=3.9"}],"imports":[{"note":"While boto3.client is the runtime client, mypy_boto3_workdocs provides the type definitions for static analysis.","wrong":"from boto3.client import WorkDocsClient","symbol":"WorkDocsClient","correct":"from mypy_boto3_workdocs.client import WorkDocsClient"},{"note":"Type definitions (TypedDicts) are typically found in the `type_defs` submodule, not directly under `client`.","wrong":"from mypy_boto3_workdocs.client import DescribeUsersRequestRequestTypeDef","symbol":"DescribeUsersRequestRequestTypeDef","correct":"from mypy_boto3_workdocs.type_defs import DescribeUsersRequestRequestTypeDef"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING\nimport os\n\nif TYPE_CHECKING:\n    from mypy_boto3_workdocs.client import WorkDocsClient\n    from mypy_boto3_workdocs.type_defs import DescribeUsersResponseTypeDef\n\n\ndef get_workdocs_client() -> 'WorkDocsClient':\n    # In a real application, configure AWS credentials securely.\n    # For quickstart, using environment variables.\n    session = boto3.Session(\n        aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', ''),\n        aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', ''),\n        region_name=os.environ.get('AWS_DEFAULT_REGION', 'us-east-1')\n    )\n    return session.client('workdocs')\n\n\nif __name__ == '__main__':\n    client: WorkDocsClient = get_workdocs_client()\n    print(f\"Client type: {type(client)}\")\n\n    # Example: Describe users with explicit type hints\n    response: DescribeUsersResponseTypeDef = client.describe_users(\n        OrganizationId=\"your_organization_id\" # Replace with actual Organization ID\n    )\n    print(\"Successfully described users.\")\n    print(f\"Users: {response.get('Users')}\")\n    # Note: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGION\n    # and your_organization_id must be set for this to run successfully.\n","lang":"python","description":"This quickstart demonstrates how to initialize a WorkDocs client with explicit type annotations for `mypy` using `mypy-boto3-workdocs`. It shows how to obtain a typed client and use a method with its corresponding response type definition. For full functionality, ensure your AWS credentials and WorkDocs Organization ID are configured, e.g., via environment variables."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or later.","message":"Support for Python 3.8 has been removed in `mypy-boto3-builder` version 8.12.0 and later. Users on Python 3.8 will need to upgrade to Python 3.9 or newer.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0 (and dependent mypy-boto3-* packages)"},{"fix":"Review your code for explicitly typed `TypeDef` objects and update their names according to the new conventions.","message":"TypeDef naming conventions changed in `mypy-boto3-builder` version 8.9.0. Some TypeDef names for packed method arguments became shorter (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`), and conflicting `Extra` postfixes moved to the end (e.g., `CreateDistributionExtraRequestTypeDef` -> `CreateDistributionRequestExtraTypeDef`). This might break existing type hints that use the old names.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.9.0 (and dependent mypy-boto3-* packages)"},{"fix":"Consider `pip install boto3-stubs-lite` (if you are using `boto3-stubs` umbrella package) or use `mypy`/`pyright` for type checking in PyCharm.","message":"When using PyCharm, performance issues with `Literal` overloads might lead to slow performance or high CPU usage. It is recommended to use `boto3-stubs-lite` (if available for your service) or disable PyCharm's type checker and rely on `mypy` or `pyright` instead.","severity":"gotcha","affected_versions":"All versions with PyCharm"},{"fix":"Implement a conditional import pattern like `if TYPE_CHECKING: from mypy_boto3_workdocs.client import WorkDocsClient else: WorkDocsClient = object`.","message":"Pylint might report 'undefined variable' errors when using `TYPE_CHECKING` guards for `mypy-boto3` types. To fix this, set all types to `object` in the non-`TYPE_CHECKING` branch of your conditional imports.","severity":"gotcha","affected_versions":"All versions when using Pylint with `TYPE_CHECKING`"},{"fix":"Ensure your project's packaging follows current best practices, especially if encountering issues with type checker discovery.","message":"The `mypy-boto3` ecosystem migrated to PEP 561 compliant packages in version 8.12.0. While this is primarily an internal packaging change, it ensures better compatibility and discovery of type stubs by type checkers, but users should be aware of modern packaging practices.","severity":"gotcha","affected_versions":"mypy-boto3-builder >=8.12.0 (and dependent mypy-boto3-* packages)"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}