Examples#
Index > EndUserMessagingSocial > Examples
Auto-generated documentation for EndUserMessagingSocial type annotations stubs module types-boto3-socialmessaging.
Client#
Implicit type annotations#
Can be used with types-boto3[socialmessaging]
package installed.
Write your EndUserMessagingSocial
code as usual,
type checking and code completion should work out of the box.
# EndUserMessagingSocialClient usage example
from boto3.session import Session
session = Session()
client = session.client("socialmessaging") # (1)
result = client.associate_whatsapp_business_account() # (2)
# ListLinkedWhatsAppBusinessAccountsPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("socialmessaging") # (1)
paginator = client.get_paginator("list_linked_whatsapp_business_accounts") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: EndUserMessagingSocialClient
- paginator: ListLinkedWhatsAppBusinessAccountsPaginator
- item: ListLinkedWhatsAppBusinessAccountsOutputTypeDef
Explicit type annotations#
With types-boto3-lite[socialmessaging]
or a standalone types_boto3_socialmessaging
package, you have to explicitly specify client: EndUserMessagingSocialClient
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.
# EndUserMessagingSocialClient usage example with type annotations
from boto3.session import Session
from types_boto3_socialmessaging.client import EndUserMessagingSocialClient
from types_boto3_socialmessaging.type_defs import AssociateWhatsAppBusinessAccountOutputTypeDef
from types_boto3_socialmessaging.type_defs import AssociateWhatsAppBusinessAccountInputRequestTypeDef
session = Session()
client: EndUserMessagingSocialClient = session.client("socialmessaging")
kwargs: AssociateWhatsAppBusinessAccountInputRequestTypeDef = {...}
result: AssociateWhatsAppBusinessAccountOutputTypeDef = client.associate_whatsapp_business_account(**kwargs)
# ListLinkedWhatsAppBusinessAccountsPaginator usage example with type annotations
from boto3.session import Session
from types_boto3_socialmessaging.client import EndUserMessagingSocialClient
from types_boto3_socialmessaging.paginator import ListLinkedWhatsAppBusinessAccountsPaginator
from types_boto3_socialmessaging.type_defs import ListLinkedWhatsAppBusinessAccountsOutputTypeDef
session = Session()
client: EndUserMessagingSocialClient = session.client("socialmessaging")
paginator: ListLinkedWhatsAppBusinessAccountsPaginator = client.get_paginator("list_linked_whatsapp_business_accounts")
for item in paginator.paginate(...):
item: ListLinkedWhatsAppBusinessAccountsOutputTypeDef
print(item)