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-aioboto3[mediatailor] package installed.

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

# MediaTailorClient usage example

from aioboto3.session import Session


session = Session()

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

from aioboto3.session import Session


session = Session()

async with session.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-aioboto3-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 aioboto3.session import 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 = Session()

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

from aioboto3.session import Session

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


session = Session()

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