Skip to content

Commit e2359da

Browse files
kraju3Kiran RajuAaronDDM
authored
feat(drafts, messages): Add metadata_pair to both messages and drafts (#430)
Co-authored-by: Kiran Raju <[email protected]> Co-authored-by: Aaron de Mello <[email protected]>
1 parent a57282f commit e2359da

File tree

5 files changed

+7
-1
lines changed

5 files changed

+7
-1
lines changed

.pylintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ disable=
1111
too-many-instance-attributes,
1212
unnecessary-pass,
1313
too-many-arguments,
14+
too-many-positional-arguments,
1415
too-few-public-methods,
1516

1617
[TYPECHECK]

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Unreleased
55
----------
66
* Added `message.deleted` to the Webhook enum, appended tests
77
* Fixed Participant.email not being optional, Microsoft events can now be represented
8+
* Added support for metadata_pair query params to the messages and drafts list endpoints
89

910
v6.13.1
1011
----------

nylas/models/drafts.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ class CreateDraftRequest(TypedDict):
129129
"starred": NotRequired[bool],
130130
"thread_id": NotRequired[str],
131131
"has_attachment": NotRequired[bool],
132+
"metadata_pair": NotRequired[str],
132133
},
133134
)
134135
"""
@@ -145,6 +146,7 @@ class CreateDraftRequest(TypedDict):
145146
unread: Filter messages by unread status.
146147
starred: Filter messages by starred status.
147148
has_attachment: Filter messages by whether they have an attachment.
149+
metadata_pair (NotRequired[str]): Filter messages by metadata key/value pair.
148150
limit (NotRequired[int]): The maximum number of objects to return.
149151
This field defaults to 50. The maximum allowed value is 200.
150152
page_token (NotRequired[str]): An identifier that specifies which page of data to return.

nylas/models/messages.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ class Message:
128128
"fields": NotRequired[Fields],
129129
"search_query_native": NotRequired[str],
130130
"select": NotRequired[str],
131+
"metadata_pair": NotRequired[str]
131132
},
132133
)
133134
"""
@@ -159,6 +160,8 @@ class Message:
159160
This field defaults to 50. The maximum allowed value is 200.
160161
page_token (NotRequired[str]): An identifier that specifies which page of data to return.
161162
This value should be taken from a ListResponse object's next_cursor parameter.
163+
metadata_pair (NotRequired[str]): Pass a metadata key/value pair (for example, ?metadata_pair=key1:value)
164+
to search for metadata associated with objects. See Metadata for more information.
162165
"""
163166

164167

nylas/models/notetakers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ class ListNotetakerQueryParams(ListQueryParams):
268268

269269
def __post_init__(self):
270270
"""Convert enums to string values for API requests."""
271-
super().__post_init__()
272271
# Convert state enum to string if present
273272
if hasattr(self, "state") and isinstance(self.state, NotetakerState):
274273
self.state = self.state.value

0 commit comments

Comments
 (0)