forked from loafle/openapi-generator-original
[scala] Regenerate akka sample (#5622)
This commit is contained in:
@@ -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)
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -29,15 +29,11 @@ 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]
|
||||
|
||||
|
||||
@@ -45,15 +41,11 @@ class UserApi(baseUrl: String) {
|
||||
* 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]
|
||||
|
||||
|
||||
@@ -61,15 +53,11 @@ class UserApi(baseUrl: String) {
|
||||
* 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]
|
||||
|
||||
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
@@ -129,7 +112,6 @@ 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.getOffsetDateTimeHeader("X-Expires-After")
|
||||
}
|
||||
@@ -137,13 +119,9 @@ class UserApi(baseUrl: String) {
|
||||
/**
|
||||
* 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]
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user