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
  • Get 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

    accountId

    The user’s account id.

    filter

    List of item ids to use as a filter for the returned list.

    limit

    The number of records to return. Default value is 100.

    offset

    Used to paginate. First page of results is 0. Default value is 0

    completion

    The completion block.

    Return Value

    The local state of the items. Used to provide instant feedback while the API call performs.

  • Get 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

    itemId

    The item id to get.

    accountId

    The user’s account id.

    completion

    The completion block.

    Return Value

    The local state of the item. Used to provide instant feedback while the API call performs.

  • Adds 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

    itemId

    The item id to add.

    accountId

    The user’s account id.

    completion

    The completion block.

  • Removes 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

    itemId

    The item id to remove.

    accountId

    The user’s account id.

    completion

    The completion block.

  • Updates a bulk of items for the user’s account. * Items with state=Wishlisted will be added. * Items with state=Unlisted will 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

    items

    The items to update.

    accountId

    The user’s account id.

    completion

    The completion block.

  • wishlistState(forProductId:) Default implementation

    Indicates 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) -> WishlistItemState

    Parameters

    productId

    The product id to use.

    Return Value

    The product id state in the wishlist.

  • wishlistItems(forProductIds:) 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.

    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

    productIds

    The product ids to use.

    Return Value

    The wishlist items that are accessible from the wishlist.

  • resetWishlist() Extension method

    Resets the wishlist. Call this function when the user logs out or when no account id is available.

    Declaration

    Swift

    func resetWishlist()