Examples#
Index > TrustedAdvisorPublicAPI > Examples
Auto-generated documentation for TrustedAdvisorPublicAPI type annotations stubs module types-boto3-trustedadvisor.
Client#
Implicit type annotations#
Can be used with types-boto3[trustedadvisor]
package installed.
Write your TrustedAdvisorPublicAPI
code as usual,
type checking and code completion should work out of the box.
Client method usage example#
# TrustedAdvisorPublicAPIClient usage example
from boto3.session import Session
session = Session()
client = session.client("trustedadvisor") # (1)
result = client.batch_update_recommendation_resource_exclusion() # (2)
- client: TrustedAdvisorPublicAPIClient
- result: BatchUpdateRecommendationResourceExclusionResponseTypeDef
Paginator usage example#
# ListChecksPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("trustedadvisor") # (1)
paginator = client.get_paginator("list_checks") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: TrustedAdvisorPublicAPIClient
- paginator: ListChecksPaginator
- item: ListChecksResponseTypeDef
Explicit type annotations#
With types-boto3-lite[trustedadvisor]
or a standalone types_boto3_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.
Client method usage example#
# TrustedAdvisorPublicAPIClient usage example with type annotations
from boto3.session import Session
from types_boto3_trustedadvisor.client import TrustedAdvisorPublicAPIClient
from types_boto3_trustedadvisor.type_defs import BatchUpdateRecommendationResourceExclusionResponseTypeDef
from types_boto3_trustedadvisor.type_defs import BatchUpdateRecommendationResourceExclusionRequestTypeDef
session = Session()
client: TrustedAdvisorPublicAPIClient = session.client("trustedadvisor")
kwargs: BatchUpdateRecommendationResourceExclusionRequestTypeDef = {...}
result: BatchUpdateRecommendationResourceExclusionResponseTypeDef = client.batch_update_recommendation_resource_exclusion(**kwargs)
Paginator usage example#
# ListChecksPaginator usage example with type annotations
from boto3.session import Session
from types_boto3_trustedadvisor.client import TrustedAdvisorPublicAPIClient
from types_boto3_trustedadvisor.paginator import ListChecksPaginator
from types_boto3_trustedadvisor.type_defs import ListChecksResponseTypeDef
session = Session()
client: TrustedAdvisorPublicAPIClient = session.client("trustedadvisor")
paginator: ListChecksPaginator = client.get_paginator("list_checks")
for item in paginator.paginate(...):
item: ListChecksResponseTypeDef
print(item)