Skip to content

Examples#

Index > MailManager > Examples

Auto-generated documentation for MailManager type annotations stubs module types-boto3-mailmanager.

Client#

Implicit type annotations#

Can be used with types-boto3[mailmanager] package installed.

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

# MailManagerClient usage example

from boto3.session import Session


session = Session()

client = session.client("mailmanager")  # (1)
result = client.create_addon_instance()  # (2)
  1. client: MailManagerClient
  2. result: CreateAddonInstanceResponseTypeDef
# ListAddonInstancesPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("mailmanager")  # (1)

paginator = client.get_paginator("list_addon_instances")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: MailManagerClient
  2. paginator: ListAddonInstancesPaginator
  3. item: ListAddonInstancesResponseTypeDef

Explicit type annotations#

With types-boto3-lite[mailmanager] or a standalone types_boto3_mailmanager package, you have to explicitly specify client: MailManagerClient 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.

# MailManagerClient usage example with type annotations

from boto3.session import Session

from types_boto3_mailmanager.client import MailManagerClient
from types_boto3_mailmanager.type_defs import CreateAddonInstanceResponseTypeDef
from types_boto3_mailmanager.type_defs import CreateAddonInstanceRequestRequestTypeDef


session = Session()

client: MailManagerClient = session.client("mailmanager")

kwargs: CreateAddonInstanceRequestRequestTypeDef = {...}
result: CreateAddonInstanceResponseTypeDef = client.create_addon_instance(**kwargs)
# ListAddonInstancesPaginator usage example with type annotations

from boto3.session import Session

from types_boto3_mailmanager.client import MailManagerClient
from types_boto3_mailmanager.paginator import ListAddonInstancesPaginator
from types_boto3_mailmanager.type_defs import ListAddonInstancesResponseTypeDef


session = Session()
client: MailManagerClient = session.client("mailmanager")

paginator: ListAddonInstancesPaginator = client.get_paginator("list_addon_instances")
for item in paginator.paginate(...):
    item: ListAddonInstancesResponseTypeDef
    print(item)