(projectId, location)
| 14 | 'use strict'; |
| 15 | |
| 16 | async function main(projectId, location) { |
| 17 | // [START nodejs_retail_quickstart] |
| 18 | |
| 19 | // Imports the Google Cloud client library |
| 20 | const {CatalogServiceClient} = require('@google-cloud/retail'); |
| 21 | |
| 22 | // TODO(developer): uncomment these variables with your information |
| 23 | // const projectId = 'my-project' |
| 24 | // const location = 'global' |
| 25 | |
| 26 | // Creates a client |
| 27 | const client = new CatalogServiceClient(); |
| 28 | |
| 29 | async function listCatalogs() { |
| 30 | const catalogs = await client.listCatalogs({ |
| 31 | parent: `projects/${projectId}/locations/${location}`, |
| 32 | }); |
| 33 | console.info(catalogs); |
| 34 | } |
| 35 | listCatalogs(); |
| 36 | // [END nodejs_retail_quickstart] |
| 37 | } |
| 38 | |
| 39 | main(...process.argv.slice(2)).catch(err => { |
| 40 | console.error(err.message); |
no test coverage detected