"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.SearchEngine = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Vertex AI Search and Conversation can be used to create a search engine or a chat application by connecting it with a datastore
 *
 * To get more information about SearchEngine, see:
 *
 * * [API documentation](https://cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.collections.engines)
 * * How-to Guides
 *     * [Create a Search Engine](https://cloud.google.com/generative-ai-app-builder/docs/create-engine-es)
 *
 * ## Example Usage
 *
 * ### Discoveryengine Searchengine 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-datastore-id",
 *     displayName: "tf-test-structured-datastore",
 *     industryVertical: "GENERIC",
 *     contentConfig: "NO_CONTENT",
 *     solutionTypes: ["SOLUTION_TYPE_SEARCH"],
 *     createAdvancedSiteSearch: false,
 * });
 * const basicSearchEngine = new gcp.discoveryengine.SearchEngine("basic", {
 *     engineId: "example-engine-id",
 *     collectionId: "default_collection",
 *     location: basic.location,
 *     displayName: "Example Display Name",
 *     dataStoreIds: [basic.dataStoreId],
 *     searchEngineConfig: {},
 * });
 * ```
 * ### Discoveryengine Searchengine Agentspace Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const agentspaceBasic = new gcp.discoveryengine.DataStore("agentspace_basic", {
 *     location: "global",
 *     dataStoreId: "example-datastore-id",
 *     displayName: "tf-test-structured-datastore",
 *     industryVertical: "GENERIC",
 *     contentConfig: "NO_CONTENT",
 *     solutionTypes: ["SOLUTION_TYPE_SEARCH"],
 *     createAdvancedSiteSearch: false,
 * });
 * const agentspaceBasicSearchEngine = new gcp.discoveryengine.SearchEngine("agentspace_basic", {
 *     engineId: "example-engine-id",
 *     collectionId: "default_collection",
 *     location: agentspaceBasic.location,
 *     displayName: "tf-test-agentspace-search-engine",
 *     dataStoreIds: [agentspaceBasic.dataStoreId],
 *     industryVertical: "GENERIC",
 *     appType: "APP_TYPE_INTRANET",
 *     searchEngineConfig: {},
 * });
 * ```
 *
 * ## Import
 *
 * SearchEngine can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/engines/{{engine_id}}`
 *
 * * `{{project}}/{{location}}/{{collection_id}}/{{engine_id}}`
 *
 * * `{{location}}/{{collection_id}}/{{engine_id}}`
 *
 * When using the `pulumi import` command, SearchEngine can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:discoveryengine/searchEngine:SearchEngine default projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/engines/{{engine_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:discoveryengine/searchEngine:SearchEngine default {{project}}/{{location}}/{{collection_id}}/{{engine_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:discoveryengine/searchEngine:SearchEngine default {{location}}/{{collection_id}}/{{engine_id}}
 * ```
 */
class SearchEngine extends pulumi.CustomResource {
    /**
     * Get an existing SearchEngine 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 SearchEngine(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of SearchEngine.  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'] === SearchEngine.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["appType"] = state?.appType;
            resourceInputs["collectionId"] = state?.collectionId;
            resourceInputs["commonConfig"] = state?.commonConfig;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["dataStoreIds"] = state?.dataStoreIds;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["engineId"] = state?.engineId;
            resourceInputs["features"] = state?.features;
            resourceInputs["industryVertical"] = state?.industryVertical;
            resourceInputs["kmsKeyName"] = state?.kmsKeyName;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["searchEngineConfig"] = state?.searchEngineConfig;
            resourceInputs["updateTime"] = state?.updateTime;
        }
        else {
            const args = argsOrState;
            if (args?.collectionId === undefined && !opts.urn) {
                throw new Error("Missing required property 'collectionId'");
            }
            if (args?.dataStoreIds === undefined && !opts.urn) {
                throw new Error("Missing required property 'dataStoreIds'");
            }
            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'");
            }
            if (args?.searchEngineConfig === undefined && !opts.urn) {
                throw new Error("Missing required property 'searchEngineConfig'");
            }
            resourceInputs["appType"] = args?.appType;
            resourceInputs["collectionId"] = args?.collectionId;
            resourceInputs["commonConfig"] = args?.commonConfig;
            resourceInputs["dataStoreIds"] = args?.dataStoreIds;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["engineId"] = args?.engineId;
            resourceInputs["features"] = args?.features;
            resourceInputs["industryVertical"] = args?.industryVertical;
            resourceInputs["kmsKeyName"] = args?.kmsKeyName;
            resourceInputs["location"] = args?.location;
            resourceInputs["project"] = args?.project;
            resourceInputs["searchEngineConfig"] = args?.searchEngineConfig;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(SearchEngine.__pulumiType, name, resourceInputs, opts);
    }
}
exports.SearchEngine = SearchEngine;
/** @internal */
SearchEngine.__pulumiType = 'gcp:discoveryengine/searchEngine:SearchEngine';
//# sourceMappingURL=searchEngine.js.map