commonMain.tools.ozone.setting.upsertOptionToken.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bluesky Show documentation
Show all versions of bluesky Show documentation
Bluesky Social API bindings for Kotlin.
The newest version!
package tools.ozone.setting
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 UpsertOptionScopeSerializer : KSerializer by
stringEnumSerializer(UpsertOptionScope::safeValueOf)
@Serializable(with = UpsertOptionScopeSerializer::class)
public sealed class UpsertOptionScope(
override val `value`: String,
) : AtpEnum() {
public data object Instance : UpsertOptionScope("instance")
public data object Personal : UpsertOptionScope("personal")
public data class Unknown(
public val rawValue: String,
) : UpsertOptionScope(rawValue)
public companion object {
public fun safeValueOf(`value`: String): UpsertOptionScope = when (value) {
"instance" -> Instance
"personal" -> Personal
else -> Unknown(value)
}
}
}