Skip to content

lookups.v1.phone_numbers(..).fetch(..) fails with ArgumentError #518

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

Closed
engshien opened this issue Jul 9, 2020 · 3 comments · Fixed by #520
Closed

lookups.v1.phone_numbers(..).fetch(..) fails with ArgumentError #518

engshien opened this issue Jul 9, 2020 · 3 comments · Fixed by #520
Labels
status: help wanted requesting help from the community type: bug bug in the library

Comments

@engshien
Copy link

engshien commented Jul 9, 2020

Issue Summary

lookups.v1.phone_numbers(..).fetch(..) fails with ArgumentError in generated code

Steps to Reproduce

Run code snippet

Code Snippet

require 'twilio-ruby'
account_sid = ...
auth_token = ...
twilio_client = Twilio::REST::Client.new(account_sid, auth_token)
result = twilio_client.lookups.v1.phone_numbers('+551155256325').fetch(type: 'carrier')

Exception/Log

wrong number of arguments (given 3, expected 2)
/Users/ewu/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/twilio-ruby-5.39.0/lib/twilio-ruby/framework/version.rb:60:in `fetch'
/Users/ewu/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/twilio-ruby-5.39.0/lib/twilio-ruby/rest/lookups/v1/phone_number.rb:105:in `fetch'

Technical details:

  • twilio-ruby version: twilio-ruby-5.39.0
  • ruby version: 2.6.6
@engshien
Copy link
Author

engshien commented Jul 9, 2020

I think fetch(.., params = {} ...) is now fetch(..., params: {} ...).

@eshanholtz
Copy link
Contributor

Nice catch. Unfortunately this was a bug introduced during a refactor done to support custom header parameters in the underlying API in #515 and #516. I tried to ensure backwards compatibility, but apparently none of our autogenerated integration tests for fetch have params passed in. I will work on a fix for this and release a patched version. Thanks!

@eshanholtz
Copy link
Contributor

Fix released in patch version 5.39.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: help wanted requesting help from the community type: bug bug in the library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants