Skip to content

Examples#

Index > MediaTailor > Examples

Auto-generated documentation for MediaTailor type annotations stubs module mypy-boto3-mediatailor.

Client#

Implicit type annotations#

Can be used with boto3-stubs[mediatailor] package installed.

Write your MediaTailor code as usual, type checking and code completion should work out of the box.

# MediaTailorClient usage example

from boto3.session import Session


session = Session()

client = session.client("mediatailor")  # (1)
result = client.configure_logs_for_channel()  # (2)
  1. client: MediaTailorClient
  2. result: ConfigureLogsForChannelResponseTypeDef
# GetChannelSchedulePaginator usage example

from boto3.session import Session


session = Session()
client = session.client("mediatailor")  # (1)

paginator = client.get_paginator("get_channel_schedule")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: MediaTailorClient
  2. paginator: GetChannelSchedulePaginator
  3. item: GetChannelScheduleResponseTypeDef

Explicit type annotations#

With boto3-stubs-lite[mediatailor] or a standalone mypy_boto3_mediatailor package, you have to explicitly specify client: MediaTailorClient 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.

# MediaTailorClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_mediatailor.client import MediaTailorClient
from mypy_boto3_mediatailor.type_defs import ConfigureLogsForChannelResponseTypeDef
from mypy_boto3_mediatailor.type_defs import ConfigureLogsForChannelRequestRequestTypeDef


session = Session()

client: MediaTailorClient = session.client("mediatailor")

kwargs: ConfigureLogsForChannelRequestRequestTypeDef = {...}
result: ConfigureLogsForChannelResponseTypeDef = client.configure_logs_for_channel(**kwargs)
# GetChannelSchedulePaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_mediatailor.client import MediaTailorClient
from mypy_boto3_mediatailor.paginator import GetChannelSchedulePaginator
from mypy_boto3_mediatailor.type_defs import GetChannelScheduleResponseTypeDef


session = Session()
client: MediaTailorClient = session.client("mediatailor")

paginator: GetChannelSchedulePaginator = client.get_paginator("get_channel_schedule")
for item in paginator.paginate(...):
    item: GetChannelScheduleResponseTypeDef
    print(item)