Skip to content

Examples#

Index > TrustedAdvisorPublicAPI > Examples

Auto-generated documentation for TrustedAdvisorPublicAPI type annotations stubs module types-aiobotocore-trustedadvisor.

Client#

Implicit type annotations#

Can be used with types-aioboto3[trustedadvisor] package installed.

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

# TrustedAdvisorPublicAPIClient usage example

from aioboto3.session import Session


session = Session()

async with session.client("trustedadvisor") as client:  # (1)
    result = await client.get_organization_recommendation()  # (2)
  1. client: TrustedAdvisorPublicAPIClient
  2. result: GetOrganizationRecommendationResponseTypeDef
# ListChecksPaginator usage example

from aioboto3.session import Session


session = Session()

async with session.client("trustedadvisor") as client:  # (1)
    paginator = client.get_paginator("list_checks")  # (2)
    async for item in paginator.paginate(...):
        print(item)  # (3)
  1. client: TrustedAdvisorPublicAPIClient
  2. paginator: ListChecksPaginator
  3. item: ListChecksResponseTypeDef

Explicit type annotations#

With types-aioboto3-lite[trustedadvisor] or a standalone types_aiobotocore_trustedadvisor package, you have to explicitly specify client: TrustedAdvisorPublicAPIClient 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.

# TrustedAdvisorPublicAPIClient usage example with type annotations

from aioboto3.session import Session

from types_aiobotocore_trustedadvisor.client import TrustedAdvisorPublicAPIClient
from types_aiobotocore_trustedadvisor.type_defs import GetOrganizationRecommendationResponseTypeDef
from types_aiobotocore_trustedadvisor.type_defs import GetOrganizationRecommendationRequestRequestTypeDef


session = Session()

client: TrustedAdvisorPublicAPIClient
async with session.client("trustedadvisor") as client:  # (1)
    kwargs: GetOrganizationRecommendationRequestRequestTypeDef = {...}  # (2)
    result: GetOrganizationRecommendationResponseTypeDef = await client.get_organization_recommendation(**kwargs)  # (3)
  1. client: TrustedAdvisorPublicAPIClient
  2. kwargs: GetOrganizationRecommendationRequestRequestTypeDef
  3. result: GetOrganizationRecommendationResponseTypeDef
# ListChecksPaginator usage example with type annotations

from aioboto3.session import Session

from types_aiobotocore_trustedadvisor.client import TrustedAdvisorPublicAPIClient
from types_aiobotocore_trustedadvisor.paginator import ListChecksPaginator
from types_aiobotocore_trustedadvisor.type_defs import ListChecksResponseTypeDef


session = Session()

client: TrustedAdvisorPublicAPIClient
async with session.client("trustedadvisor") as client:  # (1)
    paginator: ListChecksPaginator = client.get_paginator("list_checks")  # (2)
    async for item in paginator.paginate(...):
        item: ListChecksResponseTypeDef
        print(item)  # (3)
  1. client: TrustedAdvisorPublicAPIClient
  2. paginator: ListChecksPaginator
  3. item: ListChecksResponseTypeDef