-
Notifications
You must be signed in to change notification settings - Fork 591
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
Add arbitrary request options to single-feature helpers. #2555
Conversation
packages/vision/src/helpers.js
Outdated
@@ -74,11 +74,12 @@ var coerceImage = (image, callback) => { | |||
* asking for the single feature annotation. | |||
*/ | |||
var _createSingleFeatureMethod = featureValue => { | |||
return function(image, options) { | |||
return this.annotateImage({ | |||
return function(image, options = {}, callOptions = undefined) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
packages/vision/src/helpers.js
Outdated
|
||
// Ensure the feature value indicated by the user's method choice exists on the | ||
// features array; if it does not, add it. | ||
var found = false; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
packages/vision/src/helpers.js
Outdated
@@ -196,6 +210,9 @@ module.exports = apiVersion => { | |||
* | |||
* If the key is `content`, the value should be a Buffer. | |||
* @param {Object=} options | |||
* Any additional options which should be mapped onto the |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
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.
Except for possible Node v4 compat issue, LGTM.
packages/vision/src/helpers.js
Outdated
// the precise method called, throw an exception. | ||
for (let feature of annotateImageRequest.features) { | ||
if (feature.type !== featureValue) { | ||
throw new Error( |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
This is stuck on linting errors:
|
616b1c0
to
11c885c
Compare
Requests to all Vision methods must be in the full format of an
AnnotateImageRequest
.@jmdobry @stephenplusplus This is my pass at addressing #2553. It is definitely intended to be up for discussion.