Skip to content

Commit

Permalink
vision: update gapic layer (#1736)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus authored Oct 21, 2016
1 parent 212bde2 commit c2db58f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion packages/vision/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"arrify": "^1.0.0",
"async": "^2.0.1",
"extend": "^3.0.0",
"google-gax": "^0.7.0",
"google-gax": "^0.8.1",
"google-proto-files": "^0.8.0",
"is": "^3.0.1",
"propprop": "^0.3.0",
Expand Down
26 changes: 10 additions & 16 deletions packages/vision/src/v1/image_annotator_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ function ImageAnnotatorApi(gaxGrpc, grpcClients, opts) {
/**
* Run image detection and annotation for a batch of images.
*
* @param {Object[]} requests
* @param {Object} request
* The request object that will be sent.
* @param {Object[]} request.requests
* Individual image annotation requests for this batch.
*
* This object should have the same structure as [AnnotateImageRequest]{@link AnnotateImageRequest}
Expand All @@ -119,36 +121,28 @@ function ImageAnnotatorApi(gaxGrpc, grpcClients, opts) {
* The function which will be called with the result of the API call.
*
* The second parameter to the callback is an object representing [BatchAnnotateImagesResponse]{@link BatchAnnotateImagesResponse}
* @returns {gax.EventEmitter} - the event emitter to handle the call
* status.
* @returns {Promise} - The promise which resolves to the response object.
* The promise has a method named "cancel" which cancels the ongoing API call.
*
* @example
*
* var api = visionV1.imageAnnotatorApi();
* var requests = [];
* api.batchAnnotateImages(requests, function(err, response) {
* if (err) {
* console.error(err);
* return;
* }
* api.batchAnnotateImages({requests: requests}).then(function(response) {
* // doThingsWith(response)
* }).catch(function(err) {
* console.error(err);
* });
*/
ImageAnnotatorApi.prototype.batchAnnotateImages = function batchAnnotateImages(
requests,
options,
callback) {
ImageAnnotatorApi.prototype.batchAnnotateImages = function(request, options, callback) {
if (options instanceof Function && callback === undefined) {
callback = options;
options = {};
}
if (options === undefined) {
options = {};
}
var req = {
requests: requests
};
return this._batchAnnotateImages(req, options, callback);
return this._batchAnnotateImages(request, options, callback);
};

function ImageAnnotatorApiBuilder(gaxGrpc) {
Expand Down

0 comments on commit c2db58f

Please sign in to comment.