Add option modelPropertyNaming to javascript generator (#299)

* Add option modelPropertyNaming to javascript generator

Fixes 6530

* Update Petstore sample
This commit is contained in:
Stian Liknes
2018-06-14 13:19:23 +02:00
committed by William Cheng
parent 7126074f49
commit 24104dac35
334 changed files with 4646 additions and 2594 deletions

View File

@@ -1,12 +1,12 @@
/**
* Swagger Petstore
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
@@ -45,16 +45,16 @@ export default class AnotherFakeApi {
/**
* To test special tags
* To test special tags
* @param {module:model/Client} body client model
* @param {module:model/Client} client client model
* @param {module:api/AnotherFakeApi~testSpecialTagsCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Client}
*/
testSpecialTags(body, callback) {
let postBody = body;
testSpecialTags(client, callback) {
let postBody = client;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling testSpecialTags");
// verify the required parameter 'client' is set
if (client === undefined || client === null) {
throw new Error("Missing the required parameter 'client' when calling testSpecialTags");
}

View File

@@ -1,12 +1,12 @@
/**
* Swagger Petstore
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
@@ -14,10 +14,8 @@
import ApiClient from "../ApiClient";
import Client from '../model/Client';
import OuterBoolean from '../model/OuterBoolean';
import OuterComposite from '../model/OuterComposite';
import OuterNumber from '../model/OuterNumber';
import OuterString from '../model/OuterString';
import User from '../model/User';
/**
* Fake service.
@@ -42,16 +40,16 @@ export default class FakeApi {
* Callback function to receive the result of the fakeOuterBooleanSerialize operation.
* @callback module:api/FakeApi~fakeOuterBooleanSerializeCallback
* @param {String} error Error message, if any.
* @param {module:model/OuterBoolean} data The data returned by the service call.
* @param {Boolean} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Test serialization of outer boolean types
* @param {Object} opts Optional parameters
* @param {module:model/OuterBoolean} opts.body Input boolean as post body
* @param {Boolean} opts.body Input boolean as post body
* @param {module:api/FakeApi~fakeOuterBooleanSerializeCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/OuterBoolean}
* data is of type: {@link Boolean}
*/
fakeOuterBooleanSerialize(opts, callback) {
opts = opts || {};
@@ -69,8 +67,8 @@ export default class FakeApi {
let authNames = [];
let contentTypes = [];
let accepts = [];
let returnType = OuterBoolean;
let accepts = ['*/*'];
let returnType = Boolean;
return this.apiClient.callApi(
'/fake/outer/boolean', 'POST',
@@ -90,13 +88,13 @@ export default class FakeApi {
/**
* Test serialization of object with outer number type
* @param {Object} opts Optional parameters
* @param {module:model/OuterComposite} opts.body Input composite as post body
* @param {module:model/OuterComposite} opts.outerComposite Input composite as post body
* @param {module:api/FakeApi~fakeOuterCompositeSerializeCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/OuterComposite}
*/
fakeOuterCompositeSerialize(opts, callback) {
opts = opts || {};
let postBody = opts['body'];
let postBody = opts['outerComposite'];
let pathParams = {
@@ -110,7 +108,7 @@ export default class FakeApi {
let authNames = [];
let contentTypes = [];
let accepts = [];
let accepts = ['*/*'];
let returnType = OuterComposite;
return this.apiClient.callApi(
@@ -124,16 +122,16 @@ export default class FakeApi {
* Callback function to receive the result of the fakeOuterNumberSerialize operation.
* @callback module:api/FakeApi~fakeOuterNumberSerializeCallback
* @param {String} error Error message, if any.
* @param {module:model/OuterNumber} data The data returned by the service call.
* @param {Number} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Test serialization of outer number types
* @param {Object} opts Optional parameters
* @param {module:model/OuterNumber} opts.body Input number as post body
* @param {Number} opts.body Input number as post body
* @param {module:api/FakeApi~fakeOuterNumberSerializeCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/OuterNumber}
* data is of type: {@link Number}
*/
fakeOuterNumberSerialize(opts, callback) {
opts = opts || {};
@@ -151,8 +149,8 @@ export default class FakeApi {
let authNames = [];
let contentTypes = [];
let accepts = [];
let returnType = OuterNumber;
let accepts = ['*/*'];
let returnType = Number;
return this.apiClient.callApi(
'/fake/outer/number', 'POST',
@@ -165,16 +163,16 @@ export default class FakeApi {
* Callback function to receive the result of the fakeOuterStringSerialize operation.
* @callback module:api/FakeApi~fakeOuterStringSerializeCallback
* @param {String} error Error message, if any.
* @param {module:model/OuterString} data The data returned by the service call.
* @param {String} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Test serialization of outer string types
* @param {Object} opts Optional parameters
* @param {module:model/OuterString} opts.body Input string as post body
* @param {String} opts.body Input string as post body
* @param {module:api/FakeApi~fakeOuterStringSerializeCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/OuterString}
* data is of type: {@link String}
*/
fakeOuterStringSerialize(opts, callback) {
opts = opts || {};
@@ -192,8 +190,8 @@ export default class FakeApi {
let authNames = [];
let contentTypes = [];
let accepts = [];
let returnType = OuterString;
let accepts = ['*/*'];
let returnType = String;
return this.apiClient.callApi(
'/fake/outer/string', 'POST',
@@ -202,6 +200,55 @@ export default class FakeApi {
);
}
/**
* Callback function to receive the result of the testBodyWithQueryParams operation.
* @callback module:api/FakeApi~testBodyWithQueryParamsCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* @param {String} query
* @param {module:model/User} user
* @param {module:api/FakeApi~testBodyWithQueryParamsCallback} callback The callback function, accepting three arguments: error, data, response
*/
testBodyWithQueryParams(query, user, callback) {
let postBody = user;
// verify the required parameter 'query' is set
if (query === undefined || query === null) {
throw new Error("Missing the required parameter 'query' when calling testBodyWithQueryParams");
}
// verify the required parameter 'user' is set
if (user === undefined || user === null) {
throw new Error("Missing the required parameter 'user' when calling testBodyWithQueryParams");
}
let pathParams = {
};
let queryParams = {
'query': query
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = ['application/json'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/fake/body-with-query-params', 'PUT',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the testClientModel operation.
* @callback module:api/FakeApi~testClientModelCallback
@@ -213,16 +260,16 @@ export default class FakeApi {
/**
* To test \"client\" model
* To test \"client\" model
* @param {module:model/Client} body client model
* @param {module:model/Client} client client model
* @param {module:api/FakeApi~testClientModelCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Client}
*/
testClientModel(body, callback) {
let postBody = body;
testClientModel(client, callback) {
let postBody = client;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling testClientModel");
// verify the required parameter 'client' is set
if (client === undefined || client === null) {
throw new Error("Missing the required parameter 'client' when calling testClientModel");
}
@@ -268,7 +315,7 @@ export default class FakeApi {
* @param {Number} opts.int64 None
* @param {Number} opts._float None
* @param {String} opts._string None
* @param {Blob} opts.binary None
* @param {File} opts.binary None
* @param {Date} opts._date None
* @param {Date} opts.dateTime None
* @param {String} opts.password None
@@ -324,8 +371,8 @@ export default class FakeApi {
};
let authNames = ['http_basic_test'];
let contentTypes = ['application/xml; charset=utf-8', 'application/json; charset=utf-8'];
let accepts = ['application/xml; charset=utf-8', 'application/json; charset=utf-8'];
let contentTypes = ['application/x-www-form-urlencoded'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
@@ -347,14 +394,14 @@ export default class FakeApi {
* To test enum parameters
* To test enum parameters
* @param {Object} opts Optional parameters
* @param {Array.<module:model/String>} opts.enumFormStringArray Form parameter enum test (string array)
* @param {module:model/String} opts.enumFormString Form parameter enum test (string) (default to -efg)
* @param {Array.<module:model/String>} opts.enumHeaderStringArray Header parameter enum test (string array)
* @param {module:model/String} opts.enumHeaderString Header parameter enum test (string) (default to -efg)
* @param {module:model/String} opts.enumHeaderString Header parameter enum test (string) (default to &#39;-efg&#39;)
* @param {Array.<module:model/String>} opts.enumQueryStringArray Query parameter enum test (string array)
* @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to -efg)
* @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to &#39;-efg&#39;)
* @param {module:model/Number} opts.enumQueryInteger Query parameter enum test (double)
* @param {module:model/Number} opts.enumQueryDouble Query parameter enum test (double)
* @param {Array.<module:model/String>} opts.enumFormStringArray Form parameter enum test (string array) (default to &#39;$&#39;)
* @param {module:model/String} opts.enumFormString Form parameter enum test (string) (default to &#39;-efg&#39;)
* @param {module:api/FakeApi~testEnumParametersCallback} callback The callback function, accepting three arguments: error, data, response
*/
testEnumParameters(opts, callback) {
@@ -367,7 +414,8 @@ export default class FakeApi {
let queryParams = {
'enum_query_string_array': this.apiClient.buildCollectionParam(opts['enumQueryStringArray'], 'csv'),
'enum_query_string': opts['enumQueryString'],
'enum_query_integer': opts['enumQueryInteger']
'enum_query_integer': opts['enumQueryInteger'],
'enum_query_double': opts['enumQueryDouble']
};
let headerParams = {
'enum_header_string_array': opts['enumHeaderStringArray'],
@@ -375,13 +423,12 @@ export default class FakeApi {
};
let formParams = {
'enum_form_string_array': this.apiClient.buildCollectionParam(opts['enumFormStringArray'], 'csv'),
'enum_form_string': opts['enumFormString'],
'enum_query_double': opts['enumQueryDouble']
'enum_form_string': opts['enumFormString']
};
let authNames = [];
let contentTypes = ['*/*'];
let accepts = ['*/*'];
let contentTypes = ['application/x-www-form-urlencoded'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
@@ -401,16 +448,15 @@ export default class FakeApi {
/**
* test inline additionalProperties
*
* @param {Object} param request body
* @param {Object.<String, {String: String}>} requestBody request body
* @param {module:api/FakeApi~testInlineAdditionalPropertiesCallback} callback The callback function, accepting three arguments: error, data, response
*/
testInlineAdditionalProperties(param, callback) {
let postBody = param;
testInlineAdditionalProperties(requestBody, callback) {
let postBody = requestBody;
// verify the required parameter 'param' is set
if (param === undefined || param === null) {
throw new Error("Missing the required parameter 'param' when calling testInlineAdditionalProperties");
// verify the required parameter 'requestBody' is set
if (requestBody === undefined || requestBody === null) {
throw new Error("Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties");
}
@@ -445,7 +491,6 @@ export default class FakeApi {
/**
* test json serialization of form data
*
* @param {String} param field1
* @param {String} param2 field2
* @param {module:api/FakeApi~testJsonFormDataCallback} callback The callback function, accepting three arguments: error, data, response
@@ -476,7 +521,7 @@ export default class FakeApi {
};
let authNames = [];
let contentTypes = ['application/json'];
let contentTypes = ['application/x-www-form-urlencoded'];
let accepts = [];
let returnType = null;

View File

@@ -1,12 +1,12 @@
/**
* Swagger Petstore
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
@@ -44,16 +44,17 @@ export default class FakeClassnameTags123Api {
/**
* To test class name in snake case
* @param {module:model/Client} body client model
* To test class name in snake case
* @param {module:model/Client} client client model
* @param {module:api/FakeClassnameTags123Api~testClassnameCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Client}
*/
testClassname(body, callback) {
let postBody = body;
testClassname(client, callback) {
let postBody = client;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling testClassname");
// verify the required parameter 'client' is set
if (client === undefined || client === null) {
throw new Error("Missing the required parameter 'client' when calling testClassname");
}

View File

@@ -1,12 +1,12 @@
/**
* Swagger Petstore
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
@@ -45,16 +45,15 @@ export default class PetApi {
/**
* Add a new pet to the store
*
* @param {module:model/Pet} body Pet object that needs to be added to the store
* @param {module:model/Pet} pet Pet object that needs to be added to the store
* @param {module:api/PetApi~addPetCallback} callback The callback function, accepting three arguments: error, data, response
*/
addPet(body, callback) {
let postBody = body;
addPet(pet, callback) {
let postBody = pet;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling addPet");
// verify the required parameter 'pet' is set
if (pet === undefined || pet === null) {
throw new Error("Missing the required parameter 'pet' when calling addPet");
}
@@ -69,7 +68,7 @@ export default class PetApi {
let authNames = ['petstore_auth'];
let contentTypes = ['application/json', 'application/xml'];
let accepts = ['application/xml', 'application/json'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
@@ -89,7 +88,6 @@ export default class PetApi {
/**
* Deletes a pet
*
* @param {Number} petId Pet id to delete
* @param {Object} opts Optional parameters
* @param {String} opts.apiKey
@@ -118,7 +116,7 @@ export default class PetApi {
let authNames = ['petstore_auth'];
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
@@ -276,16 +274,15 @@ export default class PetApi {
/**
* Update an existing pet
*
* @param {module:model/Pet} body Pet object that needs to be added to the store
* @param {module:model/Pet} pet Pet object that needs to be added to the store
* @param {module:api/PetApi~updatePetCallback} callback The callback function, accepting three arguments: error, data, response
*/
updatePet(body, callback) {
let postBody = body;
updatePet(pet, callback) {
let postBody = pet;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling updatePet");
// verify the required parameter 'pet' is set
if (pet === undefined || pet === null) {
throw new Error("Missing the required parameter 'pet' when calling updatePet");
}
@@ -300,7 +297,7 @@ export default class PetApi {
let authNames = ['petstore_auth'];
let contentTypes = ['application/json', 'application/xml'];
let accepts = ['application/xml', 'application/json'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
@@ -320,7 +317,6 @@ export default class PetApi {
/**
* Updates a pet in the store with form data
*
* @param {Number} petId ID of pet that needs to be updated
* @param {Object} opts Optional parameters
* @param {String} opts.name Updated name of the pet
@@ -351,7 +347,7 @@ export default class PetApi {
let authNames = ['petstore_auth'];
let contentTypes = ['application/x-www-form-urlencoded'];
let accepts = ['application/xml', 'application/json'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
@@ -371,7 +367,6 @@ export default class PetApi {
/**
* uploads an image
*
* @param {Number} petId ID of pet to update
* @param {Object} opts Optional parameters
* @param {String} opts.additionalMetadata Additional data to pass to server

View File

@@ -1,12 +1,12 @@
/**
* Swagger Petstore
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
@@ -69,7 +69,7 @@ export default class StoreApi {
let authNames = [];
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
@@ -83,7 +83,7 @@ export default class StoreApi {
* Callback function to receive the result of the getInventory operation.
* @callback module:api/StoreApi~getInventoryCallback
* @param {String} error Error message, if any.
* @param {Object.<String, {'String': 'Number'}>} data The data returned by the service call.
* @param {Object.<String, {String: Number}>} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
@@ -91,7 +91,7 @@ export default class StoreApi {
* Returns pet inventories by status
* Returns a map of status codes to quantities
* @param {module:api/StoreApi~getInventoryCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link Object.<String, {'String': 'Number'}>}
* data is of type: {@link Object.<String, {String: Number}>}
*/
getInventory(callback) {
let postBody = null;
@@ -109,7 +109,7 @@ export default class StoreApi {
let authNames = ['api_key'];
let contentTypes = [];
let accepts = ['application/json'];
let returnType = {'String': 'Number'};
let returnType = {String: Number};
return this.apiClient.callApi(
'/store/inventory', 'GET',
@@ -174,17 +174,16 @@ export default class StoreApi {
/**
* Place an order for a pet
*
* @param {module:model/Order} body order placed for purchasing the pet
* @param {module:model/Order} order order placed for purchasing the pet
* @param {module:api/StoreApi~placeOrderCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Order}
*/
placeOrder(body, callback) {
let postBody = body;
placeOrder(order, callback) {
let postBody = order;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling placeOrder");
// verify the required parameter 'order' is set
if (order === undefined || order === null) {
throw new Error("Missing the required parameter 'order' when calling placeOrder");
}

View File

@@ -1,12 +1,12 @@
/**
* Swagger Petstore
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
@@ -45,15 +45,15 @@ export default class UserApi {
/**
* Create user
* This can only be done by the logged in user.
* @param {module:model/User} body Created user object
* @param {module:model/User} user Created user object
* @param {module:api/UserApi~createUserCallback} callback The callback function, accepting three arguments: error, data, response
*/
createUser(body, callback) {
let postBody = body;
createUser(user, callback) {
let postBody = user;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling createUser");
// verify the required parameter 'user' is set
if (user === undefined || user === null) {
throw new Error("Missing the required parameter 'user' when calling createUser");
}
@@ -68,7 +68,7 @@ export default class UserApi {
let authNames = [];
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
@@ -88,16 +88,15 @@ export default class UserApi {
/**
* Creates list of users with given input array
*
* @param {Array.<module:model/User>} body List of user object
* @param {Array.<User>} user List of user object
* @param {module:api/UserApi~createUsersWithArrayInputCallback} callback The callback function, accepting three arguments: error, data, response
*/
createUsersWithArrayInput(body, callback) {
let postBody = body;
createUsersWithArrayInput(user, callback) {
let postBody = user;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling createUsersWithArrayInput");
// verify the required parameter 'user' is set
if (user === undefined || user === null) {
throw new Error("Missing the required parameter 'user' when calling createUsersWithArrayInput");
}
@@ -112,7 +111,7 @@ export default class UserApi {
let authNames = [];
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
@@ -132,16 +131,15 @@ export default class UserApi {
/**
* Creates list of users with given input array
*
* @param {Array.<module:model/User>} body List of user object
* @param {Array.<User>} user List of user object
* @param {module:api/UserApi~createUsersWithListInputCallback} callback The callback function, accepting three arguments: error, data, response
*/
createUsersWithListInput(body, callback) {
let postBody = body;
createUsersWithListInput(user, callback) {
let postBody = user;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling createUsersWithListInput");
// verify the required parameter 'user' is set
if (user === undefined || user === null) {
throw new Error("Missing the required parameter 'user' when calling createUsersWithListInput");
}
@@ -156,7 +154,7 @@ export default class UserApi {
let authNames = [];
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
@@ -201,7 +199,7 @@ export default class UserApi {
let authNames = [];
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
@@ -221,8 +219,7 @@ export default class UserApi {
/**
* Get user by user name
*
* @param {String} username The name that needs to be fetched. Use user1 for testing.
* @param {String} username The name that needs to be fetched. Use user1 for testing.
* @param {module:api/UserApi~getUserByNameCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/User}
*/
@@ -261,17 +258,16 @@ export default class UserApi {
* Callback function to receive the result of the loginUser operation.
* @callback module:api/UserApi~loginUserCallback
* @param {String} error Error message, if any.
* @param {'String'} data The data returned by the service call.
* @param {String} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Logs user into the system
*
* @param {String} username The user name for login
* @param {String} password The password for login in clear text
* @param {module:api/UserApi~loginUserCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link 'String'}
* data is of type: {@link String}
*/
loginUser(username, password, callback) {
let postBody = null;
@@ -301,7 +297,7 @@ export default class UserApi {
let authNames = [];
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let returnType = 'String';
let returnType = String;
return this.apiClient.callApi(
'/user/login', 'GET',
@@ -320,7 +316,6 @@ export default class UserApi {
/**
* Logs out current logged in user session
*
* @param {module:api/UserApi~logoutUserCallback} callback The callback function, accepting three arguments: error, data, response
*/
logoutUser(callback) {
@@ -338,7 +333,7 @@ export default class UserApi {
let authNames = [];
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
@@ -360,20 +355,20 @@ export default class UserApi {
* Updated user
* This can only be done by the logged in user.
* @param {String} username name that need to be deleted
* @param {module:model/User} body Updated user object
* @param {module:model/User} user Updated user object
* @param {module:api/UserApi~updateUserCallback} callback The callback function, accepting three arguments: error, data, response
*/
updateUser(username, body, callback) {
let postBody = body;
updateUser(username, user, callback) {
let postBody = user;
// verify the required parameter 'username' is set
if (username === undefined || username === null) {
throw new Error("Missing the required parameter 'username' when calling updateUser");
}
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling updateUser");
// verify the required parameter 'user' is set
if (user === undefined || user === null) {
throw new Error("Missing the required parameter 'user' when calling updateUser");
}
@@ -389,7 +384,7 @@ export default class UserApi {
let authNames = [];
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(