public GitHubRequest <GistModel> CreateGist(GistCreateModel gist) { //Great... The RestSharp serializer can't handle this object... //Dictionary<string, obj> confuses it and converts it into {"key": "ok", "value": "dokie"} //instead of {"ok": "dokie"} var obj = new Dictionary <string, object>(); obj.Add("description", gist.Description); obj.Add("public", gist.Public); var files = new Dictionary <string, object>(); obj.Add("files", files); if (gist.Files != null) { foreach (var f in gist.Files.Keys) { var content = new Dictionary <string, object>(); files.Add(f, content); content.Add("content", gist.Files[f].Content); } } return(GitHubRequest.Post <GistModel>(Client.ApiUri + "/gists", obj)); }
public GitHubRequest <CommentModel> Create(string body, string path = null, int?position = null) { return(GitHubRequest.Post <CommentModel>(Uri, new { body = body, path = path, position = position })); }
public GitHubRequest <CommentModel> ReplyTo(string body, long replyToId) { return(GitHubRequest.Post <CommentModel>(Uri, new { body = body, in_reply_to = replyToId })); }
public GitHubRequest <CommentModel> Create(string body, string commitId, string path, int position) { return(GitHubRequest.Post <CommentModel>(Uri, new { body = body, commit_id = commitId, path = path, position = position })); }
public GitHubRequest <MilestoneModel> Create(string title, bool open, string description, DateTimeOffset dueDate) { return(GitHubRequest.Post <MilestoneModel>(Uri, new { Title = title, State = open ? "open" : "closed", Description = description, DueOn = dueDate })); }
public GitHubRequest <IssueModel> Create(string title, string body, string assignee, int?milestone, string[] labels) { return(GitHubRequest.Post <IssueModel>(Uri, new { title = title, body = body, assignee = assignee, milestone = milestone, labels = labels })); }
public GitHubRequest <IssueCommentModel> CreateComment(string body) { return(GitHubRequest.Post <IssueCommentModel>(Uri + "/comments", new { body = body })); }
public GitHubRequest <GistModel> ForkGist() { return(GitHubRequest.Post <GistModel>(Uri + "/forks")); }
public GitHubRequest <LabelModel> Create(string name, string color) { return(GitHubRequest.Post <LabelModel>(Uri, new { name, color })); }