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 { Traverser } from '../../core/visitors/Traverser';
/**
 * An AsyncAPI traverser implementation.
 *
 * @author eric.wittmann@gmail.com
 * @author Jakub Senko <jsenko@redhat.com>
 * @param {*} visitor
 * @class
 * @extends Traverser
 */
var AaiTraverser = /** @class */ (function (_super) {
    __extends(AaiTraverser, _super);
    function AaiTraverser(visitor) {
        return _super.call(this, visitor) || this;
    }
    /**
     *
     * @param {Document} node
     */
    AaiTraverser.prototype.traverseDocument = function (node) {
        _super.prototype.traverseDocument.call(this, node);
        var aaiNode = node;
        this.traverseCollection(aaiNode.getChannels());
        this.traverseCollection(aaiNode.getServers());
        this.traverseIfNotNull(aaiNode.components);
    };
    /**
     *
     * @param {AuthorizationCodeOAuthFlow} node
     */
    AaiTraverser.prototype.visitAuthorizationCodeOAuthFlow = function (node) {
        this.traverseOAuthFlow(node);
    };
    /**
     *
     * @param {AaiChannelItem} node
     */
    AaiTraverser.prototype.visitChannelItem = function (node) {
        node.accept(this.visitor);
        this.traverseExtensions(node);
        this.traverseValidationProblems(node);
        this.traverseIfNotNull(node.subscribe);
        this.traverseIfNotNull(node.publish);
        this.traverseCollection(node.getParameterlist());
        this.traverseIfNotNull(node.bindings);
    };
    /**
     *
     * @param {ClientCredentialsOAuthFlow} node
     */
    AaiTraverser.prototype.visitClientCredentialsOAuthFlow = function (node) {
        this.traverseOAuthFlow(node);
    };
    /**
     *
     * @param {Components} node
     */
    AaiTraverser.prototype.visitComponents = function (node) {
        var components = node;
        node.accept(this.visitor);
        this.traverseExtensions(node);
        this.traverseValidationProblems(node);
        this.traverseCollection(components.getMessagesList());
        this.traverseCollection(components.getSecuritySchemesList());
        this.traverseCollection(components.getParametersList());
        this.traverseCollection(components.getCorrelationIdsList());
        this.traverseCollection(components.getMessageTraitDefinitionsList());
        this.traverseCollection(components.getOperationTraitDefinitionsList());
        this.traverseCollection(components.getServerBindingsDefinitionList());
        this.traverseCollection(components.getChannelBindingsDefinitionList());
        this.traverseCollection(components.getOperationBindingsDefinitionList());
        this.traverseCollection(components.getMessageBindingsDefinitionList());
    };
    /**
     *
     * @param {AaiCorrelationId} node
     */
    AaiTraverser.prototype.visitCorrelationId = function (node) {
        node.accept(this.visitor);
        this.traverseExtensions(node);
        this.traverseValidationProblems(node);
    };
    /**
     *
     * @param {AaiHeaderItem} node
     */
    AaiTraverser.prototype.visitHeaderItem = function (node) {
        node.accept(this.visitor);
        this.traverseExtensions(node);
        this.traverseValidationProblems(node);
    };
    /**
     *
     * @param {ImplicitOAuthFlow} node
     */
    AaiTraverser.prototype.visitImplicitOAuthFlow = function (node) {
        this.traverseOAuthFlow(node);
    };
    /**
     *
     * @param {AaiMessage} node
     */
    AaiTraverser.prototype.visitMessage = function (node) {
        this.traverseMessageBase(node);
        this.traverseCollection(node.oneOf);
        this.traverseCollection(node.traits);
    };
    /**
     *
     * @param {AaiMessageTrait} node
     */
    AaiTraverser.prototype.visitMessageTrait = function (node) {
        this.traverseMessageBase(node);
    };
    /**
     *
     * @param {AaiMessageTraitDefinition} node
     */
    AaiTraverser.prototype.visitMessageTraitDefinition = function (node) {
        this.visitMessageTrait(node);
    };
    /**
     *
     * @param {OAuthFlows} node
     */
    AaiTraverser.prototype.visitOAuthFlows = function (node) {
        node.accept(this.visitor);
        this.traverseExtensions(node);
        this.traverseValidationProblems(node);
        this.traverseIfNotNull(node.implicit);
        this.traverseIfNotNull(node.password);
        this.traverseIfNotNull(node.clientCredentials);
        this.traverseIfNotNull(node.authorizationCode);
    };
    /**
     *
     * @param {Operation} node
     */
    AaiTraverser.prototype.visitOperation = function (node) {
        node.accept(this.visitor);
        this.traverseExtensions(node);
        this.traverseValidationProblems(node);
        var aaiNode = node;
        this.traverseOperationBase(aaiNode);
        this.traverseCollection(aaiNode.traits);
        this.traverseIfNotNull(aaiNode.message);
    };
    /**
     *
     * @param {AaiOperationTrait} node
     */
    AaiTraverser.prototype.visitOperationTrait = function (node) {
        this.traverseOperationBase(node);
    };
    /**
     *
     * @param {AaiOperationTraitDefinition} node
     */
    AaiTraverser.prototype.visitOperationTraitDefinition = function (node) {
        this.visitOperationTrait(node);
    };
    /**
     *
     * @param {PasswordOAuthFlow} node
     */
    AaiTraverser.prototype.visitPasswordOAuthFlow = function (node) {
        this.traverseOAuthFlow(node);
    };
    /**
     *
     * @param {Server} node
     */
    AaiTraverser.prototype.visitServer = function (node) {
        node.accept(this.visitor);
        this.traverseExtensions(node);
        this.traverseValidationProblems(node);
        this.traverseCollection(node.getServerVariables());
        this.traverseCollection(node.security);
        this.traverseIfNotNull(node.bindings);
    };
    /**
     *
     * @param {ServerVariable} node
     */
    AaiTraverser.prototype.visitServerVariable = function (node) {
        node.accept(this.visitor);
        this.traverseExtensions(node);
        this.traverseValidationProblems(node);
    };
    /**
     *
     * @param {AaiParameter} node
     */
    AaiTraverser.prototype.visitAaiParameter = function (node) {
        node.accept(this.visitor);
        this.traverseExtensions(node);
        this.traverseValidationProblems(node);
    };
    AaiTraverser.prototype.traverseMessageBase = function (node) {
        node.accept(this.visitor);
        this.traverseExtensions(node);
        this.traverseValidationProblems(node);
        this.traverseIfNotNull(node.headers);
        this.traverseIfNotNull(node.correlationId);
        this.traverseCollection(node.tags);
        this.traverseIfNotNull(node.externalDocs);
        this.traverseIfNotNull(node.bindings);
    };
    AaiTraverser.prototype.traverseOperationBase = function (node) {
        node.accept(this.visitor);
        this.traverseOperation(node);
        this.traverseCollection(node.tags);
        this.traverseIfNotNull(node.bindings);
    };
    /**
     *
     * @param {SecurityScheme} node
     */
    AaiTraverser.prototype.traverseSecurityScheme = function (node) {
        _super.prototype.traverseSecurityScheme.call(this, node);
        var aaiNode = node;
        this.traverseIfNotNull(aaiNode.flows);
    };
    /**
     * @see io.apicurio.datamodels.asyncapi.visitors.IAaiVisitor#visitServerBindings(io.apicurio.datamodels.asyncapi.models.AaiServerBindings)
     * @param {AaiServerBindings} node
     */
    AaiTraverser.prototype.visitServerBindings = function (node) {
        node.accept(this.visitor);
        this.traverseValidationProblems(node);
    };
    /**
     * @see io.apicurio.datamodels.asyncapi.visitors.IAaiVisitor#visitServerBindingsDefinition(io.apicurio.datamodels.asyncapi.models.AaiServerBindingsDefinition)
     * @param {AaiServerBindingsDefinition} node
     */
    AaiTraverser.prototype.visitServerBindingsDefinition = function (node) {
        this.visitServerBindings(node);
    };
    /**
     * @see io.apicurio.datamodels.asyncapi.visitors.IAaiVisitor#visitOperationBindings(io.apicurio.datamodels.asyncapi.models.AaiOperationBindings)
     * @param {AaiOperationBindings} node
     */
    AaiTraverser.prototype.visitOperationBindings = function (node) {
        node.accept(this.visitor);
        this.traverseValidationProblems(node);
    };
    /**
     * @see io.apicurio.datamodels.asyncapi.visitors.IAaiVisitor#visitOperationBindingsDefinition(io.apicurio.datamodels.asyncapi.models.AaiOperationBindingsDefinition)
     * @param {AaiOperationBindingsDefinition} node
     */
    AaiTraverser.prototype.visitOperationBindingsDefinition = function (node) {
        this.visitOperationBindings(node);
    };
    /**
     * @see io.apicurio.datamodels.asyncapi.visitors.IAaiVisitor#visitMessageBindings(io.apicurio.datamodels.asyncapi.models.AaiMessageBindings)
     * @param {AaiMessageBindings} node
     */
    AaiTraverser.prototype.visitMessageBindings = function (node) {
        node.accept(this.visitor);
        this.traverseValidationProblems(node);
    };
    /**
     * @see io.apicurio.datamodels.asyncapi.visitors.IAaiVisitor#visitMessageBindingsDefinition(io.apicurio.datamodels.asyncapi.models.AaiMessageBindingsDefinition)
     * @param {AaiMessageBindingsDefinition} node
     */
    AaiTraverser.prototype.visitMessageBindingsDefinition = function (node) {
        this.visitMessageBindings(node);
    };
    /**
     * @see io.apicurio.datamodels.asyncapi.visitors.IAaiVisitor#visitChannelBindings(io.apicurio.datamodels.asyncapi.models.AaiChannelBindings)
     * @param {AaiChannelBindings} node
     */
    AaiTraverser.prototype.visitChannelBindings = function (node) {
        node.accept(this.visitor);
        this.traverseValidationProblems(node);
    };
    /**
     * @see io.apicurio.datamodels.asyncapi.visitors.IAaiVisitor#visitChannelBindingsDefinition(io.apicurio.datamodels.asyncapi.models.AaiChannelBindingsDefinition)
     * @param {AaiChannelBindingsDefinition} node
     */
    AaiTraverser.prototype.visitChannelBindingsDefinition = function (node) {
        this.visitChannelBindings(node);
    };
    return AaiTraverser;
}(Traverser));
export { AaiTraverser };
AaiTraverser["__class"] = "io.apicurio.datamodels.asyncapi.visitors.AaiTraverser";
AaiTraverser["__interfaces"] = ["io.apicurio.datamodels.core.visitors.IVisitor", "io.apicurio.datamodels.asyncapi.visitors.IAaiVisitor", "io.apicurio.datamodels.core.visitors.ITraverser"];
//# sourceMappingURL=AaiTraverser.js.map