MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / main

Function main

media/transcoder/listJobTemplates.js:18–45  ·  view source on GitHub ↗
(projectId, location)

Source from the content-addressed store, hash-verified

16'use strict';
17
18function 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>
48process.on('unhandledRejection', err => {

Callers 1

Calls 1

listJobTemplatesFunction · 0.85

Tested by

no test coverage detected