55 lines
2.4 KiB
Kotlin
55 lines
2.4 KiB
Kotlin
package chats.data.remote.dto
|
|
|
|
import com.google.gson.annotations.SerializedName
|
|
|
|
data class UserBasicDto(
|
|
@SerializedName("id") val id: String,
|
|
@SerializedName("username") val username: String? = null,
|
|
@SerializedName("displayName") val displayName: String? = null,
|
|
@SerializedName("avatarUrl") val avatarUrl: String? = null
|
|
)
|
|
|
|
data class MessageDto(
|
|
@SerializedName("id", alternate = ["Id"]) val id: String,
|
|
@SerializedName("chatId", alternate = ["ChatId"]) val chatId: String? = null,
|
|
@SerializedName("senderId", alternate = ["SenderId"]) val senderId: String? = null,
|
|
@SerializedName("content", alternate = ["Content"]) val content: String? = null,
|
|
@SerializedName("type", alternate = ["Type"]) val type: String? = null,
|
|
@SerializedName("sequenceId", alternate = ["SequenceId"]) val sequenceId: Int? = null,
|
|
@SerializedName("createdAt", alternate = ["CreatedAt"]) val createdAt: String? = null,
|
|
@SerializedName("sender", alternate = ["Sender"]) val sender: UserBasicDto? = null,
|
|
@SerializedName("media", alternate = ["Media"]) val media: List<MediaItemDto> = emptyList(),
|
|
@SerializedName("reactions", alternate = ["Reactions"]) val reactions: List<ReactionDto>? = emptyList(),
|
|
@SerializedName("replyTo", alternate = ["ReplyTo"]) val replyTo: MessageDto? = null
|
|
)
|
|
|
|
data class ReactionDto(
|
|
@SerializedName("emoji") val emoji: String,
|
|
@SerializedName("count") val count: Int,
|
|
@SerializedName("isSetByMe") val isSetByMe: Boolean
|
|
)
|
|
|
|
data class MediaItemDto(
|
|
@SerializedName("id") val id: String,
|
|
@SerializedName("type") val type: String,
|
|
@SerializedName("url") val url: String,
|
|
@SerializedName("filename") val filename: String? = null,
|
|
@SerializedName("size") val size: Long? = null,
|
|
@SerializedName("duration") val duration: Double? = null
|
|
)
|
|
|
|
data class ChatDto(
|
|
@SerializedName("id") val id: String,
|
|
@SerializedName("type") val type: String,
|
|
@SerializedName("name") val name: String? = null,
|
|
@SerializedName("avatar") val avatar: String? = null,
|
|
@SerializedName("unreadCount", alternate = ["UnreadCount", "unread_count"]) val unreadCount: Int = 0,
|
|
@SerializedName("messages") val messages: List<MessageDto> = emptyList(),
|
|
@SerializedName("members") val members: List<ChatMemberDto> = emptyList()
|
|
)
|
|
|
|
data class ChatMemberDto(
|
|
@SerializedName("userId") val userId: String,
|
|
@SerializedName("user") val user: UserBasicDto? = null
|
|
)
|