import { Aai20Document } from '../../asyncapi/v2/models/Aai20Document';
import { DocumentType } from '../models/DocumentType';
import { Oas20Document } from '../../openapi/v2/models/Oas20Document';
import { Oas30Document } from '../../openapi/v3/models/Oas30Document';
/**
 * Factory used to create documents.
 * @author eric.wittmann@gmail.com
 * @class
 */
var DocumentFactory = /** @class */ (function () {
    function DocumentFactory() {
    }
    DocumentFactory.create = function (type) {
        switch ((type)) {
            case DocumentType.asyncapi2:
                {
                    var doc = new Aai20Document();
                    doc.asyncapi = "2.0.0";
                    return doc;
                }
                ;
            case DocumentType.openapi2:
                {
                    var doc = new Oas20Document();
                    return doc;
                }
                ;
            case DocumentType.openapi3:
                {
                    var doc = new Oas30Document();
                    doc.openapi = "3.0.2";
                    return doc;
                }
                ;
            default:
                throw Object.defineProperty(new Error("Failed to create a Document for type: " + type), '__classes', { configurable: true, value: ['java.lang.Throwable', 'java.lang.Object', 'java.lang.RuntimeException', 'java.lang.Exception'] });
        }
    };
    return DocumentFactory;
}());
export { DocumentFactory };
DocumentFactory["__class"] = "io.apicurio.datamodels.core.factories.DocumentFactory";
//# sourceMappingURL=DocumentFactory.js.map