PrivMX DOCS
API Reference/PrivMX Endpoint C# Extra/Stores

AsyncStoreApi

Store api container that manages connection and exposes asynchronous API.

Methods

AsyncStoreApi

Wraps existing thread api into async thread api. This constructor is meant to be used in advanced scenarios like object mocking and testing.

Params

storeApi

IStoreApi

Existing thread API.

connectionId

long

ID of user connection.

eventDispatcher

IEventDispatcher

Event dispatcher used as event source.

AsyncStoreApi(
IStoreApi storeApi,
long connectionId,
IEventDispatcher eventDispatcher
)

AsyncStoreApi

Creates a new instance of the store api over real privmx connection.

Params

connection

Connection

AsyncStoreApi(
Connection connection
)

DisposeAsync

Disposes store api.

ValueTask DisposeAsync()

Returns

ValueTask ·

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 (unencrypted) metadata.

privateMeta

byte[]

Private (encrypted) metadata.

containerPolicy

ContainerPolicy

Store policy.

token

CancellationToken

Cancellation token.

ValueTask<string> CreateStore(
string contextId,
List<UserWithPubKey> users,
List<UserWithPubKey> managers,
byte[] publicMeta,
byte[] privateMeta,
ContainerPolicy containerPolicy,
CancellationToken token = default
)

Returns

ValueTask<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 (unencrypted) metadata.

privateMeta

byte[]

Private (encrypted) metadata.

version

long

Current version of the updated Store.

force

bool

Force update (without checking version).

forceGenerateNewKey

bool

Force to regenerate a key for the Store.

containerPolicy

ContainerPolicy?

(optional) Store policy.

token

CancellationToken

Cancellation token.

ValueTask UpdateStore(
string storeId,
List<UserWithPubKey> users,
List<UserWithPubKey> managers,
byte[] publicMeta,
byte[] privateMeta,
long version,
bool force,
bool forceGenerateNewKey,
ContainerPolicy? containerPolicy = null,
CancellationToken token = default
)

Returns

ValueTask ·

DeleteStore

Deletes a Store by given Store ID.

Params

storeId

string

ID of the Store to delete.

token

CancellationToken

Cancellation token.

ValueTask DeleteStore(
string storeId,
CancellationToken token = default
)

Returns

ValueTask ·

GetStore

Gets a single Store by given Store ID.

Params

storeId

string

ID of the store to get.

token

CancellationToken

Cancellation token.

ValueTask<PrivMX.Endpoint.Store.Models.Store> GetStore(
string storeId,
CancellationToken token = default
)

Returns

ValueTask<PrivMX.Endpoint.Store.Models.Store> · Information about about the Store.

GetFile

Gets information about existing file.

Params

fileId

string

ID of the file to get.

token

CancellationToken

Cancellation token.

ValueTask<File> GetFile(
string fileId,
CancellationToken token = default
)

Returns

ValueTask<File> · Store file metadata.

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.

token

CancellationToken

Cancellation token.

ValueTask<PagingList<PrivMX.Endpoint.Store.Models.Store>> ListStores(
string contextId,
PagingQuery pagingQuery,
CancellationToken token = default
)

Returns

ValueTask<PagingList<PrivMX.Endpoint.Store.Models.Store>> · List of Stores.

ListFiles

Gets a list of files in given Store.storeIdID of the Store to get files from.pagingQueryList query parameters.tokenCancellation token.List of files.

Params

storeId

string

pagingQuery

PagingQuery

token

CancellationToken

ValueTask<PagingList<File>> ListFiles(
string storeId,
PagingQuery pagingQuery,
CancellationToken token = default
)

Returns

ValueTask<PagingList<File>> ·

CreateFile

Creates a new file in a Store.

Params

storeId

string

ID of the Store to create the file in.

size

long

Size of the file.

publicMeta

byte[]

Public file meta_data.

privateMeta

byte[]

Private file meta_data.

fillValue

byte?

Optional value to fill empty space in file stream on close.

token

CancellationToken

Cancellation token.

async ValueTask<PrivmxFileStream> CreateFile(
string storeId,
long size,
byte[] publicMeta,
byte[] privateMeta,
byte? fillValue = null,
CancellationToken token = default
)

Returns

async ValueTask<PrivmxFileStream> · Fixed size file stream that supports write operations.

DeleteFile

Deletes a file by given file ID.fileIdID of the Store to delete.tokenCancellation token.

Params

fileId

string

token

CancellationToken

ValueTask DeleteFile(
string fileId,
CancellationToken token = default
)

Returns

ValueTask ·

OpenFileForWrite

Opens a file for write.

Params

fileId

string

ID of the file to update.

size

long

New file size.

publicMeta

byte[]

Public file meta data.>

privateMeta

byte[]

Private file meta data.

fillValue

byte?

Optional value to fill empty space in file stream on close.

token

CancellationToken

Cancellation token

async ValueTask<PrivmxFileStream> OpenFileForWrite(
string fileId,
long size,
byte[] publicMeta,
byte[] privateMeta,
byte? fillValue = null,
CancellationToken token = default
)

Returns

async ValueTask<PrivmxFileStream> · Fixed size file stream that supports write operations.

OpenFileForRead

Opens a file for read.fileIdID of the file to read.tokenCancellation tokenFixed size readable stream that supports seek operation.

Params

fileId

string

token

CancellationToken

async ValueTask<PrivmxFileStream> OpenFileForRead(
string fileId,
CancellationToken token = default
)

Returns

async ValueTask<PrivmxFileStream> ·

UpdateFileMetaAsync

Updates meta data of an existing file in a Store.fileIdID of the file to update.publicMetaPublic file meta_data.privateMetaPrivate file meta_data.tokenCancellation token.

Params

fileId

string

publicMeta

byte[]

privateMeta

byte[]

token

CancellationToken

ValueTask UpdateFileMetaAsync(
string fileId,
byte[] publicMeta,
byte[] privateMeta,
CancellationToken token = default
)

Returns

ValueTask ·

GetStoreEvents

Gets store events.Stream of store events.

IObservable<StoreEvent> GetStoreEvents()

Returns

IObservable<StoreEvent> ·

GetFileEvents

Gets store file events.storeIdID of the tracked store.Stream of store file events.

Params

storeId

string

IObservable<StoreFileEvent> GetFileEvents(
string storeId
)

Returns

IObservable<StoreFileEvent> ·

Dispose

Disposes store api.

void Dispose()

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.