forked from loafle/openapi-generator-original
[kotlin][client] expose http status code on errors (#4742)
* [kotlin][client] expose http status code on errors * [kotlin] update pet projects * [kotlin] update pet projects
This commit is contained in:
parent
dc91112031
commit
b6fd1b0ade
@ -71,8 +71,14 @@ import {{packageName}}.infrastructure.toMultiValue
|
|||||||
ResponseType.Success -> {{#returnType}}(localVarResponse as Success<*>).data as {{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}
|
ResponseType.Success -> {{#returnType}}(localVarResponse as Success<*>).data as {{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,38 +3,14 @@ package {{packageName}}.infrastructure
|
|||||||
|
|
||||||
import java.lang.RuntimeException
|
import java.lang.RuntimeException
|
||||||
|
|
||||||
{{#nonPublicApi}}internal {{/nonPublicApi}}open class ClientException : RuntimeException {
|
{{#nonPublicApi}}internal {{/nonPublicApi}}open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) {
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ClientException] with no detail message.
|
|
||||||
*/
|
|
||||||
constructor() : super()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ClientException] with the specified detail message.
|
|
||||||
|
|
||||||
* @param message the detail message.
|
|
||||||
*/
|
|
||||||
constructor(message: kotlin.String) : super(message)
|
|
||||||
|
|
||||||
{{#nonPublicApi}}internal {{/nonPublicApi}}companion object {
|
{{#nonPublicApi}}internal {{/nonPublicApi}}companion object {
|
||||||
private const val serialVersionUID: Long = 123L
|
private const val serialVersionUID: Long = 123L
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{{#nonPublicApi}}internal {{/nonPublicApi}}open class ServerException : RuntimeException {
|
{{#nonPublicApi}}internal {{/nonPublicApi}}open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) {
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ServerException] with no detail message.
|
|
||||||
*/
|
|
||||||
constructor() : super()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ServerException] with the specified detail message.
|
|
||||||
|
|
||||||
* @param message the detail message.
|
|
||||||
*/
|
|
||||||
constructor(message: kotlin.String) : super(message)
|
|
||||||
|
|
||||||
{{#nonPublicApi}}internal {{/nonPublicApi}}companion object {
|
{{#nonPublicApi}}internal {{/nonPublicApi}}companion object {
|
||||||
private const val serialVersionUID: Long = 456L
|
private const val serialVersionUID: Long = 456L
|
||||||
|
@ -57,8 +57,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,8 +98,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,8 +142,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,8 +186,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,8 +227,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,8 +267,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,8 +309,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,8 +352,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
|
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +56,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,8 +96,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,8 +137,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,8 +178,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +56,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,8 +96,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,8 +136,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,8 +176,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,8 +217,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as User
|
ResponseType.Success -> (localVarResponse as Success<*>).data as User
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,8 +263,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,8 +302,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -301,8 +343,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,38 +3,14 @@ package org.openapitools.client.infrastructure
|
|||||||
|
|
||||||
import java.lang.RuntimeException
|
import java.lang.RuntimeException
|
||||||
|
|
||||||
open class ClientException : RuntimeException {
|
open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) {
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ClientException] with no detail message.
|
|
||||||
*/
|
|
||||||
constructor() : super()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ClientException] with the specified detail message.
|
|
||||||
|
|
||||||
* @param message the detail message.
|
|
||||||
*/
|
|
||||||
constructor(message: kotlin.String) : super(message)
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val serialVersionUID: Long = 123L
|
private const val serialVersionUID: Long = 123L
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open class ServerException : RuntimeException {
|
open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) {
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ServerException] with no detail message.
|
|
||||||
*/
|
|
||||||
constructor() : super()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ServerException] with the specified detail message.
|
|
||||||
|
|
||||||
* @param message the detail message.
|
|
||||||
*/
|
|
||||||
constructor(message: kotlin.String) : super(message)
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val serialVersionUID: Long = 456L
|
private const val serialVersionUID: Long = 456L
|
||||||
|
@ -57,8 +57,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,8 +98,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,8 +142,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,8 +188,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,8 +229,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -239,8 +269,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -275,8 +311,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -312,8 +354,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
|
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +56,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,8 +96,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,8 +137,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,8 +178,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +56,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,8 +96,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,8 +136,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,8 +176,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,8 +217,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as User
|
ResponseType.Success -> (localVarResponse as Success<*>).data as User
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,8 +263,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,8 +302,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -301,8 +343,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,38 +3,14 @@ package org.openapitools.client.infrastructure
|
|||||||
|
|
||||||
import java.lang.RuntimeException
|
import java.lang.RuntimeException
|
||||||
|
|
||||||
open class ClientException : RuntimeException {
|
open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) {
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ClientException] with no detail message.
|
|
||||||
*/
|
|
||||||
constructor() : super()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ClientException] with the specified detail message.
|
|
||||||
|
|
||||||
* @param message the detail message.
|
|
||||||
*/
|
|
||||||
constructor(message: kotlin.String) : super(message)
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val serialVersionUID: Long = 123L
|
private const val serialVersionUID: Long = 123L
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open class ServerException : RuntimeException {
|
open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) {
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ServerException] with no detail message.
|
|
||||||
*/
|
|
||||||
constructor() : super()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ServerException] with the specified detail message.
|
|
||||||
|
|
||||||
* @param message the detail message.
|
|
||||||
*/
|
|
||||||
constructor(message: kotlin.String) : super(message)
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val serialVersionUID: Long = 456L
|
private const val serialVersionUID: Long = 456L
|
||||||
|
@ -57,8 +57,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,8 +98,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,8 +142,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,8 +186,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,8 +227,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,8 +267,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,8 +309,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,8 +352,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
|
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +56,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,8 +96,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,8 +137,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,8 +178,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +56,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,8 +96,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,8 +136,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,8 +176,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,8 +217,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as User
|
ResponseType.Success -> (localVarResponse as Success<*>).data as User
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,8 +263,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,8 +302,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -301,8 +343,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,38 +3,14 @@ package org.openapitools.client.infrastructure
|
|||||||
|
|
||||||
import java.lang.RuntimeException
|
import java.lang.RuntimeException
|
||||||
|
|
||||||
open class ClientException : RuntimeException {
|
open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) {
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ClientException] with no detail message.
|
|
||||||
*/
|
|
||||||
constructor() : super()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ClientException] with the specified detail message.
|
|
||||||
|
|
||||||
* @param message the detail message.
|
|
||||||
*/
|
|
||||||
constructor(message: kotlin.String) : super(message)
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val serialVersionUID: Long = 123L
|
private const val serialVersionUID: Long = 123L
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open class ServerException : RuntimeException {
|
open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) {
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ServerException] with no detail message.
|
|
||||||
*/
|
|
||||||
constructor() : super()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ServerException] with the specified detail message.
|
|
||||||
|
|
||||||
* @param message the detail message.
|
|
||||||
*/
|
|
||||||
constructor(message: kotlin.String) : super(message)
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val serialVersionUID: Long = 456L
|
private const val serialVersionUID: Long = 456L
|
||||||
|
@ -57,8 +57,14 @@ internal class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2")
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,8 +98,14 @@ internal class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2")
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,8 +142,14 @@ internal class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2")
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,8 +186,14 @@ internal class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2")
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,8 +227,14 @@ internal class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2")
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,8 +267,14 @@ internal class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2")
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,8 +309,14 @@ internal class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2")
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,8 +352,14 @@ internal class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2")
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
|
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +56,14 @@ internal class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,8 +96,14 @@ internal class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,8 +137,14 @@ internal class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,8 +178,14 @@ internal class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +56,14 @@ internal class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2"
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,8 +96,14 @@ internal class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2"
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,8 +136,14 @@ internal class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2"
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,8 +176,14 @@ internal class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2"
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,8 +217,14 @@ internal class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2"
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as User
|
ResponseType.Success -> (localVarResponse as Success<*>).data as User
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,8 +263,14 @@ internal class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2"
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,8 +302,14 @@ internal class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2"
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -301,8 +343,14 @@ internal class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2"
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,38 +3,14 @@ package org.openapitools.client.infrastructure
|
|||||||
|
|
||||||
import java.lang.RuntimeException
|
import java.lang.RuntimeException
|
||||||
|
|
||||||
internal open class ClientException : RuntimeException {
|
internal open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) {
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ClientException] with no detail message.
|
|
||||||
*/
|
|
||||||
constructor() : super()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ClientException] with the specified detail message.
|
|
||||||
|
|
||||||
* @param message the detail message.
|
|
||||||
*/
|
|
||||||
constructor(message: kotlin.String) : super(message)
|
|
||||||
|
|
||||||
internal companion object {
|
internal companion object {
|
||||||
private const val serialVersionUID: Long = 123L
|
private const val serialVersionUID: Long = 123L
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal open class ServerException : RuntimeException {
|
internal open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) {
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ServerException] with no detail message.
|
|
||||||
*/
|
|
||||||
constructor() : super()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ServerException] with the specified detail message.
|
|
||||||
|
|
||||||
* @param message the detail message.
|
|
||||||
*/
|
|
||||||
constructor(message: kotlin.String) : super(message)
|
|
||||||
|
|
||||||
internal companion object {
|
internal companion object {
|
||||||
private const val serialVersionUID: Long = 456L
|
private const val serialVersionUID: Long = 456L
|
||||||
|
@ -57,8 +57,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,8 +98,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,8 +142,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>?
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>?
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,8 +186,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>?
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>?
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,8 +227,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet?
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet?
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,8 +267,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,8 +309,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,8 +352,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse?
|
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse?
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +56,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,8 +96,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>?
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>?
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,8 +137,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Order?
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Order?
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,8 +178,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Order?
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Order?
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +56,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,8 +96,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,8 +136,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,8 +176,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,8 +217,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as User?
|
ResponseType.Success -> (localVarResponse as Success<*>).data as User?
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,8 +263,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String?
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String?
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,8 +302,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -301,8 +343,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,38 +3,14 @@ package org.openapitools.client.infrastructure
|
|||||||
|
|
||||||
import java.lang.RuntimeException
|
import java.lang.RuntimeException
|
||||||
|
|
||||||
open class ClientException : RuntimeException {
|
open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) {
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ClientException] with no detail message.
|
|
||||||
*/
|
|
||||||
constructor() : super()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ClientException] with the specified detail message.
|
|
||||||
|
|
||||||
* @param message the detail message.
|
|
||||||
*/
|
|
||||||
constructor(message: kotlin.String) : super(message)
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val serialVersionUID: Long = 123L
|
private const val serialVersionUID: Long = 123L
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open class ServerException : RuntimeException {
|
open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) {
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ServerException] with no detail message.
|
|
||||||
*/
|
|
||||||
constructor() : super()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ServerException] with the specified detail message.
|
|
||||||
|
|
||||||
* @param message the detail message.
|
|
||||||
*/
|
|
||||||
constructor(message: kotlin.String) : super(message)
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val serialVersionUID: Long = 456L
|
private const val serialVersionUID: Long = 456L
|
||||||
|
@ -57,8 +57,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,8 +98,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,8 +142,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,8 +186,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,8 +227,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,8 +267,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,8 +309,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,8 +352,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
|
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +56,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,8 +96,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,8 +137,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,8 +178,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +56,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,8 +96,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,8 +136,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,8 +176,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,8 +217,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as User
|
ResponseType.Success -> (localVarResponse as Success<*>).data as User
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,8 +263,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,8 +302,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -301,8 +343,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,38 +3,14 @@ package org.openapitools.client.infrastructure
|
|||||||
|
|
||||||
import java.lang.RuntimeException
|
import java.lang.RuntimeException
|
||||||
|
|
||||||
open class ClientException : RuntimeException {
|
open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) {
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ClientException] with no detail message.
|
|
||||||
*/
|
|
||||||
constructor() : super()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ClientException] with the specified detail message.
|
|
||||||
|
|
||||||
* @param message the detail message.
|
|
||||||
*/
|
|
||||||
constructor(message: kotlin.String) : super(message)
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val serialVersionUID: Long = 123L
|
private const val serialVersionUID: Long = 123L
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open class ServerException : RuntimeException {
|
open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) {
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ServerException] with no detail message.
|
|
||||||
*/
|
|
||||||
constructor() : super()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ServerException] with the specified detail message.
|
|
||||||
|
|
||||||
* @param message the detail message.
|
|
||||||
*/
|
|
||||||
constructor(message: kotlin.String) : super(message)
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val serialVersionUID: Long = 456L
|
private const val serialVersionUID: Long = 456L
|
||||||
|
@ -57,8 +57,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,8 +98,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,8 +142,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,8 +186,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,8 +227,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,8 +267,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,8 +309,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,8 +352,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
|
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +56,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,8 +96,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,8 +137,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,8 +178,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +56,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,8 +96,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,8 +136,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,8 +176,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,8 +217,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as User
|
ResponseType.Success -> (localVarResponse as Success<*>).data as User
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,8 +263,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,8 +302,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -301,8 +343,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,38 +3,14 @@ package org.openapitools.client.infrastructure
|
|||||||
|
|
||||||
import java.lang.RuntimeException
|
import java.lang.RuntimeException
|
||||||
|
|
||||||
open class ClientException : RuntimeException {
|
open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) {
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ClientException] with no detail message.
|
|
||||||
*/
|
|
||||||
constructor() : super()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ClientException] with the specified detail message.
|
|
||||||
|
|
||||||
* @param message the detail message.
|
|
||||||
*/
|
|
||||||
constructor(message: kotlin.String) : super(message)
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val serialVersionUID: Long = 123L
|
private const val serialVersionUID: Long = 123L
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open class ServerException : RuntimeException {
|
open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) {
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ServerException] with no detail message.
|
|
||||||
*/
|
|
||||||
constructor() : super()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ServerException] with the specified detail message.
|
|
||||||
|
|
||||||
* @param message the detail message.
|
|
||||||
*/
|
|
||||||
constructor(message: kotlin.String) : super(message)
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val serialVersionUID: Long = 456L
|
private const val serialVersionUID: Long = 456L
|
||||||
|
@ -57,8 +57,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,8 +98,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,8 +142,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,8 +186,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,8 +227,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,8 +267,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,8 +309,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,8 +352,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
|
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +56,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,8 +96,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,8 +137,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,8 +178,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +56,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,8 +96,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,8 +136,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,8 +176,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,8 +217,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as User
|
ResponseType.Success -> (localVarResponse as Success<*>).data as User
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,8 +263,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,8 +302,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -301,8 +343,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,38 +3,14 @@ package org.openapitools.client.infrastructure
|
|||||||
|
|
||||||
import java.lang.RuntimeException
|
import java.lang.RuntimeException
|
||||||
|
|
||||||
open class ClientException : RuntimeException {
|
open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) {
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ClientException] with no detail message.
|
|
||||||
*/
|
|
||||||
constructor() : super()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ClientException] with the specified detail message.
|
|
||||||
|
|
||||||
* @param message the detail message.
|
|
||||||
*/
|
|
||||||
constructor(message: kotlin.String) : super(message)
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val serialVersionUID: Long = 123L
|
private const val serialVersionUID: Long = 123L
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open class ServerException : RuntimeException {
|
open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) {
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ServerException] with no detail message.
|
|
||||||
*/
|
|
||||||
constructor() : super()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ServerException] with the specified detail message.
|
|
||||||
|
|
||||||
* @param message the detail message.
|
|
||||||
*/
|
|
||||||
constructor(message: kotlin.String) : super(message)
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val serialVersionUID: Long = 456L
|
private const val serialVersionUID: Long = 456L
|
||||||
|
@ -57,8 +57,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,8 +98,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,8 +142,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,8 +186,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,8 +227,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,8 +267,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,8 +309,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,8 +352,14 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
|
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +56,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,8 +96,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,8 +137,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,8 +178,14 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +56,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,8 +96,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,8 +136,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,8 +176,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,8 +217,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as User
|
ResponseType.Success -> (localVarResponse as Success<*>).data as User
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,8 +263,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
|
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,8 +302,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -301,8 +343,14 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
|||||||
ResponseType.Success -> Unit
|
ResponseType.Success -> Unit
|
||||||
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
|
||||||
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
|
||||||
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
|
ResponseType.ClientError -> {
|
||||||
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
|
val localVarError = localVarResponse as ClientError<*>
|
||||||
|
throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode)
|
||||||
|
}
|
||||||
|
ResponseType.ServerError -> {
|
||||||
|
val localVarError = localVarResponse as ServerError<*>
|
||||||
|
throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,38 +3,14 @@ package org.openapitools.client.infrastructure
|
|||||||
|
|
||||||
import java.lang.RuntimeException
|
import java.lang.RuntimeException
|
||||||
|
|
||||||
open class ClientException : RuntimeException {
|
open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) {
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ClientException] with no detail message.
|
|
||||||
*/
|
|
||||||
constructor() : super()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ClientException] with the specified detail message.
|
|
||||||
|
|
||||||
* @param message the detail message.
|
|
||||||
*/
|
|
||||||
constructor(message: kotlin.String) : super(message)
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val serialVersionUID: Long = 123L
|
private const val serialVersionUID: Long = 123L
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open class ServerException : RuntimeException {
|
open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) {
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ServerException] with no detail message.
|
|
||||||
*/
|
|
||||||
constructor() : super()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an [ServerException] with the specified detail message.
|
|
||||||
|
|
||||||
* @param message the detail message.
|
|
||||||
*/
|
|
||||||
constructor(message: kotlin.String) : super(message)
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val serialVersionUID: Long = 456L
|
private const val serialVersionUID: Long = 456L
|
||||||
|
Loading…
x
Reference in New Issue
Block a user