public IssueDetails CloseIssue(string organization, string repository, int number)
        {
            var details = new IssueDetails();

            details.state = "closed";
            return(this.UpdateIssue(organization: organization, repository: repository, number: number, details: details));
        }
        public IssueDetails UpdateIssue(string organization, string repository, int number, IssueDetails details)
        {
            var uri     = string.Format("{0}/repos/{1}/{2}/issues/{3}", GitHubAPIBaseURL, organization, repository, number.ToString());
            var message = new HttpRequestMessage(new HttpMethod("PATCH"), new Uri(uri));
            var content = this.ConvertToString(details);

            message.Content = new StringContent(content, Encoding.UTF8, "application/json");
            var response = HttpHelper.SendRequest(message);
            var result   = response.Content.ReadAsStringAsync().Result;

            return(JsonConvert.DeserializeObject <IssueDetails>(result));
        }
        public IssueDetails UpdateIssue(string organization, string repository, int number, IssueDetails details)
        {
            var uri     = string.Format("{0}/repos/{1}/{2}/issues/{3}", baseUrl, organization, repository, number.ToString());
            var request = new RestRequest(uri, Method.PATCH);

            request.AddParameter("application/json", ConvertToString(details), ParameterType.RequestBody);
            return(client.Execute <IssueDetails>(request).Data);
        }