Skip to content

Examples#

Index > PinpointEmail > Examples

Auto-generated documentation for PinpointEmail type annotations stubs module mypy-boto3-pinpoint-email.

Client#

Implicit type annotations#

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

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

# PinpointEmailClient usage example

from boto3.session import Session


session = Session()

client = session.client("pinpoint-email")  # (1)
result = client.create_deliverability_test_report()  # (2)
  1. client: PinpointEmailClient
  2. result: CreateDeliverabilityTestReportResponseTypeDef
# GetDedicatedIpsPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("pinpoint-email")  # (1)

paginator = client.get_paginator("get_dedicated_ips")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: PinpointEmailClient
  2. paginator: GetDedicatedIpsPaginator
  3. item: GetDedicatedIpsResponseTypeDef

Explicit type annotations#

With boto3-stubs-lite[pinpoint-email] or a standalone mypy_boto3_pinpoint_email package, you have to explicitly specify client: PinpointEmailClient 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.

# PinpointEmailClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_pinpoint_email.client import PinpointEmailClient
from mypy_boto3_pinpoint_email.type_defs import CreateDeliverabilityTestReportResponseTypeDef
from mypy_boto3_pinpoint_email.type_defs import CreateDeliverabilityTestReportRequestRequestTypeDef


session = Session()

client: PinpointEmailClient = session.client("pinpoint-email")

kwargs: CreateDeliverabilityTestReportRequestRequestTypeDef = {...}
result: CreateDeliverabilityTestReportResponseTypeDef = client.create_deliverability_test_report(**kwargs)
# GetDedicatedIpsPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_pinpoint_email.client import PinpointEmailClient
from mypy_boto3_pinpoint_email.paginator import GetDedicatedIpsPaginator
from mypy_boto3_pinpoint_email.type_defs import GetDedicatedIpsResponseTypeDef


session = Session()
client: PinpointEmailClient = session.client("pinpoint-email")

paginator: GetDedicatedIpsPaginator = client.get_paginator("get_dedicated_ips")
for item in paginator.paginate(...):
    item: GetDedicatedIpsResponseTypeDef
    print(item)