main.com.sceyt.chatuikit.data.models.SceytResponse.kt Maven / Gradle / Ivy
package com.sceyt.chatuikit.data.models
import com.sceyt.chat.models.SceytException
sealed class SceytResponse(val data: T? = null, val message: String? = null, val code: Int? = null) {
class Success(data: T?) : SceytResponse(data)
class Error(val exception: SceytException? = null, data: T? = null) : SceytResponse(data, exception?.message, exception?.code)
}
sealed class SceytPagingResponse(val data: T? = null, val message: String? = null, val code: Int? = null) {
class Success(data: T?, val hasNext: Boolean) : SceytPagingResponse(data)
class Error(val exception: SceytException? = null, data: T? = null) : SceytPagingResponse(data, exception?.message, exception?.code)
}