PrivMX Endpoint v2.7.0
Loading...
Searching...
No Matches
privmx::endpoint::thread::ThreadApi Class Reference

#include <privmx/endpoint/thread/ThreadApi.hpp>

Inheritance diagram for privmx::endpoint::thread::ThreadApi:
Collaboration diagram for privmx::endpoint::thread::ThreadApi:

Public Member Functions

 ThreadApi ()
 ThreadApi (const ThreadApi &obj)
ThreadApioperator= (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< ThreadlistThreads (const std::string &contextId, const core::PagingQuery &pagingQuery)
Message getMessage (const std::string &messageId)
core::PagingList< MessagelistMessages (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)
Public Member Functions inherited from privmx::endpoint::core::ExtendedPointer< ThreadApiImpl >
ExtendedPointer & operator= (const ExtendedPointer &obj)
std::shared_ptr< ThreadApiImpl > getImpl () const

Static Public Member Functions

static ThreadApi create (core::Connection &connetion)

Additional Inherited Members

Protected Member Functions inherited from privmx::endpoint::core::ExtendedPointer< ThreadApiImpl >
void attachToPtrIfPossible ()
void detachFromPtrIfPossible ()
Protected Attributes inherited from privmx::endpoint::core::ExtendedPointer< ThreadApiImpl >
std::weak_ptr< ThreadApiImpl > _ptr

Detailed Description

'ThreadApi' is a class representing Endpoint's API for Threads and their messages.

Constructor & Destructor Documentation

◆ ThreadApi()

privmx::endpoint::thread::ThreadApi::ThreadApi ( )

//doc-gen:ignore

Member Function Documentation

◆ buildSubscriptionQuery()

std::string privmx::endpoint::thread::ThreadApi::buildSubscriptionQuery ( EventType eventType,
EventSelectorType selectorType,
const std::string & selectorId )

Generate subscription Query for the Thread events.

Parameters
eventTypetype of event which you listen for
selectorTypescope on which you listen for events
selectorIdID of the selector

◆ create()

ThreadApi privmx::endpoint::thread::ThreadApi::create ( core::Connection & connetion)
static

Creates an instance of 'ThreadApi'.

Parameters
connectioninstance of 'Connection'
Returns
ThreadApi object

◆ createThread()

std::string privmx::endpoint::thread::ThreadApi::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 )

Creates a new Thread in given Context.

Parameters
contextIdID of the Context to create the Thread in
usersvector of UserWithPubKey structs which indicates who will have access to the created Thread
managersvector of UserWithPubKey structs which indicates who will have access (and management rights) to the created Thread
publicMetapublic (unencrypted) metadata
privateMetaprivate (encrypted) metadata
policiesThread'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
messageIdID of the message to delete

◆ deleteThread()

void privmx::endpoint::thread::ThreadApi::deleteThread ( const std::string & threadId)

Deletes a Thread by given Thread ID.

Parameters
threadIdID of the Thread to delete

◆ getMessage()

Message privmx::endpoint::thread::ThreadApi::getMessage ( const std::string & messageId)

Gets a message by given message ID.

Parameters
IDof the message to get
Returns
struct containing the message

◆ getThread()

Thread privmx::endpoint::thread::ThreadApi::getThread ( const std::string & threadId)

Gets a Thread by given Thread ID.

Parameters
threadIdID of Thread to get
Returns
Thread struct containing info about the Thread

◆ listMessages()

core::PagingList< Message > privmx::endpoint::thread::ThreadApi::listMessages ( const std::string & threadId,
const core::PagingQuery & pagingQuery )

Gets a list of messages from a Thread.

Parameters
threadIdID of the Thread to list messages from
pagingQuerystruct with list query parameters
Returns
struct containing a list of messages

◆ listThreads()

core::PagingList< Thread > privmx::endpoint::thread::ThreadApi::listThreads ( const std::string & contextId,
const core::PagingQuery & pagingQuery )

Gets a list of Threads in given Context.

Parameters
contextIdID of the Context to get the Threads from
pagingQuerystruct 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
threadIdID of the Thread to send message to
publicMetapublic message metadata
privateMetaprivate message metadata
datacontent 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
subscriptionQuerieslist 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
subscriptionIdslist 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
messageIdID of the message to update
publicMetapublic message metadata
privateMetaprivate message metadata
datacontent of the message

◆ updateThread()

void privmx::endpoint::thread::ThreadApi::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 )

Updates an existing Thread.

Parameters
threadIdID of the Thread to update
usersvector of UserWithPubKey structs which indicates who will have access to the created Thread
managersvector of UserWithPubKey structs which indicates who will have access (and management rights) to the created Thread
publicMetapublic (unencrypted) metadata
privateMetaprivate (encrypted) metadata
versioncurrent version of the updated Thread
forceforce update (without checking version)
forceGenerateNewKeyforce to regenerate a key for the Thread
policiesThread's policies

The documentation for this class was generated from the following file: