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 __());
    };
})();
import { JsonCompat } from '../../compat/JsonCompat';
import { Node } from '../../core/models/Node';
import { Components } from '../../core/models/common/Components';
/**
 * Constructor.
 * @param {Node} parent
 * @class
 * @extends Components
 * @author Jakub Senko <jsenko@redhat.com>
 */
var AaiComponents = /** @class */ (function (_super) {
    __extends(AaiComponents, _super);
    function AaiComponents(parent) {
        var _this = this;
        if (((parent != null && parent instanceof Node) || parent === null)) {
            var __args = arguments;
            _this = _super.call(this) || this;
            if (_this.schemas === undefined)
                _this.schemas = null;
            if (_this.messages === undefined)
                _this.messages = null;
            if (_this.securitySchemes === undefined)
                _this.securitySchemes = null;
            if (_this.parameters === undefined)
                _this.parameters = null;
            if (_this.correlationIds === undefined)
                _this.correlationIds = null;
            if (_this.operationTraits === undefined)
                _this.operationTraits = null;
            if (_this.messageTraits === undefined)
                _this.messageTraits = null;
            if (_this.serverBindings === undefined)
                _this.serverBindings = null;
            if (_this.channelBindings === undefined)
                _this.channelBindings = null;
            if (_this.operationBindings === undefined)
                _this.operationBindings = null;
            if (_this.messageBindings === undefined)
                _this.messageBindings = null;
            if (_this.schemas === undefined)
                _this.schemas = null;
            if (_this.messages === undefined)
                _this.messages = null;
            if (_this.securitySchemes === undefined)
                _this.securitySchemes = null;
            if (_this.parameters === undefined)
                _this.parameters = null;
            if (_this.correlationIds === undefined)
                _this.correlationIds = null;
            if (_this.operationTraits === undefined)
                _this.operationTraits = null;
            if (_this.messageTraits === undefined)
                _this.messageTraits = null;
            if (_this.serverBindings === undefined)
                _this.serverBindings = null;
            if (_this.channelBindings === undefined)
                _this.channelBindings = null;
            if (_this.operationBindings === undefined)
                _this.operationBindings = null;
            if (_this.messageBindings === undefined)
                _this.messageBindings = null;
            (function () {
                if (parent != null) {
                    _this._parent = parent;
                    _this._ownerDocument = parent.ownerDocument();
                }
            })();
        }
        else if (parent === undefined) {
            var __args = arguments;
            _this = _super.call(this) || this;
            if (_this.schemas === undefined)
                _this.schemas = null;
            if (_this.messages === undefined)
                _this.messages = null;
            if (_this.securitySchemes === undefined)
                _this.securitySchemes = null;
            if (_this.parameters === undefined)
                _this.parameters = null;
            if (_this.correlationIds === undefined)
                _this.correlationIds = null;
            if (_this.operationTraits === undefined)
                _this.operationTraits = null;
            if (_this.messageTraits === undefined)
                _this.messageTraits = null;
            if (_this.serverBindings === undefined)
                _this.serverBindings = null;
            if (_this.channelBindings === undefined)
                _this.channelBindings = null;
            if (_this.operationBindings === undefined)
                _this.operationBindings = null;
            if (_this.messageBindings === undefined)
                _this.messageBindings = null;
            if (_this.schemas === undefined)
                _this.schemas = null;
            if (_this.messages === undefined)
                _this.messages = null;
            if (_this.securitySchemes === undefined)
                _this.securitySchemes = null;
            if (_this.parameters === undefined)
                _this.parameters = null;
            if (_this.correlationIds === undefined)
                _this.correlationIds = null;
            if (_this.operationTraits === undefined)
                _this.operationTraits = null;
            if (_this.messageTraits === undefined)
                _this.messageTraits = null;
            if (_this.serverBindings === undefined)
                _this.serverBindings = null;
            if (_this.channelBindings === undefined)
                _this.channelBindings = null;
            if (_this.operationBindings === undefined)
                _this.operationBindings = null;
            if (_this.messageBindings === undefined)
                _this.messageBindings = null;
        }
        else
            throw new Error('invalid overload');
        return _this;
    }
    /**
     *
     * @param {*} visitor
     */
    AaiComponents.prototype.accept = function (visitor) {
        var v = visitor;
        v.visitComponents(this);
    };
    AaiComponents.prototype.getMessagesList = function () {
        return JsonCompat.mapToList(this.messages);
    };
    AaiComponents.prototype.getSecuritySchemesList = function () {
        return JsonCompat.mapToList(this.securitySchemes);
    };
    AaiComponents.prototype.getParametersList = function () {
        return JsonCompat.mapToList(this.parameters);
    };
    AaiComponents.prototype.getCorrelationIdsList = function () {
        return JsonCompat.mapToList(this.correlationIds);
    };
    AaiComponents.prototype.getOperationTraitDefinitionsList = function () {
        return JsonCompat.mapToList(this.operationTraits);
    };
    AaiComponents.prototype.getMessageTraitDefinitionsList = function () {
        return JsonCompat.mapToList(this.messageTraits);
    };
    AaiComponents.prototype.getServerBindingsDefinitionList = function () {
        return JsonCompat.mapToList(this.serverBindings);
    };
    AaiComponents.prototype.getChannelBindingsDefinitionList = function () {
        return JsonCompat.mapToList(this.channelBindings);
    };
    AaiComponents.prototype.getOperationBindingsDefinitionList = function () {
        return JsonCompat.mapToList(this.operationBindings);
    };
    AaiComponents.prototype.getMessageBindingsDefinitionList = function () {
        return JsonCompat.mapToList(this.messageBindings);
    };
    AaiComponents.prototype.addSchema = function (key, value) {
        if (this.schemas == null)
            this.schemas = ({});
        /* put */ (this.schemas[key] = value);
    };
    AaiComponents.prototype.addMessage = function (key, value) {
        if (this.messages == null)
            this.messages = ({});
        /* put */ (this.messages[key] = value);
    };
    AaiComponents.prototype.addSecurityScheme = function (key, value) {
        if (this.securitySchemes == null)
            this.securitySchemes = ({});
        /* put */ (this.securitySchemes[key] = value);
    };
    AaiComponents.prototype.addParameter = function (key, value) {
        if (this.parameters == null)
            this.parameters = ({});
        /* put */ (this.parameters[key] = value);
    };
    AaiComponents.prototype.addCorrelationId = function (key, value) {
        if (this.correlationIds == null)
            this.correlationIds = ({});
        /* put */ (this.correlationIds[key] = value);
    };
    AaiComponents.prototype.addMessageTraitDefinition = function (key, value) {
        if (this.messageTraits == null)
            this.messageTraits = ({});
        /* put */ (this.messageTraits[key] = value);
    };
    AaiComponents.prototype.addOperationTraitDefinition = function (key, value) {
        if (this.operationTraits == null)
            this.operationTraits = ({});
        /* put */ (this.operationTraits[key] = value);
    };
    AaiComponents.prototype.addServerBindingDefinition = function (key, value) {
        if (this.serverBindings == null)
            this.serverBindings = ({});
        /* put */ (this.serverBindings[key] = value);
    };
    AaiComponents.prototype.addChannelBindingDefinition = function (key, value) {
        if (this.channelBindings == null)
            this.channelBindings = ({});
        /* put */ (this.channelBindings[key] = value);
    };
    AaiComponents.prototype.addOperationBindingDefinition = function (key, value) {
        if (this.operationBindings == null)
            this.operationBindings = ({});
        /* put */ (this.operationBindings[key] = value);
    };
    AaiComponents.prototype.addMessageBindingDefinition = function (key, value) {
        if (this.messageBindings == null)
            this.messageBindings = ({});
        /* put */ (this.messageBindings[key] = value);
    };
    return AaiComponents;
}(Components));
export { AaiComponents };
AaiComponents["__class"] = "io.apicurio.datamodels.asyncapi.models.AaiComponents";
AaiComponents["__interfaces"] = ["io.apicurio.datamodels.core.models.IVisitable"];
//# sourceMappingURL=AaiComponents.js.map