Class: AWS::SNS::Client

Inherits:
Core::Client show all
Extended by:
Core::Client::QueryXML
Defined in:
lib/aws/sns/client.rb

Overview

Client class for Amazon Simple Notifications Service (SNS).

Constant Summary collapse

API_VERSION =
'2010-03-31'
CACHEABLE_REQUESTS =
Set[]

Instance Attribute Summary

Attributes inherited from Core::Client

#config, #endpoint, #port, #service_ruby_name, #signer

Instance Method Summary collapse

Methods included from Core::Client::QueryXML

extended, option_parsers, xml_parsers

Methods inherited from Core::Client

#initialize, #new_stub_for, #operations, #stub_for, #with_config, #with_http_handler, #with_options

Methods included from Core::Naming

#service_name, #service_ruby_name

Constructor Details

This class inherits a constructor from AWS::Core::Client

Instance Method Details

#add_permission(options = {}) ⇒ Core::Response

Calls the AddPermission API operation.

Options:

  • :topic_arn - required - (String) The ARN of the topic whose access control policy you wish to modify.

  • :label - required - (String) A unique identifier for the new policy statement.

  • :aws_account_id - required - (Array<String>) The AWS account IDs of the users (principals) who will be given access to the specified actions. The users must have AWS accounts, but do not need to be signed up for this service.

  • :action_name - required - (Array<String>) The action you want to allow for the specified principal(s). Valid values: any Amazon SNS action name.

Response Structure:

This method returns no response data.

Returns:



52
# File 'lib/aws/sns/client.rb', line 52

define_client_method :add_permission, 'AddPermission'

#confirm_subscription(options = {}) ⇒ Core::Response

Calls the ConfirmSubscription API operation.

Options:

  • :topic_arn - required - (String) The ARN of the topic for which you wish to confirm a subscription.

  • :token - required - (String) Short-lived token sent to an endpoint during the Subscribe action.

  • :authenticate_on_unsubscribe - (String) Disallows unauthenticated unsubscribes of the subscription. If the value of this parameter is true and the request has an AWS signature, then only the topic owner and the subscription owner can unsubscribe the endpoint. The unsubscribe action will require AWS authentication.

Response Structure:

  • :subscription_arn - (String)

Returns:



75
# File 'lib/aws/sns/client.rb', line 75

define_client_method :confirm_subscription, 'ConfirmSubscription'

#create_topic(options = {}) ⇒ Core::Response

Calls the CreateTopic API operation.

Options:

  • :name - required - (String) The name of the topic you want to create. Constraints: Topic names must be made up of only uppercase and lowercase ASCII letters, numbers, and hyphens, and must be between 1 and 256 characters long.

Response Structure:

  • :topic_arn - (String)

Returns:



93
# File 'lib/aws/sns/client.rb', line 93

define_client_method :create_topic, 'CreateTopic'

#delete_topic(options = {}) ⇒ Core::Response

Calls the DeleteTopic API operation.

Options:

  • :topic_arn - required - (String) The ARN of the topic you want to delete. sns.us-east-1.amazonaws.com/ ?TopicArn=arn%3Aaws%3Asns%3Aus-east-1%3A123456789012%3AMy-Topic &Action=DeleteTopic &SignatureVersion=2 &SignatureMethod=HmacSHA256 &Timestamp=2010-03-31T12%3A00%3A00.000Z &AWSAccessKeyId=(AWS Access Key ID) &Signature=DjHBa%2BbYCKQAzctOPnLP7MbHnrHT3%2FK3kFEZjwcf9%2FU%3D <DeleteTopicResponse xmlns=“sns.amazonaws.com/doc/2010-03-31/”> <ResponseMetadata> <RequestId>fba800b9-3765-11df-8cf3-c58c53254dfb</RequestId> </ResponseMetadata> </DeleteTopicResponse>

Response Structure:

This method returns no response data.

Returns:



118
# File 'lib/aws/sns/client.rb', line 118

define_client_method :delete_topic, 'DeleteTopic'

#get_subscription_attributes(options = {}) ⇒ Core::Response

Calls the GetSubscriptionAttributes API operation.

Options:

  • :subscription_arn - required - (String) The ARN of the subscription whose properties you want to get.

Response Structure:

  • :attributes - (Hash<String,String>)

Returns:



134
# File 'lib/aws/sns/client.rb', line 134

define_client_method :get_subscription_attributes, 'GetSubscriptionAttributes'

#get_topic_attributes(options = {}) ⇒ Core::Response

Calls the GetTopicAttributes API operation.

Options:

  • :topic_arn - required - (String) The ARN of the topic whose properties you want to get.

Response Structure:

  • :attributes - (Hash<String,String>)

Returns:



150
# File 'lib/aws/sns/client.rb', line 150

define_client_method :get_topic_attributes, 'GetTopicAttributes'

#list_subscriptions(options = {}) ⇒ Core::Response

Calls the ListSubscriptions API operation.

Options:

  • :next_token - (String) Token returned by the previous ListSubscriptions request.

Response Structure:

  • :subscriptions - (Array<Hash>)

    • :subscription_arn - (String)

    • :owner - (String)

    • :protocol - (String)

    • :endpoint - (String)

    • :topic_arn - (String)

  • :next_token - (String)

Returns:



172
# File 'lib/aws/sns/client.rb', line 172

define_client_method :list_subscriptions, 'ListSubscriptions'

#list_subscriptions_by_topic(options = {}) ⇒ Core::Response

Calls the ListSubscriptionsByTopic API operation.

Options:

  • :topic_arn - required - (String) The ARN of the topic for which you wish to find subscriptions.

  • :next_token - (String) Token returned by the previous ListSubscriptionsByTopic request.

