Merge branch '4.3.x' into 5.0.x

This commit is contained in:
William Cheng
2019-11-21 15:19:31 +08:00
1736 changed files with 27265 additions and 4446 deletions

View File

@@ -1 +1,5 @@
5.0.0-SNAPSHOT
<<<<<<< HEAD
5.0.0-SNAPSHOT
=======
4.3.0-SNAPSHOT
>>>>>>> 4.3.x

View File

@@ -7,7 +7,7 @@ wrapper {
}
buildscript {
ext.kotlin_version = '1.3.41'
ext.kotlin_version = '1.3.50'
repositories {
mavenCentral()
@@ -32,6 +32,6 @@ dependencies {
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
compile "com.squareup.moshi:moshi-kotlin:1.8.0"
compile "com.squareup.moshi:moshi-adapters:1.8.0"
compile "com.squareup.okhttp3:okhttp:4.2.0"
testImplementation "io.kotlintest:kotlintest-runner-junit5:3.1.0"
compile "com.squareup.okhttp3:okhttp:4.2.2"
testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0"
}

View File

@@ -48,17 +48,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
query = localVariableQuery,
headers = localVariableHeaders
)
val response = request<Any?>(
val localVarResponse = request<Any?>(
localVariableConfig,
localVariableBody
)
return when (response.responseType) {
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
}
}
@@ -83,17 +83,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
query = localVariableQuery,
headers = localVariableHeaders
)
val response = request<Any?>(
val localVarResponse = request<Any?>(
localVariableConfig,
localVariableBody
)
return when (response.responseType) {
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
}
}
@@ -121,17 +121,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
query = localVariableQuery,
headers = localVariableHeaders
)
val response = request<kotlin.Array<Pet>>(
val localVarResponse = request<kotlin.Array<Pet>>(
localVariableConfig,
localVariableBody
)
return when (response.responseType) {
ResponseType.Success -> (response as Success<*>).data as kotlin.Array<Pet>
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
}
}
@@ -159,17 +159,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
query = localVariableQuery,
headers = localVariableHeaders
)
val response = request<kotlin.Array<Pet>>(
val localVarResponse = request<kotlin.Array<Pet>>(
localVariableConfig,
localVariableBody
)
return when (response.responseType) {
ResponseType.Success -> (response as Success<*>).data as kotlin.Array<Pet>
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
}
}
@@ -194,17 +194,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
query = localVariableQuery,
headers = localVariableHeaders
)
val response = request<Pet>(
val localVarResponse = request<Pet>(
localVariableConfig,
localVariableBody
)
return when (response.responseType) {
ResponseType.Success -> (response as Success<*>).data as Pet
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Pet
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
}
}
@@ -228,17 +228,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
query = localVariableQuery,
headers = localVariableHeaders
)
val response = request<Any?>(
val localVarResponse = request<Any?>(
localVariableConfig,
localVariableBody
)
return when (response.responseType) {
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
}
}
@@ -264,17 +264,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
query = localVariableQuery,
headers = localVariableHeaders
)
val response = request<Any?>(
val localVarResponse = request<Any?>(
localVariableConfig,
localVariableBody
)
return when (response.responseType) {
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
}
}
@@ -301,17 +301,17 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
query = localVariableQuery,
headers = localVariableHeaders
)
val response = request<ApiResponse>(
val localVarResponse = request<ApiResponse>(
localVariableConfig,
localVariableBody
)
return when (response.responseType) {
ResponseType.Success -> (response as Success<*>).data as ApiResponse
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
}
}

View File

@@ -47,17 +47,17 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
query = localVariableQuery,
headers = localVariableHeaders
)
val response = request<Any?>(
val localVarResponse = request<Any?>(
localVariableConfig,
localVariableBody
)
return when (response.responseType) {
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
}
}
@@ -81,17 +81,17 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
query = localVariableQuery,
headers = localVariableHeaders
)
val response = request<kotlin.collections.Map<kotlin.String, kotlin.Int>>(
val localVarResponse = request<kotlin.collections.Map<kotlin.String, kotlin.Int>>(
localVariableConfig,
localVariableBody
)
return when (response.responseType) {
ResponseType.Success -> (response as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
return when (localVarResponse.responseType) {
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.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
}
}
@@ -116,17 +116,17 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
query = localVariableQuery,
headers = localVariableHeaders
)
val response = request<Order>(
val localVarResponse = request<Order>(
localVariableConfig,
localVariableBody
)
return when (response.responseType) {
ResponseType.Success -> (response as Success<*>).data as Order
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
}
}
@@ -151,17 +151,17 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
query = localVariableQuery,
headers = localVariableHeaders
)
val response = request<Order>(
val localVarResponse = request<Order>(
localVariableConfig,
localVariableBody
)
return when (response.responseType) {
ResponseType.Success -> (response as Success<*>).data as Order
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as Order
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
}
}

View File

@@ -47,17 +47,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
query = localVariableQuery,
headers = localVariableHeaders
)
val response = request<Any?>(
val localVarResponse = request<Any?>(
localVariableConfig,
localVariableBody
)
return when (response.responseType) {
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
}
}
@@ -81,17 +81,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
query = localVariableQuery,
headers = localVariableHeaders
)
val response = request<Any?>(
val localVarResponse = request<Any?>(
localVariableConfig,
localVariableBody
)
return when (response.responseType) {
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
}
}
@@ -115,17 +115,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
query = localVariableQuery,
headers = localVariableHeaders
)
val response = request<Any?>(
val localVarResponse = request<Any?>(
localVariableConfig,
localVariableBody
)
return when (response.responseType) {
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
}
}
@@ -149,17 +149,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
query = localVariableQuery,
headers = localVariableHeaders
)
val response = request<Any?>(
val localVarResponse = request<Any?>(
localVariableConfig,
localVariableBody
)
return when (response.responseType) {
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
}
}
@@ -184,17 +184,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
query = localVariableQuery,
headers = localVariableHeaders
)
val response = request<User>(
val localVarResponse = request<User>(
localVariableConfig,
localVariableBody
)
return when (response.responseType) {
ResponseType.Success -> (response as Success<*>).data as User
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as User
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
}
}
@@ -224,17 +224,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
query = localVariableQuery,
headers = localVariableHeaders
)
val response = request<kotlin.String>(
val localVarResponse = request<kotlin.String>(
localVariableConfig,
localVariableBody
)
return when (response.responseType) {
ResponseType.Success -> (response as Success<*>).data as kotlin.String
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
}
}
@@ -257,17 +257,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
query = localVariableQuery,
headers = localVariableHeaders
)
val response = request<Any?>(
val localVarResponse = request<Any?>(
localVariableConfig,
localVariableBody
)
return when (response.responseType) {
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
}
}
@@ -292,17 +292,17 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
query = localVariableQuery,
headers = localVariableHeaders
)
val response = request<Any?>(
val localVarResponse = request<Any?>(
localVariableConfig,
localVariableBody
)
return when (response.responseType) {
return when (localVarResponse.responseType) {
ResponseType.Success -> Unit
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
ResponseType.ClientError -> throw ClientException((localVarResponse as ClientError<*>).body as? String ?: "Client error")
ResponseType.ServerError -> throw ServerException((localVarResponse as ServerError<*>).message ?: "Server error")
}
}

View File

@@ -9,4 +9,4 @@ class ByteArrayAdapter {
@FromJson
fun fromJson(data: String): ByteArray = data.toByteArray()
}
}