(feedName, topicName)
| 20 | // usage: node updateFeed "project/<PROJECT_NUMBER>/feeds/<FEED_ID>" projects/<PROJECT_ID>/topics/<TOPIC_ID> |
| 21 | |
| 22 | async 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 | |
| 53 | main(...process.argv.slice(2)).catch(err => { |
| 54 | console.error(err.message); |
no test coverage detected