nylas / nylas-ruby

Ruby bindings for the Nylas Platform APIs
https://nylas.com/docs
MIT License
101 stars 130 forks source link

Error when calling `accounts.ids` #378

Closed f1sherman closed 2 years ago

f1sherman commented 2 years ago

Describe the bug When calling #ids on a collection of accounts, we get the error Nylas::InvalidRequest: Unexpected query parameters set(['view'])

To Reproduce

> Nylas::API.new(app_id: <elided>, app_secret: <elided>).accounts.ids
Nylas::InvalidRequest: Unexpected query parameters set(['view'])
from /app/vendor/bundle/ruby/3.1.0/gems/nylas-5.12.0/lib/nylas/http_client.rb:227:in `handle_anticipated_failure_mode'

Expected behavior The method should return the ids of the accounts

SDK Version: 5.12.0

mrashed-dev commented 2 years ago

Hey @f1sherman thanks for opening this issue. Currently the API does not support the id view on all the different collections, like Accounts. However, we'll enable this feature on the SDK side for all of these collections. I'll update you once we have the feature ready for release.

f1sherman commented 2 years ago

Sounds great, thanks for the quick response!

mrashed-dev commented 2 years ago

@f1sherman Thanks again for your patience, the PR just went up! Now all collections, including those not supporting view=ids on the API side like Account, will work.

f1sherman commented 2 years ago

Yay, thank you!

f1sherman commented 2 years ago

Sorry, one more (potentially related) question: I'm getting the same error when calling accounts.count. Should I file a separate issue for that?

mrashed-dev commented 2 years ago

@f1sherman No need! I'll push an update to fix this as well, thanks for pointing that out.

mrashed-dev commented 2 years ago

Hey @f1sherman! That support has also been added and released in v5.12.1.