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

Function main

healthcare/datasets/createDataset.js:17–45  ·  view source on GitHub ↗
(
  projectId = process.env.GOOGLE_CLOUD_PROJECT,
  cloudRegion = 'us-central1',
  datasetId
)

Source from the content-addressed store, hash-verified

15'use strict';
16
17const 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
47process.on('unhandledRejection', err => {
48 console.error(err.message);

Callers 1

createDataset.jsFile · 0.70

Calls 1

createDatasetFunction · 0.70

Tested by

no test coverage detected