@@ -34,13 +34,13 @@ class UserApi(baseUrl: String) {
34
34
*
35
35
* @param user Created user object
36
36
*/
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 ]] =
38
38
basicRequest
39
39
.method(Method .POST , uri " $baseUrl/user " )
40
40
.contentType(" application/json" )
41
41
.header(" api_key" , apiKey)
42
42
.body(user)
43
- .response(asEither( asString, ignore ))
43
+ .response(asString.mapWithMetadata( ResponseAs .deserializeRightWithError(_ => Right (())) ))
44
44
45
45
/**
46
46
*
@@ -53,13 +53,13 @@ class UserApi(baseUrl: String) {
53
53
*
54
54
* @param user List of user object
55
55
*/
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 ]] =
57
57
basicRequest
58
58
.method(Method .POST , uri " $baseUrl/user/createWithArray " )
59
59
.contentType(" application/json" )
60
60
.header(" api_key" , apiKey)
61
61
.body(user)
62
- .response(asEither( asString, ignore ))
62
+ .response(asString.mapWithMetadata( ResponseAs .deserializeRightWithError(_ => Right (())) ))
63
63
64
64
/**
65
65
*
@@ -72,13 +72,13 @@ class UserApi(baseUrl: String) {
72
72
*
73
73
* @param user List of user object
74
74
*/
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 ]] =
76
76
basicRequest
77
77
.method(Method .POST , uri " $baseUrl/user/createWithList " )
78
78
.contentType(" application/json" )
79
79
.header(" api_key" , apiKey)
80
80
.body(user)
81
- .response(asEither( asString, ignore ))
81
+ .response(asString.mapWithMetadata( ResponseAs .deserializeRightWithError(_ => Right (())) ))
82
82
83
83
/**
84
84
* This can only be done by the logged in user.
@@ -97,7 +97,7 @@ class UserApi(baseUrl: String) {
97
97
.method(Method .DELETE , uri " $baseUrl/user/ ${username}" )
98
98
.contentType(" application/json" )
99
99
.header(" api_key" , apiKey)
100
- .response(asJson[ Unit ] )
100
+ .response(asString.mapWithMetadata( ResponseAs .deserializeRightWithError(_ => Right (()))) )
101
101
102
102
/**
103
103
*
@@ -144,12 +144,12 @@ class UserApi(baseUrl: String) {
144
144
* Available security schemes:
145
145
* api_key (apiKey)
146
146
*/
147
- def logoutUser (apiKey : String )(): Request [Either [Either [String , String ], Unit ]] =
147
+ def logoutUser (apiKey : String )(): Request [Either [ResponseException [String , Exception ], Unit ]] =
148
148
basicRequest
149
149
.method(Method .GET , uri " $baseUrl/user/logout " )
150
150
.contentType(" application/json" )
151
151
.header(" api_key" , apiKey)
152
- .response(asEither( asString, ignore ))
152
+ .response(asString.mapWithMetadata( ResponseAs .deserializeRightWithError(_ => Right (())) ))
153
153
154
154
/**
155
155
* This can only be done by the logged in user.
@@ -170,6 +170,6 @@ class UserApi(baseUrl: String) {
170
170
.contentType(" application/json" )
171
171
.header(" api_key" , apiKey)
172
172
.body(user)
173
- .response(asJson[ Unit ] )
173
+ .response(asString.mapWithMetadata( ResponseAs .deserializeRightWithError(_ => Right (()))) )
174
174
175
175
}
0 commit comments