import { Constants } from '../../core/Constants';
import { DocumentType } from '../../core/models/DocumentType';
/**
 * This factory is used to create an instance of {@link ICommand} given a "type" that was previously
 * serialized as part of the marshalling of a command to a JS object (and ultimately a JSON string).
 * The type of command is typically its short classname, but not always.
 * @author eric.wittmann@gmail.com
 * @class
 */
var CommandFactory = /** @class */ (function () {
    function CommandFactory() {
    }
    /**
     * Called to create a command of a given type.
     * @param {string} cmdType
     * @return {*}
     */
    CommandFactory.create = function (cmdType) {
        switch ((cmdType)) {
            case "AggregateCommand":
                {
                    return new AggregateCommand();
                }
                ;
            case "AddSchemaDefinitionCommand_20":
                {
                    return new AddSchemaDefinitionCommand_20();
                }
                ;
            case "AddSchemaDefinitionCommand_30":
                {
                    return new AddSchemaDefinitionCommand_30();
                }
                ;
            case "AddExampleCommand_30":
                {
                    return new AddExampleCommand_30();
                }
                ;
            case "AddParameterExampleCommand_30":
                {
                    return new AddParameterExampleCommand_30();
                }
                ;
            case "AddPathItemCommand":
            case "AddPathItemCommand_20":
            case "AddPathItemCommand_30":
                {
                    return new AddPathItemCommand();
                }
                ;
            case "AddSecurityRequirementCommand":
                {
                    return new AddSecurityRequirementCommand();
                }
                ;
            case "AddResponseDefinitionCommand_20":
                {
                    return new AddResponseDefinitionCommand_20();
                }
                ;
            case "AddResponseDefinitionCommand_30":
                {
                    return new AddResponseDefinitionCommand_30();
                }
                ;
            case "AddChildSchemaCommand":
                {
                    return new AddChildSchemaCommand();
                }
                ;
            case "ChangePropertyCommand_20":
            case "ChangePropertyCommand_30":
            case "ChangePropertyCommand":
                {
                    return (new ChangePropertyCommand());
                }
                ;
            case "ChangeDescriptionCommand_20":
            case "ChangeDescriptionCommand_30":
            case "ChangeDescriptionCommand":
                {
                    return new ChangeDescriptionCommand();
                }
                ;
            case "ChangeTitleCommand_20":
            case "ChangeTitleCommand_30":
            case "ChangeTitleCommand":
                {
                    return new ChangeTitleCommand();
                }
                ;
            case "ChangeVersionCommand_20":
            case "ChangeVersionCommand_30":
            case "ChangeVersionCommand":
                {
                    return new ChangeVersionCommand();
                }
                ;
            case "ChangeContactCommand_20":
            case "ChangeContactCommand_30":
            case "ChangeContactCommand":
                {
                    return new ChangeContactCommand();
                }
                ;
            case "ChangeLicenseCommand_20":
            case "ChangeLicenseCommand_30":
            case "ChangeLicenseCommand":
                {
                    return new ChangeLicenseCommand();
                }
                ;
            case "ChangeMediaTypeTypeCommand":
                {
                    return new ChangeMediaTypeTypeCommand();
                }
                ;
            case "ChangeParameterTypeCommand_20":
                {
                    return new ChangeParameterTypeCommand_20();
                }
                ;
            case "ChangeParameterDefinitionTypeCommand_20":
                {
                    return new ChangeParameterDefinitionTypeCommand_20();
                }
                ;
            case "ChangeParameterTypeCommand_30":
                {
                    return new ChangeParameterTypeCommand_30();
                }
                ;
            case "ChangeParameterDefinitionTypeCommand_30":
                {
                    return new ChangeParameterDefinitionTypeCommand_30();
                }
                ;
            case "ChangePropertyTypeCommand":
            case "ChangePropertyTypeCommand_20":
            case "ChangePropertyTypeCommand_30":
                {
                    return new ChangePropertyTypeCommand();
                }
                ;
            case "ChangeResponseTypeCommand":
            case "ChangeResponseTypeCommand_20":
            case "ChangeResponseDefinitionTypeCommand_20":
                {
                    return new ChangeResponseTypeCommand();
                }
                ;
            case "ChangeSecuritySchemeCommand_20":
                {
                    return new ChangeSecuritySchemeCommand_20();
                }
                ;
            case "ChangeSecuritySchemeCommand_30":
                {
                    return new ChangeSecuritySchemeCommand_30();
                }
                ;
            case "ChangeServerCommand":
                {
                    return new ChangeServerCommand();
                }
                ;
            case "ChangeSchemaTypeCommand":
                {
                    return new ChangeSchemaTypeCommand();
                }
                ;
            case "ChangeSchemaInheritanceCommand":
                {
                    return new ChangeSchemaInheritanceCommand();
                }
                ;
            case "DeleteContactCommand_20":
            case "DeleteContactCommand_30":
            case "DeleteContactCommand":
                {
                    return new DeleteContactCommand();
                }
                ;
            case "DeleteAllExamplesCommand_30":
            case "DeleteAllExamplesCommand":
                {
                    return new DeleteAllExamplesCommand();
                }
                ;
            case "DeleteAllParameterExamplesCommand_30":
            case "DeleteAllParameterExamplesCommand":
                {
                    return new DeleteAllParameterExamplesCommand();
                }
                ;
            case "DeleteAllOperationsCommand":
                {
                    return new DeleteAllOperationsCommand();
                }
                ;
            case "DeleteAllParametersCommand_20":
            case "DeleteAllParametersCommand_30":
            case "DeleteAllParametersCommand":
                {
                    return new DeleteAllParametersCommand();
                }
                ;
            case "DeleteAllPropertiesCommand_20":
            case "DeleteAllPropertiesCommand_30":
            case "DeleteAllPropertiesCommand":
                {
                    return new DeleteAllPropertiesCommand();
                }
                ;
            case "DeleteAllResponsesCommand_20":
            case "DeleteAllResponsesCommand_30":
            case "DeleteAllResponsesCommand":
                {
                    return new DeleteAllResponsesCommand();
                }
                ;
            case "DeleteAllSecurityRequirementsCommand":
                {
                    return new DeleteAllSecurityRequirementsCommand();
                }
                ;
            case "DeleteAllSecuritySchemesCommand":
                {
                    return new DeleteAllSecuritySchemesCommand();
                }
                ;
            case "DeleteAllServersCommand":
                {
                    return new DeleteAllServersCommand();
                }
                ;
            case "DeleteAllTagsCommand":
                {
                    return new DeleteAllTagsCommand();
                }
                ;
            case "DeleteAllChildSchemasCommand":
                {
                    return new DeleteAllChildSchemasCommand();
                }
                ;
            case "DeleteExampleCommand_20":
                {
                    return new DeleteExampleCommand_20();
                }
                ;
            case "DeleteExampleCommand_30":
                {
                    return new DeleteExampleCommand_30();
                }
                ;
            case "DeleteParameterExampleCommand_30":
                {
                    return new DeleteParameterExampleCommand_30();
                }
                ;
            case "DeleteExtensionCommand":
                {
                    return new DeleteExtensionCommand();
                }
                ;
            case "DeleteLicenseCommand":
            case "DeleteLicenseCommand_20":
            case "DeleteLicenseCommand_30":
                {
                    return new DeleteLicenseCommand();
                }
                ;
            case "DeleteMediaTypeCommand":
                {
                    return new DeleteMediaTypeCommand();
                }
                ;
            case "DeleteOperationCommand":
            case "DeleteOperationCommand_20":
            case "DeleteOperationCommand_30":
                {
                    return new DeleteOperationCommand();
                }
                ;
            case "DeleteParameterCommand":
            case "DeleteParameterCommand_20":
            case "DeleteParameterCommand_30":
                {
                    return new DeleteParameterCommand();
                }
                ;
            case "DeletePathCommand":
            case "DeletePathCommand_20":
            case "DeletePathCommand_30":
                {
                    return new DeletePathCommand();
                }
                ;
            case "DeletePropertyCommand":
            case "DeletePropertyCommand_20":
            case "DeletePropertyCommand_30":
                {
                    return new DeletePropertyCommand();
                }
                ;
            case "DeleteRequestBodyCommand":
            case "DeleteRequestBodyCommand_30":
                {
                    return new DeleteRequestBodyCommand();
                }
                ;
            case "DeleteResponseCommand":
            case "DeleteResponseCommand_20":
            case "DeleteResponseCommand_30":
                {
                    return new DeleteResponseCommand();
                }
                ;
            case "DeleteSchemaDefinitionCommand_20":
                {
                    return new DeleteSchemaDefinitionCommand_20();
                }
                ;
            case "DeleteSchemaDefinitionCommand_30":
                {
                    return new DeleteSchemaDefinitionCommand_30();
                }
                ;
            case "DeleteResponseDefinitionCommand_20":
                {
                    return new DeleteResponseDefinitionCommand_20();
                }
                ;
            case "DeleteResponseDefinitionCommand_30":
                {
                    return new DeleteResponseDefinitionCommand_30();
                }
                ;
            case "DeleteSecurityRequirementCommand":
                {
                    return new DeleteSecurityRequirementCommand();
                }
                ;
            case "DeleteSecuritySchemeCommand_20":
                {
                    return new DeleteSecuritySchemeCommand_20();
                }
                ;
            case "DeleteSecuritySchemeCommand_30":
                {
                    return new DeleteSecuritySchemeCommand_30();
                }
                ;
            case "DeleteServerCommand":
                {
                    return new DeleteServerCommand();
                }
                ;
            case "DeleteTagCommand":
            case "DeleteTagCommand_20":
            case "DeleteTagCommand_30":
                {
                    return new DeleteTagCommand();
                }
                ;
            case "DeleteChildSchemaCommand":
                {
                    return new DeleteChildSchemaCommand();
                }
                ;
            case "NewMediaTypeCommand":
                {
                    return new NewMediaTypeCommand();
                }
                ;
            case "NewOperationCommand":
            case "NewOperationCommand_20":
            case "NewOperationCommand_30":
                {
                    return new NewOperationCommand();
                }
                ;
            case "NewParamCommand":
            case "NewParamCommand_20":
            case "NewParamCommand_30":
                {
                    return new NewParamCommand();
                }
                ;
            case "NewPathCommand":
            case "NewPathCommand_20":
            case "NewPathCommand_30":
                {
                    return new NewPathCommand();
                }
                ;
            case "NewRequestBodyCommand_20":
                {
                    return new NewRequestBodyCommand_20();
                }
                ;
            case "NewRequestBodyCommand_30":
                {
                    return new NewRequestBodyCommand_30();
                }
                ;
            case "NewResponseCommand":
            case "NewResponseCommand_20":
            case "NewResponseCommand_30":
                {
                    return new NewResponseCommand();
                }
                ;
            case "NewSchemaDefinitionCommand_20":
                {
                    return new NewSchemaDefinitionCommand_20();
                }
                ;
            case "NewSchemaDefinitionCommand_30":
                {
                    return new NewSchemaDefinitionCommand_30();
                }
                ;
            case "NewSchemaPropertyCommand":
            case "NewSchemaPropertyCommand_20":
            case "NewSchemaPropertyCommand_30":
                {
                    return new NewSchemaPropertyCommand();
                }
                ;
            case "NewSecuritySchemeCommand_20":
                {
                    return new NewSecuritySchemeCommand_20();
                }
                ;
            case "NewSecuritySchemeCommand_30":
                {
                    return new NewSecuritySchemeCommand_30();
                }
                ;
            case "NewServerCommand":
                {
                    return new NewServerCommand();
                }
                ;
            case "NewTagCommand":
            case "NewTagCommand_20":
            case "NewTagCommand_30":
                {
                    return new NewTagCommand();
                }
                ;
            case "NewResponseDefinitionCommand_20":
                {
                    return new NewResponseDefinitionCommand_20();
                }
                ;
            case "NewResponseDefinitionCommand_30":
                {
                    return new NewResponseDefinitionCommand_30();
                }
                ;
            case "RenameParameterCommand":
                {
                    return new RenameParameterCommand();
                }
                ;
            case "RenamePathItemCommand":
                {
                    return new RenamePathItemCommand();
                }
                ;
            case "RenamePropertyCommand":
                {
                    return new RenamePropertyCommand();
                }
                ;
            case "RenameSchemaDefinitionCommand_20":
                {
                    return new RenameSchemaDefinitionCommand_20();
                }
                ;
            case "RenameSchemaDefinitionCommand_30":
                {
                    return new RenameSchemaDefinitionCommand_30();
                }
                ;
            case "RenameSecuritySchemeCommand":
                {
                    return new RenameSecuritySchemeCommand();
                }
                ;
            case "RenameTagDefinitionCommand":
                {
                    return new RenameTagDefinitionCommand();
                }
                ;
            case "RenameResponseDefinitionCommand_20":
                {
                    return new RenameResponseDefinitionCommand_20();
                }
                ;
            case "RenameResponseDefinitionCommand_30":
                {
                    return new RenameResponseDefinitionCommand_30();
                }
                ;
            case "ReplaceOperationCommand_20":
            case "ReplaceOperationCommand_30":
            case "ReplaceOperationCommand":
                {
                    return new ReplaceOperationCommand();
                }
                ;
            case "ReplaceDocumentCommand":
                {
                    return new ReplaceDocumentCommand();
                }
                ;
            case "ReplacePathItemCommand_20":
            case "ReplacePathItemCommand_30":
            case "ReplacePathItemCommand":
                {
                    return new ReplacePathItemCommand();
                }
                ;
            case "ReplaceSchemaDefinitionCommand_20":
                {
                    return new ReplaceSchemaDefinitionCommand_20();
                }
                ;
            case "ReplaceSchemaDefinitionCommand_30":
                {
                    return new ReplaceSchemaDefinitionCommand_30();
                }
                ;
            case "ReplaceSecurityRequirementCommand":
                {
                    return new ReplaceSecurityRequirementCommand();
                }
                ;
            case "ReplaceResponseDefinitionCommand_20":
                {
                    return new ReplaceResponseDefinitionCommand_20();
                }
                ;
            case "ReplaceResponseDefinitionCommand_30":
                {
                    return new ReplaceResponseDefinitionCommand_30();
                }
                ;
            case "SetPropertyCommand":
                {
                    return (new SetPropertyCommand());
                }
                ;
            case "SetExampleCommand_20":
                {
                    return new SetExampleCommand_20();
                }
                ;
            case "SetExampleCommand_30":
                {
                    return new SetExampleCommand_30();
                }
                ;
            case "SetParameterExampleCommand_30":
                {
                    return new SetParameterExampleCommand_30();
                }
                ;
            case "SetExtensionCommand":
                {
                    return new SetExtensionCommand();
                }
                ;
        }
        return null;
    };
    CommandFactory.createAggregateCommand = function (name, info, commands) {
        return new AggregateCommand(name, info, commands);
    };
    CommandFactory.createAddExampleCommand = function (mediaType, example, exampleName, exampleSummary, exampleDescription) {
        return new AddExampleCommand_30(mediaType, example, exampleName, exampleSummary, exampleDescription);
    };
    CommandFactory.createAddParameterExampleCommand = function (parameter, example, exampleName, exampleSummary, exampleDescription) {
        return new AddParameterExampleCommand_30(parameter, example, exampleName, exampleSummary, exampleDescription);
    };
    CommandFactory.createAddSchemaDefinitionCommand = function (docType, definitionName, from) {
        if (docType === DocumentType.openapi2) {
            return new AddSchemaDefinitionCommand_20(definitionName, from);
        }
        if (docType === DocumentType.openapi3) {
            return new AddSchemaDefinitionCommand_30(definitionName, from);
        }
        throw Object.defineProperty(new Error("Document type not supported by this command."), '__classes', { configurable: true, value: ['java.lang.Throwable', 'java.lang.Object', 'java.lang.RuntimeException', 'java.lang.Exception'] });
    };
    CommandFactory.createAddResponseDefinitionCommand = function (docType, definitionName, from) {
        if (docType === DocumentType.openapi2) {
            return new AddResponseDefinitionCommand_20(definitionName, from);
        }
        if (docType === DocumentType.openapi3) {
            return new AddResponseDefinitionCommand_30(definitionName, from);
        }
        throw Object.defineProperty(new Error("Document type not supported by this command."), '__classes', { configurable: true, value: ['java.lang.Throwable', 'java.lang.Object', 'java.lang.RuntimeException', 'java.lang.Exception'] });
    };
    CommandFactory.createAddPathItemCommand = function (pathItemName, from) {
        return new AddPathItemCommand(pathItemName, from);
    };
    CommandFactory.createAddSecurityRequirementCommand = function (parent, requirement) {
        return new AddSecurityRequirementCommand(parent, requirement);
    };
    CommandFactory.createAddChildSchemaCommand = function (schema, childSchema, childType) {
        return new AddChildSchemaCommand(schema, childSchema, childType);
    };
    CommandFactory.createChangePropertyCommand = function (node, property, newValue) {
        return (new ChangePropertyCommand(node, property, newValue));
    };
    CommandFactory.createChangeTitleCommand = function (newTitle) {
        return new ChangeTitleCommand(newTitle);
    };
    CommandFactory.createChangeDescriptionCommand = function (newDescription) {
        return new ChangeDescriptionCommand(newDescription);
    };
    CommandFactory.createChangeVersionCommand = function (newVersion) {
        return new ChangeVersionCommand(newVersion);
    };
    CommandFactory.createChangeLicenseCommand = function (name, url) {
        return new ChangeLicenseCommand(name, url);
    };
    CommandFactory.createChangeSchemaInheritanceCommand = function (schema, inheritanceType) {
        return new ChangeSchemaInheritanceCommand(schema, inheritanceType);
    };
    CommandFactory.createChangeContactCommand = function (name, email, url) {
        return new ChangeContactCommand(name, email, url);
    };
    CommandFactory.createChangeMediaTypeTypeCommand = function (mediaType, newType) {
        return new ChangeMediaTypeTypeCommand(mediaType, newType);
    };
    CommandFactory.createChangeParameterTypeCommand = function (docType, parameter, newType) {
        if (docType === DocumentType.openapi2) {
            return new ChangeParameterTypeCommand_20(parameter, newType);
        }
        if (docType === DocumentType.openapi3) {
            return new ChangeParameterTypeCommand_30(parameter, newType);
        }
        throw Object.defineProperty(new Error("Document type not supported by this command."), '__classes', { configurable: true, value: ['java.lang.Throwable', 'java.lang.Object', 'java.lang.RuntimeException', 'java.lang.Exception'] });
    };
    CommandFactory.createChangeParameterDefinitionTypeCommand = function (docType, parameter, newType) {
        if (docType === DocumentType.openapi2) {
            return new ChangeParameterDefinitionTypeCommand_20(parameter, newType);
        }
        if (docType === DocumentType.openapi3) {
            return new ChangeParameterDefinitionTypeCommand_30(parameter, newType);
        }
        throw Object.defineProperty(new Error("Document type not supported by this command."), '__classes', { configurable: true, value: ['java.lang.Throwable', 'java.lang.Object', 'java.lang.RuntimeException', 'java.lang.Exception'] });
    };
    CommandFactory.createChangePropertyTypeCommand = function (property, newType) {
        return new ChangePropertyTypeCommand(property, newType);
    };
    CommandFactory.createChangeSchemaTypeCommand = function (schema, newType) {
        return new ChangeSchemaTypeCommand(schema, newType);
    };
    CommandFactory.createChangeResponseTypeCommand = function (response, newType) {
        return new ChangeResponseTypeCommand(response, newType);
    };
    CommandFactory.createChangeResponseDefinitionTypeCommand = function (response, newType) {
        return new ChangeResponseTypeCommand(response, newType);
    };
    CommandFactory.createChangeSecuritySchemeCommand = function (docType, scheme) {
        if (docType === DocumentType.openapi2) {
            return new ChangeSecuritySchemeCommand_20(scheme);
        }
        else if (docType === DocumentType.openapi3) {
            return new ChangeSecuritySchemeCommand_30(scheme);
        }
        throw Object.defineProperty(new Error("Document type not supported by this command."), '__classes', { configurable: true, value: ['java.lang.Throwable', 'java.lang.Object', 'java.lang.RuntimeException', 'java.lang.Exception'] });
    };
    CommandFactory.createChangeServerCommand = function (server) {
        return new ChangeServerCommand(server);
    };
    CommandFactory.createDeleteContactCommand = function (info) {
        return new DeleteContactCommand(info);
    };
    CommandFactory.createDeleteChildSchemaCommand = function (schema) {
        return new DeleteChildSchemaCommand(schema);
    };
    CommandFactory.createDeleteAllExamplesCommand = function (mediaType) {
        return new DeleteAllExamplesCommand(mediaType);
    };
    CommandFactory.createDeleteAllParameterExamplesCommand = function (parameter) {
        return new DeleteAllParameterExamplesCommand(parameter);
    };
    CommandFactory.createDeleteAllOperationsCommand = function (pathItem) {
        return new DeleteAllOperationsCommand(pathItem);
    };
    CommandFactory.createDeleteAllParametersCommand = function (parent, type) {
        return new DeleteAllParametersCommand(parent, type);
    };
    CommandFactory.createDeleteAllPropertiesCommand = function (schema) {
        return new DeleteAllPropertiesCommand(schema);
    };
    CommandFactory.createDeleteAllResponsesCommand = function (operation) {
        return new DeleteAllResponsesCommand(Constants.PROP_RESPONSES, operation);
    };
    CommandFactory.createDeleteAllSecurityRequirementsCommand = function (parent) {
        return new DeleteAllSecurityRequirementsCommand(parent);
    };
    CommandFactory.createDeleteAllSecuritySchemesCommand = function () {
        return new DeleteAllSecuritySchemesCommand();
    };
    CommandFactory.createDeleteAllServersCommand = function (parent) {
        return new DeleteAllServersCommand(parent);
    };
    CommandFactory.createDeleteAllTagsCommand = function () {
        return new DeleteAllTagsCommand();
    };
    CommandFactory.createDeleteAllChildSchemasCommand = function (parent, type) {
        return new DeleteAllChildSchemasCommand(parent, type);
    };
    CommandFactory.createDelete20ExampleCommand = function (response, contentType) {
        return new DeleteExampleCommand_20(response, contentType);
    };
    CommandFactory.createDeleteExampleCommand = function (example) {
        return new DeleteExampleCommand_30(example);
    };
    CommandFactory.createDeleteParameterExampleCommand = function (example) {
        return new DeleteParameterExampleCommand_30(example);
    };
    CommandFactory.createDeleteExtensionCommand = function (extension) {
        return new DeleteExtensionCommand(extension);
    };
    CommandFactory.createDeleteLicenseCommand = function (info) {
        return new DeleteLicenseCommand(info);
    };
    CommandFactory.createDeleteMediaTypeCommand = function (mediaType) {
        return new DeleteMediaTypeCommand(mediaType);
    };
    CommandFactory.createDeleteOperationCommand = function (opMethod, pathItem) {
        return new DeleteOperationCommand(opMethod, pathItem);
    };
    CommandFactory.createDeleteParameterCommand = function (parameter) {
        return new DeleteParameterCommand(parameter);
    };
    CommandFactory.createDeletePathCommand = function (path) {
        return new DeletePathCommand(path);
    };
    CommandFactory.createDeletePropertyCommand = function (property) {
        return new DeletePropertyCommand(property);
    };
    CommandFactory.createDeleteRequestBodyCommand = function (operation) {
        return new DeleteRequestBodyCommand(operation);
    };
    CommandFactory.createDeleteResponseCommand = function (response) {
        return new DeleteResponseCommand(response);
    };
    CommandFactory.createDeleteSchemaDefinitionCommand = function (docType, definitionName) {
        if (docType === DocumentType.openapi2) {
            return new DeleteSchemaDefinitionCommand_20(definitionName);
        }
        if (docType === DocumentType.openapi3) {
            return new DeleteSchemaDefinitionCommand_30(definitionName);
        }
        throw Object.defineProperty(new Error("Document type not supported by this command."), '__classes', { configurable: true, value: ['java.lang.Throwable', 'java.lang.Object', 'java.lang.RuntimeException', 'java.lang.Exception'] });
    };
    CommandFactory.createDeleteResponseDefinitionCommand = function (docType, definitionName) {
        if (docType === DocumentType.openapi2) {
            return new DeleteResponseDefinitionCommand_20(definitionName);
        }
        if (docType === DocumentType.openapi3) {
            return new DeleteResponseDefinitionCommand_30(definitionName);
        }
        throw Object.defineProperty(new Error("Document type not supported by this command."), '__classes', { configurable: true, value: ['java.lang.Throwable', 'java.lang.Object', 'java.lang.RuntimeException', 'java.lang.Exception'] });
    };
    CommandFactory.createDeleteSecurityRequirementCommand = function (parent, requirement) {
        return new DeleteSecurityRequirementCommand(parent, requirement);
    };
    CommandFactory.createDeleteSecuritySchemeCommand = function (docType, schemeName) {
        if (docType === DocumentType.openapi2) {
            return new DeleteSecuritySchemeCommand_20(schemeName);
        }
        if (docType === DocumentType.openapi3) {
            return new DeleteSecuritySchemeCommand_30(schemeName);
        }
        throw Object.defineProperty(new Error("Document type not supported by this command."), '__classes', { configurable: true, value: ['java.lang.Throwable', 'java.lang.Object', 'java.lang.RuntimeException', 'java.lang.Exception'] });
    };
    CommandFactory.createDeleteServerCommand = function (server) {
        return new DeleteServerCommand(server);
    };
    CommandFactory.createDeleteTagCommand = function (tagName) {
        return new DeleteTagCommand(tagName);
    };
    /**
     * New Commands
     * @param {*} parent
     * @param {string} newMediaType
     * @return {*}
     */
    CommandFactory.createNewMediaTypeCommand = function (parent, newMediaType) {
        return new NewMediaTypeCommand(parent, newMediaType);
    };
    CommandFactory.createNewOperationCommand = function (path, method) {
        return new NewOperationCommand(path, method);
    };
    CommandFactory.createNewParamCommand = function (parent, paramName, paramType, description, newType, override) {
        return new NewParamCommand(parent, paramName, paramType, description, newType, override);
    };
    CommandFactory.createNewPathCommand = function (newPath) {
        return new NewPathCommand(newPath);
    };
    CommandFactory.createNewRequestBodyCommand = function (docType, operation) {
        if (docType === DocumentType.openapi2) {
            return new NewRequestBodyCommand_20(operation);
        }
        if (docType === DocumentType.openapi3) {
            return new NewRequestBodyCommand_30(operation);
        }
        throw Object.defineProperty(new Error("Document type not supported by this command."), '__classes', { configurable: true, value: ['java.lang.Throwable', 'java.lang.Object', 'java.lang.RuntimeException', 'java.lang.Exception'] });
    };
    CommandFactory.createNewResponseCommand = function (operation, statusCode, sourceResponse) {
        return new NewResponseCommand(operation, statusCode, sourceResponse);
    };
    CommandFactory.createNewSchemaDefinitionCommand = function (docType, definitionName, example, description) {
        if (docType === DocumentType.openapi2) {
            return new NewSchemaDefinitionCommand_20(definitionName, example, description);
        }
        if (docType === DocumentType.openapi3) {
            return new NewSchemaDefinitionCommand_30(definitionName, example, description);
        }
        throw Object.defineProperty(new Error("Document type not supported by this command."), '__classes', { configurable: true, value: ['java.lang.Throwable', 'java.lang.Object', 'java.lang.RuntimeException', 'java.lang.Exception'] });
    };
    CommandFactory.createNewResponseDefinitionCommand = function (docType, definitionName, description) {
        if (docType === DocumentType.openapi2) {
            return new NewResponseDefinitionCommand_20(definitionName, description);
        }
        if (docType === DocumentType.openapi3) {
            return new NewResponseDefinitionCommand_30(definitionName, description);
        }
        throw Object.defineProperty(new Error("Document type not supported by this command."), '__classes', { configurable: true, value: ['java.lang.Throwable', 'java.lang.Object', 'java.lang.RuntimeException', 'java.lang.Exception'] });
    };
    CommandFactory.createNewSchemaPropertyCommand = function (schema, propertyName, description, newType) {
        return new NewSchemaPropertyCommand(schema, propertyName, description, newType);
    };
    CommandFactory.createNewSecuritySchemeCommand = function (docType, scheme) {
        if (docType === DocumentType.openapi2) {
            return new NewSecuritySchemeCommand_20(scheme);
        }
        if (docType === DocumentType.openapi3) {
            return new NewSecuritySchemeCommand_30(scheme);
        }
        throw Object.defineProperty(new Error("Document type not supported by this command."), '__classes', { configurable: true, value: ['java.lang.Throwable', 'java.lang.Object', 'java.lang.RuntimeException', 'java.lang.Exception'] });
    };
    CommandFactory.createNewServerCommand = function (parent, server) {
        return new NewServerCommand(parent, server);
    };
    CommandFactory.createNewTagCommand = function (name, description) {
        return new NewTagCommand(name, description);
    };
    /**
     * Rename Commands
     * @param {*} parent
     * @param {string} oldParamName
     * @param {string} newParamName
     * @param {string} paramIn
     * @return {*}
     */
    CommandFactory.createRenameParameterCommand = function (parent, oldParamName, newParamName, paramIn) {
        return new RenameParameterCommand(parent, oldParamName, newParamName, paramIn);
    };
    CommandFactory.createRenamePathItemCommand = function (oldPath, newPath, alsoRenameSubpaths) {
        return new RenamePathItemCommand(oldPath, newPath, alsoRenameSubpaths);
    };
    CommandFactory.createRenamePropertyCommand = function (parent, oldPropertyName, newPropertyName) {
        return new RenamePropertyCommand(parent, oldPropertyName, newPropertyName);
    };
    CommandFactory.createRenameSchemaDefinitionCommand = function (docType, oldName, newName) {
        if (docType === DocumentType.openapi2) {
            return new RenameSchemaDefinitionCommand_20(oldName, newName);
        }
        if (docType === DocumentType.openapi3) {
            return new RenameSchemaDefinitionCommand_30(oldName, newName);
        }
        throw Object.defineProperty(new Error("Document type not supported by this command."), '__classes', { configurable: true, value: ['java.lang.Throwable', 'java.lang.Object', 'java.lang.RuntimeException', 'java.lang.Exception'] });
    };
    CommandFactory.createRenameResponseDefinitionCommand = function (docType, oldName, newName) {
        if (docType === DocumentType.openapi2) {
            return new RenameResponseDefinitionCommand_20(oldName, newName);
        }
        if (docType === DocumentType.openapi3) {
            return new RenameResponseDefinitionCommand_30(oldName, newName);
        }
        throw Object.defineProperty(new Error("Document type not supported by this command."), '__classes', { configurable: true, value: ['java.lang.Throwable', 'java.lang.Object', 'java.lang.RuntimeException', 'java.lang.Exception'] });
    };
    CommandFactory.createRenameSecuritySchemeCommand = function (oldSchemeName, newSchemeName) {
        return new RenameSecuritySchemeCommand(oldSchemeName, newSchemeName);
    };
    CommandFactory.createRenameTagDefinitionCommand = function (oldTag, newTag) {
        return new RenameTagDefinitionCommand(oldTag, newTag);
    };
    CommandFactory.createReplaceOperationCommand = function (old, replacement) {
        return new ReplaceOperationCommand(old, replacement);
    };
    CommandFactory.createReplaceDocumentCommand = function (old, replacement) {
        return new ReplaceDocumentCommand(old, replacement);
    };
    CommandFactory.createReplacePathItemCommand = function (old, replacement) {
        return new ReplacePathItemCommand(old, replacement);
    };
    CommandFactory.createReplaceSchemaDefinitionCommand = function (docType, old, replacement) {
        if (docType === DocumentType.openapi2) {
            return new ReplaceSchemaDefinitionCommand_20(old, replacement);
        }
        if (docType === DocumentType.openapi3) {
            return new ReplaceSchemaDefinitionCommand_30(old, replacement);
        }
        throw Object.defineProperty(new Error("Document type not supported by this command."), '__classes', { configurable: true, value: ['java.lang.Throwable', 'java.lang.Object', 'java.lang.RuntimeException', 'java.lang.Exception'] });
    };
    CommandFactory.createReplaceResponseDefinitionCommand = function (docType, old, replacement) {
        if (docType === DocumentType.openapi2) {
            return new ReplaceResponseDefinitionCommand_20(old, replacement);
        }
        if (docType === DocumentType.openapi3) {
            return new ReplaceResponseDefinitionCommand_30(old, replacement);
        }
        throw Object.defineProperty(new Error("Document type not supported by this command."), '__classes', { configurable: true, value: ['java.lang.Throwable', 'java.lang.Object', 'java.lang.RuntimeException', 'java.lang.Exception'] });
    };
    CommandFactory.createReplaceSecurityRequirementCommand = function (old, replacement) {
        return new ReplaceSecurityRequirementCommand(old, replacement);
    };
    /**
     * Set Commands
     * @param {NodePath} path
     * @param {string} property
     * @param {*} newValue
     * @return {*}
     */
    CommandFactory.createSetPropertyCommand = function (path, property, newValue) {
        return (new SetPropertyCommand(path, property, newValue));
    };
    CommandFactory.createSetExampleCommand = function (docType, parent, example, nameOrContentType) {
        if (docType === DocumentType.openapi2) {
            return new SetExampleCommand_20(parent, example, nameOrContentType);
        }
        if (docType === DocumentType.openapi3) {
            return new SetExampleCommand_30(parent, example, nameOrContentType);
        }
        throw Object.defineProperty(new Error("Document type not supported by this command."), '__classes', { configurable: true, value: ['java.lang.Throwable', 'java.lang.Object', 'java.lang.RuntimeException', 'java.lang.Exception'] });
    };
    CommandFactory.createSetParameterExampleCommand = function (parent, example, exampleName) {
        return new SetParameterExampleCommand_30(parent, example, exampleName);
    };
    CommandFactory.createSetExtensionCommand = function (parent, name, value) {
        return new SetExtensionCommand(parent, name, value);
    };
    return CommandFactory;
}());
export { CommandFactory };
CommandFactory["__class"] = "io.apicurio.datamodels.cmd.commands.CommandFactory";
import { SetExtensionCommand } from './SetExtensionCommand';
import { SetParameterExampleCommand_30 } from './SetParameterExampleCommand_30';
import { SetExampleCommand_30 } from './SetExampleCommand_30';
import { SetExampleCommand_20 } from './SetExampleCommand_20';
import { SetPropertyCommand } from './SetPropertyCommand';
import { ReplaceResponseDefinitionCommand_30 } from './ReplaceResponseDefinitionCommand_30';
import { ReplaceResponseDefinitionCommand_20 } from './ReplaceResponseDefinitionCommand_20';
import { ReplaceSecurityRequirementCommand } from './ReplaceSecurityRequirementCommand';
import { ReplaceSchemaDefinitionCommand_30 } from './ReplaceSchemaDefinitionCommand_30';
import { ReplaceSchemaDefinitionCommand_20 } from './ReplaceSchemaDefinitionCommand_20';
import { ReplacePathItemCommand } from './ReplacePathItemCommand';
import { ReplaceDocumentCommand } from './ReplaceDocumentCommand';
import { ReplaceOperationCommand } from './ReplaceOperationCommand';
import { RenameResponseDefinitionCommand_30 } from './RenameResponseDefinitionCommand_30';
import { RenameResponseDefinitionCommand_20 } from './RenameResponseDefinitionCommand_20';
import { RenameTagDefinitionCommand } from './RenameTagDefinitionCommand';
import { RenameSecuritySchemeCommand } from './RenameSecuritySchemeCommand';
import { RenameSchemaDefinitionCommand_30 } from './RenameSchemaDefinitionCommand_30';
import { RenameSchemaDefinitionCommand_20 } from './RenameSchemaDefinitionCommand_20';
import { RenamePropertyCommand } from './RenamePropertyCommand';
import { RenamePathItemCommand } from './RenamePathItemCommand';
import { RenameParameterCommand } from './RenameParameterCommand';
import { NewResponseDefinitionCommand_30 } from './NewResponseDefinitionCommand_30';
import { NewResponseDefinitionCommand_20 } from './NewResponseDefinitionCommand_20';
import { NewTagCommand } from './NewTagCommand';
import { NewServerCommand } from './NewServerCommand';
import { NewSecuritySchemeCommand_30 } from './NewSecuritySchemeCommand_30';
import { NewSecuritySchemeCommand_20 } from './NewSecuritySchemeCommand_20';
import { NewSchemaPropertyCommand } from './NewSchemaPropertyCommand';
import { NewSchemaDefinitionCommand_30 } from './NewSchemaDefinitionCommand_30';
import { NewSchemaDefinitionCommand_20 } from './NewSchemaDefinitionCommand_20';
import { NewResponseCommand } from './NewResponseCommand';
import { NewRequestBodyCommand_30 } from './NewRequestBodyCommand_30';
import { NewRequestBodyCommand_20 } from './NewRequestBodyCommand_20';
import { NewPathCommand } from './NewPathCommand';
import { NewParamCommand } from './NewParamCommand';
import { NewOperationCommand } from './NewOperationCommand';
import { NewMediaTypeCommand } from './NewMediaTypeCommand';
import { DeleteChildSchemaCommand } from './DeleteChildSchemaCommand';
import { DeleteTagCommand } from './DeleteTagCommand';
import { DeleteServerCommand } from './DeleteServerCommand';
import { DeleteSecuritySchemeCommand_30 } from './DeleteSecuritySchemeCommand_30';
import { DeleteSecuritySchemeCommand_20 } from './DeleteSecuritySchemeCommand_20';
import { DeleteSecurityRequirementCommand } from './DeleteSecurityRequirementCommand';
import { DeleteResponseDefinitionCommand_30 } from './DeleteResponseDefinitionCommand_30';
import { DeleteResponseDefinitionCommand_20 } from './DeleteResponseDefinitionCommand_20';
import { DeleteSchemaDefinitionCommand_30 } from './DeleteSchemaDefinitionCommand_30';
import { DeleteSchemaDefinitionCommand_20 } from './DeleteSchemaDefinitionCommand_20';
import { DeleteResponseCommand } from './DeleteResponseCommand';
import { DeleteRequestBodyCommand } from './DeleteRequestBodyCommand';
import { DeletePropertyCommand } from './DeletePropertyCommand';
import { DeletePathCommand } from './DeletePathCommand';
import { DeleteParameterCommand } from './DeleteParameterCommand';
import { DeleteOperationCommand } from './DeleteOperationCommand';
import { DeleteMediaTypeCommand } from './DeleteMediaTypeCommand';
import { DeleteLicenseCommand } from './DeleteLicenseCommand';
import { DeleteExtensionCommand } from './DeleteExtensionCommand';
import { DeleteParameterExampleCommand_30 } from './DeleteParameterExampleCommand_30';
import { DeleteExampleCommand_30 } from './DeleteExampleCommand_30';
import { DeleteExampleCommand_20 } from './DeleteExampleCommand_20';
import { DeleteAllChildSchemasCommand } from './DeleteAllChildSchemasCommand';
import { DeleteAllTagsCommand } from './DeleteAllTagsCommand';
import { DeleteAllServersCommand } from './DeleteAllServersCommand';
import { DeleteAllSecuritySchemesCommand } from './DeleteAllSecuritySchemesCommand';
import { DeleteAllSecurityRequirementsCommand } from './DeleteAllSecurityRequirementsCommand';
import { DeleteAllResponsesCommand } from './DeleteAllResponsesCommand';
import { DeleteAllPropertiesCommand } from './DeleteAllPropertiesCommand';
import { DeleteAllParametersCommand } from './DeleteAllParametersCommand';
import { DeleteAllOperationsCommand } from './DeleteAllOperationsCommand';
import { DeleteAllParameterExamplesCommand } from './DeleteAllParameterExamplesCommand';
import { DeleteAllExamplesCommand } from './DeleteAllExamplesCommand';
import { DeleteContactCommand } from './DeleteContactCommand';
import { ChangeSchemaInheritanceCommand } from './ChangeSchemaInheritanceCommand';
import { ChangeSchemaTypeCommand } from './ChangeSchemaTypeCommand';
import { ChangeServerCommand } from './ChangeServerCommand';
import { ChangeSecuritySchemeCommand_30 } from './ChangeSecuritySchemeCommand_30';
import { ChangeSecuritySchemeCommand_20 } from './ChangeSecuritySchemeCommand_20';
import { ChangeResponseTypeCommand } from './ChangeResponseTypeCommand';
import { ChangePropertyTypeCommand } from './ChangePropertyTypeCommand';
import { ChangeParameterDefinitionTypeCommand_30 } from './ChangeParameterDefinitionTypeCommand_30';
import { ChangeParameterTypeCommand_30 } from './ChangeParameterTypeCommand_30';
import { ChangeParameterDefinitionTypeCommand_20 } from './ChangeParameterDefinitionTypeCommand_20';
import { ChangeParameterTypeCommand_20 } from './ChangeParameterTypeCommand_20';
import { ChangeMediaTypeTypeCommand } from './ChangeMediaTypeTypeCommand';
import { ChangeLicenseCommand } from './ChangeLicenseCommand';
import { ChangeContactCommand } from './ChangeContactCommand';
import { ChangeVersionCommand } from './ChangeVersionCommand';
import { ChangeTitleCommand } from './ChangeTitleCommand';
import { ChangeDescriptionCommand } from './ChangeDescriptionCommand';
import { ChangePropertyCommand } from './ChangePropertyCommand';
import { AddChildSchemaCommand } from './AddChildSchemaCommand';
import { AddResponseDefinitionCommand_30 } from './AddResponseDefinitionCommand_30';
import { AddResponseDefinitionCommand_20 } from './AddResponseDefinitionCommand_20';
import { AddSecurityRequirementCommand } from './AddSecurityRequirementCommand';
import { AddPathItemCommand } from './AddPathItemCommand';
import { AddParameterExampleCommand_30 } from './AddParameterExampleCommand_30';
import { AddExampleCommand_30 } from './AddExampleCommand_30';
import { AddSchemaDefinitionCommand_30 } from './AddSchemaDefinitionCommand_30';
import { AddSchemaDefinitionCommand_20 } from './AddSchemaDefinitionCommand_20';
import { AggregateCommand } from './AggregateCommand';
//# sourceMappingURL=CommandFactory.js.map