#include <privmx/endpoint/thread/ThreadApi.hpp>
|
| | ThreadApi () |
|
| ThreadApi (const ThreadApi &obj) |
|
ThreadApi & | operator= (const ThreadApi &obj) |
|
| ThreadApi (ThreadApi &&obj) |
| std::string | createThread (const std::string &contextId, const std::vector< core::UserWithPubKey > &users, const std::vector< core::UserWithPubKey > &managers, const core::Buffer &publicMeta, const core::Buffer &privateMeta, const std::optional< core::ContainerPolicy > &policies=std::nullopt) |
| void | updateThread (const std::string &threadId, const std::vector< core::UserWithPubKey > &users, const std::vector< core::UserWithPubKey > &managers, const core::Buffer &publicMeta, const core::Buffer &privateMeta, const int64_t version, const bool force, const bool forceGenerateNewKey, const std::optional< core::ContainerPolicy > &policies=std::nullopt) |
| void | deleteThread (const std::string &threadId) |
| Thread | getThread (const std::string &threadId) |
| core::PagingList< Thread > | listThreads (const std::string &contextId, const core::PagingQuery &pagingQuery) |
| Message | getMessage (const std::string &messageId) |
| core::PagingList< Message > | listMessages (const std::string &threadId, const core::PagingQuery &pagingQuery) |
| std::string | sendMessage (const std::string &threadId, const core::Buffer &publicMeta, const core::Buffer &privateMeta, const core::Buffer &data) |
| void | deleteMessage (const std::string &messageId) |
| void | updateMessage (const std::string &messageId, const core::Buffer &publicMeta, const core::Buffer &privateMeta, const core::Buffer &data) |
| std::vector< std::string > | subscribeFor (const std::vector< std::string > &subscriptionQueries) |
| void | unsubscribeFrom (const std::vector< std::string > &subscriptionIds) |
| std::string | buildSubscriptionQuery (EventType eventType, EventSelectorType selectorType, const std::string &selectorId) |
|
ExtendedPointer & | operator= (const ExtendedPointer &obj) |
|
std::shared_ptr< ThreadApiImpl > | getImpl () const |
|
|
void | attachToPtrIfPossible () |
|
void | detachFromPtrIfPossible () |
|
std::weak_ptr< ThreadApiImpl > | _ptr |
'ThreadApi' is a class representing Endpoint's API for Threads and their messages.
◆ ThreadApi()
| privmx::endpoint::thread::ThreadApi::ThreadApi |
( |
| ) |
|
◆ buildSubscriptionQuery()
| std::string privmx::endpoint::thread::ThreadApi::buildSubscriptionQuery |
( |
EventType | eventType, |
|
|
EventSelectorType | selectorType, |
|
|
const std::string & | selectorId ) |
Generate subscription Query for the Thread events.
- Parameters
-
| eventType | type of event which you listen for |
| selectorType | scope on which you listen for events
|
| selectorId | ID of the selector |
◆ create()
Creates an instance of 'ThreadApi'.
- Parameters
-
| connection | instance of 'Connection' |
- Returns
- ThreadApi object
◆ createThread()
Creates a new Thread in given Context.
- Parameters
-
| contextId | ID of the Context to create the Thread in |
| users | vector of UserWithPubKey structs which indicates who will have access to the created Thread |
| managers | vector of UserWithPubKey structs which indicates who will have access (and management rights) to the created Thread |
| publicMeta | public (unencrypted) metadata |
| privateMeta | private (encrypted) metadata |
| policies | Thread's policies |
- Returns
- ID of the created Thread
◆ deleteMessage()
| void privmx::endpoint::thread::ThreadApi::deleteMessage |
( |
const std::string & | messageId | ) |
|
Deletes a message by given message ID.
- Parameters
-
| messageId | ID of the message to delete |
◆ deleteThread()
| void privmx::endpoint::thread::ThreadApi::deleteThread |
( |
const std::string & | threadId | ) |
|
◆ getMessage()
| Message privmx::endpoint::thread::ThreadApi::getMessage |
( |
const std::string & | messageId | ) |
|
Gets a message by given message ID.
- Parameters
-
- Returns
- struct containing the message
◆ getThread()
| Thread privmx::endpoint::thread::ThreadApi::getThread |
( |
const std::string & | threadId | ) |
|
◆ listMessages()
Gets a list of messages from a Thread.
- Parameters
-
| threadId | ID of the Thread to list messages from |
| pagingQuery | struct with list query parameters |
- Returns
- struct containing a list of messages
◆ listThreads()
Gets a list of Threads in given Context.
- Parameters
-
| contextId | ID of the Context to get the Threads from |
| pagingQuery | struct with list query parameters |
- Returns
- struct containing a list of Threads
◆ sendMessage()
| std::string privmx::endpoint::thread::ThreadApi::sendMessage |
( |
const std::string & | threadId, |
|
|
const core::Buffer & | publicMeta, |
|
|
const core::Buffer & | privateMeta, |
|
|
const core::Buffer & | data ) |
Sends a message in a Thread.
- Parameters
-
| threadId | ID of the Thread to send message to |
| publicMeta | public message metadata |
| privateMeta | private message metadata |
| data | content of the message |
- Returns
- ID of the new message
◆ subscribeFor()
| std::vector< std::string > privmx::endpoint::thread::ThreadApi::subscribeFor |
( |
const std::vector< std::string > & | subscriptionQueries | ) |
|
Subscribe for the Thread events on the given subscription query.
- Parameters
-
| subscriptionQueries | list of queries |
- Returns
- list of subscriptionIds in maching order to subscriptionQueries
◆ unsubscribeFrom()
| void privmx::endpoint::thread::ThreadApi::unsubscribeFrom |
( |
const std::vector< std::string > & | subscriptionIds | ) |
|
Unsubscribe from events for the given subscriptionId.
- Parameters
-
| subscriptionIds | list of subscriptionId |
◆ updateMessage()
| void privmx::endpoint::thread::ThreadApi::updateMessage |
( |
const std::string & | messageId, |
|
|
const core::Buffer & | publicMeta, |
|
|
const core::Buffer & | privateMeta, |
|
|
const core::Buffer & | data ) |
Update message in a Thread.
- Parameters
-
| messageId | ID of the message to update |
| publicMeta | public message metadata |
| privateMeta | private message metadata |
| data | content of the message |
◆ updateThread()
Updates an existing Thread.
- Parameters
-
| threadId | ID of the Thread to update |
| users | vector of UserWithPubKey structs which indicates who will have access to the created Thread |
| managers | vector of UserWithPubKey structs which indicates who will have access (and management rights) to the created Thread |
| publicMeta | public (unencrypted) metadata |
| privateMeta | private (encrypted) metadata |
| version | current version of the updated Thread |
| force | force update (without checking version) |
| forceGenerateNewKey | force to regenerate a key for the Thread |
| policies | Thread's policies |
The documentation for this class was generated from the following file: