nylas/nylas-ruby

detect_provider method raises ArgumentError

Closed this issue · 2 comments

Describe the bug
detect_provider method raises ArgumentError

To Reproduce

# ./test_run.rb file
require "nylas"

api_key = ENV["NYLAS_APP_KEY"]
nylas = Nylas::Client.new(api_key: api_key)
query_params = { email: "qwe@gmail.com" }

nylas.auth.detect_provider(query_params)

# cli
❯ ruby ./test_run.rb
/Users/some_name/.rvm/gems/ruby-3.1.3/gems/nylas-6.0.2/lib/nylas/resources/auth.rb:163:in `build_query': wrong number of arguments (given 2, expected 1) (ArgumentError)
        from /Users/some_name/.rvm/gems/ruby-3.1.3/gems/nylas-6.0.2/lib/nylas/handler/http_client.rb:214:in `build_url'
        from /Users/some_name/.rvm/gems/ruby-3.1.3/gems/nylas-6.0.2/lib/nylas/handler/http_client.rb:95:in `build_request'
        from /Users/some_name/.rvm/gems/ruby-3.1.3/gems/nylas-6.0.2/lib/nylas/handler/http_client.rb:34:in `execute'
        from /Users/some_name/.rvm/gems/ruby-3.1.3/gems/nylas-6.0.2/lib/nylas/handler/api_operations.rb:68:in `post'
        from /Users/some_name/.rvm/gems/ruby-3.1.3/gems/nylas-6.0.2/lib/nylas/resources/auth.rb:107:in `detect_provider'
        from ./test_run.rb:6:in `<main>'

Expected behavior
It should works as described in doc https://developer.nylas.com/docs/api/v3/admin/#post-/v3/providers/detect

SDK Version:
Ruby 3.1.3
Nylas: 6.0.2

Additional context

Thanks @vikkanaev we will fix it and let you know 😃

@atejada provided the fix and it will be included in the next update, releasing very soon!