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 { AbstractCommand } from '../AbstractCommand';
import { SecurityScheme } from '../../core/models/common/SecurityScheme';
/**
 * A command used to create a new security scheme in a document.
 * @author eric.wittmann@gmail.com
 * @extends AbstractCommand
 * @class
 */
var NewSecuritySchemeCommand = /** @class */ (function (_super) {
    __extends(NewSecuritySchemeCommand, _super);
    function NewSecuritySchemeCommand(scheme) {
        var _this = this;
        if (((scheme != null && scheme instanceof SecurityScheme) || scheme === null)) {
            var __args = arguments;
            _this = _super.call(this) || this;
            if (_this._scheme === undefined)
                _this._scheme = null;
            if (_this._schemeName === undefined)
                _this._schemeName = null;
            if (_this._schemeExisted === undefined)
                _this._schemeExisted = false;
            if (_this._scheme === undefined)
                _this._scheme = null;
            if (_this._schemeName === undefined)
                _this._schemeName = null;
            if (_this._schemeExisted === undefined)
                _this._schemeExisted = false;
            (function () {
                _this._scheme = Library.writeNode(scheme);
                _this._schemeName = scheme.getSchemeName();
            })();
        }
        else if (scheme === undefined) {
            var __args = arguments;
            _this = _super.call(this) || this;
            if (_this._scheme === undefined)
                _this._scheme = null;
            if (_this._schemeName === undefined)
                _this._schemeName = null;
            if (_this._schemeExisted === undefined)
                _this._schemeExisted = false;
            if (_this._scheme === undefined)
                _this._scheme = null;
            if (_this._schemeName === undefined)
                _this._schemeName = null;
            if (_this._schemeExisted === undefined)
                _this._schemeExisted = false;
        }
        else
            throw new Error('invalid overload');
        return _this;
    }
    return NewSecuritySchemeCommand;
}(AbstractCommand));
export { NewSecuritySchemeCommand };
NewSecuritySchemeCommand["__class"] = "io.apicurio.datamodels.cmd.commands.NewSecuritySchemeCommand";
NewSecuritySchemeCommand["__interfaces"] = ["io.apicurio.datamodels.cmd.ICommand"];
//# sourceMappingURL=NewSecuritySchemeCommand.js.map