mypy-boto3-workspaces-thin-client
Type annotations for the `boto3` WorkSpaces Thin Client, version 1.42.3. This library provides static type checking for your `boto3` code, enhancing developer experience by catching type-related errors before runtime. It is generated by the `mypy-boto3-builder` project, which releases frequently, often in sync with `boto3` and `botocore` updates.
Warnings
- breaking Python 3.8 support has been removed. As of `mypy-boto3-builder` version 8.12.0 (which generated `mypy-boto3-workspaces-thin-client` 1.42.3), projects targeting Python 3.8 or older will need to use an earlier version of `mypy-boto3` or upgrade their Python environment.
- breaking `mypy-boto3` packages migrated to PEP 561 (namespace packages) with `mypy-boto3-builder` 8.12.0. This change in packaging structure might affect how some tools or environments discover these stubs, particularly in older or non-standard Python setups.
- gotcha This package provides *only* type stubs. For your Python code to run and interact with AWS WorkSpaces Thin Client, you must also have the `boto3` library installed (`pip install boto3`).
- gotcha To effectively use these type stubs, you need a static type checker like `mypy`. Ensure `mypy` is installed and configured to run on your project, allowing it to discover and utilize the type hints provided by this package.
- breaking In `mypy-boto3-builder` 8.9.0, type definition names for packed method arguments were shortened (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`), and conflicting `Extra` postfixes were moved (e.g., `CreateDistributionExtraRequestTypeDef` -> `CreateDistributionRequestExtraTypeDef`). Code directly referencing these old type definition names will break.
Install
-
pip install mypy-boto3-workspaces-thin-client boto3 mypy
Imports
- WorkSpacesThinClientClient
from mypy_boto3_workspaces_thin_client.client import WorkSpacesThinClientClient
- ListWorkspacesThinClientDevicesRequestRequestTypeDef
from mypy_boto3_workspaces_thin_client.type_defs import ListWorkspacesThinClientDevicesRequestRequestTypeDef
Quickstart
import boto3
from mypy_boto3_workspaces_thin_client.client import WorkSpacesThinClientClient
from mypy_boto3_workspaces_thin_client.type_defs import ListWorkspacesThinClientDevicesRequestRequestTypeDef
def list_thin_client_devices(
region_name: str,
max_results: int = 10,
next_token: str | None = None
) -> None:
"""Lists WorkSpaces Thin Client devices with type hints."""
# boto3.client returns a WorkSpacesThinClientClient when mypy-boto3-workspaces-thin-client is installed
client: WorkSpacesThinClientClient = boto3.client("workspaces-thin-client", region_name=region_name)
request_params: ListWorkspacesThinClientDevicesRequestRequestTypeDef = {
"maxResults": max_results,
}
if next_token:
request_params["nextToken"] = next_token
print(f"Listing devices in {region_name}...")
response = client.list_workspaces_thin_client_devices(**request_params)
devices = response.get("devices", [])
if devices:
for device in devices:
print(f" Device ID: {device.get('id')}, Name: {device.get('name', 'N/A')}")
else:
print(" No devices found.")
if "nextToken" in response:
print(f" Next Token: {response['nextToken']}")
# Example usage (requires AWS credentials configured, e.g., via AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY or ~/.aws/credentials)
if __name__ == "__main__":
# Replace 'us-east-1' with your desired AWS region
list_thin_client_devices("us-east-1")