# Class v1.ProductSearchClient (5.3.5)

5.3.5 (latest) 5.2.0 4.3.2 4.2.1 4.0.3 3.1.3 3.0.1 2.4.2 2.3.8 Manages Products and ProductSets of reference images for use in product search. It uses the following resource model:

- The API has a collection of [ProductSet](https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.productset) resources, named `projects/* /locations/* /productSets/*`, which acts as a way to put different products into groups to limit identification.

In parallel,

- The API has a collection of resources, named `projects/* /locations/* /products/*`

- Each has a collection of [ReferenceImage](https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.referenceimage) resources, named `projects/* /locations/* /products/* /referenceImages/*` v1

## Package

[@google-cloud/vision](https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html)

## Constructors

### (constructor)(opts, gaxInstance)

    constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);

Construct an instance of ProductSearchClient.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `opts` | `ClientOptions` |
| `gaxInstance` | `typeof gax | typeof fallback` : loaded instance of `google-gax`. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: \`\`\` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new ProductSearchClient({fallback: true}, gax); \`\`\` |

## Properties

### apiEndpoint

    get apiEndpoint(): string;

The DNS address for this API service.

### apiEndpoint

    static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath.

### auth

    auth: gax.GoogleAuth;

### descriptors

    descriptors: Descriptors;

### innerApiCalls

    innerApiCalls: {
            [name: string]: Function;
        };

### operationsClient

    operationsClient: gax.OperationsClient;

### pathTemplates

    pathTemplates: {
            [name: string]: gax.PathTemplate;
        };

### port

    static get port(): number;

The port for this API service.

### productSearchStub

    productSearchStub?: Promise<{
            [name: string]: Function;
        }>;

### scopes

    static get scopes(): string[];

The scopes needed to make gRPC calls for every method defined in this service.

### servicePath

    static get servicePath(): string;

The DNS address for this API service.

### universeDomain

    get universeDomain(): string;

### warn

    warn: (code: string, message: string, warnType?: string) => void;

## Methods

### addProductToProductSet(request, options)

    addProductToProductSet(request?: protos.google.cloud.vision.v1.IAddProductToProductSetRequest, options?: CallOptions): Promise<[
            protos.google.protobuf.IEmpty,
            protos.google.cloud.vision.v1.IAddProductToProductSetRequest | undefined,
            {} | undefined
        ]>;

Adds a Product to the specified ProductSet. If the Product is already present, no change is made.

One Product can be added to at most 100 ProductSets.

Possible errors:

\* Returns NOT_FOUND if the Product or the ProductSet doesn't exist.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iaddproducttoproductsetrequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<[ https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.iempty, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iaddproducttoproductsetrequest | undefined, {} | undefined ]>` | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Empty](https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.empty). Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |

**Example**


      /**
       * This snippet has been automatically generated and should be regarded as a code template only.
       * It will require modifications to work.
       * It may require correct/in-range values for request initialization.
       * TODO(developer): Uncomment these variables before running the sample.
       */
      /**
       *  Required. The resource name for the ProductSet to modify.
       *  Format is:
       *  `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
       */
      // const name = 'abc123'
      /**
       *  Required. The resource name for the Product to be added to this ProductSet.
       *  Format is:
       *  `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
       */
      // const product = 'abc123'

      // Imports the Vision library
      const {ProductSearchClient} = require('https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html').v1;

      // Instantiates a client
      const visionClient = new https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html();

      async function callAddProductToProductSet() {
        // Construct request
        const request = {
          name,
          product,
        };

        // Run request
        const response = await visionClient.addProductToProductSet(request);
        console.log(response);
      }

      callAddProductToProductSet();

### addProductToProductSet(request, options, callback)

    addProductToProductSet(request: protos.google.cloud.vision.v1.IAddProductToProductSetRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1.IAddProductToProductSetRequest | null | undefined, {} | null | undefined>): void;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iaddproducttoproductsetrequest` |
| `options` | `CallOptions` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.iempty, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iaddproducttoproductsetrequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### addProductToProductSet(request, callback)

    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;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iaddproducttoproductsetrequest` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.iempty, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iaddproducttoproductsetrequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### cancelOperation(request, optionsOrCallback, callback)

    cancelOperation(request: protos.google.longrunning.CancelOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>, callback?: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): Promise<protos.google.protobuf.Empty>;

Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an value with a of 1, corresponding to `Code.CANCELLED`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.longrunning.canceloperationrequest` The request object that will be sent. |
| `optionsOrCallback` | `CallOptions | Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.longrunning.canceloperationrequest, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.empty, {} | undefined | null>` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.longrunning.canceloperationrequest, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.empty, {} | undefined | null>` The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.empty>` |   |

**Example**


    const client = longrunning.operationsClient();
    await client.cancelOperation({name: ''});

### checkImportProductSetsProgress(name)

    checkImportProductSetsProgress(name: string): Promise<LROperation<protos.google.cloud.vision.v1.ImportProductSetsResponse, protos.google.cloud.vision.v1.BatchOperationMetadata>>;

Check the status of the long running operation returned by `importProductSets()`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `string` The operation name that will be passed. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<LROperation<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.importproductsetsresponse, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.batchoperationmetadata-class>>` | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. |

**Example**


      /**
       * This snippet has been automatically generated and should be regarded as a code template only.
       * It will require modifications to work.
       * It may require correct/in-range values for request initialization.
       * TODO(developer): Uncomment these variables before running the sample.
       */
      /**
       *  Required. The project in which the ProductSets should be imported.
       *  Format is `projects/PROJECT_ID/locations/LOC_ID`.
       */
      // const parent = 'abc123'
      /**
       *  Required. The input content for the list of requests.
       */
      // const inputConfig = {}

      // Imports the Vision library
      const {ProductSearchClient} = require('https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html').v1;

      // Instantiates a client
      const visionClient = new https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html();

      async function callImportProductSets() {
        // Construct request
        const request = {
          parent,
          inputConfig,
        };

        // Run request
        const [operation] = await visionClient.importProductSets(request);
        const [response] = await operation.promise();
        console.log(response);
      }

      callImportProductSets();

### checkPurgeProductsProgress(name)

    checkPurgeProductsProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.vision.v1.BatchOperationMetadata>>;

Check the status of the long running operation returned by `purgeProducts()`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `string` The operation name that will be passed. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<LROperation<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.empty, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.batchoperationmetadata-class>>` | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. |

**Example**


      /**
       * This snippet has been automatically generated and should be regarded as a code template only.
       * It will require modifications to work.
       * It may require correct/in-range values for request initialization.
       * TODO(developer): Uncomment these variables before running the sample.
       */
      /**
       *  Specify which ProductSet contains the Products to be deleted.
       */
      // const productSetPurgeConfig = {}
      /**
       *  If delete_orphan_products is true, all Products that are not in any
       *  ProductSet will be deleted.
       */
      // const deleteOrphanProducts = true
      /**
       *  Required. The project and location in which the Products should be deleted.
       *  Format is `projects/PROJECT_ID/locations/LOC_ID`.
       */
      // const parent = 'abc123'
      /**
       *  The default value is false. Override this value to true to actually perform
       *  the purge.
       */
      // const force = true

      // Imports the Vision library
      const {ProductSearchClient} = require('https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html').v1;

      // Instantiates a client
      const visionClient = new https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html();

      async function callPurgeProducts() {
        // Construct request
        const request = {
          parent,
        };

        // Run request
        const [operation] = await visionClient.purgeProducts(request);
        const [response] = await operation.promise();
        console.log(response);
      }

      callPurgeProducts();

### close()

    close(): Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<void>` | {Promise} A promise that resolves when the client is closed. |

### createProduct(request, options)

    createProduct(request?: protos.google.cloud.vision.v1.ICreateProductRequest, options?: CallOptions): Promise<[
            protos.google.cloud.vision.v1.IProduct,
            protos.google.cloud.vision.v1.ICreateProductRequest | undefined,
            {} | undefined
        ]>;

Creates and returns a new product resource.

Possible errors:

\* Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. \* Returns INVALID_ARGUMENT if description is longer than 4096 characters. \* Returns INVALID_ARGUMENT if product_category is missing or invalid.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.icreateproductrequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<[ https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproduct, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.icreateproductrequest | undefined, {} | undefined ]>` | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |

**Example**


      /**
       * This snippet has been automatically generated and should be regarded as a code template only.
       * It will require modifications to work.
       * It may require correct/in-range values for request initialization.
       * TODO(developer): Uncomment these variables before running the sample.
       */
      /**
       *  Required. The project in which the Product should be created.
       *  Format is
       *  `projects/PROJECT_ID/locations/LOC_ID`.
       */
      // const parent = 'abc123'
      /**
       *  Required. The product to create.
       */
      // const product = {}
      /**
       *  A user-supplied resource id for this Product. If set, the server will
       *  attempt to use this value as the resource id. If it is already in use, an
       *  error is returned with code ALREADY_EXISTS. Must be at most 128 characters
       *  long. It cannot contain the character `/`.
       */
      // const productId = 'abc123'

      // Imports the Vision library
      const {ProductSearchClient} = require('https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html').v1;

      // Instantiates a client
      const visionClient = new https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html();

      async function callCreateProduct() {
        // Construct request
        const request = {
          parent,
          product,
        };

        // Run request
        const response = await visionClient.createProduct(request);
        console.log(response);
      }

      callCreateProduct();

### createProduct(request, options, callback)

    createProduct(request: protos.google.cloud.vision.v1.ICreateProductRequest, options: CallOptions, callback: Callback<protos.google.cloud.vision.v1.IProduct, protos.google.cloud.vision.v1.ICreateProductRequest | null | undefined, {} | null | undefined>): void;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.icreateproductrequest` |
| `options` | `CallOptions` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproduct, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.icreateproductrequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### createProduct(request, callback)

    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;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.icreateproductrequest` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproduct, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.icreateproductrequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### createProductSet(request, options)

    createProductSet(request?: protos.google.cloud.vision.v1.ICreateProductSetRequest, options?: CallOptions): Promise<[
            protos.google.cloud.vision.v1.IProductSet,
            protos.google.cloud.vision.v1.ICreateProductSetRequest | undefined,
            {} | undefined
        ]>;

Creates and returns a new ProductSet resource.

Possible errors:

\* Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 characters.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.icreateproductsetrequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<[ https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproductset, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.icreateproductsetrequest | undefined, {} | undefined ]>` | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [ProductSet](https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.productset). Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |

**Example**


      /**
       * This snippet has been automatically generated and should be regarded as a code template only.
       * It will require modifications to work.
       * It may require correct/in-range values for request initialization.
       * TODO(developer): Uncomment these variables before running the sample.
       */
      /**
       *  Required. The project in which the ProductSet should be created.
       *  Format is `projects/PROJECT_ID/locations/LOC_ID`.
       */
      // const parent = 'abc123'
      /**
       *  Required. The ProductSet to create.
       */
      // const productSet = {}
      /**
       *  A user-supplied resource id for this ProductSet. If set, the server will
       *  attempt to use this value as the resource id. If it is already in use, an
       *  error is returned with code ALREADY_EXISTS. Must be at most 128 characters
       *  long. It cannot contain the character `/`.
       */
      // const productSetId = 'abc123'

      // Imports the Vision library
      const {ProductSearchClient} = require('https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html').v1;

      // Instantiates a client
      const visionClient = new https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html();

      async function callCreateProductSet() {
        // Construct request
        const request = {
          parent,
          productSet,
        };

        // Run request
        const response = await visionClient.createProductSet(request);
        console.log(response);
      }

      callCreateProductSet();

### createProductSet(request, options, callback)

    createProductSet(request: protos.google.cloud.vision.v1.ICreateProductSetRequest, options: CallOptions, callback: Callback<protos.google.cloud.vision.v1.IProductSet, protos.google.cloud.vision.v1.ICreateProductSetRequest | null | undefined, {} | null | undefined>): void;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.icreateproductsetrequest` |
| `options` | `CallOptions` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproductset, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.icreateproductsetrequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### createProductSet(request, callback)

    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;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.icreateproductsetrequest` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproductset, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.icreateproductsetrequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### createReferenceImage(request, options)

    createReferenceImage(request?: protos.google.cloud.vision.v1.ICreateReferenceImageRequest, options?: CallOptions): Promise<[
            protos.google.cloud.vision.v1.IReferenceImage,
            protos.google.cloud.vision.v1.ICreateReferenceImageRequest | undefined,
            {} | undefined
        ]>;

Creates and returns a new ReferenceImage resource.

The `bounding_poly` field is optional. If `bounding_poly` is not specified, the system will try to detect regions of interest in the image that are compatible with the product_category on the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles.

Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP).

Possible errors:

\* Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters. \* Returns INVALID_ARGUMENT if the product does not exist. \* Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category is detected. \* Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.icreatereferenceimagerequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<[ https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ireferenceimage, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.icreatereferenceimagerequest | undefined, {} | undefined ]>` | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [ReferenceImage](https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.referenceimage). Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |

**Example**


      /**
       * This snippet has been automatically generated and should be regarded as a code template only.
       * It will require modifications to work.
       * It may require correct/in-range values for request initialization.
       * TODO(developer): Uncomment these variables before running the sample.
       */
      /**
       *  Required. Resource name of the product in which to create the reference
       *  image.
       *  Format is
       *  `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
       */
      // const parent = 'abc123'
      /**
       *  Required. The reference image to create.
       *  If an image ID is specified, it is ignored.
       */
      // const referenceImage = {}
      /**
       *  A user-supplied resource id for the ReferenceImage to be added. If set,
       *  the server will attempt to use this value as the resource id. If it is
       *  already in use, an error is returned with code ALREADY_EXISTS. Must be at
       *  most 128 characters long. It cannot contain the character `/`.
       */
      // const referenceImageId = 'abc123'

      // Imports the Vision library
      const {ProductSearchClient} = require('https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html').v1;

      // Instantiates a client
      const visionClient = new https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html();

      async function callCreateReferenceImage() {
        // Construct request
        const request = {
          parent,
          referenceImage,
        };

        // Run request
        const response = await visionClient.createReferenceImage(request);
        console.log(response);
      }

      callCreateReferenceImage();