Response Structure:

  • :subscriptions - (Array<Hash>)

    • :subscription_arn - (String)

    • :owner - (String)

    • :protocol - (String)

    • :endpoint - (String)

    • :topic_arn - (String)

  • :next_token - (String)

Returns:



196
# File 'lib/aws/sns/client.rb', line 196

define_client_method :list_subscriptions_by_topic, 'ListSubscriptionsByTopic'

#list_topics(options = {}) ⇒ Core::Response

Calls the ListTopics API operation.

Options:

  • :next_token - (String) Token returned by the previous ListTopics request.

Response Structure:

  • :topics - (Array<Hash>)

    • :topic_arn - (String)

  • :next_token - (String)

Returns:



214
# File 'lib/aws/sns/client.rb', line 214

define_client_method :list_topics, 'ListTopics'

#publish(options = {}) ⇒ Core::Response

Calls the Publish API operation.

Options:

  • :topic_arn - required - (String) The topic you want to publish to.

  • :message - required - (String) The message you want to send to the topic. Constraints: Messages must be UTF-8 encoded strings at most 8 KB in size (8192 bytes, not 8192 characters).

  • :subject - (String) Optional parameter to be used as the “Subject” line of when the message is delivered to e-mail endpoints. This field will also be included, if present, in the standard JSON messages delivered to other endpoints. Constraints: Subjects must be ASCII text that begins with a letter, number or punctuation mark; must not include line breaks or control characters; and must be less than 100 characters long.

  • :message_structure - (String) Optional parameter. It will have one valid value: “json”. If this option, Message is present and set to “json”, the value of Message must: be a syntactically valid JSON object. It must contain at least a top level JSON key of “default” with a value that is a string. For any other top level key that matches one of our transport protocols (e.g. “http”), then the corresponding value (if it is a string) will be used for the message published for that protocol Constraints: Keys in the JSON object that correspond to supported transport protocols must have simple JSON string values. The values will be parsed (unescaped) before they are used in outgoing messages. Typically, outbound notifications are JSON encoded (meaning, the characters will be reescaped for sending). JSON strings are UTF-8. Values have a minimum length of 0 (the empty string, “”, is allowed). Values have a maximum length bounded by the overall message size (so, including multiple protocols may limit message sizes). Non-string values will cause the key to be ignored. Keys that do not correspond to supported transport protocols will be ignored. Duplicate keys are not allowed. Failure to parse or validate any key or value in the message will cause the Publish call to return an error (no partial delivery).

Response Structure:

  • :message_id - (String)

Returns:



260
# File 'lib/aws/sns/client.rb', line 260

define_client_method :publish, 'Publish'

#remove_permission(options = {}) ⇒ Core::Response

Calls the RemovePermission API operation.

Options:

  • :topic_arn - required - (String) The ARN of the topic whose access control policy you wish to modify.

  • :label - required - (String) The unique label of the statement you want to remove.

Response Structure:

This method returns no response data.

Returns:



278
# File 'lib/aws/sns/client.rb', line 278

define_client_method :remove_permission, 'RemovePermission'

#set_subscription_attributes(options = {}) ⇒ Core::Response

Calls the SetSubscriptionAttributes API operation.

Options:

  • :subscription_arn - required - (String) The ARN of the subscription to modify.

  • :attribute_name - required - (String) The name of the attribute you want to set. Only a subset of the subscriptions attributes are mutable. Valid values: DeliveryPolicy

  • :attribute_value - required - (String) The new value for the attribute.

Response Structure:

This method returns no response data.

Returns:



299
# File 'lib/aws/sns/client.rb', line 299

define_client_method :set_subscription_attributes, 'SetSubscriptionAttributes'

#set_topic_attributes(options = {}) ⇒ Core::Response

Calls the SetTopicAttributes API operation.

Options:

  • :topic_arn - required - (String) The ARN of the topic to modify.

  • :attribute_name - required - (String) The name of the attribute you want to set. Only a subset of the topic’s attributes are mutable. Valid values: Policy | DisplayName

  • :attribute_value - required - (String) The new value for the attribute.

Response Structure:

This method returns no response data.

Returns:



319
# File 'lib/aws/sns/client.rb', line 319

define_client_method :set_topic_attributes, 'SetTopicAttributes'

#subscribe(options = {}) ⇒ Core::Response

Calls the Subscribe API operation.

Options:

  • :topic_arn - required - (String) The ARN of topic you want to subscribe to.

  • :protocol - required - (String) The protocol you want to use. Supported protocols include: http – delivery of JSON-encoded message via HTTP POST https – delivery of JSON-encoded message via HTTPS POST email – delivery of message via SMTP email-json – delivery of JSON-encoded message via SMTP sms – delivery of message via SMS sqs – delivery of JSON-encoded message to an Amazon SQS queue

  • :endpoint - required - (String) The endpoint that you want to receive notifications. Endpoints vary by protocol: For the http protocol, the endpoint is an URL beginning with “http://” For the https protocol, the endpoint is a URL beginning with “https://” For the email protocol, the endpoint is an e-mail address For the email-json protocol, the endpoint is an e-mail address For the sms protocol, the endpoint is a phone number of an SMS-enabled device For the sqs protocol, the endpoint is the ARN of an Amazon SQS queue

Response Structure:

  • :subscription_arn - (String)

Returns:



349
# File 'lib/aws/sns/client.rb', line 349

define_client_method :subscribe, 'Subscribe'

#unsubscribe(options = {}) ⇒ Core::Response

Calls the Unsubscribe API operation.

Options:

  • :subscription_arn - required - (String) The ARN of the subscription to be deleted.

Response Structure:

This method returns no response data.

Returns:



365
# File 'lib/aws/sns/client.rb', line 365

define_client_method :unsubscribe, 'Unsubscribe'