InboxApi

expect class InboxApi constructor(connection: Connection, threadApi: ThreadApi? = null, storeApi: StoreApi? = null) : AutoCloseable

Manages PrivMX Bridge Inboxes and Entries.

Parameters

connection

active connection to PrivMX Bridge

threadApi

instance of ThreadApi created on passed Connection

storeApi

instance of StoreApi created on passed Connection

Throws

when one of the passed parameters is closed

actual class InboxApi constructor(connection: Connection, threadApi: ThreadApi?, storeApi: StoreApi?) : AutoCloseable

Manages PrivMX Bridge Inboxes and Entries.

Parameters

connection

active connection to PrivMX Bridge

threadApi

instance of ThreadApi created on passed Connection

storeApi

instance of StoreApi created on passed Connection

Throws

when one of the passed parameters is closed

actual class InboxApi @JvmOverloads constructor(connection: Connection, threadApi: ThreadApi?, storeApi: StoreApi?) : AutoCloseable

Manages PrivMX Bridge Inboxes and Entries.

Parameters

connection

active connection to PrivMX Bridge

threadApi

instance of ThreadApi created on passed Connection

storeApi

instance of StoreApi created on passed Connection

Throws

when one of the passed parameters is closed

Constructors

Link copied to clipboard
expect constructor(connection: Connection, threadApi: ThreadApi? = null, storeApi: StoreApi? = null)
actual constructor(connection: Connection, threadApi: ThreadApi?, storeApi: StoreApi?)
actual constructor(connection: Connection, threadApi: ThreadApi?, storeApi: StoreApi?)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
expect open override fun close()

Frees memory.

actual open override fun close()

Frees memory.

actual open override fun close()

Frees memory.

Link copied to clipboard
expect fun closeFile(fileHandle: Long): String

Closes a file by given handle.

actual fun closeFile(fileHandle: Long): String

Closes a file by given handle.

actual external fun closeFile(fileHandle: Long): String

Closes a file by given handle.

Link copied to clipboard
expect fun createFileHandle(publicMeta: ByteArray, privateMeta: ByteArray, fileSize: Long): Long?

Creates a file handle to send a file to an Inbox. You do not have to be logged in to call this function.

actual fun createFileHandle(publicMeta: ByteArray, privateMeta: ByteArray, fileSize: Long): Long?

Creates a file handle to send a file to an Inbox. You do not have to be logged in to call this function.

actual external fun createFileHandle(publicMeta: ByteArray, privateMeta: ByteArray, fileSize: Long): Long?

Creates a file handle to send a file to an Inbox. You do not have to be logged in to call this function.

Link copied to clipboard
expect fun createInbox(contextId: String, users: List<UserWithPubKey>, managers: List<UserWithPubKey>, publicMeta: ByteArray, privateMeta: ByteArray, filesConfig: FilesConfig? = null, policies: ContainerPolicyWithoutItem? = null): String

Creates a new Inbox.

actual fun createInbox(contextId: String, users: List<UserWithPubKey>, managers: List<UserWithPubKey>, publicMeta: ByteArray, privateMeta: ByteArray, filesConfig: FilesConfig?, policies: ContainerPolicyWithoutItem?): String

Creates a new Inbox.

actual external fun createInbox(contextId: String, users: List<UserWithPubKey>, managers: List<UserWithPubKey>, publicMeta: ByteArray, privateMeta: ByteArray, filesConfig: FilesConfig?, policies: ContainerPolicyWithoutItem?): String

Creates a new Inbox.

Link copied to clipboard
expect fun deleteEntry(inboxEntryId: String)

Deletes an entry from an Inbox.

actual fun deleteEntry(inboxEntryId: String)

Deletes an entry from an Inbox.

actual external fun deleteEntry(inboxEntryId: String)

Deletes an entry from an Inbox.

Link copied to clipboard
expect fun deleteInbox(inboxId: String)

Deletes an Inbox by given Inbox ID.

actual fun deleteInbox(inboxId: String)

Deletes an Inbox by given Inbox ID.

actual external fun deleteInbox(inboxId: String)

Deletes an Inbox by given Inbox ID.

Link copied to clipboard
expect fun getInbox(inboxId: String): Inbox

Gets a single Inbox by given Inbox ID.

actual fun getInbox(inboxId: String): Inbox

Gets a single Inbox by given Inbox ID.

actual external fun getInbox(inboxId: String): Inbox

Gets a single Inbox by given Inbox ID.

Link copied to clipboard

Gets public data of given Inbox. You do not have to be logged in to call this function.

Gets public data of given Inbox. You do not have to be logged in to call this function.

actual external fun getInboxPublicView(inboxId: String): InboxPublicView

Gets public data of given Inbox. You do not have to be logged in to call this function.

Link copied to clipboard
expect fun listEntries(inboxId: String, skip: Long, limit: Long, sortOrder: String = "desc", lastId: String? = null): PagingList<InboxEntry>

Gets list of entries of given Inbox.

actual fun listEntries(inboxId: String, skip: Long, limit: Long, sortOrder: String, lastId: String?): PagingList<InboxEntry>

Gets list of entries of given Inbox.

actual external fun listEntries(inboxId: String, skip: Long, limit: Long, sortOrder: String, lastId: String?): PagingList<InboxEntry>

Gets list of entries of given Inbox.

Link copied to clipboard
expect fun listInboxes(contextId: String, skip: Long, limit: Long, sortOrder: String = "desc", lastId: String? = null): PagingList<Inbox>

Gets a list of Inboxes in given Context.

