MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / main

Function main

vision/productSearch/deleteProduct.js:17–41  ·  view source on GitHub ↗
(projectId, location, productId)

Source from the content-addressed store, hash-verified

15'use strict';
16
17function main(projectId, location, productId) {
18 // [START vision_product_search_delete_product]
19 // Imports the Google Cloud client library
20 const vision = require('@google-cloud/vision');
21
22 // Creates a client
23 const client = new vision.ProductSearchClient();
24
25 async function deleteProduct() {
26 /**
27 * TODO(developer): Uncomment the following line before running the sample.
28 */
29 // const projectId = 'Your Google Cloud project Id';
30 // const location = 'A compute region name';
31 // const productId = 'Id of the product';
32
33 // Resource path that represents full path to the product.
34 const productPath = client.productPath(projectId, location, productId);
35
36 await client.deleteProduct({name: productPath});
37 console.log('Product deleted.');
38 }
39 deleteProduct();
40 // [END vision_product_search_delete_product]
41}
42
43process.on('unhandledRejection', err => {
44 console.error(err.message);

Callers 1

deleteProduct.jsFile · 0.70

Calls 1

deleteProductFunction · 0.70

Tested by

no test coverage detected