Examples#
Index > WorkSpacesThinClient > Examples
Auto-generated documentation for WorkSpacesThinClient type annotations stubs module types-aiobotocore-workspaces-thin-client.
Client#
Implicit type annotations#
Can be used with types-aioboto3[workspaces-thin-client]
package installed.
Write your WorkSpacesThinClient
code as usual,
type checking and code completion should work out of the box.
# WorkSpacesThinClientClient usage example
from aioboto3.session import Session
session = Session()
async with session.client("workspaces-thin-client") as client: # (1)
result = await client.create_environment() # (2)
- client: WorkSpacesThinClientClient
- result: CreateEnvironmentResponseTypeDef
# ListDevicesPaginator usage example
from aioboto3.session import Session
session = Session()
async with session.client("workspaces-thin-client") as client: # (1)
paginator = client.get_paginator("list_devices") # (2)
async for item in paginator.paginate(...):
print(item) # (3)
- client: WorkSpacesThinClientClient
- paginator: ListDevicesPaginator
- item: ListDevicesResponseTypeDef
Explicit type annotations#
With types-aioboto3-lite[workspaces-thin-client]
or a standalone types_aiobotocore_workspaces_thin_client
package, you have to explicitly specify
client: WorkSpacesThinClientClient
type annotation.
All other type annotations are optional, as types should be discovered automatically. However, these type annotations can be helpful in your functions and methods.
# WorkSpacesThinClientClient usage example with type annotations
from aioboto3.session import Session
from types_aiobotocore_workspaces_thin_client.client import WorkSpacesThinClientClient
from types_aiobotocore_workspaces_thin_client.type_defs import CreateEnvironmentResponseTypeDef
from types_aiobotocore_workspaces_thin_client.type_defs import CreateEnvironmentRequestRequestTypeDef
session = Session()
client: WorkSpacesThinClientClient
async with session.client("workspaces-thin-client") as client: # (1)
kwargs: CreateEnvironmentRequestRequestTypeDef = {...} # (2)
result: CreateEnvironmentResponseTypeDef = await client.create_environment(**kwargs) # (3)
- client: WorkSpacesThinClientClient
- kwargs: CreateEnvironmentRequestRequestTypeDef
- result: CreateEnvironmentResponseTypeDef
# ListDevicesPaginator usage example with type annotations
from aioboto3.session import Session
from types_aiobotocore_workspaces_thin_client.client import WorkSpacesThinClientClient
from types_aiobotocore_workspaces_thin_client.paginator import ListDevicesPaginator
from types_aiobotocore_workspaces_thin_client.type_defs import ListDevicesResponseTypeDef
session = Session()
client: WorkSpacesThinClientClient
async with session.client("workspaces-thin-client") as client: # (1)
paginator: ListDevicesPaginator = client.get_paginator("list_devices") # (2)
async for item in paginator.paginate(...):
item: ListDevicesResponseTypeDef
print(item) # (3)
- client: WorkSpacesThinClientClient
- paginator: ListDevicesPaginator
- item: ListDevicesResponseTypeDef