StoryblokClientImpl

class StoryblokClientImpl(apiBuilder: Api.Config.Content.() -> Unit, serializersModuleBuilder: SerializersModuleBuilder.() -> Unit, jsonBuilder: JsonBuilder.() -> Unit, val json: Json = Json { isLenient = true decodeEnumsCaseInsensitive = true classDiscriminator = "component" serializersModule = SerializersModule { polymorphic(Component::class) { defaultDeserializer { serializer<Component.Unknown>() } } serializersModuleBuilder() } jsonBuilder() }, val http: HttpClient = HttpClient { install(ContentNegotiation) { json(json) } install(Storyblok(Api.CDN), apiBuilder) }) : StoryblokClient(source)

Constructors

Link copied to clipboard
constructor(apiBuilder: Api.Config.Content.() -> Unit, serializersModuleBuilder: SerializersModuleBuilder.() -> Unit, jsonBuilder: JsonBuilder.() -> Unit, json: Json = Json { isLenient = true decodeEnumsCaseInsensitive = true classDiscriminator = "component" serializersModule = SerializersModule { polymorphic(Component::class) { defaultDeserializer { serializer<Component.Unknown>() } } serializersModuleBuilder() } jsonBuilder() }, http: HttpClient = HttpClient { install(ContentNegotiation) { json(json) } install(Storyblok(Api.CDN), apiBuilder) })

Properties

Link copied to clipboard
open override val http: HttpClient

The underlying Ktor HTTP client.

Link copied to clipboard
val json: Json
Link copied to clipboard

Functions

Link copied to clipboard
open override fun close()

Closes the underlying HTTP client and releases resources.

Link copied to clipboard
open override fun story(slug: String): Flow<Story<Component>>

Retrieves a Story by its slug.

open override fun story(uuid: Uuid): Flow<Story<Component>>

Retrieves a Story by its UUID.

open override fun <T : Component> story(slug: String, typeInfo: TypeInfo): Flow<Story<T>>

Retrieves a Story by its slug with explicit type information for the Component type.

open override fun <T : Component> story(uuid: Uuid, typeInfo: TypeInfo): Flow<Story<T>>

Retrieves a Story by its UUID with explicit type information for the Component type.

Link copied to clipboard
inline fun <T : Component> StoryblokClient.story(slug: String): Flow<Story<T>>

Retrieves a Story by its slug using reified type information for the Component type.

inline fun <T : Component> StoryblokClient.story(uuid: Uuid): Flow<Story<T>>

Retrieves a Story by its UUID using reified type information for the Component type.