(fullQueryName, description)
| 19 | // description: Update Saved Query. |
| 20 | |
| 21 | async function main(fullQueryName, description) { |
| 22 | // [START asset_quickstart_update_feed] |
| 23 | const {AssetServiceClient} = require('@google-cloud/asset'); |
| 24 | |
| 25 | const client = new AssetServiceClient(); |
| 26 | // example inputs: |
| 27 | // const fullQueryName = 'folders/<FOLDER_NUMBER>/savedQueries/<QUERY_ID>'; |
| 28 | // const description = 'a new description'; |
| 29 | async function updateSavedQuery() { |
| 30 | const request = { |
| 31 | savedQuery: { |
| 32 | name: fullQueryName, |
| 33 | description: description, |
| 34 | }, |
| 35 | updateMask: { |
| 36 | paths: ['description'], |
| 37 | }, |
| 38 | }; |
| 39 | |
| 40 | // Handle the operation using the promise pattern. |
| 41 | const [query] = await client.updateSavedQuery(request); |
| 42 | // Do things with with the response. |
| 43 | console.log('Query name:', query.name); |
| 44 | console.log('Query description:', query.description); |
| 45 | console.log('Created time:', query.createTime); |
| 46 | console.log('Updated time:', query.lastUpdateTime); |
| 47 | console.log('Query type:', query.content.queryContent); |
| 48 | console.log('Query content:', JSON.stringify(query.content, null, 4)); |
| 49 | // [END asset_quickstart_update_feed] |
| 50 | } |
| 51 | await updateSavedQuery(); |
| 52 | } |
| 53 | |
| 54 | exports.updateSavedQuery = main; |
nothing calls this directly
no test coverage detected