import CliOption from './CliOption'; export default class DefaultCodegen { static addHasMore(objs: any): any; /** * Underscore the given word. * Copied from Twitter elephant bird * https://github.com/twitter/elephant-bird/blob/master/core/src/main/java/com/twitter/elephantbird/util/Strings.java * * @param word The word * @return The underscored version of the word */ static underscore(word: any): any; /** * Camelize name (parameter, property, method, etc) * * @param word string to be camelize * @param lowercaseFirstLetter lower case for first letter if set to true * @return camelized string */ static camelize(word: any, lowercaseFirstLetter?: boolean): any; /** * Generate the next name for the given name, i.e. append "2" to the base name if not ending with a number, * otherwise increase the number by 1. For example: * status => status2 * status2 => status3 * myName100 => myName101 * * @param name The base name * @return The next name for the base name */ static generateNextName(name: any): any; __fileSuffix: any; __templateDir: any; __embeddedTemplateDir: any; __outputFolder: string; __languageSpecificPrimitives: import("./java/FakeHashSet").FakeHashSet; __modelPackage: string; __apiPackage: string; modelNamePrefix: string; modelNameSuffix: string; __testPackage: string; __apiTemplateFiles: import("./java/fakeMap").FakeHashMap; __apiDataTemplateFile: import("./java/fakeMap").FakeHashMap; __modelTemplateFiles: import("./java/fakeMap").FakeHashMap; __apiTestTemplateFiles: import("./java/fakeMap").FakeHashMap; __modelTestTemplateFiles: import("./java/fakeMap").FakeHashMap; __apiDocTemplateFiles: import("./java/fakeMap").FakeHashMap; __modelDocTemplateFiles: import("./java/fakeMap").FakeHashMap; commonTemplateDir: string; __additionalProperties: import("./java/fakeMap").FakeHashMap; __vendorExtensions: import("./java/fakeMap").FakeHashMap; __supportingFiles: any[]; __cliOptions: any[]; __supportedLibraries: import("./java/fakeMap").FakeHashMap; sortParamsByRequiredFlag: boolean; ensureUniqueParams: boolean; specialCharReplacements: import("./java/fakeMap").FakeHashMap; skipOverwrite: boolean; supportsInheritance: boolean; __defaultIncludes: import("./java/FakeHashSet").FakeHashSet; __typeMapping: import("./java/fakeMap").FakeHashMap; __instantiationTypes: import("./java/fakeMap").FakeHashMap; __reservedWords: import("./java/FakeHashSet").FakeHashSet; __importMapping: import("./java/fakeMap").FakeHashMap; containerType: any; library: any; gitUserId: any; gitRepoId: any; releaseNote: any; httpUserAgent: any; /** * Default constructor. * This method will map between Swagger type and language-specified type, as well as mapping * between Swagger type and the corresponding import statement for the language. This will * also add some language specified CLI options, if any. * * * returns string presentation of the example path (it's a constructor) */ constructor(); initalizeCliOptions(): void; cliOptions(): any[]; processOpts(): void; addLicenseFile(): boolean; addSwaggerIgnoreFile(): boolean; postProcessAllModels(objs: any): any; postProcessModels(objs: any): any; /** * post process enum defined in model's properties * * @param objs Map of models * @return maps of models with better enum support */ postProcessModelsEnum(objs: any): any; /** * Returns the common prefix of variables for enum naming * * @param vars List of variable names * @return the common prefix for naming */ findCommonPrefixOfVars(listStr: any): any; /** * Return the enum default value in the language specifed format * * @param value enum variable name * @param datatype data type * @return the default value for the enum */ toEnumDefaultValue(value: any, datatype: any): string; /** * Return the enum value in the language specifed format * e.g. status becomes "status" * * @param value enum variable name * @param datatype data type * @return the sanitized value for enum */ toEnumValue(value: any, datatype: any): any; /** * Return the sanitized variable name for enum * * @param value enum variable name * @param datatype data type * @return the sanitized variable name for enum */ toEnumVarName(value: any, datatype: any): any; postProcessOperations(objs: any): any; postProcessSupportingFileData(objs: any): any; postProcessModelProperty(model: any, property: any): void; postProcessParameter(parameter: any): void; preprocessSwagger(swagger: any): void; processSwagger(swagger: any): void; escapeText(input: any): any; /** * override with any special text escaping logic to handle unsafe * characters so as to avoid code injection * @param input String to be cleaned up * @return string with unsafe characters removed or escaped */ escapeUnsafeCharacters(input: any): any; /** * Escape single and/or double quote to avoid code injection * @param input String to be cleaned up * @return string with quotation mark removed or escaped */ escapeQuotationMark(input: any): any; defaultIncludes(): import("./java/FakeHashSet").FakeHashSet; typeMapping(): import("./java/fakeMap").FakeHashMap; instantiationTypes(): import("./java/fakeMap").FakeHashMap; reservedWords(): import("./java/FakeHashSet").FakeHashSet; languageSpecificPrimitives(): import("./java/FakeHashSet").FakeHashSet; importMapping(): import("./java/fakeMap").FakeHashMap; testPackage(): string; modelPackage(): string; apiPackage(): string; fileSuffix(): any; templateDir(): any; embeddedTemplateDir(): any; getCommonTemplateDir(): string; etCommonTemplateDir(commonTemplateDir: any): void; apiDocTemplateFiles(): import("./java/fakeMap").FakeHashMap; modelDocTemplateFiles(): import("./java/fakeMap").FakeHashMap; apiTestTemplateFiles(): import("./java/fakeMap").FakeHashMap; modelTestTemplateFiles(): import("./java/fakeMap").FakeHashMap; apiTemplateFiles(): import("./java/fakeMap").FakeHashMap; apiDataTemplateFile(): import("./java/fakeMap").FakeHashMap; modelTemplateFiles(): import("./java/fakeMap").FakeHashMap; apiFileFolder(): string; /** * Checks to see if an API file needs to be generated for this template, helps to apply some logic when you have more than one api file which is condition based. * @param templateName * @param operation * @returns {boolean} */ shouldGenerateApiFor(templateName: any, operation: any): boolean; modelFileFolder(): string; apiTestFileFolder(): string; modelTestFileFolder(): string; apiDocFileFolder(): string; modelDocFileFolder(): string; additionalProperties(): import("./java/fakeMap").FakeHashMap; vendorExtensions(): import("./java/fakeMap").FakeHashMap; supportingFiles(): any[]; outputFolder(): string; setOutputDir(dir: any): void; getOutputDir(): string; setTemplateDir(templateDir: any): void; setModelPackage(modelPackage: any): void; setModelNamePrefix(modelNamePrefix: any): void; setModelNameSuffix(modelNameSuffix: any): void; setApiPackage(apiPackage: any): void; setSortParamsByRequiredFlag(sortParamsByRequiredFlag: any): void; setEnsureUniqueParams(ensureUniqueParams: any): void; /** * Return the regular expression/JSON schema pattern (http://json-schema.org/latest/json-schema-validation.html#anchor33) * * @param pattern the pattern (regular expression) * @return properly-escaped pattern */ toRegularExpression(pattern: any): any; /** * Return the file name of the Api Test * * @param name the file name of the Api * @return the file name of the Api */ toApiFilename(name: any): string; /** * Return the file name of the Api Documentation * * @param name the file name of the Api * @return the file name of the Api */ toApiDocFilename(name: any): string; /** * Return the file name of the Api Test * * @param name the file name of the Api * @return the file name of the Api */ toApiTestFilename(name: any): string; /** * Return the variable name in the Api * * @param name the varible name of the Api * @return the snake-cased variable name */ toApiVarName(name: any): any; /** * Return the capitalized file name of the model * * @param name the model name * @return the file name of the model */ toModelFilename(name: any): any; /** * Return the capitalized file name of the model test * * @param name the model name * @return the file name of the model */ toModelTestFilename(name: any): string; /** * Return the capitalized file name of the model documentation * * @param name the model name * @return the file name of the model */ toModelDocFilename(name: any): any; /** * Return the operation ID (method name) * * @param operationId operation ID * @return the sanitized method name */ toOperationId(operationId: any): any; /** * Return the variable name by removing invalid characters and proper escaping if * it's a reserved word. * * @param name the variable name * @return the sanitized variable name */ toVarName(name: any): any; /** * Return the parameter name by removing invalid characters and proper escaping if * it's a reserved word. * * @param name Codegen property object * @return the sanitized parameter name */ toParamName(name: any): any; /** * Return the Enum name (e.g. StatusEnum given 'status') * * @param property Codegen property * @return the Enum name */ toEnumName(property: any): string; /** * Return the escaped name of the reserved word * * @param name the name to be escaped * @return the escaped reserved word * * throws Runtime exception as reserved word is not allowed (default behavior) */ escapeReservedWord(name: any): void; /** * Return the fully-qualified "Model" name for import * * @param name the name of the "Model" * @return the fully-qualified "Model" name for import */ toModelImport(name: any): any; /** * Return the fully-qualified "Api" name for import * * @param name the name of the "Api" * @return the fully-qualified "Api" name for import */ toApiImport(name: any): string; /** * Initalize special character mapping */ initalizeSpecialCharacterMapping(): void; /** * Return the symbol name of a symbol * * @param input Symbol (e.g. $) * @return Symbol name (e.g. Dollar) */ getSymbolName(input: any): any; /** * Return the instantiation type of the property, especially for map and array * * @param p Swagger property object * @return string presentation of the instantiation type of the property */ toInstantiationType(p: any): string | null; /** * Return the example value of the parameter. * * @param p Swagger property object */ setParameterExampleValue(p: any): void; /** * Return the example value of the property * * @param p Swagger property object * @return string presentation of the example value of the property */ toExampleValue(p: any): any; /** * Return the default value of the property * * @param p Swagger property object * @return string presentation of the default value of the property */ toDefaultValue(p: any): any; /** * Return the property initialized from a data object * Useful for initialization with a plain object in JavaScript * * @param name Name of the property object * @param p Swagger property object * @return string presentation of the default value of the property */ toDefaultValueWithParam(name: any, p: any): string; /** * returns the swagger type for the property * @param p Swagger property object * @return string presentation of the type */ getSwaggerType(p: any): any; /** * Return the snake-case of the string * * @param name string to be snake-cased * @return snake-cased string */ snakeCase(name: any): any; /** * Capitalize the string * * @param name string to be capitalized * @return capitalized string */ initialCaps(name: any): any; /** * Output the type declaration of a given name * * @param name name * @return a string presentation of the type */ getTypeDeclaration(name: any): any; /** * Output the API (class) name (capitalized) ending with "Api" * Return DefaultApi if name is empty * * @param name the name of the Api * @return capitalized Api name ending with "Api" */ toApiName(name: any): string; /** * Output the proper model name (capitalized) * * @param name the name of the model * @return capitalized model name */ toModelName(name: any): any; /** * Convert Swagger Model object to Codegen Model object * * @param name the name of the model * @param model Swagger Model object * @param allDefinitions a map of all Swagger models from the spec * @return Codegen Model object */ fromModel(name: any, model: any, allDefinitions?: null): any; addAdditionPropertiesToCodeGenModel(codegenModel: any, swaggerModel: any): void; addProperties(properties: any, required: any, model: any, allDefinitions: any): void; /** * Camelize the method name of the getter and setter * * @param name string to be camelized * @return Camelized string */ getterAndSetterCapitalize(name: any): any; /** * Convert Swagger Property object to Codegen Property object * * @param name name of the property * @param p Swagger property object * @return Codegen Property object */ fromProperty(name: any, p: any): any; /** * Update property for array(list) container * @param property Codegen property * @param innerProperty Codegen inner property of map or list */ updatePropertyForArray(property: any, innerProperty: any): void; /** * Update property for map container * @param property Codegen property * @param innerProperty Codegen inner property of map or list */ updatePropertyForMap(property: any, innerProperty: any): void; /** * Update property for map container * @param property Codegen property * @return True if the inner most type is enum */ isPropertyInnerMostEnum(property: any): any; getInnerEnumAllowableValues(property: any): any; /** * Update datatypeWithEnum for array container * @param property Codegen property */ updateDataTypeWithEnumForArray(property: any): void; /** * Update datatypeWithEnum for map container * @param property Codegen property */ updateDataTypeWithEnumForMap(property: any): void; setNonArrayMapProperty(property: any, type: any): void; /** * Override with any special handling of response codes * @param responses Swagger Operation's responses * @return default method response or null if not found */ findMethodResponse(responses: any): any; /** * Convert Swagger Operation object to Codegen Operation object * * @param p the path of the operation * @param httpMethod HTTP method * @param operation Swagger operation object * @param definitions a map of Swagger models * @param swagger a Swagger object representing the spec * @return Codegen Operation object */ fromOperation(p: any, httpMethod: any, operation: any, definitions: any, swagger?: any): any; /** * Convert Swagger Response object to Codegen Response object * * @param responseCode HTTP response code * @param response Swagger Response object * @return Codegen Response object */ fromResponse(responseCode: any, response: any): any; /** * Convert Swagger Parameter object to Codegen Parameter object * * @param param Swagger parameter object * @param imports set of imports for library/package/module * @return Codegen Parameter object */ fromParameter(param: any, imports: any): any; isDataTypeBinary(dataType: any): any; /** * Convert map of Swagger SecuritySchemeDefinition objects to a list of Codegen Security objects * * @param schemes a map of Swagger SecuritySchemeDefinition object * @return a list of Codegen Security objects */ fromSecurity(schemes: any): any[] | readonly never[]; setReservedWordsLowerCase(words: any): void; isReservedWord(word: any): boolean; /** * Get operationId from the operation object, and if it's blank, generate a new one from the given parameters. * * @param operation the operation object * @param p the path of the operation * @param httpMethod the HTTP method of the operation * @return the (generated) operationId */ getOrGenerateOperationId(operation: any, p: any, httpMethod: any): any; /** * Check the type to see if it needs import the library/module/package * * @param type name of the type * @return true if the library/module/package of the corresponding type needs to be imported */ needToImport(type: any): boolean; toExamples(examples: any): any[] | null; addHeaders(response: any, target: any): void; /** * Add operation to group * * @param tag name of the tag * @param resourcePath path of the resource * @param operation Swagger Operation object * @param co Codegen Operation object * @param operations map of Codegen operations */ addOperationToGroup(tag: any, resourcePath: any, operation: any, co: any, operations: any): void; addParentContainer(m: any, name: any, property: any): void; /** * Dashize the given word. * * @param word The word * @return The dashized version of the word, e.g. "my-name" */ dashize(word: any): any; addImport(m: any, type: any): void; addVars(m: any, properties: any, required: any, allProperties?: any, allRequired?: any): any; _addVars(m: any, vars: any, properties: any, mandatory: any): void; /** * Remove characters that is not good to be included in method name from the input and camelize it * * @param name string to be camelize * @param nonNameElementPattern a regex pattern of the characters that is not good to be included in name * @return camelized string */ removeNonNameElementToCamelCase(name: any, nonNameElementPattern?: string): any; apiFilename(templateName: any, tag: any): string; apiDataFilename(templateName: any, tag: any): string; /** * Return the full path and API documentation file * * @param templateName template name * @param tag tag * * @return the API documentation file name with full path */ apiDocFilename(templateName: any, tag: any): string; /** * Return the full path and API test file * * @param templateName template name * @param tag tag * * @return the API test file name with full path */ apiTestFilename(templateName: any, tag: any): string; shouldOverwrite(filename: any): boolean; isSkipOverwrite(): boolean; setSkipOverwrite(skipOverwrite: any): void; /** * All library templates supported. * (key: library name, value: library description) * @return the supported libraries */ supportedLibraries(): import("./java/fakeMap").FakeHashMap; /** * Set library template (sub-template). * * @param library Library template */ setLibrary(library: any): void; /** * Library template (sub-template). * * @return Library template */ getLibrary(): any; /** * Set Git user ID. * * @param gitUserId Git user ID */ setGitUserId(gitUserId: any): void; /** * Git user ID * * @return Git user ID */ getGitUserId(): any; /** * Set Git repo ID. * * @param gitRepoId Git repo ID */ setGitRepoId(gitRepoId: any): void; /** * Git repo ID * * @return Git repo ID */ getGitRepoId(): any; /** * Set release note. * * @param releaseNote Release note */ setReleaseNote(releaseNote: any): void; /** * Release note * * @return Release note */ getReleaseNote(): any; /** * Set HTTP user agent. * * @param httpUserAgent HTTP user agent */ setHttpUserAgent(httpUserAgent: any): void; /** * HTTP user agent * * @return HTTP user agent */ getHttpUserAgent(): any; buildLibraryCliOption(supportedLibraries: any): CliOption; /** * Sanitize name (parameter, property, method, etc) * * @param name string to be sanitize * @return sanitized string */ sanitizeName(name: any): any; /** * Sanitize tag * * @param tag Tag * @return Sanitized tag */ sanitizeTag(tag: any): string; /** * Only write if the file doesn't exist * * @param outputFolder Output folder * @param supportingFile Supporting file */ writeOptional(outputFolder: any, supportingFile: any): void; /** * Set CodegenParameter boolean flag using CodegenProperty. * * @param parameter Codegen Parameter * @param property Codegen property */ setParameterBooleanFlagWithCodegenProperty(parameter: any, property: any): void; /** * Update codegen property's enum by adding "enumVars" (with name and value) * * @param var list of CodegenProperty */ updateCodegenPropertyEnum(__var: any): void; }