Examples#
Index > MediaPackageVod > Examples
Auto-generated documentation for MediaPackageVod type annotations stubs module mypy-boto3-mediapackage-vod.
Client#
Implicit type annotations#
Can be used with boto3-stubs[mediapackage-vod]
package installed.
Write your MediaPackageVod
code as usual,
type checking and code completion should work out of the box.
# MediaPackageVodClient usage example
from boto3.session import Session
session = Session()
client = session.client("mediapackage-vod") # (1)
result = client.configure_logs() # (2)
- client: MediaPackageVodClient
- result: ConfigureLogsResponseTypeDef
# ListAssetsPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("mediapackage-vod") # (1)
paginator = client.get_paginator("list_assets") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: MediaPackageVodClient
- paginator: ListAssetsPaginator
- item: ListAssetsResponseTypeDef
Explicit type annotations#
With boto3-stubs-lite[mediapackage-vod]
or a standalone mypy_boto3_mediapackage_vod
package, you have to explicitly specify client: MediaPackageVodClient
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.
# MediaPackageVodClient usage example with type annotations
from boto3.session import Session
from mypy_boto3_mediapackage_vod.client import MediaPackageVodClient
from mypy_boto3_mediapackage_vod.type_defs import ConfigureLogsResponseTypeDef
from mypy_boto3_mediapackage_vod.type_defs import ConfigureLogsRequestRequestTypeDef
session = Session()
client: MediaPackageVodClient = session.client("mediapackage-vod")
kwargs: ConfigureLogsRequestRequestTypeDef = {...}
result: ConfigureLogsResponseTypeDef = client.configure_logs(**kwargs)
# ListAssetsPaginator usage example with type annotations
from boto3.session import Session
from mypy_boto3_mediapackage_vod.client import MediaPackageVodClient
from mypy_boto3_mediapackage_vod.paginator import ListAssetsPaginator
from mypy_boto3_mediapackage_vod.type_defs import ListAssetsResponseTypeDef
session = Session()
client: MediaPackageVodClient = session.client("mediapackage-vod")
paginator: ListAssetsPaginator = client.get_paginator("list_assets")
for item in paginator.paginate(...):
item: ListAssetsResponseTypeDef
print(item)