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

commonMain.com.atproto.admin.getSubjectStatus.kt Maven / Gradle / Ivy

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

package com.atproto.admin

import com.atproto.repo.StrongRef
import kotlin.Any
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmInline
import kotlinx.collections.immutable.toImmutableList
import kotlinx.serialization.KSerializer
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import sh.christian.ozone.api.AtUri
import sh.christian.ozone.api.Cid
import sh.christian.ozone.api.Did
import sh.christian.ozone.api.model.ReadOnlyList
import sh.christian.ozone.api.runtime.valueClassSerializer

@Serializable
public sealed interface GetSubjectStatusResponseSubjectUnion {
  public class AdminRepoRefSerializer : KSerializer by valueClassSerializer(
    serialName = "com.atproto.admin.defs#repoRef",
    constructor = ::AdminRepoRef,
    valueProvider = AdminRepoRef::value,
    valueSerializerProvider = { RepoRef.serializer() },
  )

  @Serializable(with = AdminRepoRefSerializer::class)
  @JvmInline
  @SerialName("com.atproto.admin.defs#repoRef")
  public value class AdminRepoRef(
    public val `value`: RepoRef,
  ) : GetSubjectStatusResponseSubjectUnion

  public class RepoStrongRefSerializer : KSerializer by valueClassSerializer(
    serialName = "com.atproto.repo.strongRef",
    constructor = ::RepoStrongRef,
    valueProvider = RepoStrongRef::value,
    valueSerializerProvider = { StrongRef.serializer() },
  )

  @Serializable(with = RepoStrongRefSerializer::class)
  @JvmInline
  @SerialName("com.atproto.repo.strongRef")
  public value class RepoStrongRef(
    public val `value`: StrongRef,
  ) : GetSubjectStatusResponseSubjectUnion

  public class AdminRepoBlobRefSerializer : KSerializer by valueClassSerializer(
    serialName = "com.atproto.admin.defs#repoBlobRef",
    constructor = ::AdminRepoBlobRef,
    valueProvider = AdminRepoBlobRef::value,
    valueSerializerProvider = { RepoBlobRef.serializer() },
  )

  @Serializable(with = AdminRepoBlobRefSerializer::class)
  @JvmInline
  @SerialName("com.atproto.admin.defs#repoBlobRef")
  public value class AdminRepoBlobRef(
    public val `value`: RepoBlobRef,
  ) : GetSubjectStatusResponseSubjectUnion
}

@Serializable
public data class GetSubjectStatusQueryParams(
  public val did: Did? = null,
  public val uri: AtUri? = null,
  public val blob: Cid? = null,
) {
  public fun asList(): ReadOnlyList> = buildList {
    add("did" to did)
    add("uri" to uri)
    add("blob" to blob)
  }.toImmutableList()
}

@Serializable
public data class GetSubjectStatusResponse(
  public val subject: GetSubjectStatusResponseSubjectUnion,
  public val takedown: StatusAttr? = null,
  public val deactivated: StatusAttr? = null,
)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy