// *** 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.FunctionJavaScriptUDFArgs;
import com.pulumi.azure.streamanalytics.inputs.FunctionJavaScriptUDFState;
import com.pulumi.azure.streamanalytics.outputs.FunctionJavaScriptUDFInput;
import com.pulumi.azure.streamanalytics.outputs.FunctionJavaScriptUDFOutput;
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.String;
import java.util.List;
import javax.annotation.Nullable;

/**
 * Manages a JavaScript UDF Function within Stream Analytics Streaming Job.
 * 
 * ## Example Usage
 * ```java
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.core.CoreFunctions;
 * import com.pulumi.azure.core.inputs.GetResourceGroupArgs;
 * import com.pulumi.azure.streamanalytics.StreamanalyticsFunctions;
 * import com.pulumi.azure.streamanalytics.inputs.GetJobArgs;
 * import com.pulumi.azure.streamanalytics.FunctionJavaScriptUDF;
 * import com.pulumi.azure.streamanalytics.FunctionJavaScriptUDFArgs;
 * import com.pulumi.azure.streamanalytics.inputs.FunctionJavaScriptUDFInputArgs;
 * import com.pulumi.azure.streamanalytics.inputs.FunctionJavaScriptUDFOutputArgs;
 * 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) {
 *         final var exampleResourceGroup = CoreFunctions.getResourceGroup(GetResourceGroupArgs.builder()
 *             .name(&#34;example-resources&#34;)
 *             .build());
 * 
 *         final var exampleJob = StreamanalyticsFunctions.getJob(GetJobArgs.builder()
 *             .name(&#34;example-job&#34;)
 *             .resourceGroupName(exampleResourceGroup.applyValue(getResourceGroupResult -&gt; getResourceGroupResult.name()))
 *             .build());
 * 
 *         var exampleFunctionJavaScriptUDF = new FunctionJavaScriptUDF(&#34;exampleFunctionJavaScriptUDF&#34;, FunctionJavaScriptUDFArgs.builder()        
 *             .streamAnalyticsJobName(exampleJob.applyValue(getJobResult -&gt; getJobResult.name()))
 *             .resourceGroupName(exampleJob.applyValue(getJobResult -&gt; getJobResult.resourceGroupName()))
 *             .script(&#34;&#34;&#34;
 * function getRandomNumber(in) {
 *   return in;
 * }
 *             &#34;&#34;&#34;)
 *             .inputs(FunctionJavaScriptUDFInputArgs.builder()
 *                 .type(&#34;bigint&#34;)
 *                 .build())
 *             .output(FunctionJavaScriptUDFOutputArgs.builder()
 *                 .type(&#34;bigint&#34;)
 *                 .build())
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * Stream Analytics JavaScript UDF Functions can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:streamanalytics/functionJavaScriptUDF:FunctionJavaScriptUDF example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.StreamAnalytics/streamingJobs/job1/functions/func1
 * ```
 * 
 */
@ResourceType(type="azure:streamanalytics/functionJavaScriptUDF:FunctionJavaScriptUDF")
public class FunctionJavaScriptUDF extends com.pulumi.resources.CustomResource {
    /**
     * One or more `input` blocks as defined below.
     * 
     */
    @Export(name="inputs", refs={List.class,FunctionJavaScriptUDFInput.class}, tree="[0,1]")
    private Output<List<FunctionJavaScriptUDFInput>> inputs;

    /**
     * @return One or more `input` blocks as defined below.
     * 
     */
    public Output<List<FunctionJavaScriptUDFInput>> inputs() {
        return this.inputs;
    }
    /**
     * The name of the JavaScript UDF Function. 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 JavaScript UDF Function. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * An `output` blocks as defined below.
     * 
     */
    @Export(name="output", refs={FunctionJavaScriptUDFOutput.class}, tree="[0]")
    private Output<FunctionJavaScriptUDFOutput> output;

    /**
     * @return An `output` blocks as defined below.
     * 
     */
    public Output<FunctionJavaScriptUDFOutput> output() {
        return this.output;
    }
    /**
     * 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 JavaScript of this UDF Function.
     * 
     */
    @Export(name="script", refs={String.class}, tree="[0]")
    private Output<String> script;

    /**
     * @return The JavaScript of this UDF Function.
     * 
     */
    public Output<String> script() {
        return this.script;
    }
    /**
     * The name of the Stream Analytics Job where this Function should be created. 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 where this Function should be created. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> streamAnalyticsJobName() {
        return this.streamAnalyticsJobName;
    }

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

    private FunctionJavaScriptUDF(String name, Output<String> id, @Nullable FunctionJavaScriptUDFState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:streamanalytics/functionJavaScriptUDF:FunctionJavaScriptUDF", 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 FunctionJavaScriptUDF get(String name, Output<String> id, @Nullable FunctionJavaScriptUDFState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new FunctionJavaScriptUDF(name, id, state, options);
    }
}
