"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.ManagedStorageAccountSasTokenDefinition = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a Key Vault Managed Storage Account SAS Definition.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = azure.core.getClientConfig({});
 * const exampleResourceGroup = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleAccount = new azure.storage.Account("example", {
 *     name: "storageaccountname",
 *     resourceGroupName: exampleResourceGroup.name,
 *     location: exampleResourceGroup.location,
 *     accountTier: "Standard",
 *     accountReplicationType: "LRS",
 * });
 * const exampleGetAccountSAS = azure.storage.getAccountSASOutput({
 *     connectionString: exampleAccount.primaryConnectionString,
 *     httpsOnly: true,
 *     resourceTypes: {
 *         service: true,
 *         container: false,
 *         object: false,
 *     },
 *     services: {
 *         blob: true,
 *         queue: false,
 *         table: false,
 *         file: false,
 *     },
 *     start: "2021-04-30T00:00:00Z",
 *     expiry: "2023-04-30T00:00:00Z",
 *     permissions: {
 *         read: true,
 *         write: true,
 *         "delete": false,
 *         list: false,
 *         add: true,
 *         create: true,
 *         update: false,
 *         process: false,
 *         tag: false,
 *         filter: false,
 *     },
 * });
 * const exampleKeyVault = new azure.keyvault.KeyVault("example", {
 *     name: "example-keyvault",
 *     location: exampleResourceGroup.location,
 *     resourceGroupName: exampleResourceGroup.name,
 *     tenantId: example.then(example => example.tenantId),
 *     skuName: "standard",
 *     accessPolicies: [{
 *         tenantId: example.then(example => example.tenantId),
 *         objectId: example.then(example => example.objectId),
 *         secretPermissions: [
 *             "Get",
 *             "Delete",
 *         ],
 *         storagePermissions: [
 *             "Get",
 *             "List",
 *             "Set",
 *             "SetSAS",
 *             "GetSAS",
 *             "DeleteSAS",
 *             "Update",
 *             "RegenerateKey",
 *         ],
 *     }],
 * });
 * const exampleManagedStorageAccount = new azure.keyvault.ManagedStorageAccount("example", {
 *     name: "examplemanagedstorage",
 *     keyVaultId: exampleKeyVault.id,
 *     storageAccountId: exampleAccount.id,
 *     storageAccountKey: "key1",
 *     regenerateKeyAutomatically: false,
 *     regenerationPeriod: "P1D",
 * });
 * const exampleManagedStorageAccountSasTokenDefinition = new azure.keyvault.ManagedStorageAccountSasTokenDefinition("example", {
 *     name: "examplesasdefinition",
 *     validityPeriod: "P1D",
 *     managedStorageAccountId: exampleManagedStorageAccount.id,
 *     sasTemplateUri: exampleGetAccountSAS.apply(exampleGetAccountSAS => exampleGetAccountSAS.sas),
 *     sasType: "account",
 * });
 * ```
 *
 * ## Import
 *
 * Key Vaults can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:keyvault/managedStorageAccountSasTokenDefinition:ManagedStorageAccountSasTokenDefinition example https://example-keyvault.vault.azure.net/storage/exampleStorageAcc01/sas/exampleSasDefinition01
 * ```
 */
class ManagedStorageAccountSasTokenDefinition extends pulumi.CustomResource {
    /**
     * Get an existing ManagedStorageAccountSasTokenDefinition 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 ManagedStorageAccountSasTokenDefinition(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:keyvault/managedStorageAccountSasTokenDefinition:ManagedStorageAccountSasTokenDefinition';
    /**
     * Returns true if the given object is an instance of ManagedStorageAccountSasTokenDefinition.  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'] === ManagedStorageAccountSasTokenDefinition.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["managedStorageAccountId"] = state?.managedStorageAccountId;
            resourceInputs["name"] = state?.name;
            resourceInputs["sasTemplateUri"] = state?.sasTemplateUri;
            resourceInputs["sasType"] = state?.sasType;
            resourceInputs["secretId"] = state?.secretId;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["validityPeriod"] = state?.validityPeriod;
        }
        else {
            const args = argsOrState;
            if (args?.managedStorageAccountId === undefined && !opts.urn) {
                throw new Error("Missing required property 'managedStorageAccountId'");
            }
            if (args?.sasTemplateUri === undefined && !opts.urn) {
                throw new Error("Missing required property 'sasTemplateUri'");
            }
            if (args?.sasType === undefined && !opts.urn) {
                throw new Error("Missing required property 'sasType'");
            }
            if (args?.validityPeriod === undefined && !opts.urn) {
                throw new Error("Missing required property 'validityPeriod'");
            }
            resourceInputs["managedStorageAccountId"] = args?.managedStorageAccountId;
            resourceInputs["name"] = args?.name;
            resourceInputs["sasTemplateUri"] = args?.sasTemplateUri;
            resourceInputs["sasType"] = args?.sasType;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["validityPeriod"] = args?.validityPeriod;
            resourceInputs["secretId"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(ManagedStorageAccountSasTokenDefinition.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ManagedStorageAccountSasTokenDefinition = ManagedStorageAccountSasTokenDefinition;
//# sourceMappingURL=managedStorageAccountSasTokenDefinition.js.map