"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.Control = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Controls are rules that influence search results.
 *
 * To get more information about Control, see:
 *
 * * [API documentation](https://cloud.google.com/gemini/enterprise/docs/reference/rest/v1/projects.locations.collections.engines.controls)
 * * How-to Guides
 *     * [Configure serving controls](https://cloud.google.com/gemini/enterprise/docs/configure-serving-controls)
 *
 * ## Example Usage
 *
 * ### Discoveryengine Control Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const basic = new gcp.discoveryengine.DataStore("basic", {
 *     location: "global",
 *     dataStoreId: "data-store-id",
 *     displayName: "tf-test-datastore",
 *     industryVertical: "GENERIC",
 *     contentConfig: "NO_CONTENT",
 *     solutionTypes: ["SOLUTION_TYPE_SEARCH"],
 *     createAdvancedSiteSearch: false,
 * });
 * const basicSearchEngine = new gcp.discoveryengine.SearchEngine("basic", {
 *     engineId: "engine-id",
 *     collectionId: "default_collection",
 *     location: basic.location,
 *     displayName: "tf-test-engine",
 *     dataStoreIds: [basic.dataStoreId],
 *     industryVertical: "GENERIC",
 *     appType: "APP_TYPE_INTRANET",
 *     searchEngineConfig: {},
 * });
 * const basicControl = new gcp.discoveryengine.Control("basic", {
 *     location: basicSearchEngine.location,
 *     engineId: basicSearchEngine.engineId,
 *     controlId: "control-id",
 *     displayName: "tf-test-control",
 *     solutionType: "SOLUTION_TYPE_SEARCH",
 *     useCases: ["SEARCH_USE_CASE_SEARCH"],
 *     synonymsAction: {
 *         synonyms: [
 *             "test",
 *             "experiment",
 *         ],
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * Control can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/engines/{{engine_id}}/controls/{{control_id}}`
 *
 * * `{{project}}/{{location}}/{{collection_id}}/{{engine_id}}/{{control_id}}`
 *
 * * `{{location}}/{{collection_id}}/{{engine_id}}/{{control_id}}`
 *
 * When using the `pulumi import` command, Control can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:discoveryengine/control:Control default projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/engines/{{engine_id}}/controls/{{control_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:discoveryengine/control:Control default {{project}}/{{location}}/{{collection_id}}/{{engine_id}}/{{control_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:discoveryengine/control:Control default {{location}}/{{collection_id}}/{{engine_id}}/{{control_id}}
 * ```
 */
class Control extends pulumi.CustomResource {
    /**
     * Get an existing Control 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 Control(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of Control.  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'] === Control.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["boostAction"] = state?.boostAction;
            resourceInputs["collectionId"] = state?.collectionId;
            resourceInputs["conditions"] = state?.conditions;
            resourceInputs["controlId"] = state?.controlId;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["engineId"] = state?.engineId;
            resourceInputs["filterAction"] = state?.filterAction;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["promoteAction"] = state?.promoteAction;
            resourceInputs["redirectAction"] = state?.redirectAction;
            resourceInputs["solutionType"] = state?.solutionType;
            resourceInputs["synonymsAction"] = state?.synonymsAction;
            resourceInputs["useCases"] = state?.useCases;
        }
        else {
            const args = argsOrState;
            if (args?.controlId === undefined && !opts.urn) {
                throw new Error("Missing required property 'controlId'");
            }
            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?.solutionType === undefined && !opts.urn) {
                throw new Error("Missing required property 'solutionType'");
            }
            resourceInputs["boostAction"] = args?.boostAction;
            resourceInputs["collectionId"] = args?.collectionId;
            resourceInputs["conditions"] = args?.conditions;
            resourceInputs["controlId"] = args?.controlId;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["engineId"] = args?.engineId;
            resourceInputs["filterAction"] = args?.filterAction;
            resourceInputs["location"] = args?.location;
            resourceInputs["project"] = args?.project;
            resourceInputs["promoteAction"] = args?.promoteAction;
            resourceInputs["redirectAction"] = args?.redirectAction;
            resourceInputs["solutionType"] = args?.solutionType;
            resourceInputs["synonymsAction"] = args?.synonymsAction;
            resourceInputs["useCases"] = args?.useCases;
            resourceInputs["name"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Control.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Control = Control;
/** @internal */
Control.__pulumiType = 'gcp:discoveryengine/control:Control';
//# sourceMappingURL=control.js.map