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

commonMain.com.atproto.label.subscribeLabels.kt Maven / Gradle / Ivy

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

package com.atproto.label

import kotlin.Any
import kotlin.Long
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.model.JsonContent
import sh.christian.ozone.api.runtime.valueClassSerializer

@Serializable
public sealed interface SubscribeLabelsMessageUnion {
  public class LabelsSerializer : KSerializer by valueClassSerializer(
    serialName = "com.atproto.label.subscribeLabels#labels",
    constructor = ::Labels,
    valueProvider = Labels::value,
    valueSerializerProvider = { SubscribeLabelsLabels.serializer() },
  )

  @JvmInline
  @Serializable(with = LabelsSerializer::class)
  @SerialName("com.atproto.label.subscribeLabels#labels")
  public value class Labels(
    public val `value`: SubscribeLabelsLabels,
  ) : SubscribeLabelsMessageUnion

  public class InfoSerializer : KSerializer by valueClassSerializer(
    serialName = "com.atproto.label.subscribeLabels#info",
    constructor = ::Info,
    valueProvider = Info::value,
    valueSerializerProvider = { SubscribeLabelsInfo.serializer() },
  )

  @JvmInline
  @Serializable(with = InfoSerializer::class)
  @SerialName("com.atproto.label.subscribeLabels#info")
  public value class Info(
    public val `value`: SubscribeLabelsInfo,
  ) : SubscribeLabelsMessageUnion

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

/**
 * @param cursor The last known event seq number to backfill from.
 */
@Serializable
public data class SubscribeLabelsQueryParams(
  /**
   * The last known event seq number to backfill from.
   */
  public val cursor: Long? = null,
) {
  public fun asList(): List> = buildList {
    add("cursor" to cursor)
  }
}

public typealias SubscribeLabelsMessage = SubscribeLabelsMessageUnion




© 2015 - 2024 Weber Informatics LLC | Privacy Policy