From aeb17d8cb645424c2c57bfa33da1d7b1758c3612 Mon Sep 17 00:00:00 2001 From: Kiran Raju Date: Fri, 18 Jul 2025 15:17:14 -0500 Subject: [PATCH 1/3] Add metadata_pair to both messages and drafts --- nylas/models/drafts.py | 2 ++ nylas/models/messages.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/nylas/models/drafts.py b/nylas/models/drafts.py index 3c8a8c2..aec7596 100644 --- a/nylas/models/drafts.py +++ b/nylas/models/drafts.py @@ -129,6 +129,7 @@ class CreateDraftRequest(TypedDict): "starred": NotRequired[bool], "thread_id": NotRequired[str], "has_attachment": NotRequired[bool], + "metadata_pair": NotRequired[str], }, ) """ @@ -145,6 +146,7 @@ class CreateDraftRequest(TypedDict): unread: Filter messages by unread status. starred: Filter messages by starred status. has_attachment: Filter messages by whether they have an attachment. + metadata_pair: Filter messages by metadata key/value pair. limit (NotRequired[int]): The maximum number of objects to return. This field defaults to 50. The maximum allowed value is 200. page_token (NotRequired[str]): An identifier that specifies which page of data to return. diff --git a/nylas/models/messages.py b/nylas/models/messages.py index 342df89..5287690 100644 --- a/nylas/models/messages.py +++ b/nylas/models/messages.py @@ -128,6 +128,7 @@ class Message: "fields": NotRequired[Fields], "search_query_native": NotRequired[str], "select": NotRequired[str], + "metadata_pair": NotRequired[str] }, ) """ @@ -159,6 +160,7 @@ class Message: This field defaults to 50. The maximum allowed value is 200. page_token (NotRequired[str]): An identifier that specifies which page of data to return. This value should be taken from a ListResponse object's next_cursor parameter. + metadata_pair (NotRequired[int]): Pass a metadata key/value pair (for example, ?metadata_pair=key1:value) to search for metadata associated with objects. See Metadata for more information. """ From f29a7f68ac2258114253a32ff50a0eafa3388d61 Mon Sep 17 00:00:00 2001 From: Kiran Raju Date: Fri, 18 Jul 2025 15:21:39 -0500 Subject: [PATCH 2/3] updated changelog --- CHANGELOG.md | 1 + nylas/models/drafts.py | 2 +- nylas/models/messages.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 348db45..178b0eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Unreleased ---------- * Added `message.deleted` to the Webhook enum, appended tests * Fixed Participant.email not being optional, Microsoft events can now be represented +* Added support for metadata_pair query params to the messages and drafts list endpoints v6.13.1 ---------- diff --git a/nylas/models/drafts.py b/nylas/models/drafts.py index aec7596..78626b9 100644 --- a/nylas/models/drafts.py +++ b/nylas/models/drafts.py @@ -146,7 +146,7 @@ class CreateDraftRequest(TypedDict): unread: Filter messages by unread status. starred: Filter messages by starred status. has_attachment: Filter messages by whether they have an attachment. - metadata_pair: Filter messages by metadata key/value pair. + metadata_pair (NotRequired[str]): Filter messages by metadata key/value pair. limit (NotRequired[int]): The maximum number of objects to return. This field defaults to 50. The maximum allowed value is 200. page_token (NotRequired[str]): An identifier that specifies which page of data to return. diff --git a/nylas/models/messages.py b/nylas/models/messages.py index 5287690..c603bd6 100644 --- a/nylas/models/messages.py +++ b/nylas/models/messages.py @@ -160,7 +160,7 @@ class Message: This field defaults to 50. The maximum allowed value is 200. page_token (NotRequired[str]): An identifier that specifies which page of data to return. This value should be taken from a ListResponse object's next_cursor parameter. - metadata_pair (NotRequired[int]): Pass a metadata key/value pair (for example, ?metadata_pair=key1:value) to search for metadata associated with objects. See Metadata for more information. + metadata_pair (NotRequired[str]): Pass a metadata key/value pair (for example, ?metadata_pair=key1:value) to search for metadata associated with objects. See Metadata for more information. """ From 5a3d97b9727ab60663d1b8d96d4dbe5458ffd6ba Mon Sep 17 00:00:00 2001 From: Aaron de Mello Date: Tue, 9 Dec 2025 14:01:59 -0500 Subject: [PATCH 3/3] Update .pylintrc to disable 'too-many-positional-arguments' warning; format metadata_pair docstring for clarity; remove unnecessary super() call in ListNotetakerQueryParams --- .pylintrc | 1 + nylas/models/messages.py | 3 ++- nylas/models/notetakers.py | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pylintrc b/.pylintrc index f789fc6..cfbff33 100644 --- a/.pylintrc +++ b/.pylintrc @@ -11,6 +11,7 @@ disable= too-many-instance-attributes, unnecessary-pass, too-many-arguments, + too-many-positional-arguments, too-few-public-methods, [TYPECHECK] diff --git a/nylas/models/messages.py b/nylas/models/messages.py index c603bd6..9caf5bf 100644 --- a/nylas/models/messages.py +++ b/nylas/models/messages.py @@ -160,7 +160,8 @@ class Message: This field defaults to 50. The maximum allowed value is 200. page_token (NotRequired[str]): An identifier that specifies which page of data to return. This value should be taken from a ListResponse object's next_cursor parameter. - metadata_pair (NotRequired[str]): Pass a metadata key/value pair (for example, ?metadata_pair=key1:value) to search for metadata associated with objects. See Metadata for more information. + metadata_pair (NotRequired[str]): Pass a metadata key/value pair (for example, ?metadata_pair=key1:value) + to search for metadata associated with objects. See Metadata for more information. """ diff --git a/nylas/models/notetakers.py b/nylas/models/notetakers.py index a889fec..17badf6 100644 --- a/nylas/models/notetakers.py +++ b/nylas/models/notetakers.py @@ -268,7 +268,6 @@ class ListNotetakerQueryParams(ListQueryParams): def __post_init__(self): """Convert enums to string values for API requests.""" - super().__post_init__() # Convert state enum to string if present if hasattr(self, "state") and isinstance(self.state, NotetakerState): self.state = self.state.value