Examples#
Index > Route53Profiles > Examples
Auto-generated documentation for Route53Profiles type annotations stubs module mypy-boto3-route53profiles.
Client#
Implicit type annotations#
Can be used with boto3-stubs[route53profiles]
package installed.
Write your Route53Profiles
code as usual,
type checking and code completion should work out of the box.
Client method usage example#
# Route53ProfilesClient usage example
from boto3.session import Session
session = Session()
client = session.client("route53profiles") # (1)
result = client.associate_profile() # (2)
- client: Route53ProfilesClient
- result: AssociateProfileResponseTypeDef
Paginator usage example#
# ListProfileAssociationsPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("route53profiles") # (1)
paginator = client.get_paginator("list_profile_associations") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: Route53ProfilesClient
- paginator: ListProfileAssociationsPaginator
- item: ListProfileAssociationsResponseTypeDef
Explicit type annotations#
With boto3-stubs-lite[route53profiles]
or a standalone mypy_boto3_route53profiles
package, you have to explicitly specify client: Route53ProfilesClient
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#
# Route53ProfilesClient usage example with type annotations
from boto3.session import Session
from mypy_boto3_route53profiles.client import Route53ProfilesClient
from mypy_boto3_route53profiles.type_defs import AssociateProfileResponseTypeDef
from mypy_boto3_route53profiles.type_defs import AssociateProfileRequestTypeDef
session = Session()
client: Route53ProfilesClient = session.client("route53profiles")
kwargs: AssociateProfileRequestTypeDef = {...}
result: AssociateProfileResponseTypeDef = client.associate_profile(**kwargs)
Paginator usage example#
# ListProfileAssociationsPaginator usage example with type annotations
from boto3.session import Session
from mypy_boto3_route53profiles.client import Route53ProfilesClient
from mypy_boto3_route53profiles.paginator import ListProfileAssociationsPaginator
from mypy_boto3_route53profiles.type_defs import ListProfileAssociationsResponseTypeDef
session = Session()
client: Route53ProfilesClient = session.client("route53profiles")
paginator: ListProfileAssociationsPaginator = client.get_paginator("list_profile_associations")
for item in paginator.paginate(...):
item: ListProfileAssociationsResponseTypeDef
print(item)