1+ import sys
12import warnings
2- from typing import Any , Literal , NotRequired , TypedDict
3+
4+ if sys .version_info < (3 , 11 ):
5+ from typing_extensions import Any , Dict , List , Literal , NotRequired , TypedDict
6+ else :
7+ from typing import Any , Dict , List , Literal , NotRequired , TypedDict
38
49from ..exceptions import AnymailRequestsAPIError , AnymailWarning
510from ..message import AnymailMessage , AnymailRecipientStatus
@@ -24,18 +29,18 @@ class MailtrapAttachment(TypedDict):
2429 "MailtrapData" ,
2530 {
2631 "from" : MailtrapAddress ,
27- "to" : NotRequired [list [MailtrapAddress ]],
28- "cc" : NotRequired [list [MailtrapAddress ]],
29- "bcc" : NotRequired [list [MailtrapAddress ]],
30- "attachments" : NotRequired [list [MailtrapAttachment ]],
31- "headers" : NotRequired [dict [str , str ]],
32- "custom_variables" : NotRequired [dict [str , str ]],
32+ "to" : NotRequired [List [MailtrapAddress ]],
33+ "cc" : NotRequired [List [MailtrapAddress ]],
34+ "bcc" : NotRequired [List [MailtrapAddress ]],
35+ "attachments" : NotRequired [List [MailtrapAttachment ]],
36+ "headers" : NotRequired [Dict [str , str ]],
37+ "custom_variables" : NotRequired [Dict [str , str ]],
3338 "subject" : str ,
3439 "text" : str ,
3540 "html" : NotRequired [str ],
3641 "category" : NotRequired [str ],
3742 "template_id" : NotRequired [str ],
38- "template_variables" : NotRequired [dict [str , Any ]],
43+ "template_variables" : NotRequired [Dict [str , Any ]],
3944 },
4045)
4146
0 commit comments