"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.CxPage = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A Dialogflow CX conversation (session) can be described and visualized as a state machine. The states of a CX session are represented by pages.
 *
 * To get more information about Page, see:
 *
 * * [API documentation](https://cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.flows.pages)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/dialogflow/cx/docs)
 *
 * ## Example Usage
 *
 * ### Dialogflowcx Page Full
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const agent = new gcp.diagflow.CxAgent("agent", {
 *     displayName: "dialogflowcx-agent",
 *     location: "global",
 *     defaultLanguageCode: "en",
 *     supportedLanguageCodes: [
 *         "fr",
 *         "de",
 *         "es",
 *     ],
 *     timeZone: "America/New_York",
 *     description: "Example description.",
 *     avatarUri: "https://cloud.google.com/_static/images/cloud/icons/favicons/onecloud/super_cloud.png",
 *     enableStackdriverLogging: true,
 *     enableSpellCorrection: true,
 *     speechToTextSettings: {
 *         enableSpeechAdaptation: true,
 *     },
 * });
 * const myPage2 = new gcp.diagflow.CxPage("my_page2", {
 *     parent: agent.startFlow,
 *     displayName: "MyPage2",
 * });
 * const myWebhook = new gcp.diagflow.CxWebhook("my_webhook", {
 *     parent: agent.id,
 *     displayName: "MyWebhook",
 *     genericWebService: {
 *         uri: "https://example.com",
 *     },
 * });
 * const project = gcp.organizations.getProject({});
 * const basicPage = new gcp.diagflow.CxPage("basic_page", {
 *     parent: agent.startFlow,
 *     displayName: "MyPage",
 *     entryFulfillment: {
 *         messages: [
 *             {
 *                 channel: "some-channel",
 *                 text: {
 *                     texts: ["Welcome to page"],
 *                 },
 *             },
 *             {
 *                 payload: "        {\\\"some-key\\\": \\\"some-value\\\", \\\"other-key\\\": [\\\"other-value\\\"]}\n",
 *             },
 *             {
 *                 conversationSuccess: {
 *                     metadata: "          {\\\"some-metadata-key\\\": \\\"some-value\\\", \\\"other-metadata-key\\\": 1234}\n",
 *                 },
 *             },
 *             {
 *                 outputAudioText: {
 *                     text: "some output text",
 *                 },
 *             },
 *             {
 *                 outputAudioText: {
 *                     ssml: "          <speak>Some example <say-as interpret-as=\\\"characters\\\">SSML XML</say-as></speak>\n",
 *                 },
 *             },
 *             {
 *                 liveAgentHandoff: {
 *                     metadata: "          {\\\"some-metadata-key\\\": \\\"some-value\\\", \\\"other-metadata-key\\\": 1234}\n",
 *                 },
 *             },
 *             {
 *                 playAudio: {
 *                     audioUri: "http://example.com/some-audio-file.mp3",
 *                 },
 *             },
 *             {
 *                 telephonyTransferCall: {
 *                     phoneNumber: "1-234-567-8901",
 *                 },
 *             },
 *         ],
 *         setParameterActions: [
 *             {
 *                 parameter: "some-param",
 *                 value: "123.45",
 *             },
 *             {
 *                 parameter: "another-param",
 *                 value: JSON.stringify("abc"),
 *             },
 *             {
 *                 parameter: "other-param",
 *                 value: JSON.stringify(["foo"]),
 *             },
 *         ],
 *         conditionalCases: [{
 *             cases: JSON.stringify([
 *                 {
 *                     condition: "$sys.func.RAND() < 0.5",
 *                     caseContent: [
 *                         {
 *                             message: {
 *                                 text: {
 *                                     text: ["First case"],
 *                                 },
 *                             },
 *                         },
 *                         {
 *                             additionalCases: {
 *                                 cases: [{
 *                                     condition: "$sys.func.RAND() < 0.2",
 *                                     caseContent: [{
 *                                         message: {
 *                                             text: {
 *                                                 text: ["Nested case"],
 *                                             },
 *                                         },
 *                                     }],
 *                                 }],
 *                             },
 *                         },
 *                     ],
 *                 },
 *                 {
 *                     caseContent: [{
 *                         message: {
 *                             text: {
 *                                 text: ["Final case"],
 *                             },
 *                         },
 *                     }],
 *                 },
 *             ]),
 *         }],
 *     },
 *     eventHandlers: [{
 *         event: "some-event",
 *         triggerFulfillment: {
 *             returnPartialResponses: true,
 *             messages: [
 *                 {
 *                     channel: "some-channel",
 *                     text: {
 *                         texts: ["Some text"],
 *                     },
 *                 },
 *                 {
 *                     payload: "          {\\\"some-key\\\": \\\"some-value\\\", \\\"other-key\\\": [\\\"other-value\\\"]}\n",
 *                 },
 *                 {
 *                     conversationSuccess: {
 *                         metadata: "            {\\\"some-metadata-key\\\": \\\"some-value\\\", \\\"other-metadata-key\\\": 1234}\n",
 *                     },
 *                 },
 *                 {
 *                     outputAudioText: {
 *                         text: "some output text",
 *                     },
 *                 },
 *                 {
 *                     outputAudioText: {
 *                         ssml: "            <speak>Some example <say-as interpret-as=\\\"characters\\\">SSML XML</say-as></speak>\n",
 *                     },
 *                 },
 *                 {
 *                     liveAgentHandoff: {
 *                         metadata: "            {\\\"some-metadata-key\\\": \\\"some-value\\\", \\\"other-metadata-key\\\": 1234}\n",
 *                     },
 *                 },
 *                 {
 *                     playAudio: {
 *                         audioUri: "http://example.com/some-audio-file.mp3",
 *                     },
 *                 },
 *                 {
 *                     telephonyTransferCall: {
 *                         phoneNumber: "1-234-567-8901",
 *                     },
 *                 },
 *             ],
 *             setParameterActions: [
 *                 {
 *                     parameter: "some-param",
 *                     value: "123.45",
 *                 },
 *                 {
 *                     parameter: "another-param",
 *                     value: JSON.stringify("abc"),
 *                 },
 *                 {
 *                     parameter: "other-param",
 *                     value: JSON.stringify(["foo"]),
 *                 },
 *             ],
 *             conditionalCases: [{
 *                 cases: JSON.stringify([
 *                     {
 *                         condition: "$sys.func.RAND() < 0.5",
 *                         caseContent: [
 *                             {
 *                                 message: {
 *                                     text: {
 *                                         text: ["First case"],
 *                                     },
 *                                 },
 *                             },
 *                             {
 *                                 additionalCases: {
 *                                     cases: [{
 *                                         condition: "$sys.func.RAND() < 0.2",
 *                                         caseContent: [{
 *                                             message: {
 *                                                 text: {
 *                                                     text: ["Nested case"],
 *                                                 },
 *                                             },
 *                                         }],
 *                                     }],
 *                                 },
 *                             },
 *                         ],
 *                     },
 *                     {
 *                         caseContent: [{
 *                             message: {
 *                                 text: {
 *                                     text: ["Final case"],
 *                                 },
 *                             },
 *                         }],
 *                     },
 *                 ]),
 *             }],
 *         },
 *     }],
 *     form: {
 *         parameters: [{
 *             displayName: "param1",
 *             entityType: "projects/-/locations/-/agents/-/entityTypes/sys.date",
 *             defaultValue: JSON.stringify("2000-01-01"),
 *             fillBehavior: {
 *                 initialPromptFulfillment: {
 *                     messages: [
 *                         {
 *                             channel: "some-channel",
 *                             text: {
 *                                 texts: ["Please provide param1"],
 *                             },
 *                         },
 *                         {
 *                             payload: "              {\\\"some-key\\\": \\\"some-value\\\", \\\"other-key\\\": [\\\"other-value\\\"]}\n",
 *                         },
 *                         {
 *                             conversationSuccess: {
 *                                 metadata: "                {\\\"some-metadata-key\\\": \\\"some-value\\\", \\\"other-metadata-key\\\": 1234}\n",
 *                             },
 *                         },
 *                         {
 *                             outputAudioText: {
 *                                 text: "some output text",
 *                             },
 *                         },
 *                         {
 *                             outputAudioText: {
 *                                 ssml: "                <speak>Some example <say-as interpret-as=\\\"characters\\\">SSML XML</say-as></speak>\n",
 *                             },
 *                         },
 *                         {
 *                             liveAgentHandoff: {
 *                                 metadata: "                {\\\"some-metadata-key\\\": \\\"some-value\\\", \\\"other-metadata-key\\\": 1234}\n",
 *                             },
 *                         },
 *                         {
 *                             playAudio: {
 *                                 audioUri: "http://example.com/some-audio-file.mp3",
 *                             },
 *                         },
 *                         {
 *                             telephonyTransferCall: {
 *                                 phoneNumber: "1-234-567-8901",
 *                             },
 *                         },
 *                     ],
 *                     setParameterActions: [
 *                         {
 *                             parameter: "some-param",
 *                             value: "123.45",
 *                         },
 *                         {
 *                             parameter: "another-param",
 *                             value: JSON.stringify("abc"),
 *                         },
 *                         {
 *                             parameter: "other-param",
 *                             value: JSON.stringify(["foo"]),
 *                         },
 *                     ],
 *                     conditionalCases: [{
 *                         cases: JSON.stringify([
 *                             {
 *                                 condition: "$sys.func.RAND() < 0.5",
 *                                 caseContent: [
 *                                     {
 *                                         message: {
 *                                             text: {
 *                                                 text: ["First case"],
 *                                             },
 *                                         },
 *                                     },
 *                                     {
 *                                         additionalCases: {
 *                                             cases: [{
 *                                                 condition: "$sys.func.RAND() < 0.2",
 *                                                 caseContent: [{
 *                                                     message: {
 *                                                         text: {
 *                                                             text: ["Nested case"],
 *                                                         },
 *                                                     },
 *                                                 }],
 *                                             }],
 *                                         },
 *                                     },
 *                                 ],
 *                             },
 *                             {
 *                                 caseContent: [{
 *                                     message: {
 *                                         text: {
 *                                             text: ["Final case"],
 *                                         },
 *                                     },
 *                                 }],
 *                             },
 *                         ]),
 *                     }],
 *                 },
 *                 repromptEventHandlers: [
 *                     {
 *                         event: "sys.no-match-1",
 *                         triggerFulfillment: {
 *                             returnPartialResponses: true,
 *                             webhook: myWebhook.id,
 *                             tag: "some-tag",
 *                             messages: [
 *                                 {
 *                                     channel: "some-channel",
 *                                     text: {
 *                                         texts: ["Please provide param1"],
 *                                     },
 *                                 },
 *                                 {
 *                                     payload: "                {\\\"some-key\\\": \\\"some-value\\\", \\\"other-key\\\": [\\\"other-value\\\"]}\n",
 *                                 },
 *                                 {
 *                                     conversationSuccess: {
 *                                         metadata: "                  {\\\"some-metadata-key\\\": \\\"some-value\\\", \\\"other-metadata-key\\\": 1234}\n",
 *                                     },
 *                                 },
 *                                 {
 *                                     outputAudioText: {
 *                                         text: "some output text",
 *                                     },
 *                                 },
 *                                 {
 *                                     outputAudioText: {
 *                                         ssml: "                  <speak>Some example <say-as interpret-as=\\\"characters\\\">SSML XML</say-as></speak>\n",
 *                                     },
 *                                 },
 *                                 {
 *                                     liveAgentHandoff: {
 *                                         metadata: "                  {\\\"some-metadata-key\\\": \\\"some-value\\\", \\\"other-metadata-key\\\": 1234}\n",
 *                                     },
 *                                 },
 *                                 {
 *                                     playAudio: {
 *                                         audioUri: "http://example.com/some-audio-file.mp3",
 *                                     },
 *                                 },
 *                                 {
 *                                     telephonyTransferCall: {
 *                                         phoneNumber: "1-234-567-8901",
 *                                     },
 *                                 },
 *                             ],
 *                             setParameterActions: [
 *                                 {
 *                                     parameter: "some-param",
 *                                     value: "123.45",
 *                                 },
 *                                 {
 *                                     parameter: "another-param",
 *                                     value: JSON.stringify("abc"),
 *                                 },
 *                                 {
 *                                     parameter: "other-param",
 *                                     value: JSON.stringify(["foo"]),
 *                                 },
 *                             ],
 *                             conditionalCases: [{
 *                                 cases: JSON.stringify([
 *                                     {
 *                                         condition: "$sys.func.RAND() < 0.5",
 *                                         caseContent: [
 *                                             {
 *                                                 message: {
 *                                                     text: {
 *                                                         text: ["First case"],
 *                                                     },
 *                                                 },
 *                                             },
 *                                             {
 *                                                 additionalCases: {
 *                                                     cases: [{
 *                                                         condition: "$sys.func.RAND() < 0.2",
 *                                                         caseContent: [{
 *                                                             message: {
 *                                                                 text: {
 *                                                                     text: ["Nested case"],
 *                                                                 },
 *                                                             },
 *                                                         }],
 *                                                     }],
 *                                                 },
 *                                             },
 *                                         ],
 *                                     },
 *                                     {
 *                                         caseContent: [{
 *                                             message: {
 *                                                 text: {
 *                                                     text: ["Final case"],
 *                                                 },
 *                                             },
 *                                         }],
 *                                     },
 *                                 ]),
 *                             }],
 *                         },
 *                     },
 *                     {
 *                         event: "sys.no-match-2",
 *                         targetFlow: agent.startFlow,
 *                     },
 *                     {
 *                         event: "sys.no-match-3",
 *                         targetPage: myPage2.id,
 *                     },
 *                 ],
 *             },
 *             required: true,
 *             redact: true,
 *             advancedSettings: {
 *                 dtmfSettings: {
 *                     enabled: true,
 *                     maxDigits: 1,
 *                     finishDigit: "#",
 *                 },
 *             },
 *         }],
 *     },
 *     transitionRoutes: [{
 *         condition: "$page.params.status = 'FINAL'",
 *         triggerFulfillment: {
 *             messages: [
 *                 {
 *                     channel: "some-channel",
 *                     text: {
 *                         texts: ["information completed, navigating to page 2"],
 *                     },
 *                 },
 *                 {
 *                     payload: "          {\\\"some-key\\\": \\\"some-value\\\", \\\"other-key\\\": [\\\"other-value\\\"]}\n",
 *                 },
 *                 {
 *                     conversationSuccess: {
 *                         metadata: "            {\\\"some-metadata-key\\\": \\\"some-value\\\", \\\"other-metadata-key\\\": 1234}\n",
 *                     },
 *                 },
 *                 {
 *                     outputAudioText: {
 *                         text: "some output text",
 *                     },
 *                 },
 *                 {
 *                     outputAudioText: {
 *                         ssml: "            <speak>Some example <say-as interpret-as=\\\"characters\\\">SSML XML</say-as></speak>\n",
 *                     },
 *                 },
 *                 {
 *                     liveAgentHandoff: {
 *                         metadata: "            {\\\"some-metadata-key\\\": \\\"some-value\\\", \\\"other-metadata-key\\\": 1234}\n",
 *                     },
 *                 },
 *                 {
 *                     playAudio: {
 *                         audioUri: "http://example.com/some-audio-file.mp3",
 *                     },
 *                 },
 *                 {
 *                     telephonyTransferCall: {
 *                         phoneNumber: "1-234-567-8901",
 *                     },
 *                 },
 *             ],
 *             setParameterActions: [
 *                 {
 *                     parameter: "some-param",
 *                     value: "123.45",
 *                 },
 *                 {
 *                     parameter: "another-param",
 *                     value: JSON.stringify("abc"),
 *                 },
 *                 {
 *                     parameter: "other-param",
 *                     value: JSON.stringify(["foo"]),
 *                 },
 *             ],
 *             conditionalCases: [{
 *                 cases: JSON.stringify([
 *                     {
 *                         condition: "$sys.func.RAND() < 0.5",
 *                         caseContent: [
 *                             {
 *                                 message: {
 *                                     text: {
 *                                         text: ["First case"],
 *                                     },
 *                                 },
 *                             },
 *                             {
 *                                 additionalCases: {
 *                                     cases: [{
 *                                         condition: "$sys.func.RAND() < 0.2",
 *                                         caseContent: [{
 *                                             message: {
 *                                                 text: {
 *                                                     text: ["Nested case"],
 *                                                 },
 *                                             },
 *                                         }],
 *                                     }],
 *                                 },
 *                             },
 *                         ],
 *                     },
 *                     {
 *                         caseContent: [{
 *                             message: {
 *                                 text: {
 *                                     text: ["Final case"],
 *                                 },
 *                             },
 *                         }],
 *                     },
 *                 ]),
 *             }],
 *         },
 *         targetPage: myPage2.id,
 *     }],
 *     advancedSettings: {
 *         dtmfSettings: {
 *             enabled: true,
 *             maxDigits: 1,
 *             finishDigit: "#",
 *         },
 *     },
 *     knowledgeConnectorSettings: {
 *         enabled: true,
 *         triggerFulfillment: {
 *             messages: [
 *                 {
 *                     channel: "some-channel",
 *                     knowledgeInfoCard: {},
 *                 },
 *                 {
 *                     channel: "some-channel",
 *                     text: {
 *                         texts: ["information completed, navigating to page 2"],
 *                     },
 *                 },
 *                 {
 *                     payload: "          {\\\"some-key\\\": \\\"some-value\\\", \\\"other-key\\\": [\\\"other-value\\\"]}\n",
 *                 },
 *                 {
 *                     conversationSuccess: {
 *                         metadata: "            {\\\"some-metadata-key\\\": \\\"some-value\\\", \\\"other-metadata-key\\\": 1234}\n",
 *                     },
 *                 },
 *                 {
 *                     outputAudioText: {
 *                         text: "some output text",
 *                     },
 *                 },
 *                 {
 *                     outputAudioText: {
 *                         ssml: "            <speak>Some example <say-as interpret-as=\\\"characters\\\">SSML XML</say-as></speak>\n",
 *                     },
 *                 },
 *                 {
 *                     liveAgentHandoff: {
 *                         metadata: "            {\\\"some-metadata-key\\\": \\\"some-value\\\", \\\"other-metadata-key\\\": 1234}\n",
 *                     },
 *                 },
 *                 {
 *                     playAudio: {
 *                         audioUri: "http://example.com/some-audio-file.mp3",
 *                     },
 *                 },
 *                 {
 *                     telephonyTransferCall: {
 *                         phoneNumber: "1-234-567-8902",
 *                     },
 *                 },
 *             ],
 *             webhook: myWebhook.id,
 *             returnPartialResponses: true,
 *             tag: "some-tag",
 *             setParameterActions: [{
 *                 parameter: "some-param",
 *                 value: "123.45",
 *             }],
 *             conditionalCases: [{
 *                 cases: JSON.stringify([
 *                     {
 *                         condition: "$sys.func.RAND() < 0.5",
 *                         caseContent: [{
 *                             message: {
 *                                 text: {
 *                                     text: ["First case"],
 *                                 },
 *                             },
 *                         }],
 *                     },
 *                     {
 *                         caseContent: [{
 *                             message: {
 *                                 text: {
 *                                     text: ["Final case"],
 *                                 },
 *                             },
 *                         }],
 *                     },
 *                 ]),
 *             }],
 *             advancedSettings: {
 *                 speechSettings: {
 *                     endpointerSensitivity: 30,
 *                     noSpeechTimeout: "3.500s",
 *                     useTimeoutBasedEndpointing: true,
 *                     models: {
 *                         name: "wrench",
 *                         mass: "1.3kg",
 *                         count: "3",
 *                     },
 *                 },
 *                 dtmfSettings: {
 *                     enabled: true,
 *                     maxDigits: 1,
 *                     finishDigit: "#",
 *                     interdigitTimeoutDuration: "3.500s",
 *                     endpointingTimeoutDuration: "3.500s",
 *                 },
 *                 loggingSettings: {
 *                     enableStackdriverLogging: true,
 *                     enableInteractionLogging: true,
 *                     enableConsentBasedRedaction: true,
 *                 },
 *             },
 *             enableGenerativeFallback: true,
 *         },
 *         dataStoreConnections: [{
 *             dataStoreType: "PUBLIC_WEB",
 *             dataStore: pulumi.all([project, agent.location]).apply(([project, location]) => `projects/${project.number}/locations/${location}/collections/default_collection/dataStores/datastore-page-full`),
 *             documentProcessingMode: "CHUNKS",
 *         }],
 *         targetPage: myPage2.id,
 *     },
 * });
 * const myDatastore = new gcp.discoveryengine.DataStore("my_datastore", {
 *     location: "global",
 *     dataStoreId: "datastore-page-full",
 *     displayName: "datastore-page-full",
 *     industryVertical: "GENERIC",
 *     contentConfig: "NO_CONTENT",
 * });
 * ```
 *
 * ## Import
 *
 * Page can be imported using any of these accepted formats:
 *
 * * `{{parent}}/pages/{{name}}`
 *
 * * `{{parent}}/{{name}}`
 *
 * When using the `pulumi import` command, Page can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:diagflow/cxPage:CxPage default {{parent}}/pages/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:diagflow/cxPage:CxPage default {{parent}}/{{name}}
 * ```
 */
class CxPage extends pulumi.CustomResource {
    /**
     * Get an existing CxPage resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, state, opts) {
        return new CxPage(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of CxPage.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === CxPage.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["advancedSettings"] = state?.advancedSettings;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["entryFulfillment"] = state?.entryFulfillment;
            resourceInputs["eventHandlers"] = state?.eventHandlers;
            resourceInputs["form"] = state?.form;
            resourceInputs["knowledgeConnectorSettings"] = state?.knowledgeConnectorSettings;
            resourceInputs["languageCode"] = state?.languageCode;
            resourceInputs["name"] = state?.name;
            resourceInputs["parent"] = state?.parent;
            resourceInputs["transitionRouteGroups"] = state?.transitionRouteGroups;
            resourceInputs["transitionRoutes"] = state?.transitionRoutes;
        }
        else {
            const args = argsOrState;
            if (args?.displayName === undefined && !opts.urn) {
                throw new Error("Missing required property 'displayName'");
            }
            resourceInputs["advancedSettings"] = args?.advancedSettings;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["entryFulfillment"] = args?.entryFulfillment;
            resourceInputs["eventHandlers"] = args?.eventHandlers;
            resourceInputs["form"] = args?.form;
            resourceInputs["knowledgeConnectorSettings"] = args?.knowledgeConnectorSettings;
            resourceInputs["languageCode"] = args?.languageCode;
            resourceInputs["parent"] = args?.parent;
            resourceInputs["transitionRouteGroups"] = args?.transitionRouteGroups;
            resourceInputs["transitionRoutes"] = args?.transitionRoutes;
            resourceInputs["name"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(CxPage.__pulumiType, name, resourceInputs, opts);
    }
}
exports.CxPage = CxPage;
/** @internal */
CxPage.__pulumiType = 'gcp:diagflow/cxPage:CxPage';
//# sourceMappingURL=cxPage.js.map