( projectId = process.env.GOOGLE_CLOUD_PROJECT, cloudRegion = 'us-central1', datasetId )
| 15 | 'use strict'; |
| 16 | |
| 17 | const main = ( |
| 18 | projectId = process.env.GOOGLE_CLOUD_PROJECT, |
| 19 | cloudRegion = 'us-central1', |
| 20 | datasetId |
| 21 | ) => { |
| 22 | // [START healthcare_create_dataset] |
| 23 | const google = require('@googleapis/healthcare'); |
| 24 | const healthcare = google.healthcare({ |
| 25 | version: 'v1', |
| 26 | auth: new google.auth.GoogleAuth({ |
| 27 | scopes: ['https://www.googleapis.com/auth/cloud-platform'], |
| 28 | }), |
| 29 | }); |
| 30 | |
| 31 | const createDataset = async () => { |
| 32 | // TODO(developer): uncomment these lines before running the sample |
| 33 | // const cloudRegion = 'us-central1'; |
| 34 | // const projectId = 'adjective-noun-123'; |
| 35 | // const datasetId = 'my-dataset'; |
| 36 | const parent = `projects/${projectId}/locations/${cloudRegion}`; |
| 37 | const request = {parent, datasetId}; |
| 38 | |
| 39 | await healthcare.projects.locations.datasets.create(request); |
| 40 | console.log(`Created dataset: ${datasetId}`); |
| 41 | }; |
| 42 | |
| 43 | createDataset(); |
| 44 | // [END healthcare_create_dataset] |
| 45 | }; |
| 46 | |
| 47 | process.on('unhandledRejection', err => { |
| 48 | console.error(err.message); |
no test coverage detected