Examples#
Index > Route53Resolver > Examples
Auto-generated documentation for Route53Resolver type annotations stubs module types-boto3-route53resolver.
Client#
Implicit type annotations#
Can be used with types-boto3[route53resolver]
package installed.
Write your Route53Resolver
code as usual,
type checking and code completion should work out of the box.
# Route53ResolverClient usage example
from boto3.session import Session
session = Session()
client = session.client("route53resolver") # (1)
result = client.associate_firewall_rule_group() # (2)
- client: Route53ResolverClient
- result: AssociateFirewallRuleGroupResponseTypeDef
# ListFirewallConfigsPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("route53resolver") # (1)
paginator = client.get_paginator("list_firewall_configs") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: Route53ResolverClient
- paginator: ListFirewallConfigsPaginator
- item: ListFirewallConfigsResponseTypeDef
Explicit type annotations#
With types-boto3-lite[route53resolver]
or a standalone types_boto3_route53resolver
package, you have to explicitly specify client: Route53ResolverClient
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.
# Route53ResolverClient usage example with type annotations
from boto3.session import Session
from types_boto3_route53resolver.client import Route53ResolverClient
from types_boto3_route53resolver.type_defs import AssociateFirewallRuleGroupResponseTypeDef
from types_boto3_route53resolver.type_defs import AssociateFirewallRuleGroupRequestRequestTypeDef
session = Session()
client: Route53ResolverClient = session.client("route53resolver")
kwargs: AssociateFirewallRuleGroupRequestRequestTypeDef = {...}
result: AssociateFirewallRuleGroupResponseTypeDef = client.associate_firewall_rule_group(**kwargs)
# ListFirewallConfigsPaginator usage example with type annotations
from boto3.session import Session
from types_boto3_route53resolver.client import Route53ResolverClient
from types_boto3_route53resolver.paginator import ListFirewallConfigsPaginator
from types_boto3_route53resolver.type_defs import ListFirewallConfigsResponseTypeDef
session = Session()
client: Route53ResolverClient = session.client("route53resolver")
paginator: ListFirewallConfigsPaginator = client.get_paginator("list_firewall_configs")
for item in paginator.paginate(...):
item: ListFirewallConfigsResponseTypeDef
print(item)