DataSync

interface DataSync

Entry point for the DataSync API, reached via pubnub.dataSync.

Functions

Link copied to clipboard
abstract fun createChannel(classVersion: Int, channelId: String? = null, className: String? = null, classLevel: PNDataSyncClassLevel? = null, status: String? = null, payload: Any? = null): CreateChannel

Create a DataSync channel.

Link copied to clipboard
abstract fun createEntity(className: String, classVersion: Int, classLevel: PNDataSyncClassLevel? = null, entityId: String? = null, status: String? = null, payload: Any? = null): CreateEntity

Create a DataSync entity.

Link copied to clipboard
abstract fun createMembership(channelId: String, userId: String, classVersion: Int, membershipId: String? = null, status: String? = null, payload: Any? = null): CreateMembership

Create a DataSync membership linking a Channel and a User.

Link copied to clipboard
abstract fun createRelationship(entityAId: String, entityBId: String, className: String, classVersion: Int, relationshipId: String? = null, status: String? = null, payload: Any? = null): CreateRelationship

Create a DataSync relationship linking two entities under a relationship class.

Link copied to clipboard
abstract fun createUser(classVersion: Int, userId: String? = null, className: String? = null, classLevel: PNDataSyncClassLevel? = null, status: String? = null, payload: Any? = null): CreateUser

Create a DataSync user.

Link copied to clipboard
abstract fun getChannel(channelId: String): GetChannel

Get a DataSync channel by its id.

Link copied to clipboard
abstract fun getChannels(className: String? = null, classVersion: Int? = null, classLevel: PNDataSyncClassLevel? = null, filterFast: String? = null, filter: String? = null, sort: List<PNDataSyncSortField> = emptyList(), limit: Int? = null, cursor: String? = null): GetChannels

List DataSync channels.

Link copied to clipboard
abstract fun getEntities(className: String, classVersion: Int? = null, classLevel: PNDataSyncClassLevel? = null, filterFast: String? = null, filter: String? = null, sort: List<PNDataSyncSortField> = emptyList(), limit: Int? = null, cursor: String? = null): GetEntities

List DataSync entities of a class.

Link copied to clipboard
abstract fun getEntity(entityId: String): GetEntity

Get a DataSync entity by its id.

Link copied to clipboard
abstract fun getMembership(membershipId: String): GetMembership

Get a DataSync membership by its id.

Link copied to clipboard
abstract fun getMemberships(channelId: String? = null, userId: String? = null, classVersion: Int? = null, filterFast: String? = null, filter: String? = null, sort: List<PNDataSyncSortField> = emptyList(), limit: Int? = null, cursor: String? = null): GetMemberships

List DataSync memberships, optionally filtered by channel and/or user.

Link copied to clipboard
abstract fun getRelationship(relationshipId: String): GetRelationship

Get a DataSync relationship by its id.

Link copied to clipboard
abstract fun getRelationships(className: String, entityAId: String? = null, entityBId: String? = null, classVersion: Int? = null, filterFast: String? = null, filter: String? = null, sort: List<PNDataSyncSortField> = emptyList(), limit: Int? = null, cursor: String? = null): GetRelationships

List DataSync relationships in a relationship class, optionally filtered by either end.

Link copied to clipboard
abstract fun getUser(userId: String): GetUser

Get a DataSync user by its id.

Link copied to clipboard
abstract fun getUsers(className: String? = null, classVersion: Int? = null, classLevel: PNDataSyncClassLevel? = null, filterFast: String? = null, filter: String? = null, sort: List<PNDataSyncSortField> = emptyList(), limit: Int? = null, cursor: String? = null): GetUsers

List DataSync users.

Link copied to clipboard
abstract fun removeChannel(channelId: String, ifMatch: String? = null): RemoveChannel

Remove a DataSync channel by its id.

Link copied to clipboard
abstract fun removeEntity(entityId: String, ifMatch: String? = null): RemoveEntity

Remove a DataSync entity by its id.

Link copied to clipboard
abstract fun removeMembership(membershipId: String, ifMatch: String? = null): RemoveMembership

Remove a DataSync membership by its id.

Link copied to clipboard
abstract fun removeRelationship(relationshipId: String, ifMatch: String? = null): RemoveRelationship

Remove a DataSync relationship by its id.

Link copied to clipboard
abstract fun removeUser(userId: String, ifMatch: String? = null): RemoveUser

Remove a DataSync user by its id.

Link copied to clipboard
abstract fun setChannel(channelId: String, classVersion: Int, status: String? = null, payload: Any? = null, ifMatch: String? = null): SetChannel

Replaces a channel in full.

Link copied to clipboard
abstract fun setEntity(entityId: String, classVersion: Int, status: String? = null, payload: Any? = null, ifMatch: String? = null): SetEntity

Replaces an entity in full.

Link copied to clipboard
abstract fun setMembership(membershipId: String, classVersion: Int, status: String? = null, payload: Any? = null, ifMatch: String? = null): SetMembership

Replaces a membership in full.

Link copied to clipboard
abstract fun setRelationship(relationshipId: String, classVersion: Int, status: String? = null, payload: Any? = null, ifMatch: String? = null): SetRelationship

Replaces a relationship in full.

Link copied to clipboard
abstract fun setUser(userId: String, classVersion: Int, status: String? = null, payload: Any? = null, ifMatch: String? = null): SetUser

Replaces a user in full.

Link copied to clipboard
abstract fun updateChannel(channelId: String, operations: List<PNJsonPatchOperation>, ifMatch: String? = null): UpdateChannel

Partially update a DataSync channel via JSON Patch (RFC-6902).

Link copied to clipboard
abstract fun updateEntity(entityId: String, operations: List<PNJsonPatchOperation>, ifMatch: String? = null): UpdateEntity

Partially update a DataSync entity via JSON Patch (RFC-6902).

Link copied to clipboard
abstract fun updateMembership(membershipId: String, operations: List<PNJsonPatchOperation>, ifMatch: String? = null): UpdateMembership

Partially update a DataSync membership via JSON Patch (RFC-6902).

Link copied to clipboard
abstract fun updateRelationship(relationshipId: String, operations: List<PNJsonPatchOperation>, ifMatch: String? = null): UpdateRelationship

Partially update a DataSync relationship via JSON Patch (RFC-6902).

Link copied to clipboard
abstract fun updateUser(userId: String, operations: List<PNJsonPatchOperation>, ifMatch: String? = null): UpdateUser

Partially update a DataSync user via JSON Patch (RFC-6902).