using Amazon.Lambda.SimpleEmailEvents.Actions;
using System;
using System.Collections.Generic;
namespace Amazon.Lambda.SimpleEmailEvents
{
///
/// Simple Email Service event
/// http://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-ses-email-receiving
///
public class SimpleEmailEvent where TReceiptAction : IReceiptAction
{
///
/// List of SES records.
///
public IList> Records { get; set; }
///
/// An SES record.
///
public class SimpleEmailRecord where TReceiptAction : IReceiptAction
{
///
/// The event version.
///
public string EventVersion { get; set; }
///
/// The event source.
///
public string EventSource { get; set; }
///
/// The SES message.
///
public SimpleEmailService Ses { get; set; }
}
///
/// An SES record.
///
[Obsolete(
"Please move to using SimpleEmailRecord for greater flexibility over which type of action this record refers to. For a like for like replacement on lambda actions, please use SimpleEmailRecord"
)]
public class SimpleEmailRecord : SimpleEmailRecord
{ }
///
/// An SES message record.
///
public class SimpleEmailService where TReceiptAction : IReceiptAction
{
///
/// The mail data for the SES message.
///
public SimpleEmailMessage Mail { get; set; }
///
/// The receipt data for the SES message.
///
public SimpleEmailReceipt Receipt { get; set; }
}
///
/// The mail data for the SES message.
///
public class SimpleEmailMessage
{
///
/// A few of the most important headers from the message.
///
public SimpleEmailCommonHeaders CommonHeaders { get; set; }
///
/// The source email address of the message, i.e. SMTP FROM.
///
public string Source { get; set; }
///
/// The timestamp of the message.
///
public DateTime Timestamp { get; set; }
///
/// The destination recipients of the message.
///
public IList Destination { get; set; }
///
/// The headers associated with the message.
///
public IList Headers { get; set; }
///
/// Whether or not the Headers property is truncated.
///
public bool HeadersTruncated { get; set; }
///
/// The SES Message ID, which will also be the filename of the S3 object containing the message. Not to be confused with the incoming message's Message-ID header.
///
public string MessageId { get; set; }
}
///
/// The receipt data for the SES message.
///
/// The type of action being received in this receipt
public class SimpleEmailReceipt where TReceiptAction : IReceiptAction
{
///
/// The recipients of the message.
///
public IList Recipients { get; set; }
///
/// The timestamp of the message.
///
public DateTime Timestamp { get; set; }
///
/// The spam verdict of the message, e.g. status: PASS.
///
public SimpleEmailVerdict SpamVerdict { get; set; }
///
/// The DKIM verdict of the message, e.g. status: PASS.
///
public SimpleEmailVerdict DKIMVerdict { get; set; }
///
/// The SPF verdict of the message, e.g. status: PASS.
///
public SimpleEmailVerdict SPFVerdict { get; set; }
///
/// The virus verdict of the message, e.g. status: PASS.
///
public SimpleEmailVerdict VirusVerdict { get; set; }
///
/// The DMARC verdict of the message, e.g. status: PASS.
///
public SimpleEmailVerdict DMARCVerdict { get; set; }
///
/// The action of the message (i.e, which lambda was invoked, where it was stored in S3, etc)
///
public TReceiptAction Action { get; set; }
///
/// How long this incoming message took to process.
///
public long ProcessingTimeMillis { get; set; }
}
///
/// An SES message header.
///
public class SimpleEmailHeader
{
///
/// The header name.
///
public string Name { get; set; }
///
/// The header value.
///
public string Value { get; set; }
}
}
///
/// A few of the most important headers of the message.
///
public class SimpleEmailCommonHeaders
{
///
/// The From header's address(es)
///
public IList From { get; set; }
///
/// The To header's address(es)
///
public IList To { get; set; }
///
/// The Return-Path header.
///
public string ReturnPath { get; set; }
///
/// The incoming message's Message-ID header. Not to be confused with the SES messageId.
///
public string MessageId { get; set; }
///
/// The Date header.
///
public string Date { get; set; }
///
/// The Subject header.
///
public string Subject { get; set; }
}
///
/// Verdict to return status of Spam, DKIM, SPF, Virus, and DMARC.
///
public class SimpleEmailVerdict
{
///
/// The verdict status, e.g. PASS or FAIL.
///
public string Status { get; set; }
}
///
/// Simple Email Service event
/// http://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-ses-email-receiving
///
[Obsolete(
"Please move to using SimpleEmailEvent, which allows greater flexibility over which type of event is being handled. For a like for like replacement if using a lambda event, use SimpleEmailEvent"
)]
public class SimpleEmailEvent : SimpleEmailEvent
{ }
}