// *** 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.streamanalytics;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.streamanalytics.OutputMssqlArgs;
import com.pulumi.azure.streamanalytics.inputs.OutputMssqlState;
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.Double;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages a Stream Analytics Output to Microsoft SQL Server Database.
 * 
 * ## 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.streamanalytics.StreamanalyticsFunctions;
 * import com.pulumi.azure.streamanalytics.inputs.GetJobArgs;
 * import com.pulumi.azure.sql.SqlServer;
 * import com.pulumi.azure.sql.SqlServerArgs;
 * import com.pulumi.azure.sql.Database;
 * import com.pulumi.azure.sql.DatabaseArgs;
 * import com.pulumi.azure.streamanalytics.OutputMssql;
 * import com.pulumi.azure.streamanalytics.OutputMssqlArgs;
 * 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());
 * 
 *         final var exampleJob = StreamanalyticsFunctions.getJob(GetJobArgs.builder()
 *             .name(&#34;example-job&#34;)
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .build());
 * 
 *         var exampleSqlServer = new SqlServer(&#34;exampleSqlServer&#34;, SqlServerArgs.builder()        
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .location(exampleResourceGroup.location())
 *             .version(&#34;12.0&#34;)
 *             .administratorLogin(&#34;dbadmin&#34;)
 *             .administratorLoginPassword(&#34;example-password&#34;)
 *             .build());
 * 
 *         var exampleDatabase = new Database(&#34;exampleDatabase&#34;, DatabaseArgs.builder()        
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .location(exampleResourceGroup.location())
 *             .serverName(exampleSqlServer.name())
 *             .requestedServiceObjectiveName(&#34;S0&#34;)
 *             .collation(&#34;SQL_LATIN1_GENERAL_CP1_CI_AS&#34;)
 *             .maxSizeBytes(&#34;268435456000&#34;)
 *             .createMode(&#34;Default&#34;)
 *             .build());
 * 
 *         var exampleOutputMssql = new OutputMssql(&#34;exampleOutputMssql&#34;, OutputMssqlArgs.builder()        
 *             .streamAnalyticsJobName(exampleJob.applyValue(getJobResult -&gt; getJobResult).applyValue(exampleJob -&gt; exampleJob.applyValue(getJobResult -&gt; getJobResult.name())))
 *             .resourceGroupName(exampleJob.applyValue(getJobResult -&gt; getJobResult).applyValue(exampleJob -&gt; exampleJob.applyValue(getJobResult -&gt; getJobResult.resourceGroupName())))
 *             .server(exampleSqlServer.fullyQualifiedDomainName())
 *             .user(exampleSqlServer.administratorLogin())
 *             .password(exampleSqlServer.administratorLoginPassword())
 *             .database(exampleDatabase.name())
 *             .table(&#34;ExampleTable&#34;)
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * Stream Analytics Outputs to Microsoft SQL Server Database can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:streamanalytics/outputMssql:OutputMssql example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.StreamAnalytics/streamingJobs/job1/outputs/output1
 * ```
 * 
 */
@ResourceType(type="azure:streamanalytics/outputMssql:OutputMssql")
public class OutputMssql extends com.pulumi.resources.CustomResource {
    /**
     * The authentication mode for the Stream Output. Possible values are `Msi` and `ConnectionString`. Defaults to `ConnectionString`.
     * 
     */
    @Export(name="authenticationMode", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> authenticationMode;

    /**
     * @return The authentication mode for the Stream Output. Possible values are `Msi` and `ConnectionString`. Defaults to `ConnectionString`.
     * 
     */
    public Output<Optional<String>> authenticationMode() {
        return Codegen.optional(this.authenticationMode);
    }
    /**
     * The MS SQL database name where the reference table exists. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="database", refs={String.class}, tree="[0]")
    private Output<String> database;

    /**
     * @return The MS SQL database name where the reference table exists. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> database() {
        return this.database;
    }
    /**
     * The max batch count to write to the SQL Database. Defaults to `10000`. Possible values are between `1` and `1073741824`.
     * 
     */
    @Export(name="maxBatchCount", refs={Double.class}, tree="[0]")
    private Output</* @Nullable */ Double> maxBatchCount;

    /**
     * @return The max batch count to write to the SQL Database. Defaults to `10000`. Possible values are between `1` and `1073741824`.
     * 
     */
    public Output<Optional<Double>> maxBatchCount() {
        return Codegen.optional(this.maxBatchCount);
    }
    /**
     * The max writer count for the SQL Database. Defaults to `1`. Possible values are `0` which bases the writer count on the query partition and `1` which corresponds to a single writer.
     * 
     */
    @Export(name="maxWriterCount", refs={Double.class}, tree="[0]")
    private Output</* @Nullable */ Double> maxWriterCount;

    /**
     * @return The max writer count for the SQL Database. Defaults to `1`. Possible values are `0` which bases the writer count on the query partition and `1` which corresponds to a single writer.
     * 
     */
    public Output<Optional<Double>> maxWriterCount() {
        return Codegen.optional(this.maxWriterCount);
    }
    /**
     * The name of the Stream Output. 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 Stream Output. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * Password used together with username, to login to the Microsoft SQL Server. Required if `authentication_mode` is `ConnectionString`.
     * 
     */
    @Export(name="password", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> password;

    /**
     * @return Password used together with username, to login to the Microsoft SQL Server. Required if `authentication_mode` is `ConnectionString`.
     * 
     */
    public Output<Optional<String>> password() {
        return Codegen.optional(this.password);
    }
    /**
     * The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="resourceGroupName", refs={String.class}, tree="[0]")
    private Output<String> resourceGroupName;

    /**
     * @return The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> resourceGroupName() {
        return this.resourceGroupName;
    }
    /**
     * The SQL server url. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="server", refs={String.class}, tree="[0]")
    private Output<String> server;

    /**
     * @return The SQL server url. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> server() {
        return this.server;
    }
    /**
     * The name of the Stream Analytics Job. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="streamAnalyticsJobName", refs={String.class}, tree="[0]")
    private Output<String> streamAnalyticsJobName;

    /**
     * @return The name of the Stream Analytics Job. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> streamAnalyticsJobName() {
        return this.streamAnalyticsJobName;
    }
    /**
     * Table in the database that the output points to. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="table", refs={String.class}, tree="[0]")
    private Output<String> table;

    /**
     * @return Table in the database that the output points to. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> table() {
        return this.table;
    }
    /**
     * Username used to login to the Microsoft SQL Server. Changing this forces a new resource to be created. Required if `authentication_mode` is `ConnectionString`.
     * 
     */
    @Export(name="user", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> user;

    /**
     * @return Username used to login to the Microsoft SQL Server. Changing this forces a new resource to be created. Required if `authentication_mode` is `ConnectionString`.
     * 
     */
    public Output<Optional<String>> user() {
        return Codegen.optional(this.user);
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public OutputMssql(String name) {
        this(name, OutputMssqlArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public OutputMssql(String name, OutputMssqlArgs 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 OutputMssql(String name, OutputMssqlArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:streamanalytics/outputMssql:OutputMssql", name, args == null ? OutputMssqlArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private OutputMssql(String name, Output<String> id, @Nullable OutputMssqlState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:streamanalytics/outputMssql:OutputMssql", 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())
            .additionalSecretOutputs(List.of(
                "password"
            ))
            .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 OutputMssql get(String name, Output<String> id, @Nullable OutputMssqlState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new OutputMssql(name, id, state, options);
    }
}
