|
| 1 | +// Copyright 2022 Google LLC |
| 2 | +// |
1 | 3 | // Licensed under the Apache License, Version 2.0 (the "License");
|
2 | 4 | // you may not use this file except in compliance with the License.
|
3 | 5 | // You may obtain a copy of the License at
|
|
10 | 12 | // See the License for the specific language governing permissions and
|
11 | 13 | // limitations under the License.
|
12 | 14 | //
|
| 15 | +// ** This file is automatically generated by gapic-generator-typescript. ** |
| 16 | +// ** https://github.com/googleapis/gapic-generator-typescript ** |
| 17 | +// ** All changes to this file may be overwritten. ** |
13 | 18 |
|
14 | 19 | 'use strict';
|
15 | 20 |
|
16 |
| -async function main() { |
17 |
| - |
18 |
| - // [START nodejs_video_stitcher_quickstart] |
19 |
| - // Imports the Google Cloud client library |
| 21 | +function main(parent) { |
| 22 | + // [START videostitcher_v1_generated_VideoStitcherService_ListCdnKeys_async] |
| 23 | + /** |
| 24 | + * TODO(developer): Uncomment these variables before running the sample. |
| 25 | + */ |
| 26 | + /** |
| 27 | + * Required. The project that contains the list of CDN keys, in the form of |
| 28 | + * `projects/{project_number}/locations/{location}`. |
| 29 | + */ |
| 30 | + // const parent = 'abc123' |
| 31 | + /** |
| 32 | + * Requested page size. Server may return fewer items than requested. |
| 33 | + * If unspecified, server will pick an appropriate default. |
| 34 | + */ |
| 35 | + // const pageSize = 1234 |
| 36 | + /** |
| 37 | + * A token identifying a page of results the server should return. |
| 38 | + */ |
| 39 | + // const pageToken = 'abc123' |
| 40 | + /** |
| 41 | + * Filtering results |
| 42 | + */ |
| 43 | + // const filter = 'abc123' |
| 44 | + /** |
| 45 | + * Hint for how to order the results |
| 46 | + */ |
| 47 | + // const orderBy = 'abc123' |
20 | 48 |
|
21 |
| - // remove this line after package is released |
22 |
| - // eslint-disable-next-line node/no-missing-require |
23 |
| - const {VideoStitcherServiceClient} = require('@google-cloud/video-stitcher'); |
| 49 | + // Imports the Stitcher library |
| 50 | + const {VideoStitcherServiceClient} = |
| 51 | + require('@google-cloud/video-stitcher').v1; |
24 | 52 |
|
25 |
| - // TODO(developer): replace with your prefered project ID. |
26 |
| - // const projectId = 'my-project' |
| 53 | + // Instantiates a client |
| 54 | + const stitcherClient = new VideoStitcherServiceClient(); |
27 | 55 |
|
28 |
| - // Creates a client |
29 |
| - // eslint-disable-next-line no-unused-vars |
30 |
| - const client = new {VideoStitcherServiceClient}(); |
| 56 | + async function callListCdnKeys() { |
| 57 | + // Construct request |
| 58 | + const request = { |
| 59 | + parent, |
| 60 | + }; |
31 | 61 |
|
32 |
| - //TODO(library generator): write the actual function you will be testing |
33 |
| - async function doSomething() { |
34 |
| - console.log('DPE! Change this code so that it shows how to use the library! See comments below on structure.') |
35 |
| - // const [thing] = await client.methodName({ |
36 |
| - // }); |
37 |
| - // console.info(thing); |
| 62 | + // Run request |
| 63 | + const iterable = await stitcherClient.listCdnKeysAsync(request); |
| 64 | + for await (const response of iterable) { |
| 65 | + console.log(response); |
| 66 | + } |
| 67 | + console.log(iterable); |
38 | 68 | }
|
39 |
| - doSomething(); |
40 |
| - // [END nodejs_video_stitcher_quickstart] |
| 69 | + |
| 70 | + callListCdnKeys(); |
| 71 | + // [END videostitcher_v1_generated_VideoStitcherService_ListCdnKeys_async] |
41 | 72 | }
|
42 | 73 |
|
43 |
| -main(...process.argv.slice(2)).catch(err => { |
44 |
| - console.error(err.message); |
45 |
| - process.exitCode = 1; |
46 |
| -}); |
47 | 74 | process.on('unhandledRejection', err => {
|
48 | 75 | console.error(err.message);
|
49 | 76 | process.exitCode = 1;
|
50 | 77 | });
|
| 78 | +main(...process.argv.slice(2)); |
0 commit comments