Google API Ruby 客户端执行与服务方法
Google API Ruby Client execute vs Service methods
似乎有两种方法可以使用 Google API 客户端 Ruby gem:
- 创建客户端并发现 API,并调用
execute
:(https://developers.google.com/google-apps/calendar/v3/reference/calendarList/list#examples)
- 正在创建 API 服务对象并调用特定的 API 方法:http://www.rubydoc.info/github/google/google-api-ruby-client/Google/Apis/CalendarV3/CalendarService#list_events-instance_method
日历 API 文档示例使用前一种方法,但似乎需要后一种方法来批处理请求 (https://developers.google.com/api-client-library/ruby/guide/batch)。
有没有办法用以前的方法批量请求?有没有办法调和这两种方法?
收到 gem 作者的回复——后者是首选,因为它是 gem v0.9 中引入的新语法的一部分。 Google 的开发者网站上的 documentation/examples 目前并未全部更新,但他们有迁移指南:
https://github.com/google/google-api-ruby-client/blob/master/MIGRATING.md
似乎有两种方法可以使用 Google API 客户端 Ruby gem:
- 创建客户端并发现 API,并调用
execute
:(https://developers.google.com/google-apps/calendar/v3/reference/calendarList/list#examples) - 正在创建 API 服务对象并调用特定的 API 方法:http://www.rubydoc.info/github/google/google-api-ruby-client/Google/Apis/CalendarV3/CalendarService#list_events-instance_method
日历 API 文档示例使用前一种方法,但似乎需要后一种方法来批处理请求 (https://developers.google.com/api-client-library/ruby/guide/batch)。
有没有办法用以前的方法批量请求?有没有办法调和这两种方法?
收到 gem 作者的回复——后者是首选,因为它是 gem v0.9 中引入的新语法的一部分。 Google 的开发者网站上的 documentation/examples 目前并未全部更新,但他们有迁移指南:
https://github.com/google/google-api-ruby-client/blob/master/MIGRATING.md