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

Function createFeed

asset/snippets/createFeed.js:37–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35 const client = new AssetServiceClient();
36
37 async function createFeed() {
38 const projectId = await client.getProjectId();
39 // TODO(developer): Choose asset names, such as //storage.googleapis.com/[YOUR_BUCKET_NAME].
40 // const assetNames = ['ASSET_NAME1', 'ASSET_NAME2', ...];
41
42 const request = {
43 parent: `projects/${projectId}`,
44 feedId: feedId,
45 feed: {
46 assetNames: assetNames.split(','),
47 contentType: contentType,
48 feedOutputConfig: {
49 pubsubDestination: {
50 topic: topicName,
51 },
52 },
53 },
54 };
55
56 // Handle the operation using the promise pattern.
57 const result = await client.createFeed(request);
58 // Do things with with the response.
59 console.log(util.inspect(result, {depth: null}));
60 // [END asset_quickstart_create_feed]
61 }
62 createFeed();
63}
64

Callers 1

mainFunction · 0.85

Calls 1

getProjectIdMethod · 0.80

Tested by

no test coverage detected