Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing schedule-specific fields to Message model #385

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading