Class InboxApi
public class InboxApi : IInboxApi
- Inheritance
-
InboxApi
- Implements
- Inherited Members
Methods
CloseFile(long)
Closes a file by given handle.
public string CloseFile(long fileHandle)
Parameters
fileHandlelongHandle to the file.
Returns
- string
ID of closed file.
Create(Connection, ThreadApi, StoreApi)
Creates an instance of the InboxApi.
public static InboxApi Create(Connection connection, ThreadApi threadApi, StoreApi storeApi)
Parameters
connectionConnectionInstance of Connection
threadApiThreadApiInstance of ThreadApi
storeApiStoreApiInstance of StoreApi
Returns
CreateFileHandle(byte[], byte[], long)
Creates a file handle to send a file to an Inbox.
public long CreateFileHandle(byte[] publicMeta, byte[] privateMeta, long fileSize)
Parameters
publicMetabyte[]Public file metadata.
privateMetabyte[]Private file metadata.
fileSizelongSize of the file to send.
Returns
- long
File handle.
CreateInbox(string, List<UserWithPubKey>, List<UserWithPubKey>, byte[], byte[], FilesConfig?, ContainerPolicyWithoutItem?)
Creates a new Inbox.
public string CreateInbox(string contextId, List<UserWithPubKey> users, List<UserWithPubKey> managers, byte[] publicMeta, byte[] privateMeta, FilesConfig? filesConfig, ContainerPolicyWithoutItem? policies = null)
Parameters
contextIdstringID of the Context of the new Inbox.
usersList<UserWithPubKey>Vector of UserWithPubKey structs which indicates who will have access to the created Inbox.
managersList<UserWithPubKey>Vector of UserWithPubKey structs which indicates who will have access (and management rights) to the created Inbox.
publicMetabyte[]Public metadata that will remain unencrypted on the Bridge.
privateMetabyte[]Private metadata that will be encrypted before being sent to the Bridge.
filesConfigFilesConfig(optional) Configuration of files.
policiesContainerPolicyWithoutItem(optional) Inbox policy.
Returns
- string
ID of the created Inbox.
DeleteEntry(string)
Delete an entry from an Inbox.
public void DeleteEntry(string inboxEntryId)
Parameters
inboxEntryIdstringID of an entry to delete.
DeleteInbox(string)
Deletes an Inbox by given Inbox ID.
public void DeleteInbox(string inboxId)
Parameters
inboxIdstringID of the Inbox to delete.
~InboxApi()
protected ~InboxApi()
GetInbox(string)
Gets a Inbox by given Inbox ID.
public Inbox GetInbox(string inboxId)
Parameters
inboxIdstringID of the Inbox to get.
Returns
- Inbox
Information about about the Inbox.
GetInboxPublicView(string)
Gets public data of an Inbox. You do not have to be logged in to call this function.
public InboxPublicView GetInboxPublicView(string inboxId)
Parameters
inboxIdstringID of the Inbox to get.
Returns
- InboxPublicView
Public accessible information about the Inbox.
ListEntries(string, PagingQuery)
Gets list of entries in given Inbox.
public PagingList<InboxEntry> ListEntries(string inboxId, PagingQuery pagingQuery)
Parameters
inboxIdstringID of the Inbox.
pagingQueryPagingQueryList query parameters.
Returns
- PagingList<InboxEntry>
List of entries.
ListInboxes(string, PagingQuery)
Gets s list of Inboxes in given Context.
public PagingList<Inbox> ListInboxes(string contextId, PagingQuery pagingQuery)
Parameters
contextIdstringID of the Context to get Inboxes from.
pagingQueryPagingQueryList query parameters.
Returns
- PagingList<Inbox>
List of Inboxes.
OpenFile(string)
Opens a file to read.
public long OpenFile(string fileId)
Parameters
fileIdstringID of the file to read.
Returns
- long
Handle to read file data.
PrepareEntry(string, byte[], List<long>, byte[]?)
Prepares a request to send data to an Inbox.
You do not have to be logged in to call this function.
public long PrepareEntry(string inboxId, byte[] data, List<long> inboxFileHandles, byte[]? userPrivKey)
Parameters
inboxIdstringID of the Inbox to which the request applies.
databyte[]Entry data to send.
inboxFileHandlesList<long>List of file handles that will be sent with the request.
userPrivKeybyte[](optional) Sender's private key which can be used later to encrypt data for that sender.
Returns
- long
Inbox handle.
ReadEntry(string)
Gets an entry from an Inbox.
public InboxEntry ReadEntry(string inboxEntryId)
Parameters
inboxEntryIdstringID of an entry to read from the Inbox.
Returns
- InboxEntry
Data of the entry stored in the Inbox.
ReadFromFile(long, long)
Reads file data.
public byte[] ReadFromFile(long fileHandle, long length)
Parameters
Returns
- byte[]
File data chunk which size is equal to length, or smaller size when is end of file.
SeekInFile(long, long)
Moves file's read cursor.
public void SeekInFile(long fileHandle, long position)
Parameters
SendEntry(long)
Sends data to an Inbox.
You do not have to be logged in to call this function.
public void SendEntry(long inboxHandle)
Parameters
inboxHandlelongID of the Inbox to which the request applies.
SubscribeForEntryEvents(string)
Subscribes for events in given Inbox.
public void SubscribeForEntryEvents(string inboxId)
Parameters
inboxIdstringID of the Inbox.
SubscribeForInboxEvents()
Subscribes for the Inbox module main events.
public void SubscribeForInboxEvents()
UnsubscribeFromEntryEvents(string)
Unsubscribes from events in given Inbox.
public void UnsubscribeFromEntryEvents(string inboxId)
Parameters
inboxIdstringID of the Inbox.
UnsubscribeFromInboxEvents()
Unsubscribes from the Inbox module main events.
public void UnsubscribeFromInboxEvents()
UpdateInbox(string, List<UserWithPubKey>, List<UserWithPubKey>, byte[], byte[], FilesConfig?, long, bool, bool, ContainerPolicyWithoutItem?)
Updates an existing Inbox.
public void UpdateInbox(string inboxId, List<UserWithPubKey> users, List<UserWithPubKey> managers, byte[] publicMeta, byte[] privateMeta, FilesConfig? filesConfig, long version, bool force, bool forceGenerateNewKey, ContainerPolicyWithoutItem? policies = null)
Parameters
inboxIdstringID of the Inbox to update.
usersList<UserWithPubKey>Vector of UserWithPubKey structs which indicates who will have access to the created Inbox.
managersList<UserWithPubKey>Vector of UserWithPubKey structs which indicates who will have access (and management rights) to the created Inbox.
publicMetabyte[]Public metadata that will remain unencrypted on the Bridge.
privateMetabyte[]Private metadata that will be encrypted before being sent to the Bridge.
filesConfigFilesConfig(optional) Configuration of files.
versionlongCurrent version of the updated Inbox.
forceboolForce update without checking version.
forceGenerateNewKeyboolForce to regenerate a key for the Inbox.
policiesContainerPolicyWithoutItem(optional) Inbox policy.
WriteToFile(long, long, byte[])
Sends a file's data chunk to an Inbox.
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.
public void WriteToFile(long inboxHandle, long inboxFileHandle, byte[] dataChunk)