Skip to content

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-aiobotocore[savingsplans] package installed.

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

Client method usage example#

# SavingsPlansClient usage example

from aiobotocore.session import get_session


session = get_session()

async with session.create_client("savingsplans") as client:  # (1)
    result = await client.create_savings_plan()  # (2)
  1. client: SavingsPlansClient
  2. result: CreateSavingsPlanResponseTypeDef

Explicit type annotations#

With types-aiobotocore-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.

Client method usage example#

# SavingsPlansClient usage example with type annotations

from aiobotocore.session import get_session

from types_aiobotocore_savingsplans.client import SavingsPlansClient
from types_aiobotocore_savingsplans.type_defs import CreateSavingsPlanResponseTypeDef
from types_aiobotocore_savingsplans.type_defs import CreateSavingsPlanRequestTypeDef


session = get_session()

async with session.create_client("savingsplans") as client:
    client: SavingsPlansClient
    kwargs: CreateSavingsPlanRequestTypeDef = {...}
    result: CreateSavingsPlanResponseTypeDef = await client.create_savings_plan(**kwargs)