Skip to content

Commit

Permalink
Add missing schedule-specific fields to Message model (#385)
Browse files Browse the repository at this point in the history
This PR adds in two fields, schedule_id and send_at, to the Message model. These fields are returned by the API if the message being sent is scheduled.
  • Loading branch information
mrashed-dev authored Sep 20, 2024
1 parent 9c8cead commit a53c164
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ nylas-python Changelog
Unreleased
----------------
* Fix IMAP identifiers not encoding correctly
* Add missing schedule-specific fields to Message model

v6.3.1
----------------
Expand Down
8 changes: 7 additions & 1 deletion nylas/models/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,14 @@ class Message:
folders: The folders that the message is in.
headers: The headers of the message.
created_at: Unix timestamp of when the message was created.
schedule_id: The ID of the scheduled email message. Nylas returns the schedule_id if send_at is set.
send_at: Unix timestamp of when the message will be sent, if scheduled.
"""

grant_id: str
from_: Optional[List[EmailName]] = field(default=None,metadata=config(field_name="from"))
from_: Optional[List[EmailName]] = field(
default=None, metadata=config(field_name="from")
)
object: str = "message"
id: Optional[str] = None
body: Optional[str] = None
Expand All @@ -74,6 +78,8 @@ class Message:
starred: Optional[bool] = None
created_at: Optional[int] = None
date: Optional[int] = None
schedule_id: Optional[str] = None
send_at: Optional[int] = None


# Need to use Functional typed dicts because "from" and "in" are Python
Expand Down

0 comments on commit a53c164

Please sign in to comment.