README.md in google-api-client-0.34.1 vs README.md in google-api-client-0.35.0

- old
+ new

@@ -8,16 +8,41 @@ ## Migrating from 0.8.x See [MIGRATING](MIGRATING.md) for additional details on how to migrate to the latest version. +## Documentation + +Learn how to use the Google API Client Library for Ruby with these guides: + +### Usage Guides + +- [Getting Started](docs/getting-started.md) +- [Installation](docs/installation.md) +- [Auth](docs/auth.md) + - [API Keys](docs/api-keys.md) + - [OAuth 2.0](docs/oauth.md) + - [OAuth 2.0 for Web Server Applications](docs/oauth-web.md) + - [OAuth 2.0 for Installed Applications](docs/oauth-installed.md) + - [OAuth 2.0 for Server to Server Applications](docs/oauth-server.md) + - [Client Secrets](docs/client-secrets.md) +- How to... + - [Use Logging](docs/logging.md) + - [Upload Media](docs/media-upload.md) + - [Use Pagination](docs/pagination.md) + - [Improve Performance](docs/performance.md) + +### Reference Documentation + +- Reference documentation for [google-api-client](https://googleapis.dev/ruby/google-api-client/latest/index.html). + ## Installation Add this line to your application's Gemfile: ```ruby -gem 'google-api-client', '~> 0.11' +gem 'google-api-client', '~> 0.34' ``` And then execute: @@ -51,9 +76,32 @@ metadata = drive.insert_file(metadata, upload_source: 'test.txt', content_type: 'text/plain') # Download a file drive.get_file(metadata.id, download_dest: '/tmp/myfile.txt') ``` + +An example to use the Content API (Google Merchant Center) + +```ruby +require 'google/apis/content_v2' +require 'googleauth' # https://github.com/googleapis/google-auth-library-ruby + +Content = Google::Apis::ContentV2 # Alias the module +content = Content::ShoppingContentService.new + +scope = 'https://www.googleapis.com/auth/content' +merchant_id = # Merchant ID found on dashboard + +content.authorization = Google::Auth::ServiceAccountCredentials.make_creds( + json_key_io: File.open('./content-api-key.json'), + scope: scope) + +content.authorization.fetch_access_token! +# Service methods: https://googleapis.dev/ruby/google-api-client/latest/Google/Apis/ContentV2/ShoppingContentService.html +content.list_datafeeds(merchant_id) # Returns Google::Apis::ContentV2::ListDatafeedsResponse + +``` + ### Naming conventions vs JSON representation Object properties in the ruby client use the standard ruby convention for naming -- snake_case. This differs from the underlying JSON representation which typically uses camelCase for properties. There are a few notable exceptions to this rule: * For properties that are defined as hashes with user-defined keys, no translation is performed on the key.