commonMain.sh.christian.ozone.api.xrpc.findSubscriptionSerializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bluesky-jvm Show documentation
Show all versions of bluesky-jvm Show documentation
Bluesky Social API bindings for Kotlin.
The newest version!
package sh.christian.ozone.api.xrpc
import com.atproto.label.SubscribeLabelsMessageUnion
import com.atproto.sync.SubscribeReposMessageUnion
import kotlin.Any
import kotlin.String
import kotlin.Suppress
import kotlin.reflect.KClass
import kotlinx.serialization.KSerializer
@Suppress("UNCHECKED_CAST")
public fun findSubscriptionSerializer(parentType: KClass, serialName: String): KSerializer? = when(parentType) {
SubscribeReposMessageUnion::class -> when {
"com.atproto.sync.subscribeRepos#commit".endsWith(serialName) ->
SubscribeReposMessageUnion.Commit.serializer()
"com.atproto.sync.subscribeRepos#identity".endsWith(serialName) ->
SubscribeReposMessageUnion.Identity.serializer()
"com.atproto.sync.subscribeRepos#account".endsWith(serialName) ->
SubscribeReposMessageUnion.Account.serializer()
"com.atproto.sync.subscribeRepos#handle".endsWith(serialName) ->
SubscribeReposMessageUnion.Handle.serializer()
"com.atproto.sync.subscribeRepos#migrate".endsWith(serialName) ->
SubscribeReposMessageUnion.Migrate.serializer()
"com.atproto.sync.subscribeRepos#tombstone".endsWith(serialName) ->
SubscribeReposMessageUnion.Tombstone.serializer()
"com.atproto.sync.subscribeRepos#info".endsWith(serialName) ->
SubscribeReposMessageUnion.Info.serializer()
else -> null
}
SubscribeLabelsMessageUnion::class -> when {
"com.atproto.label.subscribeLabels#labels".endsWith(serialName) ->
SubscribeLabelsMessageUnion.Labels.serializer()
"com.atproto.label.subscribeLabels#info".endsWith(serialName) ->
SubscribeLabelsMessageUnion.Info.serializer()
else -> null
}
else -> null
} as KSerializer?