Examples#
Index > RecycleBin > Examples
Auto-generated documentation for RecycleBin type annotations stubs module types-boto3-rbin.
Client#
Implicit type annotations#
Can be used with types-boto3[rbin]
package installed.
Write your RecycleBin
code as usual,
type checking and code completion should work out of the box.
# RecycleBinClient usage example
from boto3.session import Session
session = Session()
client = session.client("rbin") # (1)
result = client.create_rule() # (2)
- client: RecycleBinClient
- result: CreateRuleResponseTypeDef
# ListRulesPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("rbin") # (1)
paginator = client.get_paginator("list_rules") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: RecycleBinClient
- paginator: ListRulesPaginator
- item: ListRulesResponseTypeDef
Explicit type annotations#
With types-boto3-lite[rbin]
or a standalone types_boto3_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.
# RecycleBinClient usage example with type annotations
from boto3.session import Session
from types_boto3_rbin.client import RecycleBinClient
from types_boto3_rbin.type_defs import CreateRuleResponseTypeDef
from types_boto3_rbin.type_defs import CreateRuleRequestRequestTypeDef
session = Session()
client: RecycleBinClient = session.client("rbin")
kwargs: CreateRuleRequestRequestTypeDef = {...}
result: CreateRuleResponseTypeDef = client.create_rule(**kwargs)
# ListRulesPaginator usage example with type annotations
from boto3.session import Session
from types_boto3_rbin.client import RecycleBinClient
from types_boto3_rbin.paginator import ListRulesPaginator
from types_boto3_rbin.type_defs import ListRulesResponseTypeDef
session = Session()
client: RecycleBinClient = session.client("rbin")
paginator: ListRulesPaginator = client.get_paginator("list_rules")
for item in paginator.paginate(...):
item: ListRulesResponseTypeDef
print(item)