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.

For embedded field masks in requests (for example, the Sheets API), specify the camelCase form when referencing fields.

Outisde those exceptions, if a property is specified using camelCase in a request, it will be ignored during serialization and omitted from the request.

Media

Methods that allow media operations have additional parameters to specify the upload source or download destination.

For uploads, the upload_source parameter can be specified with either a path to a file, an IO stream, or StringIO
instance.

For downloads, the download_dest parameter can also be either a path to a file, an IO stream, or StringIO instance.

Both uploads & downloads are resumable. If an error occurs during transmission the request will be automatically
retried from the last received byte.

Errors & Retries

Retries are disabled by default, but enabling retries is strongly encouraged. The number of retries can be configured
via Google::Apis::RequestOptions. Any number greater than 0 will enable retries.

When retries are enabled, if a server or rate limit error occurs during a request it is automatically retried with
an exponentially increasing delay on subsequent retries. If a request can not be retried or if the maximum number
of retries is exceeded, an exception is thrown.

Callbacks

A block can be specified when making calls. If present, the block will be called with the result or error, rather than
returning the result from the call or raising the error. Example:

Media operations -- uploads & downloads -- can not be included in batch with other requests.

However, some APIs support batch uploads. To upload multiple files in a batch, use the batch_upload method instead.
Batch uploads should only be used when uploading multiple small files. For large files, upload files individually to
take advantage of the libraries built-in resumable upload support.

Hashes

While the API will always return instances of schema classes, plain hashes are accepted in method calls for
convenience. Hash keys must be symbols matching the attribute names on the corresponding object the hash is meant
to replace. For example:

IMPORTANT: Be careful when supplying hashes for request objects. If it is the last argument to a method, ruby will interpret the hash as keyword arguments. To prevent this, appending an empty hash as an extra parameter will avoid misinterpretation.

Authorization

The Google Auth Library for Ruby provides an implementation of
[application default credentials] for Ruby. It offers a simple way to get authorization credentials for use in
calling Google APIs, best suited for cases when the call needs to have the same identity
and authorization level for the application independent of the user. This is
the recommended approach to authorize calls to Cloud APIs, particularly when
you're building an application that uses Google Compute Engine.

Authorization using environment variables

The GoogleAuth Library for Ruby also supports authorization via
environment variables if you do not want to check in developer credentials
or private keys. Simply set the following variables for your application: