var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
/* Generated from Java with JSweet 2.3.7 - http://www.jsweet.org */
import { Library } from '../../Library';
import { ModelUtils } from '../util/ModelUtils';
import { DeleteSecuritySchemeCommand } from './DeleteSecuritySchemeCommand';
/**
 * @author eric.wittmann@gmail.com
 * @extends DeleteSecuritySchemeCommand
 * @class
 */
var DeleteSecuritySchemeCommand_30 = /** @class */ (function (_super) {
    __extends(DeleteSecuritySchemeCommand_30, _super);
    function DeleteSecuritySchemeCommand_30(schemeName) {
        var _this = this;
        if (((typeof schemeName === 'string') || schemeName === null)) {
            var __args = arguments;
            _this = _super.call(this, schemeName) || this;
        }
        else if (schemeName === undefined) {
            var __args = arguments;
            _this = _super.call(this) || this;
        }
        else
            throw new Error('invalid overload');
        return _this;
    }
    /**
     * @see io.apicurio.datamodels.cmd.commands.DeleteSecuritySchemeCommand#doDeleteScheme(io.apicurio.datamodels.core.models.Document)
     * @param {Document} document
     * @return {*}
     */
    DeleteSecuritySchemeCommand_30.prototype.doDeleteScheme = function (document) {
        var doc30 = document;
        if (ModelUtils.isDefined(doc30.components)) {
            return Library.writeNode(doc30.components.removeSecurityScheme(this._schemeName));
        }
        else {
            return null;
        }
    };
    /**
     * @see io.apicurio.datamodels.cmd.commands.DeleteSecuritySchemeCommand#doRestoreScheme(io.apicurio.datamodels.core.models.Document, java.lang.Object)
     * @param {Document} document
     * @param {*} oldScheme
     */
    DeleteSecuritySchemeCommand_30.prototype.doRestoreScheme = function (document, oldScheme) {
        var doc30 = document;
        if (ModelUtils.isDefined(doc30.components)) {
            var scheme = doc30.components.createSecurityScheme(this._schemeName);
            Library.readNode(oldScheme, scheme);
            doc30.components.addSecurityScheme(this._schemeName, scheme);
        }
    };
    return DeleteSecuritySchemeCommand_30;
}(DeleteSecuritySchemeCommand));
export { DeleteSecuritySchemeCommand_30 };
DeleteSecuritySchemeCommand_30["__class"] = "io.apicurio.datamodels.cmd.commands.DeleteSecuritySchemeCommand_30";
DeleteSecuritySchemeCommand_30["__interfaces"] = ["io.apicurio.datamodels.cmd.ICommand"];
//# sourceMappingURL=DeleteSecuritySchemeCommand_30.js.map