com.pubnub.api.builder.PubSubOperations.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pubnub-kotlin Show documentation
Show all versions of pubnub-kotlin Show documentation
PubNub is a cross-platform client-to-client (1:1 and 1:many) push service in the cloud, capable of
broadcasting real-time messages to millions of web and mobile clients simultaneously, in less than a quarter
second!
package com.pubnub.api.builder
// basic publish/subscribe class
internal sealed class PubSubOperation
// concrete publish/subscribe cases
internal data class SubscribeOperation(
val channels: List = emptyList(),
val channelGroups: List = emptyList(),
val presenceEnabled: Boolean = false,
val timetoken: Long = 0L
) : PubSubOperation()
internal data class UnsubscribeOperation(
val channels: List = emptyList(),
val channelGroups: List = emptyList()
) : PubSubOperation()
internal data class PresenceOperation(
val channels: List = emptyList(),
val channelGroups: List = emptyList(),
val connected: Boolean = false
) : PubSubOperation()
internal data class StateOperation(
val channels: List = emptyList(),
val channelGroups: List = emptyList(),
val state: Any? = null
) : PubSubOperation()
internal data class TimetokenRegionOperation(
val timetoken: Long = 0L,
val region: String
) : PubSubOperation()
internal object ConnectedStatusAnnouncedOperation : PubSubOperation()
internal object NoOpOperation : PubSubOperation()