SNSServiceResource
Auto-generated documentation for SNS type annotations stubs module mypy-boto3-sns.
SNSServiceResource
Type annotations and code completion for boto3.resource("sns")
, included resources and collections.
boto3 documentation
from mypy_boto3_sns.service_resource import SNSServiceResource
def get_sns_resource() -> SNSServiceResource:
return boto3.resource("sns")
Attributes
-
meta
: SNSResourceMeta -
platform_applications
: ServiceResourcePlatformApplicationsCollection -
subscriptions
: ServiceResourceSubscriptionsCollection -
topics
: ServiceResourceTopicsCollection
Collections
ServiceResourcePlatformApplicationsCollection
Provides access to PlatformApplication resource.
Type annotations and code completion for boto3.resource("sns").platform_applications
collection.
boto3 documentation
from mypy_boto3_sns.service_resource import ServiceResourcePlatformApplicationsCollection
def get_collection() -> ServiceResourcePlatformApplicationsCollection:
return boto3.resource("sns").platform_applications
ServiceResourceSubscriptionsCollection
Provides access to Subscription resource.
Type annotations and code completion for boto3.resource("sns").subscriptions
collection.
boto3 documentation
from mypy_boto3_sns.service_resource import ServiceResourceSubscriptionsCollection
def get_collection() -> ServiceResourceSubscriptionsCollection:
return boto3.resource("sns").subscriptions
ServiceResourceTopicsCollection
Provides access to Topic resource.
Type annotations and code completion for boto3.resource("sns").topics
collection.
boto3 documentation
from mypy_boto3_sns.service_resource import ServiceResourceTopicsCollection
def get_collection() -> ServiceResourceTopicsCollection:
return boto3.resource("sns").topics
Methods
SNSServiceResource.PlatformApplication method
Creates a PlatformApplication resource.
Type annotations and code completion for boto3.resource("sns").PlatformApplication
method.
boto3 documentation
kwargs: ServiceResourcePlatformApplicationRequestTypeDef = { # (1)
"arn": ...,
}
parent.PlatformApplication(**kwargs)
SNSServiceResource.PlatformEndpoint method
Creates a PlatformEndpoint resource.
Type annotations and code completion for boto3.resource("sns").PlatformEndpoint
method.
boto3 documentation
kwargs: ServiceResourcePlatformEndpointRequestTypeDef = { # (1)
"arn": ...,
}
parent.PlatformEndpoint(**kwargs)
SNSServiceResource.Subscription method
Creates a Subscription resource.
Type annotations and code completion for boto3.resource("sns").Subscription
method.
boto3 documentation
kwargs: ServiceResourceSubscriptionRequestTypeDef = { # (1)
"arn": ...,
}
parent.Subscription(**kwargs)
SNSServiceResource.Topic method
Creates a Topic resource.
Type annotations and code completion for boto3.resource("sns").Topic
method.
boto3 documentation
kwargs: ServiceResourceTopicRequestTypeDef = { # (1)
"arn": ...,
}
parent.Topic(**kwargs)
SNSServiceResource.create_platform_application method
Creates a platform application object for one of the supported push notification services, such as APNS and GCM (Firebase Cloud Messaging), to which devices and mobile apps may register.
Type annotations and code completion for boto3.resource("sns").create_platform_application
method.
boto3 documentation
def create_platform_application(
self,
*,
Name: str,
Platform: str,
Attributes: Mapping[str, str],
) -> PlatformApplication:
...
kwargs: CreatePlatformApplicationInputServiceResourceCreatePlatformApplicationTypeDef = { # (1)
"Name": ...,
"Platform": ...,
"Attributes": ...,
}
parent.create_platform_application(**kwargs)
SNSServiceResource.create_topic method
Creates a topic to which notifications can be published.
Type annotations and code completion for boto3.resource("sns").create_topic
method.
boto3 documentation
def create_topic(
self,
*,
Name: str,
Attributes: Mapping[str, str] = ...,
Tags: Sequence[TagTypeDef] = ..., # (1)
DataProtectionPolicy: str = ...,
) -> Topic:
...
- See TagTypeDef
kwargs: CreateTopicInputServiceResourceCreateTopicTypeDef = { # (1)
"Name": ...,
}
parent.create_topic(**kwargs)
SNSServiceResource.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("sns").get_available_subresources
method.
boto3 documentation
PlatformApplication
Type annotations and code completion for boto3.resource("sns").PlatformApplication
class.
boto3 documentation
from mypy_boto3_sns.service_resource import PlatformApplication
def get_resource() -> PlatformApplication:
return boto3.resource("sns").PlatformApplication(...)
PlatformApplication attributes
attributes
:Dict
[str
,str
]arn
:str
endpoints
: PlatformApplicationEndpointsCollection
PlatformApplication collections
PlatformApplication.endpoints
Provides access to PlatformEndpoint resource.
Type annotations and code completion for boto3.resource("sns").PlatformApplication(...).endpoints
collection.
boto3 documentation
from mypy_boto3_sns.service_resource import PlatformApplicationEndpointsCollection
def get_collection() -> PlatformApplicationEndpointsCollection:
resource = boto3.resource("sns").PlatformApplication(...)
return resource.endpoints
PlatformApplication methods
PlatformApplication.create_platform_endpoint method
Creates an endpoint for a device and mobile app on one of the supported push notification services, such as GCM (Firebase Cloud Messaging) and APNS.
Type annotations and code completion for boto3.resource("sns").create_platform_endpoint
method.
boto3 documentation
def create_platform_endpoint(
self,
*,
Token: str,
CustomUserData: str = ...,
Attributes: Mapping[str, str] = ...,
) -> PlatformEndpoint:
...
kwargs: CreatePlatformEndpointInputPlatformApplicationCreatePlatformEndpointTypeDef = { # (1)
"Token": ...,
}
parent.create_platform_endpoint(**kwargs)
PlatformApplication.delete method
Deletes a platform application object for one of the supported push notification services, such as APNS and GCM (Firebase Cloud Messaging).
Type annotations and code completion for boto3.resource("sns").delete
method.
boto3 documentation
PlatformApplication.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("sns").get_available_subresources
method.
boto3 documentation
PlatformApplication.load method
Calls meth:SNS.Client.get_platform_application_attributes
to update the
attributes of the PlatformApplication resource.
Type annotations and code completion for boto3.resource("sns").load
method.
boto3 documentation
PlatformApplication.reload method
Calls meth:SNS.Client.get_platform_application_attributes
to update the
attributes of the PlatformApplication resource.
Type annotations and code completion for boto3.resource("sns").reload
method.
boto3 documentation
PlatformApplication.set_attributes method
Sets the attributes of the platform application object for the supported push notification services, such as APNS and GCM (Firebase Cloud Messaging).
Type annotations and code completion for boto3.resource("sns").set_attributes
method.
boto3 documentation
kwargs: SetPlatformApplicationAttributesInputPlatformApplicationSetAttributesTypeDef = { # (1)
"Attributes": ...,
}
parent.set_attributes(**kwargs)
PlatformEndpoint
Type annotations and code completion for boto3.resource("sns").PlatformEndpoint
class.
boto3 documentation
from mypy_boto3_sns.service_resource import PlatformEndpoint
def get_resource() -> PlatformEndpoint:
return boto3.resource("sns").PlatformEndpoint(...)
PlatformEndpoint attributes
attributes
:Dict
[str
,str
]arn
:str
PlatformEndpoint methods
PlatformEndpoint.delete method
Deletes the endpoint for a device and mobile app from Amazon SNS.
Type annotations and code completion for boto3.resource("sns").delete
method.
boto3 documentation
PlatformEndpoint.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("sns").get_available_subresources
method.
boto3 documentation
PlatformEndpoint.load method
Calls meth:SNS.Client.get_endpoint_attributes
to update the attributes of
the PlatformEndpoint resource.
Type annotations and code completion for boto3.resource("sns").load
method.
boto3 documentation
PlatformEndpoint.publish method
Sends a message to an Amazon SNS topic, a text message (SMS message) directly to
a phone number, or a message to a mobile platform endpoint (when you specify the
TargetArn
).
Type annotations and code completion for boto3.resource("sns").publish
method.
boto3 documentation
def publish(
self,
*,
Message: str,
TopicArn: str = ...,
PhoneNumber: str = ...,
Subject: str = ...,
MessageStructure: str = ...,
MessageAttributes: Mapping[str, MessageAttributeValueTypeDef] = ..., # (1)
MessageDeduplicationId: str = ...,
MessageGroupId: str = ...,
) -> PublishResponseTypeDef: # (2)
...
kwargs: PublishInputPlatformEndpointPublishTypeDef = { # (1)
"Message": ...,
}
parent.publish(**kwargs)
PlatformEndpoint.reload method
Calls meth:SNS.Client.get_endpoint_attributes
to update the attributes of
the PlatformEndpoint resource.
Type annotations and code completion for boto3.resource("sns").reload
method.
boto3 documentation
PlatformEndpoint.set_attributes method
Sets the attributes for an endpoint for a device on one of the supported push notification services, such as GCM (Firebase Cloud Messaging) and APNS.
Type annotations and code completion for boto3.resource("sns").set_attributes
method.
boto3 documentation
kwargs: SetEndpointAttributesInputPlatformEndpointSetAttributesTypeDef = { # (1)
"Attributes": ...,
}
parent.set_attributes(**kwargs)
Subscription
Type annotations and code completion for boto3.resource("sns").Subscription
class.
boto3 documentation
from mypy_boto3_sns.service_resource import Subscription
def get_resource() -> Subscription:
return boto3.resource("sns").Subscription(...)
Subscription attributes
attributes
:Dict
[str
,str
]arn
:str
Subscription methods
Subscription.delete method
Deletes a subscription.
Type annotations and code completion for boto3.resource("sns").delete
method.
boto3 documentation
Subscription.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("sns").get_available_subresources
method.
boto3 documentation
Subscription.load method
Calls meth:SNS.Client.get_subscription_attributes
to update the attributes
of the Subscription resource.
Type annotations and code completion for boto3.resource("sns").load
method.
boto3 documentation
Subscription.reload method
Calls meth:SNS.Client.get_subscription_attributes
to update the attributes
of the Subscription resource.
Type annotations and code completion for boto3.resource("sns").reload
method.
boto3 documentation
Subscription.set_attributes method
Allows a subscription owner to set an attribute of the subscription to a new value.
Type annotations and code completion for boto3.resource("sns").set_attributes
method.
boto3 documentation
def set_attributes(
self,
*,
AttributeName: str,
AttributeValue: str = ...,
) -> None:
...
kwargs: SetSubscriptionAttributesInputSubscriptionSetAttributesTypeDef = { # (1)
"AttributeName": ...,
}
parent.set_attributes(**kwargs)
Topic
Type annotations and code completion for boto3.resource("sns").Topic
class.
boto3 documentation
from mypy_boto3_sns.service_resource import Topic
def get_resource() -> Topic:
return boto3.resource("sns").Topic(...)
Topic attributes
attributes
:Dict
[str
,str
]arn
:str
subscriptions
: TopicSubscriptionsCollection
Topic collections
Topic.subscriptions
Provides access to Subscription resource.
Type annotations and code completion for boto3.resource("sns").Topic(...).subscriptions
collection.
boto3 documentation
from mypy_boto3_sns.service_resource import TopicSubscriptionsCollection
def get_collection() -> TopicSubscriptionsCollection:
resource = boto3.resource("sns").Topic(...)
return resource.subscriptions
Topic methods
Topic.add_permission method
Adds a statement to a topic's access control policy, granting access for the specified Amazon Web Services accounts to the specified actions.
Type annotations and code completion for boto3.resource("sns").add_permission
method.
boto3 documentation
def add_permission(
self,
*,
Label: str,
AWSAccountId: Sequence[str],
ActionName: Sequence[str],
) -> None:
...
kwargs: AddPermissionInputTopicAddPermissionTypeDef = { # (1)
"Label": ...,
"AWSAccountId": ...,
"ActionName": ...,
}
parent.add_permission(**kwargs)
Topic.confirm_subscription method
Verifies an endpoint owner's intent to receive messages by validating the token
sent to the endpoint by an earlier Subscribe
action.
Type annotations and code completion for boto3.resource("sns").confirm_subscription
method.
boto3 documentation
def confirm_subscription(
self,
*,
Token: str,
AuthenticateOnUnsubscribe: str = ...,
) -> Subscription:
...
kwargs: ConfirmSubscriptionInputTopicConfirmSubscriptionTypeDef = { # (1)
"Token": ...,
}
parent.confirm_subscription(**kwargs)
Topic.delete method
Deletes a topic and all its subscriptions.
Type annotations and code completion for boto3.resource("sns").delete
method.
boto3 documentation
Topic.get_available_subresources method
Returns a list of all the available sub-resources for this Resource.
Type annotations and code completion for boto3.resource("sns").get_available_subresources
method.
boto3 documentation
Topic.load method
Calls meth:SNS.Client.get_topic_attributes
to update the attributes of the
Topic resource.
Type annotations and code completion for boto3.resource("sns").load
method.
boto3 documentation
Topic.publish method
Sends a message to an Amazon SNS topic, a text message (SMS message) directly to
a phone number, or a message to a mobile platform endpoint (when you specify the
TargetArn
).
Type annotations and code completion for boto3.resource("sns").publish
method.
boto3 documentation
def publish(
self,
*,
Message: str,
TargetArn: str = ...,
PhoneNumber: str = ...,
Subject: str = ...,
MessageStructure: str = ...,
MessageAttributes: Mapping[str, MessageAttributeValueTypeDef] = ..., # (1)
MessageDeduplicationId: str = ...,
MessageGroupId: str = ...,
) -> PublishResponseTypeDef: # (2)
...
kwargs: PublishInputTopicPublishTypeDef = { # (1)
"Message": ...,
}
parent.publish(**kwargs)
Topic.reload method
Calls meth:SNS.Client.get_topic_attributes
to update the attributes of the
Topic resource.
Type annotations and code completion for boto3.resource("sns").reload
method.
boto3 documentation
Topic.remove_permission method
Removes a statement from a topic's access control policy.
Type annotations and code completion for boto3.resource("sns").remove_permission
method.
boto3 documentation
kwargs: RemovePermissionInputTopicRemovePermissionTypeDef = { # (1)
"Label": ...,
}
parent.remove_permission(**kwargs)
Topic.set_attributes method
Allows a topic owner to set an attribute of the topic to a new value.
Type annotations and code completion for boto3.resource("sns").set_attributes
method.
boto3 documentation
def set_attributes(
self,
*,
AttributeName: str,
AttributeValue: str = ...,
) -> None:
...
kwargs: SetTopicAttributesInputTopicSetAttributesTypeDef = { # (1)
"AttributeName": ...,
}
parent.set_attributes(**kwargs)
Topic.subscribe method
Subscribes an endpoint to an Amazon SNS topic.
Type annotations and code completion for boto3.resource("sns").subscribe
method.
boto3 documentation
def subscribe(
self,
*,
Protocol: str,
Endpoint: str = ...,
Attributes: Mapping[str, str] = ...,
ReturnSubscriptionArn: bool = ...,
) -> Subscription:
...