Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
# 0.7.0
* Remove CLI
* Support for automatic retires & backoff. Off by default, enable by setting `retries` on `APIClient`
* Experimental new interface (see `Google::APIClient::Service`)
* Experimental new interface (see `Legacy::Google::APIClient::Service`)
* Fix warnings when using Faraday separately
* Support Google Compute Engine service accounts
* Enable gzip compression for responses
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ $ gem install google-api-client
## Example Usage

```ruby
require 'google/api_client'
require 'google/api_client/client_secrets'
require 'google/api_client/auth/installed_app'
require 'legacy/google/api_client'
require 'legacy/google/api_client/client_secrets'
require 'legacy/google/api_client/auth/installed_app'

# Initialize the client.
client = Google::APIClient.new(
client = Legacy::Google::APIClient.new(
:application_name => 'Example Ruby application',
:application_version => '1.0.0'
)
Expand All @@ -48,11 +48,11 @@ client = Google::APIClient.new(
plus = client.discovered_api('plus')

# Load client secrets from your client_secrets.json.
client_secrets = Google::APIClient::ClientSecrets.load
client_secrets = Legacy::Google::APIClient::ClientSecrets.load

# Run installed application flow. Check the samples for a more
# complete example that saves the credentials between runs.
flow = Google::APIClient::InstalledAppFlow.new(
flow = Legacy::Google::APIClient::InstalledAppFlow.new(
:client_id => client_secrets.client_id,
:client_secret => client_secrets.client_secret,
:scope => ['https://www.googleapis.com/auth/plus.me']
Expand Down Expand Up @@ -118,7 +118,7 @@ client.execute(...)
This is simpler API to use than in previous versions, although that is still available:

```ruby
key = Google::APIClient::KeyUtils.load_from_pkcs12('client.p12', 'notasecret')
key = Legacy::Google::APIClient::KeyUtils.load_from_pkcs12('client.p12', 'notasecret')
client.authorization = Signet::OAuth2::Client.new(
:token_credential_uri => 'https://accounts.google.com/o/oauth2/token',
:audience => 'https://accounts.google.com/o/oauth2/token',
Expand All @@ -143,16 +143,16 @@ The default value for retries is 0, but will be enabled by default in future rel

### Batching Requests

Some Google APIs support batching requests into a single HTTP request. Use `Google::APIClient::BatchRequest`
Some Google APIs support batching requests into a single HTTP request. Use `Legacy::Google::APIClient::BatchRequest`
to bundle multiple requests together.

Example:

```ruby
client = Google::APIClient.new
client = Legacy::Google::APIClient.new
urlshortener = client.discovered_api('urlshortener')

batch = Google::APIClient::BatchRequest.new do |result|
batch = Legacy::Google::APIClient::BatchRequest.new do |result|
puts result.data
end

Expand All @@ -173,13 +173,13 @@ end

### Media Upload

For APIs that support file uploads, use `Google::APIClient::UploadIO` to load the stream. Both multipart and resumable
For APIs that support file uploads, use `Legacy::Google::APIClient::UploadIO` to load the stream. Both multipart and resumable
uploads can be used. For example, to upload a file to Google Drive using multipart

```ruby
drive = client.discovered_api('drive', 'v2')

media = Google::APIClient::UploadIO.new('mymovie.m4v', 'video/mp4')
media = Legacy::Google::APIClient::UploadIO.new('mymovie.m4v', 'video/mp4')
metadata = {
'title' => 'My movie',
'description' => 'The best home movie ever made'
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require File.join(File.dirname(__FILE__), 'lib/google/api_client', 'version')

PKG_DISPLAY_NAME = 'Google API Client'
PKG_NAME = PKG_DISPLAY_NAME.downcase.gsub(/\s/, '-')
PKG_VERSION = Google::APIClient::VERSION::STRING
PKG_VERSION = Legacy::Google::APIClient::VERSION::STRING
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
PKG_HOMEPAGE = 'https://github.com/google/google-api-ruby-client'

Expand Down
4 changes: 2 additions & 2 deletions google-api-client.gemspec
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- encoding: utf-8 -*-
require File.join(File.dirname(__FILE__), 'lib/google/api_client', 'version')
require File.join(File.dirname(__FILE__), 'lib/legacy/google/api_client', 'version')

Gem::Specification.new do |s|
s.name = "google-api-client"
s.version = Google::APIClient::VERSION::STRING
s.version = Legacy::Google::APIClient::VERSION::STRING

s.required_rubygems_version = ">= 1.3.5"
s.require_paths = ["lib"]
Expand Down
Loading