Creates an inbox in a specified context for a group of users, managed by a set of managers.
This method creates an inbox associated with a given context ID, assigning users and managers to it, while attaching metadata and configuration for files if needed.
Updates an existing inbox by replacing its users, managers, metadata, and configuration with new values.
This method updates the specified inbox, replacing its current users, managers, and metadata (both public and private) with the new ones provided. It also allows updating the files configuration, optionally forcing the update and generating a new key if necessary.
Retrieves the inbox associated with the given inbox ID.
This method fetches an inbox based on its unique identifier, returning detailed information about the inbox, such as its users, managers, and metadata.
Lists all inboxes in the specified context, based on the given paging query.
This method retrieves a list of inboxes associated with a specific context, with the results potentially being paginated according to the provided `PagingQuery`.
Retrieves the public view of the specified inbox.
This method fetches the public view of an inbox, which includes public metadata that can be accessed without privileged access.
func getInboxPublicView( for inboxId:String ) throws -> privmx.endpoint.inbox.InboxPublicView
Name
Type
Description
inboxId
String
The unique identifier of the inbox to retrieve the public view for, provided as a `String`.
Type
Description
privmx.endpoint.inbox.InboxPublicView
An `InboxPublicView` object containing the public metadata and details of the requested inbox.
Prepares an entry to be sent to the specified inbox, optionally attaching file handles.
This method prepares a new entry to be sent to the inbox identified by `inboxId`. The entry can contain metadata and optional files, represented by `InboxFileHandle` objects. A private key may be provided for encryption purposes.
func prepareEntry( in inboxId: String, containing data: Data, attaching inboxFilesHandles:[privmx.InboxFileHandle], as userPrivateKey: String? ) throws -> privmx.InboxHandle
Name
Type
Description
inboxId
String
The unique identifier of the inbox to which the entry will be sent, provided as a `String`.
data
Data
The main content of the entry, provided as `Data`.
inboxFilesHandles
[privmx.InboxFileHandle]
An array of `InboxFileHandle` objects representing any files that should be attached to the entry.
userPrivateKey
String?
An optional private key for encryption, provided as a `String`. Otherwise random key is used.
Type
Description
privmx.InboxHandle
An `InboxHandle` object representing the prepared entry that can be sent.
Sends a previously prepared entry to its corresponding inbox.
This method sends an entry that has been prepared using `prepareEntry`. The `InboxHandle` must be passed, which represents the entry that was previously prepared for submission.
func sendEntry( to inboxHandle: privmx.InboxHandle ) throws -> Void
Name
Type
Description
inboxHandle
privmx.InboxHandle
The handle of the prepared entry to be sent, provided as an `InboxHandle`.
Type
Description
This method returns `Void` and does not provide any result on success.
Reads the content of a specific inbox entry identified by its entry ID.
This method retrieves the content and metadata of an inbox entry based on its unique identifier. Read access to the Inbox is required to successfully read its content.
Lists all entries in the specified inbox, based on the provided paging query.
This method retrieves a list of inbox entries associated with a specific inbox ID, with the results potentially being paginated according to the provided `PagingQuery`.
Deletes a specific inbox entry identified by its entry ID.
This method removes the inbox entry identified by the provided entry ID, deleting its content and metadata. Full access to the inbox is required to successfully perform the deletion.
Creates a file handle for attaching files to an inbox entry.
This method prepares a file handle, including public and private metadata, as well as the file size. The file handle is used when attaching files to an inbox entry before sending.
Writes a chunk of data to a file associated with a prepared inbox entry.
This method uploads a chunk of data to a file that is part of a prepared inbox entry. The `InboxFileHandle` represents the file, and the `InboxHandle` represents the entry being prepared.
func writeToFile( _ inboxFileHandle: privmx.InboxFileHandle, in inboxHandle: privmx.InboxHandle, uploading dataChunk: Data ) throws -> Void
Name
Type
Description
inboxFileHandle
privmx.InboxFileHandle
The handle of the file to which data will be written, provided as an `InboxFileHandle`.
inboxHandle
privmx.InboxHandle
The handle of the inbox entry that the file is associated with, provided as an `InboxHandle`.
dataChunk
Data
The chunk of data to be uploaded, provided as `Data`.
Type
Description
This method returns `Void` and does not provide any result on success.
Opens a file associated with the given file ID and returns a file handle.
This method opens a file based on its unique file ID and returns a handle that can be used to read from or write to the file. The file must be closed using `closeFile` after operations are completed.
Reads a specified number of bytes from an open file.
This method reads up to `length` bytes from a file, starting from the current file pointer position, and returns the data as a `Data` object.
Moves the file pointer to a specified position within a file.
This method adjusts the file pointer to the given position in a file associated with the provided file handle. It is useful for reading from or writing to a specific part of a file.
Closes an open file associated with the given file handle.
This method closes a file that was opened using `openFile`. It ensures that all pending changes are written and that the file handle is released.
Subscribes to receive entry events for a specific inbox.
This method subscribes to receive notifications or events related to entries within the specified inbox. Once subscribed, the client will be notified of any changes or updates to the entries in the inbox.
func subscribeForEntryEvents( in inboxId: String ) throws -> Void
Name
Type
Description
inboxId
String
The unique identifier of the inbox to subscribe to for entry events, provided as a `String`.
Type
Description
This method returns `Void` and does not provide any result on success.
Unsubscribes from receiving entry events for a specific inbox.
This method unsubscribes the client from receiving notifications or events related to entries within the specified inbox. It stops further event notifications for that inbox.
func unsubscribeFromEntryEvents( in inboxId: String ) throws -> Void
Name
Type
Description
inboxId
String
The unique identifier of the inbox to unsubscribe from entry events, provided as a `String`.
Type
Description
This method returns `Void` and does not provide any result on success.