@google-cloud/vision
Advanced tools
Comparing version 1.11.0 to 2.0.0
@@ -24,3 +24,4 @@ /// <reference types="node" /> | ||
source?: { | ||
filename: string; | ||
filename?: string; | ||
imageUri?: string; | ||
}; | ||
@@ -27,0 +28,0 @@ content?: Uint8Array | string | null; |
@@ -20,2 +20,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.call = void 0; | ||
const fs = require("fs"); | ||
@@ -25,3 +26,3 @@ const is = require("is"); | ||
const gax = require("google-gax"); | ||
// tslint:disable-next-line no-any | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
const _requestToObject = (request) => { | ||
@@ -207,3 +208,5 @@ if (is.string(request)) { | ||
}); | ||
const protoFilesRoot = gax.protobuf.Root.fromJSON(require('../protos/protos.json')); | ||
const protoFilesRoot = gax.protobuf.Root.fromJSON( | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
require('../protos/protos.json')); | ||
const features = protoFilesRoot.lookup(`google.cloud.vision.${apiVersion}.Feature.Type`).values; | ||
@@ -210,0 +213,0 @@ /** |
@@ -20,2 +20,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.protos = exports.ProductSearchClient = exports.ImageAnnotatorClient = exports.v1p4beta1 = exports.v1p3beta1 = exports.v1p2beta1 = exports.v1p1beta1 = exports.v1 = void 0; | ||
const v1 = require("./v1"); | ||
@@ -22,0 +23,0 @@ exports.v1 = v1; |
import * as gax from 'google-gax'; | ||
import { Callback, ClientOptions, LROperation } from 'google-gax'; | ||
import * as protosTypes from '../../protos/protos'; | ||
import { Callback, Descriptors, ClientOptions, LROperation } from 'google-gax'; | ||
import * as protos from '../../protos/protos'; | ||
/** | ||
@@ -12,5 +12,2 @@ * Service that performs Google Cloud Vision API detection tasks over client | ||
export declare class ImageAnnotatorClient { | ||
private _descriptors; | ||
private _innerApiCalls; | ||
private _pathTemplates; | ||
private _terminated; | ||
@@ -23,2 +20,9 @@ private _opts; | ||
auth: gax.GoogleAuth; | ||
descriptors: Descriptors; | ||
innerApiCalls: { | ||
[name: string]: Function; | ||
}; | ||
pathTemplates: { | ||
[name: string]: gax.PathTemplate; | ||
}; | ||
operationsClient: gax.OperationsClient; | ||
@@ -88,11 +92,45 @@ imageAnnotatorStub?: Promise<{ | ||
getProjectId(callback: Callback<string, undefined, undefined>): void; | ||
batchAnnotateImages(request: protosTypes.google.cloud.vision.v1.IBatchAnnotateImagesRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1.IBatchAnnotateImagesResponse, (protosTypes.google.cloud.vision.v1.IBatchAnnotateImagesRequest | undefined), {} | undefined]>; | ||
batchAnnotateImages(request: protosTypes.google.cloud.vision.v1.IBatchAnnotateImagesRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1.IBatchAnnotateImagesResponse, protosTypes.google.cloud.vision.v1.IBatchAnnotateImagesRequest | undefined, {} | undefined>): void; | ||
batchAnnotateFiles(request: protosTypes.google.cloud.vision.v1.IBatchAnnotateFilesRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1.IBatchAnnotateFilesResponse, protosTypes.google.cloud.vision.v1.IBatchAnnotateFilesRequest | undefined, {} | undefined]>; | ||
batchAnnotateFiles(request: protosTypes.google.cloud.vision.v1.IBatchAnnotateFilesRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1.IBatchAnnotateFilesResponse, protosTypes.google.cloud.vision.v1.IBatchAnnotateFilesRequest | undefined, {} | undefined>): void; | ||
asyncBatchAnnotateImages(request: protosTypes.google.cloud.vision.v1.IAsyncBatchAnnotateImagesRequest, options?: gax.CallOptions): Promise<[LROperation<protosTypes.google.cloud.vision.v1.IAsyncBatchAnnotateImagesResponse, protosTypes.google.cloud.vision.v1.IOperationMetadata>, protosTypes.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
asyncBatchAnnotateImages(request: protosTypes.google.cloud.vision.v1.IAsyncBatchAnnotateImagesRequest, options: gax.CallOptions, callback: Callback<LROperation<protosTypes.google.cloud.vision.v1.IAsyncBatchAnnotateImagesResponse, protosTypes.google.cloud.vision.v1.IOperationMetadata>, protosTypes.google.longrunning.IOperation | undefined, {} | undefined>): void; | ||
asyncBatchAnnotateFiles(request: protosTypes.google.cloud.vision.v1.IAsyncBatchAnnotateFilesRequest, options?: gax.CallOptions): Promise<[LROperation<protosTypes.google.cloud.vision.v1.IAsyncBatchAnnotateFilesResponse, protosTypes.google.cloud.vision.v1.IOperationMetadata>, protosTypes.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
asyncBatchAnnotateFiles(request: protosTypes.google.cloud.vision.v1.IAsyncBatchAnnotateFilesRequest, options: gax.CallOptions, callback: Callback<LROperation<protosTypes.google.cloud.vision.v1.IAsyncBatchAnnotateFilesResponse, protosTypes.google.cloud.vision.v1.IOperationMetadata>, protosTypes.google.longrunning.IOperation | undefined, {} | undefined>): void; | ||
batchAnnotateImages(request: protos.google.cloud.vision.v1.IBatchAnnotateImagesRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1.IBatchAnnotateImagesResponse, protos.google.cloud.vision.v1.IBatchAnnotateImagesRequest | undefined, {} | undefined]>; | ||
batchAnnotateImages(request: protos.google.cloud.vision.v1.IBatchAnnotateImagesRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1.IBatchAnnotateImagesResponse, protos.google.cloud.vision.v1.IBatchAnnotateImagesRequest | null | undefined, {} | null | undefined>): void; | ||
batchAnnotateImages(request: protos.google.cloud.vision.v1.IBatchAnnotateImagesRequest, callback: Callback<protos.google.cloud.vision.v1.IBatchAnnotateImagesResponse, protos.google.cloud.vision.v1.IBatchAnnotateImagesRequest | null | undefined, {} | null | undefined>): void; | ||
batchAnnotateFiles(request: protos.google.cloud.vision.v1.IBatchAnnotateFilesRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1.IBatchAnnotateFilesResponse, protos.google.cloud.vision.v1.IBatchAnnotateFilesRequest | undefined, {} | undefined]>; | ||
batchAnnotateFiles(request: protos.google.cloud.vision.v1.IBatchAnnotateFilesRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1.IBatchAnnotateFilesResponse, protos.google.cloud.vision.v1.IBatchAnnotateFilesRequest | null | undefined, {} | null | undefined>): void; | ||
batchAnnotateFiles(request: protos.google.cloud.vision.v1.IBatchAnnotateFilesRequest, callback: Callback<protos.google.cloud.vision.v1.IBatchAnnotateFilesResponse, protos.google.cloud.vision.v1.IBatchAnnotateFilesRequest | null | undefined, {} | null | undefined>): void; | ||
asyncBatchAnnotateImages(request: protos.google.cloud.vision.v1.IAsyncBatchAnnotateImagesRequest, options?: gax.CallOptions): Promise<[LROperation<protos.google.cloud.vision.v1.IAsyncBatchAnnotateImagesResponse, protos.google.cloud.vision.v1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
asyncBatchAnnotateImages(request: protos.google.cloud.vision.v1.IAsyncBatchAnnotateImagesRequest, options: gax.CallOptions, callback: Callback<LROperation<protos.google.cloud.vision.v1.IAsyncBatchAnnotateImagesResponse, protos.google.cloud.vision.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
asyncBatchAnnotateImages(request: protos.google.cloud.vision.v1.IAsyncBatchAnnotateImagesRequest, callback: Callback<LROperation<protos.google.cloud.vision.v1.IAsyncBatchAnnotateImagesResponse, protos.google.cloud.vision.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
/** | ||
* Check the status of the long running operation returned by the asyncBatchAnnotateImages() method. | ||
* @param {String} name | ||
* The operation name that will be passed. | ||
* @returns {Promise} - The promise which resolves to an object. | ||
* The decoded operation object has result and metadata field to get information from. | ||
* | ||
* @example: | ||
* const decodedOperation = await checkAsyncBatchAnnotateImagesProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
* | ||
*/ | ||
checkAsyncBatchAnnotateImagesProgress(name: string): Promise<LROperation<protos.google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse, protos.google.cloud.vision.v1.OperationMetadata>>; | ||
asyncBatchAnnotateFiles(request: protos.google.cloud.vision.v1.IAsyncBatchAnnotateFilesRequest, options?: gax.CallOptions): Promise<[LROperation<protos.google.cloud.vision.v1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
asyncBatchAnnotateFiles(request: protos.google.cloud.vision.v1.IAsyncBatchAnnotateFilesRequest, options: gax.CallOptions, callback: Callback<LROperation<protos.google.cloud.vision.v1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
asyncBatchAnnotateFiles(request: protos.google.cloud.vision.v1.IAsyncBatchAnnotateFilesRequest, callback: Callback<LROperation<protos.google.cloud.vision.v1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
/** | ||
* Check the status of the long running operation returned by the asyncBatchAnnotateFiles() method. | ||
* @param {String} name | ||
* The operation name that will be passed. | ||
* @returns {Promise} - The promise which resolves to an object. | ||
* The decoded operation object has result and metadata field to get information from. | ||
* | ||
* @example: | ||
* const decodedOperation = await checkAsyncBatchAnnotateFilesProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
* | ||
*/ | ||
checkAsyncBatchAnnotateFilesProgress(name: string): Promise<LROperation<protos.google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1.OperationMetadata>>; | ||
/** | ||
* Return a fully-qualified product resource name string. | ||
@@ -113,3 +151,3 @@ * | ||
*/ | ||
matchProjectFromProductName(productName: string): string; | ||
matchProjectFromProductName(productName: string): string | number; | ||
/** | ||
@@ -122,3 +160,3 @@ * Parse the location from Product resource. | ||
*/ | ||
matchLocationFromProductName(productName: string): string; | ||
matchLocationFromProductName(productName: string): string | number; | ||
/** | ||
@@ -131,3 +169,3 @@ * Parse the product from Product resource. | ||
*/ | ||
matchProductFromProductName(productName: string): string; | ||
matchProductFromProductName(productName: string): string | number; | ||
/** | ||
@@ -149,3 +187,3 @@ * Return a fully-qualified productSet resource name string. | ||
*/ | ||
matchProjectFromProductSetName(productSetName: string): string; | ||
matchProjectFromProductSetName(productSetName: string): string | number; | ||
/** | ||
@@ -158,3 +196,3 @@ * Parse the location from ProductSet resource. | ||
*/ | ||
matchLocationFromProductSetName(productSetName: string): string; | ||
matchLocationFromProductSetName(productSetName: string): string | number; | ||
/** | ||
@@ -167,3 +205,3 @@ * Parse the product_set from ProductSet resource. | ||
*/ | ||
matchProductSetFromProductSetName(productSetName: string): string; | ||
matchProductSetFromProductSetName(productSetName: string): string | number; | ||
/** | ||
@@ -186,3 +224,3 @@ * Return a fully-qualified referenceImage resource name string. | ||
*/ | ||
matchProjectFromReferenceImageName(referenceImageName: string): string; | ||
matchProjectFromReferenceImageName(referenceImageName: string): string | number; | ||
/** | ||
@@ -195,3 +233,3 @@ * Parse the location from ReferenceImage resource. | ||
*/ | ||
matchLocationFromReferenceImageName(referenceImageName: string): string; | ||
matchLocationFromReferenceImageName(referenceImageName: string): string | number; | ||
/** | ||
@@ -204,3 +242,3 @@ * Parse the product from ReferenceImage resource. | ||
*/ | ||
matchProductFromReferenceImageName(referenceImageName: string): string; | ||
matchProductFromReferenceImageName(referenceImageName: string): string | number; | ||
/** | ||
@@ -213,3 +251,3 @@ * Parse the reference_image from ReferenceImage resource. | ||
*/ | ||
matchReferenceImageFromReferenceImageName(referenceImageName: string): string; | ||
matchReferenceImageFromReferenceImageName(referenceImageName: string): string | number; | ||
/** | ||
@@ -216,0 +254,0 @@ * Terminate the GRPC channel and close the client. |
"use strict"; | ||
// Copyright 2019 Google LLC | ||
// Copyright 2020 Google LLC | ||
// | ||
@@ -20,5 +20,7 @@ // Licensed under the Apache License, Version 2.0 (the "License"); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ImageAnnotatorClient = void 0; | ||
const gax = require("google-gax"); | ||
const path = require("path"); | ||
const gapicConfig = require("./image_annotator_client_config.json"); | ||
const google_gax_1 = require("google-gax"); | ||
const version = require('../../../package.json').version; | ||
@@ -59,4 +61,9 @@ /** | ||
constructor(opts) { | ||
this._descriptors = { page: {}, stream: {}, longrunning: {} }; | ||
this._terminated = false; | ||
this.descriptors = { | ||
page: {}, | ||
stream: {}, | ||
longrunning: {}, | ||
batching: {}, | ||
}; | ||
// Ensure that options include the service address and port. | ||
@@ -110,7 +117,10 @@ const staticMembers = this.constructor; | ||
const nodejsProtoPath = path.join(__dirname, '..', '..', 'protos', 'protos.json'); | ||
this._protos = this._gaxGrpc.loadProto(opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath); | ||
this._protos = this._gaxGrpc.loadProto(opts.fallback | ||
? // eslint-disable-next-line @typescript-eslint/no-var-requires | ||
require('../../protos/protos.json') | ||
: nodejsProtoPath); | ||
// This API contains "path templates"; forward-slash-separated | ||
// identifiers to uniquely identify resources within the API. | ||
// Create useful helper objects for these. | ||
this._pathTemplates = { | ||
this.pathTemplates = { | ||
productPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/products/{product}'), | ||
@@ -124,3 +134,5 @@ productSetPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/productSets/{product_set}'), | ||
const protoFilesRoot = opts.fallback | ||
? this._gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) | ||
? this._gaxModule.protobuf.Root.fromJSON( | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
require('../../protos/protos.json')) | ||
: this._gaxModule.protobuf.loadSync(nodejsProtoPath); | ||
@@ -137,3 +149,3 @@ this.operationsClient = this._gaxModule | ||
const asyncBatchAnnotateFilesMetadata = protoFilesRoot.lookup('.google.cloud.vision.v1.OperationMetadata'); | ||
this._descriptors.longrunning = { | ||
this.descriptors.longrunning = { | ||
asyncBatchAnnotateImages: new this._gaxModule.LongrunningDescriptor(this.operationsClient, asyncBatchAnnotateImagesResponse.decode.bind(asyncBatchAnnotateImagesResponse), asyncBatchAnnotateImagesMetadata.decode.bind(asyncBatchAnnotateImagesMetadata)), | ||
@@ -147,3 +159,3 @@ asyncBatchAnnotateFiles: new this._gaxModule.LongrunningDescriptor(this.operationsClient, asyncBatchAnnotateFilesResponse.decode.bind(asyncBatchAnnotateFilesResponse), asyncBatchAnnotateFilesMetadata.decode.bind(asyncBatchAnnotateFilesMetadata)), | ||
// merely providing the destination and request information. | ||
this._innerApiCalls = {}; | ||
this.innerApiCalls = {}; | ||
} | ||
@@ -170,3 +182,3 @@ /** | ||
? this._protos.lookupService('google.cloud.vision.v1.ImageAnnotator') | ||
: // tslint:disable-next-line no-any | ||
: // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
this._protos.google.cloud.vision.v1.ImageAnnotator, this._opts); | ||
@@ -182,16 +194,15 @@ // Iterate over each of the methods that the service provides | ||
for (const methodName of imageAnnotatorStubMethods) { | ||
const innerCallPromise = this.imageAnnotatorStub.then(stub => (...args) => { | ||
const callPromise = this.imageAnnotatorStub.then(stub => (...args) => { | ||
if (this._terminated) { | ||
return Promise.reject('The client has already been closed.'); | ||
} | ||
return stub[methodName].apply(stub, args); | ||
const func = stub[methodName]; | ||
return func.apply(stub, args); | ||
}, (err) => () => { | ||
throw err; | ||
}); | ||
const apiCall = this._gaxModule.createApiCall(innerCallPromise, this._defaults[methodName], this._descriptors.page[methodName] || | ||
this._descriptors.stream[methodName] || | ||
this._descriptors.longrunning[methodName]); | ||
this._innerApiCalls[methodName] = (argument, callOptions, callback) => { | ||
return apiCall(argument, callOptions, callback); | ||
}; | ||
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], this.descriptors.page[methodName] || | ||
this.descriptors.stream[methodName] || | ||
this.descriptors.longrunning[methodName]); | ||
this.innerApiCalls[methodName] = apiCall; | ||
} | ||
@@ -284,3 +295,3 @@ return this.imageAnnotatorStub; | ||
this.initialize(); | ||
return this._innerApiCalls.batchAnnotateImages(request, options, callback); | ||
return this.innerApiCalls.batchAnnotateImages(request, options, callback); | ||
} | ||
@@ -337,3 +348,3 @@ /** | ||
this.initialize(); | ||
return this._innerApiCalls.batchAnnotateFiles(request, options, callback); | ||
return this.innerApiCalls.batchAnnotateFiles(request, options, callback); | ||
} | ||
@@ -393,5 +404,25 @@ /** | ||
this.initialize(); | ||
return this._innerApiCalls.asyncBatchAnnotateImages(request, options, callback); | ||
return this.innerApiCalls.asyncBatchAnnotateImages(request, options, callback); | ||
} | ||
/** | ||
* Check the status of the long running operation returned by the asyncBatchAnnotateImages() method. | ||
* @param {String} name | ||
* The operation name that will be passed. | ||
* @returns {Promise} - The promise which resolves to an object. | ||
* The decoded operation object has result and metadata field to get information from. | ||
* | ||
* @example: | ||
* const decodedOperation = await checkAsyncBatchAnnotateImagesProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
* | ||
*/ | ||
async checkAsyncBatchAnnotateImagesProgress(name) { | ||
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name }); | ||
const [operation] = await this.operationsClient.getOperation(request); | ||
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.asyncBatchAnnotateImages, gax.createDefaultBackoffSettings()); | ||
return decodeOperation; | ||
} | ||
/** | ||
* Run asynchronous image detection and annotation for a list of generic | ||
@@ -444,4 +475,24 @@ * files, such as PDF files, which may contain multiple pages and multiple | ||
this.initialize(); | ||
return this._innerApiCalls.asyncBatchAnnotateFiles(request, options, callback); | ||
return this.innerApiCalls.asyncBatchAnnotateFiles(request, options, callback); | ||
} | ||
/** | ||
* Check the status of the long running operation returned by the asyncBatchAnnotateFiles() method. | ||
* @param {String} name | ||
* The operation name that will be passed. | ||
* @returns {Promise} - The promise which resolves to an object. | ||
* The decoded operation object has result and metadata field to get information from. | ||
* | ||
* @example: | ||
* const decodedOperation = await checkAsyncBatchAnnotateFilesProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
* | ||
*/ | ||
async checkAsyncBatchAnnotateFilesProgress(name) { | ||
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name }); | ||
const [operation] = await this.operationsClient.getOperation(request); | ||
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.asyncBatchAnnotateFiles, gax.createDefaultBackoffSettings()); | ||
return decodeOperation; | ||
} | ||
// -------------------- | ||
@@ -459,6 +510,6 @@ // -- Path templates -- | ||
productPath(project, location, product) { | ||
return this._pathTemplates.productPathTemplate.render({ | ||
project, | ||
location, | ||
product, | ||
return this.pathTemplates.productPathTemplate.render({ | ||
project: project, | ||
location: location, | ||
product: product, | ||
}); | ||
@@ -474,3 +525,3 @@ } | ||
matchProjectFromProductName(productName) { | ||
return this._pathTemplates.productPathTemplate.match(productName).project; | ||
return this.pathTemplates.productPathTemplate.match(productName).project; | ||
} | ||
@@ -485,3 +536,3 @@ /** | ||
matchLocationFromProductName(productName) { | ||
return this._pathTemplates.productPathTemplate.match(productName).location; | ||
return this.pathTemplates.productPathTemplate.match(productName).location; | ||
} | ||
@@ -496,3 +547,3 @@ /** | ||
matchProductFromProductName(productName) { | ||
return this._pathTemplates.productPathTemplate.match(productName).product; | ||
return this.pathTemplates.productPathTemplate.match(productName).product; | ||
} | ||
@@ -508,5 +559,5 @@ /** | ||
productSetPath(project, location, productSet) { | ||
return this._pathTemplates.productSetPathTemplate.render({ | ||
project, | ||
location, | ||
return this.pathTemplates.productSetPathTemplate.render({ | ||
project: project, | ||
location: location, | ||
product_set: productSet, | ||
@@ -523,3 +574,3 @@ }); | ||
matchProjectFromProductSetName(productSetName) { | ||
return this._pathTemplates.productSetPathTemplate.match(productSetName) | ||
return this.pathTemplates.productSetPathTemplate.match(productSetName) | ||
.project; | ||
@@ -535,3 +586,3 @@ } | ||
matchLocationFromProductSetName(productSetName) { | ||
return this._pathTemplates.productSetPathTemplate.match(productSetName) | ||
return this.pathTemplates.productSetPathTemplate.match(productSetName) | ||
.location; | ||
@@ -547,3 +598,3 @@ } | ||
matchProductSetFromProductSetName(productSetName) { | ||
return this._pathTemplates.productSetPathTemplate.match(productSetName) | ||
return this.pathTemplates.productSetPathTemplate.match(productSetName) | ||
.product_set; | ||
@@ -561,6 +612,6 @@ } | ||
referenceImagePath(project, location, product, referenceImage) { | ||
return this._pathTemplates.referenceImagePathTemplate.render({ | ||
project, | ||
location, | ||
product, | ||
return this.pathTemplates.referenceImagePathTemplate.render({ | ||
project: project, | ||
location: location, | ||
product: product, | ||
reference_image: referenceImage, | ||
@@ -577,3 +628,3 @@ }); | ||
matchProjectFromReferenceImageName(referenceImageName) { | ||
return this._pathTemplates.referenceImagePathTemplate.match(referenceImageName).project; | ||
return this.pathTemplates.referenceImagePathTemplate.match(referenceImageName).project; | ||
} | ||
@@ -588,3 +639,3 @@ /** | ||
matchLocationFromReferenceImageName(referenceImageName) { | ||
return this._pathTemplates.referenceImagePathTemplate.match(referenceImageName).location; | ||
return this.pathTemplates.referenceImagePathTemplate.match(referenceImageName).location; | ||
} | ||
@@ -599,3 +650,3 @@ /** | ||
matchProductFromReferenceImageName(referenceImageName) { | ||
return this._pathTemplates.referenceImagePathTemplate.match(referenceImageName).product; | ||
return this.pathTemplates.referenceImagePathTemplate.match(referenceImageName).product; | ||
} | ||
@@ -610,3 +661,3 @@ /** | ||
matchReferenceImageFromReferenceImageName(referenceImageName) { | ||
return this._pathTemplates.referenceImagePathTemplate.match(referenceImageName).reference_image; | ||
return this.pathTemplates.referenceImagePathTemplate.match(referenceImageName).reference_image; | ||
} | ||
@@ -613,0 +664,0 @@ /** |
"use strict"; | ||
// Copyright 2019 Google LLC | ||
// Copyright 2020 Google LLC | ||
// | ||
@@ -21,5 +21,5 @@ // Licensed under the Apache License, Version 2.0 (the "License"); | ||
var image_annotator_client_1 = require("./image_annotator_client"); | ||
exports.ImageAnnotatorClient = image_annotator_client_1.ImageAnnotatorClient; | ||
Object.defineProperty(exports, "ImageAnnotatorClient", { enumerable: true, get: function () { return image_annotator_client_1.ImageAnnotatorClient; } }); | ||
var product_search_client_1 = require("./product_search_client"); | ||
exports.ProductSearchClient = product_search_client_1.ProductSearchClient; | ||
Object.defineProperty(exports, "ProductSearchClient", { enumerable: true, get: function () { return product_search_client_1.ProductSearchClient; } }); | ||
//# sourceMappingURL=index.js.map |
/// <reference types="node" /> | ||
import * as gax from 'google-gax'; | ||
import { Callback, ClientOptions, LROperation } from 'google-gax'; | ||
import { Callback, Descriptors, ClientOptions, LROperation, PaginationCallback } from 'google-gax'; | ||
import { Transform } from 'stream'; | ||
import * as protosTypes from '../../protos/protos'; | ||
import * as protos from '../../protos/protos'; | ||
/** | ||
@@ -25,5 +25,2 @@ * Manages Products and ProductSets of reference images for use in product | ||
export declare class ProductSearchClient { | ||
private _descriptors; | ||
private _innerApiCalls; | ||
private _pathTemplates; | ||
private _terminated; | ||
@@ -36,2 +33,9 @@ private _opts; | ||
auth: gax.GoogleAuth; | ||
descriptors: Descriptors; | ||
innerApiCalls: { | ||
[name: string]: Function; | ||
}; | ||
pathTemplates: { | ||
[name: string]: gax.PathTemplate; | ||
}; | ||
operationsClient: gax.OperationsClient; | ||
@@ -101,35 +105,81 @@ productSearchStub?: Promise<{ | ||
getProjectId(callback: Callback<string, undefined, undefined>): void; | ||
createProductSet(request: protosTypes.google.cloud.vision.v1.ICreateProductSetRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1.IProductSet, protosTypes.google.cloud.vision.v1.ICreateProductSetRequest | undefined, {} | undefined]>; | ||
createProductSet(request: protosTypes.google.cloud.vision.v1.ICreateProductSetRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1.IProductSet, protosTypes.google.cloud.vision.v1.ICreateProductSetRequest | undefined, {} | undefined>): void; | ||
getProductSet(request: protosTypes.google.cloud.vision.v1.IGetProductSetRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1.IProductSet, protosTypes.google.cloud.vision.v1.IGetProductSetRequest | undefined, {} | undefined]>; | ||
getProductSet(request: protosTypes.google.cloud.vision.v1.IGetProductSetRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1.IProductSet, protosTypes.google.cloud.vision.v1.IGetProductSetRequest | undefined, {} | undefined>): void; | ||
updateProductSet(request: protosTypes.google.cloud.vision.v1.IUpdateProductSetRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1.IProductSet, protosTypes.google.cloud.vision.v1.IUpdateProductSetRequest | undefined, {} | undefined]>; | ||
updateProductSet(request: protosTypes.google.cloud.vision.v1.IUpdateProductSetRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1.IProductSet, protosTypes.google.cloud.vision.v1.IUpdateProductSetRequest | undefined, {} | undefined>): void; | ||
deleteProductSet(request: protosTypes.google.cloud.vision.v1.IDeleteProductSetRequest, options?: gax.CallOptions): Promise<[protosTypes.google.protobuf.IEmpty, protosTypes.google.cloud.vision.v1.IDeleteProductSetRequest | undefined, {} | undefined]>; | ||
deleteProductSet(request: protosTypes.google.cloud.vision.v1.IDeleteProductSetRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.protobuf.IEmpty, protosTypes.google.cloud.vision.v1.IDeleteProductSetRequest | undefined, {} | undefined>): void; | ||
createProduct(request: protosTypes.google.cloud.vision.v1.ICreateProductRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1.IProduct, protosTypes.google.cloud.vision.v1.ICreateProductRequest | undefined, {} | undefined]>; | ||
createProduct(request: protosTypes.google.cloud.vision.v1.ICreateProductRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1.IProduct, protosTypes.google.cloud.vision.v1.ICreateProductRequest | undefined, {} | undefined>): void; | ||
getProduct(request: protosTypes.google.cloud.vision.v1.IGetProductRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1.IProduct, protosTypes.google.cloud.vision.v1.IGetProductRequest | undefined, {} | undefined]>; | ||
getProduct(request: protosTypes.google.cloud.vision.v1.IGetProductRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1.IProduct, protosTypes.google.cloud.vision.v1.IGetProductRequest | undefined, {} | undefined>): void; | ||
updateProduct(request: protosTypes.google.cloud.vision.v1.IUpdateProductRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1.IProduct, protosTypes.google.cloud.vision.v1.IUpdateProductRequest | undefined, {} | undefined]>; | ||
updateProduct(request: protosTypes.google.cloud.vision.v1.IUpdateProductRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1.IProduct, protosTypes.google.cloud.vision.v1.IUpdateProductRequest | undefined, {} | undefined>): void; | ||
deleteProduct(request: protosTypes.google.cloud.vision.v1.IDeleteProductRequest, options?: gax.CallOptions): Promise<[protosTypes.google.protobuf.IEmpty, protosTypes.google.cloud.vision.v1.IDeleteProductRequest | undefined, {} | undefined]>; | ||
deleteProduct(request: protosTypes.google.cloud.vision.v1.IDeleteProductRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.protobuf.IEmpty, protosTypes.google.cloud.vision.v1.IDeleteProductRequest | undefined, {} | undefined>): void; | ||
createReferenceImage(request: protosTypes.google.cloud.vision.v1.ICreateReferenceImageRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1.IReferenceImage, (protosTypes.google.cloud.vision.v1.ICreateReferenceImageRequest | undefined), {} | undefined]>; | ||
createReferenceImage(request: protosTypes.google.cloud.vision.v1.ICreateReferenceImageRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1.IReferenceImage, protosTypes.google.cloud.vision.v1.ICreateReferenceImageRequest | undefined, {} | undefined>): void; | ||
deleteReferenceImage(request: protosTypes.google.cloud.vision.v1.IDeleteReferenceImageRequest, options?: gax.CallOptions): Promise<[protosTypes.google.protobuf.IEmpty, (protosTypes.google.cloud.vision.v1.IDeleteReferenceImageRequest | undefined), {} | undefined]>; | ||
deleteReferenceImage(request: protosTypes.google.cloud.vision.v1.IDeleteReferenceImageRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.protobuf.IEmpty, protosTypes.google.cloud.vision.v1.IDeleteReferenceImageRequest | undefined, {} | undefined>): void; | ||
getReferenceImage(request: protosTypes.google.cloud.vision.v1.IGetReferenceImageRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1.IReferenceImage, protosTypes.google.cloud.vision.v1.IGetReferenceImageRequest | undefined, {} | undefined]>; | ||
getReferenceImage(request: protosTypes.google.cloud.vision.v1.IGetReferenceImageRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1.IReferenceImage, protosTypes.google.cloud.vision.v1.IGetReferenceImageRequest | undefined, {} | undefined>): void; | ||
addProductToProductSet(request: protosTypes.google.cloud.vision.v1.IAddProductToProductSetRequest, options?: gax.CallOptions): Promise<[protosTypes.google.protobuf.IEmpty, (protosTypes.google.cloud.vision.v1.IAddProductToProductSetRequest | undefined), {} | undefined]>; | ||
addProductToProductSet(request: protosTypes.google.cloud.vision.v1.IAddProductToProductSetRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.protobuf.IEmpty, protosTypes.google.cloud.vision.v1.IAddProductToProductSetRequest | undefined, {} | undefined>): void; | ||
removeProductFromProductSet(request: protosTypes.google.cloud.vision.v1.IRemoveProductFromProductSetRequest, options?: gax.CallOptions): Promise<[protosTypes.google.protobuf.IEmpty, (protosTypes.google.cloud.vision.v1.IRemoveProductFromProductSetRequest | undefined), {} | undefined]>; | ||
removeProductFromProductSet(request: protosTypes.google.cloud.vision.v1.IRemoveProductFromProductSetRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.protobuf.IEmpty, protosTypes.google.cloud.vision.v1.IRemoveProductFromProductSetRequest | undefined, {} | undefined>): void; | ||
importProductSets(request: protosTypes.google.cloud.vision.v1.IImportProductSetsRequest, options?: gax.CallOptions): Promise<[LROperation<protosTypes.google.cloud.vision.v1.IImportProductSetsResponse, protosTypes.google.cloud.vision.v1.IBatchOperationMetadata>, protosTypes.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
importProductSets(request: protosTypes.google.cloud.vision.v1.IImportProductSetsRequest, options: gax.CallOptions, callback: Callback<LROperation<protosTypes.google.cloud.vision.v1.IImportProductSetsResponse, protosTypes.google.cloud.vision.v1.IBatchOperationMetadata>, protosTypes.google.longrunning.IOperation | undefined, {} | undefined>): void; | ||
purgeProducts(request: protosTypes.google.cloud.vision.v1.IPurgeProductsRequest, options?: gax.CallOptions): Promise<[LROperation<protosTypes.google.protobuf.IEmpty, protosTypes.google.cloud.vision.v1.IBatchOperationMetadata>, protosTypes.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
purgeProducts(request: protosTypes.google.cloud.vision.v1.IPurgeProductsRequest, options: gax.CallOptions, callback: Callback<LROperation<protosTypes.google.protobuf.IEmpty, protosTypes.google.cloud.vision.v1.IBatchOperationMetadata>, protosTypes.google.longrunning.IOperation | undefined, {} | undefined>): void; | ||
listProductSets(request: protosTypes.google.cloud.vision.v1.IListProductSetsRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1.IProductSet[], protosTypes.google.cloud.vision.v1.IListProductSetsRequest | null, protosTypes.google.cloud.vision.v1.IListProductSetsResponse]>; | ||
listProductSets(request: protosTypes.google.cloud.vision.v1.IListProductSetsRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1.IProductSet[], protosTypes.google.cloud.vision.v1.IListProductSetsRequest | null, protosTypes.google.cloud.vision.v1.IListProductSetsResponse>): void; | ||
createProductSet(request: protos.google.cloud.vision.v1.ICreateProductSetRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1.IProductSet, protos.google.cloud.vision.v1.ICreateProductSetRequest | undefined, {} | undefined]>; | ||
createProductSet(request: protos.google.cloud.vision.v1.ICreateProductSetRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1.IProductSet, protos.google.cloud.vision.v1.ICreateProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
createProductSet(request: protos.google.cloud.vision.v1.ICreateProductSetRequest, callback: Callback<protos.google.cloud.vision.v1.IProductSet, protos.google.cloud.vision.v1.ICreateProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
getProductSet(request: protos.google.cloud.vision.v1.IGetProductSetRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1.IProductSet, protos.google.cloud.vision.v1.IGetProductSetRequest | undefined, {} | undefined]>; | ||
getProductSet(request: protos.google.cloud.vision.v1.IGetProductSetRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1.IProductSet, protos.google.cloud.vision.v1.IGetProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
getProductSet(request: protos.google.cloud.vision.v1.IGetProductSetRequest, callback: Callback<protos.google.cloud.vision.v1.IProductSet, protos.google.cloud.vision.v1.IGetProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
updateProductSet(request: protos.google.cloud.vision.v1.IUpdateProductSetRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1.IProductSet, protos.google.cloud.vision.v1.IUpdateProductSetRequest | undefined, {} | undefined]>; | ||
updateProductSet(request: protos.google.cloud.vision.v1.IUpdateProductSetRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1.IProductSet, protos.google.cloud.vision.v1.IUpdateProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
updateProductSet(request: protos.google.cloud.vision.v1.IUpdateProductSetRequest, callback: Callback<protos.google.cloud.vision.v1.IProductSet, protos.google.cloud.vision.v1.IUpdateProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
deleteProductSet(request: protos.google.cloud.vision.v1.IDeleteProductSetRequest, options?: gax.CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1.IDeleteProductSetRequest | undefined, {} | undefined]>; | ||
deleteProductSet(request: protos.google.cloud.vision.v1.IDeleteProductSetRequest, options: gax.CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1.IDeleteProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
deleteProductSet(request: protos.google.cloud.vision.v1.IDeleteProductSetRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1.IDeleteProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
createProduct(request: protos.google.cloud.vision.v1.ICreateProductRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1.IProduct, protos.google.cloud.vision.v1.ICreateProductRequest | undefined, {} | undefined]>; | ||
createProduct(request: protos.google.cloud.vision.v1.ICreateProductRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1.IProduct, protos.google.cloud.vision.v1.ICreateProductRequest | null | undefined, {} | null | undefined>): void; | ||
createProduct(request: protos.google.cloud.vision.v1.ICreateProductRequest, callback: Callback<protos.google.cloud.vision.v1.IProduct, protos.google.cloud.vision.v1.ICreateProductRequest | null | undefined, {} | null | undefined>): void; | ||
getProduct(request: protos.google.cloud.vision.v1.IGetProductRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1.IProduct, protos.google.cloud.vision.v1.IGetProductRequest | undefined, {} | undefined]>; | ||
getProduct(request: protos.google.cloud.vision.v1.IGetProductRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1.IProduct, protos.google.cloud.vision.v1.IGetProductRequest | null | undefined, {} | null | undefined>): void; | ||
getProduct(request: protos.google.cloud.vision.v1.IGetProductRequest, callback: Callback<protos.google.cloud.vision.v1.IProduct, protos.google.cloud.vision.v1.IGetProductRequest | null | undefined, {} | null | undefined>): void; | ||
updateProduct(request: protos.google.cloud.vision.v1.IUpdateProductRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1.IProduct, protos.google.cloud.vision.v1.IUpdateProductRequest | undefined, {} | undefined]>; | ||
updateProduct(request: protos.google.cloud.vision.v1.IUpdateProductRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1.IProduct, protos.google.cloud.vision.v1.IUpdateProductRequest | null | undefined, {} | null | undefined>): void; | ||
updateProduct(request: protos.google.cloud.vision.v1.IUpdateProductRequest, callback: Callback<protos.google.cloud.vision.v1.IProduct, protos.google.cloud.vision.v1.IUpdateProductRequest | null | undefined, {} | null | undefined>): void; | ||
deleteProduct(request: protos.google.cloud.vision.v1.IDeleteProductRequest, options?: gax.CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1.IDeleteProductRequest | undefined, {} | undefined]>; | ||
deleteProduct(request: protos.google.cloud.vision.v1.IDeleteProductRequest, options: gax.CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1.IDeleteProductRequest | null | undefined, {} | null | undefined>): void; | ||
deleteProduct(request: protos.google.cloud.vision.v1.IDeleteProductRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1.IDeleteProductRequest | null | undefined, {} | null | undefined>): void; | ||
createReferenceImage(request: protos.google.cloud.vision.v1.ICreateReferenceImageRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1.IReferenceImage, protos.google.cloud.vision.v1.ICreateReferenceImageRequest | undefined, {} | undefined]>; | ||
createReferenceImage(request: protos.google.cloud.vision.v1.ICreateReferenceImageRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1.IReferenceImage, protos.google.cloud.vision.v1.ICreateReferenceImageRequest | null | undefined, {} | null | undefined>): void; | ||
createReferenceImage(request: protos.google.cloud.vision.v1.ICreateReferenceImageRequest, callback: Callback<protos.google.cloud.vision.v1.IReferenceImage, protos.google.cloud.vision.v1.ICreateReferenceImageRequest | null | undefined, {} | null | undefined>): void; | ||
deleteReferenceImage(request: protos.google.cloud.vision.v1.IDeleteReferenceImageRequest, options?: gax.CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1.IDeleteReferenceImageRequest | undefined, {} | undefined]>; | ||
deleteReferenceImage(request: protos.google.cloud.vision.v1.IDeleteReferenceImageRequest, options: gax.CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1.IDeleteReferenceImageRequest | null | undefined, {} | null | undefined>): void; | ||
deleteReferenceImage(request: protos.google.cloud.vision.v1.IDeleteReferenceImageRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1.IDeleteReferenceImageRequest | null | undefined, {} | null | undefined>): void; | ||
getReferenceImage(request: protos.google.cloud.vision.v1.IGetReferenceImageRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1.IReferenceImage, protos.google.cloud.vision.v1.IGetReferenceImageRequest | undefined, {} | undefined]>; | ||
getReferenceImage(request: protos.google.cloud.vision.v1.IGetReferenceImageRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1.IReferenceImage, protos.google.cloud.vision.v1.IGetReferenceImageRequest | null | undefined, {} | null | undefined>): void; | ||
getReferenceImage(request: protos.google.cloud.vision.v1.IGetReferenceImageRequest, callback: Callback<protos.google.cloud.vision.v1.IReferenceImage, protos.google.cloud.vision.v1.IGetReferenceImageRequest | null | undefined, {} | null | undefined>): void; | ||
addProductToProductSet(request: protos.google.cloud.vision.v1.IAddProductToProductSetRequest, options?: gax.CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1.IAddProductToProductSetRequest | undefined, {} | undefined]>; | ||
addProductToProductSet(request: protos.google.cloud.vision.v1.IAddProductToProductSetRequest, options: gax.CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1.IAddProductToProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
addProductToProductSet(request: protos.google.cloud.vision.v1.IAddProductToProductSetRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1.IAddProductToProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
removeProductFromProductSet(request: protos.google.cloud.vision.v1.IRemoveProductFromProductSetRequest, options?: gax.CallOptions): Promise<[protos.google.protobuf.IEmpty, (protos.google.cloud.vision.v1.IRemoveProductFromProductSetRequest | undefined), {} | undefined]>; | ||
removeProductFromProductSet(request: protos.google.cloud.vision.v1.IRemoveProductFromProductSetRequest, options: gax.CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1.IRemoveProductFromProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
removeProductFromProductSet(request: protos.google.cloud.vision.v1.IRemoveProductFromProductSetRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1.IRemoveProductFromProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
importProductSets(request: protos.google.cloud.vision.v1.IImportProductSetsRequest, options?: gax.CallOptions): Promise<[LROperation<protos.google.cloud.vision.v1.IImportProductSetsResponse, protos.google.cloud.vision.v1.IBatchOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
importProductSets(request: protos.google.cloud.vision.v1.IImportProductSetsRequest, options: gax.CallOptions, callback: Callback<LROperation<protos.google.cloud.vision.v1.IImportProductSetsResponse, protos.google.cloud.vision.v1.IBatchOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
importProductSets(request: protos.google.cloud.vision.v1.IImportProductSetsRequest, callback: Callback<LROperation<protos.google.cloud.vision.v1.IImportProductSetsResponse, protos.google.cloud.vision.v1.IBatchOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
/** | ||
* Check the status of the long running operation returned by the importProductSets() method. | ||
* @param {String} name | ||
* The operation name that will be passed. | ||
* @returns {Promise} - The promise which resolves to an object. | ||
* The decoded operation object has result and metadata field to get information from. | ||
* | ||
* @example: | ||
* const decodedOperation = await checkImportProductSetsProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
* | ||
*/ | ||
checkImportProductSetsProgress(name: string): Promise<LROperation<protos.google.cloud.vision.v1.ImportProductSetsResponse, protos.google.cloud.vision.v1.BatchOperationMetadata>>; | ||
purgeProducts(request: protos.google.cloud.vision.v1.IPurgeProductsRequest, options?: gax.CallOptions): Promise<[LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1.IBatchOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
purgeProducts(request: protos.google.cloud.vision.v1.IPurgeProductsRequest, options: gax.CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1.IBatchOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
purgeProducts(request: protos.google.cloud.vision.v1.IPurgeProductsRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1.IBatchOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
/** | ||
* Check the status of the long running operation returned by the purgeProducts() method. | ||
* @param {String} name | ||
* The operation name that will be passed. | ||
* @returns {Promise} - The promise which resolves to an object. | ||
* The decoded operation object has result and metadata field to get information from. | ||
* | ||
* @example: | ||
* const decodedOperation = await checkPurgeProductsProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
* | ||
*/ | ||
checkPurgeProductsProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.vision.v1.BatchOperationMetadata>>; | ||
listProductSets(request: protos.google.cloud.vision.v1.IListProductSetsRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1.IProductSet[], protos.google.cloud.vision.v1.IListProductSetsRequest | null, protos.google.cloud.vision.v1.IListProductSetsResponse]>; | ||
listProductSets(request: protos.google.cloud.vision.v1.IListProductSetsRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.cloud.vision.v1.IListProductSetsRequest, protos.google.cloud.vision.v1.IListProductSetsResponse | null | undefined, protos.google.cloud.vision.v1.IProductSet>): void; | ||
listProductSets(request: protos.google.cloud.vision.v1.IListProductSetsRequest, callback: PaginationCallback<protos.google.cloud.vision.v1.IListProductSetsRequest, protos.google.cloud.vision.v1.IListProductSetsResponse | null | undefined, protos.google.cloud.vision.v1.IProductSet>): void; | ||
/** | ||
* Equivalent to {@link listProductSets}, but returns a NodeJS Stream object. | ||
@@ -162,6 +212,28 @@ * | ||
*/ | ||
listProductSetsStream(request?: protosTypes.google.cloud.vision.v1.IListProductSetsRequest, options?: gax.CallOptions): Transform; | ||
listProducts(request: protosTypes.google.cloud.vision.v1.IListProductsRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1.IProduct[], protosTypes.google.cloud.vision.v1.IListProductsRequest | null, protosTypes.google.cloud.vision.v1.IListProductsResponse]>; | ||
listProducts(request: protosTypes.google.cloud.vision.v1.IListProductsRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1.IProduct[], protosTypes.google.cloud.vision.v1.IListProductsRequest | null, protosTypes.google.cloud.vision.v1.IListProductsResponse>): void; | ||
listProductSetsStream(request?: protos.google.cloud.vision.v1.IListProductSetsRequest, options?: gax.CallOptions): Transform; | ||
/** | ||
* Equivalent to {@link listProductSets}, but returns an iterable object. | ||
* | ||
* for-await-of syntax is used with the iterable to recursively get response element on-demand. | ||
* | ||
* @param {Object} request | ||
* The request object that will be sent. | ||
* @param {string} request.parent | ||
* Required. The project from which ProductSets should be listed. | ||
* | ||
* Format is `projects/PROJECT_ID/locations/LOC_ID`. | ||
* @param {number} request.pageSize | ||
* The maximum number of items to return. Default 10, maximum 100. | ||
* @param {string} request.pageToken | ||
* The next_page_token returned from a previous List request, if any. | ||
* @param {object} [options] | ||
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. | ||
* @returns {Object} | ||
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. | ||
*/ | ||
listProductSetsAsync(request?: protos.google.cloud.vision.v1.IListProductSetsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.cloud.vision.v1.IProductSet>; | ||
listProducts(request: protos.google.cloud.vision.v1.IListProductsRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1.IProduct[], protos.google.cloud.vision.v1.IListProductsRequest | null, protos.google.cloud.vision.v1.IListProductsResponse]>; | ||
listProducts(request: protos.google.cloud.vision.v1.IListProductsRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.cloud.vision.v1.IListProductsRequest, protos.google.cloud.vision.v1.IListProductsResponse | null | undefined, protos.google.cloud.vision.v1.IProduct>): void; | ||
listProducts(request: protos.google.cloud.vision.v1.IListProductsRequest, callback: PaginationCallback<protos.google.cloud.vision.v1.IListProductsRequest, protos.google.cloud.vision.v1.IListProductsResponse | null | undefined, protos.google.cloud.vision.v1.IProduct>): void; | ||
/** | ||
* Equivalent to {@link listProducts}, but returns a NodeJS Stream object. | ||
@@ -195,6 +267,29 @@ * | ||
*/ | ||
listProductsStream(request?: protosTypes.google.cloud.vision.v1.IListProductsRequest, options?: gax.CallOptions): Transform; | ||
listReferenceImages(request: protosTypes.google.cloud.vision.v1.IListReferenceImagesRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1.IReferenceImage[], protosTypes.google.cloud.vision.v1.IListReferenceImagesRequest | null, protosTypes.google.cloud.vision.v1.IListReferenceImagesResponse]>; | ||
listReferenceImages(request: protosTypes.google.cloud.vision.v1.IListReferenceImagesRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1.IReferenceImage[], protosTypes.google.cloud.vision.v1.IListReferenceImagesRequest | null, protosTypes.google.cloud.vision.v1.IListReferenceImagesResponse>): void; | ||
listProductsStream(request?: protos.google.cloud.vision.v1.IListProductsRequest, options?: gax.CallOptions): Transform; | ||
/** | ||
* Equivalent to {@link listProducts}, but returns an iterable object. | ||
* | ||
* for-await-of syntax is used with the iterable to recursively get response element on-demand. | ||
* | ||
* @param {Object} request | ||
* The request object that will be sent. | ||
* @param {string} request.parent | ||
* Required. The project OR ProductSet from which Products should be listed. | ||
* | ||
* Format: | ||
* `projects/PROJECT_ID/locations/LOC_ID` | ||
* @param {number} request.pageSize | ||
* The maximum number of items to return. Default 10, maximum 100. | ||
* @param {string} request.pageToken | ||
* The next_page_token returned from a previous List request, if any. | ||
* @param {object} [options] | ||
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. | ||
* @returns {Object} | ||
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. | ||
*/ | ||
listProductsAsync(request?: protos.google.cloud.vision.v1.IListProductsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.cloud.vision.v1.IProduct>; | ||
listReferenceImages(request: protos.google.cloud.vision.v1.IListReferenceImagesRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1.IReferenceImage[], protos.google.cloud.vision.v1.IListReferenceImagesRequest | null, protos.google.cloud.vision.v1.IListReferenceImagesResponse]>; | ||
listReferenceImages(request: protos.google.cloud.vision.v1.IListReferenceImagesRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.cloud.vision.v1.IListReferenceImagesRequest, protos.google.cloud.vision.v1.IListReferenceImagesResponse | null | undefined, protos.google.cloud.vision.v1.IReferenceImage>): void; | ||
listReferenceImages(request: protos.google.cloud.vision.v1.IListReferenceImagesRequest, callback: PaginationCallback<protos.google.cloud.vision.v1.IListReferenceImagesRequest, protos.google.cloud.vision.v1.IListReferenceImagesResponse | null | undefined, protos.google.cloud.vision.v1.IReferenceImage>): void; | ||
/** | ||
* Equivalent to {@link listReferenceImages}, but returns a NodeJS Stream object. | ||
@@ -231,6 +326,32 @@ * | ||
*/ | ||
listReferenceImagesStream(request?: protosTypes.google.cloud.vision.v1.IListReferenceImagesRequest, options?: gax.CallOptions): Transform; | ||
listProductsInProductSet(request: protosTypes.google.cloud.vision.v1.IListProductsInProductSetRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1.IProduct[], protosTypes.google.cloud.vision.v1.IListProductsInProductSetRequest | null, protosTypes.google.cloud.vision.v1.IListProductsInProductSetResponse]>; | ||
listProductsInProductSet(request: protosTypes.google.cloud.vision.v1.IListProductsInProductSetRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1.IProduct[], protosTypes.google.cloud.vision.v1.IListProductsInProductSetRequest | null, protosTypes.google.cloud.vision.v1.IListProductsInProductSetResponse>): void; | ||
listReferenceImagesStream(request?: protos.google.cloud.vision.v1.IListReferenceImagesRequest, options?: gax.CallOptions): Transform; | ||
/** | ||
* Equivalent to {@link listReferenceImages}, but returns an iterable object. | ||
* | ||
* for-await-of syntax is used with the iterable to recursively get response element on-demand. | ||
* | ||
* @param {Object} request | ||
* The request object that will be sent. | ||
* @param {string} request.parent | ||
* Required. Resource name of the product containing the reference images. | ||
* | ||
* Format is | ||
* `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. | ||
* @param {number} request.pageSize | ||
* The maximum number of items to return. Default 10, maximum 100. | ||
* @param {string} request.pageToken | ||
* A token identifying a page of results to be returned. This is the value | ||
* of `nextPageToken` returned in a previous reference image list request. | ||
* | ||
* Defaults to the first page if not specified. | ||
* @param {object} [options] | ||
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. | ||
* @returns {Object} | ||
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. | ||
*/ | ||
listReferenceImagesAsync(request?: protos.google.cloud.vision.v1.IListReferenceImagesRequest, options?: gax.CallOptions): AsyncIterable<protos.google.cloud.vision.v1.IReferenceImage>; | ||
listProductsInProductSet(request: protos.google.cloud.vision.v1.IListProductsInProductSetRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1.IProduct[], protos.google.cloud.vision.v1.IListProductsInProductSetRequest | null, protos.google.cloud.vision.v1.IListProductsInProductSetResponse]>; | ||
listProductsInProductSet(request: protos.google.cloud.vision.v1.IListProductsInProductSetRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.cloud.vision.v1.IListProductsInProductSetRequest, protos.google.cloud.vision.v1.IListProductsInProductSetResponse | null | undefined, protos.google.cloud.vision.v1.IProduct>): void; | ||
listProductsInProductSet(request: protos.google.cloud.vision.v1.IListProductsInProductSetRequest, callback: PaginationCallback<protos.google.cloud.vision.v1.IListProductsInProductSetRequest, protos.google.cloud.vision.v1.IListProductsInProductSetResponse | null | undefined, protos.google.cloud.vision.v1.IProduct>): void; | ||
/** | ||
* Equivalent to {@link listProductsInProductSet}, but returns a NodeJS Stream object. | ||
@@ -264,4 +385,26 @@ * | ||
*/ | ||
listProductsInProductSetStream(request?: protosTypes.google.cloud.vision.v1.IListProductsInProductSetRequest, options?: gax.CallOptions): Transform; | ||
listProductsInProductSetStream(request?: protos.google.cloud.vision.v1.IListProductsInProductSetRequest, options?: gax.CallOptions): Transform; | ||
/** | ||
* Equivalent to {@link listProductsInProductSet}, but returns an iterable object. | ||
* | ||
* for-await-of syntax is used with the iterable to recursively get response element on-demand. | ||
* | ||
* @param {Object} request | ||
* The request object that will be sent. | ||
* @param {string} request.name | ||
* Required. The ProductSet resource for which to retrieve Products. | ||
* | ||
* Format is: | ||
* `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` | ||
* @param {number} request.pageSize | ||
* The maximum number of items to return. Default 10, maximum 100. | ||
* @param {string} request.pageToken | ||
* The next_page_token returned from a previous List request, if any. | ||
* @param {object} [options] | ||
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. | ||
* @returns {Object} | ||
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. | ||
*/ | ||
listProductsInProductSetAsync(request?: protos.google.cloud.vision.v1.IListProductsInProductSetRequest, options?: gax.CallOptions): AsyncIterable<protos.google.cloud.vision.v1.IProduct>; | ||
/** | ||
* Return a fully-qualified location resource name string. | ||
@@ -281,3 +424,3 @@ * | ||
*/ | ||
matchProjectFromLocationName(locationName: string): string; | ||
matchProjectFromLocationName(locationName: string): string | number; | ||
/** | ||
@@ -290,3 +433,3 @@ * Parse the location from Location resource. | ||
*/ | ||
matchLocationFromLocationName(locationName: string): string; | ||
matchLocationFromLocationName(locationName: string): string | number; | ||
/** | ||
@@ -308,3 +451,3 @@ * Return a fully-qualified product resource name string. | ||
*/ | ||
matchProjectFromProductName(productName: string): string; | ||
matchProjectFromProductName(productName: string): string | number; | ||
/** | ||
@@ -317,3 +460,3 @@ * Parse the location from Product resource. | ||
*/ | ||
matchLocationFromProductName(productName: string): string; | ||
matchLocationFromProductName(productName: string): string | number; | ||
/** | ||
@@ -326,3 +469,3 @@ * Parse the product from Product resource. | ||
*/ | ||
matchProductFromProductName(productName: string): string; | ||
matchProductFromProductName(productName: string): string | number; | ||
/** | ||
@@ -344,3 +487,3 @@ * Return a fully-qualified productSet resource name string. | ||
*/ | ||
matchProjectFromProductSetName(productSetName: string): string; | ||
matchProjectFromProductSetName(productSetName: string): string | number; | ||
/** | ||
@@ -353,3 +496,3 @@ * Parse the location from ProductSet resource. | ||
*/ | ||
matchLocationFromProductSetName(productSetName: string): string; | ||
matchLocationFromProductSetName(productSetName: string): string | number; | ||
/** | ||
@@ -362,3 +505,3 @@ * Parse the product_set from ProductSet resource. | ||
*/ | ||
matchProductSetFromProductSetName(productSetName: string): string; | ||
matchProductSetFromProductSetName(productSetName: string): string | number; | ||
/** | ||
@@ -381,3 +524,3 @@ * Return a fully-qualified referenceImage resource name string. | ||
*/ | ||
matchProjectFromReferenceImageName(referenceImageName: string): string; | ||
matchProjectFromReferenceImageName(referenceImageName: string): string | number; | ||
/** | ||
@@ -390,3 +533,3 @@ * Parse the location from ReferenceImage resource. | ||
*/ | ||
matchLocationFromReferenceImageName(referenceImageName: string): string; | ||
matchLocationFromReferenceImageName(referenceImageName: string): string | number; | ||
/** | ||
@@ -399,3 +542,3 @@ * Parse the product from ReferenceImage resource. | ||
*/ | ||
matchProductFromReferenceImageName(referenceImageName: string): string; | ||
matchProductFromReferenceImageName(referenceImageName: string): string | number; | ||
/** | ||
@@ -408,3 +551,3 @@ * Parse the reference_image from ReferenceImage resource. | ||
*/ | ||
matchReferenceImageFromReferenceImageName(referenceImageName: string): string; | ||
matchReferenceImageFromReferenceImageName(referenceImageName: string): string | number; | ||
/** | ||
@@ -411,0 +554,0 @@ * Terminate the GRPC channel and close the client. |
import * as gax from 'google-gax'; | ||
import { Callback, ClientOptions } from 'google-gax'; | ||
import * as protosTypes from '../../protos/protos'; | ||
import { Callback, Descriptors, ClientOptions } from 'google-gax'; | ||
import * as protos from '../../protos/protos'; | ||
/** | ||
@@ -12,4 +12,2 @@ * Service that performs Google Cloud Vision API detection tasks over client | ||
export declare class ImageAnnotatorClient { | ||
private _descriptors; | ||
private _innerApiCalls; | ||
private _terminated; | ||
@@ -22,2 +20,6 @@ private _opts; | ||
auth: gax.GoogleAuth; | ||
descriptors: Descriptors; | ||
innerApiCalls: { | ||
[name: string]: Function; | ||
}; | ||
imageAnnotatorStub?: Promise<{ | ||
@@ -86,4 +88,5 @@ [name: string]: Function; | ||
getProjectId(callback: Callback<string, undefined, undefined>): void; | ||
batchAnnotateImages(request: protosTypes.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesResponse, (protosTypes.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest | undefined), {} | undefined]>; | ||
batchAnnotateImages(request: protosTypes.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesResponse, protosTypes.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest | undefined, {} | undefined>): void; | ||
batchAnnotateImages(request: protos.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesResponse, (protos.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest | undefined), {} | undefined]>; | ||
batchAnnotateImages(request: protos.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesResponse, protos.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest | null | undefined, {} | null | undefined>): void; | ||
batchAnnotateImages(request: protos.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest, callback: Callback<protos.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesResponse, protos.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest | null | undefined, {} | null | undefined>): void; | ||
/** | ||
@@ -90,0 +93,0 @@ * Terminate the GRPC channel and close the client. |
"use strict"; | ||
// Copyright 2019 Google LLC | ||
// Copyright 2020 Google LLC | ||
// | ||
@@ -20,2 +20,3 @@ // Licensed under the Apache License, Version 2.0 (the "License"); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ImageAnnotatorClient = void 0; | ||
const gax = require("google-gax"); | ||
@@ -59,4 +60,9 @@ const path = require("path"); | ||
constructor(opts) { | ||
this._descriptors = { page: {}, stream: {}, longrunning: {} }; | ||
this._terminated = false; | ||
this.descriptors = { | ||
page: {}, | ||
stream: {}, | ||
longrunning: {}, | ||
batching: {}, | ||
}; | ||
// Ensure that options include the service address and port. | ||
@@ -110,3 +116,6 @@ const staticMembers = this.constructor; | ||
const nodejsProtoPath = path.join(__dirname, '..', '..', 'protos', 'protos.json'); | ||
this._protos = this._gaxGrpc.loadProto(opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath); | ||
this._protos = this._gaxGrpc.loadProto(opts.fallback | ||
? // eslint-disable-next-line @typescript-eslint/no-var-requires | ||
require('../../protos/protos.json') | ||
: nodejsProtoPath); | ||
// Put together the default options sent with requests. | ||
@@ -117,3 +126,3 @@ this._defaults = this._gaxGrpc.constructSettings('google.cloud.vision.v1p1beta1.ImageAnnotator', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') }); | ||
// merely providing the destination and request information. | ||
this._innerApiCalls = {}; | ||
this.innerApiCalls = {}; | ||
} | ||
@@ -140,3 +149,3 @@ /** | ||
? this._protos.lookupService('google.cloud.vision.v1p1beta1.ImageAnnotator') | ||
: // tslint:disable-next-line no-any | ||
: // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
this._protos.google.cloud.vision.v1p1beta1.ImageAnnotator, this._opts); | ||
@@ -147,16 +156,15 @@ // Iterate over each of the methods that the service provides | ||
for (const methodName of imageAnnotatorStubMethods) { | ||
const innerCallPromise = this.imageAnnotatorStub.then(stub => (...args) => { | ||
const callPromise = this.imageAnnotatorStub.then(stub => (...args) => { | ||
if (this._terminated) { | ||
return Promise.reject('The client has already been closed.'); | ||
} | ||
return stub[methodName].apply(stub, args); | ||
const func = stub[methodName]; | ||
return func.apply(stub, args); | ||
}, (err) => () => { | ||
throw err; | ||
}); | ||
const apiCall = this._gaxModule.createApiCall(innerCallPromise, this._defaults[methodName], this._descriptors.page[methodName] || | ||
this._descriptors.stream[methodName] || | ||
this._descriptors.longrunning[methodName]); | ||
this._innerApiCalls[methodName] = (argument, callOptions, callback) => { | ||
return apiCall(argument, callOptions, callback); | ||
}; | ||
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], this.descriptors.page[methodName] || | ||
this.descriptors.stream[methodName] || | ||
this.descriptors.longrunning[methodName]); | ||
this.innerApiCalls[methodName] = apiCall; | ||
} | ||
@@ -231,3 +239,3 @@ return this.imageAnnotatorStub; | ||
this.initialize(); | ||
return this._innerApiCalls.batchAnnotateImages(request, options, callback); | ||
return this.innerApiCalls.batchAnnotateImages(request, options, callback); | ||
} | ||
@@ -234,0 +242,0 @@ /** |
"use strict"; | ||
// Copyright 2019 Google LLC | ||
// Copyright 2020 Google LLC | ||
// | ||
@@ -21,3 +21,3 @@ // Licensed under the Apache License, Version 2.0 (the "License"); | ||
var image_annotator_client_1 = require("./image_annotator_client"); | ||
exports.ImageAnnotatorClient = image_annotator_client_1.ImageAnnotatorClient; | ||
Object.defineProperty(exports, "ImageAnnotatorClient", { enumerable: true, get: function () { return image_annotator_client_1.ImageAnnotatorClient; } }); | ||
//# sourceMappingURL=index.js.map |
import * as gax from 'google-gax'; | ||
import { Callback, ClientOptions, LROperation } from 'google-gax'; | ||
import * as protosTypes from '../../protos/protos'; | ||
import { Callback, Descriptors, ClientOptions, LROperation } from 'google-gax'; | ||
import * as protos from '../../protos/protos'; | ||
/** | ||
@@ -12,4 +12,2 @@ * Service that performs Google Cloud Vision API detection tasks over client | ||
export declare class ImageAnnotatorClient { | ||
private _descriptors; | ||
private _innerApiCalls; | ||
private _terminated; | ||
@@ -22,2 +20,6 @@ private _opts; | ||
auth: gax.GoogleAuth; | ||
descriptors: Descriptors; | ||
innerApiCalls: { | ||
[name: string]: Function; | ||
}; | ||
operationsClient: gax.OperationsClient; | ||
@@ -87,7 +89,24 @@ imageAnnotatorStub?: Promise<{ | ||
getProjectId(callback: Callback<string, undefined, undefined>): void; | ||
batchAnnotateImages(request: protosTypes.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesResponse, (protosTypes.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest | undefined), {} | undefined]>; | ||
batchAnnotateImages(request: protosTypes.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesResponse, protosTypes.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest | undefined, {} | undefined>): void; | ||
asyncBatchAnnotateFiles(request: protosTypes.google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesRequest, options?: gax.CallOptions): Promise<[LROperation<protosTypes.google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesResponse, protosTypes.google.cloud.vision.v1p2beta1.IOperationMetadata>, protosTypes.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
asyncBatchAnnotateFiles(request: protosTypes.google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesRequest, options: gax.CallOptions, callback: Callback<LROperation<protosTypes.google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesResponse, protosTypes.google.cloud.vision.v1p2beta1.IOperationMetadata>, protosTypes.google.longrunning.IOperation | undefined, {} | undefined>): void; | ||
batchAnnotateImages(request: protos.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesResponse, (protos.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest | undefined), {} | undefined]>; | ||
batchAnnotateImages(request: protos.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesResponse, protos.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest | null | undefined, {} | null | undefined>): void; | ||
batchAnnotateImages(request: protos.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest, callback: Callback<protos.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesResponse, protos.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest | null | undefined, {} | null | undefined>): void; | ||
asyncBatchAnnotateFiles(request: protos.google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesRequest, options?: gax.CallOptions): Promise<[LROperation<protos.google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p2beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
asyncBatchAnnotateFiles(request: protos.google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesRequest, options: gax.CallOptions, callback: Callback<LROperation<protos.google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p2beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
asyncBatchAnnotateFiles(request: protos.google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesRequest, callback: Callback<LROperation<protos.google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p2beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
/** | ||
* Check the status of the long running operation returned by the asyncBatchAnnotateFiles() method. | ||
* @param {String} name | ||
* The operation name that will be passed. | ||
* @returns {Promise} - The promise which resolves to an object. | ||
* The decoded operation object has result and metadata field to get information from. | ||
* | ||
* @example: | ||
* const decodedOperation = await checkAsyncBatchAnnotateFilesProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
* | ||
*/ | ||
checkAsyncBatchAnnotateFilesProgress(name: string): Promise<LROperation<protos.google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p2beta1.OperationMetadata>>; | ||
/** | ||
* Terminate the GRPC channel and close the client. | ||
@@ -94,0 +113,0 @@ * |
"use strict"; | ||
// Copyright 2019 Google LLC | ||
// Copyright 2020 Google LLC | ||
// | ||
@@ -20,5 +20,7 @@ // Licensed under the Apache License, Version 2.0 (the "License"); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ImageAnnotatorClient = void 0; | ||
const gax = require("google-gax"); | ||
const path = require("path"); | ||
const gapicConfig = require("./image_annotator_client_config.json"); | ||
const google_gax_1 = require("google-gax"); | ||
const version = require('../../../package.json').version; | ||
@@ -59,4 +61,9 @@ /** | ||
constructor(opts) { | ||
this._descriptors = { page: {}, stream: {}, longrunning: {} }; | ||
this._terminated = false; | ||
this.descriptors = { | ||
page: {}, | ||
stream: {}, | ||
longrunning: {}, | ||
batching: {}, | ||
}; | ||
// Ensure that options include the service address and port. | ||
@@ -110,3 +117,6 @@ const staticMembers = this.constructor; | ||
const nodejsProtoPath = path.join(__dirname, '..', '..', 'protos', 'protos.json'); | ||
this._protos = this._gaxGrpc.loadProto(opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath); | ||
this._protos = this._gaxGrpc.loadProto(opts.fallback | ||
? // eslint-disable-next-line @typescript-eslint/no-var-requires | ||
require('../../protos/protos.json') | ||
: nodejsProtoPath); | ||
// This API contains "long-running operations", which return a | ||
@@ -116,3 +126,5 @@ // an Operation object that allows for tracking of the operation, | ||
const protoFilesRoot = opts.fallback | ||
? this._gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) | ||
? this._gaxModule.protobuf.Root.fromJSON( | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
require('../../protos/protos.json')) | ||
: this._gaxModule.protobuf.loadSync(nodejsProtoPath); | ||
@@ -127,3 +139,3 @@ this.operationsClient = this._gaxModule | ||
const asyncBatchAnnotateFilesMetadata = protoFilesRoot.lookup('.google.cloud.vision.v1p2beta1.OperationMetadata'); | ||
this._descriptors.longrunning = { | ||
this.descriptors.longrunning = { | ||
asyncBatchAnnotateFiles: new this._gaxModule.LongrunningDescriptor(this.operationsClient, asyncBatchAnnotateFilesResponse.decode.bind(asyncBatchAnnotateFilesResponse), asyncBatchAnnotateFilesMetadata.decode.bind(asyncBatchAnnotateFilesMetadata)), | ||
@@ -136,3 +148,3 @@ }; | ||
// merely providing the destination and request information. | ||
this._innerApiCalls = {}; | ||
this.innerApiCalls = {}; | ||
} | ||
@@ -159,3 +171,3 @@ /** | ||
? this._protos.lookupService('google.cloud.vision.v1p2beta1.ImageAnnotator') | ||
: // tslint:disable-next-line no-any | ||
: // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
this._protos.google.cloud.vision.v1p2beta1.ImageAnnotator, this._opts); | ||
@@ -169,16 +181,15 @@ // Iterate over each of the methods that the service provides | ||
for (const methodName of imageAnnotatorStubMethods) { | ||
const innerCallPromise = this.imageAnnotatorStub.then(stub => (...args) => { | ||
const callPromise = this.imageAnnotatorStub.then(stub => (...args) => { | ||
if (this._terminated) { | ||
return Promise.reject('The client has already been closed.'); | ||
} | ||
return stub[methodName].apply(stub, args); | ||
const func = stub[methodName]; | ||
return func.apply(stub, args); | ||
}, (err) => () => { | ||
throw err; | ||
}); | ||
const apiCall = this._gaxModule.createApiCall(innerCallPromise, this._defaults[methodName], this._descriptors.page[methodName] || | ||
this._descriptors.stream[methodName] || | ||
this._descriptors.longrunning[methodName]); | ||
this._innerApiCalls[methodName] = (argument, callOptions, callback) => { | ||
return apiCall(argument, callOptions, callback); | ||
}; | ||
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], this.descriptors.page[methodName] || | ||
this.descriptors.stream[methodName] || | ||
this.descriptors.longrunning[methodName]); | ||
this.innerApiCalls[methodName] = apiCall; | ||
} | ||
@@ -253,3 +264,3 @@ return this.imageAnnotatorStub; | ||
this.initialize(); | ||
return this._innerApiCalls.batchAnnotateImages(request, options, callback); | ||
return this.innerApiCalls.batchAnnotateImages(request, options, callback); | ||
} | ||
@@ -286,5 +297,25 @@ /** | ||
this.initialize(); | ||
return this._innerApiCalls.asyncBatchAnnotateFiles(request, options, callback); | ||
return this.innerApiCalls.asyncBatchAnnotateFiles(request, options, callback); | ||
} | ||
/** | ||
* Check the status of the long running operation returned by the asyncBatchAnnotateFiles() method. | ||
* @param {String} name | ||
* The operation name that will be passed. | ||
* @returns {Promise} - The promise which resolves to an object. | ||
* The decoded operation object has result and metadata field to get information from. | ||
* | ||
* @example: | ||
* const decodedOperation = await checkAsyncBatchAnnotateFilesProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
* | ||
*/ | ||
async checkAsyncBatchAnnotateFilesProgress(name) { | ||
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name }); | ||
const [operation] = await this.operationsClient.getOperation(request); | ||
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.asyncBatchAnnotateFiles, gax.createDefaultBackoffSettings()); | ||
return decodeOperation; | ||
} | ||
/** | ||
* Terminate the GRPC channel and close the client. | ||
@@ -291,0 +322,0 @@ * |
"use strict"; | ||
// Copyright 2019 Google LLC | ||
// Copyright 2020 Google LLC | ||
// | ||
@@ -21,3 +21,3 @@ // Licensed under the Apache License, Version 2.0 (the "License"); | ||
var image_annotator_client_1 = require("./image_annotator_client"); | ||
exports.ImageAnnotatorClient = image_annotator_client_1.ImageAnnotatorClient; | ||
Object.defineProperty(exports, "ImageAnnotatorClient", { enumerable: true, get: function () { return image_annotator_client_1.ImageAnnotatorClient; } }); | ||
//# sourceMappingURL=index.js.map |
import * as gax from 'google-gax'; | ||
import { Callback, ClientOptions, LROperation } from 'google-gax'; | ||
import * as protosTypes from '../../protos/protos'; | ||
import { Callback, Descriptors, ClientOptions, LROperation } from 'google-gax'; | ||
import * as protos from '../../protos/protos'; | ||
/** | ||
@@ -12,5 +12,2 @@ * Service that performs Google Cloud Vision API detection tasks over client | ||
export declare class ImageAnnotatorClient { | ||
private _descriptors; | ||
private _innerApiCalls; | ||
private _pathTemplates; | ||
private _terminated; | ||
@@ -23,2 +20,9 @@ private _opts; | ||
auth: gax.GoogleAuth; | ||
descriptors: Descriptors; | ||
innerApiCalls: { | ||
[name: string]: Function; | ||
}; | ||
pathTemplates: { | ||
[name: string]: gax.PathTemplate; | ||
}; | ||
operationsClient: gax.OperationsClient; | ||
@@ -88,7 +92,24 @@ imageAnnotatorStub?: Promise<{ | ||
getProjectId(callback: Callback<string, undefined, undefined>): void; | ||
batchAnnotateImages(request: protosTypes.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesResponse, (protosTypes.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest | undefined), {} | undefined]>; | ||
batchAnnotateImages(request: protosTypes.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesResponse, protosTypes.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest | undefined, {} | undefined>): void; | ||
asyncBatchAnnotateFiles(request: protosTypes.google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesRequest, options?: gax.CallOptions): Promise<[LROperation<protosTypes.google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesResponse, protosTypes.google.cloud.vision.v1p3beta1.IOperationMetadata>, protosTypes.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
asyncBatchAnnotateFiles(request: protosTypes.google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesRequest, options: gax.CallOptions, callback: Callback<LROperation<protosTypes.google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesResponse, protosTypes.google.cloud.vision.v1p3beta1.IOperationMetadata>, protosTypes.google.longrunning.IOperation | undefined, {} | undefined>): void; | ||
batchAnnotateImages(request: protos.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesResponse, (protos.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest | undefined), {} | undefined]>; | ||
batchAnnotateImages(request: protos.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesResponse, protos.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest | null | undefined, {} | null | undefined>): void; | ||
batchAnnotateImages(request: protos.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest, callback: Callback<protos.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesResponse, protos.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest | null | undefined, {} | null | undefined>): void; | ||
asyncBatchAnnotateFiles(request: protos.google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesRequest, options?: gax.CallOptions): Promise<[LROperation<protos.google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p3beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
asyncBatchAnnotateFiles(request: protos.google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesRequest, options: gax.CallOptions, callback: Callback<LROperation<protos.google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p3beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
asyncBatchAnnotateFiles(request: protos.google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesRequest, callback: Callback<LROperation<protos.google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p3beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
/** | ||
* Check the status of the long running operation returned by the asyncBatchAnnotateFiles() method. | ||
* @param {String} name | ||
* The operation name that will be passed. | ||
* @returns {Promise} - The promise which resolves to an object. | ||
* The decoded operation object has result and metadata field to get information from. | ||
* | ||
* @example: | ||
* const decodedOperation = await checkAsyncBatchAnnotateFilesProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
* | ||
*/ | ||
checkAsyncBatchAnnotateFilesProgress(name: string): Promise<LROperation<protos.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p3beta1.OperationMetadata>>; | ||
/** | ||
* Return a fully-qualified product resource name string. | ||
@@ -109,3 +130,3 @@ * | ||
*/ | ||
matchProjectFromProductName(productName: string): string; | ||
matchProjectFromProductName(productName: string): string | number; | ||
/** | ||
@@ -118,3 +139,3 @@ * Parse the location from Product resource. | ||
*/ | ||
matchLocationFromProductName(productName: string): string; | ||
matchLocationFromProductName(productName: string): string | number; | ||
/** | ||
@@ -127,3 +148,3 @@ * Parse the product from Product resource. | ||
*/ | ||
matchProductFromProductName(productName: string): string; | ||
matchProductFromProductName(productName: string): string | number; | ||
/** | ||
@@ -145,3 +166,3 @@ * Return a fully-qualified productSet resource name string. | ||
*/ | ||
matchProjectFromProductSetName(productSetName: string): string; | ||
matchProjectFromProductSetName(productSetName: string): string | number; | ||
/** | ||
@@ -154,3 +175,3 @@ * Parse the location from ProductSet resource. | ||
*/ | ||
matchLocationFromProductSetName(productSetName: string): string; | ||
matchLocationFromProductSetName(productSetName: string): string | number; | ||
/** | ||
@@ -163,3 +184,3 @@ * Parse the product_set from ProductSet resource. | ||
*/ | ||
matchProductSetFromProductSetName(productSetName: string): string; | ||
matchProductSetFromProductSetName(productSetName: string): string | number; | ||
/** | ||
@@ -182,3 +203,3 @@ * Return a fully-qualified referenceImage resource name string. | ||
*/ | ||
matchProjectFromReferenceImageName(referenceImageName: string): string; | ||
matchProjectFromReferenceImageName(referenceImageName: string): string | number; | ||
/** | ||
@@ -191,3 +212,3 @@ * Parse the location from ReferenceImage resource. | ||
*/ | ||
matchLocationFromReferenceImageName(referenceImageName: string): string; | ||
matchLocationFromReferenceImageName(referenceImageName: string): string | number; | ||
/** | ||
@@ -200,3 +221,3 @@ * Parse the product from ReferenceImage resource. | ||
*/ | ||
matchProductFromReferenceImageName(referenceImageName: string): string; | ||
matchProductFromReferenceImageName(referenceImageName: string): string | number; | ||
/** | ||
@@ -209,3 +230,3 @@ * Parse the reference_image from ReferenceImage resource. | ||
*/ | ||
matchReferenceImageFromReferenceImageName(referenceImageName: string): string; | ||
matchReferenceImageFromReferenceImageName(referenceImageName: string): string | number; | ||
/** | ||
@@ -212,0 +233,0 @@ * Terminate the GRPC channel and close the client. |
"use strict"; | ||
// Copyright 2019 Google LLC | ||
// Copyright 2020 Google LLC | ||
// | ||
@@ -20,5 +20,7 @@ // Licensed under the Apache License, Version 2.0 (the "License"); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ImageAnnotatorClient = void 0; | ||
const gax = require("google-gax"); | ||
const path = require("path"); | ||
const gapicConfig = require("./image_annotator_client_config.json"); | ||
const google_gax_1 = require("google-gax"); | ||
const version = require('../../../package.json').version; | ||
@@ -59,4 +61,9 @@ /** | ||
constructor(opts) { | ||
this._descriptors = { page: {}, stream: {}, longrunning: {} }; | ||
this._terminated = false; | ||
this.descriptors = { | ||
page: {}, | ||
stream: {}, | ||
longrunning: {}, | ||
batching: {}, | ||
}; | ||
// Ensure that options include the service address and port. | ||
@@ -110,7 +117,10 @@ const staticMembers = this.constructor; | ||
const nodejsProtoPath = path.join(__dirname, '..', '..', 'protos', 'protos.json'); | ||
this._protos = this._gaxGrpc.loadProto(opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath); | ||
this._protos = this._gaxGrpc.loadProto(opts.fallback | ||
? // eslint-disable-next-line @typescript-eslint/no-var-requires | ||
require('../../protos/protos.json') | ||
: nodejsProtoPath); | ||
// This API contains "path templates"; forward-slash-separated | ||
// identifiers to uniquely identify resources within the API. | ||
// Create useful helper objects for these. | ||
this._pathTemplates = { | ||
this.pathTemplates = { | ||
productPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/products/{product}'), | ||
@@ -124,3 +134,5 @@ productSetPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/productSets/{product_set}'), | ||
const protoFilesRoot = opts.fallback | ||
? this._gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) | ||
? this._gaxModule.protobuf.Root.fromJSON( | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
require('../../protos/protos.json')) | ||
: this._gaxModule.protobuf.loadSync(nodejsProtoPath); | ||
@@ -135,3 +147,3 @@ this.operationsClient = this._gaxModule | ||
const asyncBatchAnnotateFilesMetadata = protoFilesRoot.lookup('.google.cloud.vision.v1p3beta1.OperationMetadata'); | ||
this._descriptors.longrunning = { | ||
this.descriptors.longrunning = { | ||
asyncBatchAnnotateFiles: new this._gaxModule.LongrunningDescriptor(this.operationsClient, asyncBatchAnnotateFilesResponse.decode.bind(asyncBatchAnnotateFilesResponse), asyncBatchAnnotateFilesMetadata.decode.bind(asyncBatchAnnotateFilesMetadata)), | ||
@@ -144,3 +156,3 @@ }; | ||
// merely providing the destination and request information. | ||
this._innerApiCalls = {}; | ||
this.innerApiCalls = {}; | ||
} | ||
@@ -167,3 +179,3 @@ /** | ||
? this._protos.lookupService('google.cloud.vision.v1p3beta1.ImageAnnotator') | ||
: // tslint:disable-next-line no-any | ||
: // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
this._protos.google.cloud.vision.v1p3beta1.ImageAnnotator, this._opts); | ||
@@ -177,16 +189,15 @@ // Iterate over each of the methods that the service provides | ||
for (const methodName of imageAnnotatorStubMethods) { | ||
const innerCallPromise = this.imageAnnotatorStub.then(stub => (...args) => { | ||
const callPromise = this.imageAnnotatorStub.then(stub => (...args) => { | ||
if (this._terminated) { | ||
return Promise.reject('The client has already been closed.'); | ||
} | ||
return stub[methodName].apply(stub, args); | ||
const func = stub[methodName]; | ||
return func.apply(stub, args); | ||
}, (err) => () => { | ||
throw err; | ||
}); | ||
const apiCall = this._gaxModule.createApiCall(innerCallPromise, this._defaults[methodName], this._descriptors.page[methodName] || | ||
this._descriptors.stream[methodName] || | ||
this._descriptors.longrunning[methodName]); | ||
this._innerApiCalls[methodName] = (argument, callOptions, callback) => { | ||
return apiCall(argument, callOptions, callback); | ||
}; | ||
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], this.descriptors.page[methodName] || | ||
this.descriptors.stream[methodName] || | ||
this.descriptors.longrunning[methodName]); | ||
this.innerApiCalls[methodName] = apiCall; | ||
} | ||
@@ -261,3 +272,3 @@ return this.imageAnnotatorStub; | ||
this.initialize(); | ||
return this._innerApiCalls.batchAnnotateImages(request, options, callback); | ||
return this.innerApiCalls.batchAnnotateImages(request, options, callback); | ||
} | ||
@@ -294,4 +305,24 @@ /** | ||
this.initialize(); | ||
return this._innerApiCalls.asyncBatchAnnotateFiles(request, options, callback); | ||
return this.innerApiCalls.asyncBatchAnnotateFiles(request, options, callback); | ||
} | ||
/** | ||
* Check the status of the long running operation returned by the asyncBatchAnnotateFiles() method. | ||
* @param {String} name | ||
* The operation name that will be passed. | ||
* @returns {Promise} - The promise which resolves to an object. | ||
* The decoded operation object has result and metadata field to get information from. | ||
* | ||
* @example: | ||
* const decodedOperation = await checkAsyncBatchAnnotateFilesProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
* | ||
*/ | ||
async checkAsyncBatchAnnotateFilesProgress(name) { | ||
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name }); | ||
const [operation] = await this.operationsClient.getOperation(request); | ||
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.asyncBatchAnnotateFiles, gax.createDefaultBackoffSettings()); | ||
return decodeOperation; | ||
} | ||
// -------------------- | ||
@@ -309,6 +340,6 @@ // -- Path templates -- | ||
productPath(project, location, product) { | ||
return this._pathTemplates.productPathTemplate.render({ | ||
project, | ||
location, | ||
product, | ||
return this.pathTemplates.productPathTemplate.render({ | ||
project: project, | ||
location: location, | ||
product: product, | ||
}); | ||
@@ -324,3 +355,3 @@ } | ||
matchProjectFromProductName(productName) { | ||
return this._pathTemplates.productPathTemplate.match(productName).project; | ||
return this.pathTemplates.productPathTemplate.match(productName).project; | ||
} | ||
@@ -335,3 +366,3 @@ /** | ||
matchLocationFromProductName(productName) { | ||
return this._pathTemplates.productPathTemplate.match(productName).location; | ||
return this.pathTemplates.productPathTemplate.match(productName).location; | ||
} | ||
@@ -346,3 +377,3 @@ /** | ||
matchProductFromProductName(productName) { | ||
return this._pathTemplates.productPathTemplate.match(productName).product; | ||
return this.pathTemplates.productPathTemplate.match(productName).product; | ||
} | ||
@@ -358,5 +389,5 @@ /** | ||
productSetPath(project, location, productSet) { | ||
return this._pathTemplates.productSetPathTemplate.render({ | ||
project, | ||
location, | ||
return this.pathTemplates.productSetPathTemplate.render({ | ||
project: project, | ||
location: location, | ||
product_set: productSet, | ||
@@ -373,3 +404,3 @@ }); | ||
matchProjectFromProductSetName(productSetName) { | ||
return this._pathTemplates.productSetPathTemplate.match(productSetName) | ||
return this.pathTemplates.productSetPathTemplate.match(productSetName) | ||
.project; | ||
@@ -385,3 +416,3 @@ } | ||
matchLocationFromProductSetName(productSetName) { | ||
return this._pathTemplates.productSetPathTemplate.match(productSetName) | ||
return this.pathTemplates.productSetPathTemplate.match(productSetName) | ||
.location; | ||
@@ -397,3 +428,3 @@ } | ||
matchProductSetFromProductSetName(productSetName) { | ||
return this._pathTemplates.productSetPathTemplate.match(productSetName) | ||
return this.pathTemplates.productSetPathTemplate.match(productSetName) | ||
.product_set; | ||
@@ -411,6 +442,6 @@ } | ||
referenceImagePath(project, location, product, referenceImage) { | ||
return this._pathTemplates.referenceImagePathTemplate.render({ | ||
project, | ||
location, | ||
product, | ||
return this.pathTemplates.referenceImagePathTemplate.render({ | ||
project: project, | ||
location: location, | ||
product: product, | ||
reference_image: referenceImage, | ||
@@ -427,3 +458,3 @@ }); | ||
matchProjectFromReferenceImageName(referenceImageName) { | ||
return this._pathTemplates.referenceImagePathTemplate.match(referenceImageName).project; | ||
return this.pathTemplates.referenceImagePathTemplate.match(referenceImageName).project; | ||
} | ||
@@ -438,3 +469,3 @@ /** | ||
matchLocationFromReferenceImageName(referenceImageName) { | ||
return this._pathTemplates.referenceImagePathTemplate.match(referenceImageName).location; | ||
return this.pathTemplates.referenceImagePathTemplate.match(referenceImageName).location; | ||
} | ||
@@ -449,3 +480,3 @@ /** | ||
matchProductFromReferenceImageName(referenceImageName) { | ||
return this._pathTemplates.referenceImagePathTemplate.match(referenceImageName).product; | ||
return this.pathTemplates.referenceImagePathTemplate.match(referenceImageName).product; | ||
} | ||
@@ -460,3 +491,3 @@ /** | ||
matchReferenceImageFromReferenceImageName(referenceImageName) { | ||
return this._pathTemplates.referenceImagePathTemplate.match(referenceImageName).reference_image; | ||
return this.pathTemplates.referenceImagePathTemplate.match(referenceImageName).reference_image; | ||
} | ||
@@ -463,0 +494,0 @@ /** |
"use strict"; | ||
// Copyright 2019 Google LLC | ||
// Copyright 2020 Google LLC | ||
// | ||
@@ -21,5 +21,5 @@ // Licensed under the Apache License, Version 2.0 (the "License"); | ||
var image_annotator_client_1 = require("./image_annotator_client"); | ||
exports.ImageAnnotatorClient = image_annotator_client_1.ImageAnnotatorClient; | ||
Object.defineProperty(exports, "ImageAnnotatorClient", { enumerable: true, get: function () { return image_annotator_client_1.ImageAnnotatorClient; } }); | ||
var product_search_client_1 = require("./product_search_client"); | ||
exports.ProductSearchClient = product_search_client_1.ProductSearchClient; | ||
Object.defineProperty(exports, "ProductSearchClient", { enumerable: true, get: function () { return product_search_client_1.ProductSearchClient; } }); | ||
//# sourceMappingURL=index.js.map |
/// <reference types="node" /> | ||
import * as gax from 'google-gax'; | ||
import { Callback, ClientOptions, LROperation } from 'google-gax'; | ||
import { Callback, Descriptors, ClientOptions, LROperation, PaginationCallback } from 'google-gax'; | ||
import { Transform } from 'stream'; | ||
import * as protosTypes from '../../protos/protos'; | ||
import * as protos from '../../protos/protos'; | ||
/** | ||
@@ -25,5 +25,2 @@ * Manages Products and ProductSets of reference images for use in product | ||
export declare class ProductSearchClient { | ||
private _descriptors; | ||
private _innerApiCalls; | ||
private _pathTemplates; | ||
private _terminated; | ||
@@ -36,2 +33,9 @@ private _opts; | ||
auth: gax.GoogleAuth; | ||
descriptors: Descriptors; | ||
innerApiCalls: { | ||
[name: string]: Function; | ||
}; | ||
pathTemplates: { | ||
[name: string]: gax.PathTemplate; | ||
}; | ||
operationsClient: gax.OperationsClient; | ||
@@ -101,33 +105,63 @@ productSearchStub?: Promise<{ | ||
getProjectId(callback: Callback<string, undefined, undefined>): void; | ||
createProductSet(request: protosTypes.google.cloud.vision.v1p3beta1.ICreateProductSetRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p3beta1.IProductSet, (protosTypes.google.cloud.vision.v1p3beta1.ICreateProductSetRequest | undefined), {} | undefined]>; | ||
createProductSet(request: protosTypes.google.cloud.vision.v1p3beta1.ICreateProductSetRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p3beta1.IProductSet, protosTypes.google.cloud.vision.v1p3beta1.ICreateProductSetRequest | undefined, {} | undefined>): void; | ||
getProductSet(request: protosTypes.google.cloud.vision.v1p3beta1.IGetProductSetRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p3beta1.IProductSet, (protosTypes.google.cloud.vision.v1p3beta1.IGetProductSetRequest | undefined), {} | undefined]>; | ||
getProductSet(request: protosTypes.google.cloud.vision.v1p3beta1.IGetProductSetRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p3beta1.IProductSet, protosTypes.google.cloud.vision.v1p3beta1.IGetProductSetRequest | undefined, {} | undefined>): void; | ||
updateProductSet(request: protosTypes.google.cloud.vision.v1p3beta1.IUpdateProductSetRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p3beta1.IProductSet, (protosTypes.google.cloud.vision.v1p3beta1.IUpdateProductSetRequest | undefined), {} | undefined]>; | ||
updateProductSet(request: protosTypes.google.cloud.vision.v1p3beta1.IUpdateProductSetRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p3beta1.IProductSet, protosTypes.google.cloud.vision.v1p3beta1.IUpdateProductSetRequest | undefined, {} | undefined>): void; | ||
deleteProductSet(request: protosTypes.google.cloud.vision.v1p3beta1.IDeleteProductSetRequest, options?: gax.CallOptions): Promise<[protosTypes.google.protobuf.IEmpty, (protosTypes.google.cloud.vision.v1p3beta1.IDeleteProductSetRequest | undefined), {} | undefined]>; | ||
deleteProductSet(request: protosTypes.google.cloud.vision.v1p3beta1.IDeleteProductSetRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.protobuf.IEmpty, protosTypes.google.cloud.vision.v1p3beta1.IDeleteProductSetRequest | undefined, {} | undefined>): void; | ||
createProduct(request: protosTypes.google.cloud.vision.v1p3beta1.ICreateProductRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p3beta1.IProduct, (protosTypes.google.cloud.vision.v1p3beta1.ICreateProductRequest | undefined), {} | undefined]>; | ||
createProduct(request: protosTypes.google.cloud.vision.v1p3beta1.ICreateProductRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p3beta1.IProduct, protosTypes.google.cloud.vision.v1p3beta1.ICreateProductRequest | undefined, {} | undefined>): void; | ||
getProduct(request: protosTypes.google.cloud.vision.v1p3beta1.IGetProductRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p3beta1.IProduct, protosTypes.google.cloud.vision.v1p3beta1.IGetProductRequest | undefined, {} | undefined]>; | ||
getProduct(request: protosTypes.google.cloud.vision.v1p3beta1.IGetProductRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p3beta1.IProduct, protosTypes.google.cloud.vision.v1p3beta1.IGetProductRequest | undefined, {} | undefined>): void; | ||
updateProduct(request: protosTypes.google.cloud.vision.v1p3beta1.IUpdateProductRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p3beta1.IProduct, (protosTypes.google.cloud.vision.v1p3beta1.IUpdateProductRequest | undefined), {} | undefined]>; | ||
updateProduct(request: protosTypes.google.cloud.vision.v1p3beta1.IUpdateProductRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p3beta1.IProduct, protosTypes.google.cloud.vision.v1p3beta1.IUpdateProductRequest | undefined, {} | undefined>): void; | ||
deleteProduct(request: protosTypes.google.cloud.vision.v1p3beta1.IDeleteProductRequest, options?: gax.CallOptions): Promise<[protosTypes.google.protobuf.IEmpty, (protosTypes.google.cloud.vision.v1p3beta1.IDeleteProductRequest | undefined), {} | undefined]>; | ||
deleteProduct(request: protosTypes.google.cloud.vision.v1p3beta1.IDeleteProductRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.protobuf.IEmpty, protosTypes.google.cloud.vision.v1p3beta1.IDeleteProductRequest | undefined, {} | undefined>): void; | ||
createReferenceImage(request: protosTypes.google.cloud.vision.v1p3beta1.ICreateReferenceImageRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p3beta1.IReferenceImage, (protosTypes.google.cloud.vision.v1p3beta1.ICreateReferenceImageRequest | undefined), {} | undefined]>; | ||
createReferenceImage(request: protosTypes.google.cloud.vision.v1p3beta1.ICreateReferenceImageRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p3beta1.IReferenceImage, protosTypes.google.cloud.vision.v1p3beta1.ICreateReferenceImageRequest | undefined, {} | undefined>): void; | ||
deleteReferenceImage(request: protosTypes.google.cloud.vision.v1p3beta1.IDeleteReferenceImageRequest, options?: gax.CallOptions): Promise<[protosTypes.google.protobuf.IEmpty, (protosTypes.google.cloud.vision.v1p3beta1.IDeleteReferenceImageRequest | undefined), {} | undefined]>; | ||
deleteReferenceImage(request: protosTypes.google.cloud.vision.v1p3beta1.IDeleteReferenceImageRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.protobuf.IEmpty, protosTypes.google.cloud.vision.v1p3beta1.IDeleteReferenceImageRequest | undefined, {} | undefined>): void; | ||
getReferenceImage(request: protosTypes.google.cloud.vision.v1p3beta1.IGetReferenceImageRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p3beta1.IReferenceImage, (protosTypes.google.cloud.vision.v1p3beta1.IGetReferenceImageRequest | undefined), {} | undefined]>; | ||
getReferenceImage(request: protosTypes.google.cloud.vision.v1p3beta1.IGetReferenceImageRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p3beta1.IReferenceImage, protosTypes.google.cloud.vision.v1p3beta1.IGetReferenceImageRequest | undefined, {} | undefined>): void; | ||
addProductToProductSet(request: protosTypes.google.cloud.vision.v1p3beta1.IAddProductToProductSetRequest, options?: gax.CallOptions): Promise<[protosTypes.google.protobuf.IEmpty, (protosTypes.google.cloud.vision.v1p3beta1.IAddProductToProductSetRequest | undefined), {} | undefined]>; | ||
addProductToProductSet(request: protosTypes.google.cloud.vision.v1p3beta1.IAddProductToProductSetRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.protobuf.IEmpty, protosTypes.google.cloud.vision.v1p3beta1.IAddProductToProductSetRequest | undefined, {} | undefined>): void; | ||
removeProductFromProductSet(request: protosTypes.google.cloud.vision.v1p3beta1.IRemoveProductFromProductSetRequest, options?: gax.CallOptions): Promise<[protosTypes.google.protobuf.IEmpty, (protosTypes.google.cloud.vision.v1p3beta1.IRemoveProductFromProductSetRequest | undefined), {} | undefined]>; | ||
removeProductFromProductSet(request: protosTypes.google.cloud.vision.v1p3beta1.IRemoveProductFromProductSetRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.protobuf.IEmpty, protosTypes.google.cloud.vision.v1p3beta1.IRemoveProductFromProductSetRequest | undefined, {} | undefined>): void; | ||
importProductSets(request: protosTypes.google.cloud.vision.v1p3beta1.IImportProductSetsRequest, options?: gax.CallOptions): Promise<[LROperation<protosTypes.google.cloud.vision.v1p3beta1.IImportProductSetsResponse, protosTypes.google.cloud.vision.v1p3beta1.IBatchOperationMetadata>, protosTypes.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
importProductSets(request: protosTypes.google.cloud.vision.v1p3beta1.IImportProductSetsRequest, options: gax.CallOptions, callback: Callback<LROperation<protosTypes.google.cloud.vision.v1p3beta1.IImportProductSetsResponse, protosTypes.google.cloud.vision.v1p3beta1.IBatchOperationMetadata>, protosTypes.google.longrunning.IOperation | undefined, {} | undefined>): void; | ||
listProductSets(request: protosTypes.google.cloud.vision.v1p3beta1.IListProductSetsRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p3beta1.IProductSet[], protosTypes.google.cloud.vision.v1p3beta1.IListProductSetsRequest | null, protosTypes.google.cloud.vision.v1p3beta1.IListProductSetsResponse]>; | ||
listProductSets(request: protosTypes.google.cloud.vision.v1p3beta1.IListProductSetsRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p3beta1.IProductSet[], protosTypes.google.cloud.vision.v1p3beta1.IListProductSetsRequest | null, protosTypes.google.cloud.vision.v1p3beta1.IListProductSetsResponse>): void; | ||
createProductSet(request: protos.google.cloud.vision.v1p3beta1.ICreateProductSetRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p3beta1.IProductSet, protos.google.cloud.vision.v1p3beta1.ICreateProductSetRequest | undefined, {} | undefined]>; | ||
createProductSet(request: protos.google.cloud.vision.v1p3beta1.ICreateProductSetRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1p3beta1.IProductSet, protos.google.cloud.vision.v1p3beta1.ICreateProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
createProductSet(request: protos.google.cloud.vision.v1p3beta1.ICreateProductSetRequest, callback: Callback<protos.google.cloud.vision.v1p3beta1.IProductSet, protos.google.cloud.vision.v1p3beta1.ICreateProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
getProductSet(request: protos.google.cloud.vision.v1p3beta1.IGetProductSetRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p3beta1.IProductSet, protos.google.cloud.vision.v1p3beta1.IGetProductSetRequest | undefined, {} | undefined]>; | ||
getProductSet(request: protos.google.cloud.vision.v1p3beta1.IGetProductSetRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1p3beta1.IProductSet, protos.google.cloud.vision.v1p3beta1.IGetProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
getProductSet(request: protos.google.cloud.vision.v1p3beta1.IGetProductSetRequest, callback: Callback<protos.google.cloud.vision.v1p3beta1.IProductSet, protos.google.cloud.vision.v1p3beta1.IGetProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
updateProductSet(request: protos.google.cloud.vision.v1p3beta1.IUpdateProductSetRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p3beta1.IProductSet, protos.google.cloud.vision.v1p3beta1.IUpdateProductSetRequest | undefined, {} | undefined]>; | ||
updateProductSet(request: protos.google.cloud.vision.v1p3beta1.IUpdateProductSetRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1p3beta1.IProductSet, protos.google.cloud.vision.v1p3beta1.IUpdateProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
updateProductSet(request: protos.google.cloud.vision.v1p3beta1.IUpdateProductSetRequest, callback: Callback<protos.google.cloud.vision.v1p3beta1.IProductSet, protos.google.cloud.vision.v1p3beta1.IUpdateProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
deleteProductSet(request: protos.google.cloud.vision.v1p3beta1.IDeleteProductSetRequest, options?: gax.CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p3beta1.IDeleteProductSetRequest | undefined, {} | undefined]>; | ||
deleteProductSet(request: protos.google.cloud.vision.v1p3beta1.IDeleteProductSetRequest, options: gax.CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p3beta1.IDeleteProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
deleteProductSet(request: protos.google.cloud.vision.v1p3beta1.IDeleteProductSetRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p3beta1.IDeleteProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
createProduct(request: protos.google.cloud.vision.v1p3beta1.ICreateProductRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p3beta1.IProduct, protos.google.cloud.vision.v1p3beta1.ICreateProductRequest | undefined, {} | undefined]>; | ||
createProduct(request: protos.google.cloud.vision.v1p3beta1.ICreateProductRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1p3beta1.IProduct, protos.google.cloud.vision.v1p3beta1.ICreateProductRequest | null | undefined, {} | null | undefined>): void; | ||
createProduct(request: protos.google.cloud.vision.v1p3beta1.ICreateProductRequest, callback: Callback<protos.google.cloud.vision.v1p3beta1.IProduct, protos.google.cloud.vision.v1p3beta1.ICreateProductRequest | null | undefined, {} | null | undefined>): void; | ||
getProduct(request: protos.google.cloud.vision.v1p3beta1.IGetProductRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p3beta1.IProduct, protos.google.cloud.vision.v1p3beta1.IGetProductRequest | undefined, {} | undefined]>; | ||
getProduct(request: protos.google.cloud.vision.v1p3beta1.IGetProductRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1p3beta1.IProduct, protos.google.cloud.vision.v1p3beta1.IGetProductRequest | null | undefined, {} | null | undefined>): void; | ||
getProduct(request: protos.google.cloud.vision.v1p3beta1.IGetProductRequest, callback: Callback<protos.google.cloud.vision.v1p3beta1.IProduct, protos.google.cloud.vision.v1p3beta1.IGetProductRequest | null | undefined, {} | null | undefined>): void; | ||
updateProduct(request: protos.google.cloud.vision.v1p3beta1.IUpdateProductRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p3beta1.IProduct, protos.google.cloud.vision.v1p3beta1.IUpdateProductRequest | undefined, {} | undefined]>; | ||
updateProduct(request: protos.google.cloud.vision.v1p3beta1.IUpdateProductRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1p3beta1.IProduct, protos.google.cloud.vision.v1p3beta1.IUpdateProductRequest | null | undefined, {} | null | undefined>): void; | ||
updateProduct(request: protos.google.cloud.vision.v1p3beta1.IUpdateProductRequest, callback: Callback<protos.google.cloud.vision.v1p3beta1.IProduct, protos.google.cloud.vision.v1p3beta1.IUpdateProductRequest | null | undefined, {} | null | undefined>): void; | ||
deleteProduct(request: protos.google.cloud.vision.v1p3beta1.IDeleteProductRequest, options?: gax.CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p3beta1.IDeleteProductRequest | undefined, {} | undefined]>; | ||
deleteProduct(request: protos.google.cloud.vision.v1p3beta1.IDeleteProductRequest, options: gax.CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p3beta1.IDeleteProductRequest | null | undefined, {} | null | undefined>): void; | ||
deleteProduct(request: protos.google.cloud.vision.v1p3beta1.IDeleteProductRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p3beta1.IDeleteProductRequest | null | undefined, {} | null | undefined>): void; | ||
createReferenceImage(request: protos.google.cloud.vision.v1p3beta1.ICreateReferenceImageRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p3beta1.IReferenceImage, (protos.google.cloud.vision.v1p3beta1.ICreateReferenceImageRequest | undefined), {} | undefined]>; | ||
createReferenceImage(request: protos.google.cloud.vision.v1p3beta1.ICreateReferenceImageRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1p3beta1.IReferenceImage, protos.google.cloud.vision.v1p3beta1.ICreateReferenceImageRequest | null | undefined, {} | null | undefined>): void; | ||
createReferenceImage(request: protos.google.cloud.vision.v1p3beta1.ICreateReferenceImageRequest, callback: Callback<protos.google.cloud.vision.v1p3beta1.IReferenceImage, protos.google.cloud.vision.v1p3beta1.ICreateReferenceImageRequest | null | undefined, {} | null | undefined>): void; | ||
deleteReferenceImage(request: protos.google.cloud.vision.v1p3beta1.IDeleteReferenceImageRequest, options?: gax.CallOptions): Promise<[protos.google.protobuf.IEmpty, (protos.google.cloud.vision.v1p3beta1.IDeleteReferenceImageRequest | undefined), {} | undefined]>; | ||
deleteReferenceImage(request: protos.google.cloud.vision.v1p3beta1.IDeleteReferenceImageRequest, options: gax.CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p3beta1.IDeleteReferenceImageRequest | null | undefined, {} | null | undefined>): void; | ||
deleteReferenceImage(request: protos.google.cloud.vision.v1p3beta1.IDeleteReferenceImageRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p3beta1.IDeleteReferenceImageRequest | null | undefined, {} | null | undefined>): void; | ||
getReferenceImage(request: protos.google.cloud.vision.v1p3beta1.IGetReferenceImageRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p3beta1.IReferenceImage, (protos.google.cloud.vision.v1p3beta1.IGetReferenceImageRequest | undefined), {} | undefined]>; | ||
getReferenceImage(request: protos.google.cloud.vision.v1p3beta1.IGetReferenceImageRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1p3beta1.IReferenceImage, protos.google.cloud.vision.v1p3beta1.IGetReferenceImageRequest | null | undefined, {} | null | undefined>): void; | ||
getReferenceImage(request: protos.google.cloud.vision.v1p3beta1.IGetReferenceImageRequest, callback: Callback<protos.google.cloud.vision.v1p3beta1.IReferenceImage, protos.google.cloud.vision.v1p3beta1.IGetReferenceImageRequest | null | undefined, {} | null | undefined>): void; | ||
addProductToProductSet(request: protos.google.cloud.vision.v1p3beta1.IAddProductToProductSetRequest, options?: gax.CallOptions): Promise<[protos.google.protobuf.IEmpty, (protos.google.cloud.vision.v1p3beta1.IAddProductToProductSetRequest | undefined), {} | undefined]>; | ||
addProductToProductSet(request: protos.google.cloud.vision.v1p3beta1.IAddProductToProductSetRequest, options: gax.CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p3beta1.IAddProductToProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
addProductToProductSet(request: protos.google.cloud.vision.v1p3beta1.IAddProductToProductSetRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p3beta1.IAddProductToProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
removeProductFromProductSet(request: protos.google.cloud.vision.v1p3beta1.IRemoveProductFromProductSetRequest, options?: gax.CallOptions): Promise<[protos.google.protobuf.IEmpty, (protos.google.cloud.vision.v1p3beta1.IRemoveProductFromProductSetRequest | undefined), {} | undefined]>; | ||
removeProductFromProductSet(request: protos.google.cloud.vision.v1p3beta1.IRemoveProductFromProductSetRequest, options: gax.CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p3beta1.IRemoveProductFromProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
removeProductFromProductSet(request: protos.google.cloud.vision.v1p3beta1.IRemoveProductFromProductSetRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p3beta1.IRemoveProductFromProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
importProductSets(request: protos.google.cloud.vision.v1p3beta1.IImportProductSetsRequest, options?: gax.CallOptions): Promise<[LROperation<protos.google.cloud.vision.v1p3beta1.IImportProductSetsResponse, protos.google.cloud.vision.v1p3beta1.IBatchOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
importProductSets(request: protos.google.cloud.vision.v1p3beta1.IImportProductSetsRequest, options: gax.CallOptions, callback: Callback<LROperation<protos.google.cloud.vision.v1p3beta1.IImportProductSetsResponse, protos.google.cloud.vision.v1p3beta1.IBatchOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
importProductSets(request: protos.google.cloud.vision.v1p3beta1.IImportProductSetsRequest, callback: Callback<LROperation<protos.google.cloud.vision.v1p3beta1.IImportProductSetsResponse, protos.google.cloud.vision.v1p3beta1.IBatchOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
/** | ||
* Check the status of the long running operation returned by the importProductSets() method. | ||
* @param {String} name | ||
* The operation name that will be passed. | ||
* @returns {Promise} - The promise which resolves to an object. | ||
* The decoded operation object has result and metadata field to get information from. | ||
* | ||
* @example: | ||
* const decodedOperation = await checkImportProductSetsProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
* | ||
*/ | ||
checkImportProductSetsProgress(name: string): Promise<LROperation<protos.google.cloud.vision.v1p3beta1.ImportProductSetsResponse, protos.google.cloud.vision.v1p3beta1.BatchOperationMetadata>>; | ||
listProductSets(request: protos.google.cloud.vision.v1p3beta1.IListProductSetsRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p3beta1.IProductSet[], protos.google.cloud.vision.v1p3beta1.IListProductSetsRequest | null, protos.google.cloud.vision.v1p3beta1.IListProductSetsResponse]>; | ||
listProductSets(request: protos.google.cloud.vision.v1p3beta1.IListProductSetsRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.cloud.vision.v1p3beta1.IListProductSetsRequest, protos.google.cloud.vision.v1p3beta1.IListProductSetsResponse | null | undefined, protos.google.cloud.vision.v1p3beta1.IProductSet>): void; | ||
listProductSets(request: protos.google.cloud.vision.v1p3beta1.IListProductSetsRequest, callback: PaginationCallback<protos.google.cloud.vision.v1p3beta1.IListProductSetsRequest, protos.google.cloud.vision.v1p3beta1.IListProductSetsResponse | null | undefined, protos.google.cloud.vision.v1p3beta1.IProductSet>): void; | ||
/** | ||
* Equivalent to {@link listProductSets}, but returns a NodeJS Stream object. | ||
@@ -160,6 +194,28 @@ * | ||
*/ | ||
listProductSetsStream(request?: protosTypes.google.cloud.vision.v1p3beta1.IListProductSetsRequest, options?: gax.CallOptions): Transform; | ||
listProducts(request: protosTypes.google.cloud.vision.v1p3beta1.IListProductsRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p3beta1.IProduct[], protosTypes.google.cloud.vision.v1p3beta1.IListProductsRequest | null, protosTypes.google.cloud.vision.v1p3beta1.IListProductsResponse]>; | ||
listProducts(request: protosTypes.google.cloud.vision.v1p3beta1.IListProductsRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p3beta1.IProduct[], protosTypes.google.cloud.vision.v1p3beta1.IListProductsRequest | null, protosTypes.google.cloud.vision.v1p3beta1.IListProductsResponse>): void; | ||
listProductSetsStream(request?: protos.google.cloud.vision.v1p3beta1.IListProductSetsRequest, options?: gax.CallOptions): Transform; | ||
/** | ||
* Equivalent to {@link listProductSets}, but returns an iterable object. | ||
* | ||
* for-await-of syntax is used with the iterable to recursively get response element on-demand. | ||
* | ||
* @param {Object} request | ||
* The request object that will be sent. | ||
* @param {string} request.parent | ||
* Required. The project from which ProductSets should be listed. | ||
* | ||
* Format is `projects/PROJECT_ID/locations/LOC_ID`. | ||
* @param {number} request.pageSize | ||
* The maximum number of items to return. Default 10, maximum 100. | ||
* @param {string} request.pageToken | ||
* The next_page_token returned from a previous List request, if any. | ||
* @param {object} [options] | ||
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. | ||
* @returns {Object} | ||
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. | ||
*/ | ||
listProductSetsAsync(request?: protos.google.cloud.vision.v1p3beta1.IListProductSetsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.cloud.vision.v1p3beta1.IProductSet>; | ||
listProducts(request: protos.google.cloud.vision.v1p3beta1.IListProductsRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p3beta1.IProduct[], protos.google.cloud.vision.v1p3beta1.IListProductsRequest | null, protos.google.cloud.vision.v1p3beta1.IListProductsResponse]>; | ||
listProducts(request: protos.google.cloud.vision.v1p3beta1.IListProductsRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.cloud.vision.v1p3beta1.IListProductsRequest, protos.google.cloud.vision.v1p3beta1.IListProductsResponse | null | undefined, protos.google.cloud.vision.v1p3beta1.IProduct>): void; | ||
listProducts(request: protos.google.cloud.vision.v1p3beta1.IListProductsRequest, callback: PaginationCallback<protos.google.cloud.vision.v1p3beta1.IListProductsRequest, protos.google.cloud.vision.v1p3beta1.IListProductsResponse | null | undefined, protos.google.cloud.vision.v1p3beta1.IProduct>): void; | ||
/** | ||
* Equivalent to {@link listProducts}, but returns a NodeJS Stream object. | ||
@@ -193,6 +249,29 @@ * | ||
*/ | ||
listProductsStream(request?: protosTypes.google.cloud.vision.v1p3beta1.IListProductsRequest, options?: gax.CallOptions): Transform; | ||
listReferenceImages(request: protosTypes.google.cloud.vision.v1p3beta1.IListReferenceImagesRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p3beta1.IReferenceImage[], protosTypes.google.cloud.vision.v1p3beta1.IListReferenceImagesRequest | null, protosTypes.google.cloud.vision.v1p3beta1.IListReferenceImagesResponse]>; | ||
listReferenceImages(request: protosTypes.google.cloud.vision.v1p3beta1.IListReferenceImagesRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p3beta1.IReferenceImage[], protosTypes.google.cloud.vision.v1p3beta1.IListReferenceImagesRequest | null, protosTypes.google.cloud.vision.v1p3beta1.IListReferenceImagesResponse>): void; | ||
listProductsStream(request?: protos.google.cloud.vision.v1p3beta1.IListProductsRequest, options?: gax.CallOptions): Transform; | ||
/** | ||
* Equivalent to {@link listProducts}, but returns an iterable object. | ||
* | ||
* for-await-of syntax is used with the iterable to recursively get response element on-demand. | ||
* | ||
* @param {Object} request | ||
* The request object that will be sent. | ||
* @param {string} request.parent | ||
* Required. The project OR ProductSet from which Products should be listed. | ||
* | ||
* Format: | ||
* `projects/PROJECT_ID/locations/LOC_ID` | ||
* @param {number} request.pageSize | ||
* The maximum number of items to return. Default 10, maximum 100. | ||
* @param {string} request.pageToken | ||
* The next_page_token returned from a previous List request, if any. | ||
* @param {object} [options] | ||
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. | ||
* @returns {Object} | ||
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. | ||
*/ | ||
listProductsAsync(request?: protos.google.cloud.vision.v1p3beta1.IListProductsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.cloud.vision.v1p3beta1.IProduct>; | ||
listReferenceImages(request: protos.google.cloud.vision.v1p3beta1.IListReferenceImagesRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p3beta1.IReferenceImage[], protos.google.cloud.vision.v1p3beta1.IListReferenceImagesRequest | null, protos.google.cloud.vision.v1p3beta1.IListReferenceImagesResponse]>; | ||
listReferenceImages(request: protos.google.cloud.vision.v1p3beta1.IListReferenceImagesRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.cloud.vision.v1p3beta1.IListReferenceImagesRequest, protos.google.cloud.vision.v1p3beta1.IListReferenceImagesResponse | null | undefined, protos.google.cloud.vision.v1p3beta1.IReferenceImage>): void; | ||
listReferenceImages(request: protos.google.cloud.vision.v1p3beta1.IListReferenceImagesRequest, callback: PaginationCallback<protos.google.cloud.vision.v1p3beta1.IListReferenceImagesRequest, protos.google.cloud.vision.v1p3beta1.IListReferenceImagesResponse | null | undefined, protos.google.cloud.vision.v1p3beta1.IReferenceImage>): void; | ||
/** | ||
* Equivalent to {@link listReferenceImages}, but returns a NodeJS Stream object. | ||
@@ -229,6 +308,32 @@ * | ||
*/ | ||
listReferenceImagesStream(request?: protosTypes.google.cloud.vision.v1p3beta1.IListReferenceImagesRequest, options?: gax.CallOptions): Transform; | ||
listProductsInProductSet(request: protosTypes.google.cloud.vision.v1p3beta1.IListProductsInProductSetRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p3beta1.IProduct[], protosTypes.google.cloud.vision.v1p3beta1.IListProductsInProductSetRequest | null, protosTypes.google.cloud.vision.v1p3beta1.IListProductsInProductSetResponse]>; | ||
listProductsInProductSet(request: protosTypes.google.cloud.vision.v1p3beta1.IListProductsInProductSetRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p3beta1.IProduct[], protosTypes.google.cloud.vision.v1p3beta1.IListProductsInProductSetRequest | null, protosTypes.google.cloud.vision.v1p3beta1.IListProductsInProductSetResponse>): void; | ||
listReferenceImagesStream(request?: protos.google.cloud.vision.v1p3beta1.IListReferenceImagesRequest, options?: gax.CallOptions): Transform; | ||
/** | ||
* Equivalent to {@link listReferenceImages}, but returns an iterable object. | ||
* | ||
* for-await-of syntax is used with the iterable to recursively get response element on-demand. | ||
* | ||
* @param {Object} request | ||
* The request object that will be sent. | ||
* @param {string} request.parent | ||
* Required. Resource name of the product containing the reference images. | ||
* | ||
* Format is | ||
* `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. | ||
* @param {number} request.pageSize | ||
* The maximum number of items to return. Default 10, maximum 100. | ||
* @param {string} request.pageToken | ||
* A token identifying a page of results to be returned. This is the value | ||
* of `nextPageToken` returned in a previous reference image list request. | ||
* | ||
* Defaults to the first page if not specified. | ||
* @param {object} [options] | ||
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. | ||
* @returns {Object} | ||
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. | ||
*/ | ||
listReferenceImagesAsync(request?: protos.google.cloud.vision.v1p3beta1.IListReferenceImagesRequest, options?: gax.CallOptions): AsyncIterable<protos.google.cloud.vision.v1p3beta1.IReferenceImage>; | ||
listProductsInProductSet(request: protos.google.cloud.vision.v1p3beta1.IListProductsInProductSetRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p3beta1.IProduct[], protos.google.cloud.vision.v1p3beta1.IListProductsInProductSetRequest | null, protos.google.cloud.vision.v1p3beta1.IListProductsInProductSetResponse]>; | ||
listProductsInProductSet(request: protos.google.cloud.vision.v1p3beta1.IListProductsInProductSetRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.cloud.vision.v1p3beta1.IListProductsInProductSetRequest, protos.google.cloud.vision.v1p3beta1.IListProductsInProductSetResponse | null | undefined, protos.google.cloud.vision.v1p3beta1.IProduct>): void; | ||
listProductsInProductSet(request: protos.google.cloud.vision.v1p3beta1.IListProductsInProductSetRequest, callback: PaginationCallback<protos.google.cloud.vision.v1p3beta1.IListProductsInProductSetRequest, protos.google.cloud.vision.v1p3beta1.IListProductsInProductSetResponse | null | undefined, protos.google.cloud.vision.v1p3beta1.IProduct>): void; | ||
/** | ||
* Equivalent to {@link listProductsInProductSet}, but returns a NodeJS Stream object. | ||
@@ -262,4 +367,26 @@ * | ||
*/ | ||
listProductsInProductSetStream(request?: protosTypes.google.cloud.vision.v1p3beta1.IListProductsInProductSetRequest, options?: gax.CallOptions): Transform; | ||
listProductsInProductSetStream(request?: protos.google.cloud.vision.v1p3beta1.IListProductsInProductSetRequest, options?: gax.CallOptions): Transform; | ||
/** | ||
* Equivalent to {@link listProductsInProductSet}, but returns an iterable object. | ||
* | ||
* for-await-of syntax is used with the iterable to recursively get response element on-demand. | ||
* | ||
* @param {Object} request | ||
* The request object that will be sent. | ||
* @param {string} request.name | ||
* Required. The ProductSet resource for which to retrieve Products. | ||
* | ||
* Format is: | ||
* `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` | ||
* @param {number} request.pageSize | ||
* The maximum number of items to return. Default 10, maximum 100. | ||
* @param {string} request.pageToken | ||
* The next_page_token returned from a previous List request, if any. | ||
* @param {object} [options] | ||
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. | ||
* @returns {Object} | ||
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. | ||
*/ | ||
listProductsInProductSetAsync(request?: protos.google.cloud.vision.v1p3beta1.IListProductsInProductSetRequest, options?: gax.CallOptions): AsyncIterable<protos.google.cloud.vision.v1p3beta1.IProduct>; | ||
/** | ||
* Return a fully-qualified location resource name string. | ||
@@ -279,3 +406,3 @@ * | ||
*/ | ||
matchProjectFromLocationName(locationName: string): string; | ||
matchProjectFromLocationName(locationName: string): string | number; | ||
/** | ||
@@ -288,3 +415,3 @@ * Parse the location from Location resource. | ||
*/ | ||
matchLocationFromLocationName(locationName: string): string; | ||
matchLocationFromLocationName(locationName: string): string | number; | ||
/** | ||
@@ -306,3 +433,3 @@ * Return a fully-qualified product resource name string. | ||
*/ | ||
matchProjectFromProductName(productName: string): string; | ||
matchProjectFromProductName(productName: string): string | number; | ||
/** | ||
@@ -315,3 +442,3 @@ * Parse the location from Product resource. | ||
*/ | ||
matchLocationFromProductName(productName: string): string; | ||
matchLocationFromProductName(productName: string): string | number; | ||
/** | ||
@@ -324,3 +451,3 @@ * Parse the product from Product resource. | ||
*/ | ||
matchProductFromProductName(productName: string): string; | ||
matchProductFromProductName(productName: string): string | number; | ||
/** | ||
@@ -342,3 +469,3 @@ * Return a fully-qualified productSet resource name string. | ||
*/ | ||
matchProjectFromProductSetName(productSetName: string): string; | ||
matchProjectFromProductSetName(productSetName: string): string | number; | ||
/** | ||
@@ -351,3 +478,3 @@ * Parse the location from ProductSet resource. | ||
*/ | ||
matchLocationFromProductSetName(productSetName: string): string; | ||
matchLocationFromProductSetName(productSetName: string): string | number; | ||
/** | ||
@@ -360,3 +487,3 @@ * Parse the product_set from ProductSet resource. | ||
*/ | ||
matchProductSetFromProductSetName(productSetName: string): string; | ||
matchProductSetFromProductSetName(productSetName: string): string | number; | ||
/** | ||
@@ -379,3 +506,3 @@ * Return a fully-qualified referenceImage resource name string. | ||
*/ | ||
matchProjectFromReferenceImageName(referenceImageName: string): string; | ||
matchProjectFromReferenceImageName(referenceImageName: string): string | number; | ||
/** | ||
@@ -388,3 +515,3 @@ * Parse the location from ReferenceImage resource. | ||
*/ | ||
matchLocationFromReferenceImageName(referenceImageName: string): string; | ||
matchLocationFromReferenceImageName(referenceImageName: string): string | number; | ||
/** | ||
@@ -397,3 +524,3 @@ * Parse the product from ReferenceImage resource. | ||
*/ | ||
matchProductFromReferenceImageName(referenceImageName: string): string; | ||
matchProductFromReferenceImageName(referenceImageName: string): string | number; | ||
/** | ||
@@ -406,3 +533,3 @@ * Parse the reference_image from ReferenceImage resource. | ||
*/ | ||
matchReferenceImageFromReferenceImageName(referenceImageName: string): string; | ||
matchReferenceImageFromReferenceImageName(referenceImageName: string): string | number; | ||
/** | ||
@@ -409,0 +536,0 @@ * Terminate the GRPC channel and close the client. |
import * as gax from 'google-gax'; | ||
import { Callback, ClientOptions, LROperation } from 'google-gax'; | ||
import * as protosTypes from '../../protos/protos'; | ||
import { Callback, Descriptors, ClientOptions, LROperation } from 'google-gax'; | ||
import * as protos from '../../protos/protos'; | ||
/** | ||
@@ -12,5 +12,2 @@ * Service that performs Google Cloud Vision API detection tasks over client | ||
export declare class ImageAnnotatorClient { | ||
private _descriptors; | ||
private _innerApiCalls; | ||
private _pathTemplates; | ||
private _terminated; | ||
@@ -23,2 +20,9 @@ private _opts; | ||
auth: gax.GoogleAuth; | ||
descriptors: Descriptors; | ||
innerApiCalls: { | ||
[name: string]: Function; | ||
}; | ||
pathTemplates: { | ||
[name: string]: gax.PathTemplate; | ||
}; | ||
operationsClient: gax.OperationsClient; | ||
@@ -88,11 +92,45 @@ imageAnnotatorStub?: Promise<{ | ||
getProjectId(callback: Callback<string, undefined, undefined>): void; | ||
batchAnnotateImages(request: protosTypes.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesResponse, (protosTypes.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest | undefined), {} | undefined]>; | ||
batchAnnotateImages(request: protosTypes.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesResponse, protosTypes.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest | undefined, {} | undefined>): void; | ||
batchAnnotateFiles(request: protosTypes.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesResponse, (protosTypes.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest | undefined), {} | undefined]>; | ||
batchAnnotateFiles(request: protosTypes.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesResponse, protosTypes.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest | undefined, {} | undefined>): void; | ||
asyncBatchAnnotateImages(request: protosTypes.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesRequest, options?: gax.CallOptions): Promise<[LROperation<protosTypes.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesResponse, protosTypes.google.cloud.vision.v1p4beta1.IOperationMetadata>, protosTypes.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
asyncBatchAnnotateImages(request: protosTypes.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesRequest, options: gax.CallOptions, callback: Callback<LROperation<protosTypes.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesResponse, protosTypes.google.cloud.vision.v1p4beta1.IOperationMetadata>, protosTypes.google.longrunning.IOperation | undefined, {} | undefined>): void; | ||
asyncBatchAnnotateFiles(request: protosTypes.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesRequest, options?: gax.CallOptions): Promise<[LROperation<protosTypes.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesResponse, protosTypes.google.cloud.vision.v1p4beta1.IOperationMetadata>, protosTypes.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
asyncBatchAnnotateFiles(request: protosTypes.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesRequest, options: gax.CallOptions, callback: Callback<LROperation<protosTypes.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesResponse, protosTypes.google.cloud.vision.v1p4beta1.IOperationMetadata>, protosTypes.google.longrunning.IOperation | undefined, {} | undefined>): void; | ||
batchAnnotateImages(request: protos.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesResponse, (protos.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest | undefined), {} | undefined]>; | ||
batchAnnotateImages(request: protos.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesResponse, protos.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest | null | undefined, {} | null | undefined>): void; | ||
batchAnnotateImages(request: protos.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest, callback: Callback<protos.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesResponse, protos.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest | null | undefined, {} | null | undefined>): void; | ||
batchAnnotateFiles(request: protos.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesResponse, (protos.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest | undefined), {} | undefined]>; | ||
batchAnnotateFiles(request: protos.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest | null | undefined, {} | null | undefined>): void; | ||
batchAnnotateFiles(request: protos.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest, callback: Callback<protos.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest | null | undefined, {} | null | undefined>): void; | ||
asyncBatchAnnotateImages(request: protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesRequest, options?: gax.CallOptions): Promise<[LROperation<protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesResponse, protos.google.cloud.vision.v1p4beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
asyncBatchAnnotateImages(request: protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesRequest, options: gax.CallOptions, callback: Callback<LROperation<protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesResponse, protos.google.cloud.vision.v1p4beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
asyncBatchAnnotateImages(request: protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesRequest, callback: Callback<LROperation<protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesResponse, protos.google.cloud.vision.v1p4beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
/** | ||
* Check the status of the long running operation returned by the asyncBatchAnnotateImages() method. | ||
* @param {String} name | ||
* The operation name that will be passed. | ||
* @returns {Promise} - The promise which resolves to an object. | ||
* The decoded operation object has result and metadata field to get information from. | ||
* | ||
* @example: | ||
* const decodedOperation = await checkAsyncBatchAnnotateImagesProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
* | ||
*/ | ||
checkAsyncBatchAnnotateImagesProgress(name: string): Promise<LROperation<protos.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse, protos.google.cloud.vision.v1p4beta1.OperationMetadata>>; | ||
asyncBatchAnnotateFiles(request: protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesRequest, options?: gax.CallOptions): Promise<[LROperation<protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p4beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
asyncBatchAnnotateFiles(request: protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesRequest, options: gax.CallOptions, callback: Callback<LROperation<protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p4beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
asyncBatchAnnotateFiles(request: protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesRequest, callback: Callback<LROperation<protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p4beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
/** | ||
* Check the status of the long running operation returned by the asyncBatchAnnotateFiles() method. | ||
* @param {String} name | ||
* The operation name that will be passed. | ||
* @returns {Promise} - The promise which resolves to an object. | ||
* The decoded operation object has result and metadata field to get information from. | ||
* | ||
* @example: | ||
* const decodedOperation = await checkAsyncBatchAnnotateFilesProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
* | ||
*/ | ||
checkAsyncBatchAnnotateFilesProgress(name: string): Promise<LROperation<protos.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p4beta1.OperationMetadata>>; | ||
/** | ||
* Return a fully-qualified product resource name string. | ||
@@ -113,3 +151,3 @@ * | ||
*/ | ||
matchProjectFromProductName(productName: string): string; | ||
matchProjectFromProductName(productName: string): string | number; | ||
/** | ||
@@ -122,3 +160,3 @@ * Parse the location from Product resource. | ||
*/ | ||
matchLocationFromProductName(productName: string): string; | ||
matchLocationFromProductName(productName: string): string | number; | ||
/** | ||
@@ -131,3 +169,3 @@ * Parse the product from Product resource. | ||
*/ | ||
matchProductFromProductName(productName: string): string; | ||
matchProductFromProductName(productName: string): string | number; | ||
/** | ||
@@ -149,3 +187,3 @@ * Return a fully-qualified productSet resource name string. | ||
*/ | ||
matchProjectFromProductSetName(productSetName: string): string; | ||
matchProjectFromProductSetName(productSetName: string): string | number; | ||
/** | ||
@@ -158,3 +196,3 @@ * Parse the location from ProductSet resource. | ||
*/ | ||
matchLocationFromProductSetName(productSetName: string): string; | ||
matchLocationFromProductSetName(productSetName: string): string | number; | ||
/** | ||
@@ -167,3 +205,3 @@ * Parse the product_set from ProductSet resource. | ||
*/ | ||
matchProductSetFromProductSetName(productSetName: string): string; | ||
matchProductSetFromProductSetName(productSetName: string): string | number; | ||
/** | ||
@@ -186,3 +224,3 @@ * Return a fully-qualified referenceImage resource name string. | ||
*/ | ||
matchProjectFromReferenceImageName(referenceImageName: string): string; | ||
matchProjectFromReferenceImageName(referenceImageName: string): string | number; | ||
/** | ||
@@ -195,3 +233,3 @@ * Parse the location from ReferenceImage resource. | ||
*/ | ||
matchLocationFromReferenceImageName(referenceImageName: string): string; | ||
matchLocationFromReferenceImageName(referenceImageName: string): string | number; | ||
/** | ||
@@ -204,3 +242,3 @@ * Parse the product from ReferenceImage resource. | ||
*/ | ||
matchProductFromReferenceImageName(referenceImageName: string): string; | ||
matchProductFromReferenceImageName(referenceImageName: string): string | number; | ||
/** | ||
@@ -213,3 +251,3 @@ * Parse the reference_image from ReferenceImage resource. | ||
*/ | ||
matchReferenceImageFromReferenceImageName(referenceImageName: string): string; | ||
matchReferenceImageFromReferenceImageName(referenceImageName: string): string | number; | ||
/** | ||
@@ -216,0 +254,0 @@ * Terminate the GRPC channel and close the client. |
"use strict"; | ||
// Copyright 2019 Google LLC | ||
// Copyright 2020 Google LLC | ||
// | ||
@@ -20,5 +20,7 @@ // Licensed under the Apache License, Version 2.0 (the "License"); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ImageAnnotatorClient = void 0; | ||
const gax = require("google-gax"); | ||
const path = require("path"); | ||
const gapicConfig = require("./image_annotator_client_config.json"); | ||
const google_gax_1 = require("google-gax"); | ||
const version = require('../../../package.json').version; | ||
@@ -59,4 +61,9 @@ /** | ||
constructor(opts) { | ||
this._descriptors = { page: {}, stream: {}, longrunning: {} }; | ||
this._terminated = false; | ||
this.descriptors = { | ||
page: {}, | ||
stream: {}, | ||
longrunning: {}, | ||
batching: {}, | ||
}; | ||
// Ensure that options include the service address and port. | ||
@@ -110,7 +117,10 @@ const staticMembers = this.constructor; | ||
const nodejsProtoPath = path.join(__dirname, '..', '..', 'protos', 'protos.json'); | ||
this._protos = this._gaxGrpc.loadProto(opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath); | ||
this._protos = this._gaxGrpc.loadProto(opts.fallback | ||
? // eslint-disable-next-line @typescript-eslint/no-var-requires | ||
require('../../protos/protos.json') | ||
: nodejsProtoPath); | ||
// This API contains "path templates"; forward-slash-separated | ||
// identifiers to uniquely identify resources within the API. | ||
// Create useful helper objects for these. | ||
this._pathTemplates = { | ||
this.pathTemplates = { | ||
productPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/products/{product}'), | ||
@@ -124,3 +134,5 @@ productSetPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/productSets/{product_set}'), | ||
const protoFilesRoot = opts.fallback | ||
? this._gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) | ||
? this._gaxModule.protobuf.Root.fromJSON( | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
require('../../protos/protos.json')) | ||
: this._gaxModule.protobuf.loadSync(nodejsProtoPath); | ||
@@ -137,3 +149,3 @@ this.operationsClient = this._gaxModule | ||
const asyncBatchAnnotateFilesMetadata = protoFilesRoot.lookup('.google.cloud.vision.v1p4beta1.OperationMetadata'); | ||
this._descriptors.longrunning = { | ||
this.descriptors.longrunning = { | ||
asyncBatchAnnotateImages: new this._gaxModule.LongrunningDescriptor(this.operationsClient, asyncBatchAnnotateImagesResponse.decode.bind(asyncBatchAnnotateImagesResponse), asyncBatchAnnotateImagesMetadata.decode.bind(asyncBatchAnnotateImagesMetadata)), | ||
@@ -147,3 +159,3 @@ asyncBatchAnnotateFiles: new this._gaxModule.LongrunningDescriptor(this.operationsClient, asyncBatchAnnotateFilesResponse.decode.bind(asyncBatchAnnotateFilesResponse), asyncBatchAnnotateFilesMetadata.decode.bind(asyncBatchAnnotateFilesMetadata)), | ||
// merely providing the destination and request information. | ||
this._innerApiCalls = {}; | ||
this.innerApiCalls = {}; | ||
} | ||
@@ -170,3 +182,3 @@ /** | ||
? this._protos.lookupService('google.cloud.vision.v1p4beta1.ImageAnnotator') | ||
: // tslint:disable-next-line no-any | ||
: // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
this._protos.google.cloud.vision.v1p4beta1.ImageAnnotator, this._opts); | ||
@@ -182,16 +194,15 @@ // Iterate over each of the methods that the service provides | ||
for (const methodName of imageAnnotatorStubMethods) { | ||
const innerCallPromise = this.imageAnnotatorStub.then(stub => (...args) => { | ||
const callPromise = this.imageAnnotatorStub.then(stub => (...args) => { | ||
if (this._terminated) { | ||
return Promise.reject('The client has already been closed.'); | ||
} | ||
return stub[methodName].apply(stub, args); | ||
const func = stub[methodName]; | ||
return func.apply(stub, args); | ||
}, (err) => () => { | ||
throw err; | ||
}); | ||
const apiCall = this._gaxModule.createApiCall(innerCallPromise, this._defaults[methodName], this._descriptors.page[methodName] || | ||
this._descriptors.stream[methodName] || | ||
this._descriptors.longrunning[methodName]); | ||
this._innerApiCalls[methodName] = (argument, callOptions, callback) => { | ||
return apiCall(argument, callOptions, callback); | ||
}; | ||
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], this.descriptors.page[methodName] || | ||
this.descriptors.stream[methodName] || | ||
this.descriptors.longrunning[methodName]); | ||
this.innerApiCalls[methodName] = apiCall; | ||
} | ||
@@ -266,3 +277,3 @@ return this.imageAnnotatorStub; | ||
this.initialize(); | ||
return this._innerApiCalls.batchAnnotateImages(request, options, callback); | ||
return this.innerApiCalls.batchAnnotateImages(request, options, callback); | ||
} | ||
@@ -301,3 +312,3 @@ /** | ||
this.initialize(); | ||
return this._innerApiCalls.batchAnnotateFiles(request, options, callback); | ||
return this.innerApiCalls.batchAnnotateFiles(request, options, callback); | ||
} | ||
@@ -339,5 +350,25 @@ /** | ||
this.initialize(); | ||
return this._innerApiCalls.asyncBatchAnnotateImages(request, options, callback); | ||
return this.innerApiCalls.asyncBatchAnnotateImages(request, options, callback); | ||
} | ||
/** | ||
* Check the status of the long running operation returned by the asyncBatchAnnotateImages() method. | ||
* @param {String} name | ||
* The operation name that will be passed. | ||
* @returns {Promise} - The promise which resolves to an object. | ||
* The decoded operation object has result and metadata field to get information from. | ||
* | ||
* @example: | ||
* const decodedOperation = await checkAsyncBatchAnnotateImagesProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
* | ||
*/ | ||
async checkAsyncBatchAnnotateImagesProgress(name) { | ||
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name }); | ||
const [operation] = await this.operationsClient.getOperation(request); | ||
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.asyncBatchAnnotateImages, gax.createDefaultBackoffSettings()); | ||
return decodeOperation; | ||
} | ||
/** | ||
* Run asynchronous image detection and annotation for a list of generic | ||
@@ -372,4 +403,24 @@ * files, such as PDF files, which may contain multiple pages and multiple | ||
this.initialize(); | ||
return this._innerApiCalls.asyncBatchAnnotateFiles(request, options, callback); | ||
return this.innerApiCalls.asyncBatchAnnotateFiles(request, options, callback); | ||
} | ||
/** | ||
* Check the status of the long running operation returned by the asyncBatchAnnotateFiles() method. | ||
* @param {String} name | ||
* The operation name that will be passed. | ||
* @returns {Promise} - The promise which resolves to an object. | ||
* The decoded operation object has result and metadata field to get information from. | ||
* | ||
* @example: | ||
* const decodedOperation = await checkAsyncBatchAnnotateFilesProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
* | ||
*/ | ||
async checkAsyncBatchAnnotateFilesProgress(name) { | ||
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name }); | ||
const [operation] = await this.operationsClient.getOperation(request); | ||
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.asyncBatchAnnotateFiles, gax.createDefaultBackoffSettings()); | ||
return decodeOperation; | ||
} | ||
// -------------------- | ||
@@ -387,6 +438,6 @@ // -- Path templates -- | ||
productPath(project, location, product) { | ||
return this._pathTemplates.productPathTemplate.render({ | ||
project, | ||
location, | ||
product, | ||
return this.pathTemplates.productPathTemplate.render({ | ||
project: project, | ||
location: location, | ||
product: product, | ||
}); | ||
@@ -402,3 +453,3 @@ } | ||
matchProjectFromProductName(productName) { | ||
return this._pathTemplates.productPathTemplate.match(productName).project; | ||
return this.pathTemplates.productPathTemplate.match(productName).project; | ||
} | ||
@@ -413,3 +464,3 @@ /** | ||
matchLocationFromProductName(productName) { | ||
return this._pathTemplates.productPathTemplate.match(productName).location; | ||
return this.pathTemplates.productPathTemplate.match(productName).location; | ||
} | ||
@@ -424,3 +475,3 @@ /** | ||
matchProductFromProductName(productName) { | ||
return this._pathTemplates.productPathTemplate.match(productName).product; | ||
return this.pathTemplates.productPathTemplate.match(productName).product; | ||
} | ||
@@ -436,5 +487,5 @@ /** | ||
productSetPath(project, location, productSet) { | ||
return this._pathTemplates.productSetPathTemplate.render({ | ||
project, | ||
location, | ||
return this.pathTemplates.productSetPathTemplate.render({ | ||
project: project, | ||
location: location, | ||
product_set: productSet, | ||
@@ -451,3 +502,3 @@ }); | ||
matchProjectFromProductSetName(productSetName) { | ||
return this._pathTemplates.productSetPathTemplate.match(productSetName) | ||
return this.pathTemplates.productSetPathTemplate.match(productSetName) | ||
.project; | ||
@@ -463,3 +514,3 @@ } | ||
matchLocationFromProductSetName(productSetName) { | ||
return this._pathTemplates.productSetPathTemplate.match(productSetName) | ||
return this.pathTemplates.productSetPathTemplate.match(productSetName) | ||
.location; | ||
@@ -475,3 +526,3 @@ } | ||
matchProductSetFromProductSetName(productSetName) { | ||
return this._pathTemplates.productSetPathTemplate.match(productSetName) | ||
return this.pathTemplates.productSetPathTemplate.match(productSetName) | ||
.product_set; | ||
@@ -489,6 +540,6 @@ } | ||
referenceImagePath(project, location, product, referenceImage) { | ||
return this._pathTemplates.referenceImagePathTemplate.render({ | ||
project, | ||
location, | ||
product, | ||
return this.pathTemplates.referenceImagePathTemplate.render({ | ||
project: project, | ||
location: location, | ||
product: product, | ||
reference_image: referenceImage, | ||
@@ -505,3 +556,3 @@ }); | ||
matchProjectFromReferenceImageName(referenceImageName) { | ||
return this._pathTemplates.referenceImagePathTemplate.match(referenceImageName).project; | ||
return this.pathTemplates.referenceImagePathTemplate.match(referenceImageName).project; | ||
} | ||
@@ -516,3 +567,3 @@ /** | ||
matchLocationFromReferenceImageName(referenceImageName) { | ||
return this._pathTemplates.referenceImagePathTemplate.match(referenceImageName).location; | ||
return this.pathTemplates.referenceImagePathTemplate.match(referenceImageName).location; | ||
} | ||
@@ -527,3 +578,3 @@ /** | ||
matchProductFromReferenceImageName(referenceImageName) { | ||
return this._pathTemplates.referenceImagePathTemplate.match(referenceImageName).product; | ||
return this.pathTemplates.referenceImagePathTemplate.match(referenceImageName).product; | ||
} | ||
@@ -538,3 +589,3 @@ /** | ||
matchReferenceImageFromReferenceImageName(referenceImageName) { | ||
return this._pathTemplates.referenceImagePathTemplate.match(referenceImageName).reference_image; | ||
return this.pathTemplates.referenceImagePathTemplate.match(referenceImageName).reference_image; | ||
} | ||
@@ -541,0 +592,0 @@ /** |
"use strict"; | ||
// Copyright 2019 Google LLC | ||
// Copyright 2020 Google LLC | ||
// | ||
@@ -21,5 +21,5 @@ // Licensed under the Apache License, Version 2.0 (the "License"); | ||
var image_annotator_client_1 = require("./image_annotator_client"); | ||
exports.ImageAnnotatorClient = image_annotator_client_1.ImageAnnotatorClient; | ||
Object.defineProperty(exports, "ImageAnnotatorClient", { enumerable: true, get: function () { return image_annotator_client_1.ImageAnnotatorClient; } }); | ||
var product_search_client_1 = require("./product_search_client"); | ||
exports.ProductSearchClient = product_search_client_1.ProductSearchClient; | ||
Object.defineProperty(exports, "ProductSearchClient", { enumerable: true, get: function () { return product_search_client_1.ProductSearchClient; } }); | ||
//# sourceMappingURL=index.js.map |
/// <reference types="node" /> | ||
import * as gax from 'google-gax'; | ||
import { Callback, ClientOptions, LROperation } from 'google-gax'; | ||
import { Callback, Descriptors, ClientOptions, LROperation, PaginationCallback } from 'google-gax'; | ||
import { Transform } from 'stream'; | ||
import * as protosTypes from '../../protos/protos'; | ||
import * as protos from '../../protos/protos'; | ||
/** | ||
@@ -29,5 +29,2 @@ * Manages Products and ProductSets of reference images for use in product | ||
export declare class ProductSearchClient { | ||
private _descriptors; | ||
private _innerApiCalls; | ||
private _pathTemplates; | ||
private _terminated; | ||
@@ -40,2 +37,9 @@ private _opts; | ||
auth: gax.GoogleAuth; | ||
descriptors: Descriptors; | ||
innerApiCalls: { | ||
[name: string]: Function; | ||
}; | ||
pathTemplates: { | ||
[name: string]: gax.PathTemplate; | ||
}; | ||
operationsClient: gax.OperationsClient; | ||
@@ -105,35 +109,81 @@ productSearchStub?: Promise<{ | ||
getProjectId(callback: Callback<string, undefined, undefined>): void; | ||
createProductSet(request: protosTypes.google.cloud.vision.v1p4beta1.ICreateProductSetRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p4beta1.IProductSet, (protosTypes.google.cloud.vision.v1p4beta1.ICreateProductSetRequest | undefined), {} | undefined]>; | ||
createProductSet(request: protosTypes.google.cloud.vision.v1p4beta1.ICreateProductSetRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p4beta1.IProductSet, protosTypes.google.cloud.vision.v1p4beta1.ICreateProductSetRequest | undefined, {} | undefined>): void; | ||
getProductSet(request: protosTypes.google.cloud.vision.v1p4beta1.IGetProductSetRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p4beta1.IProductSet, (protosTypes.google.cloud.vision.v1p4beta1.IGetProductSetRequest | undefined), {} | undefined]>; | ||
getProductSet(request: protosTypes.google.cloud.vision.v1p4beta1.IGetProductSetRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p4beta1.IProductSet, protosTypes.google.cloud.vision.v1p4beta1.IGetProductSetRequest | undefined, {} | undefined>): void; | ||
updateProductSet(request: protosTypes.google.cloud.vision.v1p4beta1.IUpdateProductSetRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p4beta1.IProductSet, (protosTypes.google.cloud.vision.v1p4beta1.IUpdateProductSetRequest | undefined), {} | undefined]>; | ||
updateProductSet(request: protosTypes.google.cloud.vision.v1p4beta1.IUpdateProductSetRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p4beta1.IProductSet, protosTypes.google.cloud.vision.v1p4beta1.IUpdateProductSetRequest | undefined, {} | undefined>): void; | ||
deleteProductSet(request: protosTypes.google.cloud.vision.v1p4beta1.IDeleteProductSetRequest, options?: gax.CallOptions): Promise<[protosTypes.google.protobuf.IEmpty, (protosTypes.google.cloud.vision.v1p4beta1.IDeleteProductSetRequest | undefined), {} | undefined]>; | ||
deleteProductSet(request: protosTypes.google.cloud.vision.v1p4beta1.IDeleteProductSetRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.protobuf.IEmpty, protosTypes.google.cloud.vision.v1p4beta1.IDeleteProductSetRequest | undefined, {} | undefined>): void; | ||
createProduct(request: protosTypes.google.cloud.vision.v1p4beta1.ICreateProductRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p4beta1.IProduct, (protosTypes.google.cloud.vision.v1p4beta1.ICreateProductRequest | undefined), {} | undefined]>; | ||
createProduct(request: protosTypes.google.cloud.vision.v1p4beta1.ICreateProductRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p4beta1.IProduct, protosTypes.google.cloud.vision.v1p4beta1.ICreateProductRequest | undefined, {} | undefined>): void; | ||
getProduct(request: protosTypes.google.cloud.vision.v1p4beta1.IGetProductRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p4beta1.IProduct, protosTypes.google.cloud.vision.v1p4beta1.IGetProductRequest | undefined, {} | undefined]>; | ||
getProduct(request: protosTypes.google.cloud.vision.v1p4beta1.IGetProductRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p4beta1.IProduct, protosTypes.google.cloud.vision.v1p4beta1.IGetProductRequest | undefined, {} | undefined>): void; | ||
updateProduct(request: protosTypes.google.cloud.vision.v1p4beta1.IUpdateProductRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p4beta1.IProduct, (protosTypes.google.cloud.vision.v1p4beta1.IUpdateProductRequest | undefined), {} | undefined]>; | ||
updateProduct(request: protosTypes.google.cloud.vision.v1p4beta1.IUpdateProductRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p4beta1.IProduct, protosTypes.google.cloud.vision.v1p4beta1.IUpdateProductRequest | undefined, {} | undefined>): void; | ||
deleteProduct(request: protosTypes.google.cloud.vision.v1p4beta1.IDeleteProductRequest, options?: gax.CallOptions): Promise<[protosTypes.google.protobuf.IEmpty, (protosTypes.google.cloud.vision.v1p4beta1.IDeleteProductRequest | undefined), {} | undefined]>; | ||
deleteProduct(request: protosTypes.google.cloud.vision.v1p4beta1.IDeleteProductRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.protobuf.IEmpty, protosTypes.google.cloud.vision.v1p4beta1.IDeleteProductRequest | undefined, {} | undefined>): void; | ||
createReferenceImage(request: protosTypes.google.cloud.vision.v1p4beta1.ICreateReferenceImageRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p4beta1.IReferenceImage, (protosTypes.google.cloud.vision.v1p4beta1.ICreateReferenceImageRequest | undefined), {} | undefined]>; | ||
createReferenceImage(request: protosTypes.google.cloud.vision.v1p4beta1.ICreateReferenceImageRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p4beta1.IReferenceImage, protosTypes.google.cloud.vision.v1p4beta1.ICreateReferenceImageRequest | undefined, {} | undefined>): void; | ||
deleteReferenceImage(request: protosTypes.google.cloud.vision.v1p4beta1.IDeleteReferenceImageRequest, options?: gax.CallOptions): Promise<[protosTypes.google.protobuf.IEmpty, (protosTypes.google.cloud.vision.v1p4beta1.IDeleteReferenceImageRequest | undefined), {} | undefined]>; | ||
deleteReferenceImage(request: protosTypes.google.cloud.vision.v1p4beta1.IDeleteReferenceImageRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.protobuf.IEmpty, protosTypes.google.cloud.vision.v1p4beta1.IDeleteReferenceImageRequest | undefined, {} | undefined>): void; | ||
getReferenceImage(request: protosTypes.google.cloud.vision.v1p4beta1.IGetReferenceImageRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p4beta1.IReferenceImage, (protosTypes.google.cloud.vision.v1p4beta1.IGetReferenceImageRequest | undefined), {} | undefined]>; | ||
getReferenceImage(request: protosTypes.google.cloud.vision.v1p4beta1.IGetReferenceImageRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p4beta1.IReferenceImage, protosTypes.google.cloud.vision.v1p4beta1.IGetReferenceImageRequest | undefined, {} | undefined>): void; | ||
addProductToProductSet(request: protosTypes.google.cloud.vision.v1p4beta1.IAddProductToProductSetRequest, options?: gax.CallOptions): Promise<[protosTypes.google.protobuf.IEmpty, (protosTypes.google.cloud.vision.v1p4beta1.IAddProductToProductSetRequest | undefined), {} | undefined]>; | ||
addProductToProductSet(request: protosTypes.google.cloud.vision.v1p4beta1.IAddProductToProductSetRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.protobuf.IEmpty, protosTypes.google.cloud.vision.v1p4beta1.IAddProductToProductSetRequest | undefined, {} | undefined>): void; | ||
removeProductFromProductSet(request: protosTypes.google.cloud.vision.v1p4beta1.IRemoveProductFromProductSetRequest, options?: gax.CallOptions): Promise<[protosTypes.google.protobuf.IEmpty, (protosTypes.google.cloud.vision.v1p4beta1.IRemoveProductFromProductSetRequest | undefined), {} | undefined]>; | ||
removeProductFromProductSet(request: protosTypes.google.cloud.vision.v1p4beta1.IRemoveProductFromProductSetRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.protobuf.IEmpty, protosTypes.google.cloud.vision.v1p4beta1.IRemoveProductFromProductSetRequest | undefined, {} | undefined>): void; | ||
importProductSets(request: protosTypes.google.cloud.vision.v1p4beta1.IImportProductSetsRequest, options?: gax.CallOptions): Promise<[LROperation<protosTypes.google.cloud.vision.v1p4beta1.IImportProductSetsResponse, protosTypes.google.cloud.vision.v1p4beta1.IBatchOperationMetadata>, protosTypes.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
importProductSets(request: protosTypes.google.cloud.vision.v1p4beta1.IImportProductSetsRequest, options: gax.CallOptions, callback: Callback<LROperation<protosTypes.google.cloud.vision.v1p4beta1.IImportProductSetsResponse, protosTypes.google.cloud.vision.v1p4beta1.IBatchOperationMetadata>, protosTypes.google.longrunning.IOperation | undefined, {} | undefined>): void; | ||
purgeProducts(request: protosTypes.google.cloud.vision.v1p4beta1.IPurgeProductsRequest, options?: gax.CallOptions): Promise<[LROperation<protosTypes.google.protobuf.IEmpty, protosTypes.google.cloud.vision.v1p4beta1.IBatchOperationMetadata>, protosTypes.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
purgeProducts(request: protosTypes.google.cloud.vision.v1p4beta1.IPurgeProductsRequest, options: gax.CallOptions, callback: Callback<LROperation<protosTypes.google.protobuf.IEmpty, protosTypes.google.cloud.vision.v1p4beta1.IBatchOperationMetadata>, protosTypes.google.longrunning.IOperation | undefined, {} | undefined>): void; | ||
listProductSets(request: protosTypes.google.cloud.vision.v1p4beta1.IListProductSetsRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p4beta1.IProductSet[], protosTypes.google.cloud.vision.v1p4beta1.IListProductSetsRequest | null, protosTypes.google.cloud.vision.v1p4beta1.IListProductSetsResponse]>; | ||
listProductSets(request: protosTypes.google.cloud.vision.v1p4beta1.IListProductSetsRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p4beta1.IProductSet[], protosTypes.google.cloud.vision.v1p4beta1.IListProductSetsRequest | null, protosTypes.google.cloud.vision.v1p4beta1.IListProductSetsResponse>): void; | ||
createProductSet(request: protos.google.cloud.vision.v1p4beta1.ICreateProductSetRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p4beta1.IProductSet, protos.google.cloud.vision.v1p4beta1.ICreateProductSetRequest | undefined, {} | undefined]>; | ||
createProductSet(request: protos.google.cloud.vision.v1p4beta1.ICreateProductSetRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1p4beta1.IProductSet, protos.google.cloud.vision.v1p4beta1.ICreateProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
createProductSet(request: protos.google.cloud.vision.v1p4beta1.ICreateProductSetRequest, callback: Callback<protos.google.cloud.vision.v1p4beta1.IProductSet, protos.google.cloud.vision.v1p4beta1.ICreateProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
getProductSet(request: protos.google.cloud.vision.v1p4beta1.IGetProductSetRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p4beta1.IProductSet, protos.google.cloud.vision.v1p4beta1.IGetProductSetRequest | undefined, {} | undefined]>; | ||
getProductSet(request: protos.google.cloud.vision.v1p4beta1.IGetProductSetRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1p4beta1.IProductSet, protos.google.cloud.vision.v1p4beta1.IGetProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
getProductSet(request: protos.google.cloud.vision.v1p4beta1.IGetProductSetRequest, callback: Callback<protos.google.cloud.vision.v1p4beta1.IProductSet, protos.google.cloud.vision.v1p4beta1.IGetProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
updateProductSet(request: protos.google.cloud.vision.v1p4beta1.IUpdateProductSetRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p4beta1.IProductSet, protos.google.cloud.vision.v1p4beta1.IUpdateProductSetRequest | undefined, {} | undefined]>; | ||
updateProductSet(request: protos.google.cloud.vision.v1p4beta1.IUpdateProductSetRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1p4beta1.IProductSet, protos.google.cloud.vision.v1p4beta1.IUpdateProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
updateProductSet(request: protos.google.cloud.vision.v1p4beta1.IUpdateProductSetRequest, callback: Callback<protos.google.cloud.vision.v1p4beta1.IProductSet, protos.google.cloud.vision.v1p4beta1.IUpdateProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
deleteProductSet(request: protos.google.cloud.vision.v1p4beta1.IDeleteProductSetRequest, options?: gax.CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p4beta1.IDeleteProductSetRequest | undefined, {} | undefined]>; | ||
deleteProductSet(request: protos.google.cloud.vision.v1p4beta1.IDeleteProductSetRequest, options: gax.CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p4beta1.IDeleteProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
deleteProductSet(request: protos.google.cloud.vision.v1p4beta1.IDeleteProductSetRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p4beta1.IDeleteProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
createProduct(request: protos.google.cloud.vision.v1p4beta1.ICreateProductRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p4beta1.IProduct, protos.google.cloud.vision.v1p4beta1.ICreateProductRequest | undefined, {} | undefined]>; | ||
createProduct(request: protos.google.cloud.vision.v1p4beta1.ICreateProductRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1p4beta1.IProduct, protos.google.cloud.vision.v1p4beta1.ICreateProductRequest | null | undefined, {} | null | undefined>): void; | ||
createProduct(request: protos.google.cloud.vision.v1p4beta1.ICreateProductRequest, callback: Callback<protos.google.cloud.vision.v1p4beta1.IProduct, protos.google.cloud.vision.v1p4beta1.ICreateProductRequest | null | undefined, {} | null | undefined>): void; | ||
getProduct(request: protos.google.cloud.vision.v1p4beta1.IGetProductRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p4beta1.IProduct, protos.google.cloud.vision.v1p4beta1.IGetProductRequest | undefined, {} | undefined]>; | ||
getProduct(request: protos.google.cloud.vision.v1p4beta1.IGetProductRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1p4beta1.IProduct, protos.google.cloud.vision.v1p4beta1.IGetProductRequest | null | undefined, {} | null | undefined>): void; | ||
getProduct(request: protos.google.cloud.vision.v1p4beta1.IGetProductRequest, callback: Callback<protos.google.cloud.vision.v1p4beta1.IProduct, protos.google.cloud.vision.v1p4beta1.IGetProductRequest | null | undefined, {} | null | undefined>): void; | ||
updateProduct(request: protos.google.cloud.vision.v1p4beta1.IUpdateProductRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p4beta1.IProduct, protos.google.cloud.vision.v1p4beta1.IUpdateProductRequest | undefined, {} | undefined]>; | ||
updateProduct(request: protos.google.cloud.vision.v1p4beta1.IUpdateProductRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1p4beta1.IProduct, protos.google.cloud.vision.v1p4beta1.IUpdateProductRequest | null | undefined, {} | null | undefined>): void; | ||
updateProduct(request: protos.google.cloud.vision.v1p4beta1.IUpdateProductRequest, callback: Callback<protos.google.cloud.vision.v1p4beta1.IProduct, protos.google.cloud.vision.v1p4beta1.IUpdateProductRequest | null | undefined, {} | null | undefined>): void; | ||
deleteProduct(request: protos.google.cloud.vision.v1p4beta1.IDeleteProductRequest, options?: gax.CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p4beta1.IDeleteProductRequest | undefined, {} | undefined]>; | ||
deleteProduct(request: protos.google.cloud.vision.v1p4beta1.IDeleteProductRequest, options: gax.CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p4beta1.IDeleteProductRequest | null | undefined, {} | null | undefined>): void; | ||
deleteProduct(request: protos.google.cloud.vision.v1p4beta1.IDeleteProductRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p4beta1.IDeleteProductRequest | null | undefined, {} | null | undefined>): void; | ||
createReferenceImage(request: protos.google.cloud.vision.v1p4beta1.ICreateReferenceImageRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p4beta1.IReferenceImage, (protos.google.cloud.vision.v1p4beta1.ICreateReferenceImageRequest | undefined), {} | undefined]>; | ||
createReferenceImage(request: protos.google.cloud.vision.v1p4beta1.ICreateReferenceImageRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1p4beta1.IReferenceImage, protos.google.cloud.vision.v1p4beta1.ICreateReferenceImageRequest | null | undefined, {} | null | undefined>): void; | ||
createReferenceImage(request: protos.google.cloud.vision.v1p4beta1.ICreateReferenceImageRequest, callback: Callback<protos.google.cloud.vision.v1p4beta1.IReferenceImage, protos.google.cloud.vision.v1p4beta1.ICreateReferenceImageRequest | null | undefined, {} | null | undefined>): void; | ||
deleteReferenceImage(request: protos.google.cloud.vision.v1p4beta1.IDeleteReferenceImageRequest, options?: gax.CallOptions): Promise<[protos.google.protobuf.IEmpty, (protos.google.cloud.vision.v1p4beta1.IDeleteReferenceImageRequest | undefined), {} | undefined]>; | ||
deleteReferenceImage(request: protos.google.cloud.vision.v1p4beta1.IDeleteReferenceImageRequest, options: gax.CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p4beta1.IDeleteReferenceImageRequest | null | undefined, {} | null | undefined>): void; | ||
deleteReferenceImage(request: protos.google.cloud.vision.v1p4beta1.IDeleteReferenceImageRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p4beta1.IDeleteReferenceImageRequest | null | undefined, {} | null | undefined>): void; | ||
getReferenceImage(request: protos.google.cloud.vision.v1p4beta1.IGetReferenceImageRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p4beta1.IReferenceImage, (protos.google.cloud.vision.v1p4beta1.IGetReferenceImageRequest | undefined), {} | undefined]>; | ||
getReferenceImage(request: protos.google.cloud.vision.v1p4beta1.IGetReferenceImageRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.vision.v1p4beta1.IReferenceImage, protos.google.cloud.vision.v1p4beta1.IGetReferenceImageRequest | null | undefined, {} | null | undefined>): void; | ||
getReferenceImage(request: protos.google.cloud.vision.v1p4beta1.IGetReferenceImageRequest, callback: Callback<protos.google.cloud.vision.v1p4beta1.IReferenceImage, protos.google.cloud.vision.v1p4beta1.IGetReferenceImageRequest | null | undefined, {} | null | undefined>): void; | ||
addProductToProductSet(request: protos.google.cloud.vision.v1p4beta1.IAddProductToProductSetRequest, options?: gax.CallOptions): Promise<[protos.google.protobuf.IEmpty, (protos.google.cloud.vision.v1p4beta1.IAddProductToProductSetRequest | undefined), {} | undefined]>; | ||
addProductToProductSet(request: protos.google.cloud.vision.v1p4beta1.IAddProductToProductSetRequest, options: gax.CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p4beta1.IAddProductToProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
addProductToProductSet(request: protos.google.cloud.vision.v1p4beta1.IAddProductToProductSetRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p4beta1.IAddProductToProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
removeProductFromProductSet(request: protos.google.cloud.vision.v1p4beta1.IRemoveProductFromProductSetRequest, options?: gax.CallOptions): Promise<[protos.google.protobuf.IEmpty, (protos.google.cloud.vision.v1p4beta1.IRemoveProductFromProductSetRequest | undefined), {} | undefined]>; | ||
removeProductFromProductSet(request: protos.google.cloud.vision.v1p4beta1.IRemoveProductFromProductSetRequest, options: gax.CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p4beta1.IRemoveProductFromProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
removeProductFromProductSet(request: protos.google.cloud.vision.v1p4beta1.IRemoveProductFromProductSetRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p4beta1.IRemoveProductFromProductSetRequest | null | undefined, {} | null | undefined>): void; | ||
importProductSets(request: protos.google.cloud.vision.v1p4beta1.IImportProductSetsRequest, options?: gax.CallOptions): Promise<[LROperation<protos.google.cloud.vision.v1p4beta1.IImportProductSetsResponse, protos.google.cloud.vision.v1p4beta1.IBatchOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
importProductSets(request: protos.google.cloud.vision.v1p4beta1.IImportProductSetsRequest, options: gax.CallOptions, callback: Callback<LROperation<protos.google.cloud.vision.v1p4beta1.IImportProductSetsResponse, protos.google.cloud.vision.v1p4beta1.IBatchOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
importProductSets(request: protos.google.cloud.vision.v1p4beta1.IImportProductSetsRequest, callback: Callback<LROperation<protos.google.cloud.vision.v1p4beta1.IImportProductSetsResponse, protos.google.cloud.vision.v1p4beta1.IBatchOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
/** | ||
* Check the status of the long running operation returned by the importProductSets() method. | ||
* @param {String} name | ||
* The operation name that will be passed. | ||
* @returns {Promise} - The promise which resolves to an object. | ||
* The decoded operation object has result and metadata field to get information from. | ||
* | ||
* @example: | ||
* const decodedOperation = await checkImportProductSetsProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
* | ||
*/ | ||
checkImportProductSetsProgress(name: string): Promise<LROperation<protos.google.cloud.vision.v1p4beta1.ImportProductSetsResponse, protos.google.cloud.vision.v1p4beta1.BatchOperationMetadata>>; | ||
purgeProducts(request: protos.google.cloud.vision.v1p4beta1.IPurgeProductsRequest, options?: gax.CallOptions): Promise<[LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p4beta1.IBatchOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
purgeProducts(request: protos.google.cloud.vision.v1p4beta1.IPurgeProductsRequest, options: gax.CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p4beta1.IBatchOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
purgeProducts(request: protos.google.cloud.vision.v1p4beta1.IPurgeProductsRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1p4beta1.IBatchOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
/** | ||
* Check the status of the long running operation returned by the purgeProducts() method. | ||
* @param {String} name | ||
* The operation name that will be passed. | ||
* @returns {Promise} - The promise which resolves to an object. | ||
* The decoded operation object has result and metadata field to get information from. | ||
* | ||
* @example: | ||
* const decodedOperation = await checkPurgeProductsProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
* | ||
*/ | ||
checkPurgeProductsProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.vision.v1p4beta1.BatchOperationMetadata>>; | ||
listProductSets(request: protos.google.cloud.vision.v1p4beta1.IListProductSetsRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p4beta1.IProductSet[], protos.google.cloud.vision.v1p4beta1.IListProductSetsRequest | null, protos.google.cloud.vision.v1p4beta1.IListProductSetsResponse]>; | ||
listProductSets(request: protos.google.cloud.vision.v1p4beta1.IListProductSetsRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.cloud.vision.v1p4beta1.IListProductSetsRequest, protos.google.cloud.vision.v1p4beta1.IListProductSetsResponse | null | undefined, protos.google.cloud.vision.v1p4beta1.IProductSet>): void; | ||
listProductSets(request: protos.google.cloud.vision.v1p4beta1.IListProductSetsRequest, callback: PaginationCallback<protos.google.cloud.vision.v1p4beta1.IListProductSetsRequest, protos.google.cloud.vision.v1p4beta1.IListProductSetsResponse | null | undefined, protos.google.cloud.vision.v1p4beta1.IProductSet>): void; | ||
/** | ||
* Equivalent to {@link listProductSets}, but returns a NodeJS Stream object. | ||
@@ -166,6 +216,28 @@ * | ||
*/ | ||
listProductSetsStream(request?: protosTypes.google.cloud.vision.v1p4beta1.IListProductSetsRequest, options?: gax.CallOptions): Transform; | ||
listProducts(request: protosTypes.google.cloud.vision.v1p4beta1.IListProductsRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p4beta1.IProduct[], protosTypes.google.cloud.vision.v1p4beta1.IListProductsRequest | null, protosTypes.google.cloud.vision.v1p4beta1.IListProductsResponse]>; | ||
listProducts(request: protosTypes.google.cloud.vision.v1p4beta1.IListProductsRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p4beta1.IProduct[], protosTypes.google.cloud.vision.v1p4beta1.IListProductsRequest | null, protosTypes.google.cloud.vision.v1p4beta1.IListProductsResponse>): void; | ||
listProductSetsStream(request?: protos.google.cloud.vision.v1p4beta1.IListProductSetsRequest, options?: gax.CallOptions): Transform; | ||
/** | ||
* Equivalent to {@link listProductSets}, but returns an iterable object. | ||
* | ||
* for-await-of syntax is used with the iterable to recursively get response element on-demand. | ||
* | ||
* @param {Object} request | ||
* The request object that will be sent. | ||
* @param {string} request.parent | ||
* Required. The project from which ProductSets should be listed. | ||
* | ||
* Format is `projects/PROJECT_ID/locations/LOC_ID`. | ||
* @param {number} request.pageSize | ||
* The maximum number of items to return. Default 10, maximum 100. | ||
* @param {string} request.pageToken | ||
* The next_page_token returned from a previous List request, if any. | ||
* @param {object} [options] | ||
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. | ||
* @returns {Object} | ||
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. | ||
*/ | ||
listProductSetsAsync(request?: protos.google.cloud.vision.v1p4beta1.IListProductSetsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.cloud.vision.v1p4beta1.IProductSet>; | ||
listProducts(request: protos.google.cloud.vision.v1p4beta1.IListProductsRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p4beta1.IProduct[], protos.google.cloud.vision.v1p4beta1.IListProductsRequest | null, protos.google.cloud.vision.v1p4beta1.IListProductsResponse]>; | ||
listProducts(request: protos.google.cloud.vision.v1p4beta1.IListProductsRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.cloud.vision.v1p4beta1.IListProductsRequest, protos.google.cloud.vision.v1p4beta1.IListProductsResponse | null | undefined, protos.google.cloud.vision.v1p4beta1.IProduct>): void; | ||
listProducts(request: protos.google.cloud.vision.v1p4beta1.IListProductsRequest, callback: PaginationCallback<protos.google.cloud.vision.v1p4beta1.IListProductsRequest, protos.google.cloud.vision.v1p4beta1.IListProductsResponse | null | undefined, protos.google.cloud.vision.v1p4beta1.IProduct>): void; | ||
/** | ||
* Equivalent to {@link listProducts}, but returns a NodeJS Stream object. | ||
@@ -199,6 +271,29 @@ * | ||
*/ | ||
listProductsStream(request?: protosTypes.google.cloud.vision.v1p4beta1.IListProductsRequest, options?: gax.CallOptions): Transform; | ||
listReferenceImages(request: protosTypes.google.cloud.vision.v1p4beta1.IListReferenceImagesRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p4beta1.IReferenceImage[], protosTypes.google.cloud.vision.v1p4beta1.IListReferenceImagesRequest | null, protosTypes.google.cloud.vision.v1p4beta1.IListReferenceImagesResponse]>; | ||
listReferenceImages(request: protosTypes.google.cloud.vision.v1p4beta1.IListReferenceImagesRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p4beta1.IReferenceImage[], protosTypes.google.cloud.vision.v1p4beta1.IListReferenceImagesRequest | null, protosTypes.google.cloud.vision.v1p4beta1.IListReferenceImagesResponse>): void; | ||
listProductsStream(request?: protos.google.cloud.vision.v1p4beta1.IListProductsRequest, options?: gax.CallOptions): Transform; | ||
/** | ||
* Equivalent to {@link listProducts}, but returns an iterable object. | ||
* | ||
* for-await-of syntax is used with the iterable to recursively get response element on-demand. | ||
* | ||
* @param {Object} request | ||
* The request object that will be sent. | ||
* @param {string} request.parent | ||
* Required. The project OR ProductSet from which Products should be listed. | ||
* | ||
* Format: | ||
* `projects/PROJECT_ID/locations/LOC_ID` | ||
* @param {number} request.pageSize | ||
* The maximum number of items to return. Default 10, maximum 100. | ||
* @param {string} request.pageToken | ||
* The next_page_token returned from a previous List request, if any. | ||
* @param {object} [options] | ||
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. | ||
* @returns {Object} | ||
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. | ||
*/ | ||
listProductsAsync(request?: protos.google.cloud.vision.v1p4beta1.IListProductsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.cloud.vision.v1p4beta1.IProduct>; | ||
listReferenceImages(request: protos.google.cloud.vision.v1p4beta1.IListReferenceImagesRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p4beta1.IReferenceImage[], protos.google.cloud.vision.v1p4beta1.IListReferenceImagesRequest | null, protos.google.cloud.vision.v1p4beta1.IListReferenceImagesResponse]>; | ||
listReferenceImages(request: protos.google.cloud.vision.v1p4beta1.IListReferenceImagesRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.cloud.vision.v1p4beta1.IListReferenceImagesRequest, protos.google.cloud.vision.v1p4beta1.IListReferenceImagesResponse | null | undefined, protos.google.cloud.vision.v1p4beta1.IReferenceImage>): void; | ||
listReferenceImages(request: protos.google.cloud.vision.v1p4beta1.IListReferenceImagesRequest, callback: PaginationCallback<protos.google.cloud.vision.v1p4beta1.IListReferenceImagesRequest, protos.google.cloud.vision.v1p4beta1.IListReferenceImagesResponse | null | undefined, protos.google.cloud.vision.v1p4beta1.IReferenceImage>): void; | ||
/** | ||
* Equivalent to {@link listReferenceImages}, but returns a NodeJS Stream object. | ||
@@ -235,6 +330,32 @@ * | ||
*/ | ||
listReferenceImagesStream(request?: protosTypes.google.cloud.vision.v1p4beta1.IListReferenceImagesRequest, options?: gax.CallOptions): Transform; | ||
listProductsInProductSet(request: protosTypes.google.cloud.vision.v1p4beta1.IListProductsInProductSetRequest, options?: gax.CallOptions): Promise<[protosTypes.google.cloud.vision.v1p4beta1.IProduct[], protosTypes.google.cloud.vision.v1p4beta1.IListProductsInProductSetRequest | null, protosTypes.google.cloud.vision.v1p4beta1.IListProductsInProductSetResponse]>; | ||
listProductsInProductSet(request: protosTypes.google.cloud.vision.v1p4beta1.IListProductsInProductSetRequest, options: gax.CallOptions, callback: Callback<protosTypes.google.cloud.vision.v1p4beta1.IProduct[], protosTypes.google.cloud.vision.v1p4beta1.IListProductsInProductSetRequest | null, protosTypes.google.cloud.vision.v1p4beta1.IListProductsInProductSetResponse>): void; | ||
listReferenceImagesStream(request?: protos.google.cloud.vision.v1p4beta1.IListReferenceImagesRequest, options?: gax.CallOptions): Transform; | ||
/** | ||
* Equivalent to {@link listReferenceImages}, but returns an iterable object. | ||
* | ||
* for-await-of syntax is used with the iterable to recursively get response element on-demand. | ||
* | ||
* @param {Object} request | ||
* The request object that will be sent. | ||
* @param {string} request.parent | ||
* Required. Resource name of the product containing the reference images. | ||
* | ||
* Format is | ||
* `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. | ||
* @param {number} request.pageSize | ||
* The maximum number of items to return. Default 10, maximum 100. | ||
* @param {string} request.pageToken | ||
* A token identifying a page of results to be returned. This is the value | ||
* of `nextPageToken` returned in a previous reference image list request. | ||
* | ||
* Defaults to the first page if not specified. | ||
* @param {object} [options] | ||
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. | ||
* @returns {Object} | ||
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. | ||
*/ | ||
listReferenceImagesAsync(request?: protos.google.cloud.vision.v1p4beta1.IListReferenceImagesRequest, options?: gax.CallOptions): AsyncIterable<protos.google.cloud.vision.v1p4beta1.IReferenceImage>; | ||
listProductsInProductSet(request: protos.google.cloud.vision.v1p4beta1.IListProductsInProductSetRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.vision.v1p4beta1.IProduct[], protos.google.cloud.vision.v1p4beta1.IListProductsInProductSetRequest | null, protos.google.cloud.vision.v1p4beta1.IListProductsInProductSetResponse]>; | ||
listProductsInProductSet(request: protos.google.cloud.vision.v1p4beta1.IListProductsInProductSetRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.cloud.vision.v1p4beta1.IListProductsInProductSetRequest, protos.google.cloud.vision.v1p4beta1.IListProductsInProductSetResponse | null | undefined, protos.google.cloud.vision.v1p4beta1.IProduct>): void; | ||
listProductsInProductSet(request: protos.google.cloud.vision.v1p4beta1.IListProductsInProductSetRequest, callback: PaginationCallback<protos.google.cloud.vision.v1p4beta1.IListProductsInProductSetRequest, protos.google.cloud.vision.v1p4beta1.IListProductsInProductSetResponse | null | undefined, protos.google.cloud.vision.v1p4beta1.IProduct>): void; | ||
/** | ||
* Equivalent to {@link listProductsInProductSet}, but returns a NodeJS Stream object. | ||
@@ -268,4 +389,26 @@ * | ||
*/ | ||
listProductsInProductSetStream(request?: protosTypes.google.cloud.vision.v1p4beta1.IListProductsInProductSetRequest, options?: gax.CallOptions): Transform; | ||
listProductsInProductSetStream(request?: protos.google.cloud.vision.v1p4beta1.IListProductsInProductSetRequest, options?: gax.CallOptions): Transform; | ||
/** | ||
* Equivalent to {@link listProductsInProductSet}, but returns an iterable object. | ||
* | ||
* for-await-of syntax is used with the iterable to recursively get response element on-demand. | ||
* | ||
* @param {Object} request | ||
* The request object that will be sent. | ||
* @param {string} request.name | ||
* Required. The ProductSet resource for which to retrieve Products. | ||
* | ||
* Format is: | ||
* `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` | ||
* @param {number} request.pageSize | ||
* The maximum number of items to return. Default 10, maximum 100. | ||
* @param {string} request.pageToken | ||
* The next_page_token returned from a previous List request, if any. | ||
* @param {object} [options] | ||
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. | ||
* @returns {Object} | ||
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. | ||
*/ | ||
listProductsInProductSetAsync(request?: protos.google.cloud.vision.v1p4beta1.IListProductsInProductSetRequest, options?: gax.CallOptions): AsyncIterable<protos.google.cloud.vision.v1p4beta1.IProduct>; | ||
/** | ||
* Return a fully-qualified location resource name string. | ||
@@ -285,3 +428,3 @@ * | ||
*/ | ||
matchProjectFromLocationName(locationName: string): string; | ||
matchProjectFromLocationName(locationName: string): string | number; | ||
/** | ||
@@ -294,3 +437,3 @@ * Parse the location from Location resource. | ||
*/ | ||
matchLocationFromLocationName(locationName: string): string; | ||
matchLocationFromLocationName(locationName: string): string | number; | ||
/** | ||
@@ -312,3 +455,3 @@ * Return a fully-qualified product resource name string. | ||
*/ | ||
matchProjectFromProductName(productName: string): string; | ||
matchProjectFromProductName(productName: string): string | number; | ||
/** | ||
@@ -321,3 +464,3 @@ * Parse the location from Product resource. | ||
*/ | ||
matchLocationFromProductName(productName: string): string; | ||
matchLocationFromProductName(productName: string): string | number; | ||
/** | ||
@@ -330,3 +473,3 @@ * Parse the product from Product resource. | ||
*/ | ||
matchProductFromProductName(productName: string): string; | ||
matchProductFromProductName(productName: string): string | number; | ||
/** | ||
@@ -348,3 +491,3 @@ * Return a fully-qualified productSet resource name string. | ||
*/ | ||
matchProjectFromProductSetName(productSetName: string): string; | ||
matchProjectFromProductSetName(productSetName: string): string | number; | ||
/** | ||
@@ -357,3 +500,3 @@ * Parse the location from ProductSet resource. | ||
*/ | ||
matchLocationFromProductSetName(productSetName: string): string; | ||
matchLocationFromProductSetName(productSetName: string): string | number; | ||
/** | ||
@@ -366,3 +509,3 @@ * Parse the product_set from ProductSet resource. | ||
*/ | ||
matchProductSetFromProductSetName(productSetName: string): string; | ||
matchProductSetFromProductSetName(productSetName: string): string | number; | ||
/** | ||
@@ -385,3 +528,3 @@ * Return a fully-qualified referenceImage resource name string. | ||
*/ | ||
matchProjectFromReferenceImageName(referenceImageName: string): string; | ||
matchProjectFromReferenceImageName(referenceImageName: string): string | number; | ||
/** | ||
@@ -394,3 +537,3 @@ * Parse the location from ReferenceImage resource. | ||
*/ | ||
matchLocationFromReferenceImageName(referenceImageName: string): string; | ||
matchLocationFromReferenceImageName(referenceImageName: string): string | number; | ||
/** | ||
@@ -403,3 +546,3 @@ * Parse the product from ReferenceImage resource. | ||
*/ | ||
matchProductFromReferenceImageName(referenceImageName: string): string; | ||
matchProductFromReferenceImageName(referenceImageName: string): string | number; | ||
/** | ||
@@ -412,3 +555,3 @@ * Parse the reference_image from ReferenceImage resource. | ||
*/ | ||
matchReferenceImageFromReferenceImageName(referenceImageName: string): string; | ||
matchReferenceImageFromReferenceImageName(referenceImageName: string): string | number; | ||
/** | ||
@@ -415,0 +558,0 @@ * Terminate the GRPC channel and close the client. |
@@ -7,2 +7,25 @@ # Changelog | ||
## [2.0.0](https://www.github.com/googleapis/nodejs-vision/compare/v1.11.0...v2.0.0) (2020-06-04) | ||
### ⚠ BREAKING CHANGES | ||
* The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. | ||
### Features | ||
* check status of long running operation by its name ([#773](https://www.github.com/googleapis/nodejs-vision/issues/773)) ([2b3becf](https://www.github.com/googleapis/nodejs-vision/commit/2b3becf530294202d361d7a8f35601973332eafe)) | ||
* drop node8 support, support for async iterators ([#568](https://www.github.com/googleapis/nodejs-vision/issues/568)) ([e2dccd0](https://www.github.com/googleapis/nodejs-vision/commit/e2dccd02d20ed82ed679fff629b5a4aab47b39b6)) | ||
### Bug Fixes | ||
* **deps:** update dependency @google-cloud/promisify to v2 ([#565](https://www.github.com/googleapis/nodejs-vision/issues/565)) ([c71a709](https://www.github.com/googleapis/nodejs-vision/commit/c71a70926568367fa89fbbf4226e40fcb44f679e)) | ||
* **deps:** update dependency mathjs to v7 ([#775](https://www.github.com/googleapis/nodejs-vision/issues/775)) ([d64d99f](https://www.github.com/googleapis/nodejs-vision/commit/d64d99fe615a7048a5537fbcb8fbf3364e1c53c0)) | ||
* **deps:** update dependency natural to v1 ([#768](https://www.github.com/googleapis/nodejs-vision/issues/768)) ([44a8dcc](https://www.github.com/googleapis/nodejs-vision/commit/44a8dcc389489829f927015a1070e516f2e786b0)) | ||
* **deps:** update dependency natural to v2 ([#772](https://www.github.com/googleapis/nodejs-vision/issues/772)) ([afdc8da](https://www.github.com/googleapis/nodejs-vision/commit/afdc8da5f4181b5d43c3dc0155294495d647645a)) | ||
* **samples:** use pureimage instead of canvas ([#774](https://www.github.com/googleapis/nodejs-vision/issues/774)) ([a352338](https://www.github.com/googleapis/nodejs-vision/commit/a3523388bace85f19041202c74be4beb705d620d)) | ||
* mocha tests ([#784](https://www.github.com/googleapis/nodejs-vision/issues/784)) ([319c98e](https://www.github.com/googleapis/nodejs-vision/commit/319c98e284a622876e055cfd7a249750d600ce76)) | ||
* remove eslint, update gax, fix generated protos, run the generator ([#756](https://www.github.com/googleapis/nodejs-vision/issues/756)) ([72f22b6](https://www.github.com/googleapis/nodejs-vision/commit/72f22b60e1491963ea1d22a4f96feabe07be0376)) | ||
## [1.11.0](https://www.github.com/googleapis/nodejs-vision/compare/v1.10.0...v1.11.0) (2020-03-11) | ||
@@ -9,0 +32,0 @@ |
{ | ||
"name": "@google-cloud/vision", | ||
"description": "Google Cloud Vision API client for Node.js", | ||
"version": "1.11.0", | ||
"version": "2.0.0", | ||
"license": "Apache-2.0", | ||
"author": "Google Inc", | ||
"engines": { | ||
"node": ">=8.10.0" | ||
"node": ">=10" | ||
}, | ||
@@ -32,3 +32,3 @@ "repository": "googleapis/nodejs-vision", | ||
"samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../", | ||
"lint": "gts fix && eslint --fix samples/*.js", | ||
"lint": "gts check", | ||
"docs": "jsdoc -c .jsdoc.js", | ||
@@ -40,27 +40,24 @@ "system-test": "mocha build/system-test", | ||
"predocs-test": "npm run docs", | ||
"prelint": "cd samples; npm link ../; npm i", | ||
"prelint": "cd samples; npm link ../; npm install", | ||
"clean": "gts clean", | ||
"compile": "tsc -p . && cp -r protos build/", | ||
"compile-protos": "compileProtos src", | ||
"prepare": "npm run compile" | ||
"prepare": "npm run compile", | ||
"precompile": "gts clean" | ||
}, | ||
"dependencies": { | ||
"@google-cloud/promisify": "^1.0.4", | ||
"google-gax": "^1.14.1", | ||
"@google-cloud/promisify": "^2.0.0", | ||
"google-gax": "^2.3.1", | ||
"is": "^3.3.0" | ||
}, | ||
"devDependencies": { | ||
"@google-cloud/storage": "^5.0.0", | ||
"@types/is": "0.0.21", | ||
"@types/mocha": "^7.0.1", | ||
"@types/node": "^13.7.4", | ||
"@types/is": "0.0.21", | ||
"@types/sinon": "^7.5.1", | ||
"@types/uuid": "^3.4.7", | ||
"@types/sinon": "^9.0.0", | ||
"@types/uuid": "^8.0.0", | ||
"c8": "^7.1.0", | ||
"@google-cloud/storage": "^4.3.1", | ||
"codecov": "^3.6.5", | ||
"eslint": "^6.8.0", | ||
"eslint-config-prettier": "^6.10.0", | ||
"eslint-plugin-node": "^11.0.0", | ||
"eslint-plugin-prettier": "^3.1.2", | ||
"gts": "^1.1.2", | ||
"gts": "^2.0.0", | ||
"jsdoc": "^3.6.3", | ||
@@ -71,9 +68,8 @@ "jsdoc-fresh": "^1.0.2", | ||
"mocha": "^7.0.1", | ||
"prettier": "^1.19.1", | ||
"sinon": "^9.0.0", | ||
"uuid": "^3.4.0", | ||
"null-loader": "^3.0.0", | ||
"null-loader": "^4.0.0", | ||
"pack-n-play": "^1.0.0-2", | ||
"ts-loader": "^6.2.1", | ||
"typescript": "^3.7.0", | ||
"sinon": "^9.0.1", | ||
"ts-loader": "^7.0.0", | ||
"typescript": "^3.8.3", | ||
"uuid": "^8.0.0", | ||
"webpack": "^4.41.6", | ||
@@ -80,0 +76,0 @@ "webpack-cli": "^3.3.11" |
@@ -100,2 +100,23 @@ [//]: # "This README.md file is auto-generated, all changes to this file will be lost." | ||
## Supported Node.js Versions | ||
Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). | ||
Libraries are compatible with all current _active_ and _maintenance_ versions of | ||
Node.js. | ||
Client libraries targetting some end-of-life versions of Node.js are available, and | ||
can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). | ||
The dist-tags follow the naming convention `legacy-(version)`. | ||
_Legacy Node.js versions are supported as a best effort:_ | ||
* Legacy versions will not be tested in continuous integration. | ||
* Some security patches may not be able to be backported. | ||
* Dependencies will not be kept up-to-date, and features will not be backported. | ||
#### Legacy tags available | ||
* `legacy-8`: install client libraries from this dist-tag for versions | ||
compatible with Node.js 8. | ||
## Versioning | ||
@@ -124,2 +145,8 @@ | ||
Please note that this `README.md`, the `samples/README.md`, | ||
and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) | ||
are generated from a central template. To edit one of these files, make an edit | ||
to its template in this | ||
[directory](https://github.com/googleapis/synthtool/tree/master/synthtool/gcp/templates/node_library). | ||
## License | ||
@@ -126,0 +153,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11018279
22
59940
163
+ Added@google-cloud/promisify@2.0.4(transitive)
+ Added@grpc/grpc-js@1.6.12(transitive)
+ Added@grpc/proto-loader@0.6.130.7.13(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedcliui@7.0.48.0.1(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedduplexify@4.1.3(transitive)
+ Addedemoji-regex@8.0.0(transitive)
+ Addedescalade@3.2.0(transitive)
+ Addedgaxios@4.3.3(transitive)
+ Addedgcp-metadata@4.3.1(transitive)
+ Addedget-caller-file@2.0.5(transitive)
+ Addedgoogle-auth-library@7.14.1(transitive)
+ Addedgoogle-gax@2.30.5(transitive)
+ Addedgoogle-p12-pem@3.1.4(transitive)
+ Addedgtoken@5.3.2(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedjson-bigint@1.0.0(transitive)
+ Addedlong@5.2.3(transitive)
+ Addedlru-cache@6.0.0(transitive)
+ Addednode-forge@1.3.1(transitive)
+ Addedobject-hash@3.0.0(transitive)
+ Addedproto3-json-serializer@0.1.9(transitive)
+ Addedprotobufjs@6.11.37.4.0(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedrequire-directory@2.1.1(transitive)
+ Addedstring-width@4.2.3(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedwrap-ansi@7.0.0(transitive)
+ Addedy18n@5.0.8(transitive)
+ Addedyallist@4.0.0(transitive)
+ Addedyargs@16.2.017.7.2(transitive)
+ Addedyargs-parser@20.2.921.1.1(transitive)
- Removed@google-cloud/promisify@1.0.4(transitive)
- Removed@grpc/grpc-js@1.3.8(transitive)
- Removed@grpc/proto-loader@0.5.6(transitive)
- Removed@types/fs-extra@8.1.5(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedduplexify@3.7.1(transitive)
- Removedgaxios@2.3.4(transitive)
- Removedgcp-metadata@3.5.0(transitive)
- Removedgoogle-auth-library@5.10.1(transitive)
- Removedgoogle-gax@1.15.4(transitive)
- Removedgoogle-p12-pem@2.0.5(transitive)
- Removedgtoken@4.1.4(transitive)
- Removedisarray@1.0.0(transitive)
- Removedjson-bigint@0.3.1(transitive)
- Removedlodash.at@4.6.0(transitive)
- Removedlodash.has@4.5.2(transitive)
- Removedlru-cache@5.1.1(transitive)
- Removedmime@2.6.0(transitive)
- Removednode-forge@0.10.0(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedprotobufjs@6.11.4(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedsemver@6.3.1(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedwalkdir@0.4.1(transitive)
- Removedyallist@3.1.1(transitive)
Updatedgoogle-gax@^2.3.1