BookmarkService
public protocol BookmarkService
The service contract for Bookmarking feature.
-
Retrieves the bookmark instance for a given content ID and provides bookmark record when the request is success.Returns error when the request is failed.
Declaration
Swift
func getBookmark(itemId: String, completion: @escaping (Result<BookmarkRecord, Error>) -> Void)Parameters
itemIdThe unique identifier fo content.
completionThe handle to invoke on request completion
-
Retrieves all bookmarks from bookmark server. Upon completion provides the list of BookmarkRecords or error.
Declaration
Swift
func getBookmarks(pageNumber: Int?, pageSize: Int?, sortBy: SortBy?, sortOrder: SortOrder?, completion: @escaping (Result<[BookmarkRecord], Error>) -> Void) -
Retrieves requested series-level bookmarks from bookmark server. Upon completion provides the list of BookmarkRecords or error.
Declaration
Swift
func getSeriesBookmarks(seriesIdentifier: String, pageNumber: Int?, pageSize: Int?, sortBy: SortBy?, sortOrder: SortOrder?, completion: @escaping (Result<[BookmarkRecord], Error>) -> Void) -
Retrieves all video bookmarks for a given playlist. Upon completion provides the list of BookmarkRecords or error.
Declaration
Swift
func getPlaylistBookmarks(playlistIdentifier: String, pageNumber: Int?, pageSize: Int?, sortBy: SortBy?, sortOrder: SortOrder?, completion: @escaping (Result<[BookmarkRecord], Error>) -> Void) -
Retrieves the count of all bookmarks from Bookmarks server and provides the BookmarkCount when the request is success.Returns error when the request is failed.
Declaration
Swift
func getBookmarkCount(completion: @escaping (Result<Int, Error>) -> Void)Parameters
completionThe handle to invoke on request completion
-
putBookmark(itemId:Default implementationoffset: seasonId: episodeId: videoId: mode: seasonNumber: episodeNumber: contentType: completion: ) Inserts bookmark instance for a given content ID and provides the error when the request is failed.
Default Implementation
Declaration
Swift
func putBookmark( itemId: String, offset: TimeInterval, seasonId: String?, episodeId: String?, videoId: String?, mode: Mode?, seasonNumber: Int?, episodeNumber: Int?, contentType: String?, completion: @escaping (Result<Void, Error>) -> Void ) -
deleteBookmark(itemId:Default implementationepisodeId: videoId: mode: completion: ) Deletes bookmark for a given content ID provides the error when the request is failed.
Default Implementation
Declaration
Swift
func deleteBookmark( itemId: String, episodeId: String?, videoId: String?, mode: Mode?, completion: @escaping (Result<Void, Error>) -> Void )