Examples#
Auto-generated documentation for IVS type annotations stubs module mypy-boto3-ivs.
Client#
Implicit type annotations#
Can be used with boto3-stubs[ivs]
package installed.
Write your IVS
code as usual,
type checking and code completion should work out of the box.
Client method usage example#
# IVSClient usage example
from boto3.session import Session
session = Session()
client = session.client("ivs") # (1)
result = client.batch_get_channel() # (2)
- client: IVSClient
- result: BatchGetChannelResponseTypeDef
Paginator usage example#
# ListChannelsPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("ivs") # (1)
paginator = client.get_paginator("list_channels") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: IVSClient
- paginator: ListChannelsPaginator
- item: ListChannelsResponseTypeDef
Explicit type annotations#
With boto3-stubs-lite[ivs]
or a standalone mypy_boto3_ivs
package, you have to explicitly specify client: IVSClient
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#
# IVSClient usage example with type annotations
from boto3.session import Session
from mypy_boto3_ivs.client import IVSClient
from mypy_boto3_ivs.type_defs import BatchGetChannelResponseTypeDef
from mypy_boto3_ivs.type_defs import BatchGetChannelRequestTypeDef
session = Session()
client: IVSClient = session.client("ivs")
kwargs: BatchGetChannelRequestTypeDef = {...}
result: BatchGetChannelResponseTypeDef = client.batch_get_channel(**kwargs)
Paginator usage example#
# ListChannelsPaginator usage example with type annotations
from boto3.session import Session
from mypy_boto3_ivs.client import IVSClient
from mypy_boto3_ivs.paginator import ListChannelsPaginator
from mypy_boto3_ivs.type_defs import ListChannelsResponseTypeDef
session = Session()
client: IVSClient = session.client("ivs")
paginator: ListChannelsPaginator = client.get_paginator("list_channels")
for item in paginator.paginate(...):
item: ListChannelsResponseTypeDef
print(item)