Skip to content

Examples#

Index > DeadlineCloud > Examples

Auto-generated documentation for DeadlineCloud type annotations stubs module mypy-boto3-deadline.

Client#

Implicit type annotations#

Can be used with boto3-stubs[deadline] package installed.

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

# DeadlineCloudClient usage example

from boto3.session import Session


session = Session()

client = session.client("deadline")  # (1)
result = client.assume_fleet_role_for_read()  # (2)
  1. client: DeadlineCloudClient
  2. result: AssumeFleetRoleForReadResponseTypeDef
# GetSessionsStatisticsAggregationPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("deadline")  # (1)

paginator = client.get_paginator("get_sessions_statistics_aggregation")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: DeadlineCloudClient
  2. paginator: GetSessionsStatisticsAggregationPaginator
  3. item: GetSessionsStatisticsAggregationResponseTypeDef
# FleetActiveWaiter usage example

from boto3.session import Session


session = Session()
client = session.client("deadline")  # (1)

waiter = client.get_waiter("fleet_active")  # (2)
waiter.wait()
  1. client: DeadlineCloudClient
  2. waiter: FleetActiveWaiter

Explicit type annotations#

With boto3-stubs-lite[deadline] or a standalone mypy_boto3_deadline package, you have to explicitly specify client: DeadlineCloudClient 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.

# DeadlineCloudClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_deadline.client import DeadlineCloudClient
from mypy_boto3_deadline.type_defs import AssumeFleetRoleForReadResponseTypeDef
from mypy_boto3_deadline.type_defs import AssumeFleetRoleForReadRequestRequestTypeDef


session = Session()

client: DeadlineCloudClient = session.client("deadline")

kwargs: AssumeFleetRoleForReadRequestRequestTypeDef = {...}
result: AssumeFleetRoleForReadResponseTypeDef = client.assume_fleet_role_for_read(**kwargs)
# GetSessionsStatisticsAggregationPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_deadline.client import DeadlineCloudClient
from mypy_boto3_deadline.paginator import GetSessionsStatisticsAggregationPaginator
from mypy_boto3_deadline.type_defs import GetSessionsStatisticsAggregationResponseTypeDef


session = Session()
client: DeadlineCloudClient = session.client("deadline")

paginator: GetSessionsStatisticsAggregationPaginator = client.get_paginator("get_sessions_statistics_aggregation")
for item in paginator.paginate(...):
    item: GetSessionsStatisticsAggregationResponseTypeDef
    print(item)
# FleetActiveWaiter usage example with type annotations

from boto3.session import Session

from mypy_boto3_deadline.client import DeadlineCloudClient
from mypy_boto3_deadline.waiter import FleetActiveWaiter

session = Session()
client: DeadlineCloudClient = session.client("deadline")

waiter: FleetActiveWaiter = client.get_waiter("fleet_active")
waiter.wait()