package com.adealink.weparty.module.call.data

enum class MediaType(val type: Int) {
    Unknown(0),
    Audio(1),
    Video(2);

    companion object {
        @JvmStatic
        fun map(type: Int?): MediaType {
            return entries.find { it.type == type } ?: Unknown
        }
    }
}

enum class CallStatus(val status: Int) {
    None(0),
    Waiting(1),
    Accept(2);

    companion object {
        @JvmStatic
        fun map(status: Int): CallStatus {
            return entries.find { it.status == status } ?: None
        }
    }
}

/**
 *
 * 通话结果：
 * Cancel取消：主叫方在接通前取消通话
 * Reject拒接：被叫方拒接
 * NotAnswer 未接听：被叫方超时未接听
 * NormalEnd 完成：通话接通并正常结束
 * CallBusy忙线：通话忙线
 * Interrupt中断：网络等原因导致通话中断
 */
enum class CallResult(val result: String) {
    Cancel("Cancel"),
    Reject("Reject"),
    NotAnswer("NotAnswer"),
    NormalEnd("NormalEnd"),
    CallBusy("CallBusy"),
    Interrupt("Interrupt");

    companion object {
        fun map(result: String?): CallResult? {
            return CallResult.entries.find { it.result == result }
        }
    }
}


/**
 * 呼叫用户数据(透传)
 */
//data class CallUserData(
//    @GsonNullable
//    @SerializedName("callRoomId") val callRoomId: String? = null,
//    @SerializedName("source") val source: Int = CallerSource.CALLER.source,
//    @GsonNullable
//    @SerializedName("matchId") val matchId: Long? = null,
//) {
//    /**
//     * 是否邀请
//     */
//    fun isInviteSource(): Boolean {
//        return source == CallerSource.INVITE.source
//    }
//
//    companion object {
//        val EMPTY_USER_DATA = CallUserData()
//    }
//}