"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.DataConnector = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * DataConnector manages the connection to external data sources for all data stores grouped
 * under a Collection. It's a singleton resource of Collection. The initialization is only
 * supported through DataConnectorService.SetUpDataConnector method, which will create a new
 * Collection and initialize its DataConnector.
 *
 * To get more information about DataConnector, see:
 *
 * * [API documentation](https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1alpha#dataconnectorservice)
 * * How-to Guides
 *     * [Introduction](https://cloud.google.com/agentspace/docs/introduction-to-connectors-and-data-stores)
 *
 * ## Example Usage
 *
 * ### Discoveryengine Dataconnector Servicenow Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const servicenow_basic = new gcp.discoveryengine.DataConnector("servicenow-basic", {
 *     location: "global",
 *     collectionId: "collection-id",
 *     collectionDisplayName: "tf-test-dataconnector-servicenow",
 *     dataSource: "servicenow",
 *     params: {
 *         auth_type: "OAUTH_PASSWORD_GRANT",
 *         instance_uri: "https://gcpconnector1.service-now.com/",
 *         client_id: "SECRET_MANAGER_RESOURCE_NAME",
 *         client_secret: "SECRET_MANAGER_RESOURCE_NAME",
 *         static_ip_enabled: "false",
 *         user_account: "connectorsuserqa@google.com",
 *         password: "SECRET_MANAGER_RESOURCE_NAME",
 *     },
 *     refreshInterval: "86400s",
 *     incrementalRefreshInterval: "21600s",
 *     entities: [
 *         {
 *             entityName: "catalog",
 *             params: JSON.stringify({
 *                 inclusion_filters: {
 *                     knowledgeBaseSysId: ["123"],
 *                 },
 *             }),
 *         },
 *         {
 *             entityName: "incident",
 *             params: JSON.stringify({
 *                 inclusion_filters: {
 *                     knowledgeBaseSysId: ["123"],
 *                 },
 *             }),
 *         },
 *         {
 *             entityName: "knowledge_base",
 *             params: JSON.stringify({
 *                 inclusion_filters: {
 *                     knowledgeBaseSysId: ["123"],
 *                 },
 *             }),
 *         },
 *     ],
 *     staticIpEnabled: false,
 *     connectorModes: ["DATA_INGESTION"],
 *     syncMode: "PERIODIC",
 * });
 * ```
 *
 * ## Import
 *
 * DataConnector can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/dataConnector`
 *
 * * `{{project}}/{{location}}/{{collection_id}}`
 *
 * * `{{location}}/{{collection_id}}`
 *
 * When using the `pulumi import` command, DataConnector can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:discoveryengine/dataConnector:DataConnector default projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/dataConnector
 * ```
 *
 * ```sh
 * $ pulumi import gcp:discoveryengine/dataConnector:DataConnector default {{project}}/{{location}}/{{collection_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:discoveryengine/dataConnector:DataConnector default {{location}}/{{collection_id}}
 * ```
 */
class DataConnector extends pulumi.CustomResource {
    /**
     * Get an existing DataConnector 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 DataConnector(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of DataConnector.  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'] === DataConnector.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["actionState"] = state?.actionState;
            resourceInputs["autoRunDisabled"] = state?.autoRunDisabled;
            resourceInputs["blockingReasons"] = state?.blockingReasons;
            resourceInputs["collectionDisplayName"] = state?.collectionDisplayName;
            resourceInputs["collectionId"] = state?.collectionId;
            resourceInputs["connectorModes"] = state?.connectorModes;
            resourceInputs["connectorType"] = state?.connectorType;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["dataSource"] = state?.dataSource;
            resourceInputs["entities"] = state?.entities;
            resourceInputs["errors"] = state?.errors;
            resourceInputs["incrementalRefreshInterval"] = state?.incrementalRefreshInterval;
            resourceInputs["incrementalSyncDisabled"] = state?.incrementalSyncDisabled;
            resourceInputs["jsonParams"] = state?.jsonParams;
            resourceInputs["kmsKeyName"] = state?.kmsKeyName;
            resourceInputs["lastSyncTime"] = state?.lastSyncTime;
            resourceInputs["latestPauseTime"] = state?.latestPauseTime;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["params"] = state?.params;
            resourceInputs["privateConnectivityProjectId"] = state?.privateConnectivityProjectId;
            resourceInputs["project"] = state?.project;
            resourceInputs["realtimeState"] = state?.realtimeState;
            resourceInputs["refreshInterval"] = state?.refreshInterval;
            resourceInputs["state"] = state?.state;
            resourceInputs["staticIpAddresses"] = state?.staticIpAddresses;
            resourceInputs["staticIpEnabled"] = state?.staticIpEnabled;
            resourceInputs["syncMode"] = state?.syncMode;
            resourceInputs["updateTime"] = state?.updateTime;
        }
        else {
            const args = argsOrState;
            if (args?.collectionDisplayName === undefined && !opts.urn) {
                throw new Error("Missing required property 'collectionDisplayName'");
            }
            if (args?.collectionId === undefined && !opts.urn) {
                throw new Error("Missing required property 'collectionId'");
            }
            if (args?.dataSource === undefined && !opts.urn) {
                throw new Error("Missing required property 'dataSource'");
            }
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            if (args?.refreshInterval === undefined && !opts.urn) {
                throw new Error("Missing required property 'refreshInterval'");
            }
            resourceInputs["autoRunDisabled"] = args?.autoRunDisabled;
            resourceInputs["collectionDisplayName"] = args?.collectionDisplayName;
            resourceInputs["collectionId"] = args?.collectionId;
            resourceInputs["connectorModes"] = args?.connectorModes;
            resourceInputs["dataSource"] = args?.dataSource;
            resourceInputs["entities"] = args?.entities;
            resourceInputs["incrementalRefreshInterval"] = args?.incrementalRefreshInterval;
            resourceInputs["incrementalSyncDisabled"] = args?.incrementalSyncDisabled;
            resourceInputs["jsonParams"] = args?.jsonParams;
            resourceInputs["kmsKeyName"] = args?.kmsKeyName;
            resourceInputs["location"] = args?.location;
            resourceInputs["params"] = args?.params;
            resourceInputs["project"] = args?.project;
            resourceInputs["refreshInterval"] = args?.refreshInterval;
            resourceInputs["staticIpEnabled"] = args?.staticIpEnabled;
            resourceInputs["syncMode"] = args?.syncMode;
            resourceInputs["actionState"] = undefined /*out*/;
            resourceInputs["blockingReasons"] = undefined /*out*/;
            resourceInputs["connectorType"] = undefined /*out*/;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["errors"] = undefined /*out*/;
            resourceInputs["lastSyncTime"] = undefined /*out*/;
            resourceInputs["latestPauseTime"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["privateConnectivityProjectId"] = undefined /*out*/;
            resourceInputs["realtimeState"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["staticIpAddresses"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(DataConnector.__pulumiType, name, resourceInputs, opts);
    }
}
exports.DataConnector = DataConnector;
/** @internal */
DataConnector.__pulumiType = 'gcp:discoveryengine/dataConnector:DataConnector';
//# sourceMappingURL=dataConnector.js.map