@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
181 lines • 8.01 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.Assistant = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* Assistant
*
* To get more information about Assistant, see:
*
* * [API documentation](https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1#assistantservice)
*
* ## Example Usage
*
* ### Discoveryengine Assistant Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const basic = new gcp.discoveryengine.DataStore("basic", {
* location: "global",
* dataStoreId: "example-data-store-id",
* displayName: "tf-test-structured-datastore",
* industryVertical: "GENERIC",
* contentConfig: "NO_CONTENT",
* solutionTypes: ["SOLUTION_TYPE_SEARCH"],
* createAdvancedSiteSearch: false,
* });
* const basicSearchEngine = new gcp.discoveryengine.SearchEngine("basic", {
* location: "global",
* collectionId: "default_collection",
* engineId: "example-engine-id",
* displayName: "Example Display Name",
* dataStoreIds: [basic.dataStoreId],
* searchEngineConfig: {},
* });
* const basicAssistant = new gcp.discoveryengine.Assistant("basic", {
* location: "global",
* collectionId: "default_collection",
* engineId: basicSearchEngine.engineId,
* assistantId: "default_assistant",
* displayName: "updated-tf-test-Assistant",
* description: "Assistant Description",
* generationConfig: {
* systemInstruction: {
* additionalSystemInstruction: "foobar",
* },
* defaultLanguage: "en",
* },
* customerPolicy: {
* bannedPhrases: [{
* phrase: "foo",
* matchType: "SIMPLE_STRING_MATCH",
* ignoreDiacritics: false,
* }],
* },
* webGroundingType: "WEB_GROUNDING_TYPE_GOOGLE_SEARCH",
* });
* ```
*
* ## Import
*
* Assistant can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/engines/{{engine_id}}/assistants/{{assistant_id}}`
* * `{{project}}/{{location}}/{{collection_id}}/{{engine_id}}/{{assistant_id}}`
* * `{{location}}/{{collection_id}}/{{engine_id}}/{{assistant_id}}`
*
* When using the `pulumi import` command, Assistant can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:discoveryengine/assistant:Assistant default projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/engines/{{engine_id}}/assistants/{{assistant_id}}
* $ pulumi import gcp:discoveryengine/assistant:Assistant default {{project}}/{{location}}/{{collection_id}}/{{engine_id}}/{{assistant_id}}
* $ pulumi import gcp:discoveryengine/assistant:Assistant default {{location}}/{{collection_id}}/{{engine_id}}/{{assistant_id}}
* ```
*/
class Assistant extends pulumi.CustomResource {
/**
* Get an existing Assistant 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 Assistant(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'gcp:discoveryengine/assistant:Assistant';
/**
* Returns true if the given object is an instance of Assistant. 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'] === Assistant.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["assistantId"] = state?.assistantId;
resourceInputs["collectionId"] = state?.collectionId;
resourceInputs["customerPolicy"] = state?.customerPolicy;
resourceInputs["deletionPolicy"] = state?.deletionPolicy;
resourceInputs["description"] = state?.description;
resourceInputs["displayName"] = state?.displayName;
resourceInputs["engineId"] = state?.engineId;
resourceInputs["generationConfig"] = state?.generationConfig;
resourceInputs["location"] = state?.location;
resourceInputs["name"] = state?.name;
resourceInputs["project"] = state?.project;
resourceInputs["webGroundingType"] = state?.webGroundingType;
}
else {
const args = argsOrState;
if (args?.assistantId === undefined && !opts.urn) {
throw new Error("Missing required property 'assistantId'");
}
if (args?.collectionId === undefined && !opts.urn) {
throw new Error("Missing required property 'collectionId'");
}
if (args?.displayName === undefined && !opts.urn) {
throw new Error("Missing required property 'displayName'");
}
if (args?.engineId === undefined && !opts.urn) {
throw new Error("Missing required property 'engineId'");
}
if (args?.location === undefined && !opts.urn) {
throw new Error("Missing required property 'location'");
}
resourceInputs["assistantId"] = args?.assistantId;
resourceInputs["collectionId"] = args?.collectionId;
resourceInputs["customerPolicy"] = args?.customerPolicy;
resourceInputs["deletionPolicy"] = args?.deletionPolicy;
resourceInputs["description"] = args?.description;
resourceInputs["displayName"] = args?.displayName;
resourceInputs["engineId"] = args?.engineId;
resourceInputs["generationConfig"] = args?.generationConfig;
resourceInputs["location"] = args?.location;
resourceInputs["project"] = args?.project;
resourceInputs["webGroundingType"] = args?.webGroundingType;
resourceInputs["name"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Assistant.__pulumiType, name, resourceInputs, opts);
}
}
exports.Assistant = Assistant;
//# sourceMappingURL=assistant.js.map