예제 #1
0
        internal static BookmarkFolder Create(GfycatClient client, Model folder)
        {
            BookmarkFolder bookmarkFolder = new BookmarkFolder(client, folder.Id);

            bookmarkFolder.Update(folder);
            return(bookmarkFolder);
        }
예제 #2
0
        /// <summary>
        /// Bookmarks this gfy using the specified bookmark folder
        /// </summary>
        /// <param name="folder"></param>
        /// <param name="options">The options for this request</param>
        /// <returns></returns>
        public async Task BookmarkAsync(BookmarkFolder folder = null, RequestOptions options = null)
        {
            await Client.ApiClient.BookmarkGfyAsync(Id, folder?.Id, options).ConfigureAwait(false);

            await UpdateAsync().ConfigureAwait(false);

            await(folder?.UpdateAsync()).ConfigureAwait(false);
        }
예제 #3
0
        /// <summary>
        /// Moves the specified gfys to another bookmark folder
        /// </summary>
        /// <param name="folderToMoveTo"></param>
        /// <param name="gfysToMove"></param>
        /// <param name="options"></param>
        /// <returns></returns>
        public async Task MoveGfysAsync(BookmarkFolder folderToMoveTo, IEnumerable <Gfy> gfysToMove, RequestOptions options = null)
        {
            await Client.ApiClient.MoveBookmarkedGfysAsync(Id, new API.GfyFolderAction()
            {
                Action = "move_contents", GfycatIds = gfysToMove.Select(g => g.Id), ParentId = folderToMoveTo.Id
            }, options).ConfigureAwait(false);

            await UpdateAsync(options).ConfigureAwait(false);

            await folderToMoveTo.UpdateAsync().ConfigureAwait(false);
        }
예제 #4
0
 /// <summary>
 /// Gets the contents of this album
 /// </summary>
 /// <param name="options"></param>
 /// <returns></returns>
 public async Task <BookmarkFolder> GetContentsAsync(RequestOptions options = null)
 {
     return(BookmarkFolder.Create(Client, await Client.ApiClient.GetBookmarkFolderContentsAsync(Id, options).ConfigureAwait(false)));
 }