diff --git a/Octokit.Reactive/Clients/IObservableStarredClient.cs b/Octokit.Reactive/Clients/IObservableStarredClient.cs index 8938e244..55ddef1a 100644 --- a/Octokit.Reactive/Clients/IObservableStarredClient.cs +++ b/Octokit.Reactive/Clients/IObservableStarredClient.cs @@ -2,6 +2,12 @@ namespace Octokit.Reactive { + /// + /// A client for GitHub's Activity Starring API. + /// + /// + /// See the Activity Starring API documentation for more information. + /// public interface IObservableStarredClient { /// @@ -10,9 +16,15 @@ namespace Octokit.Reactive /// The owner of the repository /// The name of the repository /// Thrown if the client is not authenticated - /// A of s starring the passed repository IObservable GetAllStargazers(string owner, string name); + /// + /// Retrieves all of the stargazers for the passed repository + /// + /// The ID of the repository + /// Thrown if the client is not authenticated + IObservable GetAllStargazers(int repositoryId); + /// /// Retrieves all of the stargazers for the passed repository /// @@ -20,8 +32,15 @@ namespace Octokit.Reactive /// The name of the repository /// Options for changing the API response /// Thrown if the client is not authenticated - /// A of s starring the passed repository IObservable GetAllStargazers(string owner, string name, ApiOptions options); + + /// + /// Retrieves all of the stargazers for the passed repository + /// + /// The ID of the repository + /// Options for changing the API response + /// Thrown if the client is not authenticated + IObservable GetAllStargazers(int repositoryId, ApiOptions options); /// /// Retrieves all of the stargazers for the passed repository with star creation timestamps. @@ -29,8 +48,14 @@ namespace Octokit.Reactive /// The owner of the repository /// The name of the repository /// Thrown if the client is not authenticated. - /// A of s starring the passed repository with star creation timestamps. IObservable GetAllStargazersWithTimestamps(string owner, string name); + + /// + /// Retrieves all of the stargazers for the passed repository with star creation timestamps. + /// + /// The ID of the repository + /// Thrown if the client is not authenticated. + IObservable GetAllStargazersWithTimestamps(int repositoryId); /// /// Retrieves all of the stargazers for the passed repository with star creation timestamps. @@ -39,43 +64,38 @@ namespace Octokit.Reactive /// The name of the repository /// Options for changing the API response /// Thrown if the client is not authenticated. - /// A of s starring the passed repository with star creation timestamps. IObservable GetAllStargazersWithTimestamps(string owner, string name, ApiOptions options); + /// + /// Retrieves all of the stargazers for the passed repository with star creation timestamps. + /// + /// The ID of the repository + /// Options for changing the API response + /// Thrown if the client is not authenticated. + IObservable GetAllStargazersWithTimestamps(int repositoryId, ApiOptions options); + /// /// Retrieves all of the starred (ies) for the current user /// /// Thrown if the client is not authenticated - /// - /// A of (ies) starred by the current user - /// IObservable GetAllForCurrent(); /// /// Retrieves all of the starred (ies) for the current user /// /// Thrown if the client is not authenticated - /// - /// A of (ies) starred by the current user - /// IObservable GetAllForCurrent(ApiOptions options); /// /// Retrieves all of the starred (ies) for the current user with star creation timestamps. /// /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the current authenticated user with star creation timestamps. - /// IObservable GetAllForCurrentWithTimestamps(); /// /// Retrieves all of the starred (ies) for the current user with star creation timestamps. /// /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the current authenticated user with star creation timestamps. - /// IObservable GetAllForCurrentWithTimestamps(ApiOptions options); /// @@ -83,10 +103,6 @@ namespace Octokit.Reactive /// /// Star-specific request parameters that sort the results /// Thrown if the client is not authenticated - /// - /// A of (ies) starred by the current user, - /// sorted according to the passed request parameters - /// IObservable GetAllForCurrent(StarredRequest request); /// @@ -95,10 +111,6 @@ namespace Octokit.Reactive /// Star-specific request parameters that sort the results /// Options for changing the API response /// Thrown if the client is not authenticated - /// - /// A of (ies) starred by the current user, - /// sorted according to the passed request parameters - /// IObservable GetAllForCurrent(StarredRequest request, ApiOptions options); /// @@ -106,10 +118,6 @@ namespace Octokit.Reactive /// /// Star-specific request parameters that sort the results /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the current user, - /// sorted according to the passed request parameters and with star creation timestamps. - /// IObservable GetAllForCurrentWithTimestamps(StarredRequest request); /// @@ -118,10 +126,6 @@ namespace Octokit.Reactive /// Star-specific request parameters that sort the results /// Options for changing the API response /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the current user, - /// sorted according to the passed request parameters and with star creation timestamps. - /// IObservable GetAllForCurrentWithTimestamps(StarredRequest request, ApiOptions options); /// @@ -129,7 +133,6 @@ namespace Octokit.Reactive /// /// The login of the user /// Thrown if the client is not authenticated - /// A starred by the specified user IObservable GetAllForUser(string user); /// @@ -138,7 +141,6 @@ namespace Octokit.Reactive /// The login of the user /// Options for changing the API response /// Thrown if the client is not authenticated - /// A starred by the specified user IObservable GetAllForUser(string user, ApiOptions options); /// @@ -146,9 +148,6 @@ namespace Octokit.Reactive /// /// The login of the user /// Thrown if the client is not authenticated. - /// - /// A (ies) starred by the specified user with star creation timestamps. - /// IObservable GetAllForUserWithTimestamps(string user); /// @@ -157,9 +156,6 @@ namespace Octokit.Reactive /// The login of the user /// Options for changing the API response /// Thrown if the client is not authenticated. - /// - /// A (ies) starred by the specified user with star creation timestamps. - /// IObservable GetAllForUserWithTimestamps(string user, ApiOptions options); /// @@ -168,7 +164,6 @@ namespace Octokit.Reactive /// The login of the user /// Star-specific request parameters that sort the results /// Thrown if the client is not authenticated - /// A starred by the specified user IObservable GetAllForUser(string user, StarredRequest request); /// @@ -178,7 +173,6 @@ namespace Octokit.Reactive /// Star-specific request parameters that sort the results /// Options for changing the API response /// Thrown if the client is not authenticated - /// A starred by the specified user IObservable GetAllForUser(string user, StarredRequest request, ApiOptions options); /// @@ -187,10 +181,6 @@ namespace Octokit.Reactive /// The login of the user /// Star-specific request parameters that sort the results /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the specified user, - /// sorted according to the passed request parameters and with star creation timestamps. - /// IObservable GetAllForUserWithTimestamps(string user, StarredRequest request); /// @@ -200,10 +190,6 @@ namespace Octokit.Reactive /// Star-specific request parameters that sort the results /// Options for changing the API response /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the specified user, - /// sorted according to the passed request parameters and with star creation timestamps. - /// IObservable GetAllForUserWithTimestamps(string user, StarredRequest request, ApiOptions options); /// @@ -212,7 +198,6 @@ namespace Octokit.Reactive /// The owner of the repository /// The name of the repository /// Thrown if the client is not authenticated. - /// A bool representing the success of the operation IObservable CheckStarred(string owner, string name); /// @@ -220,7 +205,6 @@ namespace Octokit.Reactive /// /// The owner of the repository to star /// The name of the repository to star - /// A bool representing the success of starring IObservable StarRepo(string owner, string name); /// @@ -228,7 +212,6 @@ namespace Octokit.Reactive /// /// The owner of the repository to unstar /// The name of the repository to unstar - /// A bool representing the success of the operation IObservable RemoveStarFromRepo(string owner, string name); } } diff --git a/Octokit.Reactive/Clients/ObservableStarredClient.cs b/Octokit.Reactive/Clients/ObservableStarredClient.cs index 58e59940..45ef771b 100644 --- a/Octokit.Reactive/Clients/ObservableStarredClient.cs +++ b/Octokit.Reactive/Clients/ObservableStarredClient.cs @@ -4,6 +4,12 @@ using Octokit.Reactive.Internal; namespace Octokit.Reactive { + /// + /// A client for GitHub's Activity Starring API. + /// + /// + /// See the Activity Starring API documentation for more information. + /// public class ObservableStarredClient : IObservableStarredClient { private readonly IStarredClient _client; @@ -23,7 +29,6 @@ namespace Octokit.Reactive /// The owner of the repository /// The name of the repository /// Thrown if the client is not authenticated - /// A of s starring the passed repository public IObservable GetAllStargazers(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -32,6 +37,16 @@ namespace Octokit.Reactive return GetAllStargazers(owner, name, ApiOptions.None); } + /// + /// Retrieves all of the stargazers for the passed repository + /// + /// The ID of the repository + /// Thrown if the client is not authenticated + public IObservable GetAllStargazers(int repositoryId) + { + return GetAllStargazers(repositoryId, ApiOptions.None); + } + /// /// Retrieves all of the stargazers for the passed repository /// @@ -39,7 +54,6 @@ namespace Octokit.Reactive /// The name of the repository /// Options for changing the API response /// Thrown if the client is not authenticated - /// A of s starring the passed repository public IObservable GetAllStargazers(string owner, string name, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -49,13 +63,25 @@ namespace Octokit.Reactive return _connection.GetAndFlattenAllPages(ApiUrls.Stargazers(owner, name), options); } + /// + /// Retrieves all of the stargazers for the passed repository + /// + /// The ID of the repository + /// Options for changing the API response + /// Thrown if the client is not authenticated + public IObservable GetAllStargazers(int repositoryId, ApiOptions options) + { + Ensure.ArgumentNotNull(options, "options"); + + return _connection.GetAndFlattenAllPages(ApiUrls.Stargazers(repositoryId), options); + } + /// /// Retrieves all of the stargazers for the passed repository with star creation timestamps. /// /// The owner of the repository /// The name of the repository /// Thrown if the client is not authenticated. - /// A of s starring the passed repository with star creation timestamps. public IObservable GetAllStargazersWithTimestamps(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -64,6 +90,16 @@ namespace Octokit.Reactive return GetAllStargazersWithTimestamps(owner, name, ApiOptions.None); } + /// + /// Retrieves all of the stargazers for the passed repository with star creation timestamps. + /// + /// The ID of the repository + /// Thrown if the client is not authenticated. + public IObservable GetAllStargazersWithTimestamps(int repositoryId) + { + return GetAllStargazersWithTimestamps(repositoryId, ApiOptions.None); + } + /// /// Retrieves all of the stargazers for the passed repository with star creation timestamps. /// @@ -71,7 +107,6 @@ namespace Octokit.Reactive /// The name of the repository /// Options for changing the API response /// Thrown if the client is not authenticated. - /// A of s starring the passed repository with star creation timestamps. public IObservable GetAllStargazersWithTimestamps(string owner, string name, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -81,13 +116,23 @@ namespace Octokit.Reactive return _connection.GetAndFlattenAllPages(ApiUrls.Stargazers(owner, name), null, AcceptHeaders.StarCreationTimestamps, options); } + /// + /// Retrieves all of the stargazers for the passed repository with star creation timestamps. + /// + /// The ID of the repository + /// Options for changing the API response + /// Thrown if the client is not authenticated. + public IObservable GetAllStargazersWithTimestamps(int repositoryId, ApiOptions options) + { + Ensure.ArgumentNotNull(options, "options"); + + return _connection.GetAndFlattenAllPages(ApiUrls.Stargazers(repositoryId), null, AcceptHeaders.StarCreationTimestamps, options); + } + /// /// Retrieves all of the starred (ies) for the current user /// /// Thrown if the client is not authenticated - /// - /// A of (ies) starred by the current user - /// public IObservable GetAllForCurrent() { return GetAllForCurrent(ApiOptions.None); @@ -97,9 +142,6 @@ namespace Octokit.Reactive /// Retrieves all of the starred (ies) for the current user /// /// Thrown if the client is not authenticated - /// - /// A of (ies) starred by the current user - /// public IObservable GetAllForCurrent(ApiOptions options) { Ensure.ArgumentNotNull(options, "options"); @@ -111,9 +153,6 @@ namespace Octokit.Reactive /// Retrieves all of the starred (ies) for the current user with star creation timestamps. /// /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the current authenticated user with star creation timestamps. - /// public IObservable GetAllForCurrentWithTimestamps() { return GetAllForCurrentWithTimestamps(ApiOptions.None); @@ -123,9 +162,6 @@ namespace Octokit.Reactive /// Retrieves all of the starred (ies) for the current user with star creation timestamps. /// /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the current authenticated user with star creation timestamps. - /// public IObservable GetAllForCurrentWithTimestamps(ApiOptions options) { Ensure.ArgumentNotNull(options, "options"); @@ -138,10 +174,6 @@ namespace Octokit.Reactive /// /// Star-specific request parameters that sort the results /// Thrown if the client is not authenticated - /// - /// A of (ies) starred by the current user, - /// sorted according to the passed request parameters - /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")] public IObservable GetAllForCurrent(StarredRequest request) { @@ -156,10 +188,6 @@ namespace Octokit.Reactive /// Star-specific request parameters that sort the results /// Options for changing the API response /// Thrown if the client is not authenticated - /// - /// A of (ies) starred by the current user, - /// sorted according to the passed request parameters - /// public IObservable GetAllForCurrent(StarredRequest request, ApiOptions options) { Ensure.ArgumentNotNull(request, "request"); @@ -173,10 +201,6 @@ namespace Octokit.Reactive /// /// Star-specific request parameters that sort the results /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the current user, - /// sorted according to the passed request parameters and with star creation timestamps. - /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")] public IObservable GetAllForCurrentWithTimestamps(StarredRequest request) { @@ -191,10 +215,6 @@ namespace Octokit.Reactive /// Star-specific request parameters that sort the results /// Options for changing the API response /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the current user, - /// sorted according to the passed request parameters and with star creation timestamps. - /// public IObservable GetAllForCurrentWithTimestamps(StarredRequest request, ApiOptions options) { Ensure.ArgumentNotNull(request, "request"); @@ -208,7 +228,6 @@ namespace Octokit.Reactive /// /// The login of the user /// Thrown if the client is not authenticated - /// A starred by the specified user public IObservable GetAllForUser(string user) { Ensure.ArgumentNotNullOrEmptyString(user, "user"); @@ -222,7 +241,6 @@ namespace Octokit.Reactive /// The login of the user /// Options for changing the API response /// Thrown if the client is not authenticated - /// A starred by the specified user public IObservable GetAllForUser(string user, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(user, "user"); @@ -236,9 +254,6 @@ namespace Octokit.Reactive /// /// The login of the user /// Thrown if the client is not authenticated. - /// - /// A (ies) starred by the specified user with star creation timestamps. - /// public IObservable GetAllForUserWithTimestamps(string user) { Ensure.ArgumentNotNullOrEmptyString(user, "user"); @@ -252,9 +267,6 @@ namespace Octokit.Reactive /// The login of the user /// Options for changing the API response /// Thrown if the client is not authenticated. - /// - /// A (ies) starred by the specified user with star creation timestamps. - /// public IObservable GetAllForUserWithTimestamps(string user, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(user, "user"); @@ -269,7 +281,6 @@ namespace Octokit.Reactive /// The login of the user /// Star-specific request parameters that sort the results /// Thrown if the client is not authenticated - /// A starred by the specified user [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")] public IObservable GetAllForUser(string user, StarredRequest request) { @@ -286,7 +297,6 @@ namespace Octokit.Reactive /// Star-specific request parameters that sort the results /// Options for changing the API response /// Thrown if the client is not authenticated - /// A starred by the specified user public IObservable GetAllForUser(string user, StarredRequest request, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(user, "user"); @@ -302,10 +312,6 @@ namespace Octokit.Reactive /// The login of the user /// Star-specific request parameters that sort the results /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the specified user, - /// sorted according to the passed request parameters and with star creation timestamps. - /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")] public IObservable GetAllForUserWithTimestamps(string user, StarredRequest request) { @@ -322,10 +328,6 @@ namespace Octokit.Reactive /// Star-specific request parameters that sort the results /// Options for changing the API response /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the specified user, - /// sorted according to the passed request parameters and with star creation timestamps. - /// public IObservable GetAllForUserWithTimestamps(string user, StarredRequest request, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(user, "user"); @@ -341,7 +343,6 @@ namespace Octokit.Reactive /// The owner of the repository /// The name of the repository /// Thrown if the client is not authenticated. - /// A bool representing the success of the operation public IObservable CheckStarred(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -355,7 +356,6 @@ namespace Octokit.Reactive /// /// The owner of the repository to star /// The name of the repository to star - /// A bool representing the success of starring public IObservable StarRepo(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -369,7 +369,6 @@ namespace Octokit.Reactive /// /// The owner of the repository to unstar /// The name of the repository to unstar - /// A bool representing the success of the operation public IObservable RemoveStarFromRepo(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); diff --git a/Octokit.Tests.Integration/Clients/StarredClientTests.cs b/Octokit.Tests.Integration/Clients/StarredClientTests.cs index 82f8a2f3..0196a5e7 100644 --- a/Octokit.Tests.Integration/Clients/StarredClientTests.cs +++ b/Octokit.Tests.Integration/Clients/StarredClientTests.cs @@ -8,14 +8,13 @@ namespace Octokit.Tests.Integration.Clients { public class StarredClientTests : IDisposable { - private readonly IGitHubClient _client; private readonly IStarredClient _fixture; private readonly RepositoryContext _repositoryContext; public StarredClientTests() { - _client = Helper.GetAuthenticatedClient(); - _fixture = _client.Activity.Starring; + var client = Helper.GetAuthenticatedClient(); + _fixture = client.Activity.Starring; var github = Helper.GetAuthenticatedClient(); var repoName = Helper.MakeNameWithTimestamp("public-repo1"); @@ -613,6 +612,16 @@ namespace Octokit.Tests.Integration.Clients Assert.NotNull(user); } + [IntegrationTest] + public async Task CanGetAllStargazersWithRepositoryId() + { + var users = await _fixture.GetAllStargazers(_repositoryContext.Repository.Id); + Assert.NotEmpty(users); + + var user = users.FirstOrDefault(u => u.Login == Helper.UserName); + Assert.NotNull(user); + } + [IntegrationTest] public async Task ReturnsCorrectCountOfRepositoriesWithoutStartAllStargazers() { @@ -626,6 +635,19 @@ namespace Octokit.Tests.Integration.Clients Assert.Equal(1, users.Count); } + [IntegrationTest] + public async Task ReturnsCorrectCountOfRepositoriesWithoutStartAllStargazersWithRepositoryId() + { + var options = new ApiOptions + { + PageCount = 1, + PageSize = 1 + }; + + var users = await _fixture.GetAllStargazers(7528679, options); + Assert.Equal(1, users.Count); + } + [IntegrationTest] public async Task ReturnsCorrectCountOfRepositoriesWithStartAllStargazers() { @@ -640,6 +662,20 @@ namespace Octokit.Tests.Integration.Clients Assert.Equal(1, users.Count); } + [IntegrationTest] + public async Task ReturnsCorrectCountOfRepositoriesWithStartAllStargazersWithRepositoryId() + { + var options = new ApiOptions + { + PageCount = 1, + PageSize = 1, + StartPage = 2 + }; + + var users = await _fixture.GetAllStargazers(7528679, options); + Assert.Equal(1, users.Count); + } + [IntegrationTest] public async Task ReturnsDistinctRepositoriesBasedOnStartPageAllStargazers() { @@ -666,6 +702,32 @@ namespace Octokit.Tests.Integration.Clients Assert.NotEqual(firstPage.First().Id, secondPage.First().Id); } + [IntegrationTest] + public async Task ReturnsDistinctRepositoriesBasedOnStartPageAllStargazersWithRepositoryId() + { + var startOptions = new ApiOptions + { + PageCount = 1, + PageSize = 1, + StartPage = 1 + }; + + var firstPage = await _fixture.GetAllStargazers(7528679, startOptions); + + var skipStartOptions = new ApiOptions + { + PageSize = 1, + PageCount = 1, + StartPage = 2 + }; + + var secondPage = await _fixture.GetAllStargazers(7528679, skipStartOptions); + + Assert.Equal(1, firstPage.Count); + Assert.Equal(1, secondPage.Count); + Assert.NotEqual(firstPage.First().Id, secondPage.First().Id); + } + [IntegrationTest] public async Task CanGetAllStargazersWithTimestamps() { @@ -678,6 +740,18 @@ namespace Octokit.Tests.Integration.Clients Assert.True(DateTimeOffset.UtcNow.Subtract(userStar.StarredAt) < TimeSpan.FromMinutes(5)); } + [IntegrationTest] + public async Task CanGetAllStargazersWithTimestampsWithRepositoryId() + { + var users = await _fixture.GetAllStargazersWithTimestamps(_repositoryContext.Repository.Id); + Assert.NotEmpty(users); + + var userStar = users.FirstOrDefault(star => star.User.Login == _repositoryContext.RepositoryOwner); + Assert.NotNull(userStar); + + Assert.True(DateTimeOffset.UtcNow.Subtract(userStar.StarredAt) < TimeSpan.FromMinutes(5)); + } + [IntegrationTest] public async Task ReturnsCorrectCountOfRepositoriesWithoutStartAllStargazersWithTimestamps() { @@ -691,6 +765,19 @@ namespace Octokit.Tests.Integration.Clients Assert.Equal(1, userStars.Count); } + [IntegrationTest] + public async Task ReturnsCorrectCountOfRepositoriesWithoutStartAllStargazersWithTimestampsWithRepositoryId() + { + var options = new ApiOptions + { + PageCount = 1, + PageSize = 1 + }; + + var userStars = await _fixture.GetAllStargazersWithTimestamps(7528679, options); + Assert.Equal(1, userStars.Count); + } + [IntegrationTest] public async Task ReturnsCorrectCountOfRepositoriesWithStartAllStargazersWithTimestamps() { @@ -705,6 +792,20 @@ namespace Octokit.Tests.Integration.Clients Assert.Equal(1, userStars.Count); } + [IntegrationTest] + public async Task ReturnsCorrectCountOfRepositoriesWithStartAllStargazersWithTimestampsWithRepositoryId() + { + var options = new ApiOptions + { + PageCount = 1, + PageSize = 1, + StartPage = 2 + }; + + var userStars = await _fixture.GetAllStargazersWithTimestamps(7528679, options); + Assert.Equal(1, userStars.Count); + } + [IntegrationTest] public async Task ReturnsDistinctRepositoriesBasedOnStartPageAllStargazersWithTimestamps() { @@ -731,6 +832,32 @@ namespace Octokit.Tests.Integration.Clients Assert.NotEqual(firstPage.First().StarredAt, secondPage.First().StarredAt); } + [IntegrationTest] + public async Task ReturnsDistinctRepositoriesBasedOnStartPageAllStargazersWithTimestampsWithRepositoryId() + { + var startOptions = new ApiOptions + { + PageCount = 1, + PageSize = 1, + StartPage = 1 + }; + + var firstPage = await _fixture.GetAllStargazersWithTimestamps(7528679, startOptions); + + var skipStartOptions = new ApiOptions + { + PageSize = 1, + PageCount = 1, + StartPage = 2 + }; + + var secondPage = await _fixture.GetAllStargazersWithTimestamps(7528679, skipStartOptions); + + Assert.Equal(1, firstPage.Count); + Assert.Equal(1, secondPage.Count); + Assert.NotEqual(firstPage.First().StarredAt, secondPage.First().StarredAt); + } + public void Dispose() { _repositoryContext.Dispose(); diff --git a/Octokit.Tests/Clients/StarredClientTests.cs b/Octokit.Tests/Clients/StarredClientTests.cs index 9793dcbd..2685f61f 100644 --- a/Octokit.Tests/Clients/StarredClientTests.cs +++ b/Octokit.Tests/Clients/StarredClientTests.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Octokit.Internal; -using System; +using System; +using System.Collections.Generic; using System.Net; using System.Threading.Tasks; using NSubstitute; +using Octokit.Internal; using Xunit; namespace Octokit.Tests.Clients @@ -15,8 +15,7 @@ namespace Octokit.Tests.Clients [Fact] public void EnsuresNonNullArguments() { - Assert.Throws( - () => new StarredClient(null)); + Assert.Throws(() => new StarredClient(null)); } } @@ -153,7 +152,7 @@ namespace Octokit.Tests.Clients await client.GetAllForCurrentWithTimestamps(request, options); - connection.Received().GetAll(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc"), + connection.Received().GetAll(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc"), "application/vnd.github.v3.star+json", options); } @@ -346,19 +345,31 @@ namespace Octokit.Tests.Clients public class TheGetAllStargazersForRepoMethod { [Fact] - public void RequestsCorrectUrl() + public async Task RequestsCorrectUrl() { var endpoint = new Uri("repos/fight/club/stargazers", UriKind.Relative); var connection = Substitute.For(); var client = new StarredClient(connection); - client.GetAllStargazers("fight", "club"); + await client.GetAllStargazers("fight", "club"); connection.Received().GetAll(endpoint, Args.ApiOptions); } [Fact] - public void RequestsCorrectUrlWithApiOptions() + public async Task RequestsCorrectUrlWithRepositoryId() + { + var endpoint = new Uri("repositories/1/stargazers", UriKind.Relative); + var connection = Substitute.For(); + var client = new StarredClient(connection); + + await client.GetAllStargazers(1); + + connection.Received().GetAll(endpoint, Args.ApiOptions); + } + + [Fact] + public async Task RequestsCorrectUrlWithApiOptions() { var endpoint = new Uri("repos/fight/club/stargazers", UriKind.Relative); var connection = Substitute.For(); @@ -371,27 +382,15 @@ namespace Octokit.Tests.Clients PageSize = 1 }; - client.GetAllStargazers("fight", "club", options); + await client.GetAllStargazers("fight", "club", options); connection.Received().GetAll(endpoint, options); } [Fact] - public void RequestsCorrectUrlWithTimestamps() + public async Task RequestsCorrectUrlWithApiOptionsWithRepositoryId() { - var endpoint = new Uri("repos/fight/club/stargazers", UriKind.Relative); - var connection = Substitute.For(); - var client = new StarredClient(connection); - - client.GetAllStargazersWithTimestamps("fight", "club"); - - connection.Received().GetAll(endpoint, null, "application/vnd.github.v3.star+json", Args.ApiOptions); - } - - [Fact] - public void RequestsCorrectUrlWithTimestampsWithApiOptions() - { - var endpoint = new Uri("repos/fight/club/stargazers", UriKind.Relative); + var endpoint = new Uri("repositories/1/stargazers", UriKind.Relative); var connection = Substitute.For(); var client = new StarredClient(connection); @@ -402,7 +401,69 @@ namespace Octokit.Tests.Clients PageSize = 1 }; - client.GetAllStargazersWithTimestamps("fight", "club", options); + await client.GetAllStargazers(1, options); + + connection.Received().GetAll(endpoint, options); + } + + [Fact] + public async Task RequestsCorrectUrlWithTimestamps() + { + var endpoint = new Uri("repos/fake/repo/stargazers", UriKind.Relative); + var connection = Substitute.For(); + var client = new StarredClient(connection); + + await client.GetAllStargazersWithTimestamps("fake", "repo"); + + connection.Received().GetAll(endpoint, null, "application/vnd.github.v3.star+json", Args.ApiOptions); + } + + [Fact] + public async Task RequestsCorrectUrlWithTimestampsWithRepositoryId() + { + var endpoint = new Uri("repositories/1/stargazers", UriKind.Relative); + var connection = Substitute.For(); + var client = new StarredClient(connection); + + await client.GetAllStargazersWithTimestamps(1); + + connection.Received().GetAll(endpoint, null, "application/vnd.github.v3.star+json", Args.ApiOptions); + } + + [Fact] + public async Task RequestsCorrectUrlWithTimestampsWithApiOptions() + { + var endpoint = new Uri("repos/fake/repo/stargazers", UriKind.Relative); + var connection = Substitute.For(); + var client = new StarredClient(connection); + + var options = new ApiOptions + { + PageCount = 1, + StartPage = 1, + PageSize = 1 + }; + + await client.GetAllStargazersWithTimestamps("fake", "repo", options); + + connection.Received().GetAll(endpoint, null, "application/vnd.github.v3.star+json", options); + } + + [Fact] + public async Task RequestsCorrectUrlWithTimestampsWithApiOptionsWithRepositoryId() + { + var endpoint = new Uri("repositories/1/stargazers", UriKind.Relative); + var connection = Substitute.For(); + var client = new StarredClient(connection); + + var options = new ApiOptions + { + PageCount = 1, + StartPage = 1, + PageSize = 1 + }; + + await client.GetAllStargazersWithTimestamps(1, options); connection.Received().GetAll(endpoint, null, "application/vnd.github.v3.star+json", options); } @@ -423,6 +484,9 @@ namespace Octokit.Tests.Clients await Assert.ThrowsAsync(() => client.GetAllStargazersWithTimestamps("fight", null, ApiOptions.None)); await Assert.ThrowsAsync(() => client.GetAllStargazersWithTimestamps("fight", "club", null)); + await Assert.ThrowsAsync(() => client.GetAllStargazers(1, null)); + await Assert.ThrowsAsync(() => client.GetAllStargazersWithTimestamps(1, null)); + await Assert.ThrowsAsync(() => client.GetAllStargazers("", "club")); await Assert.ThrowsAsync(() => client.GetAllStargazers("fight", "")); await Assert.ThrowsAsync(() => client.GetAllStargazers("", "club", ApiOptions.None)); diff --git a/Octokit.Tests/Reactive/ObservableStarredClientTests.cs b/Octokit.Tests/Reactive/ObservableStarredClientTests.cs index 8d2843fa..e3f0bc56 100644 --- a/Octokit.Tests/Reactive/ObservableStarredClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableStarredClientTests.cs @@ -35,6 +35,20 @@ namespace Octokit.Tests.Reactive connection.Received().Get>(endpoint, Args.EmptyDictionary, null); } + [Fact] + public void RequestsCorrectUrlWithRepositoryId() + { + var endpoint = new Uri("repositories/1/stargazers", UriKind.Relative); + var connection = Substitute.For(); + var gitHubClient = Substitute.For(); + gitHubClient.Connection.Returns(connection); + var client = new ObservableStarredClient(gitHubClient); + + client.GetAllStargazers(1); + + connection.Received().Get>(endpoint, Args.EmptyDictionary, null); + } + [Fact] public void RequestsCorrectUrlWithApiOptions() { @@ -56,6 +70,27 @@ namespace Octokit.Tests.Reactive connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2), null); } + [Fact] + public void RequestsCorrectUrlWithApiOptionsWithRepositoryId() + { + var endpoint = new Uri("repositories/1/stargazers", UriKind.Relative); + var connection = Substitute.For(); + var gitHubClient = Substitute.For(); + gitHubClient.Connection.Returns(connection); + var client = new ObservableStarredClient(gitHubClient); + + var options = new ApiOptions + { + PageCount = 1, + StartPage = 1, + PageSize = 1 + }; + + client.GetAllStargazers(1, options); + + connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2), null); + } + [Fact] public void RequestsCorrectUrlWithTimestamps() { @@ -70,6 +105,20 @@ namespace Octokit.Tests.Reactive connection.Received().Get>(endpoint, Args.EmptyDictionary, "application/vnd.github.v3.star+json"); } + [Fact] + public void RequestsCorrectUrlWithTimestampsWithRepositoryId() + { + var endpoint = new Uri("repositories/1/stargazers", UriKind.Relative); + var connection = Substitute.For(); + var gitHubClient = Substitute.For(); + gitHubClient.Connection.Returns(connection); + var client = new ObservableStarredClient(gitHubClient); + + client.GetAllStargazersWithTimestamps(1); + + connection.Received().Get>(endpoint, Args.EmptyDictionary, "application/vnd.github.v3.star+json"); + } + [Fact] public void RequestsCorrectUrlWithTimestampsWithApiOptions() { @@ -91,6 +140,27 @@ namespace Octokit.Tests.Reactive connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2), "application/vnd.github.v3.star+json"); } + [Fact] + public void RequestsCorrectUrlWithTimestampsWithApiOptionsWithRepositoryId() + { + var endpoint = new Uri("repositories/1/stargazers", UriKind.Relative); + var connection = Substitute.For(); + var gitHubClient = Substitute.For(); + gitHubClient.Connection.Returns(connection); + var client = new ObservableStarredClient(gitHubClient); + + var options = new ApiOptions + { + PageCount = 1, + StartPage = 1, + PageSize = 1 + }; + + client.GetAllStargazersWithTimestamps(1, options); + + connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2), "application/vnd.github.v3.star+json"); + } + [Fact] public void EnsuresNonNullArguments() { @@ -107,6 +177,9 @@ namespace Octokit.Tests.Reactive Assert.Throws(() => client.GetAllStargazersWithTimestamps("fight", null, ApiOptions.None)); Assert.Throws(() => client.GetAllStargazersWithTimestamps("fight", "club", null)); + Assert.Throws(() => client.GetAllStargazers(1, null)); + Assert.Throws(() => client.GetAllStargazersWithTimestamps(1, null)); + Assert.Throws(() => client.GetAllStargazers("", "club")); Assert.Throws(() => client.GetAllStargazers("fight", "")); Assert.Throws(() => client.GetAllStargazers("", "club", ApiOptions.None)); diff --git a/Octokit/Clients/IStarredClient.cs b/Octokit/Clients/IStarredClient.cs index 6aeaf127..12433c23 100644 --- a/Octokit/Clients/IStarredClient.cs +++ b/Octokit/Clients/IStarredClient.cs @@ -17,9 +17,15 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// Thrown if the client is not authenticated. - /// A of s starring the passed repository. Task> GetAllStargazers(string owner, string name); + /// + /// Retrieves all of the stargazers for the passed repository. + /// + /// The ID of the repository + /// Thrown if the client is not authenticated. + Task> GetAllStargazers(int repositoryId); + /// /// Retrieves all of the stargazers for the passed repository. /// @@ -27,18 +33,31 @@ namespace Octokit /// The name of the repository /// Options for changing the API response /// Thrown if the client is not authenticated. - /// A of s starring the passed repository. Task> GetAllStargazers(string owner, string name, ApiOptions options); + /// + /// Retrieves all of the stargazers for the passed repository. + /// + /// The ID of the repository + /// Options for changing the API response + /// Thrown if the client is not authenticated. + Task> GetAllStargazers(int repositoryId, ApiOptions options); + /// /// Retrieves all of the stargazers for the passed repository with star creation timestamps. /// /// The owner of the repository /// The name of the repository /// Thrown if the client is not authenticated. - /// A of s starring the passed repository with star creation timestamps. Task> GetAllStargazersWithTimestamps(string owner, string name); + /// + /// Retrieves all of the stargazers for the passed repository with star creation timestamps. + /// + /// The ID of the repository + /// Thrown if the client is not authenticated. + Task> GetAllStargazersWithTimestamps(int repositoryId); + /// /// Retrieves all of the stargazers for the passed repository with star creation timestamps. /// @@ -46,16 +65,20 @@ namespace Octokit /// The name of the repository /// Options for changing the API response /// Thrown if the client is not authenticated. - /// A of s starring the passed repository with star creation timestamps. Task> GetAllStargazersWithTimestamps(string owner, string name, ApiOptions options); + /// + /// Retrieves all of the stargazers for the passed repository with star creation timestamps. + /// + /// The ID of the repository + /// Options for changing the API response + /// Thrown if the client is not authenticated. + Task> GetAllStargazersWithTimestamps(int repositoryId, ApiOptions options); + /// /// Retrieves all of the starred (ies) for the current user. /// /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the current authenticated user. - /// Task> GetAllForCurrent(); /// @@ -63,18 +86,12 @@ namespace Octokit /// /// Options for changing the API response /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the current authenticated user. - /// Task> GetAllForCurrent(ApiOptions options); /// /// Retrieves all of the starred (ies) for the current user with star creation timestamps. /// /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the current authenticated user with star creation timestamps. - /// Task> GetAllForCurrentWithTimestamps(); /// @@ -82,9 +99,6 @@ namespace Octokit /// /// Options for changing the API response /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the current authenticated user with star creation timestamps. - /// Task> GetAllForCurrentWithTimestamps(ApiOptions options); /// @@ -92,10 +106,6 @@ namespace Octokit /// /// Star-specific request parameters that sort the results /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the current user, - /// sorted according to the passed request parameters. - /// Task> GetAllForCurrent(StarredRequest request); /// @@ -104,10 +114,6 @@ namespace Octokit /// Star-specific request parameters that sort the results /// Options for changing the API response /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the current user, - /// sorted according to the passed request parameters. - /// Task> GetAllForCurrent(StarredRequest request, ApiOptions options); /// @@ -115,10 +121,6 @@ namespace Octokit /// /// Star-specific request parameters that sort the results /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the current user, - /// sorted according to the passed request parameters and with star creation timestamps. - /// Task> GetAllForCurrentWithTimestamps(StarredRequest request); /// @@ -127,10 +129,6 @@ namespace Octokit /// Star-specific request parameters that sort the results /// Options for changing the API response /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the current user, - /// sorted according to the passed request parameters and with star creation timestamps. - /// Task> GetAllForCurrentWithTimestamps(StarredRequest request, ApiOptions options); /// @@ -138,9 +136,6 @@ namespace Octokit /// /// The login of the user /// Thrown if the client is not authenticated. - /// - /// A (ies) starred by the specified user. - /// Task> GetAllForUser(string user); /// @@ -149,9 +144,6 @@ namespace Octokit /// The login of the user /// Options for changing the API response /// Thrown if the client is not authenticated. - /// - /// A (ies) starred by the specified user. - /// Task> GetAllForUser(string user, ApiOptions options); /// @@ -159,9 +151,6 @@ namespace Octokit /// /// The login of the user /// Thrown if the client is not authenticated. - /// - /// A (ies) starred by the specified user with star creation timestamps. - /// Task> GetAllForUserWithTimestamps(string user); /// @@ -170,9 +159,6 @@ namespace Octokit /// The login of the user /// Options for changing the API response /// Thrown if the client is not authenticated. - /// - /// A (ies) starred by the specified user with star creation timestamps. - /// Task> GetAllForUserWithTimestamps(string user, ApiOptions options); /// @@ -181,7 +167,6 @@ namespace Octokit /// The login of the user /// Star-specific request parameters that sort the results /// Thrown if the client is not authenticated. - /// A starred by the specified user. Task> GetAllForUser(string user, StarredRequest request); /// @@ -191,7 +176,6 @@ namespace Octokit /// Star-specific request parameters that sort the results /// Options for changing the API response /// Thrown if the client is not authenticated. - /// A starred by the specified user. Task> GetAllForUser(string user, StarredRequest request, ApiOptions options); /// @@ -200,10 +184,6 @@ namespace Octokit /// The login of the user /// Star-specific request parameters that sort the results /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the specified user, - /// sorted according to the passed request parameters and with star creation timestamps. - /// Task> GetAllForUserWithTimestamps(string user, StarredRequest request); /// @@ -213,10 +193,6 @@ namespace Octokit /// Star-specific request parameters that sort the results /// Options for changing the API response /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the specified user, - /// sorted according to the passed request parameters and with star creation timestamps. - /// Task> GetAllForUserWithTimestamps(string user, StarredRequest request, ApiOptions options); /// @@ -225,23 +201,20 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// Thrown if the client is not authenticated. - /// A bool representing the success of the operation Task CheckStarred(string owner, string name); - + /// /// Stars a repository for the authenticated user. /// /// The owner of the repository to star /// The name of the repository to star - /// A bool representing the success of starring Task StarRepo(string owner, string name); - + /// /// Unstars a repository for the authenticated user. /// /// The owner of the repository to unstar /// The name of the repository to unstar - /// A bool representing the success of the operation Task RemoveStarFromRepo(string owner, string name); } } diff --git a/Octokit/Clients/StarredClient.cs b/Octokit/Clients/StarredClient.cs index 4ec54834..f9ccded0 100644 --- a/Octokit/Clients/StarredClient.cs +++ b/Octokit/Clients/StarredClient.cs @@ -26,7 +26,6 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// Thrown if the client is not authenticated. - /// A of s starring the passed repository. public Task> GetAllStargazers(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -35,6 +34,16 @@ namespace Octokit return GetAllStargazers(owner, name, ApiOptions.None); } + /// + /// Retrieves all of the stargazers for the passed repository. + /// + /// The ID of the repository + /// Thrown if the client is not authenticated. + public Task> GetAllStargazers(int repositoryId) + { + return GetAllStargazers(repositoryId, ApiOptions.None); + } + /// /// Retrieves all of the stargazers for the passed repository. /// @@ -42,7 +51,6 @@ namespace Octokit /// The name of the repository /// Options for changing the API response /// Thrown if the client is not authenticated. - /// A of s starring the passed repository. public Task> GetAllStargazers(string owner, string name, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -52,13 +60,25 @@ namespace Octokit return ApiConnection.GetAll(ApiUrls.Stargazers(owner, name), options); } + /// + /// Retrieves all of the stargazers for the passed repository. + /// + /// The ID of the repository + /// Options for changing the API response + /// Thrown if the client is not authenticated. + public Task> GetAllStargazers(int repositoryId, ApiOptions options) + { + Ensure.ArgumentNotNull(options, "options"); + + return ApiConnection.GetAll(ApiUrls.Stargazers(repositoryId), options); + } + /// /// Retrieves all of the stargazers for the passed repository with star creation timestamps. /// /// The owner of the repository /// The name of the repository /// Thrown if the client is not authenticated. - /// A of s starring the passed repository with star creation timestamps. public Task> GetAllStargazersWithTimestamps(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -67,6 +87,16 @@ namespace Octokit return GetAllStargazersWithTimestamps(owner, name, ApiOptions.None); } + /// + /// Retrieves all of the stargazers for the passed repository with star creation timestamps. + /// + /// The ID of the repository + /// Thrown if the client is not authenticated. + public Task> GetAllStargazersWithTimestamps(int repositoryId) + { + return GetAllStargazersWithTimestamps(repositoryId, ApiOptions.None); + } + /// /// Retrieves all of the stargazers for the passed repository with star creation timestamps. /// @@ -74,7 +104,6 @@ namespace Octokit /// The name of the repository /// Options for changing the API response /// Thrown if the client is not authenticated. - /// A of s starring the passed repository with star creation timestamps. public Task> GetAllStargazersWithTimestamps(string owner, string name, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -84,13 +113,23 @@ namespace Octokit return ApiConnection.GetAll(ApiUrls.Stargazers(owner, name), null, AcceptHeaders.StarCreationTimestamps, options); } + /// + /// Retrieves all of the stargazers for the passed repository with star creation timestamps. + /// + /// The ID of the repository + /// Options for changing the API response + /// Thrown if the client is not authenticated. + public Task> GetAllStargazersWithTimestamps(int repositoryId, ApiOptions options) + { + Ensure.ArgumentNotNull(options, "options"); + + return ApiConnection.GetAll(ApiUrls.Stargazers(repositoryId), null, AcceptHeaders.StarCreationTimestamps, options); + } + /// /// Retrieves all of the starred (ies) for the current user. /// /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the current authenticated user. - /// public Task> GetAllForCurrent() { return GetAllForCurrent(ApiOptions.None); @@ -101,9 +140,6 @@ namespace Octokit /// /// Options for changing the API response /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the current authenticated user. - /// public Task> GetAllForCurrent(ApiOptions options) { Ensure.ArgumentNotNull(options, "options"); @@ -115,9 +151,6 @@ namespace Octokit /// Retrieves all of the starred (ies) for the current user with star creation timestamps. /// /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the current authenticated user with star creation timestamps. - /// public Task> GetAllForCurrentWithTimestamps() { return GetAllForCurrentWithTimestamps(ApiOptions.None); @@ -128,9 +161,6 @@ namespace Octokit /// /// Options for changing the API response /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the current authenticated user with star creation timestamps. - /// public Task> GetAllForCurrentWithTimestamps(ApiOptions options) { Ensure.ArgumentNotNull(options, "options"); @@ -143,10 +173,6 @@ namespace Octokit /// /// Star-specific request parameters that sort the results /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the current user, - /// sorted according to the passed request parameters. - /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", Justification = "But i think i do need star-specific request parameters")] public Task> GetAllForCurrent(StarredRequest request) @@ -162,10 +188,6 @@ namespace Octokit /// Star-specific request parameters that sort the results /// Options for changing the API response /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the current user, - /// sorted according to the passed request parameters. - /// public Task> GetAllForCurrent(StarredRequest request, ApiOptions options) { Ensure.ArgumentNotNull(request, "request"); @@ -179,10 +201,6 @@ namespace Octokit /// /// Star-specific request parameters that sort the results /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the current user, - /// sorted according to the passed request parameters and with star creation timestamps. - /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", Justification = "But i think i do need star-specific request parameters")] public Task> GetAllForCurrentWithTimestamps(StarredRequest request) @@ -198,10 +216,6 @@ namespace Octokit /// Star-specific request parameters that sort the results /// Options for changing the API response /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the current user, - /// sorted according to the passed request parameters and with star creation timestamps. - /// public Task> GetAllForCurrentWithTimestamps(StarredRequest request, ApiOptions options) { Ensure.ArgumentNotNull(request, "request"); @@ -215,9 +229,6 @@ namespace Octokit /// /// The login of the user /// Thrown if the client is not authenticated. - /// - /// A (ies) starred by the specified user. - /// public Task> GetAllForUser(string user) { Ensure.ArgumentNotNullOrEmptyString(user, "user"); @@ -231,9 +242,6 @@ namespace Octokit /// The login of the user /// Options for changing the API response /// Thrown if the client is not authenticated. - /// - /// A (ies) starred by the specified user. - /// public Task> GetAllForUser(string user, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(user, "user"); @@ -247,9 +255,6 @@ namespace Octokit /// /// The login of the user /// Thrown if the client is not authenticated. - /// - /// A (ies) starred by the specified user with star creation timestamps. - /// public Task> GetAllForUserWithTimestamps(string user) { Ensure.ArgumentNotNullOrEmptyString(user, "user"); @@ -263,9 +268,6 @@ namespace Octokit /// The login of the user /// Options for changing the API response /// Thrown if the client is not authenticated. - /// - /// A (ies) starred by the specified user with star creation timestamps. - /// public Task> GetAllForUserWithTimestamps(string user, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(user, "user"); @@ -280,7 +282,6 @@ namespace Octokit /// The login of the user /// Star-specific request parameters that sort the results /// Thrown if the client is not authenticated. - /// A starred by the specified user. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")] public Task> GetAllForUser(string user, StarredRequest request) { @@ -297,7 +298,6 @@ namespace Octokit /// Star-specific request parameters that sort the results /// Options for changing the API response /// Thrown if the client is not authenticated. - /// A starred by the specified user. public Task> GetAllForUser(string user, StarredRequest request, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(user, "user"); @@ -313,10 +313,6 @@ namespace Octokit /// The login of the user /// Star-specific request parameters that sort the results /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the specified user, - /// sorted according to the passed request parameters and with star creation timestamps. - /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")] public Task> GetAllForUserWithTimestamps(string user, StarredRequest request) { @@ -333,10 +329,6 @@ namespace Octokit /// Star-specific request parameters that sort the results /// Options for changing the API response /// Thrown if the client is not authenticated. - /// - /// A of (ies) starred by the specified user, - /// sorted according to the passed request parameters and with star creation timestamps. - /// public Task> GetAllForUserWithTimestamps(string user, StarredRequest request, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(user, "user"); @@ -352,7 +344,6 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// Thrown if the client is not authenticated. - /// A bool representing the success of the operation public async Task CheckStarred(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -374,7 +365,6 @@ namespace Octokit /// /// The owner of the repository to star /// The name of the repository to star - /// A bool representing the success of starring public async Task StarRepo(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -396,7 +386,6 @@ namespace Octokit /// /// The owner of the repository to unstar /// The name of the repository to unstar - /// A bool representing the success of the operation public async Task RemoveStarFromRepo(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner");