Skip to content

Commit a4e28d3

Browse files
authored
docs: update list calls to async (#44)
1 parent f78c303 commit a4e28d3

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

media/livestream/listChannelEvents.js

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

3333
async function listChannelEvents() {
34-
const [events] = await livestreamServiceClient.listEvents({
34+
const iterable = await livestreamServiceClient.listEventsAsync({
3535
parent: livestreamServiceClient.channelPath(
3636
projectId,
3737
location,
3838
channelId
3939
),
4040
});
4141
console.info('Channel events:');
42-
for (const event of events) {
43-
console.info(event.name);
42+
for await (const response of iterable) {
43+
console.log(response.name);
4444
}
4545
}
4646

media/livestream/listChannels.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ function main(projectId, location) {
3030
const livestreamServiceClient = new LivestreamServiceClient();
3131

3232
async function listChannels() {
33-
const [channels] = await livestreamServiceClient.listChannels({
33+
const iterable = await livestreamServiceClient.listChannelsAsync({
3434
parent: livestreamServiceClient.locationPath(projectId, location),
3535
});
3636
console.info('Channels:');
37-
for (const channel of channels) {
38-
console.info(channel.name);
37+
for await (const response of iterable) {
38+
console.log(response.name);
3939
}
4040
}
4141

media/livestream/listInputs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ function main(projectId, location) {
3030
const livestreamServiceClient = new LivestreamServiceClient();
3131

3232
async function listInputs() {
33-
const [inputs] = await livestreamServiceClient.listInputs({
33+
const iterable = await livestreamServiceClient.listInputsAsync({
3434
parent: livestreamServiceClient.locationPath(projectId, location),
3535
});
3636
console.info('Inputs:');
37-
for (const input of inputs) {
38-
console.info(input.name);
37+
for await (const response of iterable) {
38+
console.log(response.name);
3939
}
4040
}
4141

0 commit comments

Comments
 (0)