"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.CxAgent = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Agents are best described as Natural Language Understanding (NLU) modules that transform user requests into actionable data. You can include agents in your app, product, or service to determine user intent and respond to the user in a natural way.
 *
 * To get more information about Agent, see:
 *
 * * [API documentation](https://cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/dialogflow/cx/docs)
 *
 * ## Example Usage
 *
 * ### Dialogflowcx Agent Full
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const bucket = new gcp.storage.Bucket("bucket", {
 *     name: "dialogflowcx-bucket",
 *     location: "US",
 *     uniformBucketLevelAccess: true,
 * });
 * const fullAgent = new gcp.diagflow.CxAgent("full_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,
 *     },
 *     advancedSettings: {
 *         audioExportGcsDestination: {
 *             uri: pulumi.interpolate`${bucket.url}/prefix-`,
 *         },
 *         speechSettings: {
 *             endpointerSensitivity: 30,
 *             noSpeechTimeout: "3.500s",
 *             useTimeoutBasedEndpointing: true,
 *             models: {
 *                 name: "wrench",
 *                 mass: "1.3kg",
 *                 count: "3",
 *             },
 *         },
 *         dtmfSettings: {
 *             enabled: true,
 *             maxDigits: 1,
 *             finishDigit: "#",
 *         },
 *         loggingSettings: {
 *             enableStackdriverLogging: true,
 *             enableInteractionLogging: true,
 *             enableConsentBasedRedaction: true,
 *         },
 *     },
 *     gitIntegrationSettings: {
 *         githubSettings: {
 *             displayName: "Github Repo",
 *             repositoryUri: "https://api.github.com/repos/githubtraining/hellogitworld",
 *             trackingBranch: "main",
 *             accessToken: "secret-token",
 *             branches: ["main"],
 *         },
 *     },
 *     textToSpeechSettings: {
 *         synthesizeSpeechConfigs: JSON.stringify({
 *             en: {
 *                 voice: {
 *                     name: "en-US-Neural2-A",
 *                 },
 *             },
 *             fr: {
 *                 voice: {
 *                     name: "fr-CA-Neural2-A",
 *                 },
 *             },
 *         }),
 *     },
 *     genAppBuilderSettings: {
 *         engine: "projects/-/locations/-/collections/-/engines/-",
 *     },
 *     startPlaybook: "projects/-/locations/-/agents/-/playbooks/00000000-0000-0000-0000-000000000000",
 *     enableMultiLanguageTraining: false,
 *     locked: false,
 *     answerFeedbackSettings: {
 *         enableAnswerFeedback: false,
 *     },
 *     clientCertificateSettings: {
 *         passphrase: "projects/example-proj/secrets/example-secret/versions/example-version",
 *         privateKey: "projects/example-proj/secrets/example-secret/versions/example-version",
 *         sslCertificate: `-----BEGIN CERTIFICATE-----
 * MIIDdDCCAlygAwIBAgIJANg0gKeB5LKmMA0GCSqGSIb3DQEBCwUAMIGSMQswCQYD
 * VQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNU2FuIEZyYW5j
 * aXNjbzEZMBcGA1UECgwQR2l0SHViLCBJbmMuMRkwFwYDVQQLDBBHb3Zlcm5tZW50
 * IFRlYW0xGTAXBgNVBAMMEGdvdnN0YWNrLmdpdGh1Yi5pbzAeFw0yMDA1MDUxNzM2
 * MzVaFw0zMDA1MDMxNzM2MzVaMIGSMQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2Fs
 * aWZvcm5pYTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEZMBcGA1UECgwQR2l0SHVi
 * LCBJbmMuMRkwFwYDVQQLDBBHb3Zlcm5tZW50IFRlYW0xGTAXBgNVBAMMEGdvdnN0
 * YWNrLmdpdGh1Yi5pbzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK5P
 * 4d9qWZPjZ2eA4eYV2Q8Z3Zp4g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6
 * g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6
 * g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6
 * g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6
 * g8e6g8e6g8e6g8e6g8e6AgMBAAGjggEaMIIBFjAdBgNVHQ4EFgQUCneA9H8fC+tC
 * g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6
 * g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6
 * g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6
 * g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6g8e6
 * -----END CERTIFICATE-----
 * `,
 *     },
 *     personalizationSettings: {
 *         defaultEndUserMetadata: "{\"example-key\": \"example-value\"}",
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * Agent can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/agents/{{name}}`
 *
 * * `{{project}}/{{location}}/{{name}}`
 *
 * * `{{location}}/{{name}}`
 *
 * When using the `pulumi import` command, Agent can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:diagflow/cxAgent:CxAgent default projects/{{project}}/locations/{{location}}/agents/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:diagflow/cxAgent:CxAgent default {{project}}/{{location}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:diagflow/cxAgent:CxAgent default {{location}}/{{name}}
 * ```
 */
class CxAgent extends pulumi.CustomResource {
    /**
     * Get an existing CxAgent 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 CxAgent(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of CxAgent.  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'] === CxAgent.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["advancedSettings"] = state?.advancedSettings;
            resourceInputs["answerFeedbackSettings"] = state?.answerFeedbackSettings;
            resourceInputs["avatarUri"] = state?.avatarUri;
            resourceInputs["clientCertificateSettings"] = state?.clientCertificateSettings;
            resourceInputs["defaultLanguageCode"] = state?.defaultLanguageCode;
            resourceInputs["deleteChatEngineOnDestroy"] = state?.deleteChatEngineOnDestroy;
            resourceInputs["description"] = state?.description;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["enableMultiLanguageTraining"] = state?.enableMultiLanguageTraining;
            resourceInputs["enableSpellCorrection"] = state?.enableSpellCorrection;
            resourceInputs["enableStackdriverLogging"] = state?.enableStackdriverLogging;
            resourceInputs["genAppBuilderSettings"] = state?.genAppBuilderSettings;
            resourceInputs["gitIntegrationSettings"] = state?.gitIntegrationSettings;
            resourceInputs["location"] = state?.location;
            resourceInputs["locked"] = state?.locked;
            resourceInputs["name"] = state?.name;
            resourceInputs["personalizationSettings"] = state?.personalizationSettings;
            resourceInputs["project"] = state?.project;
            resourceInputs["satisfiesPzi"] = state?.satisfiesPzi;
            resourceInputs["satisfiesPzs"] = state?.satisfiesPzs;
            resourceInputs["securitySettings"] = state?.securitySettings;
            resourceInputs["speechToTextSettings"] = state?.speechToTextSettings;
            resourceInputs["startFlow"] = state?.startFlow;
            resourceInputs["startPlaybook"] = state?.startPlaybook;
            resourceInputs["supportedLanguageCodes"] = state?.supportedLanguageCodes;
            resourceInputs["textToSpeechSettings"] = state?.textToSpeechSettings;
            resourceInputs["timeZone"] = state?.timeZone;
        }
        else {
            const args = argsOrState;
            if (args?.defaultLanguageCode === undefined && !opts.urn) {
                throw new Error("Missing required property 'defaultLanguageCode'");
            }
            if (args?.displayName === undefined && !opts.urn) {
                throw new Error("Missing required property 'displayName'");
            }
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            if (args?.timeZone === undefined && !opts.urn) {
                throw new Error("Missing required property 'timeZone'");
            }
            resourceInputs["advancedSettings"] = args?.advancedSettings;
            resourceInputs["answerFeedbackSettings"] = args?.answerFeedbackSettings;
            resourceInputs["avatarUri"] = args?.avatarUri;
            resourceInputs["clientCertificateSettings"] = args?.clientCertificateSettings;
            resourceInputs["defaultLanguageCode"] = args?.defaultLanguageCode;
            resourceInputs["deleteChatEngineOnDestroy"] = args?.deleteChatEngineOnDestroy;
            resourceInputs["description"] = args?.description;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["enableMultiLanguageTraining"] = args?.enableMultiLanguageTraining;
            resourceInputs["enableSpellCorrection"] = args?.enableSpellCorrection;
            resourceInputs["enableStackdriverLogging"] = args?.enableStackdriverLogging;
            resourceInputs["genAppBuilderSettings"] = args?.genAppBuilderSettings;
            resourceInputs["gitIntegrationSettings"] = args?.gitIntegrationSettings;
            resourceInputs["location"] = args?.location;
            resourceInputs["locked"] = args?.locked;
            resourceInputs["personalizationSettings"] = args?.personalizationSettings;
            resourceInputs["project"] = args?.project;
            resourceInputs["securitySettings"] = args?.securitySettings;
            resourceInputs["speechToTextSettings"] = args?.speechToTextSettings;
            resourceInputs["startPlaybook"] = args?.startPlaybook;
            resourceInputs["supportedLanguageCodes"] = args?.supportedLanguageCodes;
            resourceInputs["textToSpeechSettings"] = args?.textToSpeechSettings;
            resourceInputs["timeZone"] = args?.timeZone;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["satisfiesPzi"] = undefined /*out*/;
            resourceInputs["satisfiesPzs"] = undefined /*out*/;
            resourceInputs["startFlow"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(CxAgent.__pulumiType, name, resourceInputs, opts);
    }
}
exports.CxAgent = CxAgent;
/** @internal */
CxAgent.__pulumiType = 'gcp:diagflow/cxAgent:CxAgent';
//# sourceMappingURL=cxAgent.js.map