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

commonMain.tools.ozone.moderation.getRepos.kt Maven / Gradle / Ivy

The newest version!
@file:Suppress("DEPRECATION")

package tools.ozone.moderation

import kotlin.Any
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmInline
import kotlinx.serialization.KSerializer
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import sh.christian.ozone.api.Did
import sh.christian.ozone.api.model.JsonContent
import sh.christian.ozone.api.runtime.valueClassSerializer

@Serializable
public sealed interface GetReposResponseRepoUnion {
  public class DetailSerializer : KSerializer by valueClassSerializer(
    serialName = "tools.ozone.moderation.defs#repoViewDetail",
    constructor = ::Detail,
    valueProvider = Detail::value,
    valueSerializerProvider = { RepoViewDetail.serializer() },
  )

  @JvmInline
  @Serializable(with = DetailSerializer::class)
  @SerialName("tools.ozone.moderation.defs#repoViewDetail")
  public value class Detail(
    public val `value`: RepoViewDetail,
  ) : GetReposResponseRepoUnion

  public class NotFoundSerializer : KSerializer by valueClassSerializer(
    serialName = "tools.ozone.moderation.defs#repoViewNotFound",
    constructor = ::NotFound,
    valueProvider = NotFound::value,
    valueSerializerProvider = { RepoViewNotFound.serializer() },
  )

  @JvmInline
  @Serializable(with = NotFoundSerializer::class)
  @SerialName("tools.ozone.moderation.defs#repoViewNotFound")
  public value class NotFound(
    public val `value`: RepoViewNotFound,
  ) : GetReposResponseRepoUnion

  @JvmInline
  @Serializable
  public value class Unknown(
    public val `value`: JsonContent,
  ) : GetReposResponseRepoUnion
}

@Serializable
public data class GetReposQueryParams(
  public val dids: List,
) {
  init {
    require(dids.count() <= 100) {
      "dids.count() must be <= 100, but was ${dids.count()}"
    }
  }

  public fun asList(): List> = buildList {
    dids.forEach {
      add("dids" to it)
    }
  }
}

@Serializable
public data class GetReposResponse(
  public val repos: List,
)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy