public bool isUserValid(string apiKey) { var request = ConstructRedmineRequest(RedmineUrlManager.GetTicketsUrl(), apiKey); using (var response = request.GetResponse()) { return(true); } }
public List <TicketEntry> GetTicketEntries(int ticketNumber, string apiKey) { var request = ConstructRedmineRequest(RedmineUrlManager.GetEntryUrl(new { limit = 15000, issue_id = ticketNumber }), apiKey); using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) { using (var reader = new StreamReader(response.GetResponseStream())) { string json = reader.ReadToEnd(); var tickets = Parser.ParseTicketEntries(json); return(_ticketResultMapper.MapFromTicketEntryResult(tickets)); } } }
public Page <Models.Ticket> GetTickets(int userID, string apiKey) { var request = ConstructRedmineRequest(RedmineUrlManager.GetTicketsUrl(new { assigned_to_id = userID, limit = 15000 }), apiKey); using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) { using (var reader = new StreamReader(response.GetResponseStream())) { string json = reader.ReadToEnd(); var tickets = Parser.ParseTicketsResult(json); return(_ticketMapper.MapFromTicketResult(tickets)); } } }
public int GetUserID(string apiKey) { var request = ConstructRedmineRequest(RedmineUrlManager.GetCurrentUserUrl(), apiKey); using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) { using (var reader = new StreamReader(response.GetResponseStream())) { string json = reader.ReadToEnd(); var userInfo = Parser.ParseCurrentUserResult(json); return(userInfo.user.id); } } }
public RedmineUrlsTests() { _manager = new RedmineUrlManager(); }
public BaseRepository() { RedmineUrlManager = new RedmineUrlManager(); }