11from abc import ABCMeta
2+ from collections .abc import Sequence
23from typing import Any
3- from typing import Dict
4- from typing import List
54from typing import Optional
6- from typing import Sequence
75
86from mailtrap .mail .address import Address
97from mailtrap .mail .attachment import Attachment
@@ -16,12 +14,12 @@ class BaseMail(BaseEntity, metaclass=ABCMeta):
1614 def __init__ (
1715 self ,
1816 sender : Address ,
19- to : List [Address ],
20- cc : Optional [List [Address ]] = None ,
21- bcc : Optional [List [Address ]] = None ,
22- attachments : Optional [List [Attachment ]] = None ,
23- headers : Optional [Dict [str , str ]] = None ,
24- custom_variables : Optional [Dict [str , Any ]] = None ,
17+ to : list [Address ],
18+ cc : Optional [list [Address ]] = None ,
19+ bcc : Optional [list [Address ]] = None ,
20+ attachments : Optional [list [Attachment ]] = None ,
21+ headers : Optional [dict [str , str ]] = None ,
22+ custom_variables : Optional [dict [str , Any ]] = None ,
2523 ) -> None :
2624 self .sender = sender
2725 self .to = to
@@ -32,7 +30,7 @@ def __init__(
3230 self .custom_variables = custom_variables
3331
3432 @property
35- def api_data (self ) -> Dict [str , Any ]:
33+ def api_data (self ) -> dict [str , Any ]:
3634 return self .omit_none_values (
3735 {
3836 "from" : self .sender .api_data ,
@@ -48,7 +46,7 @@ def api_data(self) -> Dict[str, Any]:
4846 @staticmethod
4947 def get_api_data_from_list (
5048 items : Optional [Sequence [BaseEntity ]],
51- ) -> Optional [List [ Dict [str , Any ]]]:
49+ ) -> Optional [list [ dict [str , Any ]]]:
5250 if items is None :
5351 return None
5452
0 commit comments