1
- from typing import Iterator , List
1
+ from typing import Iterator , List , Optional
2
2
3
3
from aws_lambda_powertools .utilities .data_classes .common import DictWrapper
4
4
@@ -26,7 +26,7 @@ def get_from(self) -> List[str]:
26
26
return self ["from" ]
27
27
28
28
@property
29
- def date (self ) -> List [ str ] :
29
+ def date (self ) -> str :
30
30
"""The date and time when Amazon SES received the message."""
31
31
return self ["date" ]
32
32
@@ -45,6 +45,26 @@ def subject(self) -> str:
45
45
"""The value of the Subject header for the email."""
46
46
return str (self ["subject" ])
47
47
48
+ @property
49
+ def cc (self ) -> Optional [List [str ]]:
50
+ """The values in the CC header of the email."""
51
+ return self .get ("cc" )
52
+
53
+ @property
54
+ def bcc (self ) -> Optional [List [str ]]:
55
+ """The values in the BCC header of the email."""
56
+ return self .get ("bcc" )
57
+
58
+ @property
59
+ def sender (self ) -> Optional [List [str ]]:
60
+ """The values in the Sender header of the email."""
61
+ return self .get ("sender" )
62
+
63
+ @property
64
+ def reply_to (self ) -> Optional [List [str ]]:
65
+ """The values in the replyTo header of the email."""
66
+ return self .get ("replyTo" )
67
+
48
68
49
69
class SESMail (DictWrapper ):
50
70
@property
@@ -94,6 +114,9 @@ def common_headers(self) -> SESMailCommonHeaders:
94
114
class SESReceiptStatus (DictWrapper ):
95
115
@property
96
116
def status (self ) -> str :
117
+ """Receipt status
118
+ Possible values: 'PASS', 'FAIL', 'GRAY', 'PROCESSING_FAILED', 'DISABLED'
119
+ """
97
120
return str (self ["status" ])
98
121
99
122
@@ -107,6 +130,12 @@ def get_type(self) -> str:
107
130
# Note: this name conflicts with existing python builtins
108
131
return self ["type" ]
109
132
133
+ @property
134
+ def topic_arn (self ) -> Optional [str ]:
135
+ """String that contains the Amazon Resource Name (ARN) of the Amazon SNS topic to which the
136
+ notification was published."""
137
+ return self .get ("topicArn" )
138
+
110
139
@property
111
140
def function_arn (self ) -> str :
112
141
"""String that contains the ARN of the Lambda function that was triggered.
@@ -154,12 +183,24 @@ def spf_verdict(self) -> SESReceiptStatus:
154
183
"""Object that indicates whether the Sender Policy Framework (SPF) check passed."""
155
184
return SESReceiptStatus (self ["spfVerdict" ])
156
185
186
+ @property
187
+ def dkim_verdict (self ) -> SESReceiptStatus :
188
+ """Object that indicates whether the DomainKeys Identified Mail (DKIM) check passed"""
189
+ return SESReceiptStatus (self ["dkimVerdict" ])
190
+
157
191
@property
158
192
def dmarc_verdict (self ) -> SESReceiptStatus :
159
193
"""Object that indicates whether the Domain-based Message Authentication,
160
194
Reporting & Conformance (DMARC) check passed."""
161
195
return SESReceiptStatus (self ["dmarcVerdict" ])
162
196
197
+ @property
198
+ def dmarc_policy (self ) -> Optional [str ]:
199
+ """Indicates the Domain-based Message Authentication, Reporting & Conformance (DMARC) settings for
200
+ the sending domain. This field only appears if the message fails DMARC authentication.
201
+ Possible values for this field are: none, quarantine, reject"""
202
+ return self .get ("dmarcPolicy" )
203
+
163
204
@property
164
205
def action (self ) -> SESReceiptAction :
165
206
"""Object that encapsulates information about the action that was executed."""
0 commit comments