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';
/**
 * @author eric.wittmann@gmail.com
 * @class
 * @extends ModelClonerVisitor
 */
var Oas20ModelClonerVisitor = /** @class */ (function (_super) {
    __extends(Oas20ModelClonerVisitor, _super);
    function Oas20ModelClonerVisitor() {
        return _super.call(this) || this;
    }
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitPaths(io.apicurio.datamodels.openapi.models.OasPaths)
     * @param {OasPaths} node
     */
    Oas20ModelClonerVisitor.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
     */
    Oas20ModelClonerVisitor.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
     */
    Oas20ModelClonerVisitor.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
     */
    Oas20ModelClonerVisitor.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
     */
    Oas20ModelClonerVisitor.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
     */
    Oas20ModelClonerVisitor.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
     */
    Oas20ModelClonerVisitor.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
     */
    Oas20ModelClonerVisitor.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
     */
    Oas20ModelClonerVisitor.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
     */
    Oas20ModelClonerVisitor.prototype.visitHeader = function (node) {
        this.__clone = node.ownerDocument().createPaths().createPathItem("").createOperation(null).createResponses().createDefaultResponse().createHeaders().createHeader(node.getName());
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitResponseDefinition(io.apicurio.datamodels.core.models.common.IDefinition)
     * @param {*} node
     */
    Oas20ModelClonerVisitor.prototype.visitResponseDefinition = function (node) {
        this.__clone = node.ownerDocument().createResponseDefinitions().createResponse(node.getName());
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitExample(io.apicurio.datamodels.core.models.common.IExample)
     * @param {*} node
     */
    Oas20ModelClonerVisitor.prototype.visitExample = function (node) {
        this.__clone = node.ownerDocument().createResponseDefinitions().createResponse("").createExample();
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitOperation(io.apicurio.datamodels.core.models.common.Operation)
     * @param {Operation} node
     */
    Oas20ModelClonerVisitor.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
     */
    Oas20ModelClonerVisitor.prototype.visitParameterDefinition = function (node) {
        this.__clone = node.ownerDocument().createParameterDefinitions().createParameter(node.getName());
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitParameter(io.apicurio.datamodels.core.models.common.Parameter)
     * @param {Parameter} node
     */
    Oas20ModelClonerVisitor.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
     */
    Oas20ModelClonerVisitor.prototype.visitSchemaDefinition = function (node) {
        this.__clone = node.ownerDocument().createDefinitions().createSchemaDefinition(node.getName());
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitSchema(io.apicurio.datamodels.core.models.common.Schema)
     * @param {Schema} node
     */
    Oas20ModelClonerVisitor.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
     */
    Oas20ModelClonerVisitor.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
     */
    Oas20ModelClonerVisitor.prototype.visitSecurityScheme = function (node) {
        this.__clone = node.ownerDocument().createSecurityDefinitions().createSecurityScheme(node.getName());
    };
    /**
     * @see io.apicurio.datamodels.openapi.v2.visitors.IOas20Visitor#visitItems(io.apicurio.datamodels.openapi.v2.models.Oas20Items)
     * @param {Oas20Items} node
     */
    Oas20ModelClonerVisitor.prototype.visitItems = function (node) {
        this.__clone = node.ownerDocument().createDefinitions().createSchemaDefinition("").createItemsSchema();
    };
    /**
     * @see io.apicurio.datamodels.openapi.v2.visitors.IOas20Visitor#visitScopes(io.apicurio.datamodels.openapi.v2.models.Oas20Scopes)
     * @param {Oas20Scopes} node
     */
    Oas20ModelClonerVisitor.prototype.visitScopes = function (node) {
        this.__clone = node.ownerDocument().createSecurityDefinitions().createSecurityScheme("").createScopes();
    };
    /**
     * @see io.apicurio.datamodels.openapi.v2.visitors.IOas20Visitor#visitSecurityDefinitions(io.apicurio.datamodels.openapi.v2.models.Oas20SecurityDefinitions)
     * @param {Oas20SecurityDefinitions} node
     */
    Oas20ModelClonerVisitor.prototype.visitSecurityDefinitions = function (node) {
        this.__clone = node.ownerDocument().createSecurityDefinitions();
    };
    /**
     * @see io.apicurio.datamodels.openapi.v2.visitors.IOas20Visitor#visitDefinitions(io.apicurio.datamodels.openapi.v2.models.Oas20Definitions)
     * @param {Oas20Definitions} node
     */
    Oas20ModelClonerVisitor.prototype.visitDefinitions = function (node) {
        this.__clone = node.ownerDocument().createDefinitions();
    };
    /**
     * @see io.apicurio.datamodels.openapi.v2.visitors.IOas20Visitor#visitParameterDefinitions(io.apicurio.datamodels.openapi.v2.models.Oas20ParameterDefinitions)
     * @param {Oas20ParameterDefinitions} node
     */
    Oas20ModelClonerVisitor.prototype.visitParameterDefinitions = function (node) {
        this.__clone = node.ownerDocument().createParameterDefinitions();
    };
    /**
     * @see io.apicurio.datamodels.openapi.v2.visitors.IOas20Visitor#visitHeaders(io.apicurio.datamodels.openapi.v2.models.Oas20Headers)
     * @param {Oas20Headers} node
     */
    Oas20ModelClonerVisitor.prototype.visitHeaders = function (node) {
        this.__clone = node.ownerDocument().createResponseDefinitions().createResponse("").createHeaders();
    };
    /**
     * @see io.apicurio.datamodels.openapi.v2.visitors.IOas20Visitor#visitResponseDefinitions(io.apicurio.datamodels.openapi.v2.models.Oas20ResponseDefinitions)
     * @param {Oas20ResponseDefinitions} node
     */
    Oas20ModelClonerVisitor.prototype.visitResponseDefinitions = function (node) {
        this.__clone = node.ownerDocument().createResponseDefinitions();
    };
    return Oas20ModelClonerVisitor;
}(ModelClonerVisitor));
export { Oas20ModelClonerVisitor };
Oas20ModelClonerVisitor["__class"] = "io.apicurio.datamodels.cloning.Oas20ModelClonerVisitor";
Oas20ModelClonerVisitor["__interfaces"] = ["io.apicurio.datamodels.core.visitors.IVisitor", "io.apicurio.datamodels.openapi.v2.visitors.IOas20Visitor", "io.apicurio.datamodels.openapi.visitors.IOasVisitor"];
//# sourceMappingURL=Oas20ModelClonerVisitor.js.map