Skip to content

Commit

Permalink
[Kotlin][okhttp] replace okhttpclient with callfactory (OpenAPITools#…
Browse files Browse the repository at this point in the history
  • Loading branch information
vicmosin authored Aug 22, 2024
1 parent 0f294a5 commit 7a7c8c1
Show file tree
Hide file tree
Showing 66 changed files with 111 additions and 111 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
package {{apiPackage}}

import java.io.IOException
import okhttp3.OkHttpClient
import okhttp3.Call
import okhttp3.HttpUrl

{{#imports}}import {{import}}
Expand Down Expand Up @@ -48,7 +48,7 @@ import {{packageName}}.infrastructure.Success
import {{packageName}}.infrastructure.toMultiValue

{{#operations}}
{{#nonPublicApi}}internal {{/nonPublicApi}}class {{classname}}(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath, client) {
{{#nonPublicApi}}internal {{/nonPublicApi}}class {{classname}}(basePath: kotlin.String = defaultBasePath, client: Call.Factory = ApiClient.defaultClient) : ApiClient(basePath, client) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ import com.squareup.moshi.adapter

{{#nonPublicApi}}internal {{/nonPublicApi}}val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody()

{{#nonPublicApi}}internal {{/nonPublicApi}}open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) {
{{#nonPublicApi}}internal {{/nonPublicApi}}open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClient) {
{{#nonPublicApi}}internal {{/nonPublicApi}}companion object {
protected const val ContentType = "Content-Type"
protected const val Accept = "Accept"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package org.openapitools.client.apis

import java.io.IOException
import okhttp3.OkHttpClient
import okhttp3.Call
import okhttp3.HttpUrl


Expand All @@ -36,7 +36,7 @@ import org.openapitools.client.infrastructure.ResponseType
import org.openapitools.client.infrastructure.Success
import org.openapitools.client.infrastructure.toMultiValue

class DefaultApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath, client) {
class DefaultApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory = ApiClient.defaultClient) : ApiClient(basePath, client) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import com.squareup.moshi.adapter

val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody()

open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) {
open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClient) {
companion object {
protected const val ContentType = "Content-Type"
protected const val Accept = "Accept"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package org.openapitools.client.apis

import java.io.IOException
import okhttp3.OkHttpClient
import okhttp3.Call
import okhttp3.HttpUrl

import org.openapitools.client.models.Bird
Expand All @@ -37,7 +37,7 @@ import org.openapitools.client.infrastructure.ResponseType
import org.openapitools.client.infrastructure.Success
import org.openapitools.client.infrastructure.toMultiValue

class BirdApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath, client) {
class BirdApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory = ApiClient.defaultClient) : ApiClient(basePath, client) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import com.squareup.moshi.adapter

val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody()

open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) {
open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClient) {
companion object {
protected const val ContentType = "Content-Type"
protected const val Accept = "Accept"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package org.openapitools.client.apis

import java.io.IOException
import okhttp3.OkHttpClient
import okhttp3.Call
import okhttp3.HttpUrl


Expand All @@ -36,7 +36,7 @@ import org.openapitools.client.infrastructure.ResponseType
import org.openapitools.client.infrastructure.Success
import org.openapitools.client.infrastructure.toMultiValue

class DefaultApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath, client) {
class DefaultApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory = ApiClient.defaultClient) : ApiClient(basePath, client) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import com.squareup.moshi.adapter

val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody()

open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) {
open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClient) {
companion object {
protected const val ContentType = "Content-Type"
protected const val Accept = "Accept"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package org.openapitools.client.apis

import java.io.IOException
import okhttp3.OkHttpClient
import okhttp3.Call
import okhttp3.HttpUrl

import org.openapitools.client.models.Apa
Expand All @@ -37,7 +37,7 @@ import org.openapitools.client.infrastructure.ResponseType
import org.openapitools.client.infrastructure.Success
import org.openapitools.client.infrastructure.toMultiValue

class DefaultApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath, client) {
class DefaultApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory = ApiClient.defaultClient) : ApiClient(basePath, client) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import com.squareup.moshi.adapter

val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody()

open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) {
open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClient) {
companion object {
protected const val ContentType = "Content-Type"
protected const val Accept = "Accept"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package org.openapitools.client.apis

import java.io.IOException
import okhttp3.OkHttpClient
import okhttp3.Call
import okhttp3.HttpUrl


Expand All @@ -36,7 +36,7 @@ import org.openapitools.client.infrastructure.ResponseType
import org.openapitools.client.infrastructure.Success
import org.openapitools.client.infrastructure.toMultiValue

class DefaultApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath, client) {
class DefaultApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory = ApiClient.defaultClient) : ApiClient(basePath, client) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import com.squareup.moshi.adapter

val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody()

open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) {
open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClient) {
companion object {
protected const val ContentType = "Content-Type"
protected const val Accept = "Accept"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package org.openapitools.client.apis

import java.io.IOException
import okhttp3.OkHttpClient
import okhttp3.Call
import okhttp3.HttpUrl

import org.openapitools.client.models.ModelWithEnumPropertyHavingDefault
Expand All @@ -37,7 +37,7 @@ import org.openapitools.client.infrastructure.ResponseType
import org.openapitools.client.infrastructure.Success
import org.openapitools.client.infrastructure.toMultiValue

class DefaultApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath, client) {
class DefaultApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory = ApiClient.defaultClient) : ApiClient(basePath, client) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import com.squareup.moshi.adapter

val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody()

open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) {
open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClient) {
companion object {
protected const val ContentType = "Content-Type"
protected const val Accept = "Accept"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package org.openapitools.client.apis

import java.io.IOException
import okhttp3.OkHttpClient
import okhttp3.Call
import okhttp3.HttpUrl

import org.openapitools.client.models.ModelApiResponse
Expand All @@ -38,7 +38,7 @@ import org.openapitools.client.infrastructure.ResponseType
import org.openapitools.client.infrastructure.Success
import org.openapitools.client.infrastructure.toMultiValue

class PetApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath, client) {
class PetApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory = ApiClient.defaultClient) : ApiClient(basePath, client) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package org.openapitools.client.apis

import java.io.IOException
import okhttp3.OkHttpClient
import okhttp3.Call
import okhttp3.HttpUrl

import org.openapitools.client.models.Order
Expand All @@ -37,7 +37,7 @@ import org.openapitools.client.infrastructure.ResponseType
import org.openapitools.client.infrastructure.Success
import org.openapitools.client.infrastructure.toMultiValue

class StoreApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath, client) {
class StoreApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory = ApiClient.defaultClient) : ApiClient(basePath, client) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package org.openapitools.client.apis

import java.io.IOException
import okhttp3.OkHttpClient
import okhttp3.Call
import okhttp3.HttpUrl

import org.openapitools.client.models.User
Expand All @@ -37,7 +37,7 @@ import org.openapitools.client.infrastructure.ResponseType
import org.openapitools.client.infrastructure.Success
import org.openapitools.client.infrastructure.toMultiValue

class UserApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath, client) {
class UserApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory = ApiClient.defaultClient) : ApiClient(basePath, client) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import com.google.gson.reflect.TypeToken

val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody()

open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) {
open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClient) {
companion object {
protected const val ContentType = "Content-Type"
protected const val Accept = "Accept"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package org.openapitools.client.apis

import java.io.IOException
import okhttp3.OkHttpClient
import okhttp3.Call
import okhttp3.HttpUrl

import org.openapitools.client.models.ModelApiResponse
Expand All @@ -38,7 +38,7 @@ import org.openapitools.client.infrastructure.ResponseType
import org.openapitools.client.infrastructure.Success
import org.openapitools.client.infrastructure.toMultiValue

class PetApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath, client) {
class PetApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory = ApiClient.defaultClient) : ApiClient(basePath, client) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package org.openapitools.client.apis

import java.io.IOException
import okhttp3.OkHttpClient
import okhttp3.Call
import okhttp3.HttpUrl

import org.openapitools.client.models.Order
Expand All @@ -37,7 +37,7 @@ import org.openapitools.client.infrastructure.ResponseType
import org.openapitools.client.infrastructure.Success
import org.openapitools.client.infrastructure.toMultiValue

class StoreApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath, client) {
class StoreApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory = ApiClient.defaultClient) : ApiClient(basePath, client) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package org.openapitools.client.apis

import java.io.IOException
import okhttp3.OkHttpClient
import okhttp3.Call
import okhttp3.HttpUrl

import org.openapitools.client.models.User
Expand All @@ -37,7 +37,7 @@ import org.openapitools.client.infrastructure.ResponseType
import org.openapitools.client.infrastructure.Success
import org.openapitools.client.infrastructure.toMultiValue

class UserApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath, client) {
class UserApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory = ApiClient.defaultClient) : ApiClient(basePath, client) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import com.fasterxml.jackson.core.type.TypeReference

val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody()

open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) {
open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClient) {
companion object {
protected const val ContentType = "Content-Type"
protected const val Accept = "Accept"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package org.openapitools.client.apis

import java.io.IOException
import okhttp3.OkHttpClient
import okhttp3.Call
import okhttp3.HttpUrl

import org.openapitools.client.models.ModelApiResponse
Expand All @@ -39,7 +39,7 @@ import org.openapitools.client.infrastructure.ResponseType
import org.openapitools.client.infrastructure.Success
import org.openapitools.client.infrastructure.toMultiValue

class PetApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath, client) {
class PetApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory = ApiClient.defaultClient) : ApiClient(basePath, client) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package org.openapitools.client.apis

import java.io.IOException
import okhttp3.OkHttpClient
import okhttp3.Call
import okhttp3.HttpUrl

import org.openapitools.client.models.Order
Expand All @@ -38,7 +38,7 @@ import org.openapitools.client.infrastructure.ResponseType
import org.openapitools.client.infrastructure.Success
import org.openapitools.client.infrastructure.toMultiValue

class StoreApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath, client) {
class StoreApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory = ApiClient.defaultClient) : ApiClient(basePath, client) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package org.openapitools.client.apis

import java.io.IOException
import okhttp3.OkHttpClient
import okhttp3.Call
import okhttp3.HttpUrl

import org.openapitools.client.models.User
Expand All @@ -38,7 +38,7 @@ import org.openapitools.client.infrastructure.ResponseType
import org.openapitools.client.infrastructure.Success
import org.openapitools.client.infrastructure.toMultiValue

class UserApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath, client) {
class UserApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory = ApiClient.defaultClient) : ApiClient(basePath, client) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import kotlinx.serialization.encodeToString

val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody()

open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) {
open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClient) {
companion object {
protected const val ContentType = "Content-Type"
protected const val Accept = "Accept"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package org.openapitools.client.apis

import java.io.IOException
import okhttp3.OkHttpClient
import okhttp3.Call
import okhttp3.HttpUrl

import org.openapitools.client.models.ModelApiResponse
Expand All @@ -40,7 +40,7 @@ import org.openapitools.client.infrastructure.ResponseType
import org.openapitools.client.infrastructure.Success
import org.openapitools.client.infrastructure.toMultiValue

class PetApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath, client) {
class PetApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory = ApiClient.defaultClient) : ApiClient(basePath, client) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
Expand Down
Loading

0 comments on commit 7a7c8c1

Please sign in to comment.