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

Function main

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

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 timeZone
22) => {
23 // [START healthcare_patch_dataset]
24 const google = require('@googleapis/healthcare');
25 const healthcare = google.healthcare({
26 version: 'v1',
27 auth: new google.auth.GoogleAuth({
28 scopes: ['https://www.googleapis.com/auth/cloud-platform'],
29 }),
30 });
31
32 const patchDataset = async () => {
33 // TODO(developer): uncomment these lines before running the sample
34 // const cloudRegion = 'us-central1';
35 // const projectId = 'adjective-noun-123';
36 // const datasetId = 'my-dataset';
37 // const timeZone = 'UTC';
38 const name = `projects/${projectId}/locations/${cloudRegion}/datasets/${datasetId}`;
39 const request = {
40 name,
41 updateMask: 'timeZone',
42 resource: {timeZone: timeZone},
43 };
44
45 await healthcare.projects.locations.datasets.patch(request);
46 console.log(`Dataset ${datasetId} patched with time zone ${timeZone}`);
47 };
48
49 patchDataset();
50 // [END healthcare_patch_dataset]
51};
52
53// node patchDataset.js <projectId> <cloudRegion> <datasetId> <timeZone>
54main(...process.argv.slice(2));

Callers 1

patchDataset.jsFile · 0.70

Calls 1

patchDatasetFunction · 0.85

Tested by

no test coverage detected