StoreApi
Swift wrapper for privmx.NativeStoreApiWrapper
, providing functionality to manage Stores and files within PrivMX platform.
Static Methods
create(connection:)
Creates a new instance of `StoreApi` from a connection object. This method initializes the `StoreApi` instance, enabling Store-related operations over the specified connection.
public static func create(
connection: inout Connection
) throws -> StoreApi
Name | Type | Description |
---|---|---|
connection | inout Connection | The connection object used for Store operations. |
Type | Description |
---|---|
StoreApi | A newly created `StoreApi` instance. |
Methods
listStores(contextId:query:)
Lists all Stores the user has access to within a specified Context.
public func listStores(
contextId: std.string,
query: privmx.endpoint.core.PagingQuery
) throws -> privmx.StoreList
Name | Type | Description |
---|---|---|
contextId | std.string | The Context from which the Stores should be listed. |
query | privmx.endpoint.core.PagingQuery | A `PagingQuery` object to filter and paginate the results. |
Type | Description |
---|---|
privmx.StoreList | A `privmx.StoreList` instance containing the list of Stores. |
getStore(storeId:)
Retrieves detailed information about a specified Store.
public func getStore(
storeId: std.string
) throws -> privmx.endpoint.store.Store
Name | Type | Description |
---|---|---|
storeId | std.string | The unique identifier of the Store to retrieve. |
Type | Description |
---|---|
privmx.endpoint.store.Store | A `privmx.endpoint.store.Store` instance containing Store details. |
createStore(contextId:users:managers:publicMeta:privateMeta:)
Creates a new Store within a specified Context. This method creates a new Store with specified users and managers. Note that managers must be added as users to gain access to the Store.
public func createStore(
contextId: std.string,
users: privmx.UserWithPubKeyVector,
managers: privmx.UserWithPubKeyVector,
publicMeta: privmx.endpoint.core.Buffer,
privateMeta: privmx.endpoint.core.Buffer
) throws -> std.string
Name | Type | Description |
---|---|---|
contextId | std.string | The Context in which the Store should be created. |
users | privmx.UserWithPubKeyVector | A vector of users who will have access to the Store. |
managers | privmx.UserWithPubKeyVector | A vector of managers responsible for the Store. |
publicMeta | privmx.endpoint.core.Buffer | Public metadata for the Store, which will not be encrypted. |
privateMeta | privmx.endpoint.core.Buffer | Private metadata for the Store, which will be encrypted. |
Type | Description |
---|---|
std.string | The ID of the newly created Store as a `std.string`. |