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 { ExtensibleNode } from '../../../core/models/ExtensibleNode';
/**
 * Constructor.
 * @class
 * @extends ExtensibleNode
 * @author eric.wittmann@gmail.com
 */
var Oas20Scopes = /** @class */ (function (_super) {
    __extends(Oas20Scopes, _super);
    function Oas20Scopes() {
        var _this = _super.call(this) || this;
        _this.items = ({});
        return _this;
    }
    /**
     * @see io.apicurio.datamodels.core.models.Node#accept(io.apicurio.datamodels.core.visitors.IVisitor)
     * @param {*} visitor
     */
    Oas20Scopes.prototype.accept = function (visitor) {
        var viz = visitor;
        viz.visitScopes(this);
    };
    /**
     * Returns all the scopes.
     * @return {string[]}
     */
    Oas20Scopes.prototype.getScopeNames = function () {
        var rval = ([]);
        /* addAll */ (function (l1, l2) { return l1.push.apply(l1, l2); })(rval, /* keySet */ Object.keys(this.items));
        return rval;
    };
    /**
     * Gets a scope description.
     * @param {string} scope
     * @return {string}
     */
    Oas20Scopes.prototype.getScopeDescription = function (scope) {
        return /* get */ (function (m, k) { return m[k] === undefined ? null : m[k]; })(this.items, scope);
    };
    /**
     * Adds a scope to the map.
     * @param {string} scope
     * @param {string} description
     */
    Oas20Scopes.prototype.addScope = function (scope, description) {
        /* put */ (this.items[scope] = description);
    };
    /**
     * Removes a scope.
     * @param {string} scope
     * @return {string}
     */
    Oas20Scopes.prototype.removeScope = function (scope) {
        var _this = this;
        return /* remove */ (function (map) { var deleted = _this.items[scope]; delete _this.items[scope]; return deleted; })(this.items);
    };
    return Oas20Scopes;
}(ExtensibleNode));
export { Oas20Scopes };
Oas20Scopes["__class"] = "io.apicurio.datamodels.openapi.v2.models.Oas20Scopes";
Oas20Scopes["__interfaces"] = ["io.apicurio.datamodels.core.models.IVisitable"];
//# sourceMappingURL=Oas20Scopes.js.map