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

commonMain.com.atproto.server.createSessionToken.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 CreateSessionStatusSerializer : KSerializer by stringEnumSerializer(CreateSessionStatus::safeValueOf)

/**
 * If active=false, this optional field indicates a possible reason for why the account is not
 * active. If active=false and no status is supplied, then the host makes no claim for why the
 * repository is no longer being hosted.
 */
@Serializable(with = CreateSessionStatusSerializer::class)
public sealed class CreateSessionStatus(
  override val `value`: String,
) : AtpEnum() {
  public data object Takendown : CreateSessionStatus("takendown")

  public data object Suspended : CreateSessionStatus("suspended")

  public data object Deactivated : CreateSessionStatus("deactivated")

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy