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 { ModelClonerVisitor } from './ModelClonerVisitor';
/**
 * TODO: create model factories for OpenAPI (already exists for AsyncAPI) to make this easier
 *
 * @author eric.wittmann@gmail.com
 * @class
 * @extends ModelClonerVisitor
 */
var Oas30ModelClonerVisitor = /** @class */ (function (_super) {
    __extends(Oas30ModelClonerVisitor, _super);
    function Oas30ModelClonerVisitor() {
        return _super.call(this) || this;
    }
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitPaths(io.apicurio.datamodels.openapi.models.OasPaths)
     * @param {OasPaths} node
     */
    Oas30ModelClonerVisitor.prototype.visitPaths = function (node) {
        this.__clone = node.ownerDocument().createPaths();
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitPathItem(io.apicurio.datamodels.openapi.models.OasPathItem)
     * @param {OasPathItem} node
     */
    Oas30ModelClonerVisitor.prototype.visitPathItem = function (node) {
        this.__clone = node.ownerDocument().createPaths().createPathItem(node.getPath());
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitResponse(io.apicurio.datamodels.openapi.models.OasResponse)
     * @param {OasResponse} node
     */
    Oas30ModelClonerVisitor.prototype.visitResponse = function (node) {
        this.__clone = node.ownerDocument().createPaths().createPathItem("").createOperation(null).createResponses().createResponse(node.getStatusCode());
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitResponses(io.apicurio.datamodels.openapi.models.OasResponses)
     * @param {OasResponses} node
     */
    Oas30ModelClonerVisitor.prototype.visitResponses = function (node) {
        this.__clone = node.ownerDocument().createPaths().createPathItem("").createOperation(null).createResponses();
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitXML(io.apicurio.datamodels.openapi.models.OasXML)
     * @param {OasXML} node
     */
    Oas30ModelClonerVisitor.prototype.visitXML = function (node) {
        this.__clone = node.ownerDocument().createPaths().createPathItem("").createOperation(null).createParameter().createSchema().createXML();
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitAllOfSchema(io.apicurio.datamodels.openapi.models.OasSchema)
     * @param {OasSchema} node
     */
    Oas30ModelClonerVisitor.prototype.visitAllOfSchema = function (node) {
        this.__clone = node.createAllOfSchema();
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitItemsSchema(io.apicurio.datamodels.openapi.models.OasSchema)
     * @param {OasSchema} node
     */
    Oas30ModelClonerVisitor.prototype.visitItemsSchema = function (node) {
        this.__clone = node.ownerDocument().createPaths().createPathItem("").createOperation(null).createParameter().createSchema().createItemsSchema();
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitAdditionalPropertiesSchema(io.apicurio.datamodels.openapi.models.OasSchema)
     * @param {OasSchema} node
     */
    Oas30ModelClonerVisitor.prototype.visitAdditionalPropertiesSchema = function (node) {
        this.__clone = node.ownerDocument().createPaths().createPathItem("").createOperation(null).createParameter().createSchema().createAdditionalPropertiesSchema();
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitPropertySchema(io.apicurio.datamodels.openapi.models.IOasPropertySchema)
     * @param {*} node
     */
    Oas30ModelClonerVisitor.prototype.visitPropertySchema = function (node) {
        this.__clone = node.ownerDocument().createPaths().createPathItem("").createOperation(null).createParameter().createSchema().createPropertySchema(node.getPropertyName());
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitHeader(io.apicurio.datamodels.openapi.models.OasHeader)
     * @param {OasHeader} node
     */
    Oas30ModelClonerVisitor.prototype.visitHeader = function (node) {
        this.__clone = node.ownerDocument().createPaths().createPathItem("").createOperation(null).createResponses().createDefaultResponse().createHeader(node.getName());
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitResponseDefinition(io.apicurio.datamodels.core.models.common.IDefinition)
     * @param {*} node
     */
    Oas30ModelClonerVisitor.prototype.visitResponseDefinition = function (node) {
        this.__clone = node.ownerDocument().createComponents().createResponseDefinition(node.getName());
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitExample(io.apicurio.datamodels.core.models.common.IExample)
     * @param {*} node
     */
    Oas30ModelClonerVisitor.prototype.visitExample = function (node) {
        this.__clone = (node.ownerDocument().createComponents().createParameterDefinition("").createExample(node.getName()));
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitOperation(io.apicurio.datamodels.core.models.common.Operation)
     * @param {Operation} node
     */
    Oas30ModelClonerVisitor.prototype.visitOperation = function (node) {
        this.__clone = node.ownerDocument().createPaths().createPathItem("").createOperation(node.getType());
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitParameterDefinition(io.apicurio.datamodels.core.models.common.IDefinition)
     * @param {*} node
     */
    Oas30ModelClonerVisitor.prototype.visitParameterDefinition = function (node) {
        this.__clone = node.ownerDocument().createComponents().createParameterDefinition(node.getName());
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitParameter(io.apicurio.datamodels.core.models.common.Parameter)
     * @param {Parameter} node
     */
    Oas30ModelClonerVisitor.prototype.visitParameter = function (node) {
        this.__clone = node.ownerDocument().createPaths().createPathItem("").createParameter();
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitSchemaDefinition(io.apicurio.datamodels.core.models.common.IDefinition)
     * @param {*} node
     */
    Oas30ModelClonerVisitor.prototype.visitSchemaDefinition = function (node) {
        this.__clone = node.ownerDocument().createComponents().createSchemaDefinition(node.getName());
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitSchema(io.apicurio.datamodels.core.models.common.Schema)
     * @param {Schema} node
     */
    Oas30ModelClonerVisitor.prototype.visitSchema = function (node) {
        this.__clone = node.ownerDocument().createPaths().createPathItem("").createParameter().createSchema();
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitSecurityRequirement(io.apicurio.datamodels.core.models.common.SecurityRequirement)
     * @param {SecurityRequirement} node
     */
    Oas30ModelClonerVisitor.prototype.visitSecurityRequirement = function (node) {
        this.__clone = node.ownerDocument().createSecurityRequirement();
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitSecurityScheme(io.apicurio.datamodels.core.models.common.SecurityScheme)
     * @param {SecurityScheme} node
     */
    Oas30ModelClonerVisitor.prototype.visitSecurityScheme = function (node) {
        this.__clone = node.ownerDocument().createComponents().createSecurityScheme(node.getName());
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitComponents(io.apicurio.datamodels.core.models.common.Components)
     * @param {Components} node
     */
    Oas30ModelClonerVisitor.prototype.visitComponents = function (node) {
        this.__clone = node.ownerDocument().createComponents();
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitCallbackPathItem(io.apicurio.datamodels.openapi.v3.models.Oas30CallbackPathItem)
     * @param {Oas30CallbackPathItem} node
     */
    Oas30ModelClonerVisitor.prototype.visitCallbackPathItem = function (node) {
        this.__clone = node.ownerDocument().createComponents().createCallbackDefinition("").createPathItem(node.getPath());
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitCallback(io.apicurio.datamodels.openapi.v3.models.Oas30Callback)
     * @param {Oas30Callback} node
     */
    Oas30ModelClonerVisitor.prototype.visitCallback = function (node) {
        this.__clone = (node.ownerDocument()).createPaths().createPathItem("/").createOperation("GET").createCallback(node.getName());
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitLinkServer(io.apicurio.datamodels.openapi.v3.models.Oas30LinkServer)
     * @param {Oas30LinkServer} node
     */
    Oas30ModelClonerVisitor.prototype.visitLinkServer = function (node) {
        this.__clone = node.ownerDocument().createComponents().createLinkDefinition("").createServer();
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitCallbackDefinition(io.apicurio.datamodels.openapi.v3.models.Oas30CallbackDefinition)
     * @param {Oas30CallbackDefinition} node
     */
    Oas30ModelClonerVisitor.prototype.visitCallbackDefinition = function (node) {
        this.__clone = node.ownerDocument().createComponents().createCallbackDefinition(node.getName());
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitLink(io.apicurio.datamodels.openapi.v3.models.Oas30Link)
     * @param {Oas30Link} node
     */
    Oas30ModelClonerVisitor.prototype.visitLink = function (node) {
        this.__clone = node.ownerDocument().createComponents().createResponseDefinition("").createLink(node.getName());
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitLinkRequestBodyExpression(io.apicurio.datamodels.openapi.v3.models.Oas30LinkRequestBodyExpression)
     * @param {Oas30LinkRequestBodyExpression} node
     */
    Oas30ModelClonerVisitor.prototype.visitLinkRequestBodyExpression = function (node) {
        this.__clone = node.ownerDocument().createComponents().createLinkDefinition("").createLinkRequestBodyExpression(node.getValue());
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitLinkParameterExpression(io.apicurio.datamodels.openapi.v3.models.Oas30LinkParameterExpression)
     * @param {Oas30LinkParameterExpression} node
     */
    Oas30ModelClonerVisitor.prototype.visitLinkParameterExpression = function (node) {
        this.__clone = node.ownerDocument().createComponents().createLinkDefinition("").createLinkParameterExpression(node.getName(), node.getValue());
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitLinkDefinition(io.apicurio.datamodels.openapi.v3.models.Oas30LinkDefinition)
     * @param {Oas30LinkDefinition} node
     */
    Oas30ModelClonerVisitor.prototype.visitLinkDefinition = function (node) {
        this.__clone = node.ownerDocument().createComponents().createLinkDefinition(node.getName());
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitAuthorizationCodeOAuthFlow(io.apicurio.datamodels.core.models.common.AuthorizationCodeOAuthFlow)
     * @param {AuthorizationCodeOAuthFlow} node
     */
    Oas30ModelClonerVisitor.prototype.visitAuthorizationCodeOAuthFlow = function (node) {
        this.__clone = node.ownerDocument().createComponents().createSecurityScheme("").createOAuthFlows().createAuthorizationCodeOAuthFlow();
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitClientCredentialsOAuthFlow(io.apicurio.datamodels.core.models.common.ClientCredentialsOAuthFlow)
     * @param {ClientCredentialsOAuthFlow} node
     */
    Oas30ModelClonerVisitor.prototype.visitClientCredentialsOAuthFlow = function (node) {
        this.__clone = node.ownerDocument().createComponents().createSecurityScheme("").createOAuthFlows().createClientCredentialsOAuthFlow();
    };
    /**
     *
     * @param {PasswordOAuthFlow} node
     */
    Oas30ModelClonerVisitor.prototype.visitPasswordOAuthFlow = function (node) {
        this.__clone = node.ownerDocument().createComponents().createSecurityScheme("").createOAuthFlows().createPasswordOAuthFlow();
    };
    /**
     *
     * @param {ImplicitOAuthFlow} node
     */
    Oas30ModelClonerVisitor.prototype.visitImplicitOAuthFlow = function (node) {
        this.__clone = node.ownerDocument().createComponents().createSecurityScheme("").createOAuthFlows().createImplicitOAuthFlow();
    };
    /**
     *
     * @param {OAuthFlows} node
     */
    Oas30ModelClonerVisitor.prototype.visitOAuthFlows = function (node) {
        this.__clone = node.ownerDocument().createComponents().createSecurityScheme("").createOAuthFlows();
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitEncoding(io.apicurio.datamodels.openapi.v3.models.Oas30Encoding)
     * @param {Oas30Encoding} node
     */
    Oas30ModelClonerVisitor.prototype.visitEncoding = function (node) {
        this.__clone = node.ownerDocument().createComponents().createRequestBodyDefinition("").createMediaType("").createEncoding(node.getName());
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitMediaType(io.apicurio.datamodels.openapi.v3.models.Oas30MediaType)
     * @param {Oas30MediaType} node
     */
    Oas30ModelClonerVisitor.prototype.visitMediaType = function (node) {
        this.__clone = node.ownerDocument().createComponents().createRequestBodyDefinition("").createMediaType(node.getName());
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitHeaderDefinition(io.apicurio.datamodels.openapi.v3.models.Oas30HeaderDefinition)
     * @param {Oas30HeaderDefinition} node
     */
    Oas30ModelClonerVisitor.prototype.visitHeaderDefinition = function (node) {
        this.__clone = node.ownerDocument().createComponents().createHeaderDefinition(node.getName());
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitRequestBody(io.apicurio.datamodels.openapi.v3.models.Oas30RequestBody)
     * @param {Oas30RequestBody} node
     */
    Oas30ModelClonerVisitor.prototype.visitRequestBody = function (node) {
        this.__clone = node.ownerDocument().createPaths().createPathItem("").createOperation("GET").createRequestBody();
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitRequestBodyDefinition(io.apicurio.datamodels.openapi.v3.models.Oas30RequestBodyDefinition)
     * @param {Oas30RequestBodyDefinition} node
     */
    Oas30ModelClonerVisitor.prototype.visitRequestBodyDefinition = function (node) {
        this.__clone = node.ownerDocument().createComponents().createRequestBodyDefinition(node.getName());
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitExampleDefinition(io.apicurio.datamodels.openapi.v3.models.Oas30ExampleDefinition)
     * @param {Oas30ExampleDefinition} node
     */
    Oas30ModelClonerVisitor.prototype.visitExampleDefinition = function (node) {
        this.__clone = node.ownerDocument().createComponents().createExampleDefinition(node.getName());
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitDiscriminator(io.apicurio.datamodels.openapi.v3.models.Oas30Discriminator)
     * @param {Oas30Discriminator} node
     */
    Oas30ModelClonerVisitor.prototype.visitDiscriminator = function (node) {
        this.__clone = node.ownerDocument().createComponents().createSchemaDefinition("").createDiscriminator();
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitNotSchema(io.apicurio.datamodels.openapi.v3.models.Oas30Schema.Oas30NotSchema)
     * @param {Oas30Schema.Oas30NotSchema} node
     */
    Oas30ModelClonerVisitor.prototype.visitNotSchema = function (node) {
        this.__clone = node.ownerDocument().createComponents().createSchemaDefinition("").createNotSchema();
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitOneOfSchema(io.apicurio.datamodels.openapi.v3.models.Oas30Schema.Oas30OneOfSchema)
     * @param {Oas30Schema.Oas30OneOfSchema} node
     */
    Oas30ModelClonerVisitor.prototype.visitOneOfSchema = function (node) {
        this.__clone = node.ownerDocument().createComponents().createSchemaDefinition("").createOneOfSchema();
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitAnyOfSchema(io.apicurio.datamodels.openapi.v3.models.Oas30Schema.Oas30AnyOfSchema)
     * @param {Oas30Schema.Oas30AnyOfSchema} node
     */
    Oas30ModelClonerVisitor.prototype.visitAnyOfSchema = function (node) {
        this.__clone = node.ownerDocument().createComponents().createSchemaDefinition("").createAnyOfSchema();
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitServer(io.apicurio.datamodels.core.models.common.Server)
     * @param {Server} node
     */
    Oas30ModelClonerVisitor.prototype.visitServer = function (node) {
        this.__clone = node.ownerDocument().createServer();
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor#visitServerVariable(io.apicurio.datamodels.core.models.common.ServerVariable)
     * @param {ServerVariable} node
     */
    Oas30ModelClonerVisitor.prototype.visitServerVariable = function (node) {
        this.__clone = node.ownerDocument().createServer().createServerVariable(node.getName());
    };
    return Oas30ModelClonerVisitor;
}(ModelClonerVisitor));
export { Oas30ModelClonerVisitor };
Oas30ModelClonerVisitor["__class"] = "io.apicurio.datamodels.cloning.Oas30ModelClonerVisitor";
Oas30ModelClonerVisitor["__interfaces"] = ["io.apicurio.datamodels.core.visitors.IVisitor", "io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor", "io.apicurio.datamodels.openapi.visitors.IOasVisitor"];
//# sourceMappingURL=Oas30ModelClonerVisitor.js.map