class AWS::SNS::Subscription

{Topic#confirm_subscription}.
Depending on the endpoint type, you may also need to use
To create a subscription, use the {Topic#subscribe} method.
Represents a subscription of a single endpoint to an SNS topic.

def confirmation_authenticated?

Returns:
  • (Boolean) - Returns true if the subscription confirmation
def confirmation_authenticated?
  return true if @authenticated
  if authenticated = get_attributes['ConfirmationWasAuthenticated']
    @authenticated = true
  else
    false
  end
end

def delivery_policy_json

Returns:
  • (nil, String) - Returns the delivery policy JSON string.
def delivery_policy_json
  get_attributes['DeliveryPolicy']
end

def effective_delivery_policy_json

Returns:
  • (nil, String) - Returns the effective delivery policy JSON string.
def effective_delivery_policy_json
  get_attributes['EffectiveDeliveryPolicy']
end

def eql? other

Returns:
  • (Boolean) - Returns true if the subscriptions have the same
def eql? other
  other.kind_of?(Subscription) and other.arn == arn
end

def exists?

Returns:
  • (Boolean) - Returns true if the subscription exists.

Other tags:
    Note: - This method requests the entire list of subscriptions
def exists?
  begin
    get_attributes
    true
  rescue Errors::NotFound, Errors::InvalidParameter
    false
  end
end

def get_attributes

def get_attributes
  client.get_subscription_attributes(:subscription_arn => arn).attributes
end

def initialize(arn, opts = {})

Other tags:
    Private: -
def initialize(arn, opts = {})
  @arn = arn
  @topic_arn = opts[:topic_arn]
  @endpoint = opts[:endpoint]
  @protocol = opts[:protocol]
  @owner_id = opts[:owner_id]
  super
end

def inspect

Other tags:
    Private: -
def inspect
  "<#{self.class} arn:#{arn}>"
end

def owner_id

Returns:
  • (String) - The AWS account ID of the subscription owner.
def owner_id
  @owner_id ||= get_attributes['Owner']
end

def topic

Returns:
  • (Topic) -
def topic
  Topic.new(topic_arn, :config => config)  
end

def topic_arn

Returns:
  • (String) -
def topic_arn
  @topic_arn ||= get_attributes['TopicArn']
end

def unsubscribe

Returns:
  • (nil) -
def unsubscribe
  client.unsubscribe(:subscription_arn => arn)
  nil
end

def update_delivery_policy policy_json

def update_delivery_policy policy_json
  client_opts = {}
  client_opts[:subscription_arn] = arn
  client_opts[:attribute_name] = 'DeliveryPolicy'
  client_opts[:attribute_value] = policy_json
  client.set_subscription_attributes(client_opts)
end