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.
# drsClient usage example
from aioboto3.session import Session
session = Session()
async with session.client("drs") as client: # (1)
result = await client.associate_source_network_stack() # (2)
- client: drsClient
- result: AssociateSourceNetworkStackResponseTypeDef
# DescribeJobLogItemsPaginator 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)
- client: drsClient
- paginator: DescribeJobLogItemsPaginator
- 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.
# drsClient usage example with type annotations
from aioboto3.session import 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 = Session()
client: drsClient
async with session.client("drs") as client: # (1)
kwargs: AssociateSourceNetworkStackRequestRequestTypeDef = {...} # (2)
result: AssociateSourceNetworkStackResponseTypeDef = await client.associate_source_network_stack(**kwargs) # (3)
- client: drsClient
- kwargs: AssociateSourceNetworkStackRequestRequestTypeDef
- result: AssociateSourceNetworkStackResponseTypeDef
# DescribeJobLogItemsPaginator usage example with type annotations
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)
- client: drsClient
- paginator: DescribeJobLogItemsPaginator
- item: DescribeJobLogItemsResponseTypeDef