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

commonMain.tools.ozone.moderation.getRecords.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.AtUri
import sh.christian.ozone.api.model.JsonContent
import sh.christian.ozone.api.runtime.valueClassSerializer

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

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

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

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

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

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

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

@Serializable
public data class GetRecordsResponse(
  public val records: List,
)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy