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 '../ExtensibleNode';
/**
 * Constructor.
 * @class
 * @extends ExtensibleNode
 * @author eric.wittmann@gmail.com
 */
var OAuthFlow = /** @class */ (function (_super) {
    __extends(OAuthFlow, _super);
    function OAuthFlow() {
        var _this = _super.call(this) || this;
        if (_this.authorizationUrl === undefined)
            _this.authorizationUrl = null;
        if (_this.tokenUrl === undefined)
            _this.tokenUrl = null;
        if (_this.refreshUrl === undefined)
            _this.refreshUrl = null;
        if (_this.scopes === undefined)
            _this.scopes = null;
        return _this;
    }
    /**
     * Adds a scope.
     * @param {string} scope
     * @param {string} description
     */
    OAuthFlow.prototype.addScope = function (scope, description) {
        if (this.scopes == null) {
            this.scopes = ({});
        }
        /* put */ (this.scopes[scope] = description);
    };
    /**
     * Removes a scope.
     * @param {string} scope
     */
    OAuthFlow.prototype.removeScope = function (scope) {
        var _this = this;
        if (this.scopes != null) {
            /* remove */ (function (map) { var deleted = _this.scopes[scope]; delete _this.scopes[scope]; return deleted; })(this.scopes);
        }
    };
    /**
     * Gets the list of scopes.
     * @return {string[]}
     */
    OAuthFlow.prototype.getScopes = function () {
        var rval = ([]);
        if (this.scopes != null) {
            /* addAll */ (function (l1, l2) { return l1.push.apply(l1, l2); })(rval, /* keySet */ Object.keys(this.scopes));
        }
        return rval;
    };
    return OAuthFlow;
}(ExtensibleNode));
export { OAuthFlow };
OAuthFlow["__class"] = "io.apicurio.datamodels.core.models.common.OAuthFlow";
OAuthFlow["__interfaces"] = ["io.apicurio.datamodels.core.models.IVisitable"];
//# sourceMappingURL=OAuthFlow.js.map