Пример #1
0
        public GitHubRequest <GistModel> EditGist(GistEditModel gist)
        {
            var obj = new Dictionary <string, object>();

            obj.Add("description", gist.Description);

            var files = new Dictionary <string, object>();

            obj.Add("files", files);

            if (gist.Files != null)
            {
                foreach (var f in gist.Files.Keys)
                {
                    if (gist.Files[f] == null)
                    {
                        files.Add(f, null);
                    }
                    else
                    {
                        var content = new Dictionary <string, object>();
                        files.Add(f, content);
                        content.Add("content", gist.Files[f].Content);

                        if (gist.Files[f].Filename != null)
                        {
                            content.Add("filename", gist.Files[f].Filename);
                        }
                    }
                }
            }

            return(GitHubRequest.Patch <GistModel>(Uri, obj));
        }
Пример #2
0
 public GitHubRequest <PullRequestModel> UpdateState(string state)
 {
     return(GitHubRequest.Patch <PullRequestModel>(Uri, new { state }));
 }
Пример #3
0
 public GitHubRequest <CommentModel> Update(string body)
 {
     return(GitHubRequest.Patch <CommentModel>(Uri, new { body = body }));
 }
Пример #4
0
 public GitHubRequest <bool> MarkAsRead()
 {
     return(GitHubRequest.Patch <bool>(Uri));
 }
Пример #5
0
 public GitHubRequest <IssueModel> UpdateLabels(IEnumerable <string> labels)
 {
     return(GitHubRequest.Patch <IssueModel>(Uri, new { labels = labels.ToArray() }));
 }
Пример #6
0
 public GitHubRequest <IssueModel> UpdateMilestone(int?milestone)
 {
     return(GitHubRequest.Patch <IssueModel>(Uri, new { milestone }));
 }
Пример #7
0
 public GitHubRequest <IssueModel> UpdateAssignee(string assignee)
 {
     return(GitHubRequest.Patch <IssueModel>(Uri, new { assignee }));
 }
Пример #8
0
 public GitHubRequest <IssueModel> Update(string title, string body, string state, string assignee, int?milestone, string[] labels)
 {
     return(GitHubRequest.Patch <IssueModel>(Uri, new { title, body, assignee, milestone, labels, state }));
 }
Пример #9
0
 public GitHubRequest <LabelModel> Update(string title, string color)
 {
     return(GitHubRequest.Patch <LabelModel>(Uri, new { title, color }));
 }