### createReferenceImage(request, options, callback)

    createReferenceImage(request: protos.google.cloud.vision.v1.ICreateReferenceImageRequest, options: CallOptions, callback: Callback<protos.google.cloud.vision.v1.IReferenceImage, protos.google.cloud.vision.v1.ICreateReferenceImageRequest | null | undefined, {} | null | undefined>): void;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.icreatereferenceimagerequest` |
| `options` | `CallOptions` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ireferenceimage, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.icreatereferenceimagerequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### createReferenceImage(request, callback)

    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;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.icreatereferenceimagerequest` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ireferenceimage, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.icreatereferenceimagerequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### deleteOperation(request, optionsOrCallback, callback)

    deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>): Promise<protos.google.protobuf.Empty>;

Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.longrunning.deleteoperationrequest` The request object that will be sent. |
| `optionsOrCallback` | `CallOptions | Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.empty, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.longrunning.deleteoperationrequest, {} | null | undefined>` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.empty, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.longrunning.deleteoperationrequest, {} | null | undefined>` The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.empty>` |   |

**Example**


    const client = longrunning.operationsClient();
    await client.deleteOperation({name: ''});

### deleteProduct(request, options)

    deleteProduct(request?: protos.google.cloud.vision.v1.IDeleteProductRequest, options?: CallOptions): Promise<[
            protos.google.protobuf.IEmpty,
            protos.google.cloud.vision.v1.IDeleteProductRequest | undefined,
            {} | undefined
        ]>;

Permanently deletes a product and its reference images.

Metadata of the product and all its images will be deleted right away, but search queries against ProductSets containing the product may still work until all related caches are refreshed.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ideleteproductrequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<[ https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.iempty, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ideleteproductrequest | undefined, {} | undefined ]>` | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Empty](https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.empty). Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |

**Example**


      /**
       * This snippet has been automatically generated and should be regarded as a code template only.
       * It will require modifications to work.
       * It may require correct/in-range values for request initialization.
       * TODO(developer): Uncomment these variables before running the sample.
       */
      /**
       *  Required. Resource name of product to delete.
       *  Format is:
       *  `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
       */
      // const name = 'abc123'

      // Imports the Vision library
      const {ProductSearchClient} = require('https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html').v1;

      // Instantiates a client
      const visionClient = new https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html();

      async function callDeleteProduct() {
        // Construct request
        const request = {
          name,
        };

        // Run request
        const response = await visionClient.deleteProduct(request);
        console.log(response);
      }

      callDeleteProduct();

### deleteProduct(request, options, callback)

    deleteProduct(request: protos.google.cloud.vision.v1.IDeleteProductRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1.IDeleteProductRequest | null | undefined, {} | null | undefined>): void;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ideleteproductrequest` |
| `options` | `CallOptions` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.iempty, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ideleteproductrequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### deleteProduct(request, callback)

    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;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ideleteproductrequest` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.iempty, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ideleteproductrequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### deleteProductSet(request, options)

    deleteProductSet(request?: protos.google.cloud.vision.v1.IDeleteProductSetRequest, options?: CallOptions): Promise<[
            protos.google.protobuf.IEmpty,
            protos.google.cloud.vision.v1.IDeleteProductSetRequest | undefined,
            {} | undefined
        ]>;

Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not deleted.

The actual image files are not deleted from Google Cloud Storage.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ideleteproductsetrequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<[ https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.iempty, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ideleteproductsetrequest | undefined, {} | undefined ]>` | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Empty](https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.empty). Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |

**Example**


      /**
       * This snippet has been automatically generated and should be regarded as a code template only.
       * It will require modifications to work.
       * It may require correct/in-range values for request initialization.
       * TODO(developer): Uncomment these variables before running the sample.
       */
      /**
       *  Required. Resource name of the ProductSet to delete.
       *  Format is:
       *  `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
       */
      // const name = 'abc123'

      // Imports the Vision library
      const {ProductSearchClient} = require('https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html').v1;

      // Instantiates a client
      const visionClient = new https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html();

      async function callDeleteProductSet() {
        // Construct request
        const request = {
          name,
        };

        // Run request
        const response = await visionClient.deleteProductSet(request);
        console.log(response);
      }

      callDeleteProductSet();

### deleteProductSet(request, options, callback)

    deleteProductSet(request: protos.google.cloud.vision.v1.IDeleteProductSetRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1.IDeleteProductSetRequest | null | undefined, {} | null | undefined>): void;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ideleteproductsetrequest` |
| `options` | `CallOptions` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.iempty, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ideleteproductsetrequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### deleteProductSet(request, callback)

    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;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ideleteproductsetrequest` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.iempty, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ideleteproductsetrequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### deleteReferenceImage(request, options)

    deleteReferenceImage(request?: protos.google.cloud.vision.v1.IDeleteReferenceImageRequest, options?: CallOptions): Promise<[
            protos.google.protobuf.IEmpty,
            protos.google.cloud.vision.v1.IDeleteReferenceImageRequest | undefined,
            {} | undefined
        ]>;

Permanently deletes a reference image.

The image metadata will be deleted right away, but search queries against ProductSets containing the image may still work until all related caches are refreshed.

The actual image files are not deleted from Google Cloud Storage.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ideletereferenceimagerequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<[ https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.iempty, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ideletereferenceimagerequest | undefined, {} | undefined ]>` | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Empty](https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.empty). Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |

**Example**


      /**
       * This snippet has been automatically generated and should be regarded as a code template only.
       * It will require modifications to work.
       * It may require correct/in-range values for request initialization.
       * TODO(developer): Uncomment these variables before running the sample.
       */
      /**
       *  Required. The resource name of the reference image to delete.
       *  Format is:
       *  `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`
       */
      // const name = 'abc123'

      // Imports the Vision library
      const {ProductSearchClient} = require('https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html').v1;

      // Instantiates a client
      const visionClient = new https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html();

      async function callDeleteReferenceImage() {
        // Construct request
        const request = {
          name,
        };

        // Run request
        const response = await visionClient.deleteReferenceImage(request);
        console.log(response);
      }

      callDeleteReferenceImage();

### deleteReferenceImage(request, options, callback)

    deleteReferenceImage(request: protos.google.cloud.vision.v1.IDeleteReferenceImageRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1.IDeleteReferenceImageRequest | null | undefined, {} | null | undefined>): void;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ideletereferenceimagerequest` |
| `options` | `CallOptions` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.iempty, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ideletereferenceimagerequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### deleteReferenceImage(request, callback)

    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;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ideletereferenceimagerequest` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.iempty, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ideletereferenceimagerequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### getOperation(request, optionsOrCallback, callback)

    getOperation(request: protos.google.longrunning.GetOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): Promise<[protos.google.longrunning.Operation]>;

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.longrunning.getoperationrequest` The request object that will be sent. |
| `optionsOrCallback` | `CallOptions | Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.longrunning.operation, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.longrunning.getoperationrequest, {} | null | undefined>` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.longrunning.operation, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.longrunning.getoperationrequest, {} | null | undefined>` The function which will be called with the result of the API call. The second parameter to the callback is an object representing . {Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<[https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.longrunning.operation]>` |   |

