ApiResponse

@Serializable
data class ApiResponse<T>(val success: Boolean, val data: T? = null, val error: String? = null)

A generic data class representing the structure of an API response.

Parameters

T

The type of the data returned in the response.

Constructors

Link copied to clipboard
constructor(success: Boolean, data: T? = null, error: String? = null)

Properties

Link copied to clipboard
val data: T? = null

The data returned in the response (null if there is no data).

Link copied to clipboard
val error: String? = null

An optional error message, in case of failure.

Link copied to clipboard

A boolean indicating whether the request was successful.