Examples#
Index > MediaConnect > Examples
Auto-generated documentation for MediaConnect type annotations stubs module types-boto3-mediaconnect.
Client#
Implicit type annotations#
Can be used with types-boto3[mediaconnect]
package installed.
Write your MediaConnect
code as usual,
type checking and code completion should work out of the box.
# MediaConnectClient usage example
from boto3.session import Session
session = Session()
client = session.client("mediaconnect") # (1)
result = client.add_bridge_outputs() # (2)
- client: MediaConnectClient
- result: AddBridgeOutputsResponseTypeDef
# ListBridgesPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("mediaconnect") # (1)
paginator = client.get_paginator("list_bridges") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: MediaConnectClient
- paginator: ListBridgesPaginator
- item: ListBridgesResponseTypeDef
# FlowActiveWaiter usage example
from boto3.session import Session
session = Session()
client = session.client("mediaconnect") # (1)
waiter = client.get_waiter("flow_active") # (2)
waiter.wait()
- client: MediaConnectClient
- waiter: FlowActiveWaiter
Explicit type annotations#
With types-boto3-lite[mediaconnect]
or a standalone types_boto3_mediaconnect
package, you have to explicitly specify client: MediaConnectClient
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.
# MediaConnectClient usage example with type annotations
from boto3.session import Session
from types_boto3_mediaconnect.client import MediaConnectClient
from types_boto3_mediaconnect.type_defs import AddBridgeOutputsResponseTypeDef
from types_boto3_mediaconnect.type_defs import AddBridgeOutputsRequestRequestTypeDef
session = Session()
client: MediaConnectClient = session.client("mediaconnect")
kwargs: AddBridgeOutputsRequestRequestTypeDef = {...}
result: AddBridgeOutputsResponseTypeDef = client.add_bridge_outputs(**kwargs)
# ListBridgesPaginator usage example with type annotations
from boto3.session import Session
from types_boto3_mediaconnect.client import MediaConnectClient
from types_boto3_mediaconnect.paginator import ListBridgesPaginator
from types_boto3_mediaconnect.type_defs import ListBridgesResponseTypeDef
session = Session()
client: MediaConnectClient = session.client("mediaconnect")
paginator: ListBridgesPaginator = client.get_paginator("list_bridges")
for item in paginator.paginate(...):
item: ListBridgesResponseTypeDef
print(item)
# FlowActiveWaiter usage example with type annotations
from boto3.session import Session
from types_boto3_mediaconnect.client import MediaConnectClient
from types_boto3_mediaconnect.waiter import FlowActiveWaiter
session = Session()
client: MediaConnectClient = session.client("mediaconnect")
waiter: FlowActiveWaiter = client.get_waiter("flow_active")
waiter.wait()