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.jvm.JvmInline
import kotlinx.collections.immutable.toImmutableList
import kotlinx.serialization.KSerializer
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import sh.christian.ozone.api.model.ReadOnlyList
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() },
  )

  @Serializable(with = LabelsSerializer::class)
  @JvmInline
  @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() },
  )

  @Serializable(with = InfoSerializer::class)
  @JvmInline
  @SerialName("com.atproto.label.subscribeLabels#info")
  public value class Info(
    public val `value`: SubscribeLabelsInfo,
  ) : 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(): ReadOnlyList> = buildList {
    add("cursor" to cursor)
  }.toImmutableList()
}

public typealias SubscribeLabelsMessage = SubscribeLabelsMessageUnion




© 2015 - 2024 Weber Informatics LLC | Privacy Policy