All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.atproto.server.getSessionToken.kt Maven / Gradle / Ivy

The newest version!
package com.atproto.server

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 GetSessionStatusSerializer : KSerializer by 
    stringEnumSerializer(GetSessionStatus::safeValueOf)

@Serializable(with = GetSessionStatusSerializer::class)
public sealed class GetSessionStatus(
  override val `value`: String,
) : AtpEnum() {
  public data object Takendown : GetSessionStatus("takendown")

  public data object Suspended : GetSessionStatus("suspended")

  public data object Deactivated : GetSessionStatus("deactivated")

  public data class Unknown(
    public val rawValue: String,
  ) : GetSessionStatus(rawValue)

  public companion object {
    public fun safeValueOf(`value`: String): GetSessionStatus = when (value) {
      "takendown" -> Takendown
      "suspended" -> Suspended
      "deactivated" -> Deactivated
      else -> Unknown(value)
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy