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 { Constants } from '../../core/Constants';
import { DataModelReader } from '../../core/io/DataModelReader';
/**
 * A data model reader for the AsyncAPI data model.
 *
 * @author eric.wittmann@gmail.com
 * @author Jakub Senko <jsenko@redhat.com>
 * @param {*} nodeFactory
 * @class
 * @extends DataModelReader
 */
var AaiDataModelReader = /** @class */ (function (_super) {
    __extends(AaiDataModelReader, _super);
    function AaiDataModelReader(nodeFactory) {
        var _this = _super.call(this) || this;
        if (_this.nodeFactory === undefined)
            _this.nodeFactory = null;
        _this.nodeFactory = nodeFactory;
        return _this;
    }
    /**
     * @see io.apicurio.datamodels.core.io.DataModelReader#readDocument(java.lang.Object, io.apicurio.datamodels.core.models.Document)
     * @param {*} json
     * @param {Document} node
     */
    AaiDataModelReader.prototype.readDocument = function (json, node) {
        var _this = this;
        var doc = node;
        doc.asyncapi = JsonCompat.consumePropertyString(json, Constants.PROP_ASYNCAPI);
        doc.id = JsonCompat.consumePropertyString(json, Constants.PROP_ID);
        doc.defaultContentType = JsonCompat.consumePropertyString(json, Constants.PROP_DEFAULT_CONTENT_TYPE);
        var channels = JsonCompat.consumeProperty(json, Constants.PROP_CHANNELS);
        if (channels != null) {
            JsonCompat.keys(channels).forEach((function (channels, doc) {
                return function (key) {
                    var json_ = JsonCompat.consumeProperty(channels, key);
                    var value = _this.nodeFactory.createChannelItem(node, key);
                    _this.readChannelItem(json_, value);
                    doc.addChannelItem(value);
                };
            })(channels, doc));
        }
        var serversJson = JsonCompat.consumeProperty(json, Constants.PROP_SERVERS);
        if (serversJson != null) {
            JsonCompat.keys(serversJson).forEach((function (serversJson, doc) {
                return function (key) {
                    var serverJson = JsonCompat.consumeProperty(serversJson, key);
                    var serverModel = _this.nodeFactory.createServer(node, key);
                    _this.readServer(serverJson, serverModel);
                    doc.addServer(key, serverModel);
                };
            })(serversJson, doc));
        }
        var json_ = JsonCompat.consumeProperty(json, Constants.PROP_COMPONENTS);
        if (json_ != null) {
            var components = this.nodeFactory.createComponents(node);
            this.readComponents(json_, components);
            doc.components = components;
        }
        _super.prototype.readDocument.call(this, json, doc);
    };
    AaiDataModelReader.prototype.readChannelItem = function (json, node) {
        var _this = this;
        node.$ref = JsonCompat.consumePropertyString(json, Constants.PROP_$REF);
        node.description = JsonCompat.consumePropertyString(json, Constants.PROP_DESCRIPTION);
        var json_ = JsonCompat.consumeProperty(json, Constants.PROP_SUBSCRIBE);
        if (json_ != null) {
            var operation = this.nodeFactory.createOperation(node, Constants.PROP_SUBSCRIBE);
            this.readOperation(json_, operation);
            node.subscribe = operation;
        }
        json_ = JsonCompat.consumeProperty(json, Constants.PROP_PUBLISH);
        if (json_ != null) {
            var operation = this.nodeFactory.createOperation(node, Constants.PROP_PUBLISH);
            this.readOperation(json_, operation);
            node.publish = operation;
        }
        var jsonP_ = JsonCompat.consumeProperty(json, Constants.PROP_PARAMETERS);
        if (jsonP_ != null && JsonCompat.isObject(jsonP_)) {
            JsonCompat.keys(jsonP_).forEach((function (jsonP_) {
                return function (key) {
                    var param = JsonCompat.consumeProperty(jsonP_, key);
                    var paramModel = _this.nodeFactory.createParameter(node, key);
                    _this.readAaiParameter(param, paramModel);
                    node.addParameter(key, paramModel);
                };
            })(jsonP_));
        }
        json_ = JsonCompat.consumeProperty(json, Constants.PROP_BINDINGS);
        if (json_ != null) {
            var channelBindingsModel = this.nodeFactory.createChannelBindings(node);
            this.readChannelBindings(json_, channelBindingsModel);
            node.bindings = channelBindingsModel;
        }
        this.readExtensions(json, node);
        this.readExtraProperties(json, node);
    };
    /**
     * @see io.apicurio.datamodels.core.io.DataModelReader#readServer(java.lang.Object, io.apicurio.datamodels.core.models.common.Server)
     * @param {*} json
     * @param {Server} node
     */
    AaiDataModelReader.prototype.readServer = function (json, node) {
        var _this = this;
        var aaiNode = node;
        aaiNode.protocol = JsonCompat.consumePropertyString(json, Constants.PROP_PROTOCOL);
        aaiNode.protocolVersion = JsonCompat.consumePropertyString(json, Constants.PROP_PROTOCOL_VERSION);
        var security = JsonCompat.consumePropertyArray(json, Constants.PROP_SECURITY);
        if (security != null) {
            security.forEach((function (aaiNode) {
                return function (sec) {
                    var secModel = _this.nodeFactory.createSecurityRequirement(node);
                    _this.readSecurityRequirement(sec, secModel);
                    aaiNode.addSecurityRequirement(secModel);
                };
            })(aaiNode));
        }
        var bindings = JsonCompat.consumeProperty(json, Constants.PROP_BINDINGS);
        if (bindings != null) {
            var serverBindingsModel = this.nodeFactory.createServerBindings(node);
            this.readServerBindings(bindings, serverBindingsModel);
            aaiNode.bindings = serverBindingsModel;
        }
        _super.prototype.readServer.call(this, json, node);
    };
    /**
     * @see io.apicurio.datamodels.core.io.DataModelReader#readServerVariable(java.lang.Object, io.apicurio.datamodels.core.models.common.ServerVariable)
     * @param {*} json
     * @param {ServerVariable} node
     */
    AaiDataModelReader.prototype.readServerVariable = function (json, node) {
        var aaiNode = node;
        var examples = JsonCompat.consumePropertyStringArray(json, Constants.PROP_EXAMPLES);
        aaiNode.examples = examples;
        _super.prototype.readServerVariable.call(this, json, node);
    };
    /**
     *
     * @param {*} json
     * @param {Operation} node
     */
    AaiDataModelReader.prototype.readOperation = function (json, node) {
        var _this = this;
        var aaiNode = node;
        var traits = JsonCompat.consumePropertyArray(json, Constants.PROP_TRAITS);
        if (traits != null) {
            traits.forEach((function (aaiNode) {
                return function (trait) {
                    var traitModel = _this.nodeFactory.createOperationTrait(node, null);
                    _this.readOperationTrait(trait, traitModel);
                    aaiNode.addTrait(traitModel);
                };
            })(aaiNode));
        }
        var json_ = JsonCompat.consumeProperty(json, Constants.PROP_MESSAGE);
        if (json_ != null) {
            var value = this.nodeFactory.createMessage(node, null);
            this.readMessage(json_, value);
            aaiNode.message = value;
        }
        this.readOperationBase(json, aaiNode);
    };
    AaiDataModelReader.prototype.readMessage = function (json, node) {
        var _this = this;
        var jPayload = JsonCompat.consumeProperty(json, Constants.PROP_PAYLOAD);
        if (jPayload != null) {
            node.payload = jPayload;
        }
        var traits = JsonCompat.consumePropertyArray(json, Constants.PROP_TRAITS);
        if (traits != null) {
            traits.forEach(function (trait) {
                var traitModel = _this.nodeFactory.createMessageTrait(node, null);
                _this.readMessageTrait(trait, traitModel);
                node.addTrait(traitModel);
            });
        }
        var oneOfJson = JsonCompat.consumePropertyArray(json, Constants.PROP_ONE_OF);
        if (oneOfJson != null) {
            for (var index174 = 0; index174 < oneOfJson.length; index174++) {
                var itemJson = oneOfJson[index174];
                {
                    var item = this.nodeFactory.createMessage(node, null);
                    this.readMessage(itemJson, item);
                    item._isOneOfMessage = true;
                    node.addOneOfMessage(item);
                }
            }
        }
        this.readMessageBase(json, node);
    };
    AaiDataModelReader.prototype.readMessageBase = function (json, node) {
        var _this = this;
        var jsonHeaders = JsonCompat.consumeProperty(json, Constants.PROP_HEADERS);
        if (jsonHeaders != null) {
            var headerModel = this.nodeFactory.createHeaderItem(node);
            this.readHeaderItem(jsonHeaders, headerModel);
            node.headers = headerModel;
        }
        var jsonCI = JsonCompat.consumeProperty(json, Constants.PROP_CORRELATION_ID);
        if (jsonCI != null) {
            var value = this.nodeFactory.createCorrelationId(node, null);
            this.readCorrelationId(jsonCI, value);
            node.correlationId = value;
        }
        node.schemaFormat = JsonCompat.consumePropertyString(json, Constants.PROP_SCHEMA_FORMAT);
        node.contentType = JsonCompat.consumePropertyString(json, Constants.PROP_CONTENT_TYPE);
        node.name = JsonCompat.consumePropertyString(json, Constants.PROP_NAME);
        node.title = JsonCompat.consumePropertyString(json, Constants.PROP_TITLE);
        node.summary = JsonCompat.consumePropertyString(json, Constants.PROP_SUMMARY);
        node.description = JsonCompat.consumePropertyString(json, Constants.PROP_DESCRIPTION);
        node.$ref = JsonCompat.consumePropertyString(json, Constants.PROP_$REF);
        var jsonTags = JsonCompat.consumePropertyArray(json, Constants.PROP_TAGS);
        if (jsonTags != null) {
            jsonTags.forEach(function (j) {
                var tag = _this.nodeFactory.createTag(node);
                _this.readTag(j, tag);
                node.addTag(tag);
            });
        }
        var jsonED = JsonCompat.consumeProperty(json, Constants.PROP_EXTERNAL_DOCS);
        if (jsonED != null) {
            var value = this.nodeFactory.createExternalDocumentation(node);
            this.readExternalDocumentation(jsonED, value);
            node.externalDocs = value;
        }
        var bindings = JsonCompat.consumeProperty(json, Constants.PROP_BINDINGS);
        if (bindings != null) {
            var bindingsModel = this.nodeFactory.createMessageBindings(node);
            this.readMessageBindings(bindings, bindingsModel);
            node.bindings = bindingsModel;
        }
        this.readExtensions(json, node);
        this.readExtraProperties(json, node);
    };
    AaiDataModelReader.prototype.readCorrelationId = function (json, node) {
        node.$ref = JsonCompat.consumePropertyString(json, Constants.PROP_$REF);
        node.location = JsonCompat.consumePropertyString(json, Constants.PROP_LOCATION);
        node.description = JsonCompat.consumePropertyString(json, Constants.PROP_DESCRIPTION);
        this.readExtensions(json, node);
        this.readExtraProperties(json, node);
    };
    AaiDataModelReader.prototype.readHeaderItem = function (json, node) {
        var ref = JsonCompat.consumePropertyString(json, Constants.PROP_$REF);
        if (ref != null) {
            node.$ref = ref;
        }
        else {
            node._schemaRaw = json;
        }
    };
    AaiDataModelReader.prototype.readMessageTrait = function (json, node) {
        this.readMessageBase(json, node);
    };
    AaiDataModelReader.prototype.readOperationBase = function (json, node) {
        var _this = this;
        node.$ref = JsonCompat.consumePropertyString(json, Constants.PROP_$REF);
        var jsonTags = JsonCompat.consumePropertyArray(json, Constants.PROP_TAGS);
        if (jsonTags != null) {
            jsonTags.forEach(function (j) {
                var tag = _this.nodeFactory.createTag(node);
                _this.readTag(j, tag);
                node.addTag$io_apicurio_datamodels_asyncapi_models_AaiTag(tag);
            });
        }
        var bindings = JsonCompat.consumeProperty(json, Constants.PROP_BINDINGS);
        if (bindings != null) {
            var operationBindingsModel = this.nodeFactory.createOperationBindings(node);
            this.readOperationBindings(bindings, operationBindingsModel);
            node.bindings = operationBindingsModel;
        }
        _super.prototype.readOperation.call(this, json, node);
    };
    AaiDataModelReader.prototype.readOperationTrait = function (json, node) {
        this.readOperationBase(json, node);
    };
    AaiDataModelReader.prototype.readComponents = function (json, node) {
        var _this = this;
        var components = node;
        var _jsonSchemas = JsonCompat.consumeProperty(json, Constants.PROP_SCHEMAS);
        if (_jsonSchemas != null) {
            JsonCompat.keys(_jsonSchemas).forEach((function (components, _jsonSchemas) {
                return function (key) {
                    var value = JsonCompat.consumeProperty(_jsonSchemas, key);
                    components.addSchema(key, value);
                };
            })(components, _jsonSchemas));
        }
        var _jsonMessages = JsonCompat.consumeProperty(json, Constants.PROP_MESSAGES);
        if (_jsonMessages != null) {
            JsonCompat.keys(_jsonMessages).forEach((function (components, _jsonMessages) {
                return function (key) {
                    var jsonValue = JsonCompat.consumeProperty(_jsonMessages, key);
                    var value = _this.nodeFactory.createMessage(node, key);
                    _this.readMessage(jsonValue, value);
                    components.addMessage(key, value);
                };
            })(components, _jsonMessages));
        }
        var _jsonSecuritySchemes = JsonCompat.consumeProperty(json, Constants.PROP_SECURITY_SCHEMES);
        if (_jsonSecuritySchemes != null) {
            JsonCompat.keys(_jsonSecuritySchemes).forEach((function (components, _jsonSecuritySchemes) {
                return function (key) {
                    var jsonValue = JsonCompat.consumeProperty(_jsonSecuritySchemes, key);
                    var value = _this.nodeFactory.createSecurityScheme(node, key);
                    _this.readSecurityScheme(jsonValue, value);
                    components.addSecurityScheme(key, value);
                };
            })(components, _jsonSecuritySchemes));
        }
        var _jsonParams = JsonCompat.consumeProperty(json, Constants.PROP_PARAMETERS);
        if (_jsonParams != null) {
            JsonCompat.keys(_jsonParams).forEach((function (components, _jsonParams) {
                return function (key) {
                    var jsonValue = JsonCompat.consumeProperty(_jsonParams, key);
                    var value = _this.nodeFactory.createParameter(node, key);
                    _this.readAaiParameter(jsonValue, value);
                    components.addParameter(key, value);
                };
            })(components, _jsonParams));
        }
        var _jsonCorrelationIds = JsonCompat.consumeProperty(json, Constants.PROP_CORRELATION_IDS);
        if (_jsonCorrelationIds != null) {
            JsonCompat.keys(_jsonCorrelationIds).forEach((function (_jsonCorrelationIds, components) {
                return function (key) {
                    var jsonValue = JsonCompat.consumeProperty(_jsonCorrelationIds, key);
                    var value = _this.nodeFactory.createCorrelationId(node, key);
                    _this.readCorrelationId(jsonValue, value);
                    components.addCorrelationId(key, value);
                };
            })(_jsonCorrelationIds, components));
        }
        var _jsonOpTraits = JsonCompat.consumeProperty(json, Constants.PROP_OPERATION_TRAITS);
        if (_jsonOpTraits != null) {
            JsonCompat.keys(_jsonOpTraits).forEach((function (components, _jsonOpTraits) {
                return function (key) {
                    var jsonValue = JsonCompat.consumeProperty(_jsonOpTraits, key);
                    var traitDef = _this.nodeFactory.createOperationTraitDefinition(node, key);
                    _this.readOperationTrait(jsonValue, traitDef);
                    components.addOperationTraitDefinition(key, traitDef);
                };
            })(components, _jsonOpTraits));
        }
        var _jsonMessageTraits = JsonCompat.consumeProperty(json, Constants.PROP_MESSAGE_TRAITS);
        if (_jsonMessageTraits != null) {
            JsonCompat.keys(_jsonMessageTraits).forEach((function (components, _jsonMessageTraits) {
                return function (key) {
                    var jsonValue = JsonCompat.consumeProperty(_jsonMessageTraits, key);
                    var traitDef = _this.nodeFactory.createMessageTraitDefinition(node, key);
                    _this.readMessageTrait(jsonValue, traitDef);
                    components.addMessageTraitDefinition(key, traitDef);
                };
            })(components, _jsonMessageTraits));
        }
        var _jsonServerBindings = JsonCompat.consumeProperty(json, Constants.PROP_SERVER_BINDINGS);
        if (_jsonServerBindings != null) {
            JsonCompat.keys(_jsonServerBindings).forEach((function (components, _jsonServerBindings) {
                return function (key) {
                    var jsonValue = JsonCompat.consumeProperty(_jsonServerBindings, key);
                    var bindingsDef = _this.nodeFactory.createServerBindingsDefinition(node, key);
                    _this.readServerBindings(jsonValue, bindingsDef);
                    components.addServerBindingDefinition(key, bindingsDef);
                };
            })(components, _jsonServerBindings));
        }
        var _jsonChannelBindings = JsonCompat.consumeProperty(json, Constants.PROP_CHANNEL_BINDINGS);
        if (_jsonChannelBindings != null) {
            JsonCompat.keys(_jsonChannelBindings).forEach((function (_jsonChannelBindings, components) {
                return function (key) {
                    var jsonValue = JsonCompat.consumeProperty(_jsonChannelBindings, key);
                    var bindingsDef = _this.nodeFactory.createChannelBindingsDefinition(node, key);
                    _this.readChannelBindings(jsonValue, bindingsDef);
                    components.addChannelBindingDefinition(key, bindingsDef);
                };
            })(_jsonChannelBindings, components));
        }
        var _jsonOpBindings = JsonCompat.consumeProperty(json, Constants.PROP_OPERATION_BINDINGS);
        if (_jsonOpBindings != null) {
            JsonCompat.keys(_jsonOpBindings).forEach((function (_jsonOpBindings, components) {
                return function (key) {
                    var jsonValue = JsonCompat.consumeProperty(_jsonOpBindings, key);
                    var bindingsDef = _this.nodeFactory.createOperationBindingsDefinition(node, key);
                    _this.readOperationBindings(jsonValue, bindingsDef);
                    components.addOperationBindingDefinition(key, bindingsDef);
                };
            })(_jsonOpBindings, components));
        }
        var _jsonMessageBindings = JsonCompat.consumeProperty(json, Constants.PROP_MESSAGE_BINDINGS);
        if (_jsonMessageBindings != null) {
            JsonCompat.keys(_jsonMessageBindings).forEach((function (components, _jsonMessageBindings) {
                return function (key) {
                    var jsonValue = JsonCompat.consumeProperty(_jsonMessageBindings, key);
                    var bindingsDef = _this.nodeFactory.createMessageBindingsDefinition(node, key);
                    _this.readMessageBindings(jsonValue, bindingsDef);
                    components.addMessageBindingDefinition(key, bindingsDef);
                };
            })(components, _jsonMessageBindings));
        }
        this.readExtensions(json, node);
        this.readExtraProperties(json, node);
    };
    /**
     *
     * @param {*} json
     * @param {SecurityScheme} node
     */
    AaiDataModelReader.prototype.readSecurityScheme = function (json, node) {
        var aaiNode = node;
        aaiNode.$ref = JsonCompat.consumePropertyString(json, Constants.PROP_$REF);
        aaiNode.scheme = JsonCompat.consumePropertyString(json, Constants.PROP_SCHEME);
        var jsonFlows = JsonCompat.consumeProperty(json, Constants.PROP_FLOWS);
        if (jsonFlows != null) {
            var value = this.nodeFactory.createOAuthFlows(node);
            this.readOAuthFlows(jsonFlows, value);
            aaiNode.flows = value;
        }
        aaiNode.openIdConnectUrl = JsonCompat.consumePropertyString(json, Constants.PROP_OPEN_ID_CONNECT_URL);
        aaiNode.bearerFormat = JsonCompat.consumePropertyString(json, Constants.PROP_BEARER_FORMAT);
        _super.prototype.readSecurityScheme.call(this, json, aaiNode);
    };
    /**
     *
     * @param {*} json
     * @param {OAuthFlows} node
     */
    AaiDataModelReader.prototype.readOAuthFlows = function (json, node) {
        _super.prototype.readOAuthFlows.call(this, json, node);
    };
    /**
     * Reads a channel bindings model.
     * @param {*} json
     * @param {AaiChannelBindings} node
     */
    AaiDataModelReader.prototype.readChannelBindings = function (json, node) {
        node.http = JsonCompat.consumeProperty(json, Constants.PROP_HTTP);
        node.ws = JsonCompat.consumeProperty(json, Constants.PROP_WS);
        node.kafka = JsonCompat.consumeProperty(json, Constants.PROP_KAFKA);
        node.amqp = JsonCompat.consumeProperty(json, Constants.PROP_AMQP);
        node.amqp1 = JsonCompat.consumeProperty(json, Constants.PROP_AMQP1);
        node.mqtt = JsonCompat.consumeProperty(json, Constants.PROP_MQTT);
        node.mqtt5 = JsonCompat.consumeProperty(json, Constants.PROP_MQTT5);
        node.nats = JsonCompat.consumeProperty(json, Constants.PROP_NATS);
        node.jms = JsonCompat.consumeProperty(json, Constants.PROP_JMS);
        node.sns = JsonCompat.consumeProperty(json, Constants.PROP_SNS);
        node.sqs = JsonCompat.consumeProperty(json, Constants.PROP_SQS);
        node.stomp = JsonCompat.consumeProperty(json, Constants.PROP_STOMP);
        node.redis = JsonCompat.consumeProperty(json, Constants.PROP_REDIS);
        this.readExtraProperties(json, node);
    };
    /**
     * Reads a message bindings model.
     * @param {*} json
     * @param {AaiMessageBindings} node
     */
    AaiDataModelReader.prototype.readMessageBindings = function (json, node) {
        node.http = JsonCompat.consumeProperty(json, Constants.PROP_HTTP);
        node.ws = JsonCompat.consumeProperty(json, Constants.PROP_WS);
        node.kafka = JsonCompat.consumeProperty(json, Constants.PROP_KAFKA);
        node.amqp = JsonCompat.consumeProperty(json, Constants.PROP_AMQP);
        node.amqp1 = JsonCompat.consumeProperty(json, Constants.PROP_AMQP1);
        node.mqtt = JsonCompat.consumeProperty(json, Constants.PROP_MQTT);
        node.mqtt5 = JsonCompat.consumeProperty(json, Constants.PROP_MQTT5);
        node.nats = JsonCompat.consumeProperty(json, Constants.PROP_NATS);
        node.jms = JsonCompat.consumeProperty(json, Constants.PROP_JMS);
        node.sns = JsonCompat.consumeProperty(json, Constants.PROP_SNS);
        node.sqs = JsonCompat.consumeProperty(json, Constants.PROP_SQS);
        node.stomp = JsonCompat.consumeProperty(json, Constants.PROP_STOMP);
        node.redis = JsonCompat.consumeProperty(json, Constants.PROP_REDIS);
        this.readExtraProperties(json, node);
    };
    /**
     * Reads a operation bindings model.
     * @param {*} json
     * @param {AaiOperationBindings} node
     */
    AaiDataModelReader.prototype.readOperationBindings = function (json, node) {
        node.http = JsonCompat.consumeProperty(json, Constants.PROP_HTTP);
        node.ws = JsonCompat.consumeProperty(json, Constants.PROP_WS);
        node.kafka = JsonCompat.consumeProperty(json, Constants.PROP_KAFKA);
        node.amqp = JsonCompat.consumeProperty(json, Constants.PROP_AMQP);
        node.amqp1 = JsonCompat.consumeProperty(json, Constants.PROP_AMQP1);
        node.mqtt = JsonCompat.consumeProperty(json, Constants.PROP_MQTT);
        node.mqtt5 = JsonCompat.consumeProperty(json, Constants.PROP_MQTT5);
        node.nats = JsonCompat.consumeProperty(json, Constants.PROP_NATS);
        node.jms = JsonCompat.consumeProperty(json, Constants.PROP_JMS);
        node.sns = JsonCompat.consumeProperty(json, Constants.PROP_SNS);
        node.sqs = JsonCompat.consumeProperty(json, Constants.PROP_SQS);
        node.stomp = JsonCompat.consumeProperty(json, Constants.PROP_STOMP);
        node.redis = JsonCompat.consumeProperty(json, Constants.PROP_REDIS);
        this.readExtraProperties(json, node);
    };
    /**
     * Reads a server bindings model.
     * @param {*} json
     * @param {AaiServerBindings} node
     */
    AaiDataModelReader.prototype.readServerBindings = function (json, node) {
        node.http = JsonCompat.consumeProperty(json, Constants.PROP_HTTP);
        node.ws = JsonCompat.consumeProperty(json, Constants.PROP_WS);
        node.kafka = JsonCompat.consumeProperty(json, Constants.PROP_KAFKA);
        node.amqp = JsonCompat.consumeProperty(json, Constants.PROP_AMQP);
        node.amqp1 = JsonCompat.consumeProperty(json, Constants.PROP_AMQP1);
        node.mqtt = JsonCompat.consumeProperty(json, Constants.PROP_MQTT);
        node.mqtt5 = JsonCompat.consumeProperty(json, Constants.PROP_MQTT5);
        node.nats = JsonCompat.consumeProperty(json, Constants.PROP_NATS);
        node.jms = JsonCompat.consumeProperty(json, Constants.PROP_JMS);
        node.sns = JsonCompat.consumeProperty(json, Constants.PROP_SNS);
        node.sqs = JsonCompat.consumeProperty(json, Constants.PROP_SQS);
        node.stomp = JsonCompat.consumeProperty(json, Constants.PROP_STOMP);
        node.redis = JsonCompat.consumeProperty(json, Constants.PROP_REDIS);
        this.readExtraProperties(json, node);
    };
    return AaiDataModelReader;
}(DataModelReader));
export { AaiDataModelReader };
AaiDataModelReader["__class"] = "io.apicurio.datamodels.asyncapi.io.AaiDataModelReader";
//# sourceMappingURL=AaiDataModelReader.js.map