Package io.getstream.chat.android.client.models

Types

Link copied to clipboard
data class AgoraChannel(val channel: String)

Represents Agora channel information that contains available channel in a chat channel.

Link copied to clipboard
data class App(    val name: String,     val fileUploadConfig: FileUploadConfig,     val imageUploadConfig: FileUploadConfig)

The representation of the app, with its configurations.

Link copied to clipboard
data class AppSettings(val app: App)

App settings, as they are configured in the dashboard.

Link copied to clipboard
data class Attachment(    var authorName: String? = null,     var authorLink: String? = null,     var titleLink: String? = null,     var thumbUrl: String? = null,     var imageUrl: String? = null,     var assetUrl: String? = null,     var ogUrl: String? = null,     var mimeType: String? = null,     var fileSize: Int = 0,     var title: String? = null,     var text: String? = null,     var type: String? = null,     var image: String? = null,     var url: String? = null,     var name: String? = null,     var fallback: String? = null,     var originalHeight: Int? = null,     var originalWidth: Int? = null,     var upload: File? = null,     var uploadState: Attachment.UploadState? = null,     var extraData: MutableMap<String, Any> = mutableMapOf()) : CustomObject

Represents an attachment. Most commonly these are files, images, videos and audio recordings, but the class is flexible enough that it can represent other things as well such as a date, a given location or other things.

Link copied to clipboard
data class BannedUser(    val user: User,     val bannedBy: User?,     val channel: Channel?,     val createdAt: Date?,     val expires: Date?,     val shadow: Boolean,     val reason: String?)
Link copied to clipboard
data class BannedUsersSort(val createdAt: Date) : ComparableFieldProvider
Link copied to clipboard
data class Channel(    var cid: String = "",     var id: String = "",     var type: String = "",     var name: String = "",     var image: String = "",     var watcherCount: Int = 0,     var frozen: Boolean = false,     var lastMessageAt: Date? = null,     var createdAt: Date? = null,     var deletedAt: Date? = null,     var updatedAt: Date? = null,     var syncStatus: SyncStatus = SyncStatus.COMPLETED,     var memberCount: Int = 0,     var messages: List<Message> = mutableListOf(),     var members: List<Member> = mutableListOf(),     var watchers: List<User> = mutableListOf(),     var read: List<ChannelUserRead> = mutableListOf(),     var config: Config = Config(),     var createdBy: User = User(),     var unreadCount: Int? = null,     val team: String = "",     var hidden: Boolean? = null,     var hiddenMessagesBefore: Date? = null,     val cooldown: Int = 0,     var pinnedMessages: List<Message> = mutableListOf(),     var ownCapabilities: Set<String> = setOf(),     var membership: Member? = null,     var extraData: MutableMap<String, Any> = mutableMapOf()) : CustomObject, ComparableFieldProvider

Channel is where conversations take place between two or more chat users. It contains a list of messages and have a list of the member users that are participating in the conversation.

Link copied to clipboard
object ChannelCapabilities

Predefined list of channel capabilities constants. Channel capabilities provide you information on which features are available for the current user. Channel capabilities are affected by a number of factors including:

Link copied to clipboard
data class ChannelConfig(val type: String, val config: Config)

Configuration of a channel.

Link copied to clipboard
data class ChannelInfo(    val cid: String? = null,     val id: String? = null,     val type: String? = null,     val memberCount: Int = 0,     val name: String? = null,     val image: String? = null)

A Channel object that contains less information. Used only internally.

Link copied to clipboard
data class ChannelMute(    val user: User,     val channel: Channel,     val createdAt: Date,     var updatedAt: Date,     val expires: Date?)

Represents a channel mute.

Link copied to clipboard
data class ChannelUserRead(    var user: User,     var lastRead: Date? = null,     var unreadMessages: Int = 0,     var lastMessageSeenDate: Date? = null) : UserEntity

Information about how many messages are unread in the channel by a given user.

