(projectId, agentId, flowId, location, displayName)
| 17 | const {PagesClient} = require('@google-cloud/dialogflow-cx'); |
| 18 | |
| 19 | async function main(projectId, agentId, flowId, location, displayName) { |
| 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 displayName = 'my-display-name'; |
| 27 | // const location = 'global'; |
| 28 | |
| 29 | // [START dialogflow_cx_create_page_sample] |
| 30 | async function createPage(projectId, agentId, flowId, location, displayName) { |
| 31 | const pagesClient = new PagesClient(); |
| 32 | |
| 33 | const createPageRequest = { |
| 34 | parent: `projects/${projectId}/locations/${location}/agents/${agentId}/flows/${flowId}`, |
| 35 | page: { |
| 36 | displayName: displayName, |
| 37 | }, |
| 38 | }; |
| 39 | |
| 40 | const response = await pagesClient.createPage(createPageRequest); |
| 41 | console.log(response); |
| 42 | } |
| 43 | // [END dialogflow_cx_create_page_sample] |
| 44 | |
| 45 | await createPage(projectId, agentId, flowId, location, displayName); |
| 46 | } |
| 47 | |
| 48 | main(...process.argv.slice(2)).catch(err => { |
| 49 | console.error(err); |
no test coverage detected