Examples#
Auto-generated documentation for AppStream type annotations stubs module mypy-boto3-appstream.
Client#
Implicit type annotations#
Can be used with boto3-stubs[appstream]
package installed.
Write your AppStream
code as usual,
type checking and code completion should work out of the box.
Client method usage example#
# AppStreamClient usage example
from boto3.session import Session
session = Session()
client = session.client("appstream") # (1)
result = client.associate_app_block_builder_app_block() # (2)
- client: AppStreamClient
- result: AssociateAppBlockBuilderAppBlockResultTypeDef
Paginator usage example#
# DescribeDirectoryConfigsPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("appstream") # (1)
paginator = client.get_paginator("describe_directory_configs") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: AppStreamClient
- paginator: DescribeDirectoryConfigsPaginator
- item: DescribeDirectoryConfigsResultTypeDef
Waiter usage example#
# FleetStartedWaiter usage example
from boto3.session import Session
session = Session()
client = session.client("appstream") # (1)
waiter = client.get_waiter("fleet_started") # (2)
waiter.wait(...)
- client: AppStreamClient
- waiter: FleetStartedWaiter
Explicit type annotations#
With boto3-stubs-lite[appstream]
or a standalone mypy_boto3_appstream
package, you have to explicitly specify client: AppStreamClient
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.
Client method usage example#
# AppStreamClient usage example with type annotations
from boto3.session import Session
from mypy_boto3_appstream.client import AppStreamClient
from mypy_boto3_appstream.type_defs import AssociateAppBlockBuilderAppBlockResultTypeDef
from mypy_boto3_appstream.type_defs import AssociateAppBlockBuilderAppBlockRequestTypeDef
session = Session()
client: AppStreamClient = session.client("appstream")
kwargs: AssociateAppBlockBuilderAppBlockRequestTypeDef = {...}
result: AssociateAppBlockBuilderAppBlockResultTypeDef = client.associate_app_block_builder_app_block(**kwargs)
Paginator usage example#
# DescribeDirectoryConfigsPaginator usage example with type annotations
from boto3.session import Session
from mypy_boto3_appstream.client import AppStreamClient
from mypy_boto3_appstream.paginator import DescribeDirectoryConfigsPaginator
from mypy_boto3_appstream.type_defs import DescribeDirectoryConfigsResultTypeDef
session = Session()
client: AppStreamClient = session.client("appstream")
paginator: DescribeDirectoryConfigsPaginator = client.get_paginator("describe_directory_configs")
for item in paginator.paginate(...):
item: DescribeDirectoryConfigsResultTypeDef
print(item)
Waiter usage example#
# FleetStartedWaiter usage example with type annotations
from boto3.session import Session
from mypy_boto3_appstream.client import AppStreamClient
from mypy_boto3_appstream.waiter import FleetStartedWaiter
session = Session()
client: AppStreamClient = session.client("appstream")
waiter: FleetStartedWaiter = client.get_waiter("fleet_started")
waiter.wait(...)