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-aioboto3[drs] package installed.

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

Client usage example
from aioboto3.session import Session


session = Session()

async with session.client("drs") as client:  # (1)
    result = await client.create_extended_source_server()  # (2)
  1. client: drsClient
  2. result: CreateExtendedSourceServerResponseTypeDef
Paginator usage example
from aioboto3.session import Session


session = Session()

async with session.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-aioboto3-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.

Client usage example
from aioboto3.session import Session

from types_aiobotocore_drs.client import drsClient
from types_aiobotocore_drs.type_defs import CreateExtendedSourceServerResponseTypeDef
from types_aiobotocore_drs.type_defs import CreateExtendedSourceServerRequestRequestTypeDef


session = Session()

client: drsClient
async with session.client("drs") as client:  # (1)
    kwargs: CreateExtendedSourceServerRequestRequestTypeDef = {...}  # (2)
    result: CreateExtendedSourceServerResponseTypeDef = await client.create_extended_source_server(**kwargs)  # (3)
  1. client: drsClient
  2. kwargs: CreateExtendedSourceServerRequestRequestTypeDef
  3. result: CreateExtendedSourceServerResponseTypeDef
Paginator usage example
from aioboto3.session import Session

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


session = Session()

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