add prefix, suffix to ts model

This commit is contained in:
wing328 2016-02-29 12:11:54 +08:00
parent 9f3c34dbfa
commit 74d91f4ea1
9 changed files with 400 additions and 224 deletions

View File

@ -17,12 +17,13 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
supportsInheritance = true; supportsInheritance = true;
setReservedWordsLowerCase(Arrays.asList( setReservedWordsLowerCase(Arrays.asList(
// local variable names used in API methods (endpoints) // local variable names used in API methods (endpoints)
"path", "queryParameters", "headerParams", "formParams", "useFormData", "deferred", "varLocalPath", "queryParameters", "headerParams", "formParams", "useFormData", "varLocalDeferred",
"requestOptions", "requestOptions",
// Typescript reserved words // Typescript reserved words
"abstract", "await", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "debugger", "default", "delete", "do", "double", "else", "enum", "export", "extends", "false", "final", "finally", "float", "for", "function", "goto", "if", "implements", "import", "in", "instanceof", "int", "interface", "let", "long", "native", "new", "null", "package", "private", "protected", "public", "return", "short", "static", "super", "switch", "synchronized", "this", "throw", "transient", "true", "try", "typeof", "var", "void", "volatile", "while", "with", "yield")); "abstract", "await", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "debugger", "default", "delete", "do", "double", "else", "enum", "export", "extends", "false", "final", "finally", "float", "for", "function", "goto", "if", "implements", "import", "in", "instanceof", "int", "interface", "let", "long", "native", "new", "null", "package", "private", "protected", "public", "return", "short", "static", "super", "switch", "synchronized", "this", "throw", "transient", "true", "try", "typeof", "var", "void", "volatile", "while", "with", "yield"));
languageSpecificPrimitives = new HashSet<String>(Arrays.asList( languageSpecificPrimitives = new HashSet<String>(Arrays.asList(
"string",
"String", "String",
"boolean", "boolean",
"Boolean", "Boolean",
@ -30,7 +31,12 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
"Integer", "Integer",
"Long", "Long",
"Float", "Float",
"Object")); "Object",
"Array",
"Date",
"number",
"any"
));
instantiationTypes.put("array", "Array"); instantiationTypes.put("array", "Array");
typeMapping = new HashMap<String, String>(); typeMapping = new HashMap<String, String>();
@ -116,10 +122,22 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
@Override @Override
public String toModelName(String name) { public String toModelName(String name) {
// model name cannot use reserved keyword, e.g. return name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
if (isReservedWord(name))
throw new RuntimeException(name if (!StringUtils.isEmpty(modelNamePrefix)) {
+ " (reserved word) cannot be used as a model name"); name = modelNamePrefix + "_" + name;
}
if (!StringUtils.isEmpty(modelNameSuffix)) {
name = name + "_" + modelNameSuffix;
}
// model name cannot use reserved keyword, e.g. return
if (isReservedWord(name)) {
String modelName = camelize("object_" + name);
LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + modelName);
return modelName;
}
// camelize the model name // camelize the model name
// phone_number => PhoneNumber // phone_number => PhoneNumber
@ -158,7 +176,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
return type; return type;
} else } else
type = swaggerType; type = swaggerType;
return type; return toModelName(type);
} }
@Override @Override

View File

