-
Notifications
You must be signed in to change notification settings - Fork 76
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
[58500] Python SDK support for metadata for events #152
[58500] Python SDK support for metadata for events #152
Conversation
'metadata_key' and 'metadata_value' can already be filtered by passing them in as an array. 'metadata_pair' is now supported by passing in a dict
This pull request has been linked to Clubhouse Story #58500: Python SDK support for metadata for events. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll need to run python Black locally to format things (it may just be upset about your import order; unsure)
And ideally you could add some tests to https://github.com/nylas/nylas-python/blob/main/tests/test_events.py here as well
Added extra logic in the mock_events function to be able to mimic filtering using the 3 different types of metadata filters; `metadata_key`, `metadata_value`, and `metadata_pair`
@philrenaud Black was re-ran and tests were added! |
New `nylas` v5.0.0 release bringing in the following additions: * Add support for the Nylas Neural API (#163) * Add `metadata` support (#152) * Add new Room Resource fields (#156) * Add `Nylas-API-Version` header support (#157, #151) as well as the following changes: * Transitioned from `app_id` and `app_secret` naming to `client_id` and `client_secret` (#159, #86) * Fix adding a tracking object to an existing `draft` (#153) * Fix issue when converting offset-aware `datetime` objects to `timestamp` (#154, #143) * Fix `limit` value in filter not being used when making `.all()` call (#155) * Fix `from_` field set by attribute on draft ignored (#162, #160) * Remove `bumpversion` from a required dependency to an extra dependency (#158, #144)
Description
The Nylas Calendar API has a new beta feature of adding a new metadata field to calendar events. This PR makes the feature available via the Nylas Python SDK.
Usage
To filter using either
metadata_key
ormetadata_value
you can pass in a string:events = nylas.events.where(metadata_key='hello').all()
or, you can pass in multiple strings as an array:
events = nylas.events.where(metadata_value=['value1', 'value2']).all()
To filter on
metadata_pair
you can pass in adict
of key-value pairs to use in the query:events = nylas.events.where(metadata_pair={'hello': 'world'}).all()
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.