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

Function main

vision/productSearch/getProductSet.js:17–46  ·  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_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
48process.on('unhandledRejection', err => {
49 console.error(err.message);

Callers 1

getProductSet.jsFile · 0.70

Calls 1

getProductSetFunction · 0.85

Tested by

no test coverage detected