| 31 | const livestreamServiceClient = new LivestreamServiceClient(); |
| 32 | |
| 33 | async function createInput() { |
| 34 | // Construct request |
| 35 | const request = { |
| 36 | parent: livestreamServiceClient.locationPath(projectId, location), |
| 37 | inputId: inputId, |
| 38 | input: { |
| 39 | type: 'RTMP_PUSH', |
| 40 | }, |
| 41 | }; |
| 42 | |
| 43 | // Run request |
| 44 | const [operation] = await livestreamServiceClient.createInput(request); |
| 45 | const response = await operation.promise(); |
| 46 | const [input] = response; |
| 47 | console.log(`Input: ${input.name}`); |
| 48 | } |
| 49 | |
| 50 | createInput(); |
| 51 | // [END livestream_create_input] |