// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
/**
 * A static-signature-based credential that supports updating
 * the underlying signature value.
 */
var AzureSASCredential = /** @class */ (function () {
    /**
     * Create an instance of an AzureSASCredential for use
     * with a service client.
     *
     * @param signature - The initial value of the shared access signature to use in authentication
     */
    function AzureSASCredential(signature) {
        if (!signature) {
            throw new Error("shared access signature must be a non-empty string");
        }
        this._signature = signature;
    }
    Object.defineProperty(AzureSASCredential.prototype, "signature", {
        /**
         * The value of the shared access signature to be used in authentication
         */
        get: function () {
            return this._signature;
        },
        enumerable: false,
        configurable: true
    });
    /**
     * Change the value of the signature.
     *
     * Updates will take effect upon the next request after
     * updating the signature value.
     *
     * @param newSignature - The new shared access signature value to be used
     */
    AzureSASCredential.prototype.update = function (newSignature) {
        if (!newSignature) {
            throw new Error("shared access signature must be a non-empty string");
        }
        this._signature = newSignature;
    };
    return AzureSASCredential;
}());
export { AzureSASCredential };
//# sourceMappingURL=azureSASCredential.js.map