Skip to content

Examples#

Index > UserNotificationsContacts > Examples

Auto-generated documentation for UserNotificationsContacts type annotations stubs module types-boto3-notificationscontacts.

Client#

Implicit type annotations#

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

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

Client method usage example#

# UserNotificationsContactsClient usage example

from boto3.session import Session


session = Session()

client = session.client("notificationscontacts")  # (1)
result = client.create_email_contact()  # (2)
  1. client: UserNotificationsContactsClient
  2. result: CreateEmailContactResponseTypeDef

Paginator usage example#

# ListEmailContactsPaginator usage example

from boto3.session import Session


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

paginator = client.get_paginator("list_email_contacts")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: UserNotificationsContactsClient
  2. paginator: ListEmailContactsPaginator
  3. item: ListEmailContactsResponseTypeDef

Explicit type annotations#

With types-boto3-lite[notificationscontacts] or a standalone types_boto3_notificationscontacts package, you have to explicitly specify client: UserNotificationsContactsClient 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 method usage example#

# UserNotificationsContactsClient usage example with type annotations

from boto3.session import Session

from types_boto3_notificationscontacts.client import UserNotificationsContactsClient
from types_boto3_notificationscontacts.type_defs import CreateEmailContactResponseTypeDef
from types_boto3_notificationscontacts.type_defs import CreateEmailContactRequestTypeDef


session = Session()

client: UserNotificationsContactsClient = session.client("notificationscontacts")

kwargs: CreateEmailContactRequestTypeDef = {...}
result: CreateEmailContactResponseTypeDef = client.create_email_contact(**kwargs)

Paginator usage example#

# ListEmailContactsPaginator usage example with type annotations

from boto3.session import Session

from types_boto3_notificationscontacts.client import UserNotificationsContactsClient
from types_boto3_notificationscontacts.paginator import ListEmailContactsPaginator
from types_boto3_notificationscontacts.type_defs import ListEmailContactsResponseTypeDef


session = Session()
client: UserNotificationsContactsClient = session.client("notificationscontacts")

paginator: ListEmailContactsPaginator = client.get_paginator("list_email_contacts")
for item in paginator.paginate(...):
    item: ListEmailContactsResponseTypeDef
    print(item)