diff --git a/Octokit/Clients/IRepositoriesClient.cs b/Octokit/Clients/IRepositoriesClient.cs index 2080e6a0..a6c8cdc0 100644 --- a/Octokit/Clients/IRepositoriesClient.cs +++ b/Octokit/Clients/IRepositoriesClient.cs @@ -108,7 +108,7 @@ namespace Octokit [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Makes a network request")] Task> GetAllPublic(); - + /// /// Gets all repositories owned by the current user. /// @@ -122,7 +122,22 @@ namespace Octokit [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Makes a network request")] Task> GetAllForCurrent(); - + + /// + /// Gets all repositories owned by the current user. + /// + /// + /// See the API documentation for more information. + /// The default page size on GitHub.com is 30. + /// + /// Search parameters to filter results on + /// Thrown if the client is not authenticated. + /// Thrown when a general API error occurs. + /// A of . + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", + Justification = "Makes a network request")] + Task> GetAllForCurrent(RepositoryRequest request); + /// /// Gets all repositories owned by the specified user. /// diff --git a/Octokit/Clients/RepositoriesClient.cs b/Octokit/Clients/RepositoriesClient.cs index cc118d48..b8f68c83 100644 --- a/Octokit/Clients/RepositoriesClient.cs +++ b/Octokit/Clients/RepositoriesClient.cs @@ -204,6 +204,24 @@ namespace Octokit return ApiConnection.GetAll(ApiUrls.Repositories()); } + /// + /// Gets all repositories owned by the current user. + /// + /// + /// See the API documentation for more information. + /// The default page size on GitHub.com is 30. + /// + /// Search parameters to filter results on + /// Thrown if the client is not authenticated. + /// Thrown when a general API error occurs. + /// A of . + public Task> GetAllForCurrent(RepositoryRequest request) + { + Ensure.ArgumentNotNull(request, "request"); + + return ApiConnection.GetAll(ApiUrls.Repositories(), request.ToParametersDictionary()); + } + /// /// Gets all repositories owned by the specified user. /// diff --git a/Octokit/Models/Request/RepositoryRequest.cs b/Octokit/Models/Request/RepositoryRequest.cs new file mode 100644 index 00000000..6bc9e923 --- /dev/null +++ b/Octokit/Models/Request/RepositoryRequest.cs @@ -0,0 +1,33 @@ +using Octokit.Internal; + +namespace Octokit +{ + public class RepositoryRequest : RequestParameters + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods")] + public RepositoryType Type { get; set; } + + public RepositorySort Sort { get; set; } + + public SortDirection Direction { get; set; } + } + + public enum RepositoryType + { + All, + Owner, + Public, + Private, + Member + } + + public enum RepositorySort + { + Created, + Updated, + Pushed, + + [Parameter(Value = "full_name")] + FullName + } +} diff --git a/Octokit/Octokit-Mono.csproj b/Octokit/Octokit-Mono.csproj index 61556f1e..a8bf80ab 100644 --- a/Octokit/Octokit-Mono.csproj +++ b/Octokit/Octokit-Mono.csproj @@ -368,6 +368,7 @@ + \ No newline at end of file diff --git a/Octokit/Octokit-MonoAndroid.csproj b/Octokit/Octokit-MonoAndroid.csproj index aa58c2a9..56859c3a 100644 --- a/Octokit/Octokit-MonoAndroid.csproj +++ b/Octokit/Octokit-MonoAndroid.csproj @@ -380,6 +380,7 @@ + \ No newline at end of file diff --git a/Octokit/Octokit-Monotouch.csproj b/Octokit/Octokit-Monotouch.csproj index a7bd1580..3535181b 100644 --- a/Octokit/Octokit-Monotouch.csproj +++ b/Octokit/Octokit-Monotouch.csproj @@ -373,7 +373,8 @@ + - + \ No newline at end of file diff --git a/Octokit/Octokit-Portable.csproj b/Octokit/Octokit-Portable.csproj index 6162c449..df8d5d62 100644 --- a/Octokit/Octokit-Portable.csproj +++ b/Octokit/Octokit-Portable.csproj @@ -366,6 +366,7 @@ + @@ -396,4 +397,4 @@ --> - + \ No newline at end of file diff --git a/Octokit/Octokit-netcore45.csproj b/Octokit/Octokit-netcore45.csproj index bbe7548e..f29a903d 100644 --- a/Octokit/Octokit-netcore45.csproj +++ b/Octokit/Octokit-netcore45.csproj @@ -370,6 +370,7 @@ + diff --git a/Octokit/Octokit.csproj b/Octokit/Octokit.csproj index f1a90016..a3bd9201 100644 --- a/Octokit/Octokit.csproj +++ b/Octokit/Octokit.csproj @@ -84,6 +84,7 @@ +