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

Function listNotifications

storage/listNotifications.js:39–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37 const storage = new Storage();
38
39 async function listNotifications() {
40 try {
41 // Lists notifications in the bucket
42 const [notifications] = await storage
43 .bucket(bucketName)
44 .getNotifications();
45
46 console.log('Notifications:');
47 notifications.forEach(notification => {
48 console.log(notification.id);
49 });
50 } catch (error) {
51 console.error(
52 'Error executing list notifications:',
53 error.message || error
54 );
55 }
56 }
57
58 listNotifications();
59 // [END storage_list_bucket_notifications]

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected