google/google-api-nodejs-client — pull request #307 by Alaneor (2014-10-14 22:23:28+00:00)
Title: Implement per-client default params

Default params can be very useful when you know you are going to work on a single resource or if there is a particular query parameter you would like to attach to all API calls for a given endpoint.

The current behaviour is implemented as follows:
- Set a default per-client params during client construction using the `params` property: `var store = googleapis.datastore({ version: 'v1beta2', params: { datasetId: 'set123' } });`
- You can always override these params by passing them to the actual method call: `store.datasets.lookup({ datasetId: 'set456' });`
- Same rules for the default params apply as for the options available in the client constructor and method params - they may be modified as long as the programmer has a reference to the original object, but whenever an API call is initiated, the params are copied to another object to prevent tampering in "mid-air"

Looking forward to hearing your thoughts on this.

Based on discussion in #278.
Closes #278.