@@ -233,6 +233,10 @@ class VisualRecognitionV3 extends BaseService {
233233 *
234234 * Encode special characters in the file name in UTF-8.
235235 * @param {string } [params.classname_positive_examples_filename] - The filename for classname_positive_examples.
236+ *
237+ * Specify the filename by appending `_positive_examples_filename` to the class name. For example,
238+ * the filename parameter for `goldenretriever_positive_examples` would be `goldenretriever_positive_examples_filename`
239+ *
236240 * @param {string } [params.negative_examples_filename] - The filename for negative_examples.
237241 * @param {Object } [params.headers] - Custom request headers
238242 * @param {Function } [callback] - The callback that handles the response.
@@ -249,11 +253,6 @@ class VisualRecognitionV3 extends BaseService {
249253 if ( missingParams ) {
250254 return _callback ( missingParams ) ;
251255 }
252- if ( _params . classname_positive_examples && ! _params . classname_positive_examples_filename ) {
253- console . warn (
254- 'WARNING: `classname_positive_examples_filename` should be provided if `classname_positive_examples` is not null. This will be REQUIRED in the next major release.'
255- ) ;
256- }
257256 if ( _params . negative_examples && ! _params . negative_examples_filename ) {
258257 console . warn (
259258 'WARNING: `negative_examples_filename` should be provided if `negative_examples` is not null. This will be REQUIRED in the next major release.'
@@ -273,8 +272,14 @@ class VisualRecognitionV3 extends BaseService {
273272 }
274273 } ;
275274 positiveExampleClasses . forEach ( positiveExampleClass => {
275+ if ( ! _params [ `${ positiveExampleClass } _filename` ] ) {
276+ console . warn (
277+ `WARNING: \`${ positiveExampleClass } _filename\` should be provided if \`${ positiveExampleClass } \` is not null. This will be REQUIRED in the next major release.`
278+ ) ;
279+ }
276280 formData [ positiveExampleClass ] = {
277281 data : _params [ positiveExampleClass ] ,
282+ filename : _params [ `${ positiveExampleClass } _filename` ] ,
278283 contentType : 'application/octet-stream' ,
279284 } ;
280285 } ) ;
@@ -433,6 +438,9 @@ class VisualRecognitionV3 extends BaseService {
433438 *
434439 * Encode special characters in the file name in UTF-8.
435440 * @param {string } [params.classname_positive_examples_filename] - The filename for classname_positive_examples.
441+ *
442+ * Specify the filename by appending `_positive_examples_filename` to the class name. For example,
443+ * the filename parameter for `goldenretriever_positive_examples` would be `goldenretriever_positive_examples_filename`
436444 * @param {string } [params.negative_examples_filename] - The filename for negative_examples.
437445 * @param {Object } [params.headers] - Custom request headers
438446 * @param {Function } [callback] - The callback that handles the response.
@@ -449,11 +457,6 @@ class VisualRecognitionV3 extends BaseService {
449457 if ( missingParams ) {
450458 return _callback ( missingParams ) ;
451459 }
452- if ( _params . classname_positive_examples && ! _params . classname_positive_examples_filename ) {
453- console . warn (
454- 'WARNING: `classname_positive_examples_filename` should be provided if `classname_positive_examples` is not null. This will be REQUIRED in the next major release.'
455- ) ;
456- }
457460 if ( _params . negative_examples && ! _params . negative_examples_filename ) {
458461 console . warn (
459462 'WARNING: `negative_examples_filename` should be provided if `negative_examples` is not null. This will be REQUIRED in the next major release.'
@@ -475,8 +478,14 @@ class VisualRecognitionV3 extends BaseService {
475478 'classifier_id' : _params . classifier_id
476479 } ;
477480 positiveExampleClasses . forEach ( positiveExampleClass => {
481+ if ( ! _params [ `${ positiveExampleClass } _filename` ] ) {
482+ console . warn (
483+ `WARNING: \`${ positiveExampleClass } _filename\` should be provided if \`${ positiveExampleClass } \` is not null. This will be REQUIRED in the next major release.`
484+ ) ;
485+ }
478486 formData [ positiveExampleClass ] = {
479487 data : _params [ positiveExampleClass ] ,
488+ filename : _params [ `${ positiveExampleClass } _filename` ] ,
480489 contentType : 'application/octet-stream' ,
481490 } ;
482491 } ) ;
0 commit comments