Examples#
Index > SavingsPlans > Examples
Auto-generated documentation for SavingsPlans type annotations stubs module types-aiobotocore-savingsplans.
Client#
Implicit type annotations#
Can be used with types-aioboto3[savingsplans]
package installed.
Write your SavingsPlans
code as usual,
type checking and code completion should work out of the box.
# SavingsPlansClient usage example
from aioboto3.session import Session
session = Session()
async with session.client("savingsplans") as client: # (1)
result = await client.create_savings_plan() # (2)
- client: SavingsPlansClient
- result: CreateSavingsPlanResponseTypeDef
Explicit type annotations#
With types-aioboto3-lite[savingsplans]
or a standalone types_aiobotocore_savingsplans
package, you have to explicitly specify
client: SavingsPlansClient
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.
# SavingsPlansClient usage example with type annotations
from aioboto3.session import Session
from types_aiobotocore_savingsplans.client import SavingsPlansClient
from types_aiobotocore_savingsplans.type_defs import CreateSavingsPlanResponseTypeDef
from types_aiobotocore_savingsplans.type_defs import CreateSavingsPlanRequestRequestTypeDef
session = Session()
client: SavingsPlansClient
async with session.client("savingsplans") as client: # (1)
kwargs: CreateSavingsPlanRequestRequestTypeDef = {...} # (2)
result: CreateSavingsPlanResponseTypeDef = await client.create_savings_plan(**kwargs) # (3)
- client: SavingsPlansClient
- kwargs: CreateSavingsPlanRequestRequestTypeDef
- result: CreateSavingsPlanResponseTypeDef