From adaf3f6a4bdce1c4549aa88eb40585f790fc1aa0 Mon Sep 17 00:00:00 2001 From: Haroon Date: Wed, 6 Nov 2013 23:05:49 +0000 Subject: [PATCH] search issues --- Octokit/Clients/ISearchClient.cs | 8 +++++++ Octokit/Clients/SearchClient.cs | 7 +++++++ Octokit/Models/Response/SearchRepo.cs | 30 ++++++++++++++++++++++++++- 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/Octokit/Clients/ISearchClient.cs b/Octokit/Clients/ISearchClient.cs index 70cd0496..d7e15c3d 100644 --- a/Octokit/Clients/ISearchClient.cs +++ b/Octokit/Clients/ISearchClient.cs @@ -23,5 +23,13 @@ namespace Octokit /// /// Task> SearchUsers(SearchTerm search); + + /// + /// search issues + /// + /// + /// + Task> SearchIssues(SearchTerm search); + } } \ No newline at end of file diff --git a/Octokit/Clients/SearchClient.cs b/Octokit/Clients/SearchClient.cs index 4d1ef1b2..8ac5cda7 100644 --- a/Octokit/Clients/SearchClient.cs +++ b/Octokit/Clients/SearchClient.cs @@ -27,5 +27,12 @@ namespace Octokit Ensure.ArgumentNotNull(search, "search"); return ApiConnection.GetAll("search/users".FormatUri(), search.Parameters); } + + + public Task> SearchIssues(SearchTerm search) + { + Ensure.ArgumentNotNull(search, "search"); + return ApiConnection.GetAll("search/issues".FormatUri(), search.Parameters); + } } } \ No newline at end of file diff --git a/Octokit/Models/Response/SearchRepo.cs b/Octokit/Models/Response/SearchRepo.cs index 1439646b..6e6bcd73 100644 --- a/Octokit/Models/Response/SearchRepo.cs +++ b/Octokit/Models/Response/SearchRepo.cs @@ -49,9 +49,37 @@ namespace Octokit public string Login { get; set; } /// - /// full name of repo e.g. dtrupenn/Tetris + /// users avatar url /// public string AvatarUrl { get; set; } } + public class SearchIssue + { + /// + /// issue id + /// + public int Id { get; set; } + + /// + /// number inside the repo + /// + public int Number { get; set; } + + /// + /// author of this issue + /// + public User User { get; set; } + + /// + /// title of issue + /// + public string Title { get; set; } + + /// + /// comments on this issue + /// + public int Comments { get; set; } + } + } \ No newline at end of file