Response

@Serializable
sealed class Response<T>

Inheritors

Types

Link copied to clipboard
@Serializable
@SerialName(value = "false")
data class Failure(val errorCode: Int, val description: String? = null, val parameters: ResponseParameters? = null) : Response<Nothing>
Link copied to clipboard
@Serializable
@SerialName(value = "true")
data class Success<T>(val result: T) : Response<T>

Properties

Link copied to clipboard
val ok: Boolean

Functions

Link copied to clipboard
fun <T> Response<T>.getOrNull(): T?

Get response or null on failure.

Link copied to clipboard

Whether the request completed successfully.

Link copied to clipboard
inline fun <T> Response<T>.onFailure(block: (Response.Failure) -> Unit): T?