com.pubnub.api.models.server.SubscribeMessage.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.server
import com.google.gson.JsonElement
import com.google.gson.annotations.SerializedName
import com.pubnub.api.workers.SubscribeMessageProcessor.Companion.TYPE_FILES
import com.pubnub.api.workers.SubscribeMessageProcessor.Companion.TYPE_MESSAGE
class SubscribeMessage(
@SerializedName("a")
internal val shard: String?,
@SerializedName("b")
internal val subscriptionMatch: String?,
@SerializedName("c")
internal val channel: String?,
@SerializedName("d")
internal val payload: JsonElement?,
@SerializedName("f")
internal val flags: String?,
@SerializedName("i")
internal val issuingClientId: String?,
@SerializedName("k")
internal val subscribeKey: String?,
@SerializedName("o")
internal val originationMetadata: OriginationMetaData?,
@SerializedName("p")
internal val publishMetaData: PublishMetaData?,
@SerializedName("u")
internal val userMetadata: JsonElement?,
@SerializedName("e")
internal val type: Int?
) {
fun supportsEncryption() = type in arrayOf(null, TYPE_MESSAGE, TYPE_FILES)
}