Skip to content

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.

Client method usage example#

# EndUserMessagingSocialClient usage example

from boto3.session import Session


session = Session()

client = session.client("socialmessaging")  # (1)
result = client.associate_whatsapp_business_account()  # (2)
  1. client: EndUserMessagingSocialClient
  2. result: AssociateWhatsAppBusinessAccountOutputTypeDef

Paginator usage example#

# 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)
  1. client: EndUserMessagingSocialClient
  2. paginator: ListLinkedWhatsAppBusinessAccountsPaginator
  3. 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.

Client method usage example#

# 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 AssociateWhatsAppBusinessAccountInputTypeDef


session = Session()

client: EndUserMessagingSocialClient = session.client("socialmessaging")

kwargs: AssociateWhatsAppBusinessAccountInputTypeDef = {...}
result: AssociateWhatsAppBusinessAccountOutputTypeDef = client.associate_whatsapp_business_account(**kwargs)

Paginator usage example#

# 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)