Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
nylas-python Changelog
======================
Unreleased
----------
* Fixed `webhooks.list()` dropping the `overrides` argument, so per request `api_key`, `api_uri`, `timeout` and `headers` now apply to it

v6.17.0
----------
* Clarify that event `default` visibility is Google-only
Expand Down
6 changes: 5 additions & 1 deletion nylas/resources/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ def list(self, overrides: RequestOverrides = None) -> ListResponse[Webhook]:
Returns:
The list of webhook destinations
"""
return super().list(path="/v3/webhooks", response_type=Webhook)
return super().list(
path="/v3/webhooks",
response_type=Webhook,
overrides=overrides,
)

def find(
self, webhook_id: str, overrides: RequestOverrides = None
Expand Down
10 changes: 10 additions & 0 deletions tests/resources/test_webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ def test_list_webhooks(self, http_client_list_response):
"GET", "/v3/webhooks", None, None, None, overrides=None
)

def test_list_webhooks_with_overrides(self, http_client_list_response):
webhooks = Webhooks(http_client_list_response)
overrides = {"api_key": "override-key", "api_uri": "https://override.nylas.com"}

webhooks.list(overrides=overrides)

http_client_list_response._execute.assert_called_once_with(
"GET", "/v3/webhooks", None, None, None, overrides=overrides
)

def test_find_webhook(self, http_client_response):
webhooks = Webhooks(http_client_response)

Expand Down