Skip to content


Index > SESV2 > Examples

Auto-generated documentation for SESV2 type annotations stubs module mypy-boto3-sesv2.


Implicit type annotations

Can be used with boto3-stubs[sesv2] package installed.

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

Client usage example
from boto3.session import Session

session = Session()

client = session.client("sesv2")  # (1)
result = client.batch_get_metric_data()  # (2)
  1. client: SESV2Client
  2. result: BatchGetMetricDataResponseTypeDef

Explicit type annotations

With boto3-stubs-lite[sesv2] or a standalone mypy_boto3_sesv2 package, you have to explicitly specify client: SESV2Client 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 boto3.session import Session

from mypy_boto3_sesv2.client import SESV2Client
from mypy_boto3_sesv2.type_defs import BatchGetMetricDataResponseTypeDef
from mypy_boto3_sesv2.type_defs import BatchGetMetricDataRequestRequestTypeDef

session = Session()

client: SESV2Client = session.client("sesv2")

kwargs: BatchGetMetricDataRequestRequestTypeDef = {...}
result: BatchGetMetricDataResponseTypeDef = client.batch_get_metric_data(**kwargs)