(projectId, location, productId)
| 15 | 'use strict'; |
| 16 | |
| 17 | function 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 | |
| 43 | process.on('unhandledRejection', err => { |
| 44 | console.error(err.message); |
no test coverage detected