mypy-boto3-workspaces-thin-client

1.42.3 · active · verified Sat Apr 11

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

Install

Imports

Quickstart

This example demonstrates how to initialize a `WorkSpacesThinClientClient` with `boto3` and use type-hinted request parameters and client methods provided by `mypy-boto3-workspaces-thin-client`.

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")

view raw JSON →