Skip to content

Examples#

Index > Route53Resolver > Examples

Auto-generated documentation for Route53Resolver type annotations stubs module types-aiobotocore-route53resolver.

Client#

Implicit type annotations#

Can be used with types-aioboto3[route53resolver] package installed.

Write your Route53Resolver code as usual, type checking and code completion should work out of the box.

# Route53ResolverClient usage example

from aioboto3.session import Session


session = Session()

async with session.client("route53resolver") as client:  # (1)
    result = await client.associate_firewall_rule_group()  # (2)
  1. client: Route53ResolverClient
  2. result: AssociateFirewallRuleGroupResponseTypeDef
# ListFirewallConfigsPaginator usage example

from aioboto3.session import Session


session = Session()

async with session.client("route53resolver") as client:  # (1)
    paginator = client.get_paginator("list_firewall_configs")  # (2)
    async for item in paginator.paginate(...):
        print(item)  # (3)
  1. client: Route53ResolverClient
  2. paginator: ListFirewallConfigsPaginator
  3. item: ListFirewallConfigsResponseTypeDef

Explicit type annotations#

With types-aioboto3-lite[route53resolver] or a standalone types_aiobotocore_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 aioboto3.session import Session

from types_aiobotocore_route53resolver.client import Route53ResolverClient
from types_aiobotocore_route53resolver.type_defs import AssociateFirewallRuleGroupResponseTypeDef
from types_aiobotocore_route53resolver.type_defs import AssociateFirewallRuleGroupRequestRequestTypeDef


session = Session()

client: Route53ResolverClient
async with session.client("route53resolver") as client:  # (1)
    kwargs: AssociateFirewallRuleGroupRequestRequestTypeDef = {...}  # (2)
    result: AssociateFirewallRuleGroupResponseTypeDef = await client.associate_firewall_rule_group(**kwargs)  # (3)
  1. client: Route53ResolverClient
  2. kwargs: AssociateFirewallRuleGroupRequestRequestTypeDef
  3. result: AssociateFirewallRuleGroupResponseTypeDef
# ListFirewallConfigsPaginator usage example with type annotations

from aioboto3.session import Session

from types_aiobotocore_route53resolver.client import Route53ResolverClient
from types_aiobotocore_route53resolver.paginator import ListFirewallConfigsPaginator
from types_aiobotocore_route53resolver.type_defs import ListFirewallConfigsResponseTypeDef


session = Session()

client: Route53ResolverClient
async with session.client("route53resolver") as client:  # (1)
    paginator: ListFirewallConfigsPaginator = client.get_paginator("list_firewall_configs")  # (2)
    async for item in paginator.paginate(...):
        item: ListFirewallConfigsResponseTypeDef
        print(item)  # (3)
  1. client: Route53ResolverClient
  2. paginator: ListFirewallConfigsPaginator
  3. item: ListFirewallConfigsResponseTypeDef