PNDataSyncEventMessage

Sealed hierarchy of DataSync realtime change events.

There is one Set leaf (carrying the full current snapshot) and one Delete leaf (carrying only {id, deletedAt}) per DataSync element type, plus PNUnknownDataSyncEventMessage for forward-compatibility. Because the backend type set can grow in a future server version, an exhaustive when over this hierarchy must include an else / PNUnknownDataSyncEventMessage branch — that is what keeps future server-side additions non-breaking.

The verb of the event is not uniform across leaves and so is not declared here: the PNSet… leaves carry an event: PNDataSyncSetEventType (CREATE or UPDATE); the PNDelete… leaves have no event (the leaf class itself is the delete); and PNUnknownDataSyncEventMessage keeps the raw wire event string.

Inheritors

Properties

Link copied to clipboard
abstract val classLevel: String?

the level at which the class is defined (e.g. SubKey / Global). Modeled as a nullable String rather than an enum to stay source-compatible with future values.

Link copied to clipboard
abstract val className: String?

the object's class name, if present on the envelope.

Link copied to clipboard
abstract val classVersion: Int?

the object's class version, if present on the envelope.

Link copied to clipboard
abstract val source: String

event source, always "data-sync".

Link copied to clipboard
abstract val type: String

the wire discriminator: one of user, channel, entity, relationship, membership (an inheritance-aware value derived by the backend from the object's Global ancestor).

Link copied to clipboard
abstract val version: String

envelope version.