Skip to content
This repository was archived by the owner on Jul 20, 2023. It is now read-only.

Commit 94d3fbc

Browse files
authored
docs: update list calls to Async (#186)
1 parent 3cc3500 commit 94d3fbc

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

samples/listJobTemplates.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ function main(projectId, location) {
3131
const transcoderServiceClient = new TranscoderServiceClient();
3232

3333
async function listJobTemplates() {
34-
const [jobTemplates] = await transcoderServiceClient.listJobTemplates({
34+
const iterable = await transcoderServiceClient.listJobTemplatesAsync({
3535
parent: transcoderServiceClient.locationPath(projectId, location),
3636
});
3737
console.info('Job templates:');
38-
for (const jobTemplate of jobTemplates) {
39-
console.info(jobTemplate.name);
38+
for await (const response of iterable) {
39+
console.log(response.name);
4040
}
4141
}
4242

samples/listJobs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ function main(projectId, location) {
3131
const transcoderServiceClient = new TranscoderServiceClient();
3232

3333
async function listJobs() {
34-
const [jobs] = await transcoderServiceClient.listJobs({
34+
const iterable = await transcoderServiceClient.listJobsAsync({
3535
parent: transcoderServiceClient.locationPath(projectId, location),
3636
});
3737
console.info('Jobs:');
38-
for (const job of jobs) {
39-
console.info(job.name);
38+
for await (const response of iterable) {
39+
console.log(response.name);
4040
}
4141
}
4242

0 commit comments

Comments
 (0)