ruby client get_by_id yields "User no implicit conversion of Symbol into Integer"
resolver
the current ruby client seems to be generated from a swagger description.
fetching company details with get_by_id seems broken though. i'm not managing to get it working. listing all companies works fine for your info.
i keep hitting this error "no implicit conversion of Symbol into Integer" . i wen't looking in the source but i don't seem to find the source. the code is not trivial to read as it's generated code.
if anyone knows how to get company details with the latest ruby gem code for a given id, please share 🙂
see below for actual outputs. from that output it seems te system really expects just 1 argument (which i can’t read in the code) and it needs to be a primitive string or int, because the code generation tries to load an inexistent class in the other cases.
i also tried for several ruby versions: 3.0, 3.2 … same results
regards koen
``` irb(main):001> c = Hubspot::Client.new(access_token: ENV["HUBSPOT_ACCESS_TOKEN"]) => #<:client:0x000000010761a780>"pat-eu1-8e5f2c79-11e9-4bc1-9678-7708c19ab0b2"}> irb(main):002> c.crm.companies.basic_api.get_by_id(1) /Users/koenhandekyn/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/hubspot-api-client-17.2.0/lib/hubspot/discovery/base_api_client.rb:135:in `[]': no implicit conversion of Symbol into Integer (TypeError)
params_with_defaults[:opts] ||= {} ^^^^^^^^^^^^^ irb(main):003> c.crm.companies.basic_api.get_by_id("1") /Users/koenhandekyn/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/hubspot-api-client-17.2.0/lib/hubspot/discovery/base_api_client.rb:135:in `[]': no implicit conversion of Symbol into Integer (TypeError)
params_with_defaults[:opts] ||= {} ^^^^^^^^^^^^^ irb(main):004> c.crm.companies.basic_api.get_by_id(id: 1) <>:38:in `require': cannot load such file -- hubspot/codegen/crm/companies/models/company_id (LoadError) irb(main):005> c.crm.companies.basic_api.get_by_id(id: "1") <>:38:in `require': cannot load such file -- hubspot/codegen/crm/companies/models/company_id (LoadError) irb(main):006> c.crm.companies.basic_api.get_by_id({id: "1"}) <>:38:in `require': cannot load such file -- hubspot/codegen/crm/companies/models/company_id (LoadError) irb(main):007> c.crm.companies.basic_api.get_by_id({id: 1}) <>:38:in `require': cannot load such file -- hubspot/codegen/crm/companies/models/company_id (LoadError) irb(main):008> c.crm.companies.basic_api.get_by_id(1, opts: {}) /Users/koenhandekyn/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/hubspot-api-client-17.2.0/lib/hubspot/discovery/base_api_client.rb:133:in `block (2 levels) in define_api_methods': wrong number of arguments (given 2, expected 0..1) (ArgumentError) irb(main):009> c.crm.companies.basic_api.get_by_id(1, {}) /Users/koenhandekyn/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/hubspot-api-client-17.2.0/lib/hubspot/discovery/base_api_client.rb:133:in `block (2 levels) in define_api_methods': wrong number of arguments (given 2, expected 0..1) (ArgumentError) ```