class AWS::SQS::ReceivedSNSMessage
Represents message published from an {SNS::Topic} to an {SQS::Queue}.
def body
def body to_h[:body] end
def initialize body, options = {}
-
options
(Hash
) -- -
body
(String
) -- The SQS message body
def initialize body, options = {} @body = body super end
def message_id
-
(String)
- Returns the unique id of the SNS message.
def message_id to_h[:message_id] end
def message_type
-
(String)
- Returns the message type.
def message_type to_h[:message_type] end
def published_at
-
(Time)
- Returns the time the message was published at by SNS.
def published_at to_h[:published_at] end
def raw_message
-
(String)
- Returns the JSON hash (as a string) as was
def raw_message @body end
def signature
-
(String)
- Returns the calculated signature for the message.
def signature to_h[:signature] end
def signature_version
-
(String)
- Returns the signature version.
def signature_version to_h[:signature_version] end
def signing_cert_url
-
(String)
- Returns the url for the signing cert.
def signing_cert_url to_h[:signing_cert_url] end
def to_h
-
(Hash)
- Returns the decoded message as a hash.
def to_h data = JSON.parse(@body) { :body => data['Message'], :topic_arn => data['TopicArn'], :message_type => data['Type'], :signature => data['Signature'], :signature_version => data['SignatureVersion'], :published_at => Time.parse(data['Timestamp']), :message_id => data['MessageId'], :signing_cert_url => data['SigningCertURL'], :unsubscribe_url => data['UnsubscribeURL'], } end
def topic
-
(SNS::Topic)
- Returns the topic that published this message.
def topic SNS::Topic.new(topic_arn, :config => config) end
def topic_arn
-
(String)
- Returns the ARN for the topic that published this
def topic_arn to_h[:topic_arn] end
def unsubscribe_url
-
(String)
- Returns the url you can request to unsubscribe message
def unsubscribe_url to_h[:unsubscribe_url] end