<commit_before>﻿using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using PinSharp.Api.Responses;
using PinSharp.Models;

namespace PinSharp.Api
{
    internal partial class PinterestApi : IMeApi
    {
        public Task<IDetailedUser> GetUserAsync()
        {
            return GetAsync<IDetailedUser>("me", new RequestOptions(UserFields));
        }

        public Task<IEnumerable<IUserBoard>> GetBoardsAsync()
        {
            var fields = BoardFields.Where(x => !x.StartsWith("creator"));
            return GetAsync<IEnumerable<IUserBoard>>("me/boards", new RequestOptions(fields));
        }

        Task<PagedResponse<IUserPin>> IMeApi.GetPinsAsync(string cursor, int limit)
        {
            var fields = PinFields.Where(x => !x.StartsWith("creator"));
            var responseTask = GetPagedAsync<IUserPin>("me/pins", new RequestOptions(fields, cursor, limit));
            return PagedResponse<IUserPin>.FromTask(responseTask);
        }

        public Task<PagedResponse<IUserPin>> GetLikedPinsAsync(string cursor, int limit)
        {
            var fields = PinFields.Where(x => !x.StartsWith("creator"));
            var responseTask = GetPagedAsync<IUserPin>("me/likes", new RequestOptions(fields, cursor, limit));
            return PagedResponse<IUserPin>.FromTask(responseTask);
        }

        public Task<PagedResponse<IUser>> GetFollowersAsync(string cursor, int limit)
        {
            var responseTask = GetPagedAsync<IUser>("me/followers", new RequestOptions(cursor, limit));
            return PagedResponse<IUser>.FromTask(responseTask);
        }

        public Task<PagedResponse<IBoard>> GetSuggestedBoardsAsync(string pin, string cursor, int limit)
        {
            // NOTE: This endpoint uses 'count' instead of 'limit' for some reason
            var responseTask = GetPagedAsync<IBoard>("me/boards/suggested", new RequestOptions(BoardFields, cursor, new {count = limit}));
            return PagedResponse<IBoard>.FromTask(responseTask);
        }

        public Task<PagedResponse<IBoard>> GetSuggestedBoardsAsync(string cursor, int limit)
        {
            // NOTE: This endpoint uses 'count' instead of 'limit' for some reason
            var responseTask = GetPagedAsync<IBoard>("me/boards/suggested", new RequestOptions(BoardFields, cursor, new {count = limit}));
            return PagedResponse<IBoard>.FromTask(responseTask);
        }

        public Task<PagedResponse<IBoard>> GetFollowingBoardsAsync(string cursor, int limit)
        {
            var responseTask = GetPagedAsync<IBoard>("me/following/boards", new RequestOptions(BoardFields, cursor, limit));
            return PagedResponse<IBoard>.FromTask(responseTask);
        }

        public Task<PagedResponse<Interest>> GetFollowingInterestsAsync(string cursor, int limit)
        {
            var responseTask = GetPagedAsync<Interest>("me/following/interests", new RequestOptions( cursor, limit));
            return PagedResponse<Interest>.FromTask(responseTask);
        }

        public Task<PagedResponse<IUser>> GetFollowingUsersAsync(string cursor, int limit)
        {
            var responseTask = GetPagedAsync<IUser>("me/following/users", new RequestOptions(cursor, limit));
            return PagedResponse<IUser>.FromTask(responseTask);
        }

        public Task<PagedResponse<IUserBoard>> SearchBoardsAsync(string query, string cursor, int limit)
        {
            var fields = BoardFields.Where(x => !x.StartsWith("creator"));
            var responseTask = GetPagedAsync<IUserBoard>($"me/search/boards", new RequestOptions(query, fields, cursor, limit));
            return PagedResponse<IUserBoard>.FromTask(responseTask);
        }

        public Task<PagedResponse<IUserPin>> SearchPinsAsync(string query, string cursor, int limit)
        {
            var fields = PinFields.Where(x => !x.StartsWith("creator"));
            var responseTask = GetPagedAsync<IUserPin>($"me/search/pins",
                new RequestOptions(query, fields, cursor, limit));
            return PagedResponse<IUserPin>.FromTask(responseTask);
        }

        public Task FollowBoardAsync(string board)
        {
            return PostAsync("me/following/boards", new {board});
        }

        public Task UnfollowBoardAsync(string board)
        {
            return DeleteAsync($"me/following/boards/{board}");
        }

        public Task FollowUserAsync(string user)
        {
            return PostAsync("me/following/users", new {user});
        }

        public Task UnfollowUserAsync(string user)
        {
            return DeleteAsync($"me/following/users/{user}");
        }
    }
}<commit_msg>Keep code on the same line<commit_after>﻿using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using PinSharp.Api.Responses;
using PinSharp.Models;

