Table of Contents

Class ThreadApi

Namespace
PrivMX.Endpoint.Thread
Assembly
PrivMX.Endpoint.dll
public class ThreadApi : IThreadApi
Inheritance
ThreadApi
Implements
Inherited Members

Fields

ptr

public readonly IntPtr ptr

Field Value

IntPtr

Methods

Create(Connection)

Creates an instance of the ThreadApi.

public static ThreadApi Create(Connection connection)

Parameters

connection Connection

Instance of Connection

Returns

ThreadApi

Created instance of the ThreadApi.

CreateThread(string, List<UserWithPubKey>, List<UserWithPubKey>, byte[], byte[], ContainerPolicy?)

Creates new Thread in given Context.

public string CreateThread(string contextId, List<UserWithPubKey> users, List<UserWithPubKey> managers, byte[] publicMeta, byte[] privateMeta, ContainerPolicy? policies = null)

Parameters

contextId string

ID of the Context to create the Thread in.

users List<UserWithPubKey>

Array of UserWithPubKey which indicates who will have access to the created Thread.

managers List<UserWithPubKey>

Array of UserWithPubKey which indicates who will have access (and management rights) to the created Thread.

publicMeta byte[]

Public metadata that will remain unencrypted on the Bridge.

privateMeta byte[]

Private metadata that will be encrypted before being sent to the Bridge.

policies ContainerPolicy

(optional) Thread policy.

Returns

string

ID of the created Thread.

DeleteMessage(string)

Deletes a message by given message ID.

public void DeleteMessage(string messageId)

Parameters

messageId string

ID of the message to delete.

DeleteThread(string)

Deletes a Thread by given Thread ID.

public void DeleteThread(string threadId)

Parameters

threadId string

ID of the Thread to delete.

~ThreadApi()

protected ~ThreadApi()

GetMessage(string)

Gets a message by given message ID.

public Message GetMessage(string messageId)

Parameters

messageId string

ID of the message to get.

Returns

Message

Message.

GetThread(string)

Gets a Thread by given Thread ID.

public Thread GetThread(string threadId)

Parameters

threadId string

ID of Thread to get.

Returns

Thread

Information about about the Thread.

ListMessages(string, PagingQuery)

Gets a list of messages from a Thread.

public PagingList<Message> ListMessages(string threadId, PagingQuery pagingQuery)

Parameters

threadId string

ID of the Thread to list messages from.

pagingQuery PagingQuery

List query parameters.

Returns

PagingList<Message>

List of messages.

ListThreads(string, PagingQuery)

Gets a list of Threads in given Context.

public PagingList<Thread> ListThreads(string contextId, PagingQuery pagingQuery)

Parameters

contextId string

ID of the Context to get the Threads from.

pagingQuery PagingQuery

List query parameters.

Returns

PagingList<Thread>

List of Threads.

SendMessage(string, byte[], byte[], byte[])

Sends a message in a Thread.

public string SendMessage(string threadId, byte[] publicMeta, byte[] privateMeta, byte[] data)

Parameters

threadId string

ID of the Thread to send message to.

publicMeta byte[]

Public message metadata.

privateMeta byte[]

Private message metadata.

data byte[]

Content of the message.

Returns

string

ID of the new message.

SubscribeForMessageEvents(string)

Subscribes for the events in given Thread.

public void SubscribeForMessageEvents(string threadId)

Parameters

threadId string

ID of the Thread to subscribe for.

SubscribeForThreadEvents()

Subscribes for the Thread module main events.

public void SubscribeForThreadEvents()

UnsubscribeFromMessageEvents(string)

Unsubscribes from events in given Thread.

public void UnsubscribeFromMessageEvents(string threadId)

Parameters

threadId string

ID of the Thread to unsubscribe from.

UnsubscribeFromThreadEvents()

Unsubscribes from the Thread module main events.

public void UnsubscribeFromThreadEvents()

UpdateMessage(string, byte[], byte[], byte[])

Updates a message in a Thread.

public void UpdateMessage(string messageId, byte[] publicMeta, byte[] privateMeta, byte[] data)

Parameters

messageId string

ID of the message to update.

publicMeta byte[]

Public message metadata.

privateMeta byte[]

Private message metadata.

data byte[]

Content of the message.

UpdateThread(string, List<UserWithPubKey>, List<UserWithPubKey>, byte[], byte[], long, bool, bool, ContainerPolicy?)

Updates an existing Thread.

public void UpdateThread(string threadId, List<UserWithPubKey> users, List<UserWithPubKey> managers, byte[] publicMeta, byte[] privateMeta, long version, bool force, bool forceGenerateNewKey, ContainerPolicy? policies = null)

Parameters

threadId string

ID of the Thread to update.

users List<UserWithPubKey>

Array of UserWithPubKey structs which indicates who will have access to the created Thread.

managers List<UserWithPubKey>

Array of UserWithPubKey structs which indicates who will have access (and management rights) to the created Thread.

publicMeta byte[]

Public metadata that will remain unencrypted on the Bridge.

privateMeta byte[]

Private metadata that will be encrypted before being sent to the Bridge.

version long

Current version of the updated Thread.

force bool

Force update (without checking version).

forceGenerateNewKey bool

Force to regenerate a key for the Thread.

policies ContainerPolicy

(optional) Thread policy.