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

Function main

media/livestream/deleteChannelEvent.js:18–52  ·  view source on GitHub ↗
(projectId, location, channelId, eventId)

Source from the content-addressed store, hash-verified

16'use strict';
17
18function 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>
55process.on('unhandledRejection', err => {

Callers 1

Calls 1

deleteChannelEventFunction · 0.85

Tested by

no test coverage detected