setItem

inline suspend fun <T : Any> SyncList.setItem(itemIndex: Long, itemData: T): SyncList.Item

Serializes the given value into an equivalent JsonObject using a serializer retrieved from reified type parameter and set it as value of the SyncList.Item.

Type T must be annotated with @Serializable.

Return

SyncList.Item which has been set.

Parameters

itemIndex

Index of the item to set.

itemData

Item data to set.

Throws

SerializationException

If the itemData cannot be serialized to JSON object.

TwilioException

When error occurred while updating the item.


inline suspend fun <T : Any> SyncMap.setItem(itemKey: String, itemData: T): SyncMap.Item

Serializes the given value into an equivalent JsonObject using a serializer retrieved from reified type parameter and set it as value of the SyncMap.Item.

Type T must be annotated with @Serializable.

Return

SyncMap.Item which has been set.

Parameters

itemKey

Key of the item to set.

itemData

Item data to set.

Throws

SerializationException

If the itemData cannot be serialized to JSON object.

TwilioException

When error occurred while updating the document.