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.
# UserNotificationsContactsClient usage example
from boto3.session import Session
session = Session()
client = session.client("notificationscontacts") # (1)
result = client.create_email_contact() # (2)
- client: UserNotificationsContactsClient
- result: CreateEmailContactResponseTypeDef
# 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)
- client: UserNotificationsContactsClient
- paginator: ListEmailContactsPaginator
- 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.
# 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 CreateEmailContactRequestRequestTypeDef
session = Session()
client: UserNotificationsContactsClient = session.client("notificationscontacts")
kwargs: CreateEmailContactRequestRequestTypeDef = {...}
result: CreateEmailContactResponseTypeDef = client.create_email_contact(**kwargs)
# 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)