mypy-boto3-trustedadvisor Type Stubs

1.42.54 · active · verified Sat Apr 11

mypy-boto3-trustedadvisor provides type annotations for the boto3 TrustedAdvisorPublicAPI service, ensuring static type checking and improved IDE autocomplete for AWS Trusted Advisor operations. It is generated by the mypy-boto3-builder, which frequently releases updates to keep pace with new boto3 versions and service changes, often on a weekly or bi-weekly cadence.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to obtain a type-hinted TrustedAdvisorPublicAPIClient using boto3 and the mypy-boto3-trustedadvisor stubs. It shows explicit type annotation for the client and a response TypeDef for improved type checking and auto-completion.

import boto3
from mypy_boto3_trustedadvisor.client import TrustedAdvisorPublicAPIClient
from mypy_boto3_trustedadvisor.type_defs import DescribeAccountRecommendationsResponseTypeDef

def get_trustedadvisor_client() -> TrustedAdvisorPublicAPIClient:
    # Assuming AWS credentials are configured (e.g., via environment variables, ~/.aws/credentials)
    session = boto3.session.Session()
    client: TrustedAdvisorPublicAPIClient = session.client('trustedadvisor')
    return client

if __name__ == '__main__':
    trustedadvisor_client = get_trustedadvisor_client()
    # Example API call with type hints
    response: DescribeAccountRecommendationsResponseTypeDef = trustedadvisor_client.describe_account_recommendations()
    print(response)

view raw JSON →