| 32 | const livestreamServiceClient = new LivestreamServiceClient(); |
| 33 | |
| 34 | async function updateChannel() { |
| 35 | // Construct request |
| 36 | const request = { |
| 37 | channel: { |
| 38 | name: livestreamServiceClient.channelPath( |
| 39 | projectId, |
| 40 | location, |
| 41 | channelId |
| 42 | ), |
| 43 | inputAttachments: [ |
| 44 | { |
| 45 | key: 'updated-input', |
| 46 | input: livestreamServiceClient.inputPath( |
| 47 | projectId, |
| 48 | location, |
| 49 | inputId |
| 50 | ), |
| 51 | }, |
| 52 | ], |
| 53 | }, |
| 54 | updateMask: { |
| 55 | paths: ['input_attachments'], |
| 56 | }, |
| 57 | }; |
| 58 | |
| 59 | // Run request |
| 60 | const [operation] = await livestreamServiceClient.updateChannel(request); |
| 61 | const response = await operation.promise(); |
| 62 | const [channel] = response; |
| 63 | console.log(`Updated channel: ${channel.name}`); |
| 64 | } |
| 65 | |
| 66 | updateChannel(); |
| 67 | // [END livestream_update_channel] |