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