Skip to content

Examples#

Index > Pricing > Examples

Auto-generated documentation for Pricing type annotations stubs module types-aiobotocore-pricing.

Client#

Implicit type annotations#

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

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

# PricingClient usage example

from aiobotocore.session import get_session


session = get_session()

async with session.create_client("pricing") as client:  # (1)
    result = await client.describe_services()  # (2)
  1. client: PricingClient
  2. result: DescribeServicesResponseTypeDef
# DescribeServicesPaginator usage example

from aiobotocore.session import get_session


session = get_session()

async with session.create_client("pricing") as client:  # (1)
    paginator = client.get_paginator("describe_services")  # (2)
    async for item in paginator.paginate(...):
        print(item)  # (3)
  1. client: PricingClient
  2. paginator: DescribeServicesPaginator
  3. item: DescribeServicesResponseTypeDef

Explicit type annotations#

With types-aiobotocore-lite[pricing] or a standalone types_aiobotocore_pricing package, you have to explicitly specify client: PricingClient 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.

# PricingClient usage example with type annotations

from aiobotocore.session import get_session

from types_aiobotocore_pricing.client import PricingClient
from types_aiobotocore_pricing.type_defs import DescribeServicesResponseTypeDef
from types_aiobotocore_pricing.type_defs import DescribeServicesRequestRequestTypeDef


session = get_session()

async with session.create_client("pricing") as client:
    client: PricingClient
    kwargs: DescribeServicesRequestRequestTypeDef = {...}
    result: DescribeServicesResponseTypeDef = await client.describe_services(**kwargs)
# DescribeServicesPaginator usage example with type annotations

from aiobotocore.session import get_session

from types_aiobotocore_pricing.client import PricingClient
from types_aiobotocore_pricing.paginator import DescribeServicesPaginator
from types_aiobotocore_pricing.type_defs import DescribeServicesResponseTypeDef


session = get_session()

async with session.create_client("pricing") as client:
    client: PricingClient
    paginator: DescribeServicesPaginator = client.get_paginator("describe_services")
    async for item in paginator.paginate(...):
        item: DescribeServicesResponseTypeDef
        print(item)