Skip to content

Examples#

Index > WAFRegional > Examples

Auto-generated documentation for WAFRegional type annotations stubs module types-aiobotocore-waf-regional.

Client#

Implicit type annotations#

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

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

# WAFRegionalClient usage example

from aioboto3.session import Session


session = Session()

async with session.client("waf-regional") as client:  # (1)
    result = await client.create_byte_match_set()  # (2)
  1. client: WAFRegionalClient
  2. result: CreateByteMatchSetResponseTypeDef

Explicit type annotations#

With types-aioboto3-lite[waf-regional] or a standalone types_aiobotocore_waf_regional package, you have to explicitly specify client: WAFRegionalClient 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.

# WAFRegionalClient usage example with type annotations

from aioboto3.session import Session

from types_aiobotocore_waf_regional.client import WAFRegionalClient
from types_aiobotocore_waf_regional.type_defs import CreateByteMatchSetResponseTypeDef
from types_aiobotocore_waf_regional.type_defs import CreateByteMatchSetRequestRequestTypeDef


session = Session()

client: WAFRegionalClient
async with session.client("waf-regional") as client:  # (1)
    kwargs: CreateByteMatchSetRequestRequestTypeDef = {...}  # (2)
    result: CreateByteMatchSetResponseTypeDef = await client.create_byte_match_set(**kwargs)  # (3)
  1. client: WAFRegionalClient
  2. kwargs: CreateByteMatchSetRequestRequestTypeDef
  3. result: CreateByteMatchSetResponseTypeDef