(projectId, location)
| 16 | 'use strict'; |
| 17 | |
| 18 | function main(projectId, location) { |
| 19 | // [START transcoder_list_job_templates] |
| 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 Transcoder library |
| 27 | const {TranscoderServiceClient} = |
| 28 | require('@google-cloud/video-transcoder').v1; |
| 29 | |
| 30 | // Instantiates a client |
| 31 | const transcoderServiceClient = new TranscoderServiceClient(); |
| 32 | |
| 33 | async function listJobTemplates() { |
| 34 | const iterable = await transcoderServiceClient.listJobTemplatesAsync({ |
| 35 | parent: transcoderServiceClient.locationPath(projectId, location), |
| 36 | }); |
| 37 | console.info('Job templates:'); |
| 38 | for await (const response of iterable) { |
| 39 | console.log(response.name); |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | listJobTemplates(); |
| 44 | // [END transcoder_list_job_templates] |
| 45 | } |
| 46 | |
| 47 | // node listJobTemplates.js <projectId> <location> |
| 48 | process.on('unhandledRejection', err => { |
no test coverage detected