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

commonMain.app.bsky.embed.recordWithMediaView.kt Maven / Gradle / Ivy

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

package app.bsky.embed

import kotlin.Suppress
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 RecordWithMediaViewMediaUnion {
  public class ImagesViewSerializer : KSerializer by valueClassSerializer(
    serialName = "app.bsky.embed.images#view",
    constructor = ::ImagesView,
    valueProvider = ImagesView::value,
    valueSerializerProvider = { app.bsky.embed.ImagesView.serializer() },
  )

  @JvmInline
  @Serializable(with = ImagesViewSerializer::class)
  @SerialName("app.bsky.embed.images#view")
  public value class ImagesView(
    public val `value`: app.bsky.embed.ImagesView,
  ) : RecordWithMediaViewMediaUnion

  public class VideoViewSerializer : KSerializer by valueClassSerializer(
    serialName = "app.bsky.embed.video#view",
    constructor = ::VideoView,
    valueProvider = VideoView::value,
    valueSerializerProvider = { app.bsky.embed.VideoView.serializer() },
  )

  @JvmInline
  @Serializable(with = VideoViewSerializer::class)
  @SerialName("app.bsky.embed.video#view")
  public value class VideoView(
    public val `value`: app.bsky.embed.VideoView,
  ) : RecordWithMediaViewMediaUnion

  public class ExternalViewSerializer : KSerializer by valueClassSerializer(
    serialName = "app.bsky.embed.external#view",
    constructor = ::ExternalView,
    valueProvider = ExternalView::value,
    valueSerializerProvider = { app.bsky.embed.ExternalView.serializer() },
  )

  @JvmInline
  @Serializable(with = ExternalViewSerializer::class)
  @SerialName("app.bsky.embed.external#view")
  public value class ExternalView(
    public val `value`: app.bsky.embed.ExternalView,
  ) : RecordWithMediaViewMediaUnion

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

@Serializable
public data class RecordWithMediaView(
  public val record: RecordView,
  public val media: RecordWithMediaViewMediaUnion,
)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy