"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.JobStorageAccount = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a Stream Analytics Job Storage Account. Use this resource for managing the Job Storage Account using `Msi` authentication with a `SystemAssigned` identity.
 *
 * > **Note:** The Job Storage Account for a Stream Analytics Job can be managed on the `azure.streamanalytics.Job` resource with the `jobStorageAccount` block, or with this resource. We do not recommend managing the Job Storage Account through both means as this can lead to conflicts.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleJob = new azure.streamanalytics.Job("example", {
 *     name: "example-job",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     compatibilityLevel: "1.2",
 *     dataLocale: "en-GB",
 *     eventsLateArrivalMaxDelayInSeconds: 60,
 *     eventsOutOfOrderMaxDelayInSeconds: 50,
 *     eventsOutOfOrderPolicy: "Adjust",
 *     outputErrorPolicy: "Drop",
 *     streamingUnits: 3,
 *     skuName: "StandardV2",
 *     identity: {
 *         type: "SystemAssigned",
 *     },
 *     tags: {
 *         environment: "Example",
 *     },
 *     transformationQuery: `    SELECT *
 *     INTO [YourOutputAlias]
 *     FROM [YourInputAlias]
 * `,
 * });
 * const exampleAccount = new azure.storage.Account("example", {
 *     name: "exampleaccount",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     accountTier: "Standard",
 *     accountReplicationType: "LRS",
 * });
 * const exampleJobStorageAccount = new azure.streamanalytics.JobStorageAccount("example", {
 *     streamAnalyticsJobId: exampleJob.id,
 *     storageAccountName: exampleAccount.name,
 *     authenticationMode: "Msi",
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.StreamAnalytics` - 2021-10-01-preview
 *
 * ## Import
 *
 * Stream Analytics Job Storage Accounts can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:streamanalytics/jobStorageAccount:JobStorageAccount example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.StreamAnalytics/streamingJobs/job1
 * ```
 */
class JobStorageAccount extends pulumi.CustomResource {
    /**
     * Get an existing JobStorageAccount 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 JobStorageAccount(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:streamanalytics/jobStorageAccount:JobStorageAccount';
    /**
     * Returns true if the given object is an instance of JobStorageAccount.  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'] === JobStorageAccount.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["authenticationMode"] = state?.authenticationMode;
            resourceInputs["storageAccountKey"] = state?.storageAccountKey;
            resourceInputs["storageAccountName"] = state?.storageAccountName;
            resourceInputs["streamAnalyticsJobId"] = state?.streamAnalyticsJobId;
        }
        else {
            const args = argsOrState;
            if (args?.authenticationMode === undefined && !opts.urn) {
                throw new Error("Missing required property 'authenticationMode'");
            }
            if (args?.storageAccountName === undefined && !opts.urn) {
                throw new Error("Missing required property 'storageAccountName'");
            }
            if (args?.streamAnalyticsJobId === undefined && !opts.urn) {
                throw new Error("Missing required property 'streamAnalyticsJobId'");
            }
            resourceInputs["authenticationMode"] = args?.authenticationMode;
            resourceInputs["storageAccountKey"] = args?.storageAccountKey ? pulumi.secret(args.storageAccountKey) : undefined;
            resourceInputs["storageAccountName"] = args?.storageAccountName;
            resourceInputs["streamAnalyticsJobId"] = args?.streamAnalyticsJobId;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["storageAccountKey"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(JobStorageAccount.__pulumiType, name, resourceInputs, opts);
    }
}
exports.JobStorageAccount = JobStorageAccount;
//# sourceMappingURL=jobStorageAccount.js.map