@@ -34,13 +34,13 @@ class UserApi(baseUrl: String) {
3434 *
3535 * @param user Created user object
3636 */
37- def createUser (apiKey : String )(user : User ): Request [Either [Either [String , String ], Unit ]] =
37+ def createUser (apiKey : String )(user : User ): Request [Either [ResponseException [String , Exception ], Unit ]] =
3838 basicRequest
3939 .method(Method .POST , uri " $baseUrl/user " )
4040 .contentType(" application/json" )
4141 .header(" api_key" , apiKey)
4242 .body(user)
43- .response(asEither( asString, ignore ))
43+ .response(asString.mapWithMetadata( ResponseAs .deserializeRightWithError(_ => Right (())) ))
4444
4545 /**
4646 *
@@ -53,13 +53,13 @@ class UserApi(baseUrl: String) {
5353 *
5454 * @param user List of user object
5555 */
56- def createUsersWithArrayInput (apiKey : String )(user : Seq [User ]): Request [Either [Either [String , String ], Unit ]] =
56+ def createUsersWithArrayInput (apiKey : String )(user : Seq [User ]): Request [Either [ResponseException [String , Exception ], Unit ]] =
5757 basicRequest
5858 .method(Method .POST , uri " $baseUrl/user/createWithArray " )
5959 .contentType(" application/json" )
6060 .header(" api_key" , apiKey)
6161 .body(user)
62- .response(asEither( asString, ignore ))
62+ .response(asString.mapWithMetadata( ResponseAs .deserializeRightWithError(_ => Right (())) ))
6363
6464 /**
6565 *
@@ -72,13 +72,13 @@ class UserApi(baseUrl: String) {
7272 *
7373 * @param user List of user object
7474 */
75- def createUsersWithListInput (apiKey : String )(user : Seq [User ]): Request [Either [Either [String , String ], Unit ]] =
75+ def createUsersWithListInput (apiKey : String )(user : Seq [User ]): Request [Either [ResponseException [String , Exception ], Unit ]] =
7676 basicRequest
7777 .method(Method .POST , uri " $baseUrl/user/createWithList " )
7878 .contentType(" application/json" )
7979 .header(" api_key" , apiKey)
8080 .body(user)
81- .response(asEither( asString, ignore ))
81+ .response(asString.mapWithMetadata( ResponseAs .deserializeRightWithError(_ => Right (())) ))
8282
8383 /**
8484 * This can only be done by the logged in user.
@@ -97,7 +97,7 @@ class UserApi(baseUrl: String) {
9797 .method(Method .DELETE , uri " $baseUrl/user/ ${username}" )
9898 .contentType(" application/json" )
9999 .header(" api_key" , apiKey)
100- .response(asJson[ Unit ] )
100+ .response(asString.mapWithMetadata( ResponseAs .deserializeRightWithError(_ => Right (()))) )
101101
102102 /**
103103 *
@@ -144,12 +144,12 @@ class UserApi(baseUrl: String) {
144144 * Available security schemes:
145145 * api_key (apiKey)
146146 */
147- def logoutUser (apiKey : String )(): Request [Either [Either [String , String ], Unit ]] =
147+ def logoutUser (apiKey : String )(): Request [Either [ResponseException [String , Exception ], Unit ]] =
148148 basicRequest
149149 .method(Method .GET , uri " $baseUrl/user/logout " )
150150 .contentType(" application/json" )
151151 .header(" api_key" , apiKey)
152- .response(asEither( asString, ignore ))
152+ .response(asString.mapWithMetadata( ResponseAs .deserializeRightWithError(_ => Right (())) ))
153153
154154 /**
155155 * This can only be done by the logged in user.
@@ -170,6 +170,6 @@ class UserApi(baseUrl: String) {
170170 .contentType(" application/json" )
171171 .header(" api_key" , apiKey)
172172 .body(user)
173- .response(asJson[ Unit ] )
173+ .response(asString.mapWithMetadata( ResponseAs .deserializeRightWithError(_ => Right (()))) )
174174
175175}
0 commit comments