(projectId, location, channelId)
| 16 | 'use strict'; |
| 17 | |
| 18 | function main(projectId, location, channelId) { |
| 19 | // [START livestream_delete_channel] |
| 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 deleteChannel() { |
| 34 | // Construct request |
| 35 | const request = { |
| 36 | name: livestreamServiceClient.channelPath(projectId, location, channelId), |
| 37 | }; |
| 38 | |
| 39 | // Run request |
| 40 | const [operation] = await livestreamServiceClient.deleteChannel(request); |
| 41 | await operation.promise(); |
| 42 | console.log('Deleted channel'); |
| 43 | } |
| 44 | |
| 45 | deleteChannel(); |
| 46 | // [END livestream_delete_channel] |
| 47 | } |
| 48 | |
| 49 | // node deleteChannel.js <projectId> <location> <channelId> |
| 50 | process.on('unhandledRejection', err => { |
no test coverage detected