Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add bound parameters to Service objects
You can now create service objects with a `params` hash that contains top level parameters bound to all subsequent operation calls. For example, to operate on an S3 object, you can use: var s3obj = new AWS.S3({Bucket: 'bucket', Key: 'key'}); // no bound params passed to put or get calls s3obj.putObject({Body: 'text'}, function() { s3obj.getObject(function(err, data) { console.log("Got the data back", data.Body.toString()); }); }); Note that only toplevel parameters can be bound. These parameters will also be automatically ignored for operations that do not use these parameters. For example, we can still use the `s3obj` variable to call `listObjects()`, even though that operation does not accept a `Key` parameter: s3obj.listObjects(function(err, data) { console.log("Objects in my bucket", data); });
- Loading branch information
Showing
4 changed files
with
42 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8ea211f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI the example in the commit message should say: