Skip to content

Commit c8dac4a

Browse files
committed
Reverting these files, they don't need to change
1 parent 6f30a6d commit c8dac4a

File tree

2 files changed

+97
-94
lines changed

2 files changed

+97
-94
lines changed

samples/client/petstore/scala/src/main/scala/com/wordnik/petstore/api/PetApi.scala

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class PetApi {
1515

1616
def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value
1717

18-
def deletePet (petId: String) = {
18+
def getPetById (petId: Long) : Option[Pet]= {
1919
// create path and map variables
2020
val path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId))
2121

@@ -34,16 +34,17 @@ class PetApi {
3434
case _ => throw new Exception("missing required params")
3535
}
3636
try {
37-
apiInvoker.invokeApi(basePath, path, "DELETE", queryParams.toMap, None, headerParams.toMap, contentType) match {
37+
apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, None, headerParams.toMap, contentType) match {
3838
case s: String =>
39-
case _ => None
39+
Some(ApiInvoker.deserialize(s, "", classOf[Pet]).asInstanceOf[Pet])
40+
case _ => None
4041
}
4142
} catch {
4243
case ex: ApiException if ex.code == 404 => None
4344
case ex: ApiException => throw ex
4445
}
4546
}
46-
def getPetById (petId: Long) : Option[Pet]= {
47+
def deletePet (petId: String) = {
4748
// create path and map variables
4849
val path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}",apiInvoker.escape(petId))
4950

@@ -62,10 +63,9 @@ class PetApi {
6263
case _ => throw new Exception("missing required params")
6364
}
6465
try {
65-
apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, None, headerParams.toMap, contentType) match {
66+
apiInvoker.invokeApi(basePath, path, "DELETE", queryParams.toMap, None, headerParams.toMap, contentType) match {
6667
case s: String =>
67-
Some(ApiInvoker.deserialize(s, "", classOf[Pet]).asInstanceOf[Pet])
68-
case _ => None
68+
case _ => None
6969
}
7070
} catch {
7171
case ex: ApiException if ex.code == 404 => None
@@ -132,6 +132,30 @@ class PetApi {
132132
case ex: ApiException => throw ex
133133
}
134134
}
135+
def uploadFile (additionalMetadata: String, body: File) = {
136+
// create path and map variables
137+
val path = "/pet/uploadImage".replaceAll("\\{format\\}","json")
138+
139+
val contentType = {
140+
if(body != null && body.isInstanceOf[File] )
141+
"multipart/form-data"
142+
else "application/json"
143+
}
144+
145+
// query params
146+
val queryParams = new HashMap[String, String]
147+
val headerParams = new HashMap[String, String]
148+
149+
try {
150+
apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, body, headerParams.toMap, contentType) match {
151+
case s: String =>
152+
case _ => None
153+
}
154+
} catch {
155+
case ex: ApiException if ex.code == 404 => None
156+
case ex: ApiException => throw ex
157+
}
158+
}
135159
def addPet (body: Pet) = {
136160
// create path and map variables
137161
val path = "/pet".replaceAll("\\{format\\}","json")
@@ -246,26 +270,5 @@ class PetApi {
246270
case ex: ApiException => throw ex
247271
}
248272
}
249-
def uploadFile (additionalMetadata: String, file: File) = {
250-
// create path and map variables
251-
val path = "/pet/uploadImage".replaceAll("\\{format\\}","json")
252-
253-
val contentType = {
254-
"application/json"}
255-
256-
// query params
257-
val queryParams = new HashMap[String, String]
258-
val headerParams = new HashMap[String, String]
259-
260-
try {
261-
apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, None, headerParams.toMap, contentType) match {
262-
case s: String =>
263-
case _ => None
264-
}
265-
} catch {
266-
case ex: ApiException if ex.code == 404 => None
267-
case ex: ApiException => throw ex
268-
}
269-
}
270273
}
271274

