[Kotlin] [OkHttp4] detailed requests (#10201)

* #10199: Extract from generated function per operation one that returns headers and other info

* add autogenerated output

* fix suspend generation

* fix return statement generation for coroutine variant
This commit is contained in:
Simon Wegendt
2021-11-16 15:34:26 +01:00
committed by GitHub
parent 3c503dae2a
commit af2ca38ab7
35 changed files with 4436 additions and 1110 deletions

View File

@@ -11,6 +11,7 @@ import kotlinx.coroutines.withContext
{{/useCoroutines}}
{{/doNotUseRxAndCoroutines}}
import {{packageName}}.infrastructure.ApiClient
import {{packageName}}.infrastructure.ApiInfrastructureResponse
import {{packageName}}.infrastructure.ClientException
import {{packageName}}.infrastructure.ClientError
import {{packageName}}.infrastructure.ServerException
@@ -50,11 +51,7 @@ import {{packageName}}.infrastructure.toMultiValue
{{#isDeprecated}}
@Suppress("DEPRECATION")
{{/isDeprecated}}
val localVariableConfig = {{operationId}}RequestConfig({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}})
val localVarResponse = request<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map<String, Any?>{{/hasFormParams}}{{/hasBodyParam}}, {{{returnType}}}{{^returnType}}Unit{{/returnType}}>(
localVariableConfig
)
val localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}})
return{{^doNotUseRxAndCoroutines}}{{#useCoroutines}}@withContext{{/useCoroutines}}{{/doNotUseRxAndCoroutines}} when (localVarResponse.responseType) {
ResponseType.Success -> {{#returnType}}(localVarResponse as Success<*>).data as {{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}
@@ -71,6 +68,31 @@ import {{packageName}}.infrastructure.toMultiValue
}
}
/**
* {{summary}}
* {{notes}}
{{#allParams}}* @param {{{paramName}}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
{{/allParams}}* @return ApiInfrastructureResponse<{{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit?{{/returnType}}>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/{{#returnType}}
@Suppress("UNCHECKED_CAST"){{/returnType}}
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
{{#isDeprecated}}
@Deprecated(message = "This operation is deprecated.")
{{/isDeprecated}}
{{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : ApiInfrastructureResponse<{{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit?{{/returnType}}>{{^doNotUseRxAndCoroutines}}{{#useCoroutines}} = withContext(Dispatchers.IO){{/useCoroutines}}{{/doNotUseRxAndCoroutines}} {
{{#isDeprecated}}
@Suppress("DEPRECATION")
{{/isDeprecated}}
val localVariableConfig = {{operationId}}RequestConfig({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}})
return{{^doNotUseRxAndCoroutines}}{{#useCoroutines}}@withContext{{/useCoroutines}}{{/doNotUseRxAndCoroutines}} request<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map<String, Any?>{{/hasFormParams}}{{/hasBodyParam}}, {{{returnType}}}{{^returnType}}Unit{{/returnType}}>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation {{operationId}}
*

View File

@@ -24,6 +24,7 @@ import org.openapitools.client.models.ApiResponse
import org.openapitools.client.models.Pet
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -54,11 +55,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun addPet(body: Pet) : Unit {
val localVariableConfig = addPetRequestConfig(body = body)
val localVarResponse = request<Pet, Unit>(
localVariableConfig
)
val localVarResponse = addPetWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -75,6 +72,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Add a new pet to the store
*
* @param body Pet object that needs to be added to the store
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = addPetRequestConfig(body = body)
return request<Pet, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation addPet
*
@@ -107,11 +122,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit {
val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -128,6 +139,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Deletes a pet
*
* @param petId Pet id to delete
* @param apiKey (optional)
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deletePet
*
@@ -162,11 +192,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
val localVariableConfig = findPetsByStatusRequestConfig(status = status)
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
val localVarResponse = findPetsByStatusWithHttpInfo(status = status)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
@@ -183,6 +209,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter
* @return ApiInfrastructureResponse<kotlin.collections.List<Pet>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List<kotlin.String>) : ApiInfrastructureResponse<kotlin.collections.List<Pet>?> {
val localVariableConfig = findPetsByStatusRequestConfig(status = status)
return request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation findPetsByStatus
*
@@ -220,11 +265,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Deprecated(message = "This operation is deprecated.")
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
@Suppress("DEPRECATION")
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
val localVarResponse = findPetsByTagsWithHttpInfo(tags = tags)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
@@ -241,6 +282,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by
* @return ApiInfrastructureResponse<kotlin.collections.List<Pet>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
@Deprecated(message = "This operation is deprecated.")
fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List<kotlin.String>) : ApiInfrastructureResponse<kotlin.collections.List<Pet>?> {
@Suppress("DEPRECATION")
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
return request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation findPetsByTags
*
@@ -277,11 +339,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getPetById(petId: kotlin.Long) : Pet {
val localVariableConfig = getPetByIdRequestConfig(petId = petId)
val localVarResponse = request<Unit, Pet>(
localVariableConfig
)
val localVarResponse = getPetByIdWithHttpInfo(petId = petId)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
@@ -298,6 +356,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Find pet by ID
* Returns a single pet
* @param petId ID of pet to return
* @return ApiInfrastructureResponse<Pet?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse<Pet?> {
val localVariableConfig = getPetByIdRequestConfig(petId = petId)
return request<Unit, Pet>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getPetById
*
@@ -329,11 +406,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePet(body: Pet) : Unit {
val localVariableConfig = updatePetRequestConfig(body = body)
val localVarResponse = request<Pet, Unit>(
localVariableConfig
)
val localVarResponse = updatePetWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -350,6 +423,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Update an existing pet
*
* @param body Pet object that needs to be added to the store
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updatePetRequestConfig(body = body)
return request<Pet, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updatePet
*
@@ -383,11 +474,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit {
val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status)
val localVarResponse = request<Map<String, Any?>, Unit>(
localVariableConfig
)
val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -404,6 +491,26 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Updates a pet in the store with form data
*
* @param petId ID of pet that needs to be updated
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status)
return request<Map<String, Any?>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updatePetWithForm
*
@@ -440,11 +547,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse {
val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file)
val localVarResponse = request<Map<String, Any?>, ApiResponse>(
localVariableConfig
)
val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
@@ -461,6 +564,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* uploads an image
*
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @return ApiInfrastructureResponse<ApiResponse?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse<ApiResponse?> {
val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file)
return request<Map<String, Any?>, ApiResponse>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation uploadFile
*

View File

@@ -23,6 +23,7 @@ package org.openapitools.client.apis
import org.openapitools.client.models.Order
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -53,11 +54,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteOrder(orderId: kotlin.String) : Unit {
val localVariableConfig = deleteOrderRequestConfig(orderId = orderId)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -74,6 +71,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Delete purchase order by ID
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
* @param orderId ID of the order that needs to be deleted
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deleteOrderRequestConfig(orderId = orderId)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deleteOrder
*
@@ -105,11 +120,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getInventory() : kotlin.collections.Map<kotlin.String, kotlin.Int> {
val localVariableConfig = getInventoryRequestConfig()
val localVarResponse = request<Unit, kotlin.collections.Map<kotlin.String, kotlin.Int>>(
localVariableConfig
)
val localVarResponse = getInventoryWithHttpInfo()
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
@@ -126,6 +137,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
* @return ApiInfrastructureResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getInventoryWithHttpInfo() : ApiInfrastructureResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>?> {
val localVariableConfig = getInventoryRequestConfig()
return request<Unit, kotlin.collections.Map<kotlin.String, kotlin.Int>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getInventory
*
@@ -157,11 +186,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getOrderById(orderId: kotlin.Long) : Order {
val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId)
val localVarResponse = request<Unit, Order>(
localVariableConfig
)
val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
@@ -178,6 +203,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* @param orderId ID of pet that needs to be fetched
* @return ApiInfrastructureResponse<Order?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse<Order?> {
val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId)
return request<Unit, Order>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getOrderById
*
@@ -210,11 +254,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun placeOrder(body: Order) : Order {
val localVariableConfig = placeOrderRequestConfig(body = body)
val localVarResponse = request<Order, Order>(
localVariableConfig
)
val localVarResponse = placeOrderWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
@@ -231,6 +271,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Place an order for a pet
*
* @param body order placed for purchasing the pet
* @return ApiInfrastructureResponse<Order?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse<Order?> {
val localVariableConfig = placeOrderRequestConfig(body = body)
return request<Order, Order>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation placeOrder
*

View File

@@ -23,6 +23,7 @@ package org.openapitools.client.apis
import org.openapitools.client.models.User
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -53,11 +54,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUser(body: User) : Unit {
val localVariableConfig = createUserRequestConfig(body = body)
val localVarResponse = request<User, Unit>(
localVariableConfig
)
val localVarResponse = createUserWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -74,6 +71,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Create user
* This can only be done by the logged in user.
* @param body Created user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUserRequestConfig(body = body)
return request<User, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUser
*
@@ -105,11 +120,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInput(body: kotlin.collections.List<User>) : Unit {
val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body)
val localVarResponse = request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -126,6 +137,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Creates list of users with given input array
*
* @param body List of user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List<User>) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body)
return request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUsersWithArrayInput
*
@@ -157,11 +186,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInput(body: kotlin.collections.List<User>) : Unit {
val localVariableConfig = createUsersWithListInputRequestConfig(body = body)
val localVarResponse = request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
val localVarResponse = createUsersWithListInputWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -178,6 +203,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Creates list of users with given input array
*
* @param body List of user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List<User>) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUsersWithListInputRequestConfig(body = body)
return request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUsersWithListInput
*
@@ -209,11 +252,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteUser(username: kotlin.String) : Unit {
val localVariableConfig = deleteUserRequestConfig(username = username)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deleteUserWithHttpInfo(username = username)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -230,6 +269,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Delete user
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deleteUserRequestConfig(username = username)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deleteUser
*
@@ -262,11 +319,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getUserByName(username: kotlin.String) : User {
val localVariableConfig = getUserByNameRequestConfig(username = username)
val localVarResponse = request<Unit, User>(
localVariableConfig
)
val localVarResponse = getUserByNameWithHttpInfo(username = username)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as User
@@ -283,6 +336,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return ApiInfrastructureResponse<User?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse<User?> {
val localVariableConfig = getUserByNameRequestConfig(username = username)
return request<Unit, User>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getUserByName
*
@@ -316,11 +388,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String {
val localVariableConfig = loginUserRequestConfig(username = username, password = password)
val localVarResponse = request<Unit, kotlin.String>(
localVariableConfig
)
val localVarResponse = loginUserWithHttpInfo(username = username, password = password)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
@@ -337,6 +405,26 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Logs user into the system
*
* @param username The user name for login
* @param password The password for login in clear text
* @return ApiInfrastructureResponse<kotlin.String?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse<kotlin.String?> {
val localVariableConfig = loginUserRequestConfig(username = username, password = password)
return request<Unit, kotlin.String>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation loginUser
*
@@ -372,11 +460,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun logoutUser() : Unit {
val localVariableConfig = logoutUserRequestConfig()
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = logoutUserWithHttpInfo()
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -393,6 +477,23 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Logs out current logged in user session
*
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun logoutUserWithHttpInfo() : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = logoutUserRequestConfig()
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation logoutUser
*
@@ -424,11 +525,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updateUser(username: kotlin.String, body: User) : Unit {
val localVariableConfig = updateUserRequestConfig(username = username, body = body)
val localVarResponse = request<User, Unit>(
localVariableConfig
)
val localVarResponse = updateUserWithHttpInfo(username = username, body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -445,6 +542,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Updated user
* This can only be done by the logged in user.
* @param username name that need to be deleted
* @param body Updated user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updateUserRequestConfig(username = username, body = body)
return request<User, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updateUser
*

View File

@@ -24,6 +24,7 @@ import org.openapitools.client.models.ApiResponse
import org.openapitools.client.models.Pet
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -54,11 +55,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun addPet(body: Pet) : Unit {
val localVariableConfig = addPetRequestConfig(body = body)
val localVarResponse = request<Pet, Unit>(
localVariableConfig
)
val localVarResponse = addPetWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -75,6 +72,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Add a new pet to the store
*
* @param body Pet object that needs to be added to the store
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = addPetRequestConfig(body = body)
return request<Pet, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation addPet
*
@@ -107,11 +122,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit {
val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -128,6 +139,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Deletes a pet
*
* @param petId Pet id to delete
* @param apiKey (optional)
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deletePet
*
@@ -162,11 +192,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
val localVariableConfig = findPetsByStatusRequestConfig(status = status)
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
val localVarResponse = findPetsByStatusWithHttpInfo(status = status)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
@@ -183,6 +209,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter
* @return ApiInfrastructureResponse<kotlin.collections.List<Pet>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List<kotlin.String>) : ApiInfrastructureResponse<kotlin.collections.List<Pet>?> {
val localVariableConfig = findPetsByStatusRequestConfig(status = status)
return request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation findPetsByStatus
*
@@ -220,11 +265,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Deprecated(message = "This operation is deprecated.")
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
@Suppress("DEPRECATION")
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
val localVarResponse = findPetsByTagsWithHttpInfo(tags = tags)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
@@ -241,6 +282,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by
* @return ApiInfrastructureResponse<kotlin.collections.List<Pet>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
@Deprecated(message = "This operation is deprecated.")
fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List<kotlin.String>) : ApiInfrastructureResponse<kotlin.collections.List<Pet>?> {
@Suppress("DEPRECATION")
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
return request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation findPetsByTags
*
@@ -277,11 +339,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getPetById(petId: kotlin.Long) : Pet {
val localVariableConfig = getPetByIdRequestConfig(petId = petId)
val localVarResponse = request<Unit, Pet>(
localVariableConfig
)
val localVarResponse = getPetByIdWithHttpInfo(petId = petId)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
@@ -298,6 +356,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Find pet by ID
* Returns a single pet
* @param petId ID of pet to return
* @return ApiInfrastructureResponse<Pet?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse<Pet?> {
val localVariableConfig = getPetByIdRequestConfig(petId = petId)
return request<Unit, Pet>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getPetById
*
@@ -329,11 +406,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePet(body: Pet) : Unit {
val localVariableConfig = updatePetRequestConfig(body = body)
val localVarResponse = request<Pet, Unit>(
localVariableConfig
)
val localVarResponse = updatePetWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -350,6 +423,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Update an existing pet
*
* @param body Pet object that needs to be added to the store
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updatePetRequestConfig(body = body)
return request<Pet, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updatePet
*
@@ -383,11 +474,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit {
val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status)
val localVarResponse = request<Map<String, Any?>, Unit>(
localVariableConfig
)
val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -404,6 +491,26 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Updates a pet in the store with form data
*
* @param petId ID of pet that needs to be updated
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status)
return request<Map<String, Any?>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updatePetWithForm
*
@@ -440,11 +547,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse {
val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file)
val localVarResponse = request<Map<String, Any?>, ApiResponse>(
localVariableConfig
)
val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
@@ -461,6 +564,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* uploads an image
*
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @return ApiInfrastructureResponse<ApiResponse?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse<ApiResponse?> {
val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file)
return request<Map<String, Any?>, ApiResponse>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation uploadFile
*

View File

@@ -23,6 +23,7 @@ package org.openapitools.client.apis
import org.openapitools.client.models.Order
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -53,11 +54,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteOrder(orderId: kotlin.String) : Unit {
val localVariableConfig = deleteOrderRequestConfig(orderId = orderId)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -74,6 +71,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Delete purchase order by ID
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
* @param orderId ID of the order that needs to be deleted
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deleteOrderRequestConfig(orderId = orderId)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deleteOrder
*
@@ -105,11 +120,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getInventory() : kotlin.collections.Map<kotlin.String, kotlin.Int> {
val localVariableConfig = getInventoryRequestConfig()
val localVarResponse = request<Unit, kotlin.collections.Map<kotlin.String, kotlin.Int>>(
localVariableConfig
)
val localVarResponse = getInventoryWithHttpInfo()
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
@@ -126,6 +137,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
* @return ApiInfrastructureResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getInventoryWithHttpInfo() : ApiInfrastructureResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>?> {
val localVariableConfig = getInventoryRequestConfig()
return request<Unit, kotlin.collections.Map<kotlin.String, kotlin.Int>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getInventory
*
@@ -157,11 +186,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getOrderById(orderId: kotlin.Long) : Order {
val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId)
val localVarResponse = request<Unit, Order>(
localVariableConfig
)
val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
@@ -178,6 +203,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* @param orderId ID of pet that needs to be fetched
* @return ApiInfrastructureResponse<Order?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse<Order?> {
val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId)
return request<Unit, Order>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getOrderById
*
@@ -210,11 +254,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun placeOrder(body: Order) : Order {
val localVariableConfig = placeOrderRequestConfig(body = body)
val localVarResponse = request<Order, Order>(
localVariableConfig
)
val localVarResponse = placeOrderWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
@@ -231,6 +271,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Place an order for a pet
*
* @param body order placed for purchasing the pet
* @return ApiInfrastructureResponse<Order?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse<Order?> {
val localVariableConfig = placeOrderRequestConfig(body = body)
return request<Order, Order>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation placeOrder
*

View File

@@ -23,6 +23,7 @@ package org.openapitools.client.apis
import org.openapitools.client.models.User
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -53,11 +54,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUser(body: User) : Unit {
val localVariableConfig = createUserRequestConfig(body = body)
val localVarResponse = request<User, Unit>(
localVariableConfig
)
val localVarResponse = createUserWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -74,6 +71,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Create user
* This can only be done by the logged in user.
* @param body Created user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUserRequestConfig(body = body)
return request<User, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUser
*
@@ -105,11 +120,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInput(body: kotlin.collections.List<User>) : Unit {
val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body)
val localVarResponse = request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -126,6 +137,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Creates list of users with given input array
*
* @param body List of user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List<User>) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body)
return request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUsersWithArrayInput
*
@@ -157,11 +186,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInput(body: kotlin.collections.List<User>) : Unit {
val localVariableConfig = createUsersWithListInputRequestConfig(body = body)
val localVarResponse = request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
val localVarResponse = createUsersWithListInputWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -178,6 +203,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Creates list of users with given input array
*
* @param body List of user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List<User>) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUsersWithListInputRequestConfig(body = body)
return request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUsersWithListInput
*
@@ -209,11 +252,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteUser(username: kotlin.String) : Unit {
val localVariableConfig = deleteUserRequestConfig(username = username)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deleteUserWithHttpInfo(username = username)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -230,6 +269,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Delete user
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deleteUserRequestConfig(username = username)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deleteUser
*
@@ -262,11 +319,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getUserByName(username: kotlin.String) : User {
val localVariableConfig = getUserByNameRequestConfig(username = username)
val localVarResponse = request<Unit, User>(
localVariableConfig
)
val localVarResponse = getUserByNameWithHttpInfo(username = username)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as User
@@ -283,6 +336,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return ApiInfrastructureResponse<User?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse<User?> {
val localVariableConfig = getUserByNameRequestConfig(username = username)
return request<Unit, User>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getUserByName
*
@@ -316,11 +388,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String {
val localVariableConfig = loginUserRequestConfig(username = username, password = password)
val localVarResponse = request<Unit, kotlin.String>(
localVariableConfig
)
val localVarResponse = loginUserWithHttpInfo(username = username, password = password)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
@@ -337,6 +405,26 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Logs user into the system
*
* @param username The user name for login
* @param password The password for login in clear text
* @return ApiInfrastructureResponse<kotlin.String?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse<kotlin.String?> {
val localVariableConfig = loginUserRequestConfig(username = username, password = password)
return request<Unit, kotlin.String>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation loginUser
*
@@ -372,11 +460,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun logoutUser() : Unit {
val localVariableConfig = logoutUserRequestConfig()
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = logoutUserWithHttpInfo()
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -393,6 +477,23 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Logs out current logged in user session
*
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun logoutUserWithHttpInfo() : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = logoutUserRequestConfig()
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation logoutUser
*
@@ -424,11 +525,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updateUser(username: kotlin.String, body: User) : Unit {
val localVariableConfig = updateUserRequestConfig(username = username, body = body)
val localVarResponse = request<User, Unit>(
localVariableConfig
)
val localVarResponse = updateUserWithHttpInfo(username = username, body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -445,6 +542,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Updated user
* This can only be done by the logged in user.
* @param username name that need to be deleted
* @param body Updated user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updateUserRequestConfig(username = username, body = body)
return request<User, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updateUser
*

View File

@@ -24,6 +24,7 @@ import org.openapitools.client.models.ApiResponse
import org.openapitools.client.models.Pet
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -54,11 +55,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun addPet(body: Pet) : Unit {
val localVariableConfig = addPetRequestConfig(body = body)
val localVarResponse = request<Pet, Unit>(
localVariableConfig
)
val localVarResponse = addPetWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -75,6 +72,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Add a new pet to the store
*
* @param body Pet object that needs to be added to the store
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = addPetRequestConfig(body = body)
return request<Pet, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation addPet
*
@@ -107,11 +122,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit {
val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -128,6 +139,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Deletes a pet
*
* @param petId Pet id to delete
* @param apiKey (optional)
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deletePet
*
@@ -164,11 +194,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Deprecated(message = "This operation is deprecated.")
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
@Suppress("DEPRECATION")
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
val localVarResponse = findPetsByTagsWithHttpInfo(tags = tags)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
@@ -185,6 +211,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by
* @return ApiInfrastructureResponse<kotlin.collections.List<Pet>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
@Deprecated(message = "This operation is deprecated.")
fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List<kotlin.String>) : ApiInfrastructureResponse<kotlin.collections.List<Pet>?> {
@Suppress("DEPRECATION")
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
return request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation findPetsByTags
*
@@ -221,11 +268,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getAllPets(lastUpdated: java.time.OffsetDateTime?) : kotlin.collections.List<Pet> {
val localVariableConfig = getAllPetsRequestConfig(lastUpdated = lastUpdated)
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
val localVarResponse = getAllPetsWithHttpInfo(lastUpdated = lastUpdated)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
@@ -242,6 +285,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Get all pets
*
* @param lastUpdated When this endpoint was hit last to help indentify if the client already has the latest copy. (optional)
* @return ApiInfrastructureResponse<kotlin.collections.List<Pet>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getAllPetsWithHttpInfo(lastUpdated: java.time.OffsetDateTime?) : ApiInfrastructureResponse<kotlin.collections.List<Pet>?> {
val localVariableConfig = getAllPetsRequestConfig(lastUpdated = lastUpdated)
return request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getAllPets
*
@@ -279,11 +341,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getPetById(petId: kotlin.Long) : Pet {
val localVariableConfig = getPetByIdRequestConfig(petId = petId)
val localVarResponse = request<Unit, Pet>(
localVariableConfig
)
val localVarResponse = getPetByIdWithHttpInfo(petId = petId)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
@@ -300,6 +358,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Find pet by ID
* Returns a single pet
* @param petId ID of pet to return
* @return ApiInfrastructureResponse<Pet?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse<Pet?> {
val localVariableConfig = getPetByIdRequestConfig(petId = petId)
return request<Unit, Pet>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getPetById
*
@@ -331,11 +408,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePet(body: Pet) : Unit {
val localVariableConfig = updatePetRequestConfig(body = body)
val localVarResponse = request<Pet, Unit>(
localVariableConfig
)
val localVarResponse = updatePetWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -352,6 +425,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Update an existing pet
*
* @param body Pet object that needs to be added to the store
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updatePetRequestConfig(body = body)
return request<Pet, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updatePet
*
@@ -385,11 +476,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit {
val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status)
val localVarResponse = request<Map<String, Any?>, Unit>(
localVariableConfig
)
val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -406,6 +493,26 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Updates a pet in the store with form data
*
* @param petId ID of pet that needs to be updated
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status)
return request<Map<String, Any?>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updatePetWithForm
*
@@ -442,11 +549,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse {
val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file)
val localVarResponse = request<Map<String, Any?>, ApiResponse>(
localVariableConfig
)
val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
@@ -463,6 +566,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* uploads an image
*
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @return ApiInfrastructureResponse<ApiResponse?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse<ApiResponse?> {
val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file)
return request<Map<String, Any?>, ApiResponse>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation uploadFile
*

View File

@@ -23,6 +23,7 @@ package org.openapitools.client.apis
import org.openapitools.client.models.Order
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -53,11 +54,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteOrder(orderId: kotlin.String) : Unit {
val localVariableConfig = deleteOrderRequestConfig(orderId = orderId)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -74,6 +71,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Delete purchase order by ID
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
* @param orderId ID of the order that needs to be deleted
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deleteOrderRequestConfig(orderId = orderId)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deleteOrder
*
@@ -105,11 +120,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getInventory() : kotlin.collections.Map<kotlin.String, kotlin.Int> {
val localVariableConfig = getInventoryRequestConfig()
val localVarResponse = request<Unit, kotlin.collections.Map<kotlin.String, kotlin.Int>>(
localVariableConfig
)
val localVarResponse = getInventoryWithHttpInfo()
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
@@ -126,6 +137,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
* @return ApiInfrastructureResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getInventoryWithHttpInfo() : ApiInfrastructureResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>?> {
val localVariableConfig = getInventoryRequestConfig()
return request<Unit, kotlin.collections.Map<kotlin.String, kotlin.Int>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getInventory
*
@@ -157,11 +186,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getOrderById(orderId: kotlin.Long) : Order {
val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId)
val localVarResponse = request<Unit, Order>(
localVariableConfig
)
val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
@@ -178,6 +203,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* @param orderId ID of pet that needs to be fetched
* @return ApiInfrastructureResponse<Order?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse<Order?> {
val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId)
return request<Unit, Order>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getOrderById
*
@@ -210,11 +254,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun placeOrder(body: Order) : Order {
val localVariableConfig = placeOrderRequestConfig(body = body)
val localVarResponse = request<Order, Order>(
localVariableConfig
)
val localVarResponse = placeOrderWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
@@ -231,6 +271,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Place an order for a pet
*
* @param body order placed for purchasing the pet
* @return ApiInfrastructureResponse<Order?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse<Order?> {
val localVariableConfig = placeOrderRequestConfig(body = body)
return request<Order, Order>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation placeOrder
*

View File

@@ -23,6 +23,7 @@ package org.openapitools.client.apis
import org.openapitools.client.models.User
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -53,11 +54,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUser(body: User) : Unit {
val localVariableConfig = createUserRequestConfig(body = body)
val localVarResponse = request<User, Unit>(
localVariableConfig
)
val localVarResponse = createUserWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -74,6 +71,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Create user
* This can only be done by the logged in user.
* @param body Created user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUserRequestConfig(body = body)
return request<User, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUser
*
@@ -105,11 +120,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInput(body: kotlin.collections.List<User>) : Unit {
val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body)
val localVarResponse = request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -126,6 +137,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Creates list of users with given input array
*
* @param body List of user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List<User>) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body)
return request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUsersWithArrayInput
*
@@ -157,11 +186,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInput(body: kotlin.collections.List<User>) : Unit {
val localVariableConfig = createUsersWithListInputRequestConfig(body = body)
val localVarResponse = request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
val localVarResponse = createUsersWithListInputWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -178,6 +203,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Creates list of users with given input array
*
* @param body List of user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List<User>) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUsersWithListInputRequestConfig(body = body)
return request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUsersWithListInput
*
@@ -209,11 +252,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteUser(username: kotlin.String) : Unit {
val localVariableConfig = deleteUserRequestConfig(username = username)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deleteUserWithHttpInfo(username = username)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -230,6 +269,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Delete user
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deleteUserRequestConfig(username = username)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deleteUser
*
@@ -262,11 +319,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getUserByName(username: kotlin.String) : User {
val localVariableConfig = getUserByNameRequestConfig(username = username)
val localVarResponse = request<Unit, User>(
localVariableConfig
)
val localVarResponse = getUserByNameWithHttpInfo(username = username)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as User
@@ -283,6 +336,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return ApiInfrastructureResponse<User?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse<User?> {
val localVariableConfig = getUserByNameRequestConfig(username = username)
return request<Unit, User>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getUserByName
*
@@ -316,11 +388,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String {
val localVariableConfig = loginUserRequestConfig(username = username, password = password)
val localVarResponse = request<Unit, kotlin.String>(
localVariableConfig
)
val localVarResponse = loginUserWithHttpInfo(username = username, password = password)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
@@ -337,6 +405,26 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Logs user into the system
*
* @param username The user name for login
* @param password The password for login in clear text
* @return ApiInfrastructureResponse<kotlin.String?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse<kotlin.String?> {
val localVariableConfig = loginUserRequestConfig(username = username, password = password)
return request<Unit, kotlin.String>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation loginUser
*
@@ -372,11 +460,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun logoutUser() : Unit {
val localVariableConfig = logoutUserRequestConfig()
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = logoutUserWithHttpInfo()
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -393,6 +477,23 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Logs out current logged in user session
*
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun logoutUserWithHttpInfo() : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = logoutUserRequestConfig()
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation logoutUser
*
@@ -424,11 +525,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updateUser(username: kotlin.String, body: User) : Unit {
val localVariableConfig = updateUserRequestConfig(username = username, body = body)
val localVarResponse = request<User, Unit>(
localVariableConfig
)
val localVarResponse = updateUserWithHttpInfo(username = username, body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -445,6 +542,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Updated user
* This can only be done by the logged in user.
* @param username name that need to be deleted
* @param body Updated user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updateUserRequestConfig(username = username, body = body)
return request<User, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updateUser
*

View File

@@ -26,6 +26,7 @@ import org.openapitools.client.models.Pet
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -56,11 +57,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun addPet(body: Pet) : Unit = withContext(Dispatchers.IO) {
val localVariableConfig = addPetRequestConfig(body = body)
val localVarResponse = request<Pet, Unit>(
localVariableConfig
)
val localVarResponse = addPetWithHttpInfo(body = body)
return@withContext when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -77,6 +74,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Add a new pet to the store
*
* @param body Pet object that needs to be added to the store
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse<Unit?> = withContext(Dispatchers.IO) {
val localVariableConfig = addPetRequestConfig(body = body)
return@withContext request<Pet, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation addPet
*
@@ -109,11 +124,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit = withContext(Dispatchers.IO) {
val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey)
return@withContext when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -130,6 +141,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Deletes a pet
*
* @param petId Pet id to delete
* @param apiKey (optional)
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse<Unit?> = withContext(Dispatchers.IO) {
val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey)
return@withContext request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deletePet
*
@@ -164,11 +194,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> = withContext(Dispatchers.IO) {
val localVariableConfig = findPetsByStatusRequestConfig(status = status)
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
val localVarResponse = findPetsByStatusWithHttpInfo(status = status)
return@withContext when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
@@ -185,6 +211,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter
* @return ApiInfrastructureResponse<kotlin.collections.List<Pet>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List<kotlin.String>) : ApiInfrastructureResponse<kotlin.collections.List<Pet>?> = withContext(Dispatchers.IO) {
val localVariableConfig = findPetsByStatusRequestConfig(status = status)
return@withContext request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation findPetsByStatus
*
@@ -222,11 +267,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Deprecated(message = "This operation is deprecated.")
suspend fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> = withContext(Dispatchers.IO) {
@Suppress("DEPRECATION")
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
val localVarResponse = findPetsByTagsWithHttpInfo(tags = tags)
return@withContext when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
@@ -243,6 +284,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by
* @return ApiInfrastructureResponse<kotlin.collections.List<Pet>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
@Deprecated(message = "This operation is deprecated.")
suspend fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List<kotlin.String>) : ApiInfrastructureResponse<kotlin.collections.List<Pet>?> = withContext(Dispatchers.IO) {
@Suppress("DEPRECATION")
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
return@withContext request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation findPetsByTags
*
@@ -279,11 +341,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun getPetById(petId: kotlin.Long) : Pet = withContext(Dispatchers.IO) {
val localVariableConfig = getPetByIdRequestConfig(petId = petId)
val localVarResponse = request<Unit, Pet>(
localVariableConfig
)
val localVarResponse = getPetByIdWithHttpInfo(petId = petId)
return@withContext when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
@@ -300,6 +358,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Find pet by ID
* Returns a single pet
* @param petId ID of pet to return
* @return ApiInfrastructureResponse<Pet?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse<Pet?> = withContext(Dispatchers.IO) {
val localVariableConfig = getPetByIdRequestConfig(petId = petId)
return@withContext request<Unit, Pet>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getPetById
*
@@ -331,11 +408,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun updatePet(body: Pet) : Unit = withContext(Dispatchers.IO) {
val localVariableConfig = updatePetRequestConfig(body = body)
val localVarResponse = request<Pet, Unit>(
localVariableConfig
)
val localVarResponse = updatePetWithHttpInfo(body = body)
return@withContext when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -352,6 +425,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Update an existing pet
*
* @param body Pet object that needs to be added to the store
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse<Unit?> = withContext(Dispatchers.IO) {
val localVariableConfig = updatePetRequestConfig(body = body)
return@withContext request<Pet, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updatePet
*
@@ -385,11 +476,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit = withContext(Dispatchers.IO) {
val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status)
val localVarResponse = request<Map<String, Any?>, Unit>(
localVariableConfig
)
val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status)
return@withContext when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -406,6 +493,26 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Updates a pet in the store with form data
*
* @param petId ID of pet that needs to be updated
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse<Unit?> = withContext(Dispatchers.IO) {
val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status)
return@withContext request<Map<String, Any?>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updatePetWithForm
*
@@ -442,11 +549,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse = withContext(Dispatchers.IO) {
val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file)
val localVarResponse = request<Map<String, Any?>, ApiResponse>(
localVariableConfig
)
val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file)
return@withContext when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
@@ -463,6 +566,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* uploads an image
*
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @return ApiInfrastructureResponse<ApiResponse?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse<ApiResponse?> = withContext(Dispatchers.IO) {
val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file)
return@withContext request<Map<String, Any?>, ApiResponse>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation uploadFile
*

View File

@@ -25,6 +25,7 @@ import org.openapitools.client.models.Order
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -55,11 +56,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun deleteOrder(orderId: kotlin.String) : Unit = withContext(Dispatchers.IO) {
val localVariableConfig = deleteOrderRequestConfig(orderId = orderId)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId)
return@withContext when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -76,6 +73,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Delete purchase order by ID
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
* @param orderId ID of the order that needs to be deleted
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse<Unit?> = withContext(Dispatchers.IO) {
val localVariableConfig = deleteOrderRequestConfig(orderId = orderId)
return@withContext request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deleteOrder
*
@@ -107,11 +122,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun getInventory() : kotlin.collections.Map<kotlin.String, kotlin.Int> = withContext(Dispatchers.IO) {
val localVariableConfig = getInventoryRequestConfig()
val localVarResponse = request<Unit, kotlin.collections.Map<kotlin.String, kotlin.Int>>(
localVariableConfig
)
val localVarResponse = getInventoryWithHttpInfo()
return@withContext when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
@@ -128,6 +139,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
* @return ApiInfrastructureResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun getInventoryWithHttpInfo() : ApiInfrastructureResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>?> = withContext(Dispatchers.IO) {
val localVariableConfig = getInventoryRequestConfig()
return@withContext request<Unit, kotlin.collections.Map<kotlin.String, kotlin.Int>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getInventory
*
@@ -159,11 +188,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun getOrderById(orderId: kotlin.Long) : Order = withContext(Dispatchers.IO) {
val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId)
val localVarResponse = request<Unit, Order>(
localVariableConfig
)
val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId)
return@withContext when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
@@ -180,6 +205,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* @param orderId ID of pet that needs to be fetched
* @return ApiInfrastructureResponse<Order?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse<Order?> = withContext(Dispatchers.IO) {
val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId)
return@withContext request<Unit, Order>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getOrderById
*
@@ -212,11 +256,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun placeOrder(body: Order) : Order = withContext(Dispatchers.IO) {
val localVariableConfig = placeOrderRequestConfig(body = body)
val localVarResponse = request<Order, Order>(
localVariableConfig
)
val localVarResponse = placeOrderWithHttpInfo(body = body)
return@withContext when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
@@ -233,6 +273,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Place an order for a pet
*
* @param body order placed for purchasing the pet
* @return ApiInfrastructureResponse<Order?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse<Order?> = withContext(Dispatchers.IO) {
val localVariableConfig = placeOrderRequestConfig(body = body)
return@withContext request<Order, Order>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation placeOrder
*

View File

@@ -25,6 +25,7 @@ import org.openapitools.client.models.User
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -55,11 +56,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun createUser(body: User) : Unit = withContext(Dispatchers.IO) {
val localVariableConfig = createUserRequestConfig(body = body)
val localVarResponse = request<User, Unit>(
localVariableConfig
)
val localVarResponse = createUserWithHttpInfo(body = body)
return@withContext when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -76,6 +73,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Create user
* This can only be done by the logged in user.
* @param body Created user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse<Unit?> = withContext(Dispatchers.IO) {
val localVariableConfig = createUserRequestConfig(body = body)
return@withContext request<User, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUser
*
@@ -107,11 +122,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun createUsersWithArrayInput(body: kotlin.collections.List<User>) : Unit = withContext(Dispatchers.IO) {
val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body)
val localVarResponse = request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body)
return@withContext when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -128,6 +139,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Creates list of users with given input array
*
* @param body List of user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List<User>) : ApiInfrastructureResponse<Unit?> = withContext(Dispatchers.IO) {
val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body)
return@withContext request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUsersWithArrayInput
*
@@ -159,11 +188,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun createUsersWithListInput(body: kotlin.collections.List<User>) : Unit = withContext(Dispatchers.IO) {
val localVariableConfig = createUsersWithListInputRequestConfig(body = body)
val localVarResponse = request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
val localVarResponse = createUsersWithListInputWithHttpInfo(body = body)
return@withContext when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -180,6 +205,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Creates list of users with given input array
*
* @param body List of user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List<User>) : ApiInfrastructureResponse<Unit?> = withContext(Dispatchers.IO) {
val localVariableConfig = createUsersWithListInputRequestConfig(body = body)
return@withContext request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUsersWithListInput
*
@@ -211,11 +254,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun deleteUser(username: kotlin.String) : Unit = withContext(Dispatchers.IO) {
val localVariableConfig = deleteUserRequestConfig(username = username)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deleteUserWithHttpInfo(username = username)
return@withContext when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -232,6 +271,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Delete user
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse<Unit?> = withContext(Dispatchers.IO) {
val localVariableConfig = deleteUserRequestConfig(username = username)
return@withContext request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deleteUser
*
@@ -264,11 +321,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun getUserByName(username: kotlin.String) : User = withContext(Dispatchers.IO) {
val localVariableConfig = getUserByNameRequestConfig(username = username)
val localVarResponse = request<Unit, User>(
localVariableConfig
)
val localVarResponse = getUserByNameWithHttpInfo(username = username)
return@withContext when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as User
@@ -285,6 +338,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return ApiInfrastructureResponse<User?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse<User?> = withContext(Dispatchers.IO) {
val localVariableConfig = getUserByNameRequestConfig(username = username)
return@withContext request<Unit, User>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getUserByName
*
@@ -318,11 +390,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String = withContext(Dispatchers.IO) {
val localVariableConfig = loginUserRequestConfig(username = username, password = password)
val localVarResponse = request<Unit, kotlin.String>(
localVariableConfig
)
val localVarResponse = loginUserWithHttpInfo(username = username, password = password)
return@withContext when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
@@ -339,6 +407,26 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Logs user into the system
*
* @param username The user name for login
* @param password The password for login in clear text
* @return ApiInfrastructureResponse<kotlin.String?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse<kotlin.String?> = withContext(Dispatchers.IO) {
val localVariableConfig = loginUserRequestConfig(username = username, password = password)
return@withContext request<Unit, kotlin.String>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation loginUser
*
@@ -374,11 +462,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun logoutUser() : Unit = withContext(Dispatchers.IO) {
val localVariableConfig = logoutUserRequestConfig()
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = logoutUserWithHttpInfo()
return@withContext when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -395,6 +479,23 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Logs out current logged in user session
*
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun logoutUserWithHttpInfo() : ApiInfrastructureResponse<Unit?> = withContext(Dispatchers.IO) {
val localVariableConfig = logoutUserRequestConfig()
return@withContext request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation logoutUser
*
@@ -426,11 +527,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun updateUser(username: kotlin.String, body: User) : Unit = withContext(Dispatchers.IO) {
val localVariableConfig = updateUserRequestConfig(username = username, body = body)
val localVarResponse = request<User, Unit>(
localVariableConfig
)
val localVarResponse = updateUserWithHttpInfo(username = username, body = body)
return@withContext when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -447,6 +544,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Updated user
* This can only be done by the logged in user.
* @param username name that need to be deleted
* @param body Updated user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse<Unit?> = withContext(Dispatchers.IO) {
val localVariableConfig = updateUserRequestConfig(username = username, body = body)
return@withContext request<User, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updateUser
*

View File

@@ -24,6 +24,7 @@ import org.openapitools.client.models.ApiResponse
import org.openapitools.client.models.Pet
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -54,11 +55,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun addPet(body: Pet) : Unit {
val localVariableConfig = addPetRequestConfig(body = body)
val localVarResponse = request<Pet, Unit>(
localVariableConfig
)
val localVarResponse = addPetWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -75,6 +72,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Add a new pet to the store
*
* @param body Pet object that needs to be added to the store
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = addPetRequestConfig(body = body)
return request<Pet, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation addPet
*
@@ -107,11 +122,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit {
val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -128,6 +139,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Deletes a pet
*
* @param petId Pet id to delete
* @param apiKey (optional)
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deletePet
*
@@ -162,11 +192,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
val localVariableConfig = findPetsByStatusRequestConfig(status = status)
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
val localVarResponse = findPetsByStatusWithHttpInfo(status = status)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
@@ -183,6 +209,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter
* @return ApiInfrastructureResponse<kotlin.collections.List<Pet>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List<kotlin.String>) : ApiInfrastructureResponse<kotlin.collections.List<Pet>?> {
val localVariableConfig = findPetsByStatusRequestConfig(status = status)
return request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation findPetsByStatus
*
@@ -220,11 +265,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Deprecated(message = "This operation is deprecated.")
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
@Suppress("DEPRECATION")
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
val localVarResponse = findPetsByTagsWithHttpInfo(tags = tags)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
@@ -241,6 +282,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by
* @return ApiInfrastructureResponse<kotlin.collections.List<Pet>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
@Deprecated(message = "This operation is deprecated.")
fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List<kotlin.String>) : ApiInfrastructureResponse<kotlin.collections.List<Pet>?> {
@Suppress("DEPRECATION")
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
return request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation findPetsByTags
*
@@ -277,11 +339,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getPetById(petId: kotlin.Long) : Pet {
val localVariableConfig = getPetByIdRequestConfig(petId = petId)
val localVarResponse = request<Unit, Pet>(
localVariableConfig
)
val localVarResponse = getPetByIdWithHttpInfo(petId = petId)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
@@ -298,6 +356,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Find pet by ID
* Returns a single pet
* @param petId ID of pet to return
* @return ApiInfrastructureResponse<Pet?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse<Pet?> {
val localVariableConfig = getPetByIdRequestConfig(petId = petId)
return request<Unit, Pet>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getPetById
*
@@ -329,11 +406,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePet(body: Pet) : Unit {
val localVariableConfig = updatePetRequestConfig(body = body)
val localVarResponse = request<Pet, Unit>(
localVariableConfig
)
val localVarResponse = updatePetWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -350,6 +423,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Update an existing pet
*
* @param body Pet object that needs to be added to the store
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updatePetRequestConfig(body = body)
return request<Pet, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updatePet
*
@@ -383,11 +474,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit {
val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status)
val localVarResponse = request<Map<String, Any?>, Unit>(
localVariableConfig
)
val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -404,6 +491,26 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Updates a pet in the store with form data
*
* @param petId ID of pet that needs to be updated
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status)
return request<Map<String, Any?>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updatePetWithForm
*
@@ -440,11 +547,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse {
val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file)
val localVarResponse = request<Map<String, Any?>, ApiResponse>(
localVariableConfig
)
val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
@@ -461,6 +564,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* uploads an image
*
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @return ApiInfrastructureResponse<ApiResponse?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse<ApiResponse?> {
val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file)
return request<Map<String, Any?>, ApiResponse>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation uploadFile
*

View File

@@ -23,6 +23,7 @@ package org.openapitools.client.apis
import org.openapitools.client.models.Order
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -53,11 +54,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteOrder(orderId: kotlin.String) : Unit {
val localVariableConfig = deleteOrderRequestConfig(orderId = orderId)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -74,6 +71,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Delete purchase order by ID
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
* @param orderId ID of the order that needs to be deleted
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deleteOrderRequestConfig(orderId = orderId)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deleteOrder
*
@@ -105,11 +120,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getInventory() : kotlin.collections.Map<kotlin.String, kotlin.Int> {
val localVariableConfig = getInventoryRequestConfig()
val localVarResponse = request<Unit, kotlin.collections.Map<kotlin.String, kotlin.Int>>(
localVariableConfig
)
val localVarResponse = getInventoryWithHttpInfo()
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
@@ -126,6 +137,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
* @return ApiInfrastructureResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getInventoryWithHttpInfo() : ApiInfrastructureResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>?> {
val localVariableConfig = getInventoryRequestConfig()
return request<Unit, kotlin.collections.Map<kotlin.String, kotlin.Int>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getInventory
*
@@ -157,11 +186,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getOrderById(orderId: kotlin.Long) : Order {
val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId)
val localVarResponse = request<Unit, Order>(
localVariableConfig
)
val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
@@ -178,6 +203,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* @param orderId ID of pet that needs to be fetched
* @return ApiInfrastructureResponse<Order?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse<Order?> {
val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId)
return request<Unit, Order>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getOrderById
*
@@ -210,11 +254,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun placeOrder(body: Order) : Order {
val localVariableConfig = placeOrderRequestConfig(body = body)
val localVarResponse = request<Order, Order>(
localVariableConfig
)
val localVarResponse = placeOrderWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
@@ -231,6 +271,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Place an order for a pet
*
* @param body order placed for purchasing the pet
* @return ApiInfrastructureResponse<Order?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse<Order?> {
val localVariableConfig = placeOrderRequestConfig(body = body)
return request<Order, Order>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation placeOrder
*

View File

@@ -23,6 +23,7 @@ package org.openapitools.client.apis
import org.openapitools.client.models.User
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -53,11 +54,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUser(body: User) : Unit {
val localVariableConfig = createUserRequestConfig(body = body)
val localVarResponse = request<User, Unit>(
localVariableConfig
)
val localVarResponse = createUserWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -74,6 +71,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Create user
* This can only be done by the logged in user.
* @param body Created user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUserRequestConfig(body = body)
return request<User, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUser
*
@@ -105,11 +120,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInput(body: kotlin.collections.List<User>) : Unit {
val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body)
val localVarResponse = request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -126,6 +137,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Creates list of users with given input array
*
* @param body List of user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List<User>) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body)
return request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUsersWithArrayInput
*
@@ -157,11 +186,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInput(body: kotlin.collections.List<User>) : Unit {
val localVariableConfig = createUsersWithListInputRequestConfig(body = body)
val localVarResponse = request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
val localVarResponse = createUsersWithListInputWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -178,6 +203,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Creates list of users with given input array
*
* @param body List of user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List<User>) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUsersWithListInputRequestConfig(body = body)
return request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUsersWithListInput
*
@@ -209,11 +252,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteUser(username: kotlin.String) : Unit {
val localVariableConfig = deleteUserRequestConfig(username = username)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deleteUserWithHttpInfo(username = username)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -230,6 +269,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Delete user
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deleteUserRequestConfig(username = username)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deleteUser
*
@@ -262,11 +319,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getUserByName(username: kotlin.String) : User {
val localVariableConfig = getUserByNameRequestConfig(username = username)
val localVarResponse = request<Unit, User>(
localVariableConfig
)
val localVarResponse = getUserByNameWithHttpInfo(username = username)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as User
@@ -283,6 +336,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return ApiInfrastructureResponse<User?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse<User?> {
val localVariableConfig = getUserByNameRequestConfig(username = username)
return request<Unit, User>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getUserByName
*
@@ -316,11 +388,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String {
val localVariableConfig = loginUserRequestConfig(username = username, password = password)
val localVarResponse = request<Unit, kotlin.String>(
localVariableConfig
)
val localVarResponse = loginUserWithHttpInfo(username = username, password = password)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
@@ -337,6 +405,26 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Logs user into the system
*
* @param username The user name for login
* @param password The password for login in clear text
* @return ApiInfrastructureResponse<kotlin.String?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse<kotlin.String?> {
val localVariableConfig = loginUserRequestConfig(username = username, password = password)
return request<Unit, kotlin.String>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation loginUser
*
@@ -372,11 +460,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun logoutUser() : Unit {
val localVariableConfig = logoutUserRequestConfig()
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = logoutUserWithHttpInfo()
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -393,6 +477,23 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Logs out current logged in user session
*
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun logoutUserWithHttpInfo() : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = logoutUserRequestConfig()
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation logoutUser
*
@@ -424,11 +525,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updateUser(username: kotlin.String, body: User) : Unit {
val localVariableConfig = updateUserRequestConfig(username = username, body = body)
val localVarResponse = request<User, Unit>(
localVariableConfig
)
val localVarResponse = updateUserWithHttpInfo(username = username, body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -445,6 +542,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Updated user
* This can only be done by the logged in user.
* @param username name that need to be deleted
* @param body Updated user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updateUserRequestConfig(username = username, body = body)
return request<User, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updateUser
*

View File

@@ -24,6 +24,7 @@ import org.openapitools.client.models.ApiResponse
import org.openapitools.client.models.Pet
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -54,11 +55,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun addPet(body: Pet) : Unit {
val localVariableConfig = addPetRequestConfig(body = body)
val localVarResponse = request<Pet, Unit>(
localVariableConfig
)
val localVarResponse = addPetWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -75,6 +72,24 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas
}
}
/**
* Add a new pet to the store
*
* @param body Pet object that needs to be added to the store
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = addPetRequestConfig(body = body)
return request<Pet, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation addPet
*
@@ -107,11 +122,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit {
val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -128,6 +139,25 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas
}
}
/**
* Deletes a pet
*
* @param petId Pet id to delete
* @param apiKey (optional)
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deletePet
*
@@ -162,11 +192,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
val localVariableConfig = findPetsByStatusRequestConfig(status = status)
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
val localVarResponse = findPetsByStatusWithHttpInfo(status = status)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
@@ -183,6 +209,25 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas
}
}
/**
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter
* @return ApiInfrastructureResponse<kotlin.collections.List<Pet>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List<kotlin.String>) : ApiInfrastructureResponse<kotlin.collections.List<Pet>?> {
val localVariableConfig = findPetsByStatusRequestConfig(status = status)
return request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation findPetsByStatus
*
@@ -220,11 +265,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas
@Deprecated(message = "This operation is deprecated.")
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
@Suppress("DEPRECATION")
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
val localVarResponse = findPetsByTagsWithHttpInfo(tags = tags)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
@@ -241,6 +282,27 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas
}
}
/**
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by
* @return ApiInfrastructureResponse<kotlin.collections.List<Pet>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
@Deprecated(message = "This operation is deprecated.")
fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List<kotlin.String>) : ApiInfrastructureResponse<kotlin.collections.List<Pet>?> {
@Suppress("DEPRECATION")
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
return request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation findPetsByTags
*
@@ -277,11 +339,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getPetById(petId: kotlin.Long) : Pet {
val localVariableConfig = getPetByIdRequestConfig(petId = petId)
val localVarResponse = request<Unit, Pet>(
localVariableConfig
)
val localVarResponse = getPetByIdWithHttpInfo(petId = petId)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
@@ -298,6 +356,25 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas
}
}
/**
* Find pet by ID
* Returns a single pet
* @param petId ID of pet to return
* @return ApiInfrastructureResponse<Pet?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse<Pet?> {
val localVariableConfig = getPetByIdRequestConfig(petId = petId)
return request<Unit, Pet>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getPetById
*
@@ -329,11 +406,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePet(body: Pet) : Unit {
val localVariableConfig = updatePetRequestConfig(body = body)
val localVarResponse = request<Pet, Unit>(
localVariableConfig
)
val localVarResponse = updatePetWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -350,6 +423,24 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas
}
}
/**
* Update an existing pet
*
* @param body Pet object that needs to be added to the store
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updatePetRequestConfig(body = body)
return request<Pet, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updatePet
*
@@ -383,11 +474,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit {
val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status)
val localVarResponse = request<Map<String, Any?>, Unit>(
localVariableConfig
)
val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -404,6 +491,26 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas
}
}
/**
* Updates a pet in the store with form data
*
* @param petId ID of pet that needs to be updated
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status)
return request<Map<String, Any?>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updatePetWithForm
*
@@ -440,11 +547,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse {
val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file)
val localVarResponse = request<Map<String, Any?>, ApiResponse>(
localVariableConfig
)
val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
@@ -461,6 +564,27 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas
}
}
/**
* uploads an image
*
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @return ApiInfrastructureResponse<ApiResponse?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse<ApiResponse?> {
val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file)
return request<Map<String, Any?>, ApiResponse>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation uploadFile
*

View File

@@ -23,6 +23,7 @@ package org.openapitools.client.apis
import org.openapitools.client.models.Order
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -53,11 +54,7 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteOrder(orderId: kotlin.String) : Unit {
val localVariableConfig = deleteOrderRequestConfig(orderId = orderId)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -74,6 +71,24 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b
}
}
/**
* Delete purchase order by ID
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
* @param orderId ID of the order that needs to be deleted
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deleteOrderRequestConfig(orderId = orderId)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deleteOrder
*
@@ -105,11 +120,7 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getInventory() : kotlin.collections.Map<kotlin.String, kotlin.Int> {
val localVariableConfig = getInventoryRequestConfig()
val localVarResponse = request<Unit, kotlin.collections.Map<kotlin.String, kotlin.Int>>(
localVariableConfig
)
val localVarResponse = getInventoryWithHttpInfo()
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
@@ -126,6 +137,24 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b
}
}
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
* @return ApiInfrastructureResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getInventoryWithHttpInfo() : ApiInfrastructureResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>?> {
val localVariableConfig = getInventoryRequestConfig()
return request<Unit, kotlin.collections.Map<kotlin.String, kotlin.Int>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getInventory
*
@@ -157,11 +186,7 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getOrderById(orderId: kotlin.Long) : Order {
val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId)
val localVarResponse = request<Unit, Order>(
localVariableConfig
)
val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
@@ -178,6 +203,25 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b
}
}
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* @param orderId ID of pet that needs to be fetched
* @return ApiInfrastructureResponse<Order?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse<Order?> {
val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId)
return request<Unit, Order>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getOrderById
*
@@ -210,11 +254,7 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun placeOrder(body: Order) : Order {
val localVariableConfig = placeOrderRequestConfig(body = body)
val localVarResponse = request<Order, Order>(
localVariableConfig
)
val localVarResponse = placeOrderWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
@@ -231,6 +271,25 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b
}
}
/**
* Place an order for a pet
*
* @param body order placed for purchasing the pet
* @return ApiInfrastructureResponse<Order?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse<Order?> {
val localVariableConfig = placeOrderRequestConfig(body = body)
return request<Order, Order>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation placeOrder
*

View File

@@ -23,6 +23,7 @@ package org.openapitools.client.apis
import org.openapitools.client.models.User
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -53,11 +54,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUser(body: User) : Unit {
val localVariableConfig = createUserRequestConfig(body = body)
val localVarResponse = request<User, Unit>(
localVariableConfig
)
val localVarResponse = createUserWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -74,6 +71,24 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba
}
}
/**
* Create user
* This can only be done by the logged in user.
* @param body Created user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUserRequestConfig(body = body)
return request<User, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUser
*
@@ -105,11 +120,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInput(body: kotlin.collections.List<User>) : Unit {
val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body)
val localVarResponse = request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -126,6 +137,24 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba
}
}
/**
* Creates list of users with given input array
*
* @param body List of user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List<User>) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body)
return request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUsersWithArrayInput
*
@@ -157,11 +186,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInput(body: kotlin.collections.List<User>) : Unit {
val localVariableConfig = createUsersWithListInputRequestConfig(body = body)
val localVarResponse = request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
val localVarResponse = createUsersWithListInputWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -178,6 +203,24 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba
}
}
/**
* Creates list of users with given input array
*
* @param body List of user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List<User>) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUsersWithListInputRequestConfig(body = body)
return request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUsersWithListInput
*
@@ -209,11 +252,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteUser(username: kotlin.String) : Unit {
val localVariableConfig = deleteUserRequestConfig(username = username)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deleteUserWithHttpInfo(username = username)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -230,6 +269,24 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba
}
}
/**
* Delete user
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deleteUserRequestConfig(username = username)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deleteUser
*
@@ -262,11 +319,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getUserByName(username: kotlin.String) : User {
val localVariableConfig = getUserByNameRequestConfig(username = username)
val localVarResponse = request<Unit, User>(
localVariableConfig
)
val localVarResponse = getUserByNameWithHttpInfo(username = username)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as User
@@ -283,6 +336,25 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba
}
}
/**
* Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return ApiInfrastructureResponse<User?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse<User?> {
val localVariableConfig = getUserByNameRequestConfig(username = username)
return request<Unit, User>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getUserByName
*
@@ -316,11 +388,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String {
val localVariableConfig = loginUserRequestConfig(username = username, password = password)
val localVarResponse = request<Unit, kotlin.String>(
localVariableConfig
)
val localVarResponse = loginUserWithHttpInfo(username = username, password = password)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
@@ -337,6 +405,26 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba
}
}
/**
* Logs user into the system
*
* @param username The user name for login
* @param password The password for login in clear text
* @return ApiInfrastructureResponse<kotlin.String?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse<kotlin.String?> {
val localVariableConfig = loginUserRequestConfig(username = username, password = password)
return request<Unit, kotlin.String>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation loginUser
*
@@ -372,11 +460,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun logoutUser() : Unit {
val localVariableConfig = logoutUserRequestConfig()
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = logoutUserWithHttpInfo()
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -393,6 +477,23 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba
}
}
/**
* Logs out current logged in user session
*
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun logoutUserWithHttpInfo() : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = logoutUserRequestConfig()
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation logoutUser
*
@@ -424,11 +525,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updateUser(username: kotlin.String, body: User) : Unit {
val localVariableConfig = updateUserRequestConfig(username = username, body = body)
val localVarResponse = request<User, Unit>(
localVariableConfig
)
val localVarResponse = updateUserWithHttpInfo(username = username, body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -445,6 +542,25 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba
}
}
/**
* Updated user
* This can only be done by the logged in user.
* @param username name that need to be deleted
* @param body Updated user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updateUserRequestConfig(username = username, body = body)
return request<User, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updateUser
*

View File

@@ -24,6 +24,7 @@ import org.openapitools.client.models.ApiResponse
import org.openapitools.client.models.Pet
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -54,11 +55,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun addPet(body: Pet) : Unit {
val localVariableConfig = addPetRequestConfig(body = body)
val localVarResponse = request<Pet, Unit>(
localVariableConfig
)
val localVarResponse = addPetWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -75,6 +72,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Add a new pet to the store
*
* @param body Pet object that needs to be added to the store
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = addPetRequestConfig(body = body)
return request<Pet, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation addPet
*
@@ -107,11 +122,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit {
val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -128,6 +139,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Deletes a pet
*
* @param petId Pet id to delete
* @param apiKey (optional)
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deletePet
*
@@ -162,11 +192,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet>? {
val localVariableConfig = findPetsByStatusRequestConfig(status = status)
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
val localVarResponse = findPetsByStatusWithHttpInfo(status = status)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>?
@@ -183,6 +209,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter
* @return ApiInfrastructureResponse<kotlin.collections.List<Pet>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List<kotlin.String>) : ApiInfrastructureResponse<kotlin.collections.List<Pet>?> {
val localVariableConfig = findPetsByStatusRequestConfig(status = status)
return request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation findPetsByStatus
*
@@ -220,11 +265,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Deprecated(message = "This operation is deprecated.")
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet>? {
@Suppress("DEPRECATION")
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
val localVarResponse = findPetsByTagsWithHttpInfo(tags = tags)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>?
@@ -241,6 +282,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by
* @return ApiInfrastructureResponse<kotlin.collections.List<Pet>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
@Deprecated(message = "This operation is deprecated.")
fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List<kotlin.String>) : ApiInfrastructureResponse<kotlin.collections.List<Pet>?> {
@Suppress("DEPRECATION")
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
return request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation findPetsByTags
*
@@ -277,11 +339,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getPetById(petId: kotlin.Long) : Pet? {
val localVariableConfig = getPetByIdRequestConfig(petId = petId)
val localVarResponse = request<Unit, Pet>(
localVariableConfig
)
val localVarResponse = getPetByIdWithHttpInfo(petId = petId)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet?
@@ -298,6 +356,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Find pet by ID
* Returns a single pet
* @param petId ID of pet to return
* @return ApiInfrastructureResponse<Pet?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse<Pet?> {
val localVariableConfig = getPetByIdRequestConfig(petId = petId)
return request<Unit, Pet>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getPetById
*
@@ -329,11 +406,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePet(body: Pet) : Unit {
val localVariableConfig = updatePetRequestConfig(body = body)
val localVarResponse = request<Pet, Unit>(
localVariableConfig
)
val localVarResponse = updatePetWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -350,6 +423,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Update an existing pet
*
* @param body Pet object that needs to be added to the store
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updatePetRequestConfig(body = body)
return request<Pet, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updatePet
*
@@ -383,11 +474,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit {
val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status)
val localVarResponse = request<Map<String, Any?>, Unit>(
localVariableConfig
)
val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -404,6 +491,26 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Updates a pet in the store with form data
*
* @param petId ID of pet that needs to be updated
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status)
return request<Map<String, Any?>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updatePetWithForm
*
@@ -440,11 +547,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse? {
val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file)
val localVarResponse = request<Map<String, Any?>, ApiResponse>(
localVariableConfig
)
val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse?
@@ -461,6 +564,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* uploads an image
*
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @return ApiInfrastructureResponse<ApiResponse?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse<ApiResponse?> {
val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file)
return request<Map<String, Any?>, ApiResponse>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation uploadFile
*

View File

@@ -23,6 +23,7 @@ package org.openapitools.client.apis
import org.openapitools.client.models.Order
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -53,11 +54,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteOrder(orderId: kotlin.String) : Unit {
val localVariableConfig = deleteOrderRequestConfig(orderId = orderId)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -74,6 +71,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Delete purchase order by ID
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
* @param orderId ID of the order that needs to be deleted
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deleteOrderRequestConfig(orderId = orderId)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deleteOrder
*
@@ -105,11 +120,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getInventory() : kotlin.collections.Map<kotlin.String, kotlin.Int>? {
val localVariableConfig = getInventoryRequestConfig()
val localVarResponse = request<Unit, kotlin.collections.Map<kotlin.String, kotlin.Int>>(
localVariableConfig
)
val localVarResponse = getInventoryWithHttpInfo()
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>?
@@ -126,6 +137,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
* @return ApiInfrastructureResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getInventoryWithHttpInfo() : ApiInfrastructureResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>?> {
val localVariableConfig = getInventoryRequestConfig()
return request<Unit, kotlin.collections.Map<kotlin.String, kotlin.Int>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getInventory
*
@@ -157,11 +186,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getOrderById(orderId: kotlin.Long) : Order? {
val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId)
val localVarResponse = request<Unit, Order>(
localVariableConfig
)
val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Order?
@@ -178,6 +203,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* @param orderId ID of pet that needs to be fetched
* @return ApiInfrastructureResponse<Order?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse<Order?> {
val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId)
return request<Unit, Order>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getOrderById
*
@@ -210,11 +254,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun placeOrder(body: Order) : Order? {
val localVariableConfig = placeOrderRequestConfig(body = body)
val localVarResponse = request<Order, Order>(
localVariableConfig
)
val localVarResponse = placeOrderWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Order?
@@ -231,6 +271,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Place an order for a pet
*
* @param body order placed for purchasing the pet
* @return ApiInfrastructureResponse<Order?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse<Order?> {
val localVariableConfig = placeOrderRequestConfig(body = body)
return request<Order, Order>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation placeOrder
*

View File

@@ -23,6 +23,7 @@ package org.openapitools.client.apis
import org.openapitools.client.models.User
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -53,11 +54,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUser(body: User) : Unit {
val localVariableConfig = createUserRequestConfig(body = body)
val localVarResponse = request<User, Unit>(
localVariableConfig
)
val localVarResponse = createUserWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -74,6 +71,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Create user
* This can only be done by the logged in user.
* @param body Created user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUserRequestConfig(body = body)
return request<User, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUser
*
@@ -105,11 +120,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInput(body: kotlin.collections.List<User>) : Unit {
val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body)
val localVarResponse = request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -126,6 +137,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Creates list of users with given input array
*
* @param body List of user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List<User>) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body)
return request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUsersWithArrayInput
*
@@ -157,11 +186,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInput(body: kotlin.collections.List<User>) : Unit {
val localVariableConfig = createUsersWithListInputRequestConfig(body = body)
val localVarResponse = request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
val localVarResponse = createUsersWithListInputWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -178,6 +203,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Creates list of users with given input array
*
* @param body List of user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List<User>) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUsersWithListInputRequestConfig(body = body)
return request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUsersWithListInput
*
@@ -209,11 +252,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteUser(username: kotlin.String) : Unit {
val localVariableConfig = deleteUserRequestConfig(username = username)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deleteUserWithHttpInfo(username = username)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -230,6 +269,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Delete user
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deleteUserRequestConfig(username = username)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deleteUser
*
@@ -262,11 +319,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getUserByName(username: kotlin.String) : User? {
val localVariableConfig = getUserByNameRequestConfig(username = username)
val localVarResponse = request<Unit, User>(
localVariableConfig
)
val localVarResponse = getUserByNameWithHttpInfo(username = username)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as User?
@@ -283,6 +336,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return ApiInfrastructureResponse<User?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse<User?> {
val localVariableConfig = getUserByNameRequestConfig(username = username)
return request<Unit, User>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getUserByName
*
@@ -316,11 +388,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String? {
val localVariableConfig = loginUserRequestConfig(username = username, password = password)
val localVarResponse = request<Unit, kotlin.String>(
localVariableConfig
)
val localVarResponse = loginUserWithHttpInfo(username = username, password = password)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String?
@@ -337,6 +405,26 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Logs user into the system
*
* @param username The user name for login
* @param password The password for login in clear text
* @return ApiInfrastructureResponse<kotlin.String?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse<kotlin.String?> {
val localVariableConfig = loginUserRequestConfig(username = username, password = password)
return request<Unit, kotlin.String>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation loginUser
*
@@ -372,11 +460,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun logoutUser() : Unit {
val localVariableConfig = logoutUserRequestConfig()
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = logoutUserWithHttpInfo()
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -393,6 +477,23 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Logs out current logged in user session
*
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun logoutUserWithHttpInfo() : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = logoutUserRequestConfig()
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation logoutUser
*
@@ -424,11 +525,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updateUser(username: kotlin.String, body: User) : Unit {
val localVariableConfig = updateUserRequestConfig(username = username, body = body)
val localVarResponse = request<User, Unit>(
localVariableConfig
)
val localVarResponse = updateUserWithHttpInfo(username = username, body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -445,6 +542,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Updated user
* This can only be done by the logged in user.
* @param username name that need to be deleted
* @param body Updated user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updateUserRequestConfig(username = username, body = body)
return request<User, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updateUser
*

View File

@@ -24,6 +24,7 @@ import org.openapitools.client.models.ApiResponse
import org.openapitools.client.models.Pet
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -54,11 +55,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun addPet(body: Pet) : Unit {
val localVariableConfig = addPetRequestConfig(body = body)
val localVarResponse = request<Pet, Unit>(
localVariableConfig
)
val localVarResponse = addPetWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -75,6 +72,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Add a new pet to the store
*
* @param body Pet object that needs to be added to the store
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = addPetRequestConfig(body = body)
return request<Pet, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation addPet
*
@@ -107,11 +122,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit {
val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -128,6 +139,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Deletes a pet
*
* @param petId Pet id to delete
* @param apiKey (optional)
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deletePet
*
@@ -162,11 +192,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
val localVariableConfig = findPetsByStatusRequestConfig(status = status)
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
val localVarResponse = findPetsByStatusWithHttpInfo(status = status)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
@@ -183,6 +209,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter
* @return ApiInfrastructureResponse<kotlin.collections.List<Pet>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List<kotlin.String>) : ApiInfrastructureResponse<kotlin.collections.List<Pet>?> {
val localVariableConfig = findPetsByStatusRequestConfig(status = status)
return request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation findPetsByStatus
*
@@ -220,11 +265,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Deprecated(message = "This operation is deprecated.")
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
@Suppress("DEPRECATION")
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
val localVarResponse = findPetsByTagsWithHttpInfo(tags = tags)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
@@ -241,6 +282,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by
* @return ApiInfrastructureResponse<kotlin.collections.List<Pet>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
@Deprecated(message = "This operation is deprecated.")
fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List<kotlin.String>) : ApiInfrastructureResponse<kotlin.collections.List<Pet>?> {
@Suppress("DEPRECATION")
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
return request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation findPetsByTags
*
@@ -277,11 +339,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getPetById(petId: kotlin.Long) : Pet {
val localVariableConfig = getPetByIdRequestConfig(petId = petId)
val localVarResponse = request<Unit, Pet>(
localVariableConfig
)
val localVarResponse = getPetByIdWithHttpInfo(petId = petId)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
@@ -298,6 +356,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Find pet by ID
* Returns a single pet
* @param petId ID of pet to return
* @return ApiInfrastructureResponse<Pet?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse<Pet?> {
val localVariableConfig = getPetByIdRequestConfig(petId = petId)
return request<Unit, Pet>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getPetById
*
@@ -329,11 +406,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePet(body: Pet) : Unit {
val localVariableConfig = updatePetRequestConfig(body = body)
val localVarResponse = request<Pet, Unit>(
localVariableConfig
)
val localVarResponse = updatePetWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -350,6 +423,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Update an existing pet
*
* @param body Pet object that needs to be added to the store
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updatePetRequestConfig(body = body)
return request<Pet, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updatePet
*
@@ -383,11 +474,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit {
val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status)
val localVarResponse = request<Map<String, Any?>, Unit>(
localVariableConfig
)
val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -404,6 +491,26 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Updates a pet in the store with form data
*
* @param petId ID of pet that needs to be updated
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status)
return request<Map<String, Any?>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updatePetWithForm
*
@@ -440,11 +547,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse {
val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file)
val localVarResponse = request<Map<String, Any?>, ApiResponse>(
localVariableConfig
)
val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
@@ -461,6 +564,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* uploads an image
*
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @return ApiInfrastructureResponse<ApiResponse?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse<ApiResponse?> {
val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file)
return request<Map<String, Any?>, ApiResponse>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation uploadFile
*

View File

@@ -23,6 +23,7 @@ package org.openapitools.client.apis
import org.openapitools.client.models.Order
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -53,11 +54,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteOrder(orderId: kotlin.String) : Unit {
val localVariableConfig = deleteOrderRequestConfig(orderId = orderId)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -74,6 +71,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Delete purchase order by ID
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
* @param orderId ID of the order that needs to be deleted
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deleteOrderRequestConfig(orderId = orderId)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deleteOrder
*
@@ -105,11 +120,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getInventory() : kotlin.collections.Map<kotlin.String, kotlin.Int> {
val localVariableConfig = getInventoryRequestConfig()
val localVarResponse = request<Unit, kotlin.collections.Map<kotlin.String, kotlin.Int>>(
localVariableConfig
)
val localVarResponse = getInventoryWithHttpInfo()
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
@@ -126,6 +137,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
* @return ApiInfrastructureResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getInventoryWithHttpInfo() : ApiInfrastructureResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>?> {
val localVariableConfig = getInventoryRequestConfig()
return request<Unit, kotlin.collections.Map<kotlin.String, kotlin.Int>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getInventory
*
@@ -157,11 +186,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getOrderById(orderId: kotlin.Long) : Order {
val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId)
val localVarResponse = request<Unit, Order>(
localVariableConfig
)
val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
@@ -178,6 +203,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* @param orderId ID of pet that needs to be fetched
* @return ApiInfrastructureResponse<Order?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse<Order?> {
val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId)
return request<Unit, Order>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getOrderById
*
@@ -210,11 +254,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun placeOrder(body: Order) : Order {
val localVariableConfig = placeOrderRequestConfig(body = body)
val localVarResponse = request<Order, Order>(
localVariableConfig
)
val localVarResponse = placeOrderWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
@@ -231,6 +271,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Place an order for a pet
*
* @param body order placed for purchasing the pet
* @return ApiInfrastructureResponse<Order?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse<Order?> {
val localVariableConfig = placeOrderRequestConfig(body = body)
return request<Order, Order>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation placeOrder
*

View File

@@ -23,6 +23,7 @@ package org.openapitools.client.apis
import org.openapitools.client.models.User
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -53,11 +54,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUser(body: User) : Unit {
val localVariableConfig = createUserRequestConfig(body = body)
val localVarResponse = request<User, Unit>(
localVariableConfig
)
val localVarResponse = createUserWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -74,6 +71,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Create user
* This can only be done by the logged in user.
* @param body Created user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUserRequestConfig(body = body)
return request<User, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUser
*
@@ -105,11 +120,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInput(body: kotlin.collections.List<User>) : Unit {
val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body)
val localVarResponse = request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -126,6 +137,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Creates list of users with given input array
*
* @param body List of user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List<User>) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body)
return request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUsersWithArrayInput
*
@@ -157,11 +186,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInput(body: kotlin.collections.List<User>) : Unit {
val localVariableConfig = createUsersWithListInputRequestConfig(body = body)
val localVarResponse = request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
val localVarResponse = createUsersWithListInputWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -178,6 +203,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Creates list of users with given input array
*
* @param body List of user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List<User>) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUsersWithListInputRequestConfig(body = body)
return request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUsersWithListInput
*
@@ -209,11 +252,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteUser(username: kotlin.String) : Unit {
val localVariableConfig = deleteUserRequestConfig(username = username)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deleteUserWithHttpInfo(username = username)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -230,6 +269,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Delete user
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deleteUserRequestConfig(username = username)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deleteUser
*
@@ -262,11 +319,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getUserByName(username: kotlin.String) : User {
val localVariableConfig = getUserByNameRequestConfig(username = username)
val localVarResponse = request<Unit, User>(
localVariableConfig
)
val localVarResponse = getUserByNameWithHttpInfo(username = username)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as User
@@ -283,6 +336,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return ApiInfrastructureResponse<User?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse<User?> {
val localVariableConfig = getUserByNameRequestConfig(username = username)
return request<Unit, User>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getUserByName
*
@@ -316,11 +388,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String {
val localVariableConfig = loginUserRequestConfig(username = username, password = password)
val localVarResponse = request<Unit, kotlin.String>(
localVariableConfig
)
val localVarResponse = loginUserWithHttpInfo(username = username, password = password)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
@@ -337,6 +405,26 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Logs user into the system
*
* @param username The user name for login
* @param password The password for login in clear text
* @return ApiInfrastructureResponse<kotlin.String?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse<kotlin.String?> {
val localVariableConfig = loginUserRequestConfig(username = username, password = password)
return request<Unit, kotlin.String>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation loginUser
*
@@ -372,11 +460,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun logoutUser() : Unit {
val localVariableConfig = logoutUserRequestConfig()
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = logoutUserWithHttpInfo()
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -393,6 +477,23 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Logs out current logged in user session
*
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun logoutUserWithHttpInfo() : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = logoutUserRequestConfig()
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation logoutUser
*
@@ -424,11 +525,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updateUser(username: kotlin.String, body: User) : Unit {
val localVariableConfig = updateUserRequestConfig(username = username, body = body)
val localVarResponse = request<User, Unit>(
localVariableConfig
)
val localVarResponse = updateUserWithHttpInfo(username = username, body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -445,6 +542,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Updated user
* This can only be done by the logged in user.
* @param username name that need to be deleted
* @param body Updated user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updateUserRequestConfig(username = username, body = body)
return request<User, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updateUser
*

View File

@@ -24,6 +24,7 @@ import org.openapitools.client.models.ApiResponse
import org.openapitools.client.models.Pet
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -54,11 +55,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun addPet(body: Pet) : Unit {
val localVariableConfig = addPetRequestConfig(body = body)
val localVarResponse = request<Pet, Unit>(
localVariableConfig
)
val localVarResponse = addPetWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -75,6 +72,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Add a new pet to the store
*
* @param body Pet object that needs to be added to the store
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = addPetRequestConfig(body = body)
return request<Pet, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation addPet
*
@@ -107,11 +122,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deletePet(apiKey: kotlin.String?, petId: kotlin.Long) : Unit {
val localVariableConfig = deletePetRequestConfig(apiKey = apiKey, petId = petId)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deletePetWithHttpInfo(apiKey = apiKey, petId = petId)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -128,6 +139,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Deletes a pet
*
* @param apiKey (optional)
* @param petId Pet id to delete
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deletePetWithHttpInfo(apiKey: kotlin.String?, petId: kotlin.Long) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deletePetRequestConfig(apiKey = apiKey, petId = petId)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deletePet
*
@@ -162,11 +192,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
val localVariableConfig = findPetsByStatusRequestConfig(status = status)
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
val localVarResponse = findPetsByStatusWithHttpInfo(status = status)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
@@ -183,6 +209,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter
* @return ApiInfrastructureResponse<kotlin.collections.List<Pet>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List<kotlin.String>) : ApiInfrastructureResponse<kotlin.collections.List<Pet>?> {
val localVariableConfig = findPetsByStatusRequestConfig(status = status)
return request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation findPetsByStatus
*
@@ -220,11 +265,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Deprecated(message = "This operation is deprecated.")
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
@Suppress("DEPRECATION")
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
val localVarResponse = findPetsByTagsWithHttpInfo(tags = tags)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
@@ -241,6 +282,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by
* @return ApiInfrastructureResponse<kotlin.collections.List<Pet>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
@Deprecated(message = "This operation is deprecated.")
fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List<kotlin.String>) : ApiInfrastructureResponse<kotlin.collections.List<Pet>?> {
@Suppress("DEPRECATION")
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
return request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation findPetsByTags
*
@@ -277,11 +339,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getPetById(petId: kotlin.Long) : Pet {
val localVariableConfig = getPetByIdRequestConfig(petId = petId)
val localVarResponse = request<Unit, Pet>(
localVariableConfig
)
val localVarResponse = getPetByIdWithHttpInfo(petId = petId)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
@@ -298,6 +356,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Find pet by ID
* Returns a single pet
* @param petId ID of pet to return
* @return ApiInfrastructureResponse<Pet?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse<Pet?> {
val localVariableConfig = getPetByIdRequestConfig(petId = petId)
return request<Unit, Pet>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getPetById
*
@@ -329,11 +406,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePet(body: Pet) : Unit {
val localVariableConfig = updatePetRequestConfig(body = body)
val localVarResponse = request<Pet, Unit>(
localVariableConfig
)
val localVarResponse = updatePetWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -350,6 +423,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Update an existing pet
*
* @param body Pet object that needs to be added to the store
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updatePetRequestConfig(body = body)
return request<Pet, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updatePet
*
@@ -383,11 +474,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit {
val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status)
val localVarResponse = request<Map<String, Any?>, Unit>(
localVariableConfig
)
val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -404,6 +491,26 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Updates a pet in the store with form data
*
* @param petId ID of pet that needs to be updated
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status)
return request<Map<String, Any?>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updatePetWithForm
*
@@ -440,11 +547,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse {
val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file)
val localVarResponse = request<Map<String, Any?>, ApiResponse>(
localVariableConfig
)
val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
@@ -461,6 +564,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* uploads an image
*
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @return ApiInfrastructureResponse<ApiResponse?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse<ApiResponse?> {
val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file)
return request<Map<String, Any?>, ApiResponse>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation uploadFile
*

View File

@@ -23,6 +23,7 @@ package org.openapitools.client.apis
import org.openapitools.client.models.Order
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -53,11 +54,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteOrder(orderId: kotlin.String) : Unit {
val localVariableConfig = deleteOrderRequestConfig(orderId = orderId)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -74,6 +71,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Delete purchase order by ID
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
* @param orderId ID of the order that needs to be deleted
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deleteOrderRequestConfig(orderId = orderId)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deleteOrder
*
@@ -105,11 +120,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getInventory() : kotlin.collections.Map<kotlin.String, kotlin.Int> {
val localVariableConfig = getInventoryRequestConfig()
val localVarResponse = request<Unit, kotlin.collections.Map<kotlin.String, kotlin.Int>>(
localVariableConfig
)
val localVarResponse = getInventoryWithHttpInfo()
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
@@ -126,6 +137,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
* @return ApiInfrastructureResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getInventoryWithHttpInfo() : ApiInfrastructureResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>?> {
val localVariableConfig = getInventoryRequestConfig()
return request<Unit, kotlin.collections.Map<kotlin.String, kotlin.Int>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getInventory
*
@@ -157,11 +186,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getOrderById(orderId: kotlin.Long) : Order {
val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId)
val localVarResponse = request<Unit, Order>(
localVariableConfig
)
val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
@@ -178,6 +203,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* @param orderId ID of pet that needs to be fetched
* @return ApiInfrastructureResponse<Order?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse<Order?> {
val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId)
return request<Unit, Order>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getOrderById
*
@@ -210,11 +254,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun placeOrder(body: Order) : Order {
val localVariableConfig = placeOrderRequestConfig(body = body)
val localVarResponse = request<Order, Order>(
localVariableConfig
)
val localVarResponse = placeOrderWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
@@ -231,6 +271,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Place an order for a pet
*
* @param body order placed for purchasing the pet
* @return ApiInfrastructureResponse<Order?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse<Order?> {
val localVariableConfig = placeOrderRequestConfig(body = body)
return request<Order, Order>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation placeOrder
*

View File

@@ -23,6 +23,7 @@ package org.openapitools.client.apis
import org.openapitools.client.models.User
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -53,11 +54,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUser(body: User) : Unit {
val localVariableConfig = createUserRequestConfig(body = body)
val localVarResponse = request<User, Unit>(
localVariableConfig
)
val localVarResponse = createUserWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -74,6 +71,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Create user
* This can only be done by the logged in user.
* @param body Created user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUserRequestConfig(body = body)
return request<User, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUser
*
@@ -105,11 +120,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInput(body: kotlin.collections.List<User>) : Unit {
val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body)
val localVarResponse = request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -126,6 +137,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Creates list of users with given input array
*
* @param body List of user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List<User>) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body)
return request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUsersWithArrayInput
*
@@ -157,11 +186,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInput(body: kotlin.collections.List<User>) : Unit {
val localVariableConfig = createUsersWithListInputRequestConfig(body = body)
val localVarResponse = request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
val localVarResponse = createUsersWithListInputWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -178,6 +203,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Creates list of users with given input array
*
* @param body List of user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List<User>) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUsersWithListInputRequestConfig(body = body)
return request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUsersWithListInput
*
@@ -209,11 +252,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteUser(username: kotlin.String) : Unit {
val localVariableConfig = deleteUserRequestConfig(username = username)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deleteUserWithHttpInfo(username = username)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -230,6 +269,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Delete user
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deleteUserRequestConfig(username = username)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deleteUser
*
@@ -262,11 +319,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getUserByName(username: kotlin.String) : User {
val localVariableConfig = getUserByNameRequestConfig(username = username)
val localVarResponse = request<Unit, User>(
localVariableConfig
)
val localVarResponse = getUserByNameWithHttpInfo(username = username)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as User
@@ -283,6 +336,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return ApiInfrastructureResponse<User?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse<User?> {
val localVariableConfig = getUserByNameRequestConfig(username = username)
return request<Unit, User>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getUserByName
*
@@ -316,11 +388,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String {
val localVariableConfig = loginUserRequestConfig(username = username, password = password)
val localVarResponse = request<Unit, kotlin.String>(
localVariableConfig
)
val localVarResponse = loginUserWithHttpInfo(username = username, password = password)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
@@ -337,6 +405,26 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Logs user into the system
*
* @param username The user name for login
* @param password The password for login in clear text
* @return ApiInfrastructureResponse<kotlin.String?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse<kotlin.String?> {
val localVariableConfig = loginUserRequestConfig(username = username, password = password)
return request<Unit, kotlin.String>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation loginUser
*
@@ -372,11 +460,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun logoutUser() : Unit {
val localVariableConfig = logoutUserRequestConfig()
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = logoutUserWithHttpInfo()
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -393,6 +477,23 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Logs out current logged in user session
*
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun logoutUserWithHttpInfo() : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = logoutUserRequestConfig()
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation logoutUser
*
@@ -424,11 +525,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updateUser(username: kotlin.String, body: User) : Unit {
val localVariableConfig = updateUserRequestConfig(username = username, body = body)
val localVarResponse = request<User, Unit>(
localVariableConfig
)
val localVarResponse = updateUserWithHttpInfo(username = username, body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -445,6 +542,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Updated user
* This can only be done by the logged in user.
* @param username name that need to be deleted
* @param body Updated user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updateUserRequestConfig(username = username, body = body)
return request<User, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updateUser
*

View File

@@ -24,6 +24,7 @@ import org.openapitools.client.models.ApiResponse
import org.openapitools.client.models.Pet
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -54,11 +55,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun addPet(body: Pet) : Unit {
val localVariableConfig = addPetRequestConfig(body = body)
val localVarResponse = request<Pet, Unit>(
localVariableConfig
)
val localVarResponse = addPetWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -75,6 +72,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Add a new pet to the store
*
* @param body Pet object that needs to be added to the store
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = addPetRequestConfig(body = body)
return request<Pet, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation addPet
*
@@ -107,11 +122,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit {
val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -128,6 +139,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Deletes a pet
*
* @param petId Pet id to delete
* @param apiKey (optional)
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deletePet
*
@@ -162,11 +192,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
val localVariableConfig = findPetsByStatusRequestConfig(status = status)
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
val localVarResponse = findPetsByStatusWithHttpInfo(status = status)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
@@ -183,6 +209,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter
* @return ApiInfrastructureResponse<kotlin.collections.List<Pet>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List<kotlin.String>) : ApiInfrastructureResponse<kotlin.collections.List<Pet>?> {
val localVariableConfig = findPetsByStatusRequestConfig(status = status)
return request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation findPetsByStatus
*
@@ -220,11 +265,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Deprecated(message = "This operation is deprecated.")
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
@Suppress("DEPRECATION")
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
val localVarResponse = findPetsByTagsWithHttpInfo(tags = tags)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
@@ -241,6 +282,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by
* @return ApiInfrastructureResponse<kotlin.collections.List<Pet>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
@Deprecated(message = "This operation is deprecated.")
fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List<kotlin.String>) : ApiInfrastructureResponse<kotlin.collections.List<Pet>?> {
@Suppress("DEPRECATION")
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
return request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation findPetsByTags
*
@@ -277,11 +339,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getPetById(petId: kotlin.Long) : Pet {
val localVariableConfig = getPetByIdRequestConfig(petId = petId)
val localVarResponse = request<Unit, Pet>(
localVariableConfig
)
val localVarResponse = getPetByIdWithHttpInfo(petId = petId)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
@@ -298,6 +356,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Find pet by ID
* Returns a single pet
* @param petId ID of pet to return
* @return ApiInfrastructureResponse<Pet?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse<Pet?> {
val localVariableConfig = getPetByIdRequestConfig(petId = petId)
return request<Unit, Pet>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getPetById
*
@@ -329,11 +406,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePet(body: Pet) : Unit {
val localVariableConfig = updatePetRequestConfig(body = body)
val localVarResponse = request<Pet, Unit>(
localVariableConfig
)
val localVarResponse = updatePetWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -350,6 +423,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Update an existing pet
*
* @param body Pet object that needs to be added to the store
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updatePetRequestConfig(body = body)
return request<Pet, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updatePet
*
@@ -383,11 +474,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit {
val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status)
val localVarResponse = request<Map<String, Any?>, Unit>(
localVariableConfig
)
val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -404,6 +491,26 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Updates a pet in the store with form data
*
* @param petId ID of pet that needs to be updated
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status)
return request<Map<String, Any?>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updatePetWithForm
*
@@ -440,11 +547,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse {
val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file)
val localVarResponse = request<Map<String, Any?>, ApiResponse>(
localVariableConfig
)
val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
@@ -461,6 +564,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* uploads an image
*
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @return ApiInfrastructureResponse<ApiResponse?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse<ApiResponse?> {
val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file)
return request<Map<String, Any?>, ApiResponse>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation uploadFile
*

View File

@@ -23,6 +23,7 @@ package org.openapitools.client.apis
import org.openapitools.client.models.Order
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -53,11 +54,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteOrder(orderId: kotlin.String) : Unit {
val localVariableConfig = deleteOrderRequestConfig(orderId = orderId)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -74,6 +71,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Delete purchase order by ID
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
* @param orderId ID of the order that needs to be deleted
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deleteOrderRequestConfig(orderId = orderId)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deleteOrder
*
@@ -105,11 +120,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getInventory() : kotlin.collections.Map<kotlin.String, kotlin.Int> {
val localVariableConfig = getInventoryRequestConfig()
val localVarResponse = request<Unit, kotlin.collections.Map<kotlin.String, kotlin.Int>>(
localVariableConfig
)
val localVarResponse = getInventoryWithHttpInfo()
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
@@ -126,6 +137,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
* @return ApiInfrastructureResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getInventoryWithHttpInfo() : ApiInfrastructureResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>?> {
val localVariableConfig = getInventoryRequestConfig()
return request<Unit, kotlin.collections.Map<kotlin.String, kotlin.Int>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getInventory
*
@@ -157,11 +186,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getOrderById(orderId: kotlin.Long) : Order {
val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId)
val localVarResponse = request<Unit, Order>(
localVariableConfig
)
val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
@@ -178,6 +203,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* @param orderId ID of pet that needs to be fetched
* @return ApiInfrastructureResponse<Order?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse<Order?> {
val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId)
return request<Unit, Order>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getOrderById
*
@@ -210,11 +254,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun placeOrder(body: Order) : Order {
val localVariableConfig = placeOrderRequestConfig(body = body)
val localVarResponse = request<Order, Order>(
localVariableConfig
)
val localVarResponse = placeOrderWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
@@ -231,6 +271,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Place an order for a pet
*
* @param body order placed for purchasing the pet
* @return ApiInfrastructureResponse<Order?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse<Order?> {
val localVariableConfig = placeOrderRequestConfig(body = body)
return request<Order, Order>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation placeOrder
*

View File

@@ -23,6 +23,7 @@ package org.openapitools.client.apis
import org.openapitools.client.models.User
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -53,11 +54,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUser(body: User) : Unit {
val localVariableConfig = createUserRequestConfig(body = body)
val localVarResponse = request<User, Unit>(
localVariableConfig
)
val localVarResponse = createUserWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -74,6 +71,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Create user
* This can only be done by the logged in user.
* @param body Created user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUserRequestConfig(body = body)
return request<User, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUser
*
@@ -105,11 +120,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInput(body: kotlin.collections.List<User>) : Unit {
val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body)
val localVarResponse = request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -126,6 +137,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Creates list of users with given input array
*
* @param body List of user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List<User>) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body)
return request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUsersWithArrayInput
*
@@ -157,11 +186,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInput(body: kotlin.collections.List<User>) : Unit {
val localVariableConfig = createUsersWithListInputRequestConfig(body = body)
val localVarResponse = request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
val localVarResponse = createUsersWithListInputWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -178,6 +203,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Creates list of users with given input array
*
* @param body List of user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List<User>) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUsersWithListInputRequestConfig(body = body)
return request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUsersWithListInput
*
@@ -209,11 +252,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteUser(username: kotlin.String) : Unit {
val localVariableConfig = deleteUserRequestConfig(username = username)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deleteUserWithHttpInfo(username = username)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -230,6 +269,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Delete user
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deleteUserRequestConfig(username = username)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deleteUser
*
@@ -262,11 +319,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getUserByName(username: kotlin.String) : User {
val localVariableConfig = getUserByNameRequestConfig(username = username)
val localVarResponse = request<Unit, User>(
localVariableConfig
)
val localVarResponse = getUserByNameWithHttpInfo(username = username)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as User
@@ -283,6 +336,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return ApiInfrastructureResponse<User?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse<User?> {
val localVariableConfig = getUserByNameRequestConfig(username = username)
return request<Unit, User>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getUserByName
*
@@ -316,11 +388,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String {
val localVariableConfig = loginUserRequestConfig(username = username, password = password)
val localVarResponse = request<Unit, kotlin.String>(
localVariableConfig
)
val localVarResponse = loginUserWithHttpInfo(username = username, password = password)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
@@ -337,6 +405,26 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Logs user into the system
*
* @param username The user name for login
* @param password The password for login in clear text
* @return ApiInfrastructureResponse<kotlin.String?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse<kotlin.String?> {
val localVariableConfig = loginUserRequestConfig(username = username, password = password)
return request<Unit, kotlin.String>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation loginUser
*
@@ -372,11 +460,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun logoutUser() : Unit {
val localVariableConfig = logoutUserRequestConfig()
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = logoutUserWithHttpInfo()
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -393,6 +477,23 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Logs out current logged in user session
*
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun logoutUserWithHttpInfo() : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = logoutUserRequestConfig()
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation logoutUser
*
@@ -424,11 +525,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updateUser(username: kotlin.String, body: User) : Unit {
val localVariableConfig = updateUserRequestConfig(username = username, body = body)
val localVarResponse = request<User, Unit>(
localVariableConfig
)
val localVarResponse = updateUserWithHttpInfo(username = username, body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -445,6 +542,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Updated user
* This can only be done by the logged in user.
* @param username name that need to be deleted
* @param body Updated user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updateUserRequestConfig(username = username, body = body)
return request<User, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updateUser
*

View File

@@ -23,6 +23,7 @@ package org.openapitools.client.apis
import org.openapitools.client.models.PetEnum
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -53,11 +54,7 @@ class EnumApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getEnum() : PetEnum {
val localVariableConfig = getEnumRequestConfig()
val localVarResponse = request<Unit, PetEnum>(
localVariableConfig
)
val localVarResponse = getEnumWithHttpInfo()
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as PetEnum
@@ -74,6 +71,24 @@ class EnumApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Get enums
*
* @return ApiInfrastructureResponse<PetEnum?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getEnumWithHttpInfo() : ApiInfrastructureResponse<PetEnum?> {
val localVariableConfig = getEnumRequestConfig()
return request<Unit, PetEnum>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getEnum
*

View File

@@ -24,6 +24,7 @@ import org.openapitools.client.models.ApiResponse
import org.openapitools.client.models.Pet
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -54,11 +55,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun addPet(body: Pet) : Unit {
val localVariableConfig = addPetRequestConfig(body = body)
val localVarResponse = request<Pet, Unit>(
localVariableConfig
)
val localVarResponse = addPetWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -75,6 +72,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Add a new pet to the store
*
* @param body Pet object that needs to be added to the store
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = addPetRequestConfig(body = body)
return request<Pet, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation addPet
*
@@ -107,11 +122,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit {
val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -128,6 +139,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Deletes a pet
*
* @param petId Pet id to delete
* @param apiKey (optional)
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deletePet
*
@@ -162,11 +192,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
val localVariableConfig = findPetsByStatusRequestConfig(status = status)
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
val localVarResponse = findPetsByStatusWithHttpInfo(status = status)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
@@ -183,6 +209,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter
* @return ApiInfrastructureResponse<kotlin.collections.List<Pet>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List<kotlin.String>) : ApiInfrastructureResponse<kotlin.collections.List<Pet>?> {
val localVariableConfig = findPetsByStatusRequestConfig(status = status)
return request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation findPetsByStatus
*
@@ -220,11 +265,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Deprecated(message = "This operation is deprecated.")
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
@Suppress("DEPRECATION")
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
val localVarResponse = findPetsByTagsWithHttpInfo(tags = tags)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
@@ -241,6 +282,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by
* @return ApiInfrastructureResponse<kotlin.collections.List<Pet>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
@Deprecated(message = "This operation is deprecated.")
fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List<kotlin.String>) : ApiInfrastructureResponse<kotlin.collections.List<Pet>?> {
@Suppress("DEPRECATION")
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
return request<Unit, kotlin.collections.List<Pet>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation findPetsByTags
*
@@ -277,11 +339,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getPetById(petId: kotlin.Long) : Pet {
val localVariableConfig = getPetByIdRequestConfig(petId = petId)
val localVarResponse = request<Unit, Pet>(
localVariableConfig
)
val localVarResponse = getPetByIdWithHttpInfo(petId = petId)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
@@ -298,6 +356,25 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Find pet by ID
* Returns a single pet
* @param petId ID of pet to return
* @return ApiInfrastructureResponse<Pet?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse<Pet?> {
val localVariableConfig = getPetByIdRequestConfig(petId = petId)
return request<Unit, Pet>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getPetById
*
@@ -329,11 +406,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePet(body: Pet) : Unit {
val localVariableConfig = updatePetRequestConfig(body = body)
val localVarResponse = request<Pet, Unit>(
localVariableConfig
)
val localVarResponse = updatePetWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -350,6 +423,24 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Update an existing pet
*
* @param body Pet object that needs to be added to the store
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updatePetRequestConfig(body = body)
return request<Pet, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updatePet
*
@@ -383,11 +474,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit {
val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status)
val localVarResponse = request<Map<String, Any?>, Unit>(
localVariableConfig
)
val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -404,6 +491,26 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Updates a pet in the store with form data
*
* @param petId ID of pet that needs to be updated
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status)
return request<Map<String, Any?>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updatePetWithForm
*
@@ -440,11 +547,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse {
val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file)
val localVarResponse = request<Map<String, Any?>, ApiResponse>(
localVariableConfig
)
val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
@@ -461,6 +564,27 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* uploads an image
*
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @return ApiInfrastructureResponse<ApiResponse?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse<ApiResponse?> {
val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file)
return request<Map<String, Any?>, ApiResponse>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation uploadFile
*

View File

@@ -23,6 +23,7 @@ package org.openapitools.client.apis
import org.openapitools.client.models.Order
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -53,11 +54,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteOrder(orderId: kotlin.String) : Unit {
val localVariableConfig = deleteOrderRequestConfig(orderId = orderId)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -74,6 +71,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Delete purchase order by ID
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
* @param orderId ID of the order that needs to be deleted
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deleteOrderRequestConfig(orderId = orderId)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deleteOrder
*
@@ -105,11 +120,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getInventory() : kotlin.collections.Map<kotlin.String, kotlin.Int> {
val localVariableConfig = getInventoryRequestConfig()
val localVarResponse = request<Unit, kotlin.collections.Map<kotlin.String, kotlin.Int>>(
localVariableConfig
)
val localVarResponse = getInventoryWithHttpInfo()
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
@@ -126,6 +137,24 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
* @return ApiInfrastructureResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getInventoryWithHttpInfo() : ApiInfrastructureResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>?> {
val localVariableConfig = getInventoryRequestConfig()
return request<Unit, kotlin.collections.Map<kotlin.String, kotlin.Int>>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getInventory
*
@@ -157,11 +186,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getOrderById(orderId: kotlin.Long) : Order {
val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId)
val localVarResponse = request<Unit, Order>(
localVariableConfig
)
val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
@@ -178,6 +203,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* @param orderId ID of pet that needs to be fetched
* @return ApiInfrastructureResponse<Order?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse<Order?> {
val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId)
return request<Unit, Order>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getOrderById
*
@@ -210,11 +254,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun placeOrder(body: Order) : Order {
val localVariableConfig = placeOrderRequestConfig(body = body)
val localVarResponse = request<Order, Order>(
localVariableConfig
)
val localVarResponse = placeOrderWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
@@ -231,6 +271,25 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
}
}
/**
* Place an order for a pet
*
* @param body order placed for purchasing the pet
* @return ApiInfrastructureResponse<Order?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse<Order?> {
val localVariableConfig = placeOrderRequestConfig(body = body)
return request<Order, Order>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation placeOrder
*

View File

@@ -23,6 +23,7 @@ package org.openapitools.client.apis
import org.openapitools.client.models.User
import org.openapitools.client.infrastructure.ApiClient
import org.openapitools.client.infrastructure.ApiInfrastructureResponse
import org.openapitools.client.infrastructure.ClientException
import org.openapitools.client.infrastructure.ClientError
import org.openapitools.client.infrastructure.ServerException
@@ -53,11 +54,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUser(body: User) : Unit {
val localVariableConfig = createUserRequestConfig(body = body)
val localVarResponse = request<User, Unit>(
localVariableConfig
)
val localVarResponse = createUserWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -74,6 +71,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Create user
* This can only be done by the logged in user.
* @param body Created user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUserRequestConfig(body = body)
return request<User, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUser
*
@@ -105,11 +120,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInput(body: kotlin.collections.List<User>) : Unit {
val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body)
val localVarResponse = request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -126,6 +137,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Creates list of users with given input array
*
* @param body List of user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List<User>) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body)
return request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUsersWithArrayInput
*
@@ -157,11 +186,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInput(body: kotlin.collections.List<User>) : Unit {
val localVariableConfig = createUsersWithListInputRequestConfig(body = body)
val localVarResponse = request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
val localVarResponse = createUsersWithListInputWithHttpInfo(body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -178,6 +203,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Creates list of users with given input array
*
* @param body List of user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List<User>) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = createUsersWithListInputRequestConfig(body = body)
return request<kotlin.collections.List<User>, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation createUsersWithListInput
*
@@ -209,11 +252,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteUser(username: kotlin.String) : Unit {
val localVariableConfig = deleteUserRequestConfig(username = username)
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = deleteUserWithHttpInfo(username = username)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -230,6 +269,24 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Delete user
* This can only be done by the logged in user.
* @param username The name that needs to be deleted
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = deleteUserRequestConfig(username = username)
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation deleteUser
*
@@ -262,11 +319,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getUserByName(username: kotlin.String) : User {
val localVariableConfig = getUserByNameRequestConfig(username = username)
val localVarResponse = request<Unit, User>(
localVariableConfig
)
val localVarResponse = getUserByNameWithHttpInfo(username = username)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as User
@@ -283,6 +336,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return ApiInfrastructureResponse<User?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse<User?> {
val localVariableConfig = getUserByNameRequestConfig(username = username)
return request<Unit, User>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation getUserByName
*
@@ -316,11 +388,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String {
val localVariableConfig = loginUserRequestConfig(username = username, password = password)
val localVarResponse = request<Unit, kotlin.String>(
localVariableConfig
)
val localVarResponse = loginUserWithHttpInfo(username = username, password = password)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
@@ -337,6 +405,26 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Logs user into the system
*
* @param username The user name for login
* @param password The password for login in clear text
* @return ApiInfrastructureResponse<kotlin.String?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse<kotlin.String?> {
val localVariableConfig = loginUserRequestConfig(username = username, password = password)
return request<Unit, kotlin.String>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation loginUser
*
@@ -372,11 +460,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun logoutUser() : Unit {
val localVariableConfig = logoutUserRequestConfig()
val localVarResponse = request<Unit, Unit>(
localVariableConfig
)
val localVarResponse = logoutUserWithHttpInfo()
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -393,6 +477,23 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Logs out current logged in user session
*
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun logoutUserWithHttpInfo() : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = logoutUserRequestConfig()
return request<Unit, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation logoutUser
*
@@ -424,11 +525,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updateUser(username: kotlin.String, body: User) : Unit {
val localVariableConfig = updateUserRequestConfig(username = username, body = body)
val localVarResponse = request<User, Unit>(
localVariableConfig
)
val localVarResponse = updateUserWithHttpInfo(username = username, body = body)
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
@@ -445,6 +542,25 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
}
}
/**
* Updated user
* This can only be done by the logged in user.
* @param username name that need to be deleted
* @param body Updated user object
* @return ApiInfrastructureResponse<Unit?>
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse<Unit?> {
val localVariableConfig = updateUserRequestConfig(username = username, body = body)
return request<User, Unit>(
localVariableConfig
)
}
/**
* To obtain the request config of the operation updateUser
*