FavoriteAPI interface

An interface representing favorite related APIs

Methods

favoriteItem(FavoriteItemInput)

Favorites an item identified by its object ID.

getItemFavoriteState(GetItemFavoriteStateInput)

Retrieves the favorite state of an item identified by its object ID.

onItemFavoriteStateChange(OnItemFavoriteStateChangeInput, ItemFavoriteStateChangeHandler)

Subscribes to changes in the favorite state of an item identified by its object ID.

unFavoriteItem(UnFavoriteItemInput)

Unfavorites an item identified by its object ID.

Method Details

favoriteItem(FavoriteItemInput)

Favorites an item identified by its object ID.

function favoriteItem(input: FavoriteItemInput): Promise<FavoriteItemOutput>

Parameters

input
FavoriteItemInput

The input containing the object ID of the item to be favorited.

Returns

A promise that resolves with the output of the favorite operation.

getItemFavoriteState(GetItemFavoriteStateInput)

Retrieves the favorite state of an item identified by its object ID.

function getItemFavoriteState(input: GetItemFavoriteStateInput): Promise<GetItemFavoriteStateOutput>

Parameters

input
GetItemFavoriteStateInput

The input containing the object ID of the item.

Returns

A promise that resolves with the favorite state of the item.

onItemFavoriteStateChange(OnItemFavoriteStateChangeInput, ItemFavoriteStateChangeHandler)

Subscribes to changes in the favorite state of an item identified by its object ID.

function onItemFavoriteStateChange(input: OnItemFavoriteStateChangeInput, callback: ItemFavoriteStateChangeHandler): Promise<Unsubscribable>

Parameters

input
OnItemFavoriteStateChangeInput

The input containing the object ID of the item to monitor for changes.

callback
ItemFavoriteStateChangeHandler

The callback function invoked when the favorite state of the item changes.

Returns

Promise<Unsubscribable>

A promise that resolves with an object that can be used to unsubscribe from the subscription.

unFavoriteItem(UnFavoriteItemInput)

Unfavorites an item identified by its object ID.

function unFavoriteItem(input: UnFavoriteItemInput): Promise<UnFavoriteItemOutput>

Parameters

input
UnFavoriteItemInput

The input containing the object ID of the item to be unfavorited.

Returns

A promise that resolves with the output of the unfavorite operation.