44
55from resend import request
66
7- from ._email import Email
87from ._emails import Emails
98
109
11- class _SendOptions (TypedDict ):
12- idempotency_key : NotRequired [ str ]
10+ class SendEmailResponse (TypedDict ):
11+ id : str
1312 """
14- Unique key that ensures the same operation is not processed multiple times.
15- Allows for safe retries without duplicating operations.
16- If provided, will be sent as the `Idempotency-Key` header.
17- """
18-
19-
20- class _SendResponse (TypedDict ):
21- data : List [Email ]
22- """
23- A list of email objects
13+ The sent Email ID.
2414 """
2515
2616
2717class Batch :
2818
29- class SendOptions (_SendOptions ):
19+ class SendOptions (TypedDict ):
3020 """
3121 SendOptions is the class that wraps the options for the batch send method.
3222
@@ -36,12 +26,17 @@ class SendOptions(_SendOptions):
3626 If provided, will be sent as the `Idempotency-Key` header.
3727 """
3828
39- class SendResponse (_SendResponse ):
29+ idempotency_key : NotRequired [str ]
30+ """
31+ Unique key that ensures the same operation is not processed multiple times.
32+ Allows for safe retries without duplicating operations.
33+ If provided, will be sent as the `Idempotency-Key` header.
4034 """
41- SendResponse type that wraps a list of email objects
4235
43- Attributes:
44- data (List[Email]): A list of email objects
36+ class SendResponse (TypedDict ):
37+ data : List [SendEmailResponse ]
38+ """
39+ A list of email objects
4540 """
4641
4742 @classmethod
@@ -61,7 +56,7 @@ def send(
6156 """
6257 path = "/emails/batch"
6358
64- resp = request .Request [_SendResponse ](
59+ resp = request .Request [Batch . SendResponse ](
6560 path = path ,
6661 params = cast (List [Dict [Any , Any ]], params ),
6762 verb = "post" ,
0 commit comments