Type annotations for boto3 WorkspacesInstances
mypy-boto3-workspaces-instances provides comprehensive type annotations for the `boto3` WorkspacesInstances service, compatible with mypy, Pyright, VSCode, and other type-checking tools. It enhances developer experience by offering static type checking and auto-completion for `boto3.client('workspaces-instances')` calls. This library is automatically generated by `mypy-boto3-builder` and is currently at version 1.42.31, with frequent updates to align with new `boto3` releases.
Warnings
- breaking Support for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0. If you are using this version of the stubs, you must use Python 3.9 or newer.
- breaking TypeDef naming conventions changed in `mypy-boto3-builder` version 8.9.0. This includes shorter names for packed method arguments (e.g., `RequestRequestTypeDef` becoming `RequestTypeDef`) and moving `Extra` postfixes.
- gotcha This package provides type stubs only; it does not include the `boto3` runtime library itself. `boto3` must be installed separately for your application to function.
- gotcha PyCharm may experience slow performance or high CPU usage when dealing with `Literal` overloads in `mypy-boto3` due to a known IDE issue (PY-40997).
Install
-
pip install mypy-boto3-workspaces-instances -
pip install 'boto3-stubs[workspaces]' # or boto3-stubs-lite[workspaces]
Imports
- WorkspacesInstancesClient
from mypy_boto3_workspaces_instances.client import WorkspacesInstancesClient
- AcceptAccountLinkInvitationRequestTypeDef
from mypy_boto3_workspaces_instances.type_defs import AcceptAccountLinkInvitationRequestTypeDef
- AGAModeForDirectoryEnumType
from mypy_boto3_workspaces_instances.literals import AGAModeForDirectoryEnumType
Quickstart
import boto3
from mypy_boto3_workspaces_instances.client import WorkspacesInstancesClient
from mypy_boto3_workspaces_instances.type_defs import DescribeAccountLinksResultTypeDef
def list_workspaces_instances() -> None:
# Initialize the Boto3 client with type annotation
client: WorkspacesInstancesClient = boto3.client('workspaces-instances')
# Example API call with type-checked parameters and return value
response: DescribeAccountLinksResultTypeDef = client.describe_account_links(
LinkStatusFilter=['LINKED']
)
print(f"Account links: {response.get('AccountLinks')}")
if __name__ == "__main__":
list_workspaces_instances()