Link copied to clipboard
data class Command(    val name: String,     val description: String,     val args: String,     val set: String)
Link copied to clipboard
data class Config(    val createdAt: Date? = null,     val updatedAt: Date? = null,     val name: String = "",     val typingEventsEnabled: Boolean = true,     val readEventsEnabled: Boolean = true,     val connectEventsEnabled: Boolean = true,     val searchEnabled: Boolean = true,     val isReactionsEnabled: Boolean = true,     val isThreadEnabled: Boolean = true,     val muteEnabled: Boolean = true,     val uploadsEnabled: Boolean = true,     val urlEnrichmentEnabled: Boolean = true,     val customEventsEnabled: Boolean = false,     val pushNotificationsEnabled: Boolean = true,     val messageRetention: String = "infinite",     val maxMessageLength: Int = 5000,     val automod: String = "disabled",     val automodBehavior: String = "",     val blocklistBehavior: String = "",     val commands: List<Command> = mutableListOf())
Link copied to clipboard
data class ConnectionData(val user: User, val connectionId: String)
Link copied to clipboard
enum ConnectionState : Enum<ConnectionState>

Represents possible states of the WebSocket connection.

Link copied to clipboard
object Constants

Represents constants used across all SDKs.

Link copied to clipboard
interface CustomObject
Link copied to clipboard
data class Device(    val token: String,     val pushProvider: PushProvider,     val providerName: String?)

Device's information needed to register push notifications.

Link copied to clipboard
object EventType

https://getstream.io/chat/docs/js/#event_object

Link copied to clipboard
data class FileUploadConfig(    val allowedFileExtensions: List<String>,     val allowedMimeTypes: List<String>,     val blockedFileExtensions: List<String>,     val blockedMimeTypes: List<String>)

The configuration of file upload.

Link copied to clipboard
object Filters

Stream supports a limited set of filters for querying channels, users and members. The example below shows how to filter for channels of type messaging where the current user is a member

Link copied to clipboard
data class Flag(    val user: User,     val targetUser: User?,     val targetMessageId: String,     val reviewedBy: String,     val createdByAutomod: Boolean,     val createdAt: Date?,     val updatedAt: Date,     val reviewedAt: Date?,     val approvedAt: Date?,     val rejectedAt: Date?)
Link copied to clipboard
data class GuestUser(val user: User, val token: String)
Link copied to clipboard
data class HMSRoom(val roomId: String, val roomName: String)

Represents HMS room information that contains available room in a chat channel.

Link copied to clipboard
enum InitializationState : Enum<InitializationState>

The state of initialization process.

Link copied to clipboard
data class Member(    var user: User,     var createdAt: Date? = null,     var updatedAt: Date? = null,     var isInvited: Boolean? = null,     var inviteAcceptedAt: Date? = null,     var inviteRejectedAt: Date? = null,     var shadowBanned: Boolean = false,     var banned: Boolean = false,     var channelRole: String? = null) : UserEntity, ComparableFieldProvider

Represents a channel member.

Link copied to clipboard
data class Message(    var id: String = "",     var cid: String = "",     var text: String = "",     val html: String = "",     var parentId: String? = null,     var command: String? = null,     var attachments: MutableList<Attachment> = mutableListOf(),     var mentionedUsersIds: MutableList<String> = mutableListOf(),     var mentionedUsers: MutableList<User> = mutableListOf(),     var replyCount: Int = 0,     var reactionCounts: MutableMap<String, Int> = mutableMapOf(),     var reactionScores: MutableMap<String, Int> = mutableMapOf(),     var syncStatus: SyncStatus = SyncStatus.COMPLETED,     var syncDescription: MessageSyncDescription? = null,     var type: String = "",     var latestReactions: MutableList<Reaction> = mutableListOf(),     var ownReactions: MutableList<Reaction> = mutableListOf(),     var createdAt: Date? = null,     var updatedAt: Date? = null,     var deletedAt: Date? = null,     var updatedLocallyAt: Date? = null,     var createdLocallyAt: Date? = null,     var user: User = User(),     var extraData: MutableMap<String, Any> = mutableMapOf(),     var silent: Boolean = false,     var shadowed: Boolean = false,     val i18n: Map<String, String> = mapOf(),     var showInChannel: Boolean = false,     var channelInfo: ChannelInfo? = null,     var replyTo: Message? = null,     var replyMessageId: String? = null,     var pinned: Boolean = false,     var pinnedAt: Date? = null,     var pinExpires: Date? = null,     var pinnedBy: User? = null,     var threadParticipants: List<User> = emptyList()) : CustomObject, ComparableFieldProvider
Link copied to clipboard
object MessageAwaitingAttachments : MessageSyncInProgress