samples/client/petstore/scala/src/main/scala/com/wordnik/petstore/api/UserApi.scala

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ class UserApi {
1515

1616
def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value
1717

18-
def createUser (body: User) = {
18+
def updateUser (username: String, body: User) = {
1919
// create path and map variables
20-
val path = "/user".replaceAll("\\{format\\}","json")
20+
val path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username))
21+
22+
2123

2224
val contentType = {
2325
if(body != null && body.isInstanceOf[File] )
@@ -30,12 +32,12 @@ class UserApi {
3032
val headerParams = new HashMap[String, String]
3133

3234
// verify required params are set
33-
(List(body).filter(_ != null)).size match {
34-
case 1 => // all required values set
35+
(List(username, body).filter(_ != null)).size match {
36+
case 2 => // all required values set
3537
case _ => throw new Exception("missing required params")
3638
}
3739
try {
38-
apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, body, headerParams.toMap, contentType) match {
40+
apiInvoker.invokeApi(basePath, path, "PUT", queryParams.toMap, body, headerParams.toMap, contentType) match {
3941
case s: String =>
4042
case _ => None
4143
}
@@ -44,27 +46,26 @@ class UserApi {
4446
case ex: ApiException => throw ex
4547
}
4648
}
47-
def createUsersWithArrayInput (body: List[User]) = {
49+
def deleteUser (username: String) = {
4850
// create path and map variables
49-
val path = "/user/createWithArray".replaceAll("\\{format\\}","json")
51+
val path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username))
52+
53+
5054

5155
val contentType = {
52-
if(body != null && body.isInstanceOf[File] )
53-
"multipart/form-data"
54-
else "application/json"
55-
}
56+
"application/json"}
5657

5758
// query params
5859
val queryParams = new HashMap[String, String]
5960
val headerParams = new HashMap[String, String]
6061

6162
// verify required params are set
62-
(List(body).filter(_ != null)).size match {
63+
(List(username).filter(_ != null)).size match {
6364
case 1 => // all required values set
6465
case _ => throw new Exception("missing required params")
6566
}
6667
try {
67-
apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, body, headerParams.toMap, contentType) match {
68+
apiInvoker.invokeApi(basePath, path, "DELETE", queryParams.toMap, None, headerParams.toMap, contentType) match {
6869
case s: String =>
6970
case _ => None
7071
}
@@ -73,71 +74,67 @@ class UserApi {
7374
case ex: ApiException => throw ex
7475
}
7576
}
76-
def createUsersWithListInput (body: List[User]) = {
77+
def getUserByName (username: String) : Option[User]= {
7778
// create path and map variables
78-
val path = "/user/createWithList".replaceAll("\\{format\\}","json")
79+
val path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username))
80+
81+
7982

8083
val contentType = {
81-
if(body != null && body.isInstanceOf[File] )
82-
"multipart/form-data"
83-
else "application/json"
84-
}
84+
"application/json"}
8585

8686
// query params
8787
val queryParams = new HashMap[String, String]
8888
val headerParams = new HashMap[String, String]
8989

9090
// verify required params are set
91-
(List(body).filter(_ != null)).size match {
91+
(List(username).filter(_ != null)).size match {
9292
case 1 => // all required values set
9393
case _ => throw new Exception("missing required params")
9494
}
9595
try {
96-
apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, body, headerParams.toMap, contentType) match {
96+
apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, None, headerParams.toMap, contentType) match {
9797
case s: String =>
98-
case _ => None
98+
Some(ApiInvoker.deserialize(s, "", classOf[User]).asInstanceOf[User])
99+
case _ => None
99100
}
100101
} catch {
101102
case ex: ApiException if ex.code == 404 => None
102103
case ex: ApiException => throw ex
103104
}
104105
}
105-
def updateUser (username: String, body: User) = {
106+
def loginUser (username: String, password: String) : Option[String]= {
106107
// create path and map variables
107-
val path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username))
108-
109-
108+
val path = "/user/login".replaceAll("\\{format\\}","json")
110109

111110
val contentType = {
112-
if(body != null && body.isInstanceOf[File] )
113-
"multipart/form-data"
114-
else "application/json"
115-
}
111+
"application/json"}
116112

117113
// query params
118114
val queryParams = new HashMap[String, String]
119115
val headerParams = new HashMap[String, String]
120116

121117
// verify required params are set
122-
(List(username, body).filter(_ != null)).size match {
118+
(List(username, password).filter(_ != null)).size match {
123119
case 2 => // all required values set
124120
case _ => throw new Exception("missing required params")
125121
}
122+
if(String.valueOf(username) != "null") queryParams += "username" -> username.toString
123+
if(String.valueOf(password) != "null") queryParams += "password" -> password.toString
126124
try {
127-
apiInvoker.invokeApi(basePath, path, "PUT", queryParams.toMap, body, headerParams.toMap, contentType) match {
125+
apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, None, headerParams.toMap, contentType) match {
128126
case s: String =>
129-
case _ => None
127+
Some(ApiInvoker.deserialize(s, "", classOf[String]).asInstanceOf[String])
128+
case _ => None
130129
}
131130
} catch {
132131
case ex: ApiException if ex.code == 404 => None
133132
case ex: ApiException => throw ex
134133
}
135134
}
136-
def deleteUser (username: String) = {
135+
def logoutUser () = {
137136
// create path and map variables
138-
val path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username))
139-
140-
137+
val path = "/user/logout".replaceAll("\\{format\\}","json")
141138

142139
val contentType = {
143140
"application/json"}
@@ -146,13 +143,8 @@ class UserApi {
146143
val queryParams = new HashMap[String, String]
147144
val headerParams = new HashMap[String, String]
148145

149-
// verify required params are set
150-
(List(username).filter(_ != null)).size match {
151-
case 1 => // all required values set
152-
case _ => throw new Exception("missing required params")
153-
}
154146
try {
155-
apiInvoker.invokeApi(basePath, path, "DELETE", queryParams.toMap, None, headerParams.toMap, contentType) match {
147+
apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, None, headerParams.toMap, contentType) match {
156148
case s: String =>
157149
case _ => None
158150
}
@@ -161,77 +153,85 @@ class UserApi {
161153
case ex: ApiException => throw ex
162154
}
163155
}
164-
def getUserByName (username: String) : Option[User]= {
156+
def createUser (body: User) = {
165157
// create path and map variables
166-
val path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}",apiInvoker.escape(username))
167-
168-
158+
val path = "/user".replaceAll("\\{format\\}","json")
169159

170160
val contentType = {
171-
"application/json"}
161+
if(body != null && body.isInstanceOf[File] )
162+
"multipart/form-data"
163+
else "application/json"
164+
}
172165

173166
// query params
174167
val queryParams = new HashMap[String, String]
175168
val headerParams = new HashMap[String, String]
176169

177170
// verify required params are set
178-
(List(username).filter(_ != null)).size match {
171+
(List(body).filter(_ != null)).size match {
179172
case 1 => // all required values set
180173
case _ => throw new Exception("missing required params")
181174
}
182175
try {
183-
apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, None, headerParams.toMap, contentType) match {
176+
apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, body, headerParams.toMap, contentType) match {
184177
case s: String =>
185-
Some(ApiInvoker.deserialize(s, "", classOf[User]).asInstanceOf[User])
186-
case _ => None
178+
case _ => None
187179
}
188180
} catch {
189181
case ex: ApiException if ex.code == 404 => None
190182
case ex: ApiException => throw ex
191183
}
192184
}
193-
def loginUser (username: String, password: String) : Option[String]= {
185+
def createUsersWithArrayInput (body: List[User]) = {
194186
// create path and map variables
195-
val path = "/user/login".replaceAll("\\{format\\}","json")
187+
val path = "/user/createWithArray".replaceAll("\\{format\\}","json")
196188

197189
val contentType = {
198-
"application/json"}
190+
if(body != null && body.isInstanceOf[File] )
191+
"multipart/form-data"
192+
else "application/json"
193+
}
199194

200195
// query params
201196
val queryParams = new HashMap[String, String]
202197
val headerParams = new HashMap[String, String]
203198

204199
// verify required params are set
205-
(List(username, password).filter(_ != null)).size match {
206-
case 2 => // all required values set
200+
(List(body).filter(_ != null)).size match {
201+
case 1 => // all required values set
207202
case _ => throw new Exception("missing required params")
208203
}
209-
if(String.valueOf(username) != "null") queryParams += "username" -> username.toString
210-
if(String.valueOf(password) != "null") queryParams += "password" -> password.toString
211204
try {
212-
apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, None, headerParams.toMap, contentType) match {
205+
apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, body, headerParams.toMap, contentType) match {
213206
case s: String =>
214-
Some(ApiInvoker.deserialize(s, "", classOf[String]).asInstanceOf[String])
215-
case _ => None
207+
case _ => None
216208
}
217209
} catch {
218210
case ex: ApiException if ex.code == 404 => None
219211
case ex: ApiException => throw ex
220212
}
221213
}
222-
def logoutUser () = {
214+
def createUsersWithListInput (body: List[User]) = {
223215
// create path and map variables
224-
val path = "/user/logout".replaceAll("\\{format\\}","json")
216+
val path = "/user/createWithList".replaceAll("\\{format\\}","json")
225217

226218
val contentType = {
227-
"application/json"}
219+
if(body != null && body.isInstanceOf[File] )
220+
"multipart/form-data"
221+
else "application/json"
222+
}
228223

229224
// query params
230225
val queryParams = new HashMap[String, String]
231226
val headerParams = new HashMap[String, String]
232227

228+
// verify required params are set
229+
(List(body).filter(_ != null)).size match {
230+
case 1 => // all required values set
231+
case _ => throw new Exception("missing required params")
232+
}
233233
try {
234-
apiInvoker.invokeApi(basePath, path, "GET", queryParams.toMap, None, headerParams.toMap, contentType) match {
234+
apiInvoker.invokeApi(basePath, path, "POST", queryParams.toMap, body, headerParams.toMap, contentType) match {
235235
case s: String =>
236236
case _ => None
237237
}

0 commit comments

Comments
 (0)