MessageDto

@Serializable
data class MessageDto(val id: String = "", val conversationId: String = "", val seq: Int = 0, val senderType: SenderType = SenderType.SYSTEM, val content: String = "", val createdAt: Instant = Instant.EPOCH, val senderId: String? = null, val senderName: String? = null, val visibility: String = "public", val contentType: String = "text", val attachments: List<Attachment> = emptyList(), val clientId: String? = null, val metadata: JsonObject? = null, val deliveryStatus: String? = null, val deliveryError: String? = null, val readAt: Instant? = null) : TimelineItem

A chat message.

Constructors

Link copied to clipboard
constructor(id: String = "", conversationId: String = "", seq: Int = 0, senderType: SenderType = SenderType.SYSTEM, content: String = "", createdAt: Instant = Instant.EPOCH, senderId: String? = null, senderName: String? = null, visibility: String = "public", contentType: String = "text", attachments: List<Attachment> = emptyList(), clientId: String? = null, metadata: JsonObject? = null, deliveryStatus: String? = null, deliveryError: String? = null, readAt: Instant? = null)

Properties

Link copied to clipboard

Attached files.

Link copied to clipboard
@SerialName(value = "client_id")
val clientId: String? = null

The optimistic id the sender chose; matches a pending bubble.

Link copied to clipboard

Message text (may be empty when only attachments are sent).

Link copied to clipboard
@SerialName(value = "content_type")
val contentType: String

text or file.

Link copied to clipboard
@SerialName(value = "conversation_id")
open override val conversationId: String

The conversation this row belongs to.

Link copied to clipboard
@Serializable(with = InstantOrEpochSerializer::class)
@SerialName(value = "created_at")
open override val createdAt: Instant

When it was created.

Link copied to clipboard
@SerialName(value = "delivery_error")
val deliveryError: String? = null

Outbound delivery error on other channels.

Link copied to clipboard
@SerialName(value = "delivery_status")
val deliveryStatus: String? = null

Outbound delivery status on other channels.

Link copied to clipboard
open override val id: String

Unique id.

Link copied to clipboard

Rows the SDK made up locally (showLocalMessage, notices); never persisted.

Link copied to clipboard

Written by this app's user.

Link copied to clipboard
open override val kind: String

message or event.

Link copied to clipboard
val metadata: JsonObject? = null

Rich card payload and other channel data (see cardOf).

Link copied to clipboard
@Serializable(with = InstantOrNullSerializer::class)
@SerialName(value = "read_at")
val readAt: Instant? = null

When the other side read it.

Link copied to clipboard
@SerialName(value = "sender_id")
val senderId: String? = null

The sender's id (visitor id, user id, ...).

Link copied to clipboard
@SerialName(value = "sender_name")
val senderName: String? = null

Display name of the sender when known.

Link copied to clipboard
@SerialName(value = "sender_type")
val senderType: SenderType

Who wrote it.

Link copied to clipboard
open override val seq: Int = 0

Position in the conversation (monotonic).

Link copied to clipboard

public for everything a visitor sees.

Functions

Link copied to clipboard
fun toJson(): JsonObject

The wire shape, including kind.