commonMain.app.bsky.feed.SkeletonFeedPost.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bluesky Show documentation
Show all versions of bluesky Show documentation
Bluesky Social API bindings for Kotlin.
The newest version!
@file:Suppress("DEPRECATION")
package app.bsky.feed
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmInline
import kotlinx.serialization.KSerializer
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import sh.christian.ozone.api.AtUri
import sh.christian.ozone.api.runtime.valueClassSerializer
@Serializable
public sealed interface SkeletonFeedPostReasonUnion {
public class SkeletonReasonRepostSerializer : KSerializer by valueClassSerializer(
serialName = "app.bsky.feed.defs#skeletonReasonRepost",
constructor = ::SkeletonReasonRepost,
valueProvider = SkeletonReasonRepost::value,
valueSerializerProvider = { app.bsky.feed.SkeletonReasonRepost.serializer() },
)
@Serializable(with = SkeletonReasonRepostSerializer::class)
@JvmInline
@SerialName("app.bsky.feed.defs#skeletonReasonRepost")
public value class SkeletonReasonRepost(
public val `value`: app.bsky.feed.SkeletonReasonRepost,
) : SkeletonFeedPostReasonUnion
public class SkeletonReasonPinSerializer : KSerializer by valueClassSerializer(
serialName = "app.bsky.feed.defs#skeletonReasonPin",
constructor = ::SkeletonReasonPin,
valueProvider = SkeletonReasonPin::value,
valueSerializerProvider = { app.bsky.feed.SkeletonReasonPin.serializer() },
)
@Serializable(with = SkeletonReasonPinSerializer::class)
@JvmInline
@SerialName("app.bsky.feed.defs#skeletonReasonPin")
public value class SkeletonReasonPin(
public val `value`: app.bsky.feed.SkeletonReasonPin,
) : SkeletonFeedPostReasonUnion
}
/**
* @param feedContext Context that will be passed through to client and may be passed to feed
* generator back alongside interactions.
*/
@Serializable
public data class SkeletonFeedPost(
public val post: AtUri,
public val reason: SkeletonFeedPostReasonUnion? = null,
/**
* Context that will be passed through to client and may be passed to feed generator back
* alongside interactions.
*/
public val feedContext: String? = null,
) {
init {
require(feedContext == null || feedContext.count() <= 2_000) {
"feedContext.count() must be <= 2_000, but was ${feedContext?.count()}"
}
}
}