// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azure.kusto;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.kusto.EventGridDataConnectionArgs;
import com.pulumi.azure.kusto.inputs.EventGridDataConnectionState;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Boolean;
import java.lang.String;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages a Kusto (also known as Azure Data Explorer) Event Grid Data Connection
 * 
 * ## Example Usage
 * ```java
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.kusto.Cluster;
 * import com.pulumi.azure.kusto.ClusterArgs;
 * import com.pulumi.azure.kusto.inputs.ClusterSkuArgs;
 * import com.pulumi.azure.kusto.Database;
 * import com.pulumi.azure.kusto.DatabaseArgs;
 * import com.pulumi.azure.storage.Account;
 * import com.pulumi.azure.storage.AccountArgs;
 * import com.pulumi.azure.eventhub.EventHubNamespace;
 * import com.pulumi.azure.eventhub.EventHubNamespaceArgs;
 * import com.pulumi.azure.eventhub.EventHub;
 * import com.pulumi.azure.eventhub.EventHubArgs;
 * import com.pulumi.azure.eventhub.ConsumerGroup;
 * import com.pulumi.azure.eventhub.ConsumerGroupArgs;
 * import com.pulumi.azure.eventgrid.EventSubscription;
 * import com.pulumi.azure.eventgrid.EventSubscriptionArgs;
 * import com.pulumi.azure.eventgrid.inputs.EventSubscriptionRetryPolicyArgs;
 * import com.pulumi.azure.kusto.EventGridDataConnection;
 * import com.pulumi.azure.kusto.EventGridDataConnectionArgs;
 * import com.pulumi.resources.CustomResourceOptions;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * 
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 * 
 *     public static void stack(Context ctx) {
 *         var exampleResourceGroup = new ResourceGroup(&#34;exampleResourceGroup&#34;, ResourceGroupArgs.builder()        
 *             .location(&#34;West Europe&#34;)
 *             .build());
 * 
 *         var exampleCluster = new Cluster(&#34;exampleCluster&#34;, ClusterArgs.builder()        
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .sku(ClusterSkuArgs.builder()
 *                 .name(&#34;Standard_D13_v2&#34;)
 *                 .capacity(2)
 *                 .build())
 *             .build());
 * 
 *         var exampleDatabase = new Database(&#34;exampleDatabase&#34;, DatabaseArgs.builder()        
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .location(exampleResourceGroup.location())
 *             .clusterName(exampleCluster.name())
 *             .hotCachePeriod(&#34;P7D&#34;)
 *             .softDeletePeriod(&#34;P31D&#34;)
 *             .build());
 * 
 *         var exampleAccount = new Account(&#34;exampleAccount&#34;, AccountArgs.builder()        
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .location(exampleResourceGroup.location())
 *             .accountTier(&#34;Standard&#34;)
 *             .accountReplicationType(&#34;GRS&#34;)
 *             .build());
 * 
 *         var exampleEventHubNamespace = new EventHubNamespace(&#34;exampleEventHubNamespace&#34;, EventHubNamespaceArgs.builder()        
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .sku(&#34;Standard&#34;)
 *             .build());
 * 
 *         var exampleEventHub = new EventHub(&#34;exampleEventHub&#34;, EventHubArgs.builder()        
 *             .namespaceName(exampleEventHubNamespace.name())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .partitionCount(1)
 *             .messageRetention(1)
 *             .build());
 * 
 *         var exampleConsumerGroup = new ConsumerGroup(&#34;exampleConsumerGroup&#34;, ConsumerGroupArgs.builder()        
 *             .namespaceName(exampleEventHubNamespace.name())
 *             .eventhubName(exampleEventHub.name())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .build());
 * 
 *         var exampleEventSubscription = new EventSubscription(&#34;exampleEventSubscription&#34;, EventSubscriptionArgs.builder()        
 *             .scope(exampleAccount.id())
 *             .eventhubEndpointId(exampleEventHub.id())
 *             .eventDeliverySchema(&#34;EventGridSchema&#34;)
 *             .includedEventTypes(            
 *                 &#34;Microsoft.Storage.BlobCreated&#34;,
 *                 &#34;Microsoft.Storage.BlobRenamed&#34;)
 *             .retryPolicy(EventSubscriptionRetryPolicyArgs.builder()
 *                 .eventTimeToLive(144)
 *                 .maxDeliveryAttempts(10)
 *                 .build())
 *             .build());
 * 
 *         var exampleEventGridDataConnection = new EventGridDataConnection(&#34;exampleEventGridDataConnection&#34;, EventGridDataConnectionArgs.builder()        
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .location(exampleResourceGroup.location())
 *             .clusterName(exampleCluster.name())
 *             .databaseName(exampleDatabase.name())
 *             .storageAccountId(exampleAccount.id())
 *             .eventhubId(exampleEventHub.id())
 *             .eventhubConsumerGroupName(exampleConsumerGroup.name())
 *             .tableName(&#34;my-table&#34;)
 *             .mappingRuleName(&#34;my-table-mapping&#34;)
 *             .dataFormat(&#34;JSON&#34;)
 *             .build(), CustomResourceOptions.builder()
 *                 .dependsOn(exampleEventSubscription)
 *                 .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * Kusto Event Grid Data Connections can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:kusto/eventGridDataConnection:EventGridDataConnection example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Kusto/clusters/cluster1/databases/database1/dataConnections/dataConnection1
 * ```
 * 
 */
@ResourceType(type="azure:kusto/eventGridDataConnection:EventGridDataConnection")
public class EventGridDataConnection extends com.pulumi.resources.CustomResource {
    /**
     * Specifies the blob storage event type that needs to be processed. Possible Values are `Microsoft.Storage.BlobCreated` and `Microsoft.Storage.BlobRenamed`. Defaults to `Microsoft.Storage.BlobCreated`.
     * 
     */
    @Export(name="blobStorageEventType", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> blobStorageEventType;

    /**
     * @return Specifies the blob storage event type that needs to be processed. Possible Values are `Microsoft.Storage.BlobCreated` and `Microsoft.Storage.BlobRenamed`. Defaults to `Microsoft.Storage.BlobCreated`.
     * 
     */
    public Output<Optional<String>> blobStorageEventType() {
        return Codegen.optional(this.blobStorageEventType);
    }
    /**
     * Specifies the name of the Kusto Cluster this data connection will be added to. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="clusterName", refs={String.class}, tree="[0]")
    private Output<String> clusterName;

    /**
     * @return Specifies the name of the Kusto Cluster this data connection will be added to. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> clusterName() {
        return this.clusterName;
    }
    /**
     * Specifies the data format of the EventHub messages. Allowed values: `APACHEAVRO`, `AVRO`, `CSV`, `JSON`, `MULTIJSON`, `ORC`, `PARQUET`, `PSV`, `RAW`, `SCSV`, `SINGLEJSON`, `SOHSV`, `TSV`, `TSVE`, `TXT` and `W3CLOGFILE`.
     * 
     */
    @Export(name="dataFormat", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> dataFormat;

    /**
     * @return Specifies the data format of the EventHub messages. Allowed values: `APACHEAVRO`, `AVRO`, `CSV`, `JSON`, `MULTIJSON`, `ORC`, `PARQUET`, `PSV`, `RAW`, `SCSV`, `SINGLEJSON`, `SOHSV`, `TSV`, `TSVE`, `TXT` and `W3CLOGFILE`.
     * 
     */
    public Output<Optional<String>> dataFormat() {
        return Codegen.optional(this.dataFormat);
    }
    /**
     * Specifies the name of the Kusto Database this data connection will be added to. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="databaseName", refs={String.class}, tree="[0]")
    private Output<String> databaseName;

    /**
     * @return Specifies the name of the Kusto Database this data connection will be added to. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> databaseName() {
        return this.databaseName;
    }
    /**
     * Indication for database routing information from the data connection, by default only database routing information is allowed. Allowed values: `Single`, `Multi`. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="databaseRoutingType", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> databaseRoutingType;

    /**
     * @return Indication for database routing information from the data connection, by default only database routing information is allowed. Allowed values: `Single`, `Multi`. Changing this forces a new resource to be created.
     * 
     */
    public Output<Optional<String>> databaseRoutingType() {
        return Codegen.optional(this.databaseRoutingType);
    }
    /**
     * The resource ID of the event grid that is subscribed to the storage account events.
     * 
     */
    @Export(name="eventgridResourceId", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> eventgridResourceId;

    /**
     * @return The resource ID of the event grid that is subscribed to the storage account events.
     * 
     */
    public Output<Optional<String>> eventgridResourceId() {
        return Codegen.optional(this.eventgridResourceId);
    }
    /**
     * Specifies the Event Hub consumer group this data connection will use for ingestion. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="eventhubConsumerGroupName", refs={String.class}, tree="[0]")
    private Output<String> eventhubConsumerGroupName;

    /**
     * @return Specifies the Event Hub consumer group this data connection will use for ingestion. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> eventhubConsumerGroupName() {
        return this.eventhubConsumerGroupName;
    }
    /**
     * Specifies the resource id of the Event Hub this data connection will use for ingestion. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="eventhubId", refs={String.class}, tree="[0]")
    private Output<String> eventhubId;

    /**
     * @return Specifies the resource id of the Event Hub this data connection will use for ingestion. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> eventhubId() {
        return this.eventhubId;
    }
    /**
     * The location where the Kusto Database should be created. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="location", refs={String.class}, tree="[0]")
    private Output<String> location;

    /**
     * @return The location where the Kusto Database should be created. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> location() {
        return this.location;
    }
    /**
     * Empty for non-managed identity based data connection. For system assigned identity, provide cluster resource Id. For user assigned identity (UAI) provide the UAI resource Id.
     * 
     */
    @Export(name="managedIdentityResourceId", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> managedIdentityResourceId;

    /**
     * @return Empty for non-managed identity based data connection. For system assigned identity, provide cluster resource Id. For user assigned identity (UAI) provide the UAI resource Id.
     * 
     */
    public Output<Optional<String>> managedIdentityResourceId() {
        return Codegen.optional(this.managedIdentityResourceId);
    }
    /**
     * Specifies the mapping rule used for the message ingestion. Mapping rule must exist before resource is created.
     * 
     */
    @Export(name="mappingRuleName", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> mappingRuleName;

    /**
     * @return Specifies the mapping rule used for the message ingestion. Mapping rule must exist before resource is created.
     * 
     */
    public Output<Optional<String>> mappingRuleName() {
        return Codegen.optional(this.mappingRuleName);
    }
    /**
     * The name of the Kusto Event Grid Data Connection to create. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="name", refs={String.class}, tree="[0]")
    private Output<String> name;

    /**
     * @return The name of the Kusto Event Grid Data Connection to create. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * Specifies the Resource Group where the Kusto Database should exist. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="resourceGroupName", refs={String.class}, tree="[0]")
    private Output<String> resourceGroupName;

    /**
     * @return Specifies the Resource Group where the Kusto Database should exist. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> resourceGroupName() {
        return this.resourceGroupName;
    }
    /**
     * is the first record of every file ignored? Defaults to `false`.
     * 
     */
    @Export(name="skipFirstRecord", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> skipFirstRecord;

    /**
     * @return is the first record of every file ignored? Defaults to `false`.
     * 
     */
    public Output<Optional<Boolean>> skipFirstRecord() {
        return Codegen.optional(this.skipFirstRecord);
    }
    /**
     * Specifies the resource id of the Storage Account this data connection will use for ingestion. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="storageAccountId", refs={String.class}, tree="[0]")
    private Output<String> storageAccountId;

    /**
     * @return Specifies the resource id of the Storage Account this data connection will use for ingestion. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> storageAccountId() {
        return this.storageAccountId;
    }
    /**
     * Specifies the target table name used for the message ingestion. Table must exist before resource is created.
     * 
     */
    @Export(name="tableName", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> tableName;

    /**
     * @return Specifies the target table name used for the message ingestion. Table must exist before resource is created.
     * 
     */
    public Output<Optional<String>> tableName() {
        return Codegen.optional(this.tableName);
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public EventGridDataConnection(String name) {
        this(name, EventGridDataConnectionArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public EventGridDataConnection(String name, EventGridDataConnectionArgs args) {
        this(name, args, null);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param options A bag of options that control this resource's behavior.
     */
    public EventGridDataConnection(String name, EventGridDataConnectionArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:kusto/eventGridDataConnection:EventGridDataConnection", name, args == null ? EventGridDataConnectionArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private EventGridDataConnection(String name, Output<String> id, @Nullable EventGridDataConnectionState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:kusto/eventGridDataConnection:EventGridDataConnection", name, state, makeResourceOptions(options, id));
    }

    private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<String> id) {
        var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
            .version(Utilities.getVersion())
            .build();
        return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
    }

    /**
     * Get an existing Host 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
     * @param options Optional settings to control the behavior of the CustomResource.
     */
    public static EventGridDataConnection get(String name, Output<String> id, @Nullable EventGridDataConnectionState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new EventGridDataConnection(name, id, state, options);
    }
}
