com.paysera.lib.inrento.retrofit.NetworkAccessTokenApiFactory.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-lib-inrento-sdk Show documentation
Show all versions of kotlin-lib-inrento-sdk Show documentation
Paysera: Kotlin InRento SDK Library
package com.paysera.lib.inrento.retrofit
import com.paysera.lib.common.entities.CustomApiCredentials
import com.paysera.lib.common.interfaces.ErrorLoggerInterface
import com.paysera.lib.common.interfaces.TokenRefresherInterface
import com.paysera.lib.common.retrofit.BaseApiFactory
import com.paysera.lib.inrento.clients.InRentoAccessTokenApiClient
import okhttp3.Interceptor
import okhttp3.logging.HttpLoggingInterceptor
class NetworkAccessTokenApiFactory(
baseUrl: String,
userAgent: String?,
credentials: CustomApiCredentials?,
timeout: Long? = null,
httpLoggingInterceptorLevel: HttpLoggingInterceptor.Level = HttpLoggingInterceptor.Level.BASIC,
errorLogger: ErrorLoggerInterface,
certificateInterceptor: Interceptor?
) : BaseApiFactory(
baseUrl = baseUrl,
userAgent = userAgent,
credentials = credentials,
timeout = timeout,
httpLoggingInterceptorLevel = httpLoggingInterceptorLevel,
errorLogger = errorLogger,
certificateInterceptor = certificateInterceptor
) {
override fun createClient(tokenRefresher: TokenRefresherInterface?): InRentoAccessTokenApiClient {
createRetrofit(tokenRefresher).apply {
return InRentoAccessTokenApiClient(
retrofit.create(NetworkAccessTokenApiClient::class.java),
apiRequestManager
)
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy