(projectId, agentId, flowId, pageId, location)
| 17 | const {PagesClient} = require('@google-cloud/dialogflow-cx'); |
| 18 | |
| 19 | async function main(projectId, agentId, flowId, pageId, location) { |
| 20 | /** |
| 21 | * TODO(developer): Uncomment these variables before running the sample. |
| 22 | */ |
| 23 | // const projectId = 'my-project'; |
| 24 | // const agentId = 'my-agent'; |
| 25 | // const flowId = 'my-flow'; |
| 26 | // const pageId = 'my-page'; |
| 27 | // const location = 'global'; |
| 28 | |
| 29 | // [START dialogflow_cx_delete_page_sample] |
| 30 | async function deletePage(projectId, agentId, flowId, pageId, location) { |
| 31 | const pagesClient = new PagesClient(); |
| 32 | |
| 33 | const req = { |
| 34 | name: `projects/${projectId}/locations/${location}/agents/${agentId}/flows/${flowId}/pages/${pageId}`, |
| 35 | }; |
| 36 | |
| 37 | const response = await pagesClient.deletePage(req); |
| 38 | console.log(response); |
| 39 | } |
| 40 | // [END dialogflow_cx_delete_page_sample] |
| 41 | |
| 42 | await deletePage(projectId, agentId, flowId, pageId, location); |
| 43 | } |
| 44 | |
| 45 | main(...process.argv.slice(2)).catch(err => { |
| 46 | console.error(err); |
no test coverage detected