#include <privmx/endpoint/inbox/InboxApi.hpp>


Public Member Functions | |
| InboxApi () | |
| InboxApi (const InboxApi &obj) | |
| InboxApi & | operator= (const InboxApi &obj) |
| InboxApi (InboxApi &&obj) | |
| std::string | createInbox (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< inbox::FilesConfig > &filesConfig, const std::optional< core::ContainerPolicyWithoutItem > &policies=std::nullopt) |
| void | updateInbox (const std::string &inboxId, const std::vector< core::UserWithPubKey > &users, const std::vector< core::UserWithPubKey > &managers, const core::Buffer &publicMeta, const core::Buffer &privateMeta, const std::optional< inbox::FilesConfig > &filesConfig, const int64_t version, const bool force, const bool forceGenerateNewKey, const std::optional< core::ContainerPolicyWithoutItem > &policies=std::nullopt) |
| Inbox | getInbox (const std::string &inboxId) |
| core::PagingList< inbox::Inbox > | listInboxes (const std::string &contextId, const core::PagingQuery &pagingQuery) |
| inbox::InboxPublicView | getInboxPublicView (const std::string &inboxId) |
| void | deleteInbox (const std::string &inboxId) |
| int64_t | prepareEntry (const std::string &inboxId, const core::Buffer &data, const std::vector< int64_t > &inboxFileHandles=std::vector< int64_t >(), const std::optional< std::string > &userPrivKey=std::nullopt) |
| void | sendEntry (const int64_t inboxHandle) |
| inbox::InboxEntry | readEntry (const std::string &inboxEntryId) |
| core::PagingList< inbox::InboxEntry > | listEntries (const std::string &inboxId, const core::PagingQuery &pagingQuery) |
| void | deleteEntry (const std::string &inboxEntryId) |
| int64_t | createFileHandle (const core::Buffer &publicMeta, const core::Buffer &privateMeta, const int64_t &fileSize) |
| void | writeToFile (const int64_t inboxHandle, const int64_t inboxFileHandle, const core::Buffer &dataChunk) |
| int64_t | openFile (const std::string &fileId) |
| core::Buffer | readFromFile (const int64_t fileHandle, const int64_t length) |
| void | seekInFile (const int64_t fileHandle, const int64_t position) |
| std::string | closeFile (const int64_t fileHandle) |
| 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< InboxApiImpl > | |
| ExtendedPointer & | operator= (const ExtendedPointer &obj) |
| std::shared_ptr< InboxApiImpl > | getImpl () const |
Static Public Member Functions | |
| static InboxApi | create (core::Connection &connection, thread::ThreadApi &threadApi, store::StoreApi &storeApi) |
Additional Inherited Members | |
| Protected Member Functions inherited from privmx::endpoint::core::ExtendedPointer< InboxApiImpl > | |
| void | attachToPtrIfPossible () |
| void | detachFromPtrIfPossible () |
| Protected Attributes inherited from privmx::endpoint::core::ExtendedPointer< InboxApiImpl > | |
| std::weak_ptr< InboxApiImpl > | _ptr |
'InboxApi' is a class representing Endpoint's API for Inboxes and their entries.
| privmx::endpoint::inbox::InboxApi::InboxApi | ( | ) |
//doc-gen:ignore
| std::string privmx::endpoint::inbox::InboxApi::buildSubscriptionQuery | ( | EventType | eventType, |
| EventSelectorType | selectorType, | ||
| const std::string & | selectorId ) |
Generate subscription Query for the Inbox events.
| eventType | type of event which you listen for |
| selectorType | scope on which you listen for events |
| selectorId | ID of the selector |
| std::string privmx::endpoint::inbox::InboxApi::closeFile | ( | const int64_t | fileHandle | ) |
Closes a file by given handle.
| fileHandle | handle to the file |
|
static |
| int64_t privmx::endpoint::inbox::InboxApi::createFileHandle | ( | const core::Buffer & | publicMeta, |
| const core::Buffer & | privateMeta, | ||
| const int64_t & | fileSize ) |
Creates a file handle to send a file to an Inbox. You do not have to be logged in to call this function.
| publicMeta | file's public metadata |
| privateMeta | file's private metadata |
| fileSize | size of the file to send |
| std::string privmx::endpoint::inbox::InboxApi::createInbox | ( | 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< inbox::FilesConfig > & | filesConfig, | ||
| const std::optional< core::ContainerPolicyWithoutItem > & | policies = std::nullopt ) |
Creates a new Inbox.
| contextId | ID of the Context of the new Inbox |
| users | vector of UserWithPubKey structs which indicates who will have access to the created Inbox |
| managers | vector of UserWithPubKey structs which indicates who will have access (and management rights) to the created Inbox |
| publicMeta | public (unencrypted) metadata |
| privateMeta | private (encrypted) metadata |
| filesConfig | struct to override default file configuration |
| policies | Inbox policies |
| void privmx::endpoint::inbox::InboxApi::deleteEntry | ( | const std::string & | inboxEntryId | ) |
Delete an entry from an Inbox.
| ID | of an entry to delete |
| void privmx::endpoint::inbox::InboxApi::deleteInbox | ( | const std::string & | inboxId | ) |
| Inbox privmx::endpoint::inbox::InboxApi::getInbox | ( | const std::string & | inboxId | ) |
| inbox::InboxPublicView privmx::endpoint::inbox::InboxApi::getInboxPublicView | ( | const std::string & | inboxId | ) |
| core::PagingList< inbox::InboxEntry > privmx::endpoint::inbox::InboxApi::listEntries | ( | const std::string & | inboxId, |
| const core::PagingQuery & | pagingQuery ) |
| core::PagingList< inbox::Inbox > privmx::endpoint::inbox::InboxApi::listInboxes | ( | const std::string & | contextId, |
| const core::PagingQuery & | pagingQuery ) |
Gets s list of Inboxes in given Context.
| contextId | ID of the Context to get Inboxes from |
| pagingQuery | struct with list query parameters |
| int64_t privmx::endpoint::inbox::InboxApi::openFile | ( | const std::string & | fileId | ) |
Opens a file to read.
| fileId | ID of the file to read |
| int64_t privmx::endpoint::inbox::InboxApi::prepareEntry | ( | const std::string & | inboxId, |
| const core::Buffer & | data, | ||
| const std::vector< int64_t > & | inboxFileHandles = std::vector< int64_t >(), | ||
| const std::optional< std::string > & | userPrivKey = std::nullopt ) |
Prepares a request to send data to an Inbox. You do not have to be logged in to call this function.
| inboxId | ID of the Inbox to which the request applies |
| data | entry data to send |
| inboxFileHandles | optional list of file handles that will be sent with the request |
| userPrivKey | sender can optionally provide a private key, which will be used: 1) to sign the sent data, 2) to derivation of the public key, which will then be transferred along with the sent data and can be used in the future for further secure communication with the sender |
| inbox::InboxEntry privmx::endpoint::inbox::InboxApi::readEntry | ( | const std::string & | inboxEntryId | ) |
| core::Buffer privmx::endpoint::inbox::InboxApi::readFromFile | ( | const int64_t | fileHandle, |
| const int64_t | length ) |
Reads file data. Single read call moves the files's cursor position by declared length or set it at the end of the file.
| fileHandle | handle to the file |
| length | size of data to read |
| void privmx::endpoint::inbox::InboxApi::seekInFile | ( | const int64_t | fileHandle, |
| const int64_t | position ) |
Moves file's read cursor.
| fileHandle | handle to the file |
| position | sets new cursor position |
| void privmx::endpoint::inbox::InboxApi::sendEntry | ( | const int64_t | inboxHandle | ) |
| std::vector< std::string > privmx::endpoint::inbox::InboxApi::subscribeFor | ( | const std::vector< std::string > & | subscriptionQueries | ) |
Subscribe for the Inbox events on the given subscription query.
| subscriptionQueries | list of queries |
| void privmx::endpoint::inbox::InboxApi::unsubscribeFrom | ( | const std::vector< std::string > & | subscriptionIds | ) |
Unsubscribe from events for the given subscriptionId.
| subscriptionIds | list of subscriptionId |
| void privmx::endpoint::inbox::InboxApi::updateInbox | ( | const std::string & | inboxId, |
| const std::vector< core::UserWithPubKey > & | users, | ||
| const std::vector< core::UserWithPubKey > & | managers, | ||
| const core::Buffer & | publicMeta, | ||
| const core::Buffer & | privateMeta, | ||
| const std::optional< inbox::FilesConfig > & | filesConfig, | ||
| const int64_t | version, | ||
| const bool | force, | ||
| const bool | forceGenerateNewKey, | ||
| const std::optional< core::ContainerPolicyWithoutItem > & | policies = std::nullopt ) |
Updates an existing Inbox.
| inboxId | ID of the Inbox to update |
| users | vector of UserWithPubKey structs which indicates who will have access to the created Inbox |
| managers | vector of UserWithPubKey structs which indicates who will have access (and management rights) to the created Inbox |
| publicMeta | public (unencrypted) metadata |
| privateMeta | private (encrypted) metadata |
| filesConfig | struct to override default files configuration |
| version | current version of the updated Inbox |
| force | force update (without checking version) |
| forceGenerateNewKey | force to regenerate a key for the Inbox |
| policies | Inbox policies |
| void privmx::endpoint::inbox::InboxApi::writeToFile | ( | const int64_t | inboxHandle, |
| const int64_t | inboxFileHandle, | ||
| const core::Buffer & | dataChunk ) |
Sends file's data chunk to an Inbox. (note: To send the entire file - divide it into pieces of the desired size and call the function for each fragment.) You do not have to be logged in to call this function.
| inboxHandle | Handle to the prepared Inbox entry |
| inboxFileHandle | handle to the file where the uploaded chunk belongs |
| Buffer | dataChunk - file chunk to send |