Add GetAllPublic in RepositoriesClient

This commit is contained in:
rms81
2015-02-01 19:06:41 +00:00
parent ee8ed34e9e
commit aa867d5e4f
2 changed files with 29 additions and 0 deletions
+14
View File
@@ -94,6 +94,20 @@ namespace Octokit
/// <returns>A <see cref="Repository"/></returns>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")]
Task<Repository> Get(string owner, string name);
/// <summary>
/// Gets all public repositories.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/#list-all-public-repositories">API documentation</a> for more information.
/// The default page size on GitHub.com is 30.
/// </remarks>
/// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>A <see cref="IReadOnlyPagedCollection{Repository}"/> of <see cref="Repository"/>.</returns>
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate",
Justification = "Makes a network request")]
Task<IReadOnlyList<Repository>> GetAllPublic();
/// <summary>
/// Gets all repositories owned by the current user.
+15
View File
@@ -174,6 +174,21 @@ namespace Octokit
return ApiConnection.Get<Repository>(endpoint);
}
/// <summary>
/// Gets all public repositories.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/#list-all-public-repositories">API documentation</a> for more information.
/// The default page size on GitHub.com is 30.
/// </remarks>
/// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>A <see cref="IReadOnlyPagedCollection{Repository}"/> of <see cref="Repository"/>.</returns>
public Task<IReadOnlyList<Repository>> GetAllPublic()
{
return ApiConnection.GetAll<Repository>(ApiUrls.AllPublicRepositories());
}
/// <summary>
/// Gets all repositories owned by the current user.
/// </summary>