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

Function main

dialogflow-cx/create-page.js:19–46  ·  view source on GitHub ↗
(projectId, agentId, flowId, location, displayName)

Source from the content-addressed store, hash-verified

17const {PagesClient} = require('@google-cloud/dialogflow-cx');
18
19async 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
48main(...process.argv.slice(2)).catch(err => {
49 console.error(err);

Callers 1

create-page.jsFile · 0.70

Calls 1

createPageFunction · 0.85

Tested by

no test coverage detected