Skip to content

Examples#

Index > ResourceExplorer > Examples

Auto-generated documentation for ResourceExplorer type annotations stubs module types-aiobotocore-resource-explorer-2.

Client#

Implicit type annotations#

Can be used with types-aiobotocore[resource-explorer-2] package installed.

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

# ResourceExplorerClient usage example

from aiobotocore.session import get_session


session = get_session()

async with session.create_client("resource-explorer-2") as client:  # (1)
    result = await client.associate_default_view()  # (2)
  1. client: ResourceExplorerClient
  2. result: AssociateDefaultViewOutputTypeDef
# ListIndexesPaginator usage example

from aiobotocore.session import get_session


session = get_session()

async with session.create_client("resource-explorer-2") as client:  # (1)
    paginator = client.get_paginator("list_indexes")  # (2)
    async for item in paginator.paginate(...):
        print(item)  # (3)
  1. client: ResourceExplorerClient
  2. paginator: ListIndexesPaginator
  3. item: ListIndexesOutputTypeDef

Explicit type annotations#

With types-aiobotocore-lite[resource-explorer-2] or a standalone types_aiobotocore_resource_explorer_2 package, you have to explicitly specify client: ResourceExplorerClient 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.

# ResourceExplorerClient usage example with type annotations

from aiobotocore.session import get_session

from types_aiobotocore_resource_explorer_2.client import ResourceExplorerClient
from types_aiobotocore_resource_explorer_2.type_defs import AssociateDefaultViewOutputTypeDef
from types_aiobotocore_resource_explorer_2.type_defs import AssociateDefaultViewInputRequestTypeDef


session = get_session()

async with session.create_client("resource-explorer-2") as client:
    client: ResourceExplorerClient
    kwargs: AssociateDefaultViewInputRequestTypeDef = {...}
    result: AssociateDefaultViewOutputTypeDef = await client.associate_default_view(**kwargs)
# ListIndexesPaginator usage example with type annotations

from aiobotocore.session import get_session

from types_aiobotocore_resource_explorer_2.client import ResourceExplorerClient
from types_aiobotocore_resource_explorer_2.paginator import ListIndexesPaginator
from types_aiobotocore_resource_explorer_2.type_defs import ListIndexesOutputTypeDef


session = get_session()

async with session.create_client("resource-explorer-2") as client:
    client: ResourceExplorerClient
    paginator: ListIndexesPaginator = client.get_paginator("list_indexes")
    async for item in paginator.paginate(...):
        item: ListIndexesOutputTypeDef
        print(item)