import BaseService from "../../service"; import { IService, IResourceMapper, IFindParams } from "../../interfaces"; import BookmarkList, { IBookmarkList, IBookmarkListResource } from "../bookmarkList"; export interface IBookmarkListService extends IService { findByUserId(userId: string, options?: { include: string[]; }): Promise; createList(userId: string, attributes: IBookmarkList): Promise; deleteList(userId: string, listId: string): Promise; updateList(userId: string, list: IBookmarkList): Promise; } export default class BookmarkListService extends BaseService implements IBookmarkListService { resource: string; mapper: IResourceMapper; userId: string; /** * @example http://stable.web.op-api-gateway.qa.lonelyplanet.com/users/jcreamer898/bookmark-lists */ url({userId}: { userId: any; }): string; /** * Find a user's bookmark lists by Id. * By default includes entries and the target's of the entries. * Also adds the `nocache=true` query param * @param userId User Id * @param options * @example * * ```typescript * * client.bookmarkList.findByUserId("1234"}); * ``` */ findByUserId(userId: string, options?: IFindParams): Promise; /** * Create a Bookmark List from a user * @param userId User Id * @param attributes * @example * * ```typescript * * client.bookmarkList.createList("1234", { * name: "My List", * source: "dotcom", * visibility: "public" * }); * ``` */ createList(userId: string, attributes: IBookmarkList): Promise; /** * Delete a bookmark list for a user * @param userId User Id * @example * * ```typescript * * client.bookmarkList.createList("1234", { * name: "My List", * source: "dotcom", * visibility: "public" * }); * ``` */ deleteList(userId: string, listId: string): Promise; /** * Update a list * @param userId User Id * @param list List updates * @example * * ```typescript * * client.bookmarkList.updateList("1234", { * name: "My List", * source: "dotcom", * visibility: "public" * }); * ``` */ updateList(userId: string, list: IBookmarkList): Promise; }