com.pubnub.api.models.consumer.pubsub.PNPresenceEventResult.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.models.consumer.pubsub
import com.google.gson.JsonElement
import com.pubnub.api.PubNub
import com.pubnub.api.callbacks.SubscribeCallback
/**
* Wrapper around a presence event received in [SubscribeCallback.presence].
*
* @property event The presence event. Could be `join`, `leave`, `state-change` or `interval`.
* @property uuid The UUID which the presence event is related to.
* @property timestamp The timestamp of the event.
* @property occupancy Total number of users currently present in the `channel` in question.
* @property state Presence state of the related UUID, if any.
* @property channel The channel which the `event` is performed on.
* @property subscription The related subscription.
* @property timetoken The timetoken of the event.
* @property join List of users that have *joined* the `channel` if the `event` is an `interval`.
* This needs to be enabled under **presence_deltas** at the Admin Dashboard.
* @property leave List of users that have *left* the `channel` if the `event` is an `interval`.
* This needs to be enabled under **presence_deltas** at the Admin Dashboard.
* @property timeout List of users that have *timed out* of the `channel` if the `event` is an `interval`.
* This needs to be enabled under **presence_deltas** at the Admin Dashboard.
* @property hereNowRefresh Indicates to the user that a manual [PubNub.hereNow] should be called to get
* the complete list of users present in the channel.
* @property userMetadata User metadata if any.
*/
data class PNPresenceEventResult(
val event: String? = null,
val uuid: String? = null,
val timestamp: Long? = null,
val occupancy: Int? = null,
val state: JsonElement? = null,
val channel: String? = null,
val subscription: String? = null,
val timetoken: Long? = null,
val join: List? = null,
val leave: List? = null,
val timeout: List? = null,
val hereNowRefresh: Boolean? = null,
val userMetadata: Any? = null
) : PNEvent