Skip to content

Commit 755672e

Browse files
jimschubertMikailBag
authored andcommitted
[scala] Regenerate akka sample (OpenAPITools#5622)
1 parent 7b98228 commit 755672e

File tree

4 files changed

+25
-63
lines changed

4 files changed

+25
-63
lines changed

samples/client/petstore/scala-akka/README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ Class | Method | HTTP request | Description
9191

9292
- [ApiResponse](ApiResponse.md)
9393
- [Category](Category.md)
94-
- [InlineObject](InlineObject.md)
95-
- [InlineObject1](InlineObject1.md)
9694
- [Order](Order.md)
9795
- [Pet](Pet.md)
9896
- [Tag](Tag.md)
@@ -108,12 +106,6 @@ Authentication schemes defined for the API:
108106
- **API key parameter name**: api_key
109107
- **Location**: HTTP header
110108

111-
### auth_cookie
112-
113-
- **Type**: API key
114-
- **API key parameter name**: AUTH_KEY
115-
- **Location**:
116-
117109

118110
## Author
119111

samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/PetApi.scala

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,13 @@ class PetApi(baseUrl: String) {
2727

2828
/**
2929
* Expected answers:
30-
* code 200 : Pet (successful operation)
3130
* code 405 : (Invalid input)
3231
*
33-
* @param pet Pet object that needs to be added to the store
32+
* @param body Pet object that needs to be added to the store
3433
*/
35-
def addPet(pet: Pet): ApiRequest[Pet] =
36-
ApiRequest[Pet](ApiMethods.POST, baseUrl, "/pet", "application/json")
37-
.withBody(pet)
38-
.withSuccessResponse[Pet](200)
34+
def addPet(body: Pet): ApiRequest[Unit] =
35+
ApiRequest[Unit](ApiMethods.POST, baseUrl, "/pet", "application/json")
36+
.withBody(body)
3937
.withErrorResponse[Unit](405)
4038

4139

@@ -109,17 +107,15 @@ class PetApi(baseUrl: String) {
109107

110108
/**
111109
* Expected answers:
112-
* code 200 : Pet (successful operation)
113110
* code 400 : (Invalid ID supplied)
114111
* code 404 : (Pet not found)
115112
* code 405 : (Validation exception)
116113
*
117-
* @param pet Pet object that needs to be added to the store
114+
* @param body Pet object that needs to be added to the store
118115
*/
119-
def updatePet(pet: Pet): ApiRequest[Pet] =
120-
ApiRequest[Pet](ApiMethods.PUT, baseUrl, "/pet", "application/json")
121-
.withBody(pet)
122-
.withSuccessResponse[Pet](200)
116+
def updatePet(body: Pet): ApiRequest[Unit] =
117+
ApiRequest[Unit](ApiMethods.PUT, baseUrl, "/pet", "application/json")
118+
.withBody(body)
123119
.withErrorResponse[Unit](400)
124120
.withErrorResponse[Unit](404)
125121
.withErrorResponse[Unit](405)

samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/StoreApi.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ class StoreApi(baseUrl: String) {
7777
* code 200 : Order (successful operation)
7878
* code 400 : (Invalid Order)
7979
*
80-
* @param order order placed for purchasing the pet
80+
* @param body order placed for purchasing the pet
8181
*/
82-
def placeOrder(order: Order): ApiRequest[Order] =
82+
def placeOrder(body: Order): ApiRequest[Order] =
8383
ApiRequest[Order](ApiMethods.POST, baseUrl, "/store/order", "application/json")
84-
.withBody(order)
84+
.withBody(body)
8585
.withSuccessResponse[Order](200)
8686
.withErrorResponse[Unit](400)
8787

samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/UserApi.scala

Lines changed: 14 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -29,47 +29,35 @@ class UserApi(baseUrl: String) {
2929
* Expected answers:
3030
* code 0 : (successful operation)
3131
*
32-
* Available security schemes:
33-
* auth_cookie (apiKey)
34-
*
35-
* @param user Created user object
32+
* @param body Created user object
3633
*/
37-
def createUser(user: User)(implicit apiKey: ApiKeyValue): ApiRequest[Unit] =
34+
def createUser(body: User): ApiRequest[Unit] =
3835
ApiRequest[Unit](ApiMethods.POST, baseUrl, "/user", "application/json")
39-
.withApiKey(apiKey, "AUTH_KEY", COOKIE)
40-
.withBody(user)
36+
.withBody(body)
4137
.withDefaultSuccessResponse[Unit]
4238

4339

4440
/**
4541
* Expected answers:
4642
* code 0 : (successful operation)
4743
*
48-
* Available security schemes:
49-
* auth_cookie (apiKey)
50-
*
51-
* @param user List of user object
44+
* @param body List of user object
5245
*/
53-
def createUsersWithArrayInput(user: Seq[User])(implicit apiKey: ApiKeyValue): ApiRequest[Unit] =
46+
def createUsersWithArrayInput(body: Seq[User]): ApiRequest[Unit] =
5447
ApiRequest[Unit](ApiMethods.POST, baseUrl, "/user/createWithArray", "application/json")
55-
.withApiKey(apiKey, "AUTH_KEY", COOKIE)
56-
.withBody(user)
48+
.withBody(body)
5749
.withDefaultSuccessResponse[Unit]
5850

5951

6052
/**
6153
* Expected answers:
6254
* code 0 : (successful operation)
6355
*
64-
* Available security schemes:
65-
* auth_cookie (apiKey)
66-
*
67-
* @param user List of user object
56+
* @param body List of user object
6857
*/
69-
def createUsersWithListInput(user: Seq[User])(implicit apiKey: ApiKeyValue): ApiRequest[Unit] =
58+
def createUsersWithListInput(body: Seq[User]): ApiRequest[Unit] =
7059
ApiRequest[Unit](ApiMethods.POST, baseUrl, "/user/createWithList", "application/json")
71-
.withApiKey(apiKey, "AUTH_KEY", COOKIE)
72-
.withBody(user)
60+
.withBody(body)
7361
.withDefaultSuccessResponse[Unit]
7462

7563

@@ -80,14 +68,10 @@ class UserApi(baseUrl: String) {
8068
* code 400 : (Invalid username supplied)
8169
* code 404 : (User not found)
8270
*
83-
* Available security schemes:
84-
* auth_cookie (apiKey)
85-
*
8671
* @param username The name that needs to be deleted
8772
*/
88-
def deleteUser(username: String)(implicit apiKey: ApiKeyValue): ApiRequest[Unit] =
73+
def deleteUser(username: String): ApiRequest[Unit] =
8974
ApiRequest[Unit](ApiMethods.DELETE, baseUrl, "/user/{username}", "application/json")
90-
.withApiKey(apiKey, "AUTH_KEY", COOKIE)
9175
.withPathParam("username", username)
9276
.withErrorResponse[Unit](400)
9377
.withErrorResponse[Unit](404)
@@ -113,7 +97,6 @@ class UserApi(baseUrl: String) {
11397
* Expected answers:
11498
* code 200 : String (successful operation)
11599
* Headers :
116-
* Set-Cookie - Cookie authentication key for use with the `auth_cookie` apiKey authentication.
117100
* X-Rate-Limit - calls per hour allowed by the user
118101
* X-Expires-After - date in UTC when toekn expires
119102
* code 400 : (Invalid username/password supplied)
@@ -129,21 +112,16 @@ class UserApi(baseUrl: String) {
129112
.withErrorResponse[Unit](400)
130113

131114
object LoginUserHeaders {
132-
def setCookie(r: ApiReturnWithHeaders) = r.getStringHeader("Set-Cookie")
133115
def xRateLimit(r: ApiReturnWithHeaders) = r.getIntHeader("X-Rate-Limit")
134116
def xExpiresAfter(r: ApiReturnWithHeaders) = r.getOffsetDateTimeHeader("X-Expires-After")
135117
}
136118

137119
/**
138120
* Expected answers:
139121
* code 0 : (successful operation)
140-
*
141-
* Available security schemes:
142-
* auth_cookie (apiKey)
143122
*/
144-
def logoutUser()(implicit apiKey: ApiKeyValue): ApiRequest[Unit] =
123+
def logoutUser(): ApiRequest[Unit] =
145124
ApiRequest[Unit](ApiMethods.GET, baseUrl, "/user/logout", "application/json")
146-
.withApiKey(apiKey, "AUTH_KEY", COOKIE)
147125
.withDefaultSuccessResponse[Unit]
148126

149127

@@ -154,16 +132,12 @@ class UserApi(baseUrl: String) {
154132
* code 400 : (Invalid user supplied)
155133
* code 404 : (User not found)
156134
*
157-
* Available security schemes:
158-
* auth_cookie (apiKey)
159-
*
160135
* @param username name that need to be deleted
161-
* @param user Updated user object
136+
* @param body Updated user object
162137
*/
163-
def updateUser(username: String, user: User)(implicit apiKey: ApiKeyValue): ApiRequest[Unit] =
138+
def updateUser(username: String, body: User): ApiRequest[Unit] =
164139
ApiRequest[Unit](ApiMethods.PUT, baseUrl, "/user/{username}", "application/json")
165-
.withApiKey(apiKey, "AUTH_KEY", COOKIE)
166-
.withBody(user)
140+
.withBody(body)
167141
.withPathParam("username", username)
168142
.withErrorResponse[Unit](400)
169143
.withErrorResponse[Unit](404)

0 commit comments

Comments
 (0)