Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vision: update gapic layer #1736

Merged
merged 1 commit into from
Oct 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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