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

Function main

vision/productSearch/deleteProductSet.js:17–45  ·  view source on GitHub ↗
(projectId, location, productSetId)

Source from the content-addressed store, hash-verified

15'use strict';
16
17function main(projectId, location, productSetId) {
18 // [START vision_product_search_delete_product_set]
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 deleteProductSet() {
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 productSetId = 'Id of the product set';
32
33 // Resource path that represents full path to the product set.
34 const productSetPath = client.productSetPath(
35 projectId,
36 location,
37 productSetId
38 );
39
40 await client.deleteProductSet({name: productSetPath});
41 console.log('Product set deleted.');
42 }
43 deleteProductSet();
44 // [END vision_product_search_delete_product_set]
45}
46
47process.on('unhandledRejection', err => {
48 console.error(err.message);

Callers 1

Calls 1

deleteProductSetFunction · 0.85

Tested by

no test coverage detected