setMapItemWithTtl

inline suspend fun <T : Any> Maps.setMapItemWithTtl(mapSidOrUniqueName: String, itemKey: String, itemData: T, ttl: <Error class: unknown class>): 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 without opening the map.

Type T must be annotated with @Serializable.

Return

SyncMap.Item which has been set.

Parameters

mapSidOrUniqueName

SID or unique name of existing SyncMap.

itemKey

Key of the item to set.

itemData

Item data to set.

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 item.