Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions samples/client/petstore/scala-akka/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ Class | Method | HTTP request | Description

- [ApiResponse](ApiResponse.md)
- [Category](Category.md)
- [InlineObject](InlineObject.md)
- [InlineObject1](InlineObject1.md)
- [Order](Order.md)
- [Pet](Pet.md)
- [Tag](Tag.md)
Expand All @@ -108,12 +106,6 @@ Authentication schemes defined for the API:
- **API key parameter name**: api_key
- **Location**: HTTP header

### auth_cookie

- **Type**: API key
- **API key parameter name**: AUTH_KEY
- **Location**:


## Author

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,13 @@ class PetApi(baseUrl: String) {

/**
* Expected answers:
* code 200 : Pet (successful operation)
* code 405 : (Invalid input)
*
* @param pet Pet object that needs to be added to the store
* @param body Pet object that needs to be added to the store
*/
def addPet(pet: Pet): ApiRequest[Pet] =
ApiRequest[Pet](ApiMethods.POST, baseUrl, "/pet", "application/json")
.withBody(pet)
.withSuccessResponse[Pet](200)
def addPet(body: Pet): ApiRequest[Unit] =
ApiRequest[Unit](ApiMethods.POST, baseUrl, "/pet", "application/json")
.withBody(body)
.withErrorResponse[Unit](405)


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

/**
* Expected answers:
* code 200 : Pet (successful operation)
* code 400 : (Invalid ID supplied)
* code 404 : (Pet not found)
* code 405 : (Validation exception)
*
* @param pet Pet object that needs to be added to the store
* @param body Pet object that needs to be added to the store
*/
def updatePet(pet: Pet): ApiRequest[Pet] =
ApiRequest[Pet](ApiMethods.PUT, baseUrl, "/pet", "application/json")
.withBody(pet)
.withSuccessResponse[Pet](200)
def updatePet(body: Pet): ApiRequest[Unit] =
ApiRequest[Unit](ApiMethods.PUT, baseUrl, "/pet", "application/json")
.withBody(body)
.withErrorResponse[Unit](400)
.withErrorResponse[Unit](404)
.withErrorResponse[Unit](405)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ class StoreApi(baseUrl: String) {
* code 200 : Order (successful operation)
* code 400 : (Invalid Order)
*
* @param order order placed for purchasing the pet
* @param body order placed for purchasing the pet
*/
def placeOrder(order: Order): ApiRequest[Order] =
def placeOrder(body: Order): ApiRequest[Order] =
ApiRequest[Order](ApiMethods.POST, baseUrl, "/store/order", "application/json")
.withBody(order)
.withBody(body)
.withSuccessResponse[Order](200)
.withErrorResponse[Unit](400)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,47 +29,35 @@ class UserApi(baseUrl: String) {
* Expected answers:
* code 0 : (successful operation)
*
* Available security schemes:
* auth_cookie (apiKey)
*
* @param user Created user object
* @param body Created user object
*/
def createUser(user: User)(implicit apiKey: ApiKeyValue): ApiRequest[Unit] =
def createUser(body: User): ApiRequest[Unit] =
ApiRequest[Unit](ApiMethods.POST, baseUrl, "/user", "application/json")
.withApiKey(apiKey, "AUTH_KEY", COOKIE)
.withBody(user)
.withBody(body)
.withDefaultSuccessResponse[Unit]


/**
* Expected answers:
* code 0 : (successful operation)
*
* Available security schemes:
* auth_cookie (apiKey)
*
* @param user List of user object
* @param body List of user object
*/
def createUsersWithArrayInput(user: Seq[User])(implicit apiKey: ApiKeyValue): ApiRequest[Unit] =
def createUsersWithArrayInput(body: Seq[User]): ApiRequest[Unit] =
ApiRequest[Unit](ApiMethods.POST, baseUrl, "/user/createWithArray", "application/json")
.withApiKey(apiKey, "AUTH_KEY", COOKIE)
.withBody(user)
.withBody(body)
.withDefaultSuccessResponse[Unit]


/**
* Expected answers:
* code 0 : (successful operation)
*
* Available security schemes:
* auth_cookie (apiKey)
*
* @param user List of user object
* @param body List of user object
*/
def createUsersWithListInput(user: Seq[User])(implicit apiKey: ApiKeyValue): ApiRequest[Unit] =
def createUsersWithListInput(body: Seq[User]): ApiRequest[Unit] =
ApiRequest[Unit](ApiMethods.POST, baseUrl, "/user/createWithList", "application/json")
.withApiKey(apiKey, "AUTH_KEY", COOKIE)
.withBody(user)
.withBody(body)
.withDefaultSuccessResponse[Unit]


Expand All @@ -80,14 +68,10 @@ class UserApi(baseUrl: String) {
* code 400 : (Invalid username supplied)
* code 404 : (User not found)
*
* Available security schemes:
* auth_cookie (apiKey)
*
* @param username The name that needs to be deleted
*/
def deleteUser(username: String)(implicit apiKey: ApiKeyValue): ApiRequest[Unit] =
def deleteUser(username: String): ApiRequest[Unit] =
ApiRequest[Unit](ApiMethods.DELETE, baseUrl, "/user/{username}", "application/json")
.withApiKey(apiKey, "AUTH_KEY", COOKIE)
.withPathParam("username", username)
.withErrorResponse[Unit](400)
.withErrorResponse[Unit](404)
Expand All @@ -113,7 +97,6 @@ class UserApi(baseUrl: String) {
* Expected answers:
* code 200 : String (successful operation)
* Headers :
* Set-Cookie - Cookie authentication key for use with the `auth_cookie` apiKey authentication.
* X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when toekn expires
* code 400 : (Invalid username/password supplied)
Expand All @@ -129,21 +112,16 @@ class UserApi(baseUrl: String) {
.withErrorResponse[Unit](400)

object LoginUserHeaders {
def setCookie(r: ApiReturnWithHeaders) = r.getStringHeader("Set-Cookie")
def xRateLimit(r: ApiReturnWithHeaders) = r.getIntHeader("X-Rate-Limit")
def xExpiresAfter(r: ApiReturnWithHeaders) = r.getDateTimeHeader("X-Expires-After")
}

/**
* Expected answers:
* code 0 : (successful operation)
*
* Available security schemes:
* auth_cookie (apiKey)
*/
def logoutUser()(implicit apiKey: ApiKeyValue): ApiRequest[Unit] =
def logoutUser(): ApiRequest[Unit] =
ApiRequest[Unit](ApiMethods.GET, baseUrl, "/user/logout", "application/json")
.withApiKey(apiKey, "AUTH_KEY", COOKIE)
.withDefaultSuccessResponse[Unit]


Expand All @@ -154,16 +132,12 @@ class UserApi(baseUrl: String) {
* code 400 : (Invalid user supplied)
* code 404 : (User not found)
*
* Available security schemes:
* auth_cookie (apiKey)
*
* @param username name that need to be deleted
* @param user Updated user object
* @param body Updated user object
*/
def updateUser(username: String, user: User)(implicit apiKey: ApiKeyValue): ApiRequest[Unit] =
def updateUser(username: String, body: User): ApiRequest[Unit] =
ApiRequest[Unit](ApiMethods.PUT, baseUrl, "/user/{username}", "application/json")
.withApiKey(apiKey, "AUTH_KEY", COOKIE)
.withBody(user)
.withBody(body)
.withPathParam("username", username)
.withErrorResponse[Unit](400)
.withErrorResponse[Unit](404)
Expand Down