pub struct SnsMessage {
    pub sns_message_type: String,
    pub message_id: String,
    pub topic_arn: String,
    pub subject: Option<String>,
    pub timestamp: DateTime<Utc>,
    pub signature_version: String,
    pub signature: String,
    pub signing_cert_url: String,
    pub unsubscribe_url: String,
    pub message: String,
    pub message_attributes: HashMap<String, MessageAttribute>,
}
Expand description

SnsMessage stores information about each record of a SNS event

Fields

sns_message_type: String

The type of SNS message. For a lambda event, this should always be Notification

message_id: String

A Universally Unique Identifier, unique for each message published. For a notification that Amazon SNS resends during a retry, the message ID of the original message is used.

topic_arn: String

The Amazon Resource Name (ARN) for the topic that this message was published to.

subject: Option<String>

The Subject parameter specified when the notification was published to the topic.

The SNS Developer Guide states: This is an optional parameter. If no Subject was specified, then this name-value pair does not appear in this JSON document.

Preliminary tests show this appears in the lambda event JSON as Subject: null, marking as Option with need to test additional scenarios

timestamp: DateTime<Utc>

The time (UTC) when the notification was published.

signature_version: String

Version of the Amazon SNS signature used.

signature: String

Base64-encoded SHA1withRSA signature of the Message, MessageId, Subject (if present), Type, Timestamp, and TopicArn values.

signing_cert_url: String

The URL to the certificate that was used to sign the message.

unsubscribe_url: String

A URL that you can use to unsubscribe the endpoint from this topic. If you visit this URL, Amazon SNS unsubscribes the endpoint and stops sending notifications to this endpoint.

message: String

The Message value specified when the notification was published to the topic.

message_attributes: HashMap<String, MessageAttribute>

This is a HashMap of defined attributes for a message. Additional details can be found in the SNS Developer Guide

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.