Serializer

Functions

Link copied to clipboard
abstract fun beginList(descriptor: SdkFieldDescriptor): ListSerializer

Begin a list (i.e. in JSON this would be a '[') and return a ListSerializer that can be used to serialize the list's elements.

Link copied to clipboard
abstract fun beginMap(descriptor: SdkFieldDescriptor): MapSerializer

Begin a map (i.e. in JSON this would be a '{') and return a MapSerializer that can be used to serialize the map's entries.

Link copied to clipboard

Begin a struct (i.e. in JSON this would be a '{') and return a StructSerializer that can be used to serialize the struct's fields.

Link copied to clipboard
abstract fun toByteArray(): ByteArray

Consume the serializer and get the payload as a ByteArray

Inherited functions

Link copied to clipboard
abstract fun serializeBigDecimal(value: <Error class: unknown class>)

Serializes the given value.

Link copied to clipboard
abstract fun serializeBigInteger(value: <Error class: unknown class>)

Serializes the given value.

Link copied to clipboard
abstract fun serializeBoolean(value: Boolean)

Serializes the given value.

Link copied to clipboard
abstract fun serializeByte(value: Byte)

Serializes the given value.

Link copied to clipboard
abstract fun serializeByteArray(value: ByteArray)

Serializes the given value.

Link copied to clipboard
abstract fun serializeChar(value: Char)

Serializes the given value.

Link copied to clipboard
abstract fun serializeDocument(value: <Error class: unknown class>?)

Serializes the given value.

Link copied to clipboard
abstract fun serializeDouble(value: Double)

Serializes the given value.

Link copied to clipboard
abstract fun serializeFloat(value: Float)

Serializes the given value.

Link copied to clipboard
abstract fun serializeInstant(value: <Error class: unknown class>, format: <Error class: unknown class>)

Serializes the given value.

Link copied to clipboard
abstract fun serializeInt(value: Int)

Serializes the given value.

Link copied to clipboard
inline fun Serializer.serializeList(sdkFieldDescriptor: SdkFieldDescriptor, crossinline block: ListSerializer.() -> Unit)

All elements of a list are expected to be serialized in the given block.

Link copied to clipboard
abstract fun serializeLong(value: Long)

Serializes the given value.

Link copied to clipboard
inline fun Serializer.serializeMap(sdkFieldDescriptor: SdkFieldDescriptor, crossinline block: MapSerializer.() -> Unit)

All entries of a map are expected to be serialized in the given block.

Link copied to clipboard
abstract fun serializeNull()

Serializes the given value.

Link copied to clipboard

Calls the serialize method on the given object.

Link copied to clipboard
abstract fun serializeShort(value: Short)

Serializes the given value.

Link copied to clipboard
abstract fun serializeString(value: String)

Serializes the given value.

Link copied to clipboard
inline fun Serializer.serializeStruct(sdkFieldDescriptor: SdkFieldDescriptor, crossinline block: StructSerializer.() -> Unit)

All components of a struct are expected to be serialized in the given block.