You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::SNS::Subscription

Inherits:
Resources::Resource show all
Defined in:
(unknown)

Instance Attribute Summary collapse

Attributes inherited from Resources::Resource

#client, #identifiers

Instance Method Summary collapse

Methods inherited from Resources::Resource

add_data_attribute, add_identifier, #data, data_attributes, #data_loaded?, identifiers, #load, #wait_until

Methods included from Resources::OperationMethods

#add_batch_operation, #add_operation, #batch_operation, #batch_operation_names, #batch_operations, #operation, #operation_names, #operations

Constructor Details

#initialize(arn, options = {}) ⇒ Object #initialize(options = {}) ⇒ Object

Overloads:

  • #initialize(arn, options = {}) ⇒ Object

    Parameters:

    • arn (String)

    Options Hash (options):

    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

  • #initialize(options = {}) ⇒ Object

    Options Hash (options):

    • :arn (required, String)
    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

Instance Attribute Details

#arnString (readonly)

Returns:

  • (String)

#attributesHash<String,String> (readonly)

A map of the subscription\'s attributes. Attributes in this map include the following:

  • ConfirmationWasAuthenticatedtrue if the subscription confirmation request was authenticated.

  • DeliveryPolicy – The JSON serialization of the subscription\'s delivery policy.

  • EffectiveDeliveryPolicy – The JSON serialization of the effective delivery policy that takes into account the topic delivery policy and account system defaults.

  • FilterPolicy – The filter policy JSON that is assigned to the subscription.

  • Owner – The AWS account ID of the subscription\'s owner.

  • PendingConfirmationtrue if the subscription hasn\'t been confirmed. To confirm a pending subscription, call the ConfirmSubscription action with a confirmation token.

  • RawMessageDeliverytrue if raw message delivery is enabled for the subscription. Raw messages are free of JSON formatting and can be sent to HTTP/S and Amazon SQS endpoints.

  • SubscriptionArn – The subscription\'s ARN.

  • TopicArn – The topic ARN that the subscription is associated with.

Returns:

  • (Hash<String,String>)

    A map of the subscription\'s attributes.

Instance Method Details

#deleteStruct

Deletes a subscription. If the subscription requires authentication for deletion, only the owner of the subscription or the topic's owner can unsubscribe, and an AWS signature is required. If the Unsubscribe call does not require authentication and the requester is not the subscription owner, a final cancellation message is delivered to the endpoint, so that the endpoint owner can easily resubscribe to the topic if the Unsubscribe request was unintended.

This action is throttled at 100 transactions per second (TPS).

Examples:

Request syntax example with placeholder values


subscription.delete()

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#set_attributes(options = {}) ⇒ Struct

Allows a subscription owner to set an attribute of the subscription to a new value.

Examples:

Request syntax example with placeholder values


subscription.set_attributes({
  attribute_name: "attributeName", # required
  attribute_value: "attributeValue",
})

Options Hash (options):

  • :attribute_name (required, String)

    A map of attributes with their corresponding values.

    The following lists the names, descriptions, and values of the special request parameters that the SetTopicAttributes action uses:

    • DeliveryPolicy – The policy that defines how Amazon SNS retries failed deliveries to HTTP/S endpoints.

    • FilterPolicy – The simple JSON object that lets your subscriber receive only a subset of messages, rather than receiving every message published to the topic.

    • RawMessageDelivery – When set to true, enables raw message delivery to Amazon SQS or HTTP/S endpoints. This eliminates the need for the endpoints to process JSON formatting, which is otherwise created for Amazon SNS metadata.

  • :attribute_value (String)

    The new value for the attribute in JSON format.

Returns:

  • (Struct)

    Returns an empty response.

See Also: