Skip to content

Add metadata_pair to both messages and drafts #430

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kraju3
Copy link
Contributor

@kraju3 kraju3 commented Jul 18, 2025

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@AaronDDM
Copy link
Contributor

Hey can we get a changelog added, and tests if necessary?

Thanks!

Copy link

playerzero-ai bot commented Jul 18, 2025

Pull Request Summary

  • Messages Functionality:

    • Introduced metadata_pair support in ListMessagesQueryParams and FindMessageQueryParams.
    • This enhancement allows users to search and filter messages using metadata key/value pairs.
    • Documentation has been updated to guide developers on utilizing this new feature.
  • Drafts Functionality:

    • Added an optional metadata_pair field to ListDraftsQueryParams.
    • This addition enables filtering of draft messages based on custom metadata, improving search and retrieval capabilities for drafts.
  • Overall Impact:

    • These changes enhance the search and filtering capabilities for both messages and drafts by allowing the use of metadata key/value pairs.
    • Improves developer experience by providing clear documentation on the new functionality.

Functional Tests

  • Verify that drafts can be filtered using the new 'metadata_pair' field and that the correct drafts are returned based on the specified metadata key/value pair.
  • Ensure that messages can be searched and filtered using the 'metadata_pair' query parameter, and validate that the results match the expected metadata key/value criteria.
  • Test the system's behavior when 'metadata_pair' is not provided, ensuring that the default search and retrieval functionality for drafts and messages remains unaffected.
  • Check that the UI correctly reflects the use of 'metadata_pair' in search queries for both drafts and messages, and that it provides appropriate feedback or results to the user.

Files Changed

File Name Summary
nylas/models/messages.py - Added metadata_pair support in ListMessagesQueryParams and FindMessageQueryParams for metadata-based message search.
- Updated docs with metadata_pair usage details.
nylas/models/drafts.py - Added optional metadata_pair field to ListDraftsQueryParams for filtering drafts by metadata key/value.

View more in PlayerZero
updated: Jul 19 @ 12:06 AM UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants