class CallbackResultConvert<T : ApiResultInterface, R> : Callback<T>
Helper for connecting the Retrofit2 Callback into Result completion with a convertion of the data received
T - the type of the data for success operation
R - the type of the data returned after transformation
completion - sdk callback result
convert - convert function to transform the received data R in the completion data T
CallbackResultConvert(completion: (Result<R, Exception>) -> Unit, convert: (T) -> Result<R, Exception>)
Helper for connecting the Retrofit2 Callback into Result completion with a convertion of the data received |
val completion: (Result<R, Exception>) -> Unit
sdk callback result |
|
val convert: (T) -> Result<R, Exception>
convert function to transform the received data R in the completion data T |
fun onFailure(call: Call<T>, t: Throwable): Unit
Implementation of the Retrofit2 onFailure Callback |
|
fun onResponse(call: Call<T>, response: Response<T>): Unit
Implementation of the Retrofit2 onResponse Callback |