Skip to content

Examples#

Index > MediaTailor > Examples

Auto-generated documentation for MediaTailor type annotations stubs module types-aiobotocore-mediatailor.

Client#

Implicit type annotations#

Can be used with types-aiobotocore[mediatailor] package installed.

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

# MediaTailorClient usage example

from aiobotocore.session import get_session


session = get_session()

async with session.create_client("mediatailor") as client:  # (1)
    result = await client.configure_logs_for_channel()  # (2)
  1. client: MediaTailorClient
  2. result: ConfigureLogsForChannelResponseTypeDef
# GetChannelSchedulePaginator usage example

from aiobotocore.session import get_session


session = get_session()

async with session.create_client("mediatailor") as client:  # (1)
    paginator = client.get_paginator("get_channel_schedule")  # (2)
    async for item in paginator.paginate(...):
        print(item)  # (3)
  1. client: MediaTailorClient
  2. paginator: GetChannelSchedulePaginator
  3. item: GetChannelScheduleResponseTypeDef

Explicit type annotations#

With types-aiobotocore-lite[mediatailor] or a standalone types_aiobotocore_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 aiobotocore.session import get_session

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


session = get_session()

async with session.create_client("mediatailor") as client:
    client: MediaTailorClient
    kwargs: ConfigureLogsForChannelRequestRequestTypeDef = {...}
    result: ConfigureLogsForChannelResponseTypeDef = await client.configure_logs_for_channel(**kwargs)
# GetChannelSchedulePaginator usage example with type annotations

from aiobotocore.session import get_session

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


session = get_session()

async with session.create_client("mediatailor") as client:
    client: MediaTailorClient
    paginator: GetChannelSchedulePaginator = client.get_paginator("get_channel_schedule")
    async for item in paginator.paginate(...):
        item: GetChannelScheduleResponseTypeDef
        print(item)