PurchaseApi
public protocol PurchaseApi : BaseApi
Undocumented
-
get(byConsumerId:url:)
Default implementationGet consumer purchase by content url.
Throws
DCoreException.Network.notFound
if no matching was found.Default Implementation
Declaration
Swift
func get(byConsumerId id: AccountObjectIdConvertible, url: URLConvertible) -> Single<Purchase>
Parameters
id
Consumer object id of the account, eg. 1.2.*, as
AccountObjectId
orString
format.url
A url of the content, as
URL
orString
format.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
url
A url of the content, as
URL
orString
format.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
id
Consumer object id of the account, eg. 1.2.*, as
AccountObjectId
orString
format.Return Value
Array
[Purchase]
of open purchases. -
getAllHistorical(byAccountId:)
Default implementationGet a list of historical purchases for consumer id.
Throws
DCoreException.Network.notFound
if no matching block was found.Default Implementation
Declaration
Swift
func getAllHistorical(byAccountId id: AccountObjectIdConvertible) -> Single<[Purchase]>
Parameters
id
Consumer object id of the account, eg. 1.2.*, as
AccountObjectId
orString
format.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
id
Consumer object id of the account, eg. 1.2.*, as
AccountObjectId
orString
format.expression
Search expression.
from
From object id of the history object to start from, as
PurchaseObjectId
orString
format, defaultObjectId.nullObjectId
.order
Sort purchases, default
SearchOrder.Purchases.purchasedDesc
.limit
Limit 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
url
A url of the content, as
URL
orString
format.author
Feedback author account name, default
nil
.startId
Id of feedback object to start searching from, as
PurchaseObjectId
orString
format, defaultObjectId.nullObjectId()
.limit
Limit number of entries, max/default
100
.Return Value
Array
[Purchase]
of purchases.