setDataWithTtl

inline suspend fun <T : Any> SyncDocument.setDataWithTtl(data: T, ttl: <Error class: unknown class>)

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

Type T must be annotated with @Serializable.

Parameters

data

New document data.

ttl

Time to live from now or Duration.INFINITE to indicate no expiry.

Throws

SerializationException

If the given value cannot be serialized to JSON object.

TwilioException

When error occurred while updating the document.