StoreApi
'StoreApi' is a class representing Endpoint's API for Stores and their files.
Static Methods
create
Creates an instance of 'StoreApi'.
Params
connection
core::Connection &
instance of 'Connection'
Returns
StoreApi
·
StoreApi object
Methods
createStore
Creates a new Store in given Context.
Params
contextId
const std::string &
ID of the Context to create the Store in
users
const std::vector<core::UserWithPubKey> &
vector of UserWithPubKey structs which indicates who will have access to the created Store
managers
const std::vector<core::UserWithPubKey> &
vector of UserWithPubKey structs which indicates who will have access (and management rights) to the created Store
publicMeta
const core::Buffer &
public (unencrypted) metadata
privateMeta
const core::Buffer &
private (encrypted) metadata
policies
const std::optional<core::ContainerPolicy> &
Store's policies
Returns
std::string
·
created Store ID
updateStore
Updates an existing Store.
Params
storeId
const std::string &
ID of the Store to update
users
const std::vector<core::UserWithPubKey> &
vector of UserWithPubKey structs which indicates who will have access to the created Store
managers
const std::vector<core::UserWithPubKey> &
vector of UserWithPubKey structs which indicates who will have access (and management rights) to the created Store
publicMeta
const core::Buffer &
public (unencrypted) metadata
privateMeta
const core::Buffer &
private (encrypted) metadata
version
const int64_t
current version of the updated Store
force
const bool
force update (without checking version)
forceGenerateNewKey
const bool
force to regenerate a key for the Store
policies
const std::optional<core::ContainerPolicy> &
Store's policies
deleteStore
Deletes a Store by given Store ID.
Params
storeId
const std::string &
ID of the Store to delete
getStore
Gets a single Store by given Store ID.
Params
storeId
const std::string &
ID of the Store to get
Returns
Store
·
struct containing information about the Store
listStores
Gets a list of Stores in given Context.
Params
contextId
const std::string &
ID of the Context to get the Stores from
pagingQuery
const core::PagingQuery &
struct with list query parameters
Returns
core::PagingList<Store>
·
struct containing list of Stores
createFile
Creates a new file in a Store.
Params
storeId
const std::string &
ID of the Store to create the file in
publicMeta
const core::Buffer &
public file metadata
privateMeta
const core::Buffer &
private file metadata
size
const int64_t
size of the file
Returns
int64_t
·
handle to write data
updateFile
Update an existing file in a Store.
Params
fileId
const std::string &
ID of the file to update
publicMeta
const core::Buffer &
public file metadata
privateMeta
const core::Buffer &
private file metadata
size
const int64_t
size of the file
Returns
int64_t
·
handle to write file data
updateFileMeta
Update metadata of an existing file in a Store.
Params
fileId
const std::string &
ID of the file to update
publicMeta
const core::Buffer &
public file metadata
privateMeta
const core::Buffer &
private file metadata
writeToFile
Writes a file data.
Params
fileHandle
const int64_t
dataChunk
const core::Buffer &
file data chunk
deleteFile
Deletes a file by given ID.
Params
fileId
const std::string &
ID of the file to delete
getFile
Gets a single file by the given file ID.
Params
fileId
const std::string &
ID of the file to get
Returns
File
·
struct containing information about the file
listFiles
Gets a list of files in given Store.
Params
storeId
const std::string &
pagingQuery
const core::PagingQuery &
struct with list query parameters
Returns
core::PagingList<File>
·
struct containing list of files
openFile
Opens a file to read.
Params
fileId
const std::string &
ID of the file to read
Returns
int64_t
·
handle to read file data
readFromFile
Reads file data. Single read call moves the files's cursor position by declared length or set it at the end of the file.
Params
fileHandle
const int64_t
length
const int64_t
size of data to read
Returns
core::Buffer
·
buffer with file data chunk
seekInFile
Moves read cursor.
Params
fileHandle
const int64_t
position
const int64_t
new cursor position
closeFile
Closes the file handle.
Params
fileHandle
const int64_t
Returns
std::string
·
ID of closed file
subscribeForStoreEvents
Subscribes for the Store module main events.
unsubscribeFromStoreEvents
Unsubscribes from the Store module main events.
subscribeForFileEvents
Subscribes for events in given Store.
Params
storeId
const std::string &
unsubscribeFromFileEvents
Unsubscribes from events in given Store.
Params
storeId
const std::string &
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.