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

commonMain.app.bsky.actor.Token.kt Maven / Gradle / Ivy

The newest version!
package app.bsky.actor

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 AllowIncomingSerializer : KSerializer by 
    stringEnumSerializer(AllowIncoming::safeValueOf)

@Serializable(with = AllowIncomingSerializer::class)
public sealed class AllowIncoming(
  override val `value`: String,
) : AtpEnum() {
  public data object All : AllowIncoming("all")

  public data object None : AllowIncoming("none")

  public data object Following : AllowIncoming("following")

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

  public companion object {
    public fun safeValueOf(`value`: String): AllowIncoming = when (value) {
      "all" -> All
      "none" -> None
      "following" -> Following
      else -> Unknown(value)
    }
  }
}

public class VisibilitySerializer : KSerializer by 
    stringEnumSerializer(Visibility::safeValueOf)

@Serializable(with = VisibilitySerializer::class)
public sealed class Visibility(
  override val `value`: String,
) : AtpEnum() {
  public data object Ignore : Visibility("ignore")

  public data object Show : Visibility("show")

  public data object Warn : Visibility("warn")

  public data object Hide : Visibility("hide")

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

  public companion object {
    public fun safeValueOf(`value`: String): Visibility = when (value) {
      "ignore" -> Ignore
      "show" -> Show
      "warn" -> Warn
      "hide" -> Hide
      else -> Unknown(value)
    }
  }
}

public class TypeSerializer : KSerializer by  stringEnumSerializer(Type::safeValueOf)

@Serializable(with = TypeSerializer::class)
public sealed class Type(
  override val `value`: String,
) : AtpEnum() {
  public data object Feed : Type("feed")

  public data object List : Type("list")

  public data object Timeline : Type("timeline")

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

  public companion object {
    public fun safeValueOf(`value`: String): Type = when (value) {
      "feed" -> Feed
      "list" -> List
      "timeline" -> Timeline
      else -> Unknown(value)
    }
  }
}

public class SortSerializer : KSerializer by  stringEnumSerializer(Sort::safeValueOf)

@Serializable(with = SortSerializer::class)
public sealed class Sort(
  override val `value`: String,
) : AtpEnum() {
  public data object Oldest : Sort("oldest")

  public data object Newest : Sort("newest")

  public data object MostLikes : Sort("most-likes")

  public data object Random : Sort("random")

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

  public companion object {
    public fun safeValueOf(`value`: String): Sort = when (value) {
      "oldest" -> Oldest
      "newest" -> Newest
      "most-likes" -> MostLikes
      "random" -> Random
      else -> Unknown(value)
    }
  }
}

public class MutedWordTargetSerializer : KSerializer by 
    stringEnumSerializer(MutedWordTarget::safeValueOf)

@Serializable(with = MutedWordTargetSerializer::class)
public sealed class MutedWordTarget(
  override val `value`: String,
) : AtpEnum() {
  public data object Content : MutedWordTarget("content")

  public data object Tag : MutedWordTarget("tag")

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

  public companion object {
    public fun safeValueOf(`value`: String): MutedWordTarget = when (value) {
      "content" -> Content
      "tag" -> Tag
      else -> Unknown(value)
    }
  }
}

public class ActorTargetSerializer : KSerializer by 
    stringEnumSerializer(ActorTarget::safeValueOf)

@Serializable(with = ActorTargetSerializer::class)
public sealed class ActorTarget(
  override val `value`: String,
) : AtpEnum() {
  public data object All : ActorTarget("all")

  public data object ExcludeFollowing : ActorTarget("exclude-following")

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

  public companion object {
    public fun safeValueOf(`value`: String): ActorTarget = when (value) {
      "all" -> All
      "exclude-following" -> ExcludeFollowing
      else -> Unknown(value)
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy