(projectId, location, channelId, eventId)
| 16 | 'use strict'; |
| 17 | |
| 18 | function main(projectId, location, channelId, eventId) { |
| 19 | // [START livestream_delete_channel_event] |
| 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 | // eventId = 'my-channel-event'; |
| 27 | |
| 28 | // Imports the Livestream library |
| 29 | const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; |
| 30 | |
| 31 | // Instantiates a client |
| 32 | const livestreamServiceClient = new LivestreamServiceClient(); |
| 33 | |
| 34 | async function deleteChannelEvent() { |
| 35 | // Construct request |
| 36 | const request = { |
| 37 | name: livestreamServiceClient.eventPath( |
| 38 | projectId, |
| 39 | location, |
| 40 | channelId, |
| 41 | eventId |
| 42 | ), |
| 43 | }; |
| 44 | |
| 45 | // Run request |
| 46 | await livestreamServiceClient.deleteEvent(request); |
| 47 | console.log('Deleted channel event'); |
| 48 | } |
| 49 | |
| 50 | deleteChannelEvent(); |
| 51 | // [END livestream_delete_channel_event] |
| 52 | } |
| 53 | |
| 54 | // node deleteChannelEvent.js <projectId> <location> <channelId> <eventId> |
| 55 | process.on('unhandledRejection', err => { |
no test coverage detected