(projectId, location, productSetId)
| 15 | 'use strict'; |
| 16 | |
| 17 | function main(projectId, location, productSetId) { |
| 18 | // [START vision_product_search_get_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 getProductSet() { |
| 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 Google Cloud Platform location. |
| 34 | const productSetPath = client.productSetPath( |
| 35 | projectId, |
| 36 | location, |
| 37 | productSetId |
| 38 | ); |
| 39 | |
| 40 | const [productSet] = await client.getProductSet({name: productSetPath}); |
| 41 | console.log(`Product Set name: ${productSet.name}`); |
| 42 | console.log(`Product Set display name: ${productSet.displayName}`); |
| 43 | } |
| 44 | getProductSet(); |
| 45 | // [END vision_product_search_get_product_set] |
| 46 | } |
| 47 | |
| 48 | process.on('unhandledRejection', err => { |
| 49 | console.error(err.message); |
no test coverage detected