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

Function main

asset/snippets/updateFeed.js:22–51  ·  view source on GitHub ↗
(feedName, topicName)

Source from the content-addressed store, hash-verified

20// usage: node updateFeed "project/<PROJECT_NUMBER>/feeds/<FEED_ID>" projects/<PROJECT_ID>/topics/<TOPIC_ID>
21
22async function main(feedName, topicName) {
23 // [START asset_quickstart_update_feed]
24 const util = require('util');
25 const {AssetServiceClient} = require('@google-cloud/asset');
26
27 const client = new AssetServiceClient();
28
29 async function updateFeed() {
30 const request = {
31 feed: {
32 name: feedName,
33 feedOutputConfig: {
34 pubsubDestination: {
35 topic: topicName,
36 },
37 },
38 },
39 updateMask: {
40 paths: ['feed_output_config.pubsub_destination.topic'],
41 },
42 };
43
44 // Handle the operation using the promise pattern.
45 const result = await client.updateFeed(request);
46 // Do things with with the response.
47 console.log(util.inspect(result, {depth: null}));
48 // [END asset_quickstart_update_feed]
49 }
50 updateFeed();
51}
52
53main(...process.argv.slice(2)).catch(err => {
54 console.error(err.message);

Callers 1

updateFeed.jsFile · 0.70

Calls 1

updateFeedFunction · 0.85

Tested by

no test coverage detected