Пример #1
0
        public GitHubRequest <bool> MarkRepoAsRead(string username, string repository, DateTime?lastReadAt = null)
        {
            var data = new Dictionary <string, string>();

            if (lastReadAt != null)
            {
                data.Add("last_read_at", string.Concat(lastReadAt.Value.ToString("s"), "Z"));
            }
            return(GitHubRequest.Put <bool>(Client.ApiUri + "/repos/" + username + "/" + repository + "/notifications", data));
        }
Пример #2
0
        public GitHubRequest <bool> MarkAsRead(DateTime?lastReadAt = null)
        {
            var data = new Dictionary <string, string>();

            if (lastReadAt != null)
            {
                data.Add("last_read_at", string.Concat(lastReadAt.Value.ToString("s"), "Z"));
            }
            return(GitHubRequest.Put <bool>(Uri, data));
        }
Пример #3
0
        public GitHubRequest <ContentUpdateModel> UpdateContentFile(string path, string message, string content, string sha, string branch = "master")
        {
            if (null == content)
            {
                throw new Exception("Content cannot be null!");
            }
            if (string.IsNullOrEmpty(message))
            {
                throw new Exception("Commit message cannot be empty!");
            }

            content = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(content));
            return(GitHubRequest.Put <ContentUpdateModel>(Uri + "/contents" + path, new { message, content, sha, branch }));
        }
Пример #4
0
 public GitHubRequest <PullRequestMergeModel> Merge(string commit_message = null)
 {
     return(GitHubRequest.Put <PullRequestMergeModel>(Uri + "/merge", new { commit_message = commit_message }));
 }
Пример #5
0
 public GitHubRequest Star()
 {
     return(GitHubRequest.Put(Client.ApiUri + "/user/starred/" + User + "/" + Repo));
 }
Пример #6
0
        public GitHubRequest <SubscriptionModel> SetSubscription(bool subscribed, bool ignored)
        {
            var uri = Uri + "/subscription";

            return(GitHubRequest.Put <SubscriptionModel>(uri, new { Subscribed = subscribed, Ignored = ignored }));
        }
Пример #7
0
 public GitHubRequest Watch()
 {
     return(GitHubRequest.Put(Client.ApiUri + "/user/subscriptions/" + User + "/" + Repo));
 }
Пример #8
0
 public GitHubRequest Follow(string username)
 {
     return(GitHubRequest.Put(Uri + "/following/" + username));
 }
Пример #9
0
 public GitHubRequest Star()
 {
     return(GitHubRequest.Put(Uri + "/star"));
 }