Examples#
Index > MediaStore > Examples
Auto-generated documentation for MediaStore type annotations stubs module types-boto3-mediastore.
Client#
Implicit type annotations#
Can be used with types-boto3[mediastore]
package installed.
Write your MediaStore
code as usual,
type checking and code completion should work out of the box.
# MediaStoreClient usage example
from boto3.session import Session
session = Session()
client = session.client("mediastore") # (1)
result = client.create_container() # (2)
- client: MediaStoreClient
- result: CreateContainerOutputTypeDef
# ListContainersPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("mediastore") # (1)
paginator = client.get_paginator("list_containers") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: MediaStoreClient
- paginator: ListContainersPaginator
- item: ListContainersOutputTypeDef
Explicit type annotations#
With types-boto3-lite[mediastore]
or a standalone types_boto3_mediastore
package, you have to explicitly specify client: MediaStoreClient
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.
# MediaStoreClient usage example with type annotations
from boto3.session import Session
from types_boto3_mediastore.client import MediaStoreClient
from types_boto3_mediastore.type_defs import CreateContainerOutputTypeDef
from types_boto3_mediastore.type_defs import CreateContainerInputRequestTypeDef
session = Session()
client: MediaStoreClient = session.client("mediastore")
kwargs: CreateContainerInputRequestTypeDef = {...}
result: CreateContainerOutputTypeDef = client.create_container(**kwargs)
# ListContainersPaginator usage example with type annotations
from boto3.session import Session
from types_boto3_mediastore.client import MediaStoreClient
from types_boto3_mediastore.paginator import ListContainersPaginator
from types_boto3_mediastore.type_defs import ListContainersOutputTypeDef
session = Session()
client: MediaStoreClient = session.client("mediastore")
paginator: ListContainersPaginator = client.get_paginator("list_containers")
for item in paginator.paginate(...):
item: ListContainersOutputTypeDef
print(item)