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 __());
    };
})();
/* Generated from Java with JSweet 2.3.7 - http://www.jsweet.org */
import { Document } from '../../core/models/Document';
import { DocumentType } from '../../core/models/DocumentType';
/**
 * Models an OpenAPI document.
 * @author eric.wittmann@gmail.com
 * @class
 * @extends Document
 */
var OasDocument = /** @class */ (function (_super) {
    __extends(OasDocument, _super);
    function OasDocument() {
        var _this = _super.call(this) || this;
        if (_this.paths === undefined)
            _this.paths = null;
        if (_this.security === undefined)
            _this.security = null;
        return _this;
    }
    /**
     * @see io.apicurio.datamodels.core.models.common.ISecurityRequirementParent#addSecurityRequirement(io.apicurio.datamodels.core.models.common.SecurityRequirement)
     * @param {SecurityRequirement} securityRequirement
     * @return {SecurityRequirement}
     */
    OasDocument.prototype.addSecurityRequirement = function (securityRequirement) {
        if (this.security == null) {
            this.security = ([]);
        }
        /* add */ (this.security.push(securityRequirement) > 0);
        return securityRequirement;
    };
    /**
     * @see io.apicurio.datamodels.core.models.common.ISecurityRequirementParent#getSecurityRequirements()
     * @return {SecurityRequirement[]}
     */
    OasDocument.prototype.getSecurityRequirements = function () {
        return this.security;
    };
    /**
     * Returns true if the document is an OpenAPI/Swagger 2.0 document.
     * @return {boolean}
     */
    OasDocument.prototype.is2xDocument = function () {
        return this.getDocumentType() === DocumentType.openapi2;
    };
    /**
     * Returns true if the document is an OpenAPI 3.x document.
     * @return {boolean}
     */
    OasDocument.prototype.is3xDocument = function () {
        return this.getDocumentType() === DocumentType.openapi3;
    };
    return OasDocument;
}(Document));
export { OasDocument };
OasDocument["__class"] = "io.apicurio.datamodels.openapi.models.OasDocument";
OasDocument["__interfaces"] = ["io.apicurio.datamodels.core.models.common.ISecurityRequirementParent", "io.apicurio.datamodels.core.models.IVisitable", "io.apicurio.datamodels.core.models.common.IExternalDocumentationParent"];
//# sourceMappingURL=OasDocument.js.map