Skip to content

Examples#

Index > EMRContainers > Examples

Auto-generated documentation for EMRContainers type annotations stubs module types-aiobotocore-emr-containers.

Client#

Implicit type annotations#

Can be used with types-aioboto3[emr-containers] package installed.

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

# EMRContainersClient usage example

from aioboto3.session import Session


session = Session()

async with session.client("emr-containers") as client:  # (1)
    result = await client.cancel_job_run()  # (2)
  1. client: EMRContainersClient
  2. result: CancelJobRunResponseTypeDef
# ListJobRunsPaginator usage example

from aioboto3.session import Session


session = Session()

async with session.client("emr-containers") as client:  # (1)
    paginator = client.get_paginator("list_job_runs")  # (2)
    async for item in paginator.paginate(...):
        print(item)  # (3)
  1. client: EMRContainersClient
  2. paginator: ListJobRunsPaginator
  3. item: ListJobRunsResponsePaginatorTypeDef

Explicit type annotations#

With types-aioboto3-lite[emr-containers] or a standalone types_aiobotocore_emr_containers package, you have to explicitly specify client: EMRContainersClient 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.

# EMRContainersClient usage example with type annotations

from aioboto3.session import Session

from types_aiobotocore_emr_containers.client import EMRContainersClient
from types_aiobotocore_emr_containers.type_defs import CancelJobRunResponseTypeDef
from types_aiobotocore_emr_containers.type_defs import CancelJobRunRequestRequestTypeDef


session = Session()

client: EMRContainersClient
async with session.client("emr-containers") as client:  # (1)
    kwargs: CancelJobRunRequestRequestTypeDef = {...}  # (2)
    result: CancelJobRunResponseTypeDef = await client.cancel_job_run(**kwargs)  # (3)
  1. client: EMRContainersClient
  2. kwargs: CancelJobRunRequestRequestTypeDef
  3. result: CancelJobRunResponseTypeDef
# ListJobRunsPaginator usage example with type annotations

from aioboto3.session import Session

from types_aiobotocore_emr_containers.client import EMRContainersClient
from types_aiobotocore_emr_containers.paginator import ListJobRunsPaginator
from types_aiobotocore_emr_containers.type_defs import ListJobRunsResponsePaginatorTypeDef


session = Session()

client: EMRContainersClient
async with session.client("emr-containers") as client:  # (1)
    paginator: ListJobRunsPaginator = client.get_paginator("list_job_runs")  # (2)
    async for item in paginator.paginate(...):
        item: ListJobRunsResponsePaginatorTypeDef
        print(item)  # (3)
  1. client: EMRContainersClient
  2. paginator: ListJobRunsPaginator
  3. item: ListJobRunsResponsePaginatorTypeDef