PodAPI
public class PodAPI
Provides functions to communicate asynchronously with a Pod (Personal Online Datastore) for storage of data and/or for executing actions
-
Undocumented
Declaration
Swift
var host: String? -
Specifies used http methods
See moreDeclaration
Swift
enum HTTPMethod : String -
Undocumented
See moreDeclaration
Swift
enum HTTPError : Error -
Undocumented
Declaration
Swift
var isConfigured: Bool { get } -
Undocumented
Declaration
Swift
func toJSON(_ result: [String : Any]) throws -> Data -
Undocumented
Declaration
Swift
func simplify(_ item: SchemaItem, create: Bool = false) -> [String : Any]? -
Undocumented
Declaration
Swift
func simplify(_ edge: Edge, create _: Bool = false) -> [String : Any]? -
Retrieves a single data item from the pod
Remark
Note that it is not necessary to specify the type here as the pod has a global namespace for uidsDeclaration
Swift
public func get( _ uid: Int, _ callback: @escaping (_ error: Error?, _ item: Item?) -> Void )Parameters
memriIDThe memriID of the data item to retrieve
callbackFunction that is called when the task is completed either with a result, or an error
-
Undocumented
Declaration
Swift
public func sync( createItems: [SchemaItem]?, updateItems: [SchemaItem]?, deleteItems: [SchemaItem]?, createEdges: [Edge]?, updateEdges: [Edge]?, deleteEdges: [Edge]?, _ callback: @escaping (_ error: Error?) -> Void ) throws -
Undocumented
Declaration
Swift
public func downloadFile( _ uuid: String, _ callback: @escaping (Error?, Double?, HTTPURLResponse?) -> Void ) -
Undocumented
Declaration
Swift
public func uploadFile( _ uuid: String, _ callback: @escaping (Error?, Double?, HTTPURLResponse?) -> Void ) -
Queries the database for a subset of Items and returns a list of Items
Remark
The query language is a WIPDeclaration
Swift
public func query( _ queryOptions: Datasource, withEdges: Bool = true, _ callback: @escaping (_ error: Error?, _ result: [Item]?) -> Void )Parameters
queryOptionsObject describing what to query and how to return the results
callbackFunction that is called when the task is completed either with the results, or an error
-
Runs an importer on the pod
Declaration
Swift
public func runImporter( _ uid: Int, _ callback: @escaping (_ error: Error?, _ success: Bool) -> Void )Parameters
memriIDThe memriID of the data item to remove
callbackFunction that is called when the task is completed either with a result, or an error
-
Runs an indexer on the pod
Declaration
Swift
public func runIndexer( _ uid: Int, _ callback: @escaping (_ error: Error?, _ success: Bool) -> Void )Parameters
memriIDThe memriID of the data item to remove
callbackFunction that is called when the task is completed either with a result, or an error
PodAPI Class Reference