mypy-boto3-socialmessaging Type Annotations
Type annotations for the `boto3` AWS SDK's EndUserMessagingSocial service. This library provides static type checking and autocompletion for `boto3` clients and resources related to the Social Messaging service, generated by `mypy-boto3-builder`. It is compatible with various IDEs and static analysis tools like mypy and pyright. The current version is 1.42.28, and it follows a frequent release cadence, often aligning with `boto3` and `botocore` updates.
Warnings
- breaking Python 3.8 support was explicitly removed in `mypy-boto3-builder` version 8.12.0, which affects all generated stub packages, including `mypy-boto3-socialmessaging`. Users on Python 3.8 will need to upgrade their Python version to 3.9+ to use this library.
- breaking Starting from `mypy-boto3-builder` version 8.9.0, there were breaking changes in TypeDef naming conventions. This includes shorter names for packed method arguments (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`) and reordering of `Extra` postfixes. If you rely on specific generated TypeDef names, you may need to update your code.
- gotcha This package provides *only* type annotations (stubs) for the `boto3` library's `EndUserMessagingSocial` service. It does not include the `boto3` runtime itself. You *must* install the `boto3` library separately for your code to function at runtime (`pip install boto3`).
- gotcha The versioning of `mypy-boto3-socialmessaging` (and other `mypy-boto3` ecosystem packages) does not directly correlate with the `boto3` version. It follows independent Python Packaging version specifiers, driven by the `mypy-boto3-builder`, meaning a higher `mypy-boto3-socialmessaging` version doesn't necessarily imply compatibility only with a specific `boto3` version.
Install
-
pip install mypy-boto3-socialmessaging boto3
Imports
- EndUserMessagingSocialClient
from mypy_boto3_socialmessaging.client import EndUserMessagingSocialClient
Quickstart
import boto3
from mypy_boto3_socialmessaging.client import EndUserMessagingSocialClient
from os import environ
from typing import TYPE_CHECKING
# This example assumes AWS credentials are configured (e.g., via environment variables, ~/.aws/credentials, or IAM roles).
if TYPE_CHECKING:
# Only for type checking, not needed at runtime if boto3 is installed
from mypy_boto3_socialmessaging.type_defs import GetProfileSnapshotResponseTypeDef
def get_social_messaging_client() -> EndUserMessagingSocialClient:
"""Returns a type-hinted boto3 SocialMessaging client."""
region = environ.get("AWS_REGION", "us-east-1") # Default region if not set
return boto3.client("end-user-messaging-social", region_name=region)
# Example usage:
# client: EndUserMessagingSocialClient = get_social_messaging_client()
# try:
# # Replace with actual API calls for EndUserMessagingSocial
# response: GetProfileSnapshotResponseTypeDef = client.get_profile_snapshot()
# print(f"Successfully retrieved profile snapshot: {response}")
# except client.exceptions.ResourceNotFoundException:
# print("Profile snapshot not found.")
# except Exception as e:
# print(f"An error occurred: {e}")
print("mypy-boto3-socialmessaging stubs are installed and ready for type-hinting!")
print("Example client function defined: get_social_messaging_client()")