Skip to content

Examples

Index > WAFV2 > Examples

Auto-generated documentation for WAFV2 type annotations stubs module types-aiobotocore-wafv2.

Client

Implicit type annotations

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

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

Client usage example
from aioboto3.session import Session


session = Session()

async with session.client("wafv2") as client:  # (1)
    result = await client.check_capacity()  # (2)
  1. client: WAFV2Client
  2. result: CheckCapacityResponseTypeDef

Explicit type annotations

With types-aioboto3-lite[wafv2] or a standalone types_aiobotocore_wafv2 package, you have to explicitly specify client: WAFV2Client 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 usage example
from aioboto3.session import Session

from types_aiobotocore_wafv2.client import WAFV2Client
from types_aiobotocore_wafv2.type_defs import CheckCapacityResponseTypeDef
from types_aiobotocore_wafv2.type_defs import CheckCapacityRequestRequestTypeDef


session = Session()

client: WAFV2Client
async with session.client("wafv2") as client:  # (1)
    kwargs: CheckCapacityRequestRequestTypeDef = {...}  # (2)
    result: CheckCapacityResponseTypeDef = await client.check_capacity(**kwargs)  # (3)
  1. client: WAFV2Client
  2. kwargs: CheckCapacityRequestRequestTypeDef
  3. result: CheckCapacityResponseTypeDef