"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.EventhubDataConnection = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a Kusto (also known as Azure Data Explorer) EventHub Data Connection
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "my-kusto-rg",
 *     location: "West Europe",
 * });
 * const cluster = new azure.kusto.Cluster("cluster", {
 *     name: "kustocluster",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     sku: {
 *         name: "Standard_D13_v2",
 *         capacity: 2,
 *     },
 * });
 * const database = new azure.kusto.Database("database", {
 *     name: "my-kusto-database",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     clusterName: cluster.name,
 *     hotCachePeriod: "P7D",
 *     softDeletePeriod: "P31D",
 * });
 * const eventhubNs = new azure.eventhub.EventHubNamespace("eventhub_ns", {
 *     name: "my-eventhub-ns",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     sku: "Standard",
 * });
 * const eventhub = new azure.eventhub.EventHub("eventhub", {
 *     name: "my-eventhub",
 *     namespaceId: eventhubNs.id,
 *     partitionCount: 1,
 *     messageRetention: 1,
 * });
 * const consumerGroup = new azure.eventhub.ConsumerGroup("consumer_group", {
 *     name: "my-eventhub-consumergroup",
 *     namespaceName: eventhubNs.name,
 *     eventhubName: eventhub.name,
 *     resourceGroupName: example.name,
 * });
 * const eventhubConnection = new azure.kusto.EventhubDataConnection("eventhub_connection", {
 *     name: "my-kusto-eventhub-data-connection",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     clusterName: cluster.name,
 *     databaseName: database.name,
 *     eventhubId: eventhub.id,
 *     consumerGroup: consumerGroup.name,
 *     tableName: "my-table",
 *     mappingRuleName: "my-table-mapping",
 *     dataFormat: "JSON",
 *     retrievalStartDate: "2023-06-26T12:00:00Z",
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.Kusto` - 2024-04-13
 *
 * ## Import
 *
 * Kusto EventHub Data Connections can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:kusto/eventhubDataConnection:EventhubDataConnection example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Kusto/clusters/cluster1/databases/database1/dataConnections/eventHubConnection1
 * ```
 */
class EventhubDataConnection extends pulumi.CustomResource {
    /**
     * Get an existing EventhubDataConnection 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 EventhubDataConnection(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:kusto/eventhubDataConnection:EventhubDataConnection';
    /**
     * Returns true if the given object is an instance of EventhubDataConnection.  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'] === EventhubDataConnection.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["clusterName"] = state?.clusterName;
            resourceInputs["compression"] = state?.compression;
            resourceInputs["consumerGroup"] = state?.consumerGroup;
            resourceInputs["dataFormat"] = state?.dataFormat;
            resourceInputs["databaseName"] = state?.databaseName;
            resourceInputs["databaseRoutingType"] = state?.databaseRoutingType;
            resourceInputs["eventSystemProperties"] = state?.eventSystemProperties;
            resourceInputs["eventhubId"] = state?.eventhubId;
            resourceInputs["identityId"] = state?.identityId;
            resourceInputs["location"] = state?.location;
            resourceInputs["mappingRuleName"] = state?.mappingRuleName;
            resourceInputs["name"] = state?.name;
            resourceInputs["resourceGroupName"] = state?.resourceGroupName;
            resourceInputs["retrievalStartDate"] = state?.retrievalStartDate;
            resourceInputs["tableName"] = state?.tableName;
        }
        else {
            const args = argsOrState;
            if (args?.clusterName === undefined && !opts.urn) {
                throw new Error("Missing required property 'clusterName'");
            }
            if (args?.consumerGroup === undefined && !opts.urn) {
                throw new Error("Missing required property 'consumerGroup'");
            }
            if (args?.databaseName === undefined && !opts.urn) {
                throw new Error("Missing required property 'databaseName'");
            }
            if (args?.eventhubId === undefined && !opts.urn) {
                throw new Error("Missing required property 'eventhubId'");
            }
            if (args?.resourceGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            resourceInputs["clusterName"] = args?.clusterName;
            resourceInputs["compression"] = args?.compression;
            resourceInputs["consumerGroup"] = args?.consumerGroup;
            resourceInputs["dataFormat"] = args?.dataFormat;
            resourceInputs["databaseName"] = args?.databaseName;
            resourceInputs["databaseRoutingType"] = args?.databaseRoutingType;
            resourceInputs["eventSystemProperties"] = args?.eventSystemProperties;
            resourceInputs["eventhubId"] = args?.eventhubId;
            resourceInputs["identityId"] = args?.identityId;
            resourceInputs["location"] = args?.location;
            resourceInputs["mappingRuleName"] = args?.mappingRuleName;
            resourceInputs["name"] = args?.name;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["retrievalStartDate"] = args?.retrievalStartDate;
            resourceInputs["tableName"] = args?.tableName;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(EventhubDataConnection.__pulumiType, name, resourceInputs, opts);
    }
}
exports.EventhubDataConnection = EventhubDataConnection;
//# sourceMappingURL=eventhubDataConnection.js.map