forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin/master' into 5.4.x
This commit is contained in:
@@ -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
|
||||
@@ -41,7 +42,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
@@ -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
|
||||
@@ -40,7 +41,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 < 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 <= 5 or > 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
|
||||
*
|
||||
|
||||
@@ -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
|
||||
@@ -40,7 +41,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
@@ -47,6 +47,7 @@ open class ApiClient(val baseUrl: String) {
|
||||
var username: String? = null
|
||||
var password: String? = null
|
||||
var accessToken: String? = null
|
||||
const val baseUrlKey = "org.openapitools.client.baseUrl"
|
||||
|
||||
@JvmStatic
|
||||
val client: OkHttpClient by lazy {
|
||||
|
||||
Reference in New Issue
Block a user