diff --git a/resend/emails/_email.py b/resend/emails/_email.py index 04d517a..147d5a9 100644 --- a/resend/emails/_email.py +++ b/resend/emails/_email.py @@ -1,6 +1,8 @@ -from typing import List, Union +from typing import List, Optional, Union -from typing_extensions import TypedDict +from typing_extensions import NotRequired, TypedDict + +from resend.emails._tag import Tag # Uses functional typed dict syntax here in order to support "from" reserved keyword _FromParam = TypedDict( @@ -56,6 +58,18 @@ class _EmailDefaultAttrs(_FromParam): """ The last event of the email. """ + object: NotRequired[str] + """ + The object type: email. Not present on items returned by list. + """ + scheduled_at: NotRequired[Optional[str]] + """ + When the email is scheduled to be sent, or None if it is not scheduled. + """ + tags: NotRequired[List[Tag]] + """ + The tags attached to the email. Not present on items returned by list. + """ class Email(_EmailDefaultAttrs): @@ -75,4 +89,7 @@ class Email(_EmailDefaultAttrs): cc (Union[List[str], str]): Cc reply_to (Union[List[str], str]): Reply to last_event (str): The last event of the email. + object (NotRequired[str]): The object type: email. + scheduled_at (NotRequired[Optional[str]]): When the email is scheduled to be sent. + tags (NotRequired[List[Tag]]): The tags attached to the email. """ diff --git a/tests/emails_test.py b/tests/emails_test.py index 39e6594..1068efa 100644 --- a/tests/emails_test.py +++ b/tests/emails_test.py @@ -53,6 +53,8 @@ def test_email_get(self) -> None: "cc": [None], "reply_to": [None], "last_event": "delivered", + "scheduled_at": None, + "tags": [{"name": "category", "value": "confirm_email"}], } ) @@ -61,6 +63,9 @@ def test_email_get(self) -> None: ) assert email["id"] == "4ef9a417-02e9-4d39-ad75-9611e0fcc33c" assert email["message_id"] == "<111-222-333@email.example.com>" + assert email["object"] == "email" + assert email["scheduled_at"] is None + assert email["tags"] == [{"name": "category", "value": "confirm_email"}] def test_should_get_email_raise_exception_when_no_content(self) -> None: self.set_mock_json(None)