@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
201 lines • 9.15 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConversationProfile = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* A conversation profile configures a set of parameters that control the suggestions made to an agent. These parameters control the suggestions that are surfaced during runtime. Each profile configures either a Dialogflow virtual agent or a human agent for a conversation.
*
* To get more information about ConversationProfile, see:
*
* * [API documentation](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversationProfiles)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/dialogflow/docs/)
*
* ## Example Usage
*
* ### Dialogflow Conversation Profile Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const basicAgent = new gcp.diagflow.Agent("basic_agent", {
* displayName: "example_agent",
* defaultLanguageCode: "en",
* timeZone: "America/New_York",
* });
* const basicProfile = new gcp.diagflow.ConversationProfile("basic_profile", {
* displayName: "dialogflow-profile",
* location: "global",
* automatedAgentConfig: {
* agent: pulumi.interpolate`projects/${basicAgent.id}/locations/global/agent/environments/draft`,
* },
* humanAgentAssistantConfig: {
* messageAnalysisConfig: {
* enableEntityExtraction: true,
* enableSentimentAnalysis: true,
* },
* },
* });
* ```
* ### Dialogflow Conversation Profile Recognition Result Notification
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const recognitionResultNotificationProfileTopic = new gcp.pubsub.Topic("recognition_result_notification_profile", {name: "recognition-result-notification"});
* const recognitionResultNotificationProfile = new gcp.diagflow.ConversationProfile("recognition_result_notification_profile", {
* displayName: "dialogflow-profile",
* location: "global",
* newRecognitionResultNotificationConfig: {
* topic: recognitionResultNotificationProfileTopic.id,
* messageFormat: "JSON",
* },
* });
* ```
* ### Dialogflow Conversation Profile Beta Bidi
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const cesAppForAgent = new gcp.ces.App("ces_app_for_agent", {
* appId: "app-id",
* location: "us",
* displayName: "my-app",
* timeZoneSettings: {
* timeZone: "America/Los_Angeles",
* },
* });
* const bidiProfile = new gcp.diagflow.ConversationProfile("bidi_profile", {
* displayName: "dialogflow-profile-bidi",
* location: "global",
* languageCode: "en-US",
* useBidiStreaming: true,
* automatedAgentConfig: {
* agent: cesAppForAgent.id,
* },
* });
* ```
*
* ## Import
*
* ConversationProfile can be imported using any of these accepted formats:
*
* * `{{name}}`
*
* When using the `pulumi import` command, ConversationProfile can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:diagflow/conversationProfile:ConversationProfile default {{name}}
* ```
*/
class ConversationProfile extends pulumi.CustomResource {
/**
* Get an existing ConversationProfile 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 ConversationProfile(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'gcp:diagflow/conversationProfile:ConversationProfile';
/**
* Returns true if the given object is an instance of ConversationProfile. 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'] === ConversationProfile.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["automatedAgentConfig"] = state?.automatedAgentConfig;
resourceInputs["deletionPolicy"] = state?.deletionPolicy;
resourceInputs["displayName"] = state?.displayName;
resourceInputs["humanAgentAssistantConfig"] = state?.humanAgentAssistantConfig;
resourceInputs["humanAgentHandoffConfig"] = state?.humanAgentHandoffConfig;
resourceInputs["languageCode"] = state?.languageCode;
resourceInputs["location"] = state?.location;
resourceInputs["loggingConfig"] = state?.loggingConfig;
resourceInputs["name"] = state?.name;
resourceInputs["newMessageEventNotificationConfig"] = state?.newMessageEventNotificationConfig;
resourceInputs["newRecognitionResultNotificationConfig"] = state?.newRecognitionResultNotificationConfig;
resourceInputs["notificationConfig"] = state?.notificationConfig;
resourceInputs["project"] = state?.project;
resourceInputs["securitySettings"] = state?.securitySettings;
resourceInputs["sttConfig"] = state?.sttConfig;
resourceInputs["timeZone"] = state?.timeZone;
resourceInputs["ttsConfig"] = state?.ttsConfig;
resourceInputs["useBidiStreaming"] = state?.useBidiStreaming;
}
else {
const args = argsOrState;
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'");
}
resourceInputs["automatedAgentConfig"] = args?.automatedAgentConfig;
resourceInputs["deletionPolicy"] = args?.deletionPolicy;
resourceInputs["displayName"] = args?.displayName;
resourceInputs["humanAgentAssistantConfig"] = args?.humanAgentAssistantConfig;
resourceInputs["humanAgentHandoffConfig"] = args?.humanAgentHandoffConfig;
resourceInputs["languageCode"] = args?.languageCode;
resourceInputs["location"] = args?.location;
resourceInputs["loggingConfig"] = args?.loggingConfig;
resourceInputs["newMessageEventNotificationConfig"] = args?.newMessageEventNotificationConfig;
resourceInputs["newRecognitionResultNotificationConfig"] = args?.newRecognitionResultNotificationConfig;
resourceInputs["notificationConfig"] = args?.notificationConfig;
resourceInputs["project"] = args?.project;
resourceInputs["securitySettings"] = args?.securitySettings;
resourceInputs["sttConfig"] = args?.sttConfig;
resourceInputs["timeZone"] = args?.timeZone;
resourceInputs["ttsConfig"] = args?.ttsConfig;
resourceInputs["useBidiStreaming"] = args?.useBidiStreaming;
resourceInputs["name"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ConversationProfile.__pulumiType, name, resourceInputs, opts);
}
}
exports.ConversationProfile = ConversationProfile;
//# sourceMappingURL=conversationProfile.js.map