ThreadApi
‘ThreadApi’ is a class representing Endpoint’s API for Threads and their messages.
Static Methods
create(connection:)
Creates an instance of ‘ThreadApi’.
Params
connection
inout Connection
instance of ‘Connection’
Returns
ThreadApi ·
ThreadApi object
Methods
createThread(contextId:users:managers:publicMeta:privateMeta:policies:)
Creates a new Thread in given Context.
Params
contextId
std.string
ID of the Context to create the Thread in
users
privmx.UserWithPubKeyVector
vector of UserWithPubKey structs which indicates who will have access to the created Thread
managers
privmx.UserWithPubKeyVector
vector of UserWithPubKey structs which indicates who will have access (and management rights) to the created Thread
publicMeta
privmx.endpoint.core.Buffer
public (unencrypted) metadata
privateMeta
privmx.endpoint.core.Buffer
private (encrypted) metadata
policies
privmx.endpoint.core.ContainerPolicy?
Thread’s policies
Returns
std.string ·
ID of the created Thread
getThread(threadId:)
Gets a Thread by given Thread ID.
Params
threadId
std.string
ID of Thread to get
Returns
privmx.endpoint.thread.Thread ·
Thread struct containing info about the Thread
updateThread(threadId:version:users:managers:publicMeta:privateMeta:force:forceGenerateNewKey:policies:)
Updates an existing Thread.
Params
threadId
std.string
ID of the Thread to update
version
Int64
vector of UserWithPubKey structs which indicates who will have access to the created Thread
users
privmx.UserWithPubKeyVector
vector of UserWithPubKey structs which indicates who will have access (and management rights) to
managers
privmx.UserWithPubKeyVector
public (unencrypted) metadata
publicMeta
privmx.endpoint.core.Buffer
private (encrypted) metadata
privateMeta
privmx.endpoint.core.Buffer
current version of the updated Thread
force
Bool
force update (without checking version)
forceGenerateNewKey
Bool
force to regenerate a key for the Thread
policies
privmx.endpoint.core.ContainerPolicy?
Thread’s policies
deleteThread(threadId:)
Deletes a Thread by given Thread ID.
Params
threadId
std.string
ID of the Thread to delete
listThreads(contextId:pagingQuery:)
Gets a list of Threads in given Context.
Params
contextId
std.string
ID of the Context to get the Threads from
pagingQuery
privmx.endpoint.core.PagingQuery
struct with list query parameters
Returns
privmx.ThreadList ·
struct containing a list of Threads
listThreads(contextId:query:)
Params
contextId
std.string
query
privmx.endpoint.core.PagingQuery
Returns
privmx.ThreadList ·
sendMessage(threadId:publicMeta:privateMeta:data:)
Sends a message in a Thread.
Params
threadId
std.string
ID of the Thread to send message to
publicMeta
privmx.endpoint.core.Buffer
public message metadata
privateMeta
privmx.endpoint.core.Buffer
private message metadata
data
privmx.endpoint.core.Buffer
content of the message
Returns
std.string ·
ID of the new message
deleteMessage(_:)
Deletes a message by given message ID.
Params
messageId
std.string
ID of the message to delete
getMessage(_:)
Gets a message by given message ID.
Params
messageId
std.string
of the message to get
Returns
privmx.endpoint.thread.Message ·
struct containing the message
listMessages(threadId:pagingQuery:)
Gets a list of messages from a Thread.
Params
threadId
std.string
ID of the Thread to list messages from
pagingQuery
privmx.endpoint.core.PagingQuery
struct with list query parameters
Returns
privmx.MessageList ·
struct containing a list of messages
listMessages(threadId:query:)
Params
threadId
std.string
query
privmx.endpoint.core.PagingQuery
Returns
privmx.MessageList ·
updateMessage(messageId:publicMeta:privateMeta:data:)
Update message in a Thread.
Params
messageId
std.string
ID of the message to update
publicMeta
privmx.endpoint.core.Buffer
public message metadata
privateMeta
privmx.endpoint.core.Buffer
private message metadata
data
privmx.endpoint.core.Buffer
content of the message
subscribeFor(subscriptionQueries:)
Subscribe for the Thread events on the given subscription query.
Params
subscriptionQueries
privmx.SubscriptionQueryVector
list of queries
Returns
privmx.SubscriptionIdVector ·
list of subscriptionIds in maching order to subscriptionQueries
unsubscribeFrom(subscriptionIds:)
Unsubscribe from events for the given subscriptionId.
Params
subscriptionIds
privmx.SubscriptionIdVector
list of subscriptionId
buildSubscriptionQuery(eventType:selectorType:selectorId:)
Generate subscription Query for the Thread events.
Params
eventType
privmx.endpoint.thread.EventType
type of event which you listen for
selectorType
privmx.endpoint.thread.EventSelectorType
scope on which you listen for events
selectorId
std.string
ID of the selector
Returns
privmx.SubscriptionQuery ·
a properly formatted event subscription request.
We use cookies on our website. We use them to ensure the proper functioning of the site and, if you agree, for purposes we set, such as analytics or marketing.