InboxApi
Swift wrapper for privmx.NativeInboxApiWrapper
, providing methods to manage Inboxes and entries within PrivMX platform.
Static Methods
create(connection:threadApi:storeApi:)
Creates a new instance of InboxApi
using a connection, threadApi
, and StoreApi
.
Params
connection
inout Connection
The connection object to interact with PrivMX.
threadApi
inout ThreadApi
The Thread API instance.
storeApi
inout StoreApi
The Store API instance.
Returns
InboxApi
·
A new InboxApi
instance.
Methods
createInbox(contextId:users:managers:publicMeta:privateMeta:filesConfig:policies:)
Creates a new Inbox in the specified context.
If policies
argument is set to nil
, the default policies will be applied.
Params
contextId
std.string
The ID of the context where the Inbox should be created.
users
privmx.UserWithPubKeyVector
A vector of users who will have access to the Inbox.
managers
privmx.UserWithPubKeyVector
A vector of users who will manage the Inbox.
publicMeta
privmx.endpoint.core.Buffer
Public metadata that is not encrypted.
privateMeta
privmx.endpoint.core.Buffer
Private metadata that is encrypted.
filesConfig
privmx.endpoint.inbox.FilesConfig?
An optional configuration for file storage.
policies
privmx.endpoint.core.ContainerPolicyWithoutItem?
A set of policies for the Container.
Returns
std.string
·
The ID of the newly created Inbox as a std.string
.
updateInbox(inboxId:users:managers:publicMeta:privateMeta:filesConfig:version:force:forceGenerateNewKey:policies:)
Updates an existing Inbox with new metadata and configuration.
If policies
argument is set to nil
, the default policies will be applied.
Params
inboxId
std.string
The ID of the Inbox to be updated.
users
privmx.UserWithPubKeyVector
A vector of users who will have access to the Inbox.
managers
privmx.UserWithPubKeyVector
A vector of users who will manage the Inbox.
publicMeta
privmx.endpoint.core.Buffer
Updated public metadata for the Inbox.
privateMeta
privmx.endpoint.core.Buffer
Updated private metadata for the Inbox.
filesConfig
privmx.endpoint.inbox.FilesConfig?
An optional configuration for file storage.
version
Int64
The current version of the Inbox for version control.
force
Bool
Whether to force the update, ignoring version control.
forceGenerateNewKey
Bool
Whether to force regeneration of a new key for the Inbox.
policies
privmx.endpoint.core.ContainerPolicyWithoutItem?
New set of policies for the Container.
getInbox(inboxId:)
Retrieves detailed information about a specific Inbox.
Params
inboxId
std.string
The ID of the Inbox to retrieve.
Returns
privmx.endpoint.inbox.Inbox
·
An Inbox
instance containing Inbox details.
listInboxes(contextId:pagingQuery:)
Lists all Inboxes within a specified context.
Params
contextId
std.string
The ID of the context from which to list Inboxes.
pagingQuery
privmx.endpoint.core.PagingQuery
A query object to filter and paginate the results.
Returns
privmx.InboxList
·
An InboxList
containing the list of Inboxes.
getInboxPublicView(inboxId:)
Retrieves the public view of a specific Inbox.
Params
inboxId
std.string
The ID of the Inbox to retrieve the public view for.
Returns
privmx.endpoint.inbox.InboxPublicView
·
An InboxPublicView
containing the public view of the Inbox.
deleteInbox(inboxId:)
Deletes a specified Inbox.
Params
inboxId
std.string
The ID of the Inbox to delete.
prepareEntry(inboxId:data:inboxFileHandles:userPrivKey:)
Prepares a new entry to be sent to the Inbox.
If the entry contains files, they must first be prepared using createFileHandle()
and attached to the entry.
Params
inboxId
std.string
The ID of the Inbox to which the entry will be sent.
data
privmx.endpoint.core.Buffer
The data to be included in the entry.
inboxFileHandles
privmx.InboxFileHandleVector
An optional vector of file handles to be attached to the entry. By default, no files are attached.
userPrivKey
std.string?
An optional private key of the user preparing the entry, if required.
Returns
privmx.InboxHandle
·
An InboxHandle
representing the prepared entry, which should then be sent.
sendEntry(inboxHandle:)
Sends a previously prepared entry to the Inbox. This method finalizes the process by sending the entry to the specified Inbox.
Params
inboxHandle
privmx.InboxHandle
The handle of the prepared entry to be sent.
readEntry(inboxEntryId:)
Retrieves an entry from a specific Inbox.
Params
inboxEntryId
std.string
The ID of the entry to be retrieved.
Returns
privmx.endpoint.inbox.InboxEntry
·
An InboxEntry
instance representing the entry.
listEntries(inboxId:pagingQuery:)
Lists entries within a specific Inbox.
Params
inboxId
std.string
The ID of the Inbox from which to list entries.
pagingQuery
privmx.endpoint.core.PagingQuery
A query object to filter and paginate the results.
Returns
privmx.InboxEntryList
·
An InboxEntryList
containing the list of entries.
deleteEntry(inboxEntryId:)
Deletes a specified entry from an Inbox.
Params
inboxEntryId
std.string
The ID of the entry to delete.
createFileHandle(publicMeta:privateMeta:fileSize:)
Creates a new file handle for writing data to the Inbox.
Params
publicMeta
privmx.endpoint.core.Buffer
Public metadata for the file.
privateMeta
privmx.endpoint.core.Buffer
Private metadata for the file.
fileSize
Int64
The size of the file in bytes.
Returns
privmx.InboxFileHandle
·
An InboxFileHandle
for writing data to the file.
writeToFile(inboxHandle:inboxFileHandle:dataChunk:)
Writes a chunk of data to a file in the Inbox.
Params
inboxHandle
privmx.InboxHandle
Handle to the prepared Inbox entry
inboxFileHandle
privmx.InboxFileHandle
handle to the file where the uploaded chunk belongs
dataChunk
privmx.endpoint.core.Buffer
openFile(fileId:)
Opens a file for reading from the Inbox.
Params
fileId
std.string
The ID of the file to open.
Returns
privmx.InboxFileHandle
·
An InboxFileHandle
for reading from the file.
readFromFile(fileHandle:length:)
Reads data from an open file in the inbox.
Params
fileHandle
privmx.InboxFileHandle
The file handle to read from.
length
Int64
The number of bytes to read.
Returns
privmx.endpoint.core.Buffer
·
A buffer containing the read data.
seekInFile(fileHandle:position:)
Moves the read cursor in an open file.
Params
fileHandle
privmx.InboxFileHandle
The file handle to move the cursor in.
position
Int64
The new position of the cursor in bytes.
closeFile(fileHandle:)
Closes an open file in the Inbox.
Params
fileHandle
privmx.InboxFileHandle
The file handle to close.
Returns
std.string
·
The ID of the closed file as a std.string
.
subscribeForInboxEvents()
Subscribes to Inbox-related events.
unsubscribeFromInboxEvents()
Unsubscribes from Inbox-related events.
subscribeForEntryEvents(inboxId:)
Subscribes to entry-related events within a specific Inbox.
Params
inboxId
std.string
The ID of the Inbox to subscribe to entry events for.
unsubscribeFromEntryEvents(inboxId:)
Unsubscribes from entry-related events within a specific Inbox.
Params
inboxId
std.string
The ID of the Inbox to unsubscribe from entry events for.
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.