All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.com.sceyt.chatuikit.data.models.SendMessageResult.kt Maven / Gradle / Ivy

package com.sceyt.chatuikit.data.models

import com.sceyt.chatuikit.data.models.messages.SceytMessage

sealed class SendMessageResult {
    data class TempMessage(val message: SceytMessage) : SendMessageResult()
    data object StartedSendingAttachment : SendMessageResult()
    data class Success(val response: SceytResponse.Success) : SendMessageResult()
    data class Error(val response: SceytResponse.Error) : SendMessageResult()

    fun isServerResponse() = this is Success || this is Error

    fun response() = when (this) {
        is Success -> response
        is Error -> response
        else -> null
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy