Examples#
Index > Ivsrealtime > Examples
Auto-generated documentation for Ivsrealtime type annotations stubs module mypy-boto3-ivs-realtime.
Client#
Implicit type annotations#
Can be used with boto3-stubs[ivs-realtime]
package installed.
Write your Ivsrealtime
code as usual,
type checking and code completion should work out of the box.
# IvsrealtimeClient usage example
from boto3.session import Session
session = Session()
client = session.client("ivs-realtime") # (1)
result = client.create_encoder_configuration() # (2)
- client: IvsrealtimeClient
- result: CreateEncoderConfigurationResponseTypeDef
# ListIngestConfigurationsPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("ivs-realtime") # (1)
paginator = client.get_paginator("list_ingest_configurations") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: IvsrealtimeClient
- paginator: ListIngestConfigurationsPaginator
- item: ListIngestConfigurationsResponseTypeDef
Explicit type annotations#
With boto3-stubs-lite[ivs-realtime]
or a standalone mypy_boto3_ivs_realtime
package, you have to explicitly specify client: IvsrealtimeClient
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.
# IvsrealtimeClient usage example with type annotations
from boto3.session import Session
from mypy_boto3_ivs_realtime.client import IvsrealtimeClient
from mypy_boto3_ivs_realtime.type_defs import CreateEncoderConfigurationResponseTypeDef
from mypy_boto3_ivs_realtime.type_defs import CreateEncoderConfigurationRequestRequestTypeDef
session = Session()
client: IvsrealtimeClient = session.client("ivs-realtime")
kwargs: CreateEncoderConfigurationRequestRequestTypeDef = {...}
result: CreateEncoderConfigurationResponseTypeDef = client.create_encoder_configuration(**kwargs)
# ListIngestConfigurationsPaginator usage example with type annotations
from boto3.session import Session
from mypy_boto3_ivs_realtime.client import IvsrealtimeClient
from mypy_boto3_ivs_realtime.paginator import ListIngestConfigurationsPaginator
from mypy_boto3_ivs_realtime.type_defs import ListIngestConfigurationsResponseTypeDef
session = Session()
client: IvsrealtimeClient = session.client("ivs-realtime")
paginator: ListIngestConfigurationsPaginator = client.get_paginator("list_ingest_configurations")
for item in paginator.paginate(...):
item: ListIngestConfigurationsResponseTypeDef
print(item)