Class ThreadApi
public class ThreadApi : IThreadApi
- Inheritance
-
ThreadApi
- Implements
- Inherited Members
Fields
ptr
public readonly IntPtr ptr
Field Value
Methods
Create(Connection)
Creates an instance of the ThreadApi.
public static ThreadApi Create(Connection connection)
Parameters
connectionConnectionInstance of Connection
Returns
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
contextIdstringID of the Context to create the Thread in.
usersList<UserWithPubKey>Array of UserWithPubKey which indicates who will have access to the created Thread.
managersList<UserWithPubKey>Array of UserWithPubKey which indicates who will have access (and management rights) to the created Thread.
publicMetabyte[]Public metadata that will remain unencrypted on the Bridge.
privateMetabyte[]Private metadata that will be encrypted before being sent to the Bridge.
policiesContainerPolicy(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
messageIdstringID of the message to delete.
DeleteThread(string)
Deletes a Thread by given Thread ID.
public void DeleteThread(string threadId)
Parameters
threadIdstringID of the Thread to delete.
~ThreadApi()
protected ~ThreadApi()
GetMessage(string)
Gets a message by given message ID.
public Message GetMessage(string messageId)
Parameters
messageIdstringID of the message to get.
Returns
- Message
Message.
GetThread(string)
Gets a Thread by given Thread ID.
public Thread GetThread(string threadId)
Parameters
threadIdstringID 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
threadIdstringID of the Thread to list messages from.
pagingQueryPagingQueryList 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
contextIdstringID of the Context to get the Threads from.
pagingQueryPagingQueryList 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
threadIdstringID of the Thread to send message to.
publicMetabyte[]Public message metadata.
privateMetabyte[]Private message metadata.
databyte[]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
threadIdstringID 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
threadIdstringID 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
messageIdstringID of the message to update.
publicMetabyte[]Public message metadata.
privateMetabyte[]Private message metadata.
databyte[]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
threadIdstringID of the Thread to update.
usersList<UserWithPubKey>Array of UserWithPubKey structs which indicates who will have access to the created Thread.
managersList<UserWithPubKey>Array of UserWithPubKey structs which indicates who will have access (and management rights) to the created Thread.
publicMetabyte[]Public metadata that will remain unencrypted on the Bridge.
privateMetabyte[]Private metadata that will be encrypted before being sent to the Bridge.
versionlongCurrent version of the updated Thread.
forceboolForce update (without checking version).
forceGenerateNewKeyboolForce to regenerate a key for the Thread.
policiesContainerPolicy(optional) Thread policy.