Update changelog, readme, & version for next 0.9.4 release

This commit is contained in:
Steve Bazyl 2016-03-11 14:43:51 -08:00
parent 2b1f81246c
commit d2e51b4e7d
3 changed files with 33 additions and 3 deletions

View File

@ -1,3 +1,8 @@
# 0.9.4
* Add `service.fetch_all` helper for automatically retrieving paged results
* Add IAM v1 & Cloud Resource Manager v1 APIs
* Update generated APIs
# 0.9.3 # 0.9.3
* Drop ActiveSupport an MultiJson as dependencies. Active support is still included in the Gemfile * Drop ActiveSupport an MultiJson as dependencies. Active support is still included in the Gemfile
and is needed to run the code generator. and is needed to run the code generator.

View File

@ -38,7 +38,7 @@ require 'google/apis/drive_v2'
Drive = Google::Apis::DriveV2 # Alias the module Drive = Google::Apis::DriveV2 # Alias the module
drive = Drive::DriveService.new drive = Drive::DriveService.new
drive.authorization = authorization # See Googleauth or Signet libraries drive.authorization = ... # See Googleauth or Signet libraries
# Search for files in Drive (first page only) # Search for files in Drive (first page only)
files = drive.list_files(q: "title contains 'finances'") files = drive.list_files(q: "title contains 'finances'")
@ -107,6 +107,32 @@ end
This calling style is required when making batch requests as responses are not available until the entire batch This calling style is required when making batch requests as responses are not available until the entire batch
is complete. is complete.
### Paging
To fetch multiple pages of data, use the `fetch_all` method to wrap the paged query. This returns an
`Enumerable` that automatically fetches additional pages as needed.
```ruby
# List all calendar events
now = Time.now.iso8601
items = calendar.fetch_all do |token|
calendar.list_events('primary',
single_events: true,
order_by: 'startTime',
time_min: now,
page_token: token)
end
items.each { |event| puts event.summary }
```
For APIs that use a field other than `items` to contain the results, an alternate field name can be supplied.
```ruby
# List all files in Drive
items = drive.fetch_all(items: :files) { |token| drive.list_files(page_token: token) }
items.each { |file| puts file.name }
```
### Batches ### Batches
Multiple requests can be batched together into a single HTTP request to reduce overhead. Batched calls are executed Multiple requests can be batched together into a single HTTP request to reduce overhead. Batched calls are executed
@ -240,7 +266,6 @@ A URL can also be specified:
## TODO ## TODO
* ETag support (if-not-modified) * ETag support (if-not-modified)
* Auto-paging results (maybe)
* Caching * Caching
* Model validations * Model validations

View File

@ -15,7 +15,7 @@
module Google module Google
module Apis module Apis
# Client library version # Client library version
VERSION = '0.9.3' VERSION = '0.9.4'
# Current operating system # Current operating system
# @private # @private