Skip to content

Commit

Permalink
Merge branch 'main' into CUST-3118-v-3-cant-find-a-way-to-override-or…
Browse files Browse the repository at this point in the history
…-set-the-from-field-when-using-the-new-python-sdk-v-3
  • Loading branch information
mrashed-dev authored Sep 24, 2024
2 parents 4331257 + 7757cc6 commit 0c22070
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Unreleased
----------------
* Add support for from field for sending messages
* Fix IMAP identifiers not encoding correctly
* Add missing schedule-specific fields to Message model

v6.3.1
----------------
Expand Down
2 changes: 2 additions & 0 deletions nylas/models/grants.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Grant:
Attributes:
id: Globally unique object identifier.
provider: OAuth provider that the user authenticated with.
account_id: Globally unique identifier for your v2 account that has been migrated using our migration APIs.
scope: Scopes specified for the grant.
created_at: Unix timestamp when the grant was created.
grant_status: Status of the grant, if it is still valid or if the user needs to re-authenticate.
Expand All @@ -31,6 +32,7 @@ class Grant:
id: str
provider: str
scope: List[str] = field(default_factory=list)
account_id: Optional[str] = None
grant_status: Optional[str] = None
email: Optional[str] = None
user_agent: Optional[str] = None
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 0c22070

Please sign in to comment.