Skip to content

Examples#

Index > drs > Examples

Auto-generated documentation for drs type annotations stubs module types-aiobotocore-drs.

Client#

Implicit type annotations#

Can be used with types-aiobotocore[drs] package installed.

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

# drsClient usage example

from aiobotocore.session import get_session


session = get_session()

async with session.create_client("drs") as client:  # (1)
    result = await client.associate_source_network_stack()  # (2)
  1. client: drsClient
  2. result: AssociateSourceNetworkStackResponseTypeDef
# DescribeJobLogItemsPaginator usage example

from aiobotocore.session import get_session


session = get_session()

async with session.create_client("drs") as client:  # (1)
    paginator = client.get_paginator("describe_job_log_items")  # (2)
    async for item in paginator.paginate(...):
        print(item)  # (3)
  1. client: drsClient
  2. paginator: DescribeJobLogItemsPaginator
  3. item: DescribeJobLogItemsResponseTypeDef

Explicit type annotations#

With types-aiobotocore-lite[drs] or a standalone types_aiobotocore_drs package, you have to explicitly specify client: drsClient 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.

# drsClient usage example with type annotations

from aiobotocore.session import get_session

from types_aiobotocore_drs.client import drsClient
from types_aiobotocore_drs.type_defs import AssociateSourceNetworkStackResponseTypeDef
from types_aiobotocore_drs.type_defs import AssociateSourceNetworkStackRequestRequestTypeDef


session = get_session()

async with session.create_client("drs") as client:
    client: drsClient
    kwargs: AssociateSourceNetworkStackRequestRequestTypeDef = {...}
    result: AssociateSourceNetworkStackResponseTypeDef = await client.associate_source_network_stack(**kwargs)
# DescribeJobLogItemsPaginator usage example with type annotations

from aiobotocore.session import get_session

from types_aiobotocore_drs.client import drsClient
from types_aiobotocore_drs.paginator import DescribeJobLogItemsPaginator
from types_aiobotocore_drs.type_defs import DescribeJobLogItemsResponseTypeDef


session = get_session()

async with session.create_client("drs") as client:
    client: drsClient
    paginator: DescribeJobLogItemsPaginator = client.get_paginator("describe_job_log_items")
    async for item in paginator.paginate(...):
        item: DescribeJobLogItemsResponseTypeDef
        print(item)