**Example**


    const client = longrunning.operationsClient();
    const name = '';
    const [response] = await client.getOperation({name});
    // doThingsWith(response)

### getProduct(request, options)

    getProduct(request?: protos.google.cloud.vision.v1.IGetProductRequest, options?: CallOptions): Promise<[
            protos.google.cloud.vision.v1.IProduct,
            protos.google.cloud.vision.v1.IGetProductRequest | undefined,
            {} | undefined
        ]>;

Gets information associated with a Product.

Possible errors:

\* Returns NOT_FOUND if the Product does not exist.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.igetproductrequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<[ https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproduct, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.igetproductrequest | undefined, {} | undefined ]>` | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |

**Example**


      /**
       * This snippet has been automatically generated and should be regarded as a code template only.
       * It will require modifications to work.
       * It may require correct/in-range values for request initialization.
       * TODO(developer): Uncomment these variables before running the sample.
       */
      /**
       *  Required. Resource name of the Product to get.
       *  Format is:
       *  `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
       */
      // const name = 'abc123'

      // Imports the Vision library
      const {ProductSearchClient} = require('https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html').v1;

      // Instantiates a client
      const visionClient = new https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html();

      async function callGetProduct() {
        // Construct request
        const request = {
          name,
        };

        // Run request
        const response = await visionClient.getProduct(request);
        console.log(response);
      }

      callGetProduct();

### getProduct(request, options, callback)

    getProduct(request: protos.google.cloud.vision.v1.IGetProductRequest, options: CallOptions, callback: Callback<protos.google.cloud.vision.v1.IProduct, protos.google.cloud.vision.v1.IGetProductRequest | null | undefined, {} | null | undefined>): void;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.igetproductrequest` |
| `options` | `CallOptions` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproduct, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.igetproductrequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### getProduct(request, callback)

    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;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.igetproductrequest` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproduct, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.igetproductrequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### getProductSet(request, options)

    getProductSet(request?: protos.google.cloud.vision.v1.IGetProductSetRequest, options?: CallOptions): Promise<[
            protos.google.cloud.vision.v1.IProductSet,
            protos.google.cloud.vision.v1.IGetProductSetRequest | undefined,
            {} | undefined
        ]>;

Gets information associated with a ProductSet.

Possible errors:

\* Returns NOT_FOUND if the ProductSet does not exist.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.igetproductsetrequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<[ https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproductset, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.igetproductsetrequest | undefined, {} | undefined ]>` | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [ProductSet](https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.productset). Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |

**Example**


      /**
       * This snippet has been automatically generated and should be regarded as a code template only.
       * It will require modifications to work.
       * It may require correct/in-range values for request initialization.
       * TODO(developer): Uncomment these variables before running the sample.
       */
      /**
       *  Required. Resource name of the ProductSet to get.
       *  Format is:
       *  `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
       */
      // const name = 'abc123'

      // Imports the Vision library
      const {ProductSearchClient} = require('https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html').v1;

      // Instantiates a client
      const visionClient = new https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html();

      async function callGetProductSet() {
        // Construct request
        const request = {
          name,
        };

        // Run request
        const response = await visionClient.getProductSet(request);
        console.log(response);
      }

      callGetProductSet();

### getProductSet(request, options, callback)

    getProductSet(request: protos.google.cloud.vision.v1.IGetProductSetRequest, options: CallOptions, callback: Callback<protos.google.cloud.vision.v1.IProductSet, protos.google.cloud.vision.v1.IGetProductSetRequest | null | undefined, {} | null | undefined>): void;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.igetproductsetrequest` |
| `options` | `CallOptions` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproductset, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.igetproductsetrequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### getProductSet(request, callback)

    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;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.igetproductsetrequest` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproductset, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.igetproductsetrequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### getProjectId()

    getProjectId(): Promise<string>;

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<string>` |   |

### getProjectId(callback)

    getProjectId(callback: Callback<string, undefined, undefined>): void;

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `callback` | `Callback<string, undefined, undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### getReferenceImage(request, options)

    getReferenceImage(request?: protos.google.cloud.vision.v1.IGetReferenceImageRequest, options?: CallOptions): Promise<[
            protos.google.cloud.vision.v1.IReferenceImage,
            protos.google.cloud.vision.v1.IGetReferenceImageRequest | undefined,
            {} | undefined
        ]>;

Gets information associated with a ReferenceImage.

Possible errors:

\* Returns NOT_FOUND if the specified image does not exist.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.igetreferenceimagerequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<[ https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ireferenceimage, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.igetreferenceimagerequest | undefined, {} | undefined ]>` | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [ReferenceImage](https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.referenceimage). Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |

**Example**


      /**
       * This snippet has been automatically generated and should be regarded as a code template only.
       * It will require modifications to work.
       * It may require correct/in-range values for request initialization.
       * TODO(developer): Uncomment these variables before running the sample.
       */
      /**
       *  Required. The resource name of the ReferenceImage to get.
       *  Format is:
       *  `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
       */
      // const name = 'abc123'

      // Imports the Vision library
      const {ProductSearchClient} = require('https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html').v1;

      // Instantiates a client
      const visionClient = new https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html();

      async function callGetReferenceImage() {
        // Construct request
        const request = {
          name,
        };

        // Run request
        const response = await visionClient.getReferenceImage(request);
        console.log(response);
      }

      callGetReferenceImage();

### getReferenceImage(request, options, callback)

    getReferenceImage(request: protos.google.cloud.vision.v1.IGetReferenceImageRequest, options: CallOptions, callback: Callback<protos.google.cloud.vision.v1.IReferenceImage, protos.google.cloud.vision.v1.IGetReferenceImageRequest | null | undefined, {} | null | undefined>): void;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.igetreferenceimagerequest` |
| `options` | `CallOptions` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ireferenceimage, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.igetreferenceimagerequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### getReferenceImage(request, callback)

    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;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.igetreferenceimagerequest` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ireferenceimage, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.igetreferenceimagerequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### importProductSets(request, options)

    importProductSets(request?: protos.google.cloud.vision.v1.IImportProductSetsRequest, options?: CallOptions): Promise<[
            LROperation<protos.google.cloud.vision.v1.IImportProductSetsResponse, protos.google.cloud.vision.v1.IBatchOperationMetadata>,
            protos.google.longrunning.IOperation | undefined,
            {} | undefined
        ]>;

Asynchronous API that imports a list of reference images to specified product sets based on a list of image information.

The [google.longrunning.Operation](https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.longrunning.operation) API can be used to keep track of the progress and results of the request. `Operation.metadata` contains `BatchOperationMetadata`. (progress) `Operation.response` contains `ImportProductSetsResponse`. (results)

