UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

481 lines • 18.9 kB
"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! *** 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.App = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * Customer Engagement Suite App * * To get more information about App, see: * * * [API documentation](https://docs.cloud.google.com/customer-engagement-ai/conversational-agents/ps/reference/rest/v1/projects.locations.apps) * * ## Example Usage * * ### Ces App Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as std from "@pulumi/std"; * * const project = gcp.organizations.getProject({}); * const fakePrivateKeySecret = new gcp.secretmanager.Secret("fake_private_key_secret", { * secretId: "fake-pk-secret-app-tf1", * replication: { * auto: {}, * }, * }); * const fakeSecretVersion = new gcp.secretmanager.SecretVersion("fake_secret_version", { * secret: fakePrivateKeySecret.id, * secretData: std.file({ * input: "test-fixtures/test.key", * }).then(invoke => invoke.result), * }); * const privateKeyAccessor = new gcp.secretmanager.SecretIamMember("private_key_accessor", { * project: fakePrivateKeySecret.project, * secretId: fakePrivateKeySecret.secretId, * role: "roles/secretmanager.secretAccessor", * member: project.then(project => `serviceAccount:service-${project.number}@gcp-sa-ces.iam.gserviceaccount.com`), * }); * const cesAppBasic = new gcp.ces.App("ces_app_basic", { * appId: "app-id", * location: "us", * description: "Basic CES App example", * displayName: "my-app", * pinned: true, * languageSettings: { * defaultLanguageCode: "en-US", * supportedLanguageCodes: [ * "es-ES", * "fr-FR", * ], * enableMultilingualSupport: true, * fallbackAction: "escalate", * }, * audioProcessingConfig: { * synthesizeSpeechConfigs: [ * { * languageCode: "en-US", * voice: "en-US-Standard-A", * speakingRate: 1, * }, * { * languageCode: "es-ES", * voice: "es-ES-Standard-A", * speakingRate: 0.95, * }, * ], * bargeInConfig: { * bargeInAwareness: true, * }, * inactivityTimeout: "300s", * ambientSoundConfig: { * prebuiltAmbientSound: "room_2", * volumeGainDb: -6, * }, * }, * loggingSettings: { * redactionConfig: { * enableRedaction: true, * inspectTemplate: "projects/fake-project/locations/us/inspectTemplates/example-inspect", * deidentifyTemplate: "projects/fake-project/locations/us/deidentifyTemplates/example-deidentify", * }, * audioRecordingConfig: { * gcsBucket: "gs://fake-app-audio-recordings", * gcsPathPrefix: "projects/fake-project/location/us/app/test-app/123/$session/123", * }, * bigqueryExportSettings: { * dataset: "projects/fake-project/datasets/fake_app_logs", * enabled: false, * project: "projects/fake-project", * }, * cloudLoggingSettings: { * enableCloudLogging: true, * }, * conversationLoggingSettings: { * disableConversationLogging: true, * }, * }, * modelSettings: { * model: "gemini-3.0-flash-001", * temperature: 0.5, * }, * evaluationMetricsThresholds: { * goldenEvaluationMetricsThresholds: { * turnLevelMetricsThresholds: { * semanticSimilaritySuccessThreshold: 3, * overallToolInvocationCorrectnessThreshold: 1, * }, * expectationLevelMetricsThresholds: { * toolInvocationParameterCorrectnessThreshold: 1, * }, * }, * }, * variableDeclarations: [{ * name: "test", * description: "test", * schema: { * description: "schema description", * type: "ARRAY", * title: "title", * nullable: true, * requireds: ["some_property"], * enums: [ * "VALUE_A", * "VALUE_B", * ], * ref: "#/defs/MyDefinition", * uniqueItems: true, * defs: JSON.stringify({ * SimpleString: { * type: "STRING", * description: "A simple string definition", * }, * }), * anyOf: JSON.stringify([{ * type: "STRING", * description: "any_of option 1: string", * }]), * "default": JSON.stringify(false), * prefixItems: JSON.stringify([{ * type: "ARRAY", * description: "prefix item 1", * }]), * additionalProperties: JSON.stringify({ * type: "BOOLEAN", * }), * properties: JSON.stringify({ * name: { * type: "STRING", * description: "A name", * }, * }), * items: JSON.stringify({ * type: "ARRAY", * description: "An array", * }), * }, * }], * globalInstruction: "You are a virtual assistant for an e-commerce platform. Be friendly and helpful.", * guardrails: [], * defaultChannelProfile: { * channelType: "WEB_UI", * disableBargeInControl: false, * disableDtmf: true, * personaProperty: { * persona: "CONCISE", * }, * profileId: "profile-id", * webWidgetConfig: { * modality: "CHAT_ONLY", * theme: "LIGHT", * webWidgetTitle: "Help Assistant", * }, * }, * metadata: { * deployment_env: "test", * }, * timeZoneSettings: { * timeZone: "America/Los_Angeles", * }, * clientCertificateSettings: { * tlsCertificate: std.file({ * input: "test-fixtures/cert.pem", * }).then(invoke => invoke.result), * privateKey: fakeSecretVersion.name, * }, * }); * ``` * ### Ces App Ambient Sound Gcs Uri * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const cesAppAmbientSoundGcsUri = new gcp.ces.App("ces_app_ambient_sound_gcs_uri", { * appId: "app-id", * location: "us", * description: "Basic CES App example", * displayName: "my-app-ambient-sound-gcs-uri", * languageSettings: { * defaultLanguageCode: "en-US", * supportedLanguageCodes: [ * "es-ES", * "fr-FR", * ], * enableMultilingualSupport: true, * fallbackAction: "escalate", * }, * audioProcessingConfig: { * synthesizeSpeechConfigs: [ * { * languageCode: "en-US", * voice: "en-US-Standard-A", * speakingRate: 1, * }, * { * languageCode: "es-ES", * voice: "es-ES-Standard-A", * speakingRate: 0.95, * }, * ], * bargeInConfig: { * bargeInAwareness: true, * }, * inactivityTimeout: "300s", * ambientSoundConfig: { * gcsUri: "gs://fake-bucket/sounds/ambient.wav", * volumeGainDb: -6, * }, * }, * loggingSettings: { * redactionConfig: { * enableRedaction: true, * inspectTemplate: "projects/fake-project/locations/us/inspectTemplates/example-inspect", * deidentifyTemplate: "projects/fake-project/locations/us/deidentifyTemplates/example-deidentify", * }, * audioRecordingConfig: { * gcsBucket: "gs://fake-app-audio-recordings", * gcsPathPrefix: "projects/fake-project/location/us/app/fake-app/123/$session/123", * }, * bigqueryExportSettings: { * dataset: "projects/fake-project/datasets/fake_app_logs", * enabled: false, * project: "projects/fake-project", * }, * cloudLoggingSettings: { * enableCloudLogging: true, * }, * conversationLoggingSettings: { * disableConversationLogging: true, * }, * }, * modelSettings: { * model: "gemini-3.0-flash-001", * temperature: 0.5, * }, * evaluationMetricsThresholds: { * goldenEvaluationMetricsThresholds: { * turnLevelMetricsThresholds: { * semanticSimilaritySuccessThreshold: 3, * overallToolInvocationCorrectnessThreshold: 1, * }, * expectationLevelMetricsThresholds: { * toolInvocationParameterCorrectnessThreshold: 1, * }, * }, * }, * variableDeclarations: [{ * name: "test", * description: "test", * schema: { * description: "schema description", * type: "ARRAY", * nullable: true, * requireds: ["some_property"], * enums: [ * "VALUE_A", * "VALUE_B", * ], * ref: "#/defs/MyDefinition", * uniqueItems: true, * defs: JSON.stringify({ * SimpleString: { * type: "STRING", * description: "A simple string definition", * }, * }), * anyOf: JSON.stringify([{ * type: "STRING", * description: "any_of option 1: string", * }]), * "default": JSON.stringify(false), * prefixItems: JSON.stringify([{ * type: "ARRAY", * description: "prefix item 1", * }]), * additionalProperties: JSON.stringify({ * type: "BOOLEAN", * }), * properties: JSON.stringify({ * name: { * type: "STRING", * description: "A name", * }, * }), * items: JSON.stringify({ * type: "ARRAY", * description: "An array", * }), * }, * }], * globalInstruction: "You are a virtual assistant for an e-commerce platform. Be friendly and helpful.", * guardrails: [], * defaultChannelProfile: { * channelType: "WEB_UI", * disableBargeInControl: false, * disableDtmf: true, * personaProperty: { * persona: "CONCISE", * }, * profileId: "profile-id", * webWidgetConfig: { * modality: "CHAT_ONLY", * theme: "LIGHT", * webWidgetTitle: "Help Assistant", * }, * }, * metadata: { * deployment_env: "test", * }, * timeZoneSettings: { * timeZone: "America/Los_Angeles", * }, * }); * ``` * * ## Import * * App can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/apps/{{name}}` * * `{{project}}/{{location}}/{{name}}` * * `{{location}}/{{name}}` * * When using the `pulumi import` command, App can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:ces/app:App default projects/{{project}}/locations/{{location}}/apps/{{name}} * $ pulumi import gcp:ces/app:App default {{project}}/{{location}}/{{name}} * $ pulumi import gcp:ces/app:App default {{location}}/{{name}} * ``` */ class App extends pulumi.CustomResource { /** * Get an existing App 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 App(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:ces/app:App'; /** * Returns true if the given object is an instance of App. 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'] === App.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["appId"] = state?.appId; resourceInputs["audioProcessingConfig"] = state?.audioProcessingConfig; resourceInputs["clientCertificateSettings"] = state?.clientCertificateSettings; resourceInputs["createTime"] = state?.createTime; resourceInputs["dataStoreSettings"] = state?.dataStoreSettings; resourceInputs["defaultChannelProfile"] = state?.defaultChannelProfile; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["deploymentCount"] = state?.deploymentCount; resourceInputs["description"] = state?.description; resourceInputs["displayName"] = state?.displayName; resourceInputs["etag"] = state?.etag; resourceInputs["evaluationMetricsThresholds"] = state?.evaluationMetricsThresholds; resourceInputs["globalInstruction"] = state?.globalInstruction; resourceInputs["guardrails"] = state?.guardrails; resourceInputs["languageSettings"] = state?.languageSettings; resourceInputs["location"] = state?.location; resourceInputs["loggingSettings"] = state?.loggingSettings; resourceInputs["metadata"] = state?.metadata; resourceInputs["modelSettings"] = state?.modelSettings; resourceInputs["name"] = state?.name; resourceInputs["pinned"] = state?.pinned; resourceInputs["project"] = state?.project; resourceInputs["rootAgent"] = state?.rootAgent; resourceInputs["timeZoneSettings"] = state?.timeZoneSettings; resourceInputs["toolExecutionMode"] = state?.toolExecutionMode; resourceInputs["updateTime"] = state?.updateTime; resourceInputs["variableDeclarations"] = state?.variableDeclarations; } else { const args = argsOrState; if (args?.appId === undefined && !opts.urn) { throw new Error("Missing required property 'appId'"); } 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["appId"] = args?.appId; resourceInputs["audioProcessingConfig"] = args?.audioProcessingConfig; resourceInputs["clientCertificateSettings"] = args?.clientCertificateSettings; resourceInputs["dataStoreSettings"] = args?.dataStoreSettings; resourceInputs["defaultChannelProfile"] = args?.defaultChannelProfile; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["description"] = args?.description; resourceInputs["displayName"] = args?.displayName; resourceInputs["evaluationMetricsThresholds"] = args?.evaluationMetricsThresholds; resourceInputs["globalInstruction"] = args?.globalInstruction; resourceInputs["guardrails"] = args?.guardrails; resourceInputs["languageSettings"] = args?.languageSettings; resourceInputs["location"] = args?.location; resourceInputs["loggingSettings"] = args?.loggingSettings; resourceInputs["metadata"] = args?.metadata; resourceInputs["modelSettings"] = args?.modelSettings; resourceInputs["pinned"] = args?.pinned; resourceInputs["project"] = args?.project; resourceInputs["rootAgent"] = args?.rootAgent; resourceInputs["timeZoneSettings"] = args?.timeZoneSettings; resourceInputs["toolExecutionMode"] = args?.toolExecutionMode; resourceInputs["variableDeclarations"] = args?.variableDeclarations; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["deploymentCount"] = undefined /*out*/; resourceInputs["etag"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(App.__pulumiType, name, resourceInputs, opts); } } exports.App = App; //# sourceMappingURL=app.js.map