commonMain.app.bsky.richtext.facet.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bluesky-jvm Show documentation
Show all versions of bluesky-jvm Show documentation
Bluesky Social API bindings for Kotlin.
The newest version!
@file:Suppress("DEPRECATION")
package app.bsky.richtext
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.ReadOnlyList
import sh.christian.ozone.api.runtime.valueClassSerializer
@Serializable
public sealed interface FacetFeatureUnion {
public class MentionSerializer : KSerializer by valueClassSerializer(
serialName = "app.bsky.richtext.facet#mention",
constructor = ::Mention,
valueProvider = Mention::value,
valueSerializerProvider = { FacetMention.serializer() },
)
@Serializable(with = MentionSerializer::class)
@JvmInline
@SerialName("app.bsky.richtext.facet#mention")
public value class Mention(
public val `value`: FacetMention,
) : FacetFeatureUnion
public class LinkSerializer : KSerializer by valueClassSerializer(
serialName = "app.bsky.richtext.facet#link",
constructor = ::Link,
valueProvider = Link::value,
valueSerializerProvider = { FacetLink.serializer() },
)
@Serializable(with = LinkSerializer::class)
@JvmInline
@SerialName("app.bsky.richtext.facet#link")
public value class Link(
public val `value`: FacetLink,
) : FacetFeatureUnion
public class TagSerializer : KSerializer by valueClassSerializer(
serialName = "app.bsky.richtext.facet#tag",
constructor = ::Tag,
valueProvider = Tag::value,
valueSerializerProvider = { FacetTag.serializer() },
)
@Serializable(with = TagSerializer::class)
@JvmInline
@SerialName("app.bsky.richtext.facet#tag")
public value class Tag(
public val `value`: FacetTag,
) : FacetFeatureUnion
}
/**
* Annotation of a sub-string within rich text.
*/
@Serializable
public data class Facet(
public val index: FacetByteSlice,
public val features: ReadOnlyList,
)