public async Task GetTagsAsync() { var apiConnection = Substitute.For <IApiConnection>(); var client = new FollowClient(apiConnection); await client.GetTagsAsync(); await apiConnection.Received().ExecuteGetCollectionAsync <FollowedTag>("follows/tags"); }
/// <inheritdoc /> internal UserClient(PixivClient pixivClient) : base(pixivClient) { Bookmarks = new BookmarksClient(pixivClient); BookmarkTags = new BookmarkTagsClient(pixivClient); BrowsingHistory = new BrowsingHistoryClient(pixivClient); Me = new MeClient(pixivClient); Profile = new ProfileClient(pixivClient); Workspace = new WorkspaceClient(pixivClient); Follow = new FollowClient(pixivClient); }
public async Task OfCurrentUser_PassesQueryParams() { var api = new Mock <IAPIConnector>(); var client = new FollowClient(api.Object); var request = new FollowOfCurrentUserRequest(FollowOfCurrentUserRequest.Type.Artist); await client.OfCurrentUser(request); api.Verify(a => a.Get <FollowedArtistsResponse>( SpotifyUrls.CurrentUserFollower(), It.Is <Dictionary <string, string> >(val => val.ContainsKey("type")) )); }
/// <summary> /// API client /// </summary> /// <remarks> /// See the <a href="https://docs.dev.to/api/#section/Authentication/api_key">Authentication</a> for more information /// </remarks> /// <param name="apiUrl">API connection url</param> /// <param name="token">API key</param> public DevToClient(string apiUrl, string token) { var restClient = new RestClient(apiUrl); restClient.AddDefaultHeader("api-key", token); restClient.AddDefaultHeader("User-Agent", "DevToAPI-client-dotnet"); var apiConnection = new ApiConnection(restClient); AdminConfigurations = new AdminConfigurationClient(apiConnection); Articles = new ArticleClient(apiConnection); Comments = new CommentClient(apiConnection); Followers = new FollowerClient(apiConnection); Follows = new FollowClient(apiConnection); Listings = new ListingClient(apiConnection); Organizations = new OrganizationClient(apiConnection); PodcastEpisodes = new PodcastEpisodeClient(apiConnection); ReadingLists = new ReadingListClient(apiConnection); Tags = new TagClient(apiConnection); Users = new UserClient(apiConnection); Videos = new VideoClient(apiConnection); Webhooks = new WebhookClient(apiConnection); ProfileImages = new ProfileImageClient(apiConnection); }
public Task <FollowChannelResponse> GetFollowChannelAsync(uint limit = 25, uint page = 0) { return(FollowClient.GetFollowChannelAsync(_context, limit, page)); }
public Task <ChannelAuthorityResponse> GetChannelAuthorityAsync(uint channelNumberId) { return(FollowClient.GetChannelAuthorityAsync(_context, channelNumberId)); }
public Task <ContentManageResult> RemoveFollowCommunityAsync(string communityId) { return(FollowClient.RemoveFollowCommunityAsync(_context, communityId)); }
public Task <CommunityAuthorityResponse> GetCommunityAuthorityAsync(string communityId) { return(FollowClient.GetCommunityAuthorityAsync(_context, communityId)); }
public Task <UserOwnedCommunityResponse> GetUserOwnedCommunitiesAsync(uint userId) { return(FollowClient.GetUserOwnedCommunitiesAsync(_context, userId)); }