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 { OasSchema } from '../../models/OasSchema';
/**
 * Models an OpenAPI 3.0.x schema.
 * @author eric.wittmann@gmail.com
 * @class
 * @extends OasSchema
 */
var Oas30Schema = /** @class */ (function (_super) {
    __extends(Oas30Schema, _super);
    function Oas30Schema() {
        var _this = _super.call(this) || this;
        if (_this.oneOf === undefined)
            _this.oneOf = null;
        if (_this.anyOf === undefined)
            _this.anyOf = null;
        if (_this.not === undefined)
            _this.not = null;
        if (_this.discriminator === undefined)
            _this.discriminator = null;
        if (_this.nullable === undefined)
            _this.nullable = null;
        if (_this.writeOnly === undefined)
            _this.writeOnly = null;
        if (_this.deprecated === undefined)
            _this.deprecated = null;
        return _this;
    }
    /**
     * Creates a child Discriminator model.
     * @return {Oas30Discriminator} {Oas30Discriminator}
     */
    Oas30Schema.prototype.createDiscriminator = function () {
        var rval = new Oas30Discriminator();
        rval._ownerDocument = this.ownerDocument();
        rval._parent = this;
        return rval;
    };
    /**
     * @see io.apicurio.datamodels.openapi.models.OasSchema#createExternalDocumentation()
     * @return {ExternalDocumentation}
     */
    Oas30Schema.prototype.createExternalDocumentation = function () {
        var rval = new Oas30ExternalDocumentation();
        rval._ownerDocument = this.ownerDocument();
        rval._parent = this;
        return rval;
    };
    /**
     * @see io.apicurio.datamodels.openapi.models.OasSchema#createXML()
     * @return {OasXML}
     */
    Oas30Schema.prototype.createXML = function () {
        var rval = new Oas30XML();
        rval._ownerDocument = this.ownerDocument();
        rval._parent = this;
        return rval;
    };
    /**
     * @see io.apicurio.datamodels.openapi.models.OasSchema#createAllOfSchema()
     * @return {OasSchema}
     */
    Oas30Schema.prototype.createAllOfSchema = function () {
        var rval = new Oas30Schema.Oas30AllOfSchema();
        rval._ownerDocument = this.ownerDocument();
        rval._parent = this;
        return rval;
    };
    /**
     * @see io.apicurio.datamodels.openapi.models.OasSchema#createItemsSchema()
     * @return {OasSchema}
     */
    Oas30Schema.prototype.createItemsSchema = function () {
        var rval = new Oas30Schema.Oas30ItemsSchema();
        rval._ownerDocument = this.ownerDocument();
        rval._parent = this;
        return rval;
    };
    /**
     * @see io.apicurio.datamodels.openapi.models.OasSchema#createAdditionalPropertiesSchema()
     * @return {OasSchema}
     */
    Oas30Schema.prototype.createAdditionalPropertiesSchema = function () {
        var rval = new Oas30Schema.Oas30AdditionalPropertiesSchema();
        rval._ownerDocument = this.ownerDocument();
        rval._parent = this;
        return rval;
    };
    /**
     * @see io.apicurio.datamodels.openapi.models.OasSchema#createPropertySchema(java.lang.String)
     * @param {string} propertyName
     * @return {OasSchema}
     */
    Oas30Schema.prototype.createPropertySchema = function (propertyName) {
        var rval = new Oas30Schema.Oas30PropertySchema(propertyName);
        rval._ownerDocument = this.ownerDocument();
        rval._parent = this;
        return rval;
    };
    /**
     * Creates a child schema model.
     * @return {Oas30Schema.Oas30OneOfSchema}
     */
    Oas30Schema.prototype.createOneOfSchema = function () {
        var rval = new Oas30Schema.Oas30OneOfSchema();
        rval._ownerDocument = this.ownerDocument();
        rval._parent = this;
        return rval;
    };
    /**
     * Creates a child schema model.
     * @return {Oas30Schema.Oas30AnyOfSchema}
     */
    Oas30Schema.prototype.createAnyOfSchema = function () {
        var rval = new Oas30Schema.Oas30AnyOfSchema();
        rval._ownerDocument = this.ownerDocument();
        rval._parent = this;
        return rval;
    };
    /**
     * Creates a child schema model.
     * @return {Oas30Schema.Oas30NotSchema}
     */
    Oas30Schema.prototype.createNotSchema = function () {
        var rval = new Oas30Schema.Oas30NotSchema();
        rval._ownerDocument = this.ownerDocument();
        rval._parent = this;
        return rval;
    };
    /**
     * Adds a OneOf schema.
     * @param {Oas30Schema.Oas30OneOfSchema} schema
     */
    Oas30Schema.prototype.addOneOfSchema = function (schema) {
        if (this.oneOf == null) {
            this.oneOf = ([]);
        }
        /* add */ (this.oneOf.push(schema) > 0);
    };
    /**
     * Adds an AnyOf schema.
     * @param {Oas30Schema.Oas30AnyOfSchema} schema
     */
    Oas30Schema.prototype.addAnyOfSchema = function (schema) {
        if (this.anyOf == null) {
            this.anyOf = ([]);
        }
        /* add */ (this.anyOf.push(schema) > 0);
    };
    /**
     * Removes a oneOf schema.
     * @param {Oas30Schema.Oas30OneOfSchema} schema
     */
    Oas30Schema.prototype.removeOneOfSchema = function (schema) {
        if (this.oneOf != null) {
            /* remove */ (function (a) { var index = a.indexOf(schema); if (index >= 0) {
                a.splice(index, 1);
                return true;
            }
            else {
                return false;
            } })(this.oneOf);
        }
    };
    /**
     * Removes a anyOf schema.
     * @param {Oas30Schema.Oas30AnyOfSchema} schema
     */
    Oas30Schema.prototype.removeAnyOfSchema = function (schema) {
        if (this.anyOf != null) {
            /* remove */ (function (a) { var index = a.indexOf(schema); if (index >= 0) {
                a.splice(index, 1);
                return true;
            }
            else {
                return false;
            } })(this.anyOf);
        }
    };
    return Oas30Schema;
}(OasSchema));
export { Oas30Schema };
Oas30Schema["__class"] = "io.apicurio.datamodels.openapi.v3.models.Oas30Schema";
Oas30Schema["__interfaces"] = ["io.apicurio.datamodels.core.models.IVisitable", "io.apicurio.datamodels.core.models.IReferenceNode", "io.apicurio.datamodels.core.models.common.IExternalDocumentationParent"];
(function (Oas30Schema) {
    var Oas30AdditionalPropertiesSchema = /** @class */ (function (_super) {
        __extends(Oas30AdditionalPropertiesSchema, _super);
        function Oas30AdditionalPropertiesSchema() {
            return _super.call(this) || this;
        }
        /**
         * @see io.apicurio.datamodels.core.models.common.Schema#accept(io.apicurio.datamodels.core.visitors.IVisitor)
         * @param {*} visitor
         */
        Oas30AdditionalPropertiesSchema.prototype.accept = function (visitor) {
            var viz = visitor;
            viz.visitAdditionalPropertiesSchema(this);
        };
        return Oas30AdditionalPropertiesSchema;
    }(Oas30Schema));
    Oas30Schema.Oas30AdditionalPropertiesSchema = Oas30AdditionalPropertiesSchema;
    Oas30AdditionalPropertiesSchema["__class"] = "io.apicurio.datamodels.openapi.v3.models.Oas30Schema.Oas30AdditionalPropertiesSchema";
    Oas30AdditionalPropertiesSchema["__interfaces"] = ["io.apicurio.datamodels.core.models.IVisitable", "io.apicurio.datamodels.core.models.IReferenceNode", "io.apicurio.datamodels.core.models.common.IExternalDocumentationParent"];
    var Oas30ItemsSchema = /** @class */ (function (_super) {
        __extends(Oas30ItemsSchema, _super);
        function Oas30ItemsSchema() {
            return _super.call(this) || this;
        }
        /**
         * @see io.apicurio.datamodels.core.models.common.Schema#accept(io.apicurio.datamodels.core.visitors.IVisitor)
         * @param {*} visitor
         */
        Oas30ItemsSchema.prototype.accept = function (visitor) {
            var viz = visitor;
            viz.visitItemsSchema(this);
        };
        return Oas30ItemsSchema;
    }(Oas30Schema));
    Oas30Schema.Oas30ItemsSchema = Oas30ItemsSchema;
    Oas30ItemsSchema["__class"] = "io.apicurio.datamodels.openapi.v3.models.Oas30Schema.Oas30ItemsSchema";
    Oas30ItemsSchema["__interfaces"] = ["io.apicurio.datamodels.core.models.IVisitable", "io.apicurio.datamodels.core.models.IReferenceNode", "io.apicurio.datamodels.core.models.common.IExternalDocumentationParent"];
    var Oas30AllOfSchema = /** @class */ (function (_super) {
        __extends(Oas30AllOfSchema, _super);
        function Oas30AllOfSchema() {
            return _super.call(this) || this;
        }
        /**
         * @see io.apicurio.datamodels.core.models.common.Schema#accept(io.apicurio.datamodels.core.visitors.IVisitor)
         * @param {*} visitor
         */
        Oas30AllOfSchema.prototype.accept = function (visitor) {
            var viz = visitor;
            viz.visitAllOfSchema(this);
        };
        return Oas30AllOfSchema;
    }(Oas30Schema));
    Oas30Schema.Oas30AllOfSchema = Oas30AllOfSchema;
    Oas30AllOfSchema["__class"] = "io.apicurio.datamodels.openapi.v3.models.Oas30Schema.Oas30AllOfSchema";
    Oas30AllOfSchema["__interfaces"] = ["io.apicurio.datamodels.core.models.IVisitable", "io.apicurio.datamodels.core.models.IReferenceNode", "io.apicurio.datamodels.core.models.common.IExternalDocumentationParent"];
    var Oas30NotSchema = /** @class */ (function (_super) {
        __extends(Oas30NotSchema, _super);
        function Oas30NotSchema() {
            return _super.call(this) || this;
        }
        /**
         * @see io.apicurio.datamodels.core.models.common.Schema#accept(io.apicurio.datamodels.core.visitors.IVisitor)
         * @param {*} visitor
         */
        Oas30NotSchema.prototype.accept = function (visitor) {
            var viz = visitor;
            viz.visitNotSchema(this);
        };
        return Oas30NotSchema;
    }(Oas30Schema));
    Oas30Schema.Oas30NotSchema = Oas30NotSchema;
    Oas30NotSchema["__class"] = "io.apicurio.datamodels.openapi.v3.models.Oas30Schema.Oas30NotSchema";
    Oas30NotSchema["__interfaces"] = ["io.apicurio.datamodels.core.models.IVisitable", "io.apicurio.datamodels.core.models.IReferenceNode", "io.apicurio.datamodels.core.models.common.IExternalDocumentationParent"];
    var Oas30OneOfSchema = /** @class */ (function (_super) {
        __extends(Oas30OneOfSchema, _super);
        function Oas30OneOfSchema() {
            return _super.call(this) || this;
        }
        /**
         * @see io.apicurio.datamodels.core.models.common.Schema#accept(io.apicurio.datamodels.core.visitors.IVisitor)
         * @param {*} visitor
         */
        Oas30OneOfSchema.prototype.accept = function (visitor) {
            var viz = visitor;
            viz.visitOneOfSchema(this);
        };
        return Oas30OneOfSchema;
    }(Oas30Schema));
    Oas30Schema.Oas30OneOfSchema = Oas30OneOfSchema;
    Oas30OneOfSchema["__class"] = "io.apicurio.datamodels.openapi.v3.models.Oas30Schema.Oas30OneOfSchema";
    Oas30OneOfSchema["__interfaces"] = ["io.apicurio.datamodels.core.models.IVisitable", "io.apicurio.datamodels.core.models.IReferenceNode", "io.apicurio.datamodels.core.models.common.IExternalDocumentationParent"];
    var Oas30AnyOfSchema = /** @class */ (function (_super) {
        __extends(Oas30AnyOfSchema, _super);
        function Oas30AnyOfSchema() {
            return _super.call(this) || this;
        }
        /**
         * @see io.apicurio.datamodels.core.models.common.Schema#accept(io.apicurio.datamodels.core.visitors.IVisitor)
         * @param {*} visitor
         */
        Oas30AnyOfSchema.prototype.accept = function (visitor) {
            var viz = visitor;
            viz.visitAnyOfSchema(this);
        };
        return Oas30AnyOfSchema;
    }(Oas30Schema));
    Oas30Schema.Oas30AnyOfSchema = Oas30AnyOfSchema;
    Oas30AnyOfSchema["__class"] = "io.apicurio.datamodels.openapi.v3.models.Oas30Schema.Oas30AnyOfSchema";
    Oas30AnyOfSchema["__interfaces"] = ["io.apicurio.datamodels.core.models.IVisitable", "io.apicurio.datamodels.core.models.IReferenceNode", "io.apicurio.datamodels.core.models.common.IExternalDocumentationParent"];
    /**
     * Constructor.
     * @param {string} propertyName
     * @class
     * @extends Oas30Schema
     */
    var Oas30PropertySchema = /** @class */ (function (_super) {
        __extends(Oas30PropertySchema, _super);
        function Oas30PropertySchema(propertyName) {
            var _this = _super.call(this) || this;
            if (_this._propertyName === undefined)
                _this._propertyName = null;
            _this._propertyName = propertyName;
            return _this;
        }
        /**
         * @see io.apicurio.datamodels.openapi.models.IOasPropertySchema#getPropertyName()
         * @return {string}
         */
        Oas30PropertySchema.prototype.getPropertyName = function () {
            return this._propertyName;
        };
        /**
         *
         * @return {string}
         */
        Oas30PropertySchema.prototype.getName = function () {
            return this._propertyName;
        };
        /**
         * @see io.apicurio.datamodels.openapi.models.IOasPropertySchema#rename(java.lang.String)
         * @param {string} newName
         */
        Oas30PropertySchema.prototype.rename = function (newName) {
            this._propertyName = newName;
        };
        /**
         * @see io.apicurio.datamodels.core.models.common.Schema#accept(io.apicurio.datamodels.core.visitors.IVisitor)
         * @param {*} visitor
         */
        Oas30PropertySchema.prototype.accept = function (visitor) {
            var viz = visitor;
            viz.visitPropertySchema(this);
        };
        return Oas30PropertySchema;
    }(Oas30Schema));
    Oas30Schema.Oas30PropertySchema = Oas30PropertySchema;
    Oas30PropertySchema["__class"] = "io.apicurio.datamodels.openapi.v3.models.Oas30Schema.Oas30PropertySchema";
    Oas30PropertySchema["__interfaces"] = ["io.apicurio.datamodels.openapi.models.IOasPropertySchema", "io.apicurio.datamodels.core.models.IVisitable", "io.apicurio.datamodels.core.models.IReferenceNode", "io.apicurio.datamodels.core.models.common.INamed", "io.apicurio.datamodels.core.models.common.IExternalDocumentationParent"];
})(Oas30Schema || (Oas30Schema = {}));
import { Oas30XML } from './Oas30XML';
import { Oas30ExternalDocumentation } from './Oas30ExternalDocumentation';
import { Oas30Discriminator } from './Oas30Discriminator';
//# sourceMappingURL=Oas30Schema.js.map