forked from loafle/openapi-generator-original
remove default value from api (#2351)
This commit is contained in:
parent
f39e200e5d
commit
b0aac250c6
@ -72,7 +72,7 @@ class {{classname}}(
|
|||||||
{{#allParams}} * @param {{paramName}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
|
{{#allParams}} * @param {{paramName}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
|
||||||
{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
|
{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
|
||||||
*/
|
*/
|
||||||
def {{operationId}}({{#allParams}}{{paramName}}: {{#required}}{{dataType}}{{#defaultValue}} = {{#isString}}"{{{defaultValue}}}"{{/isString}}{{^isString}}{{#isByteArray}}"{{/isByteArray}}{{#isDate}}dateFormatter.parse("{{/isDate}}{{#isDateTime}}dateTimeFormatter.parse("{{/isDateTime}}{{{defaultValue}}}{{#isDate}}"){{/isDate}}{{#isDateTime}}"){{/isDateTime}}{{#isByteArray}}".getBytes{{/isByteArray}}{{/isString}}{{/defaultValue}}{{/required}}{{^required}}Option[{{dataType}}]{{#defaultValue}} = Option({{#isString}}"{{{defaultValue}}}"{{/isString}}{{^isString}}{{#isByteArray}}"{{/isByteArray}}{{#isDate}}dateFormatter.parse("{{/isDate}}{{#isDateTime}}dateTimeFormatter.parse("{{/isDateTime}}{{{defaultValue}}}{{#isDate}}"){{/isDate}}{{#isDateTime}}"){{/isDateTime}}{{#isByteArray}}".getBytes{{/isByteArray}}{{/isString}}){{/defaultValue}}{{^defaultValue}} = None{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}}: Option[{{returnType}}]{{/returnType}} = {
|
def {{operationId}}({{#allParams}}{{paramName}}: {{#required}}{{dataType}}{{/required}}{{^required}}Option[{{dataType}}] = None{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}}: Option[{{returnType}}]{{/returnType}} = {
|
||||||
val await = Try(Await.result({{operationId}}Async({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}), Duration.Inf))
|
val await = Try(Await.result({{operationId}}Async({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}), Duration.Inf))
|
||||||
await match {
|
await match {
|
||||||
case Success(i) => Some(await.get)
|
case Success(i) => Some(await.get)
|
||||||
@ -87,7 +87,7 @@ class {{classname}}(
|
|||||||
{{#allParams}} * @param {{paramName}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
|
{{#allParams}} * @param {{paramName}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
|
||||||
{{/allParams}} * @return Future({{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}})
|
{{/allParams}} * @return Future({{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}})
|
||||||
*/
|
*/
|
||||||
def {{operationId}}Async({{#allParams}}{{paramName}}: {{#required}}{{dataType}}{{#defaultValue}} = {{#isString}}"{{{defaultValue}}}"{{/isString}}{{^isString}}{{#isByteArray}}"{{/isByteArray}}{{#isDate}}dateFormatter.parse("{{/isDate}}{{#isDateTime}}dateTimeFormatter.parse("{{/isDateTime}}{{{defaultValue}}}{{#isDate}}"){{/isDate}}{{#isDateTime}}"){{/isDateTime}}{{#isByteArray}}".getBytes{{/isByteArray}}{{/isString}}{{/defaultValue}}{{/required}}{{^required}}Option[{{dataType}}]{{#defaultValue}} = Option({{#isString}}"{{{defaultValue}}}"{{/isString}}{{^isString}}{{#isByteArray}}"{{/isByteArray}}{{#isDate}}dateFormatter.parse("{{/isDate}}{{#isDateTime}}dateTimeFormatter.parse("{{/isDateTime}}{{{defaultValue}}}{{#isDate}}"){{/isDate}}{{#isDateTime}}"){{/isDateTime}}{{#isByteArray}}".getBytes{{/isByteArray}}{{/isString}}){{/defaultValue}}{{^defaultValue}} = None{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}}: Future[{{returnType}}]{{/returnType}} = {
|
def {{operationId}}Async({{#allParams}}{{paramName}}: {{#required}}{{dataType}}{{/required}}{{^required}}Option[{{dataType}}] = None{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}}: Future[{{returnType}}]{{/returnType}} = {
|
||||||
helper.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
|
helper.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,8 +97,8 @@ class {{classname}}(
|
|||||||
class {{classname}}AsyncHelper(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) {
|
class {{classname}}AsyncHelper(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) {
|
||||||
|
|
||||||
{{#operation}}
|
{{#operation}}
|
||||||
def {{operationId}}({{#allParams}}{{^required}}{{paramName}}: Option[{{dataType}}] = {{#defaultValue}}Option({{#isString}}"{{{defaultValue}}}"{{/isString}}{{^isString}}{{#isByteArray}}"{{/isByteArray}}{{#isDate}}dateFormatter.parse("{{/isDate}}{{#isDateTime}}dateTimeFormatter.parse("{{/isDateTime}}{{{defaultValue}}}{{#isDate}}"){{/isDate}}{{#isDateTime}}"){{/isDateTime}}{{#isByteArray}}".getBytes{{/isByteArray}}{{/isString}}){{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{#hasMore}},{{/hasMore}}
|
def {{operationId}}({{#allParams}}{{^required}}{{paramName}}: Option[{{dataType}}] = None{{#hasMore}},{{/hasMore}}
|
||||||
{{/required}}{{#required}}{{paramName}}: {{dataType}}{{#defaultValue}} = {{#isString}}"{{{defaultValue}}}"{{/isString}}{{^isString}}{{#isByteArray}}"{{/isByteArray}}{{#isDate}}dateFormatter.parse("{{/isDate}}{{#isDateTime}}dateTimeFormatter.parse("{{/isDateTime}}{{{defaultValue}}}{{#isDate}}"){{/isDate}}{{#isDateTime}}"){{/isDateTime}}{{#isByteArray}}".getBytes{{/isByteArray}}{{/isString}}{{/defaultValue}}{{#hasMore}},
|
{{/required}}{{#required}}{{paramName}}: {{dataType}}{{#hasMore}},
|
||||||
{{/hasMore}}{{/required}}{{/allParams}})(implicit reader: ClientResponseReader[{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}]{{#bodyParams}}, writer: RequestWriter[{{^required}}Option[{{dataType}}]{{/required}}{{#required}}{{dataType}}{{/required}}]{{/bodyParams}}){{#returnType}}: Future[{{returnType}}]{{/returnType}}{{^returnType}}: Future[Unit]{{/returnType}} = {
|
{{/hasMore}}{{/required}}{{/allParams}})(implicit reader: ClientResponseReader[{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}]{{#bodyParams}}, writer: RequestWriter[{{^required}}Option[{{dataType}}]{{/required}}{{#required}}{{dataType}}{{/required}}]{{/bodyParams}}){{#returnType}}: Future[{{returnType}}]{{/returnType}}{{^returnType}}: Future[Unit]{{/returnType}} = {
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
val path = (addFmt("{{path}}"){{#pathParams}}
|
val path = (addFmt("{{path}}"){{#pathParams}}
|
||||||
|
@ -1 +1 @@
|
|||||||
3.0.0-SNAPSHOT
|
4.0.0-SNAPSHOT
|
@ -79,11 +79,11 @@ class PetApi(
|
|||||||
* Add a new pet to the store
|
* Add a new pet to the store
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param pet Pet object that needs to be added to the store
|
* @param body Pet object that needs to be added to the store
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
def addPet(pet: Pet) = {
|
def addPet(body: Pet) = {
|
||||||
val await = Try(Await.result(addPetAsync(pet), Duration.Inf))
|
val await = Try(Await.result(addPetAsync(body), Duration.Inf))
|
||||||
await match {
|
await match {
|
||||||
case Success(i) => Some(await.get)
|
case Success(i) => Some(await.get)
|
||||||
case Failure(t) => None
|
case Failure(t) => None
|
||||||
@ -94,11 +94,11 @@ class PetApi(
|
|||||||
* Add a new pet to the store asynchronously
|
* Add a new pet to the store asynchronously
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param pet Pet object that needs to be added to the store
|
* @param body Pet object that needs to be added to the store
|
||||||
* @return Future(void)
|
* @return Future(void)
|
||||||
*/
|
*/
|
||||||
def addPetAsync(pet: Pet) = {
|
def addPetAsync(body: Pet) = {
|
||||||
helper.addPet(pet)
|
helper.addPet(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -211,11 +211,11 @@ class PetApi(
|
|||||||
* Update an existing pet
|
* Update an existing pet
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param pet Pet object that needs to be added to the store
|
* @param body Pet object that needs to be added to the store
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
def updatePet(pet: Pet) = {
|
def updatePet(body: Pet) = {
|
||||||
val await = Try(Await.result(updatePetAsync(pet), Duration.Inf))
|
val await = Try(Await.result(updatePetAsync(body), Duration.Inf))
|
||||||
await match {
|
await match {
|
||||||
case Success(i) => Some(await.get)
|
case Success(i) => Some(await.get)
|
||||||
case Failure(t) => None
|
case Failure(t) => None
|
||||||
@ -226,11 +226,11 @@ class PetApi(
|
|||||||
* Update an existing pet asynchronously
|
* Update an existing pet asynchronously
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param pet Pet object that needs to be added to the store
|
* @param body Pet object that needs to be added to the store
|
||||||
* @return Future(void)
|
* @return Future(void)
|
||||||
*/
|
*/
|
||||||
def updatePetAsync(pet: Pet) = {
|
def updatePetAsync(body: Pet) = {
|
||||||
helper.updatePet(pet)
|
helper.updatePet(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -297,7 +297,7 @@ class PetApi(
|
|||||||
|
|
||||||
class PetApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) {
|
class PetApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) {
|
||||||
|
|
||||||
def addPet(pet: Pet)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[Pet]): Future[Unit] = {
|
def addPet(body: Pet)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[Pet]): Future[Unit] = {
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
val path = (addFmt("/pet"))
|
val path = (addFmt("/pet"))
|
||||||
|
|
||||||
@ -305,9 +305,9 @@ class PetApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends
|
|||||||
val queryParams = new mutable.HashMap[String, String]
|
val queryParams = new mutable.HashMap[String, String]
|
||||||
val headerParams = new mutable.HashMap[String, String]
|
val headerParams = new mutable.HashMap[String, String]
|
||||||
|
|
||||||
if (pet == null) throw new Exception("Missing required parameter 'pet' when calling PetApi->addPet")
|
if (body == null) throw new Exception("Missing required parameter 'body' when calling PetApi->addPet")
|
||||||
|
|
||||||
val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(pet))
|
val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body))
|
||||||
resFuture flatMap { resp =>
|
resFuture flatMap { resp =>
|
||||||
process(reader.read(resp))
|
process(reader.read(resp))
|
||||||
}
|
}
|
||||||
@ -385,7 +385,7 @@ class PetApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def updatePet(pet: Pet)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[Pet]): Future[Unit] = {
|
def updatePet(body: Pet)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[Pet]): Future[Unit] = {
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
val path = (addFmt("/pet"))
|
val path = (addFmt("/pet"))
|
||||||
|
|
||||||
@ -393,9 +393,9 @@ class PetApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends
|
|||||||
val queryParams = new mutable.HashMap[String, String]
|
val queryParams = new mutable.HashMap[String, String]
|
||||||
val headerParams = new mutable.HashMap[String, String]
|
val headerParams = new mutable.HashMap[String, String]
|
||||||
|
|
||||||
if (pet == null) throw new Exception("Missing required parameter 'pet' when calling PetApi->updatePet")
|
if (body == null) throw new Exception("Missing required parameter 'body' when calling PetApi->updatePet")
|
||||||
|
|
||||||
val resFuture = client.submit("PUT", path, queryParams.toMap, headerParams.toMap, writer.write(pet))
|
val resFuture = client.submit("PUT", path, queryParams.toMap, headerParams.toMap, writer.write(body))
|
||||||
resFuture flatMap { resp =>
|
resFuture flatMap { resp =>
|
||||||
process(reader.read(resp))
|
process(reader.read(resp))
|
||||||
}
|
}
|
||||||
|
@ -153,11 +153,11 @@ class StoreApi(
|
|||||||
* Place an order for a pet
|
* Place an order for a pet
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param order order placed for purchasing the pet
|
* @param body order placed for purchasing the pet
|
||||||
* @return Order
|
* @return Order
|
||||||
*/
|
*/
|
||||||
def placeOrder(order: Order): Option[Order] = {
|
def placeOrder(body: Order): Option[Order] = {
|
||||||
val await = Try(Await.result(placeOrderAsync(order), Duration.Inf))
|
val await = Try(Await.result(placeOrderAsync(body), Duration.Inf))
|
||||||
await match {
|
await match {
|
||||||
case Success(i) => Some(await.get)
|
case Success(i) => Some(await.get)
|
||||||
case Failure(t) => None
|
case Failure(t) => None
|
||||||
@ -168,11 +168,11 @@ class StoreApi(
|
|||||||
* Place an order for a pet asynchronously
|
* Place an order for a pet asynchronously
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param order order placed for purchasing the pet
|
* @param body order placed for purchasing the pet
|
||||||
* @return Future(Order)
|
* @return Future(Order)
|
||||||
*/
|
*/
|
||||||
def placeOrderAsync(order: Order): Future[Order] = {
|
def placeOrderAsync(body: Order): Future[Order] = {
|
||||||
helper.placeOrder(order)
|
helper.placeOrder(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -228,7 +228,7 @@ class StoreApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extend
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def placeOrder(order: Order)(implicit reader: ClientResponseReader[Order], writer: RequestWriter[Order]): Future[Order] = {
|
def placeOrder(body: Order)(implicit reader: ClientResponseReader[Order], writer: RequestWriter[Order]): Future[Order] = {
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
val path = (addFmt("/store/order"))
|
val path = (addFmt("/store/order"))
|
||||||
|
|
||||||
@ -236,9 +236,9 @@ class StoreApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extend
|
|||||||
val queryParams = new mutable.HashMap[String, String]
|
val queryParams = new mutable.HashMap[String, String]
|
||||||
val headerParams = new mutable.HashMap[String, String]
|
val headerParams = new mutable.HashMap[String, String]
|
||||||
|
|
||||||
if (order == null) throw new Exception("Missing required parameter 'order' when calling StoreApi->placeOrder")
|
if (body == null) throw new Exception("Missing required parameter 'body' when calling StoreApi->placeOrder")
|
||||||
|
|
||||||
val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(order))
|
val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body))
|
||||||
resFuture flatMap { resp =>
|
resFuture flatMap { resp =>
|
||||||
process(reader.read(resp))
|
process(reader.read(resp))
|
||||||
}
|
}
|
||||||
|
@ -77,11 +77,11 @@ class UserApi(
|
|||||||
* Create user
|
* Create user
|
||||||
* This can only be done by the logged in user.
|
* This can only be done by the logged in user.
|
||||||
*
|
*
|
||||||
* @param user Created user object
|
* @param body Created user object
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
def createUser(user: User) = {
|
def createUser(body: User) = {
|
||||||
val await = Try(Await.result(createUserAsync(user), Duration.Inf))
|
val await = Try(Await.result(createUserAsync(body), Duration.Inf))
|
||||||
await match {
|
await match {
|
||||||
case Success(i) => Some(await.get)
|
case Success(i) => Some(await.get)
|
||||||
case Failure(t) => None
|
case Failure(t) => None
|
||||||
@ -92,22 +92,22 @@ class UserApi(
|
|||||||
* Create user asynchronously
|
* Create user asynchronously
|
||||||
* This can only be done by the logged in user.
|
* This can only be done by the logged in user.
|
||||||
*
|
*
|
||||||
* @param user Created user object
|
* @param body Created user object
|
||||||
* @return Future(void)
|
* @return Future(void)
|
||||||
*/
|
*/
|
||||||
def createUserAsync(user: User) = {
|
def createUserAsync(body: User) = {
|
||||||
helper.createUser(user)
|
helper.createUser(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates list of users with given input array
|
* Creates list of users with given input array
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param user List of user object
|
* @param body List of user object
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
def createUsersWithArrayInput(user: List[User]) = {
|
def createUsersWithArrayInput(body: List[User]) = {
|
||||||
val await = Try(Await.result(createUsersWithArrayInputAsync(user), Duration.Inf))
|
val await = Try(Await.result(createUsersWithArrayInputAsync(body), Duration.Inf))
|
||||||
await match {
|
await match {
|
||||||
case Success(i) => Some(await.get)
|
case Success(i) => Some(await.get)
|
||||||
case Failure(t) => None
|
case Failure(t) => None
|
||||||
@ -118,22 +118,22 @@ class UserApi(
|
|||||||
* Creates list of users with given input array asynchronously
|
* Creates list of users with given input array asynchronously
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param user List of user object
|
* @param body List of user object
|
||||||
* @return Future(void)
|
* @return Future(void)
|
||||||
*/
|
*/
|
||||||
def createUsersWithArrayInputAsync(user: List[User]) = {
|
def createUsersWithArrayInputAsync(body: List[User]) = {
|
||||||
helper.createUsersWithArrayInput(user)
|
helper.createUsersWithArrayInput(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates list of users with given input array
|
* Creates list of users with given input array
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param user List of user object
|
* @param body List of user object
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
def createUsersWithListInput(user: List[User]) = {
|
def createUsersWithListInput(body: List[User]) = {
|
||||||
val await = Try(Await.result(createUsersWithListInputAsync(user), Duration.Inf))
|
val await = Try(Await.result(createUsersWithListInputAsync(body), Duration.Inf))
|
||||||
await match {
|
await match {
|
||||||
case Success(i) => Some(await.get)
|
case Success(i) => Some(await.get)
|
||||||
case Failure(t) => None
|
case Failure(t) => None
|
||||||
@ -144,11 +144,11 @@ class UserApi(
|
|||||||
* Creates list of users with given input array asynchronously
|
* Creates list of users with given input array asynchronously
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param user List of user object
|
* @param body List of user object
|
||||||
* @return Future(void)
|
* @return Future(void)
|
||||||
*/
|
*/
|
||||||
def createUsersWithListInputAsync(user: List[User]) = {
|
def createUsersWithListInputAsync(body: List[User]) = {
|
||||||
helper.createUsersWithListInput(user)
|
helper.createUsersWithListInput(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -260,11 +260,11 @@ class UserApi(
|
|||||||
* This can only be done by the logged in user.
|
* This can only be done by the logged in user.
|
||||||
*
|
*
|
||||||
* @param username name that need to be deleted
|
* @param username name that need to be deleted
|
||||||
* @param user Updated user object
|
* @param body Updated user object
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
def updateUser(username: String, user: User) = {
|
def updateUser(username: String, body: User) = {
|
||||||
val await = Try(Await.result(updateUserAsync(username, user), Duration.Inf))
|
val await = Try(Await.result(updateUserAsync(username, body), Duration.Inf))
|
||||||
await match {
|
await match {
|
||||||
case Success(i) => Some(await.get)
|
case Success(i) => Some(await.get)
|
||||||
case Failure(t) => None
|
case Failure(t) => None
|
||||||
@ -276,18 +276,18 @@ class UserApi(
|
|||||||
* This can only be done by the logged in user.
|
* This can only be done by the logged in user.
|
||||||
*
|
*
|
||||||
* @param username name that need to be deleted
|
* @param username name that need to be deleted
|
||||||
* @param user Updated user object
|
* @param body Updated user object
|
||||||
* @return Future(void)
|
* @return Future(void)
|
||||||
*/
|
*/
|
||||||
def updateUserAsync(username: String, user: User) = {
|
def updateUserAsync(username: String, body: User) = {
|
||||||
helper.updateUser(username, user)
|
helper.updateUser(username, body)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class UserApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) {
|
class UserApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) {
|
||||||
|
|
||||||
def createUser(user: User)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[User]): Future[Unit] = {
|
def createUser(body: User)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[User]): Future[Unit] = {
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
val path = (addFmt("/user"))
|
val path = (addFmt("/user"))
|
||||||
|
|
||||||
@ -295,15 +295,15 @@ class UserApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends
|
|||||||
val queryParams = new mutable.HashMap[String, String]
|
val queryParams = new mutable.HashMap[String, String]
|
||||||
val headerParams = new mutable.HashMap[String, String]
|
val headerParams = new mutable.HashMap[String, String]
|
||||||
|
|
||||||
if (user == null) throw new Exception("Missing required parameter 'user' when calling UserApi->createUser")
|
if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->createUser")
|
||||||
|
|
||||||
val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(user))
|
val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body))
|
||||||
resFuture flatMap { resp =>
|
resFuture flatMap { resp =>
|
||||||
process(reader.read(resp))
|
process(reader.read(resp))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def createUsersWithArrayInput(user: List[User])(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[List[User]]): Future[Unit] = {
|
def createUsersWithArrayInput(body: List[User])(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[List[User]]): Future[Unit] = {
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
val path = (addFmt("/user/createWithArray"))
|
val path = (addFmt("/user/createWithArray"))
|
||||||
|
|
||||||
@ -311,15 +311,15 @@ class UserApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends
|
|||||||
val queryParams = new mutable.HashMap[String, String]
|
val queryParams = new mutable.HashMap[String, String]
|
||||||
val headerParams = new mutable.HashMap[String, String]
|
val headerParams = new mutable.HashMap[String, String]
|
||||||
|
|
||||||
if (user == null) throw new Exception("Missing required parameter 'user' when calling UserApi->createUsersWithArrayInput")
|
if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->createUsersWithArrayInput")
|
||||||
|
|
||||||
val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(user))
|
val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body))
|
||||||
resFuture flatMap { resp =>
|
resFuture flatMap { resp =>
|
||||||
process(reader.read(resp))
|
process(reader.read(resp))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def createUsersWithListInput(user: List[User])(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[List[User]]): Future[Unit] = {
|
def createUsersWithListInput(body: List[User])(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[List[User]]): Future[Unit] = {
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
val path = (addFmt("/user/createWithList"))
|
val path = (addFmt("/user/createWithList"))
|
||||||
|
|
||||||
@ -327,9 +327,9 @@ class UserApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends
|
|||||||
val queryParams = new mutable.HashMap[String, String]
|
val queryParams = new mutable.HashMap[String, String]
|
||||||
val headerParams = new mutable.HashMap[String, String]
|
val headerParams = new mutable.HashMap[String, String]
|
||||||
|
|
||||||
if (user == null) throw new Exception("Missing required parameter 'user' when calling UserApi->createUsersWithListInput")
|
if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->createUsersWithListInput")
|
||||||
|
|
||||||
val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(user))
|
val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body))
|
||||||
resFuture flatMap { resp =>
|
resFuture flatMap { resp =>
|
||||||
process(reader.read(resp))
|
process(reader.read(resp))
|
||||||
}
|
}
|
||||||
@ -409,7 +409,7 @@ class UserApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends
|
|||||||
}
|
}
|
||||||
|
|
||||||
def updateUser(username: String,
|
def updateUser(username: String,
|
||||||
user: User)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[User]): Future[Unit] = {
|
body: User)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[User]): Future[Unit] = {
|
||||||
// create path and map variables
|
// create path and map variables
|
||||||
val path = (addFmt("/user/{username}")
|
val path = (addFmt("/user/{username}")
|
||||||
replaceAll("\\{" + "username" + "\\}", username.toString))
|
replaceAll("\\{" + "username" + "\\}", username.toString))
|
||||||
@ -420,9 +420,9 @@ class UserApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends
|
|||||||
|
|
||||||
if (username == null) throw new Exception("Missing required parameter 'username' when calling UserApi->updateUser")
|
if (username == null) throw new Exception("Missing required parameter 'username' when calling UserApi->updateUser")
|
||||||
|
|
||||||
if (user == null) throw new Exception("Missing required parameter 'user' when calling UserApi->updateUser")
|
if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->updateUser")
|
||||||
|
|
||||||
val resFuture = client.submit("PUT", path, queryParams.toMap, headerParams.toMap, writer.write(user))
|
val resFuture = client.submit("PUT", path, queryParams.toMap, headerParams.toMap, writer.write(body))
|
||||||
resFuture flatMap { resp =>
|
resFuture flatMap { resp =>
|
||||||
process(reader.read(resp))
|
process(reader.read(resp))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user