Examples#
Index > Route53RecoveryCluster > Examples
Auto-generated documentation for Route53RecoveryCluster type annotations stubs module mypy-boto3-route53-recovery-cluster.
Client#
Implicit type annotations#
Can be used with boto3-stubs[route53-recovery-cluster]
package installed.
Write your Route53RecoveryCluster
code as usual,
type checking and code completion should work out of the box.
Client method usage example#
# Route53RecoveryClusterClient usage example
from boto3.session import Session
session = Session()
client = session.client("route53-recovery-cluster") # (1)
result = client.get_routing_control_state() # (2)
- client: Route53RecoveryClusterClient
- result: GetRoutingControlStateResponseTypeDef
Paginator usage example#
# ListRoutingControlsPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("route53-recovery-cluster") # (1)
paginator = client.get_paginator("list_routing_controls") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: Route53RecoveryClusterClient
- paginator: ListRoutingControlsPaginator
- item: ListRoutingControlsResponseTypeDef
Explicit type annotations#
With boto3-stubs-lite[route53-recovery-cluster]
or a standalone mypy_boto3_route53_recovery_cluster
package, you have to explicitly specify client: Route53RecoveryClusterClient
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#
# Route53RecoveryClusterClient usage example with type annotations
from boto3.session import Session
from mypy_boto3_route53_recovery_cluster.client import Route53RecoveryClusterClient
from mypy_boto3_route53_recovery_cluster.type_defs import GetRoutingControlStateResponseTypeDef
from mypy_boto3_route53_recovery_cluster.type_defs import GetRoutingControlStateRequestTypeDef
session = Session()
client: Route53RecoveryClusterClient = session.client("route53-recovery-cluster")
kwargs: GetRoutingControlStateRequestTypeDef = {...}
result: GetRoutingControlStateResponseTypeDef = client.get_routing_control_state(**kwargs)
Paginator usage example#
# ListRoutingControlsPaginator usage example with type annotations
from boto3.session import Session
from mypy_boto3_route53_recovery_cluster.client import Route53RecoveryClusterClient
from mypy_boto3_route53_recovery_cluster.paginator import ListRoutingControlsPaginator
from mypy_boto3_route53_recovery_cluster.type_defs import ListRoutingControlsResponseTypeDef
session = Session()
client: Route53RecoveryClusterClient = session.client("route53-recovery-cluster")
paginator: ListRoutingControlsPaginator = client.get_paginator("list_routing_controls")
for item in paginator.paginate(...):
item: ListRoutingControlsResponseTypeDef
print(item)