Examples#
Auto-generated documentation for MediaLive type annotations stubs module mypy-boto3-medialive.
Client#
Implicit type annotations#
Can be used with boto3-stubs[medialive]
package installed.
Write your MediaLive
code as usual,
type checking and code completion should work out of the box.
Client method usage example#
# MediaLiveClient usage example
from boto3.session import Session
session = Session()
client = session.client("medialive") # (1)
result = client.batch_delete() # (2)
- client: MediaLiveClient
- result: BatchDeleteResponseTypeDef
Paginator usage example#
# DescribeSchedulePaginator usage example
from boto3.session import Session
session = Session()
client = session.client("medialive") # (1)
paginator = client.get_paginator("describe_schedule") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: MediaLiveClient
- paginator: DescribeSchedulePaginator
- item: DescribeScheduleResponseTypeDef
Waiter usage example#
# ChannelCreatedWaiter usage example
from boto3.session import Session
session = Session()
client = session.client("medialive") # (1)
waiter = client.get_waiter("channel_created") # (2)
waiter.wait(...)
- client: MediaLiveClient
- waiter: ChannelCreatedWaiter
Explicit type annotations#
With boto3-stubs-lite[medialive]
or a standalone mypy_boto3_medialive
package, you have to explicitly specify client: MediaLiveClient
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#
# MediaLiveClient usage example with type annotations
from boto3.session import Session
from mypy_boto3_medialive.client import MediaLiveClient
from mypy_boto3_medialive.type_defs import BatchDeleteResponseTypeDef
from mypy_boto3_medialive.type_defs import BatchDeleteRequestTypeDef
session = Session()
client: MediaLiveClient = session.client("medialive")
kwargs: BatchDeleteRequestTypeDef = {...}
result: BatchDeleteResponseTypeDef = client.batch_delete(**kwargs)
Paginator usage example#
# DescribeSchedulePaginator usage example with type annotations
from boto3.session import Session
from mypy_boto3_medialive.client import MediaLiveClient
from mypy_boto3_medialive.paginator import DescribeSchedulePaginator
from mypy_boto3_medialive.type_defs import DescribeScheduleResponseTypeDef
session = Session()
client: MediaLiveClient = session.client("medialive")
paginator: DescribeSchedulePaginator = client.get_paginator("describe_schedule")
for item in paginator.paginate(...):
item: DescribeScheduleResponseTypeDef
print(item)
Waiter usage example#
# ChannelCreatedWaiter usage example with type annotations
from boto3.session import Session
from mypy_boto3_medialive.client import MediaLiveClient
from mypy_boto3_medialive.waiter import ChannelCreatedWaiter
session = Session()
client: MediaLiveClient = session.client("medialive")
waiter: ChannelCreatedWaiter = client.get_waiter("channel_created")
waiter.wait(...)