namespace PinSharp.Api
{
    internal partial class PinterestApi : IMeApi
    {
        public Task<IDetailedUser> GetUserAsync()
        {
            return GetAsync<IDetailedUser>("me", new RequestOptions(UserFields));
        }

        public Task<IEnumerable<IUserBoard>> GetBoardsAsync()
        {
            var fields = BoardFields.Where(x => !x.StartsWith("creator"));
            return GetAsync<IEnumerable<IUserBoard>>("me/boards", new RequestOptions(fields));
        }

        Task<PagedResponse<IUserPin>> IMeApi.GetPinsAsync(string cursor, int limit)
        {
            var fields = PinFields.Where(x => !x.StartsWith("creator"));
            var responseTask = GetPagedAsync<IUserPin>("me/pins", new RequestOptions(fields, cursor, limit));
            return PagedResponse<IUserPin>.FromTask(responseTask);
        }

        public Task<PagedResponse<IUserPin>> GetLikedPinsAsync(string cursor, int limit)
        {
            var fields = PinFields.Where(x => !x.StartsWith("creator"));
            var responseTask = GetPagedAsync<IUserPin>("me/likes", new RequestOptions(fields, cursor, limit));
            return PagedResponse<IUserPin>.FromTask(responseTask);
        }

        public Task<PagedResponse<IUser>> GetFollowersAsync(string cursor, int limit)
        {
            var responseTask = GetPagedAsync<IUser>("me/followers", new RequestOptions(cursor, limit));
            return PagedResponse<IUser>.FromTask(responseTask);
        }

        public Task<PagedResponse<IBoard>> GetSuggestedBoardsAsync(string pin, string cursor, int limit)
        {
            // NOTE: This endpoint uses 'count' instead of 'limit' for some reason
            var responseTask = GetPagedAsync<IBoard>("me/boards/suggested", new RequestOptions(BoardFields, cursor, new {count = limit}));
            return PagedResponse<IBoard>.FromTask(responseTask);
        }

        public Task<PagedResponse<IBoard>> GetSuggestedBoardsAsync(string cursor, int limit)
        {
            // NOTE: This endpoint uses 'count' instead of 'limit' for some reason
            var responseTask = GetPagedAsync<IBoard>("me/boards/suggested", new RequestOptions(BoardFields, cursor, new {count = limit}));
            return PagedResponse<IBoard>.FromTask(responseTask);
        }

        public Task<PagedResponse<IBoard>> GetFollowingBoardsAsync(string cursor, int limit)
        {
            var responseTask = GetPagedAsync<IBoard>("me/following/boards", new RequestOptions(BoardFields, cursor, limit));
            return PagedResponse<IBoard>.FromTask(responseTask);
        }

        public Task<PagedResponse<Interest>> GetFollowingInterestsAsync(string cursor, int limit)
        {
            var responseTask = GetPagedAsync<Interest>("me/following/interests", new RequestOptions( cursor, limit));
            return PagedResponse<Interest>.FromTask(responseTask);
        }

        public Task<PagedResponse<IUser>> GetFollowingUsersAsync(string cursor, int limit)
        {
            var responseTask = GetPagedAsync<IUser>("me/following/users", new RequestOptions(cursor, limit));
            return PagedResponse<IUser>.FromTask(responseTask);
        }

        public Task<PagedResponse<IUserBoard>> SearchBoardsAsync(string query, string cursor, int limit)
        {
            var fields = BoardFields.Where(x => !x.StartsWith("creator"));
            var responseTask = GetPagedAsync<IUserBoard>($"me/search/boards", new RequestOptions(query, fields, cursor, limit));
            return PagedResponse<IUserBoard>.FromTask(responseTask);
        }

        public Task<PagedResponse<IUserPin>> SearchPinsAsync(string query, string cursor, int limit)
        {
            var fields = PinFields.Where(x => !x.StartsWith("creator"));
            var responseTask = GetPagedAsync<IUserPin>($"me/search/pins", new RequestOptions(query, fields, cursor, limit));
            return PagedResponse<IUserPin>.FromTask(responseTask);
        }

        public Task FollowBoardAsync(string board)
        {
            return PostAsync("me/following/boards", new {board});
        }

        public Task UnfollowBoardAsync(string board)
        {
            return DeleteAsync($"me/following/boards/{board}");
        }

        public Task FollowUserAsync(string user)
        {
            return PostAsync("me/following/users", new {user});
        }

        public Task UnfollowUserAsync(string user)
        {
            return DeleteAsync($"me/following/users/{user}");
        }
    }
}
{'fraction_non_alphanumeric': 0.10743537921497713, 'fraction_numerical': 0.0, 'mean_word_length': 2.9142381348875936, 'pattern_counts': {'":': 0, '<': 95, '<?xml version=': 0, '>': 105, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '794250', 'n_tokens_mistral': 2553, 'n_tokens_neox': 2504, 'n_words': 525}