PurchaseApi
public protocol PurchaseApi : BaseApi
Undocumented
-
get(byConsumerId:url:)Default implementationGet consumer purchase by content url.
Throws
DCoreException.Network.notFoundif no matching was found.Default Implementation
Declaration
Swift
func get(byConsumerId id: AccountObjectIdConvertible, url: URLConvertible) -> Single<Purchase>Parameters
idConsumer object id of the account, eg. 1.2.*, as
AccountObjectIdorStringformat.urlA url of the content, as
URLorStringformat.Return Value
-
getAllOpen()Default implementationGet a list of open purchases.
Default Implementation
Declaration
Swift
func getAllOpen() -> Single<[Purchase]>Return Value
Array
[Purchase]of open purchases. -
getAllOpen(byUrl:)Default implementationGet a list of open purchases for content URL.
Default Implementation
Declaration
Swift
func getAllOpen(byUrl url: URLConvertible) -> Single<[Purchase]>Parameters
urlA url of the content, as
URLorStringformat.Return Value
Array
[Purchase]of open purchases. -
getAllOpen(byAccountId:)Default implementationGet a list of open purchases for consumer id.
Default Implementation
Declaration
Swift
func getAllOpen(byAccountId id: AccountObjectIdConvertible) -> Single<[Purchase]>Parameters
idConsumer object id of the account, eg. 1.2.*, as
AccountObjectIdorStringformat.Return Value
Array
[Purchase]of open purchases. -
getAllHistorical(byAccountId:)Default implementationGet a list of historical purchases for consumer id.
Throws
DCoreException.Network.notFoundif no matching block was found.Default Implementation
Declaration
Swift
func getAllHistorical(byAccountId id: AccountObjectIdConvertible) -> Single<[Purchase]>Parameters
idConsumer object id of the account, eg. 1.2.*, as
AccountObjectIdorStringformat.Return Value
Array
[Purchase]of historical purchases. -
findAll(byConsumerId:expression:from:order:limit:)Default implementationSearch consumer open and historical purchases.
Default Implementation
Declaration
Swift
func findAll(byConsumerId id: AccountObjectIdConvertible, expression: String, from: ObjectIdConvertible, order: SearchOrder.Purchases, limit: Int) -> Single<[Purchase]>Parameters
idConsumer object id of the account, eg. 1.2.*, as
AccountObjectIdorStringformat.expressionSearch expression.
fromFrom object id of the history object to start from, as
PurchaseObjectIdorStringformat, defaultObjectId.nullObjectId.orderSort purchases, default
SearchOrder.Purchases.purchasedDesc.limitLimit number of entries, max/default
100.Return Value
Array
[Purchase]of purchases. -
findAllFeedback(byUrl:author:startId:limit:)Default implementationSearch for feedback.
Default Implementation
Declaration
Swift
func findAllFeedback(byUrl url: URLConvertible, author: String?, startId: ObjectIdConvertible, limit: Int) -> Single<[Purchase]>Parameters
urlA url of the content, as
URLorStringformat.authorFeedback author account name, default
nil.startIdId of feedback object to start searching from, as
PurchaseObjectIdorStringformat, defaultObjectId.nullObjectId().limitLimit number of entries, max/default
100.Return Value
Array
[Purchase]of purchases.
View on GitHub
Install in Dash
PurchaseApi Protocol Reference