PrivMX DOCS
API Reference/PrivMX Endpoint C#/Stores

StoreApi

Static Methods

Create

Creates an instance of the StoreApi.

Params

connection

Connection

Instance of Connection

static StoreApi Create(
Connection connection
)

Returns

StoreApi · Created instance of the StoreApi.

Methods

CreateStore

Creates a new Store in given Context.

Params

contextId

string

ID of the Context to create the Store in.

users

List<UserWithPubKey>

Array of UserWithPubKey structs which indicates who will have access to the created Store.

managers

List<UserWithPubKey>

Array of UserWithPubKey structs which indicates who will have access (and management rights) to the created Store.

publicMeta

byte[]

Public metadata that will remain unencrypted on the Bridge.

privateMeta

byte[]

Private metadata that will be encrypted before being sent to the Bridge.

policies

ContainerPolicy?

(optional) Store policy.

string CreateStore(
string contextId,
List<UserWithPubKey> users,
List<UserWithPubKey> managers,
byte[] publicMeta,
byte[] privateMeta,
ContainerPolicy? policies = null
)

Returns

string · Created Store ID.

UpdateStore

Updates an existing Store.

Params

storeId

string

ID of the Store to update.

users

List<UserWithPubKey>

Array of UserWithPubKey structs which indicates who will have access to the created Store.

managers

List<UserWithPubKey>

Array of UserWithPubKey structs which indicates who will have access (and management rights) to the created Store.

publicMeta

byte[]

Public metadata that will remain unencrypted on the Bridge.

privateMeta

byte[]

Private metadata that will be encrypted before being sent to the Bridge.

version

long

Current version of the updated Store.

force

bool

Force update (without checking version).

forceGenerateNewKey

bool

Force to renenerate a key for the Store.

policies

ContainerPolicy?

(optional) Store policy.

void UpdateStore(
string storeId,
List<UserWithPubKey> users,
List<UserWithPubKey> managers,
byte[] publicMeta,
byte[] privateMeta,
long version,
bool force,
bool forceGenerateNewKey,
ContainerPolicy? policies = null
)

DeleteStore

Deletes a Store by given Store ID.

Params

storeId

string

ID of the Store to delete.

void DeleteStore(
string storeId
)

GetStore

Gets a single Store by given Store ID.

Params

storeId

string

ID of the Store to get.

Models.Store GetStore(
string storeId
)

Returns

Models.Store · Information about about the Store.

ListStores

Gets a list of Stores in given Context.

Params

contextId

string

ID of the Context to get the Stores from.

pagingQuery

PagingQuery

List query parameters.

PagingList<Models.Store> ListStores(
string contextId,
PagingQuery pagingQuery
)

Returns

PagingList<Models.Store> · List of Stores.

CreateFile

Creates a new file in a Store.

Params

storeId

string

ID of the Store to create the file in.

publicMeta

byte[]

Public file meta_data.

privateMeta

byte[]

Private file meta_data.

size

long

Size of the file.

long CreateFile(
string storeId,
byte[] publicMeta,
byte[] privateMeta,
long size
)

Returns

long · Handle to write data.

UpdateFile

Updates an existing file in a Store.

Params

fileId

string

ID of the file to update.

publicMeta

byte[]

Public file meta_data.

privateMeta

byte[]

Private file meta_data.

size

long

Size of the file.

long UpdateFile(
string fileId,
byte[] publicMeta,
byte[] privateMeta,
long size
)

Returns

long · Handle to write file data.

UpdateFileMeta

Updates meta data of an existing file in a Store.

Params

fileId

string

ID of the file to update.

publicMeta

byte[]

Public file meta_data.

privateMeta

byte[]

Private file meta_data.

void UpdateFileMeta(
string fileId,
byte[] publicMeta,
byte[] privateMeta
)

WriteToFile

Writes a file data.

Params

fileHandle

long

Handle to write file data.

dataChunk

byte[]

File data chunk.

void WriteToFile(
long fileHandle,
byte[] dataChunk
)

DeleteFile

Deletes a file by given ID.

Params

storeId

string

ID of the file to delete.

void DeleteFile(
string storeId
)

GetFile

Gets a single file by the given file ID.

Params

fileId

string

ID of the file to get.

File GetFile(
string fileId
)

Returns

File · Information about the file.

ListFiles

Gets a list of files in given Store.

Params

storeId

string

ID of the Store to get files from.

pagingQuery

PagingQuery

List query parameters.

PagingList<File> ListFiles(
string storeId,
PagingQuery pagingQuery
)

Returns

PagingList<File> · List of files.

OpenFile

Opens a file to read.

Params

fileId

string

ID of the file to read.

long OpenFile(
string fileId
)

Returns

long · Handle to read file data.

ReadFromFile

Reads file data.

Params

fileHandle

long

Handle to write file data.

length

long

Size of data to read.

byte[] ReadFromFile(
long fileHandle,
long length
)

Returns

byte[] · File data chunk.

SeekInFile

Moves read cursor.

Params

fileHandle

long

Handle to write file data.

position

long

New cursor position.

void SeekInFile(
long fileHandle,
long position
)

CloseFile

Closes the file handle.

Params

fileHandle

long

Handle to read/write file data.

string CloseFile(
long fileHandle
)

Returns

string · ID of closed file.

SubscribeForStoreEvents

Subscribes for the Store module main events.

void SubscribeForStoreEvents()

UnsubscribeFromStoreEvents

Unsubscribes from the Store module main events.

void UnsubscribeFromStoreEvents()

SubscribeForFileEvents

Subscribes for the events in given Store.

Params

storeId

string

ID of the Store to subscribe for.

void SubscribeForFileEvents(
string storeId
)

UnsubscribeFromFileEvents

Unsubscribes from the events in given Store.

Params

storeId

string

ID of the Store to unsubscribe from.

void UnsubscribeFromFileEvents(
string storeId
)

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.