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

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

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

package tools.ozone.moderation

import com.atproto.admin.RepoRef
import com.atproto.repo.StrongRef
import kotlin.Suppress
import kotlin.jvm.JvmInline
import kotlinx.collections.immutable.persistentListOf
import kotlinx.serialization.KSerializer
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
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 EmitEventRequestEventUnion {
  public class ModEventTakedownSerializer : KSerializer by valueClassSerializer(
    serialName = "tools.ozone.moderation.defs#modEventTakedown",
    constructor = ::ModEventTakedown,
    valueProvider = ModEventTakedown::value,
    valueSerializerProvider = { tools.ozone.moderation.ModEventTakedown.serializer() },
  )

  @Serializable(with = ModEventTakedownSerializer::class)
  @JvmInline
  @SerialName("tools.ozone.moderation.defs#modEventTakedown")
  public value class ModEventTakedown(
    public val `value`: tools.ozone.moderation.ModEventTakedown,
  ) : EmitEventRequestEventUnion

  public class ModEventAcknowledgeSerializer : KSerializer by valueClassSerializer(
    serialName = "tools.ozone.moderation.defs#modEventAcknowledge",
    constructor = ::ModEventAcknowledge,
    valueProvider = ModEventAcknowledge::value,
    valueSerializerProvider = { tools.ozone.moderation.ModEventAcknowledge.serializer() },
  )

  @Serializable(with = ModEventAcknowledgeSerializer::class)
  @JvmInline
  @SerialName("tools.ozone.moderation.defs#modEventAcknowledge")
  public value class ModEventAcknowledge(
    public val `value`: tools.ozone.moderation.ModEventAcknowledge,
  ) : EmitEventRequestEventUnion

  public class ModEventEscalateSerializer : KSerializer by valueClassSerializer(
    serialName = "tools.ozone.moderation.defs#modEventEscalate",
    constructor = ::ModEventEscalate,
    valueProvider = ModEventEscalate::value,
    valueSerializerProvider = { tools.ozone.moderation.ModEventEscalate.serializer() },
  )

  @Serializable(with = ModEventEscalateSerializer::class)
  @JvmInline
  @SerialName("tools.ozone.moderation.defs#modEventEscalate")
  public value class ModEventEscalate(
    public val `value`: tools.ozone.moderation.ModEventEscalate,
  ) : EmitEventRequestEventUnion

  public class ModEventCommentSerializer : KSerializer by valueClassSerializer(
    serialName = "tools.ozone.moderation.defs#modEventComment",
    constructor = ::ModEventComment,
    valueProvider = ModEventComment::value,
    valueSerializerProvider = { tools.ozone.moderation.ModEventComment.serializer() },
  )

  @Serializable(with = ModEventCommentSerializer::class)
  @JvmInline
  @SerialName("tools.ozone.moderation.defs#modEventComment")
  public value class ModEventComment(
    public val `value`: tools.ozone.moderation.ModEventComment,
  ) : EmitEventRequestEventUnion

  public class ModEventLabelSerializer : KSerializer by valueClassSerializer(
    serialName = "tools.ozone.moderation.defs#modEventLabel",
    constructor = ::ModEventLabel,
    valueProvider = ModEventLabel::value,
    valueSerializerProvider = { tools.ozone.moderation.ModEventLabel.serializer() },
  )

  @Serializable(with = ModEventLabelSerializer::class)
  @JvmInline
  @SerialName("tools.ozone.moderation.defs#modEventLabel")
  public value class ModEventLabel(
    public val `value`: tools.ozone.moderation.ModEventLabel,
  ) : EmitEventRequestEventUnion

  public class ModEventReportSerializer : KSerializer by valueClassSerializer(
    serialName = "tools.ozone.moderation.defs#modEventReport",
    constructor = ::ModEventReport,
    valueProvider = ModEventReport::value,
    valueSerializerProvider = { tools.ozone.moderation.ModEventReport.serializer() },
  )

  @Serializable(with = ModEventReportSerializer::class)
  @JvmInline
  @SerialName("tools.ozone.moderation.defs#modEventReport")
  public value class ModEventReport(
    public val `value`: tools.ozone.moderation.ModEventReport,
  ) : EmitEventRequestEventUnion

  public class ModEventMuteSerializer : KSerializer by valueClassSerializer(
    serialName = "tools.ozone.moderation.defs#modEventMute",
    constructor = ::ModEventMute,
    valueProvider = ModEventMute::value,
    valueSerializerProvider = { tools.ozone.moderation.ModEventMute.serializer() },
  )

  @Serializable(with = ModEventMuteSerializer::class)
  @JvmInline
  @SerialName("tools.ozone.moderation.defs#modEventMute")
  public value class ModEventMute(
    public val `value`: tools.ozone.moderation.ModEventMute,
  ) : EmitEventRequestEventUnion

  public class ModEventUnmuteSerializer : KSerializer by valueClassSerializer(
    serialName = "tools.ozone.moderation.defs#modEventUnmute",
    constructor = ::ModEventUnmute,
    valueProvider = ModEventUnmute::value,
    valueSerializerProvider = { tools.ozone.moderation.ModEventUnmute.serializer() },
  )

  @Serializable(with = ModEventUnmuteSerializer::class)
  @JvmInline
  @SerialName("tools.ozone.moderation.defs#modEventUnmute")
  public value class ModEventUnmute(
    public val `value`: tools.ozone.moderation.ModEventUnmute,
  ) : EmitEventRequestEventUnion

  public class ModEventMuteReporterSerializer : KSerializer by valueClassSerializer(
    serialName = "tools.ozone.moderation.defs#modEventMuteReporter",
    constructor = ::ModEventMuteReporter,
    valueProvider = ModEventMuteReporter::value,
    valueSerializerProvider = { tools.ozone.moderation.ModEventMuteReporter.serializer() },
  )

  @Serializable(with = ModEventMuteReporterSerializer::class)
  @JvmInline
  @SerialName("tools.ozone.moderation.defs#modEventMuteReporter")
  public value class ModEventMuteReporter(
    public val `value`: tools.ozone.moderation.ModEventMuteReporter,
  ) : EmitEventRequestEventUnion

  public class ModEventUnmuteReporterSerializer : KSerializer by valueClassSerializer(
    serialName = "tools.ozone.moderation.defs#modEventUnmuteReporter",
    constructor = ::ModEventUnmuteReporter,
    valueProvider = ModEventUnmuteReporter::value,
    valueSerializerProvider = { tools.ozone.moderation.ModEventUnmuteReporter.serializer() },
  )

  @Serializable(with = ModEventUnmuteReporterSerializer::class)
  @JvmInline
  @SerialName("tools.ozone.moderation.defs#modEventUnmuteReporter")
  public value class ModEventUnmuteReporter(
    public val `value`: tools.ozone.moderation.ModEventUnmuteReporter,
  ) : EmitEventRequestEventUnion

  public class ModEventReverseTakedownSerializer : KSerializer by valueClassSerializer(
    serialName = "tools.ozone.moderation.defs#modEventReverseTakedown",
    constructor = ::ModEventReverseTakedown,
    valueProvider = ModEventReverseTakedown::value,
    valueSerializerProvider = { tools.ozone.moderation.ModEventReverseTakedown.serializer() },
  )

  @Serializable(with = ModEventReverseTakedownSerializer::class)
  @JvmInline
  @SerialName("tools.ozone.moderation.defs#modEventReverseTakedown")
  public value class ModEventReverseTakedown(
    public val `value`: tools.ozone.moderation.ModEventReverseTakedown,
  ) : EmitEventRequestEventUnion

  public class ModEventResolveAppealSerializer : KSerializer by valueClassSerializer(
    serialName = "tools.ozone.moderation.defs#modEventResolveAppeal",
    constructor = ::ModEventResolveAppeal,
    valueProvider = ModEventResolveAppeal::value,
    valueSerializerProvider = { tools.ozone.moderation.ModEventResolveAppeal.serializer() },
  )

  @Serializable(with = ModEventResolveAppealSerializer::class)
  @JvmInline
  @SerialName("tools.ozone.moderation.defs#modEventResolveAppeal")
  public value class ModEventResolveAppeal(
    public val `value`: tools.ozone.moderation.ModEventResolveAppeal,
  ) : EmitEventRequestEventUnion

  public class ModEventEmailSerializer : KSerializer by valueClassSerializer(
    serialName = "tools.ozone.moderation.defs#modEventEmail",
    constructor = ::ModEventEmail,
    valueProvider = ModEventEmail::value,
    valueSerializerProvider = { tools.ozone.moderation.ModEventEmail.serializer() },
  )

  @Serializable(with = ModEventEmailSerializer::class)
  @JvmInline
  @SerialName("tools.ozone.moderation.defs#modEventEmail")
  public value class ModEventEmail(
    public val `value`: tools.ozone.moderation.ModEventEmail,
  ) : EmitEventRequestEventUnion

  public class ModEventTagSerializer : KSerializer by valueClassSerializer(
    serialName = "tools.ozone.moderation.defs#modEventTag",
    constructor = ::ModEventTag,
    valueProvider = ModEventTag::value,
    valueSerializerProvider = { tools.ozone.moderation.ModEventTag.serializer() },
  )

  @Serializable(with = ModEventTagSerializer::class)
  @JvmInline
  @SerialName("tools.ozone.moderation.defs#modEventTag")
  public value class ModEventTag(
    public val `value`: tools.ozone.moderation.ModEventTag,
  ) : EmitEventRequestEventUnion

  public class AccountEventSerializer : KSerializer by valueClassSerializer(
    serialName = "tools.ozone.moderation.defs#accountEvent",
    constructor = ::AccountEvent,
    valueProvider = AccountEvent::value,
    valueSerializerProvider = { tools.ozone.moderation.AccountEvent.serializer() },
  )

  @Serializable(with = AccountEventSerializer::class)
  @JvmInline
  @SerialName("tools.ozone.moderation.defs#accountEvent")
  public value class AccountEvent(
    public val `value`: tools.ozone.moderation.AccountEvent,
  ) : EmitEventRequestEventUnion

  public class IdentityEventSerializer : KSerializer by valueClassSerializer(
    serialName = "tools.ozone.moderation.defs#identityEvent",
    constructor = ::IdentityEvent,
    valueProvider = IdentityEvent::value,
    valueSerializerProvider = { tools.ozone.moderation.IdentityEvent.serializer() },
  )

  @Serializable(with = IdentityEventSerializer::class)
  @JvmInline
  @SerialName("tools.ozone.moderation.defs#identityEvent")
  public value class IdentityEvent(
    public val `value`: tools.ozone.moderation.IdentityEvent,
  ) : EmitEventRequestEventUnion

  public class RecordEventSerializer : KSerializer by valueClassSerializer(
    serialName = "tools.ozone.moderation.defs#recordEvent",
    constructor = ::RecordEvent,
    valueProvider = RecordEvent::value,
    valueSerializerProvider = { tools.ozone.moderation.RecordEvent.serializer() },
  )

  @Serializable(with = RecordEventSerializer::class)
  @JvmInline
  @SerialName("tools.ozone.moderation.defs#recordEvent")
  public value class RecordEvent(
    public val `value`: tools.ozone.moderation.RecordEvent,
  ) : EmitEventRequestEventUnion
}

@Serializable
public sealed interface EmitEventRequestSubjectUnion {
  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,
  ) : EmitEventRequestSubjectUnion

  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,
  ) : EmitEventRequestSubjectUnion
}

@Serializable
public data class EmitEventRequest(
  public val event: EmitEventRequestEventUnion,
  public val subject: EmitEventRequestSubjectUnion,
  public val subjectBlobCids: ReadOnlyList = persistentListOf(),
  public val createdBy: Did,
)

public typealias EmitEventResponse = ModEventView




© 2015 - 2024 Weber Informatics LLC | Privacy Policy