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 { JsonCompat } from '../../compat/JsonCompat';
import { Document } from '../../core/models/Document';
/**
 * Constructor.
 * @class
 * @extends Document
 * @author eric.wittmann@gmail.com
 */
var AaiDocument = /** @class */ (function (_super) {
    __extends(AaiDocument, _super);
    function AaiDocument() {
        var _this = _super.call(this) || this;
        if (_this.asyncapi === undefined)
            _this.asyncapi = null;
        if (_this.id === undefined)
            _this.id = null;
        _this.channels = ({});
        if (_this.servers === undefined)
            _this.servers = null;
        if (_this.components === undefined)
            _this.components = null;
        if (_this.defaultContentType === undefined)
            _this.defaultContentType = null;
        return _this;
    }
    AaiDocument.prototype.addServer = function (name, server) {
        if (this.servers == null) {
            this.servers = ({});
        }
        /* put */ (this.servers[name] = server);
        return server;
    };
    AaiDocument.prototype.getChannels = function () {
        return JsonCompat.mapToList(this.channels);
    };
    AaiDocument.prototype.addChannelItem = function (item) {
        if (this.channels == null)
            this.channels = ({});
        /* put */ (this.channels[item.getName()] = item);
    };
    AaiDocument.prototype.createServer$java_lang_String = function (name) { throw new Error('cannot invoke abstract overloaded method... check your argument(s) type(s)'); };
    AaiDocument.prototype.createServer$java_lang_String$java_lang_String$java_lang_String = function (name, url, description) { throw new Error('cannot invoke abstract overloaded method... check your argument(s) type(s)'); };
    AaiDocument.prototype.createServer = function (name, url, description) {
        if (((typeof name === 'string') || name === null) && ((typeof url === 'string') || url === null) && ((typeof description === 'string') || description === null)) {
            return this.createServer$java_lang_String$java_lang_String$java_lang_String(name, url, description);
        }
        else if (((typeof name === 'string') || name === null) && url === undefined && description === undefined) {
            return this.createServer$java_lang_String(name);
        }
        else
            throw new Error('invalid overload');
    };
    AaiDocument.prototype.getServers = function () {
        return JsonCompat.mapToList(this.servers);
    };
    return AaiDocument;
}(Document));
export { AaiDocument };
AaiDocument["__class"] = "io.apicurio.datamodels.asyncapi.models.AaiDocument";
AaiDocument["__interfaces"] = ["io.apicurio.datamodels.core.models.IVisitable", "io.apicurio.datamodels.core.models.common.IExternalDocumentationParent"];
//# sourceMappingURL=AaiDocument.js.map