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

Function main

asset/snippets/deleteSavedQuery.js:21–40  ·  view source on GitHub ↗
(fullQueryName)

Source from the content-addressed store, hash-verified

19// description: Delete Saved Query.
20
21async function main(fullQueryName) {
22 // [START asset_quickstart_delete_saved_query]
23 const {AssetServiceClient} = require('@google-cloud/asset');
24
25 const client = new AssetServiceClient();
26
27 // example inputs:
28 // const fullQueryName = 'projects/<PROJECT_NUMBER>/savedQueries/<QUERY_ID>';
29 async function deleteSavedQuery() {
30 const request = {
31 name: fullQueryName,
32 };
33 // Handle the operation using the promise pattern.
34 await client.deleteSavedQuery(request);
35 // Do things with with the response.
36 console.log('Deleted saved query:', fullQueryName);
37 // [END asset_quickstart_delete_saved_query]
38 }
39 await deleteSavedQuery();
40}
41
42exports.deleteSavedQuery = main;

Callers

nothing calls this directly

Calls 1

deleteSavedQueryFunction · 0.85

Tested by

no test coverage detected