actual fun listInboxes(contextId: String, skip: Long, limit: Long, sortOrder: String, lastId: String?): PagingList<Inbox>

Gets a list of Inboxes in given Context.

actual external fun listInboxes(contextId: String, skip: Long, limit: Long, sortOrder: String, lastId: String?): PagingList<Inbox>

Gets a list of Inboxes in given Context.

Link copied to clipboard
expect fun openFile(fileId: String): Long?

Opens a file to read.

actual fun openFile(fileId: String): Long?

Opens a file to read.

actual external fun openFile(fileId: String): Long?

Opens a file to read.

Link copied to clipboard
expect fun prepareEntry(inboxId: String, data: ByteArray, inboxFileHandles: List<Long> = emptyList(), userPrivKey: String? = null): Long?

Prepares a request to send data to an Inbox. You do not have to be logged in to call this function.

actual fun prepareEntry(inboxId: String, data: ByteArray, inboxFileHandles: List<Long>, userPrivKey: String?): Long?

Prepares a request to send data to an Inbox. You do not have to be logged in to call this function.

actual external fun prepareEntry(inboxId: String, data: ByteArray, inboxFileHandles: List<Long>, userPrivKey: String?): Long?

Prepares a request to send data to an Inbox. You do not have to be logged in to call this function.

Link copied to clipboard
expect fun readEntry(inboxEntryId: String): InboxEntry

Gets an entry from an Inbox.

actual fun readEntry(inboxEntryId: String): InboxEntry

Gets an entry from an Inbox.

actual external fun readEntry(inboxEntryId: String): InboxEntry

Gets an entry from an Inbox.

Link copied to clipboard
expect fun readFromFile(fileHandle: Long, length: Long): ByteArray

Reads file data.

actual fun readFromFile(fileHandle: Long, length: Long): ByteArray

Reads file data.

actual external fun readFromFile(fileHandle: Long, length: Long): ByteArray

Reads file data.

Link copied to clipboard
expect fun seekInFile(fileHandle: Long, position: Long)

Moves file's read cursor.

actual fun seekInFile(fileHandle: Long, position: Long)

Moves file's read cursor.

actual external fun seekInFile(fileHandle: Long, position: Long)

Moves file's read cursor.

Link copied to clipboard
expect fun sendEntry(inboxHandle: Long)

Sends data to an Inbox. You do not have to be logged in to call this function.

actual fun sendEntry(inboxHandle: Long)

Sends data to an Inbox. You do not have to be logged in to call this function.

actual external fun sendEntry(inboxHandle: Long)

Sends data to an Inbox. You do not have to be logged in to call this function.

Link copied to clipboard
expect fun subscribeForEntryEvents(inboxId: String)

Subscribes for events in given Inbox.

actual fun subscribeForEntryEvents(inboxId: String)

Subscribes for events in given Inbox.

actual external fun subscribeForEntryEvents(inboxId: String)

Subscribes for events in given Inbox.

Link copied to clipboard

Subscribes for the Inbox module main events.

Subscribes for the Inbox module main events.

actual external fun subscribeForInboxEvents()

Subscribes for the Inbox module main events.

Link copied to clipboard
expect fun unsubscribeFromEntryEvents(inboxId: String)

Unsubscribes from events in given Inbox.

actual fun unsubscribeFromEntryEvents(inboxId: String)

Unsubscribes from events in given Inbox.

actual external fun unsubscribeFromEntryEvents(inboxId: String)

Unsubscribes from events in given Inbox.

Link copied to clipboard

Subscribes for the Inbox module main events.

Subscribes for the Inbox module main events.

actual external fun unsubscribeFromInboxEvents()

Subscribes for the Inbox module main events.

Link copied to clipboard
expect fun updateInbox(inboxId: String, users: List<UserWithPubKey>, managers: List<UserWithPubKey>, publicMeta: ByteArray, privateMeta: ByteArray, filesConfig: FilesConfig? = null, version: Long, force: Boolean = false, forceGenerateNewKey: Boolean = false, policies: ContainerPolicyWithoutItem? = null)

Updates an existing Inbox.

actual fun updateInbox(inboxId: String, users: List<UserWithPubKey>, managers: List<UserWithPubKey>, publicMeta: ByteArray, privateMeta: ByteArray, filesConfig: FilesConfig?, version: Long, force: Boolean, forceGenerateNewKey: Boolean, policies: ContainerPolicyWithoutItem?)

Updates an existing Inbox.

actual external fun updateInbox(inboxId: String, users: List<UserWithPubKey>, managers: List<UserWithPubKey>, publicMeta: ByteArray, privateMeta: ByteArray, filesConfig: FilesConfig?, version: Long, force: Boolean, forceGenerateNewKey: Boolean, policies: ContainerPolicyWithoutItem?)

Updates an existing Inbox.

Link copied to clipboard
expect fun writeToFile(inboxHandle: Long, inboxFileHandle: Long, dataChunk: ByteArray)

Sends a file's data chunk to an Inbox. To send the entire file - divide it into pieces of the desired size and call the function for each fragment. You do not have to be logged in to call this function.

actual fun writeToFile(inboxHandle: Long, inboxFileHandle: Long, dataChunk: ByteArray)

Sends a file's data chunk to an Inbox. To send the entire file - divide it into pieces of the desired size and call the function for each fragment. You do not have to be logged in to call this function.

actual external fun writeToFile(inboxHandle: Long, inboxFileHandle: Long, dataChunk: ByteArray)

Sends a file's data chunk to an Inbox. To send the entire file - divide it into pieces of the desired size and call the function for each fragment. You do not have to be logged in to call this function.