mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-03 17:00:43 +00:00
Merge remote-tracking branch 'origin/master' into 5.4.x
This commit is contained in:
@@ -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
|
||||
@@ -39,7 +40,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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 identify 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
|
||||
*
|
||||
|
||||
@@ -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
|
||||
@@ -38,7 +39,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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 < 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 <= 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)
|
||||
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
|
||||
*
|
||||
|
||||
@@ -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
|
||||
@@ -38,7 +39,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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
@@ -45,6 +45,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