The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iimportproductsetsrequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<[ LROperation<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iimportproductsetsresponse, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ibatchoperationmetadata>, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.longrunning.ioperation | undefined, {} | undefined ]>` | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its `promise()` method returns a promise you can `await` for. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. |

**Example**


      /**
       * This snippet has been automatically generated and should be regarded as a code template only.
       * It will require modifications to work.
       * It may require correct/in-range values for request initialization.
       * TODO(developer): Uncomment these variables before running the sample.
       */
      /**
       *  Required. The project in which the ProductSets should be imported.
       *  Format is `projects/PROJECT_ID/locations/LOC_ID`.
       */
      // const parent = 'abc123'
      /**
       *  Required. The input content for the list of requests.
       */
      // const inputConfig = {}

      // Imports the Vision library
      const {ProductSearchClient} = require('https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html').v1;

      // Instantiates a client
      const visionClient = new https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html();

      async function callImportProductSets() {
        // Construct request
        const request = {
          parent,
          inputConfig,
        };

        // Run request
        const [operation] = await visionClient.importProductSets(request);
        const [response] = await operation.promise();
        console.log(response);
      }

      callImportProductSets();

### importProductSets(request, options, callback)

    importProductSets(request: protos.google.cloud.vision.v1.IImportProductSetsRequest, options: 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;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iimportproductsetsrequest` |
| `options` | `CallOptions` |
| `callback` | `Callback<LROperation<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iimportproductsetsresponse, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ibatchoperationmetadata>, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.longrunning.ioperation | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### importProductSets(request, callback)

    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;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iimportproductsetsrequest` |
| `callback` | `Callback<LROperation<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iimportproductsetsresponse, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ibatchoperationmetadata>, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.longrunning.ioperation | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### initialize()

    initialize(): Promise<{
            [name: string]: Function;
        }>;

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<{ [name: string]: Function; }>` | {Promise} A promise that resolves to an authenticated service stub. |

### listOperationsAsync(request, options)

    listOperationsAsync(request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.IOperation>;

Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object.

For-await-of syntax is used with the iterable to recursively get response element on-demand.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.longrunning.listoperationsrequest` The request object that will be sent. |
| `options` | `CallOptions` Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See [gax.CallOptions](https://googleapis.github.io/gax-nodejs/global.html#CallOptions) for the details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncIterable<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.longrunning.ioperation>` | {Object} An iterable Object that conforms to [iteration protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). |

**Example**


    const client = longrunning.operationsClient();
    for await (const response of client.listOperationsAsync(request));
    // doThingsWith(response)

### listProducts(request, options)

    listProducts(request?: protos.google.cloud.vision.v1.IListProductsRequest, options?: CallOptions): Promise<[
            protos.google.cloud.vision.v1.IProduct[],
            protos.google.cloud.vision.v1.IListProductsRequest | null,
            protos.google.cloud.vision.v1.IListProductsResponse
        ]>;

Lists products in an unspecified order.

Possible errors:

\* Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsrequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<[ https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproduct[], https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsrequest | null, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsresponse ]>` | {Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using `listProductsAsync()` method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |

### listProducts(request, options, callback)

    listProducts(request: protos.google.cloud.vision.v1.IListProductsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.vision.v1.IListProductsRequest, protos.google.cloud.vision.v1.IListProductsResponse | null | undefined, protos.google.cloud.vision.v1.IProduct>): void;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsrequest` |
| `options` | `CallOptions` |
| `callback` | `PaginationCallback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsrequest, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsresponse | null | undefined, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproduct>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### listProducts(request, callback)

    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;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsrequest` |
| `callback` | `PaginationCallback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsrequest, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsresponse | null | undefined, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproduct>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### listProductsAsync(request, options)

    listProductsAsync(request?: protos.google.cloud.vision.v1.IListProductsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.vision.v1.IProduct>;

Equivalent to `listProducts`, but returns an iterable object.

`for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsrequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncIterable<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproduct>` | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |

**Example**


      /**
       * This snippet has been automatically generated and should be regarded as a code template only.
       * It will require modifications to work.
       * It may require correct/in-range values for request initialization.
       * TODO(developer): Uncomment these variables before running the sample.
       */
      /**
       *  Required. The project OR ProductSet from which Products should be listed.
       *  Format:
       *  `projects/PROJECT_ID/locations/LOC_ID`
       */
      // const parent = 'abc123'
      /**
       *  The maximum number of items to return. Default 10, maximum 100.
       */
      // const pageSize = 1234
      /**
       *  The next_page_token returned from a previous List request, if any.
       */
      // const pageToken = 'abc123'

      // Imports the Vision library
      const {ProductSearchClient} = require('https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html').v1;

      // Instantiates a client
      const visionClient = new https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html();

      async function callListProducts() {
        // Construct request
        const request = {
          parent,
        };

        // Run request
        const iterable = visionClient.listProductsAsync(request);
        for await (const response of iterable) {
            console.log(response);
        }
      }

      callListProducts();

### listProductSets(request, options)

    listProductSets(request?: protos.google.cloud.vision.v1.IListProductSetsRequest, options?: CallOptions): Promise<[
            protos.google.cloud.vision.v1.IProductSet[],
            protos.google.cloud.vision.v1.IListProductSetsRequest | null,
            protos.google.cloud.vision.v1.IListProductSetsResponse
        ]>;

Lists ProductSets in an unspecified order.

Possible errors:

\* Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsetsrequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<[ https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproductset[], https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsetsrequest | null, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsetsresponse ]>` | {Promise} - The promise which resolves to an array. The first element of the array is Array of [ProductSet](https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.productset). The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using `listProductSetsAsync()` method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |

### listProductSets(request, options, callback)

    listProductSets(request: protos.google.cloud.vision.v1.IListProductSetsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.vision.v1.IListProductSetsRequest, protos.google.cloud.vision.v1.IListProductSetsResponse | null | undefined, protos.google.cloud.vision.v1.IProductSet>): void;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsetsrequest` |
| `options` | `CallOptions` |
| `callback` | `PaginationCallback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsetsrequest, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsetsresponse | null | undefined, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproductset>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### listProductSets(request, callback)

    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;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsetsrequest` |
| `callback` | `PaginationCallback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsetsrequest, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsetsresponse | null | undefined, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproductset>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### listProductSetsAsync(request, options)

    listProductSetsAsync(request?: protos.google.cloud.vision.v1.IListProductSetsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.vision.v1.IProductSet>;

Equivalent to `listProductSets`, but returns an iterable object.

`for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsetsrequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncIterable<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproductset>` | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [ProductSet](https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.productset). The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |

**Example**


      /**
       * This snippet has been automatically generated and should be regarded as a code template only.
       * It will require modifications to work.
       * It may require correct/in-range values for request initialization.
       * TODO(developer): Uncomment these variables before running the sample.
       */
      /**
       *  Required. The project from which ProductSets should be listed.
       *  Format is `projects/PROJECT_ID/locations/LOC_ID`.
       */
      // const parent = 'abc123'
      /**
       *  The maximum number of items to return. Default 10, maximum 100.
       */
      // const pageSize = 1234
      /**
       *  The next_page_token returned from a previous List request, if any.
       */
      // const pageToken = 'abc123'

      // Imports the Vision library
      const {ProductSearchClient} = require('https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html').v1;

      // Instantiates a client
      const visionClient = new https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html();

      async function callListProductSets() {
        // Construct request
        const request = {
          parent,
        };

        // Run request
        const iterable = visionClient.listProductSetsAsync(request);
        for await (const response of iterable) {
            console.log(response);
        }
      }

      callListProductSets();

### listProductSetsStream(request, options)

    listProductSetsStream(request?: protos.google.cloud.vision.v1.IListProductSetsRequest, options?: CallOptions): Transform;

Equivalent to `listProductSets`, but returns a NodeJS Stream object.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsetsrequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Transform` | {Stream} An object stream which emits an object representing [ProductSet](https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.productset) on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using `listProductSetsAsync()` method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |

### listProductsInProductSet(request, options)

    listProductsInProductSet(request?: protos.google.cloud.vision.v1.IListProductsInProductSetRequest, options?: CallOptions): Promise<[
            protos.google.cloud.vision.v1.IProduct[],
            protos.google.cloud.vision.v1.IListProductsInProductSetRequest | null,
            protos.google.cloud.vision.v1.IListProductsInProductSetResponse
        ]>;

Lists the Products in a ProductSet, in an unspecified order. If the ProductSet does not exist, the products field of the response will be empty.

Possible errors:

\* Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsinproductsetrequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<[ https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproduct[], https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsinproductsetrequest | null, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsinproductsetresponse ]>` | {Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using `listProductsInProductSetAsync()` method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |

### listProductsInProductSet(request, options, callback)

    listProductsInProductSet(request: protos.google.cloud.vision.v1.IListProductsInProductSetRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.vision.v1.IListProductsInProductSetRequest, protos.google.cloud.vision.v1.IListProductsInProductSetResponse | null | undefined, protos.google.cloud.vision.v1.IProduct>): void;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsinproductsetrequest` |
| `options` | `CallOptions` |
| `callback` | `PaginationCallback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsinproductsetrequest, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsinproductsetresponse | null | undefined, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproduct>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### listProductsInProductSet(request, callback)

    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;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsinproductsetrequest` |
| `callback` | `PaginationCallback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsinproductsetrequest, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsinproductsetresponse | null | undefined, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproduct>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### listProductsInProductSetAsync(request, options)

    listProductsInProductSetAsync(request?: protos.google.cloud.vision.v1.IListProductsInProductSetRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.vision.v1.IProduct>;

Equivalent to `listProductsInProductSet`, but returns an iterable object.

`for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsinproductsetrequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncIterable<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproduct>` | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |

**Example**


      /**
       * This snippet has been automatically generated and should be regarded as a code template only.
       * It will require modifications to work.
       * It may require correct/in-range values for request initialization.
       * TODO(developer): Uncomment these variables before running the sample.
       */
      /**
       *  Required. The ProductSet resource for which to retrieve Products.
       *  Format is:
       *  `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
       */
      // const name = 'abc123'
      /**
       *  The maximum number of items to return. Default 10, maximum 100.
       */
      // const pageSize = 1234
      /**
       *  The next_page_token returned from a previous List request, if any.
       */
      // const pageToken = 'abc123'

      // Imports the Vision library
      const {ProductSearchClient} = require('https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html').v1;

      // Instantiates a client
      const visionClient = new https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html();

      async function callListProductsInProductSet() {
        // Construct request
        const request = {
          name,
        };

        // Run request
        const iterable = visionClient.listProductsInProductSetAsync(request);
        for await (const response of iterable) {
            console.log(response);
        }
      }

      callListProductsInProductSet();

### listProductsInProductSetStream(request, options)

    listProductsInProductSetStream(request?: protos.google.cloud.vision.v1.IListProductsInProductSetRequest, options?: CallOptions): Transform;

Equivalent to `listProductsInProductSet`, but returns a NodeJS Stream object.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsinproductsetrequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Transform` | {Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using `listProductsInProductSetAsync()` method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |

### listProductsStream(request, options)

    listProductsStream(request?: protos.google.cloud.vision.v1.IListProductsRequest, options?: CallOptions): Transform;

Equivalent to `listProducts`, but returns a NodeJS Stream object.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistproductsrequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Transform` | {Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using `listProductsAsync()` method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |

### listReferenceImages(request, options)

    listReferenceImages(request?: protos.google.cloud.vision.v1.IListReferenceImagesRequest, options?: CallOptions): Promise<[
            protos.google.cloud.vision.v1.IReferenceImage[],
            protos.google.cloud.vision.v1.IListReferenceImagesRequest | null,
            protos.google.cloud.vision.v1.IListReferenceImagesResponse
        ]>;

Lists reference images.

Possible errors:

\* Returns NOT_FOUND if the parent product does not exist. \* Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistreferenceimagesrequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<[ https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ireferenceimage[], https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistreferenceimagesrequest | null, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistreferenceimagesresponse ]>` | {Promise} - The promise which resolves to an array. The first element of the array is Array of [ReferenceImage](https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.referenceimage). The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using `listReferenceImagesAsync()` method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |

### listReferenceImages(request, options, callback)

    listReferenceImages(request: protos.google.cloud.vision.v1.IListReferenceImagesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.vision.v1.IListReferenceImagesRequest, protos.google.cloud.vision.v1.IListReferenceImagesResponse | null | undefined, protos.google.cloud.vision.v1.IReferenceImage>): void;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistreferenceimagesrequest` |
| `options` | `CallOptions` |
| `callback` | `PaginationCallback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistreferenceimagesrequest, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistreferenceimagesresponse | null | undefined, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ireferenceimage>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### listReferenceImages(request, callback)

    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;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistreferenceimagesrequest` |
| `callback` | `PaginationCallback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistreferenceimagesrequest, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistreferenceimagesresponse | null | undefined, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ireferenceimage>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### listReferenceImagesAsync(request, options)

    listReferenceImagesAsync(request?: protos.google.cloud.vision.v1.IListReferenceImagesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.vision.v1.IReferenceImage>;

Equivalent to `listReferenceImages`, but returns an iterable object.

`for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistreferenceimagesrequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncIterable<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ireferenceimage>` | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [ReferenceImage](https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.referenceimage). The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |

**Example**


      /**
       * This snippet has been automatically generated and should be regarded as a code template only.
       * It will require modifications to work.
       * It may require correct/in-range values for request initialization.
       * TODO(developer): Uncomment these variables before running the sample.
       */
      /**
       *  Required. Resource name of the product containing the reference images.
       *  Format is
       *  `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
       */
      // const parent = 'abc123'
      /**
       *  The maximum number of items to return. Default 10, maximum 100.
       */
      // const pageSize = 1234
      /**
       *  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.
       */
      // const pageToken = 'abc123'

      // Imports the Vision library
      const {ProductSearchClient} = require('https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html').v1;

      // Instantiates a client
      const visionClient = new https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html();

      async function callListReferenceImages() {
        // Construct request
        const request = {
          parent,
        };

        // Run request
        const iterable = visionClient.listReferenceImagesAsync(request);
        for await (const response of iterable) {
            console.log(response);
        }
      }

      callListReferenceImages();

### listReferenceImagesStream(request, options)

    listReferenceImagesStream(request?: protos.google.cloud.vision.v1.IListReferenceImagesRequest, options?: CallOptions): Transform;

Equivalent to `listReferenceImages`, but returns a NodeJS Stream object.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ilistreferenceimagesrequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Transform` | {Stream} An object stream which emits an object representing [ReferenceImage](https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.referenceimage) on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using `listReferenceImagesAsync()` method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |

### locationPath(project, location)

    locationPath(project: string, location: string): string;

Return a fully-qualified location resource name string.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `project` | `string` |
| `location` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | {string} Resource name string. |

### matchLocationFromLocationName(locationName)

    matchLocationFromLocationName(locationName: string): string | number;

Parse the location from Location resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `locationName` | `string` A fully-qualified path representing Location resource. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string | number` | {string} A string representing the location. |

### matchLocationFromProductName(productName)

    matchLocationFromProductName(productName: string): string | number;

Parse the location from Product resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `productName` | `string` A fully-qualified path representing Product resource. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string | number` | {string} A string representing the location. |

### matchLocationFromProductSetName(productSetName)

    matchLocationFromProductSetName(productSetName: string): string | number;

Parse the location from ProductSet resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `productSetName` | `string` A fully-qualified path representing ProductSet resource. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string | number` | {string} A string representing the location. |

### matchLocationFromReferenceImageName(referenceImageName)

    matchLocationFromReferenceImageName(referenceImageName: string): string | number;

Parse the location from ReferenceImage resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `referenceImageName` | `string` A fully-qualified path representing ReferenceImage resource. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string | number` | {string} A string representing the location. |

### matchProductFromProductName(productName)

    matchProductFromProductName(productName: string): string | number;

Parse the product from Product resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `productName` | `string` A fully-qualified path representing Product resource. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string | number` | {string} A string representing the product. |

### matchProductFromReferenceImageName(referenceImageName)

    matchProductFromReferenceImageName(referenceImageName: string): string | number;

Parse the product from ReferenceImage resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `referenceImageName` | `string` A fully-qualified path representing ReferenceImage resource. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string | number` | {string} A string representing the product. |

### matchProductSetFromProductSetName(productSetName)

    matchProductSetFromProductSetName(productSetName: string): string | number;

Parse the product_set from ProductSet resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `productSetName` | `string` A fully-qualified path representing ProductSet resource. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string | number` | {string} A string representing the product_set. |

### matchProjectFromLocationName(locationName)

    matchProjectFromLocationName(locationName: string): string | number;

Parse the project from Location resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `locationName` | `string` A fully-qualified path representing Location resource. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string | number` | {string} A string representing the project. |

### matchProjectFromProductName(productName)

    matchProjectFromProductName(productName: string): string | number;

Parse the project from Product resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `productName` | `string` A fully-qualified path representing Product resource. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string | number` | {string} A string representing the project. |

### matchProjectFromProductSetName(productSetName)

    matchProjectFromProductSetName(productSetName: string): string | number;

Parse the project from ProductSet resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `productSetName` | `string` A fully-qualified path representing ProductSet resource. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string | number` | {string} A string representing the project. |

### matchProjectFromReferenceImageName(referenceImageName)

    matchProjectFromReferenceImageName(referenceImageName: string): string | number;

Parse the project from ReferenceImage resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `referenceImageName` | `string` A fully-qualified path representing ReferenceImage resource. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string | number` | {string} A string representing the project. |

### matchReferenceImageFromReferenceImageName(referenceImageName)

    matchReferenceImageFromReferenceImageName(referenceImageName: string): string | number;

Parse the reference_image from ReferenceImage resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `referenceImageName` | `string` A fully-qualified path representing ReferenceImage resource. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string | number` | {string} A string representing the reference_image. |

### productPath(project, location, product)

    productPath(project: string, location: string, product: string): string;

Return a fully-qualified product resource name string.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `project` | `string` |
| `location` | `string` |
| `product` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | {string} Resource name string. |

### productSetPath(project, location, productSet)

    productSetPath(project: string, location: string, productSet: string): string;

Return a fully-qualified productSet resource name string.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `project` | `string` |
| `location` | `string` |
| `productSet` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | {string} Resource name string. |

### purgeProducts(request, options)

    purgeProducts(request?: protos.google.cloud.vision.v1.IPurgeProductsRequest, options?: CallOptions): Promise<[
            LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1.IBatchOperationMetadata>,
            protos.google.longrunning.IOperation | undefined,
            {} | undefined
        ]>;

Asynchronous API to delete all Products in a ProductSet or all Products that are in no ProductSet.

If a Product is a member of the specified ProductSet in addition to other ProductSets, the Product will still be deleted.

It is recommended to not delete the specified ProductSet until after this operation has completed. It is also recommended to not add any of the Products involved in the batch delete to a new ProductSet while this operation is running because those Products may still end up deleted.

It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep the csv files used in ImportProductSets (if that was how you originally built the Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion.

If the plan is to purge all of the Products from a ProductSet and then re-use the empty ProductSet to re-import new Products into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet.

The [google.longrunning.Operation](https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.longrunning.operation) API can be used to keep track of the progress and results of the request. `Operation.metadata` contains `BatchOperationMetadata`. (progress)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ipurgeproductsrequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<[ LROperation<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.iempty, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ibatchoperationmetadata>, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.longrunning.ioperation | undefined, {} | undefined ]>` | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its `promise()` method returns a promise you can `await` for. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. |

**Example**


      /**
       * This snippet has been automatically generated and should be regarded as a code template only.
       * It will require modifications to work.
       * It may require correct/in-range values for request initialization.
       * TODO(developer): Uncomment these variables before running the sample.
       */
      /**
       *  Specify which ProductSet contains the Products to be deleted.
       */
      // const productSetPurgeConfig = {}
      /**
       *  If delete_orphan_products is true, all Products that are not in any
       *  ProductSet will be deleted.
       */
      // const deleteOrphanProducts = true
      /**
       *  Required. The project and location in which the Products should be deleted.
       *  Format is `projects/PROJECT_ID/locations/LOC_ID`.
       */
      // const parent = 'abc123'
      /**
       *  The default value is false. Override this value to true to actually perform
       *  the purge.
       */
      // const force = true

      // Imports the Vision library
      const {ProductSearchClient} = require('https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html').v1;

      // Instantiates a client
      const visionClient = new https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html();

      async function callPurgeProducts() {
        // Construct request
        const request = {
          parent,
        };

        // Run request
        const [operation] = await visionClient.purgeProducts(request);
        const [response] = await operation.promise();
        console.log(response);
      }

      callPurgeProducts();

### purgeProducts(request, options, callback)

    purgeProducts(request: protos.google.cloud.vision.v1.IPurgeProductsRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1.IBatchOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ipurgeproductsrequest` |
| `options` | `CallOptions` |
| `callback` | `Callback<LROperation<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.iempty, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ibatchoperationmetadata>, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.longrunning.ioperation | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### purgeProducts(request, callback)

    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;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ipurgeproductsrequest` |
| `callback` | `Callback<LROperation<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.iempty, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.ibatchoperationmetadata>, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.longrunning.ioperation | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### referenceImagePath(project, location, product, referenceImage)

    referenceImagePath(project: string, location: string, product: string, referenceImage: string): string;

Return a fully-qualified referenceImage resource name string.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `project` | `string` |
| `location` | `string` |
| `product` | `string` |
| `referenceImage` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | {string} Resource name string. |

### removeProductFromProductSet(request, options)

    removeProductFromProductSet(request?: protos.google.cloud.vision.v1.IRemoveProductFromProductSetRequest, options?: CallOptions): Promise<[
            protos.google.protobuf.IEmpty,
            protos.google.cloud.vision.v1.IRemoveProductFromProductSetRequest | undefined,
            {} | undefined
        ]>;

Removes a Product from the specified ProductSet.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iremoveproductfromproductsetrequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<[ https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.iempty, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iremoveproductfromproductsetrequest | undefined, {} | undefined ]>` | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Empty](https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.empty). Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |

**Example**


      /**
       * This snippet has been automatically generated and should be regarded as a code template only.
       * It will require modifications to work.
       * It may require correct/in-range values for request initialization.
       * TODO(developer): Uncomment these variables before running the sample.
       */
      /**
       *  Required. The resource name for the ProductSet to modify.
       *  Format is:
       *  `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`
       */
      // const name = 'abc123'
      /**
       *  Required. The resource name for the Product to be removed from this
       *  ProductSet.
       *  Format is:
       *  `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`
       */
      // const product = 'abc123'

      // Imports the Vision library
      const {ProductSearchClient} = require('https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html').v1;

      // Instantiates a client
      const visionClient = new https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html();

      async function callRemoveProductFromProductSet() {
        // Construct request
        const request = {
          name,
          product,
        };

        // Run request
        const response = await visionClient.removeProductFromProductSet(request);
        console.log(response);
      }

      callRemoveProductFromProductSet();

### removeProductFromProductSet(request, options, callback)

    removeProductFromProductSet(request: protos.google.cloud.vision.v1.IRemoveProductFromProductSetRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.vision.v1.IRemoveProductFromProductSetRequest | null | undefined, {} | null | undefined>): void;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iremoveproductfromproductsetrequest` |
| `options` | `CallOptions` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.iempty, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iremoveproductfromproductsetrequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### removeProductFromProductSet(request, callback)

    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;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iremoveproductfromproductsetrequest` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.protobuf.iempty, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iremoveproductfromproductsetrequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### updateProduct(request, options)

    updateProduct(request?: protos.google.cloud.vision.v1.IUpdateProductRequest, options?: CallOptions): Promise<[
            protos.google.cloud.vision.v1.IProduct,
            protos.google.cloud.vision.v1.IUpdateProductRequest | undefined,
            {} | undefined
        ]>;

Makes changes to a Product resource. Only the `display_name`, `description`, and `labels` fields can be updated right now.

If labels are updated, the change will not be reflected in queries until the next index time.

Possible errors:

\* Returns NOT_FOUND if the Product does not exist. \* Returns INVALID_ARGUMENT if display_name is present in update_mask but is missing from the request or longer than 4096 characters. \* Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. \* Returns INVALID_ARGUMENT if product_category is present in update_mask.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iupdateproductrequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<[ https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproduct, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iupdateproductrequest | undefined, {} | undefined ]>` | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |

**Example**


      /**
       * This snippet has been automatically generated and should be regarded as a code template only.
       * It will require modifications to work.
       * It may require correct/in-range values for request initialization.
       * TODO(developer): Uncomment these variables before running the sample.
       */
      /**
       *  Required. The Product resource which replaces the one on the server.
       *  product.name is immutable.
       */
      // const product = {}
      /**
       *  The FieldMask google.protobuf.FieldMask  that specifies which fields
       *  to update.
       *  If update_mask isn't specified, all mutable fields are to be updated.
       *  Valid mask paths include `product_labels`, `display_name`, and
       *  `description`.
       */
      // const updateMask = {}

      // Imports the Vision library
      const {ProductSearchClient} = require('https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html').v1;

      // Instantiates a client
      const visionClient = new https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html();

      async function callUpdateProduct() {
        // Construct request
        const request = {
          product,
        };

        // Run request
        const response = await visionClient.updateProduct(request);
        console.log(response);
      }

      callUpdateProduct();

### updateProduct(request, options, callback)

    updateProduct(request: protos.google.cloud.vision.v1.IUpdateProductRequest, options: CallOptions, callback: Callback<protos.google.cloud.vision.v1.IProduct, protos.google.cloud.vision.v1.IUpdateProductRequest | null | undefined, {} | null | undefined>): void;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iupdateproductrequest` |
| `options` | `CallOptions` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproduct, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iupdateproductrequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### updateProduct(request, callback)

    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;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iupdateproductrequest` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproduct, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iupdateproductrequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### updateProductSet(request, options)

    updateProductSet(request?: protos.google.cloud.vision.v1.IUpdateProductSetRequest, options?: CallOptions): Promise<[
            protos.google.cloud.vision.v1.IProductSet,
            protos.google.cloud.vision.v1.IUpdateProductSetRequest | undefined,
            {} | undefined
        ]>;

Makes changes to a ProductSet resource. Only display_name can be updated currently.

Possible errors:

\* Returns NOT_FOUND if the ProductSet does not exist. \* Returns INVALID_ARGUMENT if display_name is present in update_mask but missing from the request or longer than 4096 characters.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iupdateproductsetrequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<[ https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproductset, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iupdateproductsetrequest | undefined, {} | undefined ]>` | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [ProductSet](https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.productset). Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |

**Example**


      /**
       * This snippet has been automatically generated and should be regarded as a code template only.
       * It will require modifications to work.
       * It may require correct/in-range values for request initialization.
       * TODO(developer): Uncomment these variables before running the sample.
       */
      /**
       *  Required. The ProductSet resource which replaces the one on the server.
       */
      // const productSet = {}
      /**
       *  The FieldMask google.protobuf.FieldMask  that specifies which fields to
       *  update.
       *  If update_mask isn't specified, all mutable fields are to be updated.
       *  Valid mask path is `display_name`.
       */
      // const updateMask = {}

      // Imports the Vision library
      const {ProductSearchClient} = require('https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html').v1;

      // Instantiates a client
      const visionClient = new https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/overview.html();

      async function callUpdateProductSet() {
        // Construct request
        const request = {
          productSet,
        };

        // Run request
        const response = await visionClient.updateProductSet(request);
        console.log(response);
      }

      callUpdateProductSet();

### updateProductSet(request, options, callback)

    updateProductSet(request: protos.google.cloud.vision.v1.IUpdateProductSetRequest, options: CallOptions, callback: Callback<protos.google.cloud.vision.v1.IProductSet, protos.google.cloud.vision.v1.IUpdateProductSetRequest | null | undefined, {} | null | undefined>): void;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iupdateproductsetrequest` |
| `options` | `CallOptions` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproductset, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iupdateproductsetrequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### updateProductSet(request, callback)

    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;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iupdateproductsetrequest` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iproductset, https://docs.cloud.google.com/nodejs/docs/reference/vision/latest/vision/protos.google.cloud.vision.v1.iupdateproductsetrequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |