commonMain.app.bsky.graph.Token.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 app.bsky.graph
import kotlin.String
import kotlinx.serialization.KSerializer
import kotlinx.serialization.Serializable
import sh.christian.ozone.api.model.AtpEnum
import sh.christian.ozone.api.runtime.stringEnumSerializer
public class TokenSerializer : KSerializer by stringEnumSerializer(Token::safeValueOf)
@Serializable(with = TokenSerializer::class)
public sealed class Token(
override val `value`: String,
) : AtpEnum() {
public data object Modlist : Token("app.bsky.graph.defs#modlist")
public data object Curatelist : Token("app.bsky.graph.defs#curatelist")
public data object Referencelist : Token("app.bsky.graph.defs#referencelist")
public data class Unknown(
public val rawValue: String,
) : Token(rawValue)
public companion object {
public fun safeValueOf(`value`: String): Token = when (value) {
"app.bsky.graph.defs#modlist" -> Modlist
"app.bsky.graph.defs#curatelist" -> Curatelist
"app.bsky.graph.defs#referencelist" -> Referencelist
else -> Unknown(value)
}
}
}