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_participant_token() # (2)
- client: ivsrealtimeClient
- result: CreateParticipantTokenResponseTypeDef
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 CreateParticipantTokenResponseTypeDef
from mypy_boto3_ivs_realtime.type_defs import CreateParticipantTokenRequestRequestTypeDef
session = Session()
client: ivsrealtimeClient = session.client("ivs-realtime")
kwargs: CreateParticipantTokenRequestRequestTypeDef = {...}
result: CreateParticipantTokenResponseTypeDef = client.create_participant_token(**kwargs)