Skip to content

Examples#

Index > RecycleBin > Examples

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

Client#

Implicit type annotations#

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

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

Client method usage example#

# RecycleBinClient usage example

from aiobotocore.session import get_session


session = get_session()

async with session.create_client("rbin") as client:  # (1)
    result = await client.create_rule()  # (2)
  1. client: RecycleBinClient
  2. result: CreateRuleResponseTypeDef

Paginator usage example#

# ListRulesPaginator usage example

from aiobotocore.session import get_session


session = get_session()

async with session.create_client("rbin") as client:  # (1)
    paginator = client.get_paginator("list_rules")  # (2)
    async for item in paginator.paginate(...):
        print(item)  # (3)
  1. client: RecycleBinClient
  2. paginator: ListRulesPaginator
  3. item: ListRulesResponseTypeDef

Explicit type annotations#

With types-aiobotocore-lite[rbin] or a standalone types_aiobotocore_rbin package, you have to explicitly specify client: RecycleBinClient 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 method usage example#

# RecycleBinClient usage example with type annotations

from aiobotocore.session import get_session

from types_aiobotocore_rbin.client import RecycleBinClient
from types_aiobotocore_rbin.type_defs import CreateRuleResponseTypeDef
from types_aiobotocore_rbin.type_defs import CreateRuleRequestTypeDef


session = get_session()

async with session.create_client("rbin") as client:
    client: RecycleBinClient
    kwargs: CreateRuleRequestTypeDef = {...}
    result: CreateRuleResponseTypeDef = await client.create_rule(**kwargs)

Paginator usage example#

# ListRulesPaginator usage example with type annotations

from aiobotocore.session import get_session

from types_aiobotocore_rbin.client import RecycleBinClient
from types_aiobotocore_rbin.paginator import ListRulesPaginator
from types_aiobotocore_rbin.type_defs import ListRulesResponseTypeDef


session = get_session()

async with session.create_client("rbin") as client:
    client: RecycleBinClient
    paginator: ListRulesPaginator = client.get_paginator("list_rules")
    async for item in paginator.paginate(...):
        item: ListRulesResponseTypeDef
        print(item)