WishlistInteractor
public protocol WishlistInteractor: class
Wishlist Interactor protocol.
-
Wishlist items recently updated.
Declaration
Swift
var wishlistItems: [Wishlistable] -
Wishlist data manager.
Declaration
Swift
var wishlistDataManager: WishlistDataManager -
wishlist(accountId:filter:limit:offset:completion:)Default implementationGet the entire user’s wishlist. Can also get a filtered list of products and paginate the results.
Default Implementation
Indicates the product ids wishlist states.
Parameter
Parameter productIds: The product ids to use.Returns
The wishlist items that are accessible from the wishlist.Declaration
Swift
func wishlist(accountId: String,Parameters
accountIdThe user’s account id.
filterList of item ids to use as a filter for the returned list.
limitThe number of records to return. Default value is 100.
offsetUsed to paginate. First page of results is 0. Default value is 0
completionThe completion block.
Return Value
The local state of the items. Used to provide instant feedback while the API call performs.
-
wishlistItem(itemId:accountId:completion:)Default implementationGet a specific item by using its id.
Default Implementation
Indicates the product ids wishlist states.
Parameter
Parameter productIds: The product ids to use.Returns
The wishlist items that are accessible from the wishlist.Declaration
Swift
func wishlistItem(itemId: String,Parameters
itemIdThe item id to get.
accountIdThe user’s account id.
completionThe completion block.
Return Value
The local state of the item. Used to provide instant feedback while the API call performs.
-
addWishlistItem(itemId:accountId:completion:)Default implementationAdds an item to the wishlist.
Default Implementation
Indicates the product ids wishlist states.
Parameter
Parameter productIds: The product ids to use.Returns
The wishlist items that are accessible from the wishlist.Declaration
Swift
func addWishlistItem(itemId: String,Parameters
itemIdThe item id to add.
accountIdThe user’s account id.
completionThe completion block.
-
removeWishlistItem(itemId:accountId:completion:)Default implementationRemoves an item from the wishlist.
Default Implementation
Indicates the product ids wishlist states.
Parameter
Parameter productIds: The product ids to use.Returns
The wishlist items that are accessible from the wishlist.Declaration
Swift
func removeWishlistItem(itemId: String,Parameters
itemIdThe item id to remove.
accountIdThe user’s account id.
completionThe completion block.
-
updateWishlistItems(items:accountId:completion:)Default implementationUpdates a bulk of items for the user’s account. * Items with
state=Wishlistedwill be added. * Items withstate=Unlistedwill be removed from the wishlist.Default Implementation
Indicates the product ids wishlist states.
Parameter
Parameter productIds: The product ids to use.Returns
The wishlist items that are accessible from the wishlist.Declaration
Swift
func updateWishlistItems(items: [Wishlistable],Parameters
itemsThe items to update.
accountIdThe user’s account id.
completionThe completion block.
-
wishlistState(forProductId:)Default implementationIndicates the product id wishlist state.
Default Implementation
Indicates the product ids wishlist states.
Parameter
Parameter productIds: The product ids to use.Returns
The wishlist items that are accessible from the wishlist.Declaration
Swift
func wishlistState(forProductId productId: String) -> WishlistItemStateParameters
productIdThe product id to use.
Return Value
The product id state in the wishlist.
-
wishlistItems(forProductIds:)Default implementationIndicates the product ids wishlist states.
Parameter
Parameter productIds: The product ids to use.Returns
The wishlist items that are accessible from the wishlist.Default Implementation
Indicates the product ids wishlist states.
Parameter
Parameter productIds: The product ids to use.Returns
The wishlist items that are accessible from the wishlist.Declaration
Swift
func wishlistItems(forProductIds productIds: [String]) -> [Wishlistable]Parameters
productIdsThe product ids to use.
Return Value
The wishlist items that are accessible from the wishlist.
-
resetWishlist()Extension methodResets the wishlist. Call this function when the user logs out or when no account id is available.
Declaration
Swift
func resetWishlist()
WishlistInteractor Protocol Reference