addItemWithTtl

inline suspend fun <T : Any> SyncList.addItemWithTtl(itemData: T, ttl: <Error class: unknown class>): SyncList.Item

Serializes the given value into an equivalent JsonObject using a serializer retrieved from reified type parameter and adds it as a new item to the end of the SyncList with a specified TTL.

Type T must be annotated with @Serializable.

Return

SyncList.Item which has been added.

Parameters

itemData

Item data to add.

ttl

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

Throws

SerializationException

If the itemData cannot be serialized to JSON object.

TwilioException

When error occurred while adding the item.