Success
data class Success<out T : Any>(val value: T, val headers: Map<String, String?>, val httpCode: Int) : NetworkResponse<T>
Constructors
Properties
Functions
Link copied to clipboard
internal inline fun <T : Any, R : Any> NetworkResponse<T>.flatMap(fn: (NetworkResponse.Success<T>) -> NetworkResponse<R>): NetworkResponse<R>
Link copied to clipboard
Link copied to clipboard
internal inline fun <T : Any, U : Any> NetworkResponse<T>.mapSuccess(mapping: (T) -> U): NetworkResponse<U>
If the request is successful, perform mapping and create a new Success with its result
Link copied to clipboard
internal inline fun <T : Any> NetworkResponse<T>.onFailure(fn: (NetworkResponse.Error) -> Unit): NetworkResponse<T>
Link copied to clipboard
internal inline fun <T : Any> NetworkResponse<T>.onSuccess(fn: (NetworkResponse.Success<T>) -> Unit): NetworkResponse<T>