@ -39,7 +39,7 @@ namespace {{package}} {
{{#allParams}}* @param {{paramName}} {{description}} {{#allParams}}* @param {{paramName}} {{description}}
{{/allParams}}*/ {{/allParams}}*/
public {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}extraHttpRequestParams?: any ) : ng.IHttpPromise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}{}{{/returnType}}> { public {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}extraHttpRequestParams?: any ) : ng.IHttpPromise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}{}{{/returnType}}> {
const path = this.basePath + '{{path}}'{{#pathParams}} const localVarPath = this.basePath + '{{path}}'{{#pathParams}}
.replace('{' + '{{baseName}}' + '}', String({{paramName}})){{/pathParams}}; .replace('{' + '{{baseName}}' + '}', String({{paramName}})){{/pathParams}};
let queryParameters: any = {}; let queryParameters: any = {};
@ -76,7 +76,7 @@ namespace {{package}} {
{{/formParams}} {{/formParams}}
let httpRequestParams: any = { let httpRequestParams: any = {
method: '{{httpMethod}}', method: '{{httpMethod}}',
url: path, url: localVarPath,
json: {{#hasFormParams}}false{{/hasFormParams}}{{^hasFormParams}}true{{/hasFormParams}}, json: {{#hasFormParams}}false{{/hasFormParams}}{{^hasFormParams}}true{{/hasFormParams}},
{{#bodyParam}}data: {{paramName}}, {{#bodyParam}}data: {{paramName}},
{{/bodyParam}} {{/bodyParam}}

View File

@ -179,7 +179,7 @@ export class {{classname}} {
{{#allParams}}* @param {{paramName}} {{description}} {{#allParams}}* @param {{paramName}} {{description}}
{{/allParams}}*/ {{/allParams}}*/
public {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) : Promise<{ response: http.ClientResponse; {{#returnType}}body: {{{returnType}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }> { public {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) : Promise<{ response: http.ClientResponse; {{#returnType}}body: {{{returnType}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }> {
const path = this.basePath + '{{path}}'{{#pathParams}} const localVarPath = this.basePath + '{{path}}'{{#pathParams}}
.replace('{' + '{{baseName}}' + '}', String({{paramName}})){{/pathParams}}; .replace('{' + '{{baseName}}' + '}', String({{paramName}})){{/pathParams}};
let queryParameters: any = {}; let queryParameters: any = {};
let headerParams: any = this.extendObj({}, this.defaultHeaders); let headerParams: any = this.extendObj({}, this.defaultHeaders);
@ -212,13 +212,13 @@ export class {{classname}} {
{{/isFile}} {{/isFile}}
{{/formParams}} {{/formParams}}
let deferred = promise.defer<{ response: http.ClientResponse; {{#returnType}}body: {{{returnType}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }>(); let localVarDeferred = promise.defer<{ response: http.ClientResponse; {{#returnType}}body: {{{returnType}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }>();
let requestOptions: request.Options = { let requestOptions: request.Options = {
method: '{{httpMethod}}', method: '{{httpMethod}}',
qs: queryParameters, qs: queryParameters,
headers: headerParams, headers: headerParams,
uri: path, uri: localVarPath,
json: true, json: true,
{{#bodyParam}} {{#bodyParam}}
body: {{paramName}}, body: {{paramName}},
@ -241,17 +241,17 @@ export class {{classname}} {
request(requestOptions, (error, response, body) => { request(requestOptions, (error, response, body) => {
if (error) { if (error) {
deferred.reject(error); localVarDeferred.reject(error);
} else { } else {
if (response.statusCode >= 200 && response.statusCode <= 299) { if (response.statusCode >= 200 && response.statusCode <= 299) {
deferred.resolve({ response: response, body: body }); localVarDeferred.resolve({ response: response, body: body });
} else { } else {
deferred.reject({ response: response, body: body }); localVarDeferred.reject({ response: response, body: body });
} }
} }
}); });
return deferred.promise; return localVarDeferred.promise;
} }
{{/operation}} {{/operation}}
} }

View File

@ -59,7 +59,7 @@ public class TypeScriptAngularModelTest {
final CodegenProperty property3 = cm.vars.get(2); final CodegenProperty property3 = cm.vars.get(2);
Assert.assertEquals(property3.baseName, "createdAt"); Assert.assertEquals(property3.baseName, "createdAt");
Assert.assertEquals(property3.complexType, "Date"); Assert.assertEquals(property3.complexType, null);
Assert.assertEquals(property3.datatype, "Date"); Assert.assertEquals(property3.datatype, "Date");
Assert.assertEquals(property3.name, "createdAt"); Assert.assertEquals(property3.name, "createdAt");
Assert.assertEquals(property3.defaultValue, "null"); Assert.assertEquals(property3.defaultValue, "null");

View File

@ -59,7 +59,7 @@ public class TypeScriptNodeModelTest {
final CodegenProperty property3 = cm.vars.get(2); final CodegenProperty property3 = cm.vars.get(2);
Assert.assertEquals(property3.baseName, "createdAt"); Assert.assertEquals(property3.baseName, "createdAt");
Assert.assertEquals(property3.complexType, "Date"); Assert.assertEquals(property3.complexType, null);
Assert.assertEquals(property3.datatype, "Date"); Assert.assertEquals(property3.datatype, "Date");
Assert.assertEquals(property3.name, "createdAt"); Assert.assertEquals(property3.name, "createdAt");
Assert.assertEquals(property3.defaultValue, "null"); Assert.assertEquals(property3.defaultValue, "null");

View File

@ -32,13 +32,13 @@ namespace API.Client {
* @param body Pet object that needs to be added to the store * @param body Pet object that needs to be added to the store
*/ */
public updatePet (body?: Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { public updatePet (body?: Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
const path = this.basePath + '/pet'; const localVarPath = this.basePath + '/pet';
let queryParameters: any = {}; let queryParameters: any = {};
let headerParams: any = this.extendObj({}, this.defaultHeaders); let headerParams: any = this.extendObj({}, this.defaultHeaders);
let httpRequestParams: any = { let httpRequestParams: any = {
method: 'PUT', method: 'PUT',
url: path, url: localVarPath,
json: true, json: true,
data: body, data: body,
@ -59,13 +59,13 @@ namespace API.Client {
* @param body Pet object that needs to be added to the store * @param body Pet object that needs to be added to the store
*/ */
public addPet (body?: Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { public addPet (body?: Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
const path = this.basePath + '/pet'; const localVarPath = this.basePath + '/pet';
let queryParameters: any = {}; let queryParameters: any = {};
let headerParams: any = this.extendObj({}, this.defaultHeaders); let headerParams: any = this.extendObj({}, this.defaultHeaders);
let httpRequestParams: any = { let httpRequestParams: any = {
method: 'POST', method: 'POST',
url: path, url: localVarPath,
json: true, json: true,
data: body, data: body,
@ -82,11 +82,11 @@ namespace API.Client {
} }
/** /**
* Finds Pets by status * Finds Pets by status
* Multiple status values can be provided with comma seperated strings * Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter * @param status Status values that need to be considered for query
*/ */
public findPetsByStatus (status?: Array<string>, extraHttpRequestParams?: any ) : ng.IHttpPromise<Array<Pet>> { public findPetsByStatus (status?: Array<string>, extraHttpRequestParams?: any ) : ng.IHttpPromise<Array<Pet>> {
const path = this.basePath + '/pet/findByStatus'; const localVarPath = this.basePath + '/pet/findByStatus';
let queryParameters: any = {}; let queryParameters: any = {};
let headerParams: any = this.extendObj({}, this.defaultHeaders); let headerParams: any = this.extendObj({}, this.defaultHeaders);
@ -96,7 +96,7 @@ namespace API.Client {
let httpRequestParams: any = { let httpRequestParams: any = {
method: 'GET', method: 'GET',
url: path, url: localVarPath,
json: true, json: true,
@ -116,7 +116,7 @@ namespace API.Client {
* @param tags Tags to filter by * @param tags Tags to filter by
*/ */
public findPetsByTags (tags?: Array<string>, extraHttpRequestParams?: any ) : ng.IHttpPromise<Array<Pet>> { public findPetsByTags (tags?: Array<string>, extraHttpRequestParams?: any ) : ng.IHttpPromise<Array<Pet>> {
const path = this.basePath + '/pet/findByTags'; const localVarPath = this.basePath + '/pet/findByTags';
let queryParameters: any = {}; let queryParameters: any = {};
let headerParams: any = this.extendObj({}, this.defaultHeaders); let headerParams: any = this.extendObj({}, this.defaultHeaders);
@ -126,7 +126,7 @@ namespace API.Client {
let httpRequestParams: any = { let httpRequestParams: any = {
method: 'GET', method: 'GET',
url: path, url: localVarPath,
json: true, json: true,
@ -146,7 +146,7 @@ namespace API.Client {
* @param petId ID of pet that needs to be fetched * @param petId ID of pet that needs to be fetched
*/ */
public getPetById (petId: number, extraHttpRequestParams?: any ) : ng.IHttpPromise<Pet> { public getPetById (petId: number, extraHttpRequestParams?: any ) : ng.IHttpPromise<Pet> {
const path = this.basePath + '/pet/{petId}' const localVarPath = this.basePath + '/pet/{petId}'
.replace('{' + 'petId' + '}', String(petId)); .replace('{' + 'petId' + '}', String(petId));
let queryParameters: any = {}; let queryParameters: any = {};
@ -157,7 +157,7 @@ namespace API.Client {
} }
let httpRequestParams: any = { let httpRequestParams: any = {
method: 'GET', method: 'GET',
url: path, url: localVarPath,
json: true, json: true,
@ -179,7 +179,7 @@ namespace API.Client {
* @param status Updated status of the pet * @param status Updated status of the pet
*/ */
public updatePetWithForm (petId: string, name?: string, status?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { public updatePetWithForm (petId: string, name?: string, status?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
const path = this.basePath + '/pet/{petId}' const localVarPath = this.basePath + '/pet/{petId}'
.replace('{' + 'petId' + '}', String(petId)); .replace('{' + 'petId' + '}', String(petId));
let queryParameters: any = {}; let queryParameters: any = {};
@ -198,7 +198,7 @@ namespace API.Client {
let httpRequestParams: any = { let httpRequestParams: any = {
method: 'POST', method: 'POST',
url: path, url: localVarPath,
json: false, json: false,
data: this.$httpParamSerializer(formParams), data: this.$httpParamSerializer(formParams),
@ -220,7 +220,7 @@ namespace API.Client {
* @param apiKey * @param apiKey
*/ */
public deletePet (petId: number, apiKey?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { public deletePet (petId: number, apiKey?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
const path = this.basePath + '/pet/{petId}' const localVarPath = this.basePath + '/pet/{petId}'
.replace('{' + 'petId' + '}', String(petId)); .replace('{' + 'petId' + '}', String(petId));
let queryParameters: any = {}; let queryParameters: any = {};
@ -233,7 +233,7 @@ namespace API.Client {
let httpRequestParams: any = { let httpRequestParams: any = {
method: 'DELETE', method: 'DELETE',
url: path, url: localVarPath,
json: true, json: true,
@ -255,7 +255,7 @@ namespace API.Client {
* @param file file to upload * @param file file to upload
*/ */
public uploadFile (petId: number, additionalMetadata?: string, file?: any, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { public uploadFile (petId: number, additionalMetadata?: string, file?: any, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
const path = this.basePath + '/pet/{petId}/uploadImage' const localVarPath = this.basePath + '/pet/{petId}/uploadImage'
.replace('{' + 'petId' + '}', String(petId)); .replace('{' + 'petId' + '}', String(petId));
let queryParameters: any = {}; let queryParameters: any = {};
@ -274,7 +274,7 @@ namespace API.Client {
let httpRequestParams: any = { let httpRequestParams: any = {
method: 'POST', method: 'POST',
url: path, url: localVarPath,
json: false, json: false,
data: this.$httpParamSerializer(formParams), data: this.$httpParamSerializer(formParams),
@ -294,19 +294,19 @@ namespace API.Client {
* Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions * Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
* @param petId ID of pet that needs to be fetched * @param petId ID of pet that needs to be fetched
*/ */
public getPetByIdWithByteArray (petId: number, extraHttpRequestParams?: any ) : ng.IHttpPromise<string> { public petPetIdtestingByteArraytrueGet (petId: number, extraHttpRequestParams?: any ) : ng.IHttpPromise<string> {
const path = this.basePath + '/pet/{petId}?testing_byte_array=true' const localVarPath = this.basePath + '/pet/{petId}?testing_byte_array=true'
.replace('{' + 'petId' + '}', String(petId)); .replace('{' + 'petId' + '}', String(petId));
let queryParameters: any = {}; let queryParameters: any = {};
let headerParams: any = this.extendObj({}, this.defaultHeaders); let headerParams: any = this.extendObj({}, this.defaultHeaders);
// verify required parameter 'petId' is set // verify required parameter 'petId' is set
if (!petId) { if (!petId) {
throw new Error('Missing required parameter petId when calling getPetByIdWithByteArray'); throw new Error('Missing required parameter petId when calling petPetIdtestingByteArraytrueGet');
} }
let httpRequestParams: any = { let httpRequestParams: any = {
method: 'GET', method: 'GET',
url: path, url: localVarPath,
json: true, json: true,
@ -326,13 +326,13 @@ namespace API.Client {
* @param body Pet object in the form of byte array * @param body Pet object in the form of byte array
*/ */
public addPetUsingByteArray (body?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { public addPetUsingByteArray (body?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
const path = this.basePath + '/pet?testing_byte_array=true'; const localVarPath = this.basePath + '/pet?testing_byte_array=true';
let queryParameters: any = {}; let queryParameters: any = {};
let headerParams: any = this.extendObj({}, this.defaultHeaders); let headerParams: any = this.extendObj({}, this.defaultHeaders);
let httpRequestParams: any = { let httpRequestParams: any = {
method: 'POST', method: 'POST',
url: path, url: localVarPath,
json: true, json: true,
data: body, data: body,

View File

@ -26,18 +26,48 @@ namespace API.Client {
return <T1&T2>objA; return <T1&T2>objA;
} }
/**
* Finds orders by status
* A single status value can be provided as a string
* @param status Status value that needs to be considered for query
*/
public findOrdersByStatus (status?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<Array<Order>> {
const localVarPath = this.basePath + '/store/findByStatus';
let queryParameters: any = {};
let headerParams: any = this.extendObj({}, this.defaultHeaders);
if (status !== undefined) {
queryParameters['status'] = status;
}
let httpRequestParams: any = {
method: 'GET',
url: localVarPath,
json: true,
params: queryParameters,
headers: headerParams
};
if (extraHttpRequestParams) {
httpRequestParams = this.extendObj(httpRequestParams, extraHttpRequestParams);
}
return this.$http(httpRequestParams);
}
/** /**
* Returns pet inventories by status * Returns pet inventories by status
* Returns a map of status codes to quantities * Returns a map of status codes to quantities
*/ */
public getInventory (extraHttpRequestParams?: any ) : ng.IHttpPromise<{ [key: string]: number; }> { public getInventory (extraHttpRequestParams?: any ) : ng.IHttpPromise<{ [key: string]: number; }> {
const path = this.basePath + '/store/inventory'; const localVarPath = this.basePath + '/store/inventory';
let queryParameters: any = {}; let queryParameters: any = {};
let headerParams: any = this.extendObj({}, this.defaultHeaders); let headerParams: any = this.extendObj({}, this.defaultHeaders);
let httpRequestParams: any = { let httpRequestParams: any = {
method: 'GET', method: 'GET',
url: path, url: localVarPath,
json: true, json: true,
@ -57,13 +87,13 @@ namespace API.Client {
* @param body order placed for purchasing the pet * @param body order placed for purchasing the pet
*/ */
public placeOrder (body?: Order, extraHttpRequestParams?: any ) : ng.IHttpPromise<Order> { public placeOrder (body?: Order, extraHttpRequestParams?: any ) : ng.IHttpPromise<Order> {
const path = this.basePath + '/store/order'; const localVarPath = this.basePath + '/store/order';
let queryParameters: any = {}; let queryParameters: any = {};
let headerParams: any = this.extendObj({}, this.defaultHeaders); let headerParams: any = this.extendObj({}, this.defaultHeaders);
let httpRequestParams: any = { let httpRequestParams: any = {
method: 'POST', method: 'POST',
url: path, url: localVarPath,
json: true, json: true,
data: body, data: body,
@ -84,7 +114,7 @@ namespace API.Client {
* @param orderId ID of pet that needs to be fetched * @param orderId ID of pet that needs to be fetched
*/ */
public getOrderById (orderId: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<Order> { public getOrderById (orderId: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<Order> {
const path = this.basePath + '/store/order/{orderId}' const localVarPath = this.basePath + '/store/order/{orderId}'
.replace('{' + 'orderId' + '}', String(orderId)); .replace('{' + 'orderId' + '}', String(orderId));
let queryParameters: any = {}; let queryParameters: any = {};
@ -95,7 +125,7 @@ namespace API.Client {
} }
let httpRequestParams: any = { let httpRequestParams: any = {
method: 'GET', method: 'GET',
url: path, url: localVarPath,
json: true, json: true,
@ -115,7 +145,7 @@ namespace API.Client {
* @param orderId ID of the order that needs to be deleted * @param orderId ID of the order that needs to be deleted
*/ */
public deleteOrder (orderId: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { public deleteOrder (orderId: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
const path = this.basePath + '/store/order/{orderId}' const localVarPath = this.basePath + '/store/order/{orderId}'
.replace('{' + 'orderId' + '}', String(orderId)); .replace('{' + 'orderId' + '}', String(orderId));
let queryParameters: any = {}; let queryParameters: any = {};
@ -126,7 +156,7 @@ namespace API.Client {
} }
let httpRequestParams: any = { let httpRequestParams: any = {
method: 'DELETE', method: 'DELETE',
url: path, url: localVarPath,
json: true, json: true,

View File

@ -32,13 +32,13 @@ namespace API.Client {
* @param body Created user object * @param body Created user object
*/ */
public createUser (body?: User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { public createUser (body?: User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
const path = this.basePath + '/user'; const localVarPath = this.basePath + '/user';
let queryParameters: any = {}; let queryParameters: any = {};
let headerParams: any = this.extendObj({}, this.defaultHeaders); let headerParams: any = this.extendObj({}, this.defaultHeaders);
let httpRequestParams: any = { let httpRequestParams: any = {
method: 'POST', method: 'POST',
url: path, url: localVarPath,
json: true, json: true,
data: body, data: body,
@ -59,13 +59,13 @@ namespace API.Client {
* @param body List of user object * @param body List of user object
*/ */
public createUsersWithArrayInput (body?: Array<User>, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { public createUsersWithArrayInput (body?: Array<User>, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
const path = this.basePath + '/user/createWithArray'; const localVarPath = this.basePath + '/user/createWithArray';
let queryParameters: any = {}; let queryParameters: any = {};
let headerParams: any = this.extendObj({}, this.defaultHeaders); let headerParams: any = this.extendObj({}, this.defaultHeaders);
let httpRequestParams: any = { let httpRequestParams: any = {
method: 'POST', method: 'POST',
url: path, url: localVarPath,
json: true, json: true,
data: body, data: body,
@ -86,13 +86,13 @@ namespace API.Client {
* @param body List of user object * @param body List of user object
*/ */
public createUsersWithListInput (body?: Array<User>, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { public createUsersWithListInput (body?: Array<User>, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
const path = this.basePath + '/user/createWithList'; const localVarPath = this.basePath + '/user/createWithList';
let queryParameters: any = {}; let queryParameters: any = {};
let headerParams: any = this.extendObj({}, this.defaultHeaders); let headerParams: any = this.extendObj({}, this.defaultHeaders);
let httpRequestParams: any = { let httpRequestParams: any = {
method: 'POST', method: 'POST',
url: path, url: localVarPath,
json: true, json: true,
data: body, data: body,
@ -114,7 +114,7 @@ namespace API.Client {
* @param password The password for login in clear text * @param password The password for login in clear text
*/ */
public loginUser (username?: string, password?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<string> { public loginUser (username?: string, password?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<string> {
const path = this.basePath + '/user/login'; const localVarPath = this.basePath + '/user/login';
let queryParameters: any = {}; let queryParameters: any = {};
let headerParams: any = this.extendObj({}, this.defaultHeaders); let headerParams: any = this.extendObj({}, this.defaultHeaders);
@ -128,7 +128,7 @@ namespace API.Client {
let httpRequestParams: any = { let httpRequestParams: any = {
method: 'GET', method: 'GET',
url: path, url: localVarPath,
json: true, json: true,
@ -147,13 +147,13 @@ namespace API.Client {
* *
*/ */
public logoutUser (extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { public logoutUser (extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
const path = this.basePath + '/user/logout'; const localVarPath = this.basePath + '/user/logout';
let queryParameters: any = {}; let queryParameters: any = {};
let headerParams: any = this.extendObj({}, this.defaultHeaders); let headerParams: any = this.extendObj({}, this.defaultHeaders);
let httpRequestParams: any = { let httpRequestParams: any = {
method: 'GET', method: 'GET',
url: path, url: localVarPath,
json: true, json: true,
@ -173,7 +173,7 @@ namespace API.Client {
* @param username The name that needs to be fetched. Use user1 for testing. * @param username The name that needs to be fetched. Use user1 for testing.
*/ */
public getUserByName (username: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<User> { public getUserByName (username: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<User> {
const path = this.basePath + '/user/{username}' const localVarPath = this.basePath + '/user/{username}'
.replace('{' + 'username' + '}', String(username)); .replace('{' + 'username' + '}', String(username));
let queryParameters: any = {}; let queryParameters: any = {};
@ -184,7 +184,7 @@ namespace API.Client {
} }
let httpRequestParams: any = { let httpRequestParams: any = {
method: 'GET', method: 'GET',
url: path, url: localVarPath,
json: true, json: true,
@ -205,7 +205,7 @@ namespace API.Client {
* @param body Updated user object * @param body Updated user object
*/ */
public updateUser (username: string, body?: User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { public updateUser (username: string, body?: User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
const path = this.basePath + '/user/{username}' const localVarPath = this.basePath + '/user/{username}'
.replace('{' + 'username' + '}', String(username)); .replace('{' + 'username' + '}', String(username));
let queryParameters: any = {}; let queryParameters: any = {};
@ -216,7 +216,7 @@ namespace API.Client {
} }
let httpRequestParams: any = { let httpRequestParams: any = {
method: 'PUT', method: 'PUT',
url: path, url: localVarPath,
json: true, json: true,
data: body, data: body,
@ -237,7 +237,7 @@ namespace API.Client {
* @param username The name that needs to be deleted * @param username The name that needs to be deleted
*/ */
public deleteUser (username: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { public deleteUser (username: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
const path = this.basePath + '/user/{username}' const localVarPath = this.basePath + '/user/{username}'
.replace('{' + 'username' + '}', String(username)); .replace('{' + 'username' + '}', String(username));
let queryParameters: any = {}; let queryParameters: any = {};
@ -248,7 +248,7 @@ namespace API.Client {
} }
let httpRequestParams: any = { let httpRequestParams: any = {
method: 'DELETE', method: 'DELETE',
url: path, url: localVarPath,
json: true, json: true,

File diff suppressed because it is too large Load Diff