googleapis/google-api-ruby-client

Dcoumentation and usage guide: google-apis-mybusinessbusinessinformation_v1 api

skarmakar opened this issue ยท 3 comments

There is an issue in the creating a client object code snippet

Steps to reproduce

require "google/apis/mybusinessbusinessinformation_v1"

client = Google::Apis::MybusinessbusinessinformationV1::MyBusinessBusinessInformationService.new
client.authentication = # ... use the googleauth gem to create credentials

produces

NoMethodError: undefined method `authentication=' for #<Google::Apis::MybusinessbusinessinformationV1::MyBusinessBusinessInformationService:0x0000562fea11e4a8>
Did you mean?  authorization=

It should be

client = Google::Apis::MybusinessbusinessinformationV1::MyBusinessBusinessInformationService.new
client.authorization = # ... use the googleauth gem to create credentials

Secondly, could not able to find any sample code in the Usage Guide. Would be great to have some examples in the readme.

Thanks for the report! The authorization snippet has been fixed and should propagate out to generated clients in the next day; however we're in a release freeze for the holiday so it probably won't appear in released gems until the new year.

Regarding sample code, I agree it would be great to have some examples specific to the MyBusiness service in the readme. At this point, these clients are autogenerated, and we don't have engineers available for every service and programming language combination to hand-create examples. My best suggestion is to go to the my-business documentation page (https://developers.google.com/my-business) and look for examples there. There might not be Ruby examples, but you may find Python or similar language that you can combine with the getting started info in the Ruby readme to get a feel for how to use the API from Ruby.

@dazuma thanks for your reply. I realized that this is a pretty old version and #662 explaining how to generate a local version for the V4(.9?) version. But https://developers.google.com/my-business/samples/mybusiness_google_rest_v4.json is not found (404). Any idea?

@skarmakar Added the link in #662 but wanted to put it here as well for visibility. I found an updated JSON here: https://developers.google.com/static/my-business/samples/mybusiness_google_rest_v4p9.json. This allowed me to generate the API and use it.