(projectId, location, channelId)
| 16 | 'use strict'; |
| 17 | |
| 18 | function main(projectId, location, channelId) { |
| 19 | // [START livestream_list_channel_events] |
| 20 | /** |
| 21 | * TODO(developer): Uncomment these variables before running the sample. |
| 22 | */ |
| 23 | // projectId = 'my-project-id'; |
| 24 | // location = 'us-central1'; |
| 25 | // channelId = 'my-channel'; |
| 26 | |
| 27 | // Imports the Livestream library |
| 28 | const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; |
| 29 | |
| 30 | // Instantiates a client |
| 31 | const livestreamServiceClient = new LivestreamServiceClient(); |
| 32 | |
| 33 | async function listChannelEvents() { |
| 34 | const iterable = await livestreamServiceClient.listEventsAsync({ |
| 35 | parent: livestreamServiceClient.channelPath( |
| 36 | projectId, |
| 37 | location, |
| 38 | channelId |
| 39 | ), |
| 40 | }); |
| 41 | console.info('Channel events:'); |
| 42 | for await (const response of iterable) { |
| 43 | console.log(response.name); |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | listChannelEvents(); |
| 48 | // [END livestream_list_channel_events] |
| 49 | } |
| 50 | |
| 51 | // node listChannelEvents.js <projectId> <location> <channelId> |
| 52 | process.on('unhandledRejection', err => { |
no test coverage detected