-
Notifications
You must be signed in to change notification settings - Fork 0
/
sns_ses.go
130 lines (116 loc) · 4.05 KB
/
sns_ses.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
package sns_ses
import "time"
type NotificationType string
const (
NotificationTypeBounce NotificationType = "Bounce"
NotificationTypeComplaint NotificationType = "Complaint"
NotificationTypeDelivery NotificationType = "Delivery"
NotificationTypeReceived NotificationType = "Received"
)
type BounceType string
const (
BounceTypeUndetermined BounceType = "Undetermined"
BounceTypePermanent BounceType = "Permanent"
BounceTypeTransient BounceType = "Transient"
)
type BounceSubType string
const (
BounceSubTypeUndetermined BounceSubType = "Undetermined"
BounceSubTypeGeneral BounceSubType = "General"
BounceSubTypeNoEmail BounceSubType = "NoEmail"
)
type Body struct {
Type string `json:"type"`
Subject string `json:"subject"`
MessageId string `json:"messageId"`
Message string `json:"message"`
PublishTime int64 `json:"publishTime"`
}
type Message struct {
NotificationType NotificationType `json:"notificationType"`
Mail Mail `json:"mail"`
Bounce *Bounce `json:"bounce"`
Complaint *Complaint `json:"complaint"`
Delivery *Delivery `json:"delivery"`
Receipt *Receipt `json:"receipt"`
}
type Receipt struct {
Timestamp time.Time `json:"timestamp"`
ProcessingTimeMillis int `json:"processingTimeMillis"`
Recipients []string `json:"recipients"`
SpamVerdict struct {
Status string `json:"status"`
} `json:"spamVerdict"`
VirusVerdict struct {
Status string `json:"status"`
} `json:"virusVerdict"`
SpfVerdict struct {
Status string `json:"status"`
} `json:"spfVerdict"`
DkimVerdict struct {
Status string `json:"status"`
} `json:"dkimVerdict"`
DmarcVerdict struct {
Status string `json:"status"`
} `json:"dmarcVerdict"`
Action struct {
Type string `json:"type"`
TopicArn string `json:"topicArn"`
BucketName string `json:"bucketName"`
ObjectKeyPrefix string `json:"objectKeyPrefix"`
ObjectKey string `json:"objectKey"`
} `json:"action"`
}
type Mail struct {
Timestamp string `json:"timestamp"`
MessageId string `json:"messageId"`
Source string `json:"source"`
SourceArn string `json:"sourceArn"`
SourceIp string `json:"sourceIp"`
SendingAccountId string `json:"sendingAccountId"`
Destination []string `json:"destination"`
HeadersTruncated bool `json:"headersTruncated"`
Headers []struct {
Name string `json:"name"`
Value string `json:"value"`
} `json:"headers"`
CommonHeaders struct {
From []string `json:"from"`
Date string `json:"date"`
To []string `json:"to"`
MessageId string `json:"messageId"`
Subject string `json:"subject"`
} `json:"commonHeaders"`
}
type Bounce struct {
BounceType BounceType `json:"bounceType"`
BounceSubType BounceSubType `json:"bounceSubType"`
BouncedRecipients []struct {
Status string `json:"status"`
Action string `json:"action"`
DiagnosticCode string `json:"diagnosticCode,omitempty"`
EmailAddress string `json:"emailAddress"`
} `json:"bouncedRecipients"`
ReportingMTA string `json:"reportingMTA"`
Timestamp time.Time `json:"timestamp"`
FeedbackId string `json:"feedbackId"`
RemoteMtaIp string `json:"remoteMtaIp"`
}
type Complaint struct {
UserAgent string `json:"userAgent"`
ComplainedRecipients []struct {
EmailAddress string `json:"emailAddress"`
} `json:"complainedRecipients"`
ComplaintFeedbackType string `json:"complaintFeedbackType"`
ArrivalDate time.Time `json:"arrivalDate"`
Timestamp time.Time `json:"timestamp"`
FeedbackId string `json:"feedbackId"`
}
type Delivery struct {
Timestamp time.Time `json:"timestamp"`
ProcessingTimeMillis int `json:"processingTimeMillis"`
Recipients []string `json:"recipients"`
SmtpResponse string `json:"smtpResponse"`
ReportingMTA string `json:"reportingMTA"`
RemoteMtaIp string `json:"remoteMtaIp"`
}