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 { OasTraverser } from '../../visitors/OasTraverser';
/**
 * Constructor.
 * @param {*} visitor
 * @class
 * @extends OasTraverser
 * @author eric.wittmann@gmail.com
 */
var Oas30Traverser = /** @class */ (function (_super) {
    __extends(Oas30Traverser, _super);
    function Oas30Traverser(visitor) {
        return _super.call(this, visitor) || this;
    }
    /**
     * @see io.apicurio.datamodels.openapi.visitors.OasTraverser#traverseDocument(io.apicurio.datamodels.core.models.Document)
     * @param {Document} node
     */
    Oas30Traverser.prototype.traverseDocument = function (node) {
        var doc = node;
        _super.prototype.traverseDocument.call(this, doc);
        this.traverseCollection(doc.servers);
        this.traverseIfNotNull(doc.components);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.Traverser#traverseParameter(io.apicurio.datamodels.core.models.common.Parameter)
     * @param {Parameter} node
     */
    Oas30Traverser.prototype.traverseParameter = function (node) {
        _super.prototype.traverseParameter.call(this, node);
        var param = node;
        this.traverseCollection(param.getExamples());
        this.traverseCollection(param.getMediaTypes());
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.OasTraverser#traverseResponse(io.apicurio.datamodels.openapi.models.OasResponse)
     * @param {OasResponse} node
     */
    Oas30Traverser.prototype.traverseResponse = function (node) {
        _super.prototype.traverseResponse.call(this, node);
        var response = node;
        this.traverseCollection(response.getHeaders());
        this.traverseCollection(response.getMediaTypes());
        this.traverseCollection(response.getLinks());
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.OasTraverser#traverseSchema(io.apicurio.datamodels.core.models.common.Schema)
     * @param {Schema} node
     */
    Oas30Traverser.prototype.traverseSchema = function (node) {
        _super.prototype.traverseSchema.call(this, node);
        var schema = node;
        this.traverseCollection(schema.oneOf);
        this.traverseCollection(schema.anyOf);
        this.traverseIfNotNull(schema.not);
        this.traverseIfNotNull(schema.discriminator);
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.OasTraverser#traverseOperation(io.apicurio.datamodels.core.models.common.Operation)
     * @param {Operation} node
     */
    Oas30Traverser.prototype.traverseOperation = function (node) {
        _super.prototype.traverseOperation.call(this, node);
        var op = node;
        this.traverseIfNotNull(op.requestBody);
        this.traverseCollection(op.getCallbacks());
        this.traverseCollection(op.servers);
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.OasTraverser#traverseHeader(io.apicurio.datamodels.openapi.models.OasHeader)
     * @param {OasHeader} node
     */
    Oas30Traverser.prototype.traverseHeader = function (node) {
        _super.prototype.traverseHeader.call(this, node);
        var header = node;
        this.traverseIfNotNull(header.schema);
        this.traverseCollection(header.getExamples());
        this.traverseCollection(header.getMediaTypes());
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitComponents(io.apicurio.datamodels.core.models.common.Components)
     * @param {Components} node
     */
    Oas30Traverser.prototype.visitComponents = function (node) {
        var components = node;
        node.accept(this.visitor);
        this.traverseCollection(components.getSchemaDefinitions());
        this.traverseCollection(components.getResponseDefinitions());
        this.traverseCollection(components.getParameterDefinitions());
        this.traverseCollection(components.getExampleDefinitions());
        this.traverseCollection(components.getRequestBodyDefinitions());
        this.traverseCollection(components.getHeaderDefinitions());
        this.traverseCollection(components.getSecuritySchemes());
        this.traverseCollection(components.getLinkDefinitions());
        this.traverseCollection(components.getCallbackDefinitions());
        this.traverseExtensions(node);
        this.traverseValidationProblems(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.OasTraverser#traversePathItem(io.apicurio.datamodels.openapi.models.OasPathItem)
     * @param {OasPathItem} node
     */
    Oas30Traverser.prototype.traversePathItem = function (node) {
        _super.prototype.traversePathItem.call(this, node);
        var pathItem = node;
        this.traverseIfNotNull(pathItem.trace);
        this.traverseCollection(pathItem.servers);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitCallbackPathItem(io.apicurio.datamodels.openapi.v3.models.Oas30CallbackPathItem)
     * @param {Oas30CallbackPathItem} node
     */
    Oas30Traverser.prototype.visitCallbackPathItem = function (node) {
        this.visitPathItem(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitCallback(io.apicurio.datamodels.openapi.v3.models.Oas30Callback)
     * @param {Oas30Callback} node
     */
    Oas30Traverser.prototype.visitCallback = function (node) {
        node.accept(this.visitor);
        this.traverseIndexedNode(node);
        this.traverseExtensions(node);
        this.traverseValidationProblems(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitLinkServer(io.apicurio.datamodels.openapi.v3.models.Oas30LinkServer)
     * @param {Oas30LinkServer} node
     */
    Oas30Traverser.prototype.visitLinkServer = function (node) {
        this.visitServer(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitCallbackDefinition(io.apicurio.datamodels.openapi.v3.models.Oas30CallbackDefinition)
     * @param {Oas30CallbackDefinition} node
     */
    Oas30Traverser.prototype.visitCallbackDefinition = function (node) {
        this.visitCallback(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitLink(io.apicurio.datamodels.openapi.v3.models.Oas30Link)
     * @param {Oas30Link} node
     */
    Oas30Traverser.prototype.visitLink = function (node) {
        node.accept(this.visitor);
        this.traverseCollection(node.getLinkParameterExpressions());
        this.traverseIfNotNull(node.requestBody);
        this.traverseIfNotNull(node.server);
        this.traverseExtensions(node);
        this.traverseValidationProblems(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitLinkRequestBodyExpression(io.apicurio.datamodels.openapi.v3.models.Oas30LinkRequestBodyExpression)
     * @param {Oas30LinkRequestBodyExpression} node
     */
    Oas30Traverser.prototype.visitLinkRequestBodyExpression = function (node) {
        node.accept(this.visitor);
        this.traverseValidationProblems(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitLinkParameterExpression(io.apicurio.datamodels.openapi.v3.models.Oas30LinkParameterExpression)
     * @param {Oas30LinkParameterExpression} node
     */
    Oas30Traverser.prototype.visitLinkParameterExpression = function (node) {
        node.accept(this.visitor);
        this.traverseValidationProblems(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitLinkDefinition(io.apicurio.datamodels.openapi.v3.models.Oas30LinkDefinition)
     * @param {Oas30LinkDefinition} node
     */
    Oas30Traverser.prototype.visitLinkDefinition = function (node) {
        this.visitLink(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitAuthorizationCodeOAuthFlow(io.apicurio.datamodels.core.models.common.AuthorizationCodeOAuthFlow)
     * @param {AuthorizationCodeOAuthFlow} node
     */
    Oas30Traverser.prototype.visitAuthorizationCodeOAuthFlow = function (node) {
        this.traverseOAuthFlow(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitClientCredentialsOAuthFlow(io.apicurio.datamodels.core.models.common.ClientCredentialsOAuthFlow)
     * @param {ClientCredentialsOAuthFlow} node
     */
    Oas30Traverser.prototype.visitClientCredentialsOAuthFlow = function (node) {
        this.traverseOAuthFlow(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitPasswordOAuthFlow(io.apicurio.datamodels.core.models.common.PasswordOAuthFlow)
     * @param {PasswordOAuthFlow} node
     */
    Oas30Traverser.prototype.visitPasswordOAuthFlow = function (node) {
        this.traverseOAuthFlow(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitImplicitOAuthFlow(io.apicurio.datamodels.core.models.common.ImplicitOAuthFlow)
     * @param {ImplicitOAuthFlow} node
     */
    Oas30Traverser.prototype.visitImplicitOAuthFlow = function (node) {
        this.traverseOAuthFlow(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitOAuthFlows(io.apicurio.datamodels.core.models.common.OAuthFlows)
     * @param {OAuthFlows} node
     */
    Oas30Traverser.prototype.visitOAuthFlows = function (node) {
        this.traverseOAuthFlows(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitExample(io.apicurio.datamodels.core.models.common.IExample)
     * @param {*} node
     */
    Oas30Traverser.prototype.visitExample = function (node) {
        var example30 = node;
        node.accept(this.visitor);
        this.traverseExtensions(example30);
        this.traverseValidationProblems(example30);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitEncoding(io.apicurio.datamodels.openapi.v3.models.Oas30Encoding)
     * @param {Oas30Encoding} node
     */
    Oas30Traverser.prototype.visitEncoding = function (node) {
        node.accept(this.visitor);
        this.traverseCollection(node.getHeaders());
        this.traverseExtensions(node);
        this.traverseValidationProblems(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitMediaType(io.apicurio.datamodels.openapi.v3.models.Oas30MediaType)
     * @param {Oas30MediaType} node
     */
    Oas30Traverser.prototype.visitMediaType = function (node) {
        node.accept(this.visitor);
        this.traverseIfNotNull(node.schema);
        this.traverseCollection(node.getExamples());
        this.traverseCollection(node.getEncodings());
        this.traverseExtensions(node);
        this.traverseValidationProblems(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitHeaderDefinition(io.apicurio.datamodels.openapi.v3.models.Oas30HeaderDefinition)
     * @param {Oas30HeaderDefinition} node
     */
    Oas30Traverser.prototype.visitHeaderDefinition = function (node) {
        this.visitHeader(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitRequestBody(io.apicurio.datamodels.openapi.v3.models.Oas30RequestBody)
     * @param {Oas30RequestBody} node
     */
    Oas30Traverser.prototype.visitRequestBody = function (node) {
        node.accept(this.visitor);
        this.traverseCollection(node.getMediaTypes());
        this.traverseExtensions(node);
        this.traverseValidationProblems(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitRequestBodyDefinition(io.apicurio.datamodels.openapi.v3.models.Oas30RequestBodyDefinition)
     * @param {Oas30RequestBodyDefinition} node
     */
    Oas30Traverser.prototype.visitRequestBodyDefinition = function (node) {
        this.visitRequestBody(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitExampleDefinition(io.apicurio.datamodels.openapi.v3.models.Oas30ExampleDefinition)
     * @param {Oas30ExampleDefinition} node
     */
    Oas30Traverser.prototype.visitExampleDefinition = function (node) {
        this.visitExample(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitDiscriminator(io.apicurio.datamodels.openapi.v3.models.Oas30Discriminator)
     * @param {Oas30Discriminator} node
     */
    Oas30Traverser.prototype.visitDiscriminator = function (node) {
        node.accept(this.visitor);
        this.traverseValidationProblems(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitNotSchema(io.apicurio.datamodels.openapi.v3.models.Oas30Schema.Oas30NotSchema)
     * @param {Oas30Schema.Oas30NotSchema} node
     */
    Oas30Traverser.prototype.visitNotSchema = function (node) {
        this.visitSchema(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitOneOfSchema(io.apicurio.datamodels.openapi.v3.models.Oas30Schema.Oas30OneOfSchema)
     * @param {Oas30Schema.Oas30OneOfSchema} node
     */
    Oas30Traverser.prototype.visitOneOfSchema = function (node) {
        this.visitSchema(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitAnyOfSchema(io.apicurio.datamodels.openapi.v3.models.Oas30Schema.Oas30AnyOfSchema)
     * @param {Oas30Schema.Oas30AnyOfSchema} node
     */
    Oas30Traverser.prototype.visitAnyOfSchema = function (node) {
        this.visitSchema(node);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.Traverser#traverseSecurityScheme(io.apicurio.datamodels.core.models.common.SecurityScheme)
     * @param {SecurityScheme} node
     */
    Oas30Traverser.prototype.traverseSecurityScheme = function (node) {
        _super.prototype.traverseSecurityScheme.call(this, node);
        var scheme = node;
        this.traverseIfNotNull(scheme.flows);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitServer(io.apicurio.datamodels.core.models.common.Server)
     * @param {Server} node
     */
    Oas30Traverser.prototype.visitServer = function (node) {
        node.accept(this.visitor);
        this.traverseCollection(node.getServerVariables());
        this.traverseExtensions(node);
        this.traverseValidationProblems(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitServerVariable(io.apicurio.datamodels.core.models.common.ServerVariable)
     * @param {ServerVariable} node
     */
    Oas30Traverser.prototype.visitServerVariable = function (node) {
        node.accept(this.visitor);
        this.traverseExtensions(node);
        this.traverseValidationProblems(node);
    };
    return Oas30Traverser;
}(OasTraverser));
export { Oas30Traverser };
Oas30Traverser["__class"] = "io.apicurio.datamodels.openapi.v3.visitors.Oas30Traverser";
Oas30Traverser["__interfaces"] = ["io.apicurio.datamodels.core.visitors.IVisitor", "io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor", "io.apicurio.datamodels.core.visitors.ITraverser", "io.apicurio.datamodels.openapi.visitors.IOasVisitor"];
//# sourceMappingURL=Oas30Traverser.js.map