When sync is in progress due to awaiting attachments.

Link copied to clipboard
data class MessageModerationFailed(val violations: List<ModerationViolation>) : MessageSyncFailed

When sync is failed due to moderation violation.

Link copied to clipboard
sealed class MessageSyncContent

A content of message sync description.

Link copied to clipboard
data class MessageSyncDescription(val type: MessageSyncType, val content: MessageSyncContent)

An addition to SyncStatus to cover message related statuses in detail.

Link copied to clipboard
sealed class MessageSyncFailed : MessageSyncContent

When sync is failed.

Link copied to clipboard
sealed class MessageSyncInProgress : MessageSyncContent

When sync is in progress.

Link copied to clipboard
object MessageSyncNone : MessageSyncContent

When no additional description is required to SyncStatus.

Link copied to clipboard
enum MessageSyncType : Enum<MessageSyncType>

A type of message sync description.

Link copied to clipboard
data class ModerationViolation(val code: Int, val messages: List<String>)

Moderation violation details.

Link copied to clipboard
data class Mute(    var user: User,     var target: User,     var createdAt: Date,     var updatedAt: Date,     val expires: Date?)
Link copied to clipboard
data class PushMessage(    val messageId: String,     val channelId: String,     val channelType: String)
Link copied to clipboard
enum PushProvider : Enum<PushProvider>

Push notifications provider type.

Link copied to clipboard
data class Reaction(    var messageId: String = "",     var type: String = "",     var score: Int = 0,     var user: User? = null,     var userId: String = "",     var createdAt: Date? = null,     var updatedAt: Date? = null,     var deletedAt: Date? = null,     var syncStatus: SyncStatus = SyncStatus.COMPLETED,     var extraData: MutableMap<String, Any> = mutableMapOf(),     var enforceUnique: Boolean = false) : CustomObject
Link copied to clipboard
data class SearchMessagesResult(    val messages: List<Message> = emptyList(),     val next: String? = null,     val previous: String? = null,     val resultsWarning: SearchWarning? = null)
Link copied to clipboard
data class SearchWarning(    val channelSearchCids: List<String>,     val channelSearchCount: Int,     val warningCode: Int,     val warningDescription: String)

Represents a warning related to message search results. For example, if there are more than 500 channels that match the channel filter.

Link copied to clipboard
data class TypingEvent(val channelId: String, val users: List<User>)
Link copied to clipboard
data class UploadedFile(val file: String, val thumbUrl: String? = null)

Represents a successfully uploaded file.

Link copied to clipboard
data class UploadedImage(val file: String, val thumbUrl: String? = null)

Represents a successfully uploaded image.

Link copied to clipboard
data class User(    var id: String = "",     var role: String = "",     var name: String = "",     var image: String = "",     var invisible: Boolean = false,     var banned: Boolean = false,     var devices: List<Device> = mutableListOf(),     var online: Boolean = false,     var createdAt: Date? = null,     var updatedAt: Date? = null,     var lastActive: Date? = null,     var totalUnreadCount: Int = 0,     var unreadChannels: Int = 0,     var mutes: List<Mute> = mutableListOf(),     val teams: List<String> = listOf(),     val channelMutes: List<ChannelMute> = emptyList(),     var extraData: MutableMap<String, Any> = mutableMapOf()) : CustomObject, ComparableFieldProvider

Represents a person who uses a chat and can perform chat operations like viewing channels or sending messages.

Link copied to clipboard
interface UserEntity
Link copied to clipboard
typealias UserId = String

Represents User.id String.

Link copied to clipboard
data class VideoCallInfo(    val callId: String,     val provider: String,     val type: String,     val agoraChannel: AgoraChannel,     val hmsRoom: HMSRoom,     val videoCallToken: VideoCallToken)

Represents currently available call information for Agora and HMS video calls.

Link copied to clipboard
data class VideoCallToken(    val token: String,     val agoraUid: Int?,     val agoraAppId: String?)

A call token that is used in currently available video call integrations.

Properties

Link copied to clipboard
val Channel.initials: String
val User.initials: String
Link copied to clipboard
val Message.originalLanguage: String

Functions

Link copied to clipboard
fun Message.getTranslation(language: String): String
Link copied to clipboard
fun Channel.getUnreadMessagesCount(forUserId: String = ""): Int