Example #1
0
 public PullRequest(Uri url, Uri htmlUrl, Uri diffUrl, Uri patchUrl, Uri issueUrl, Uri statusesUrl, int number, ItemState state, string title, string body, DateTimeOffset createdAt, DateTimeOffset updatedAt, DateTimeOffset?closedAt, DateTimeOffset?mergedAt, GitReference head, GitReference @base, User user, User assignee, bool?mergeable, User mergedBy, int comments, int commits, int additions, int deletions, int changedFiles, Milestone milestone)
 {
     Url          = url;
     HtmlUrl      = htmlUrl;
     DiffUrl      = diffUrl;
     PatchUrl     = patchUrl;
     IssueUrl     = issueUrl;
     StatusesUrl  = statusesUrl;
     Number       = number;
     State        = state;
     Title        = title;
     Body         = body;
     CreatedAt    = createdAt;
     UpdatedAt    = updatedAt;
     ClosedAt     = closedAt;
     MergedAt     = mergedAt;
     Head         = head;
     Base         = @base;
     User         = user;
     Assignee     = assignee;
     Mergeable    = mergeable;
     MergedBy     = mergedBy;
     Comments     = comments;
     Commits      = commits;
     Additions    = additions;
     Deletions    = deletions;
     ChangedFiles = changedFiles;
     Milestone    = milestone;
 }
Example #2
0
 public RepositoryTag(string name, GitReference commit, string zipballUrl, string tarballUrl)
 {
     Name       = name;
     Commit     = commit;
     ZipballUrl = zipballUrl;
     TarballUrl = tarballUrl;
 }
Example #3
0
 public PullRequest(Uri url, Uri htmlUrl, Uri diffUrl, Uri patchUrl, Uri issueUrl, Uri statusesUrl, int number, ItemState state, string title, string body, DateTimeOffset createdAt, DateTimeOffset updatedAt, DateTimeOffset? closedAt, DateTimeOffset? mergedAt, GitReference head, GitReference @base, User user, User assignee, bool? mergeable, User mergedBy, int comments, int commits, int additions, int deletions, int changedFiles)
 {
     Url = url;
     HtmlUrl = htmlUrl;
     DiffUrl = diffUrl;
     PatchUrl = patchUrl;
     IssueUrl = issueUrl;
     StatusesUrl = statusesUrl;
     Number = number;
     State = state;
     Title = title;
     Body = body;
     CreatedAt = createdAt;
     UpdatedAt = updatedAt;
     ClosedAt = closedAt;
     MergedAt = mergedAt;
     Head = head;
     Base = @base;
     User = user;
     Assignee = assignee;
     Mergeable = mergeable;
     MergedBy = mergedBy;
     Comments = comments;
     Commits = commits;
     Additions = additions;
     Deletions = deletions;
     ChangedFiles = changedFiles;
 }
Example #4
0
 public PullRequest(long id, string url, string htmlUrl, string diffUrl, string patchUrl, string issueUrl, string statusesUrl, int number, ItemState state, string title, string body, DateTimeOffset createdAt, DateTimeOffset updatedAt, DateTimeOffset?closedAt, DateTimeOffset?mergedAt, GitReference head, GitReference @base, User user, User assignee, IReadOnlyList <User> assignees, bool?mergeable, User mergedBy, string mergeCommitSha, int comments, int commits, int additions, int deletions, int changedFiles, Milestone milestone, bool locked, IReadOnlyList <User> requestedReviewers)
 {
     Id                 = id;
     Url                = url;
     HtmlUrl            = htmlUrl;
     DiffUrl            = diffUrl;
     PatchUrl           = patchUrl;
     IssueUrl           = issueUrl;
     StatusesUrl        = statusesUrl;
     Number             = number;
     State              = state;
     Title              = title;
     Body               = body;
     CreatedAt          = createdAt;
     UpdatedAt          = updatedAt;
     ClosedAt           = closedAt;
     MergedAt           = mergedAt;
     Head               = head;
     Base               = @base;
     User               = user;
     Assignee           = assignee;
     Assignees          = assignees;
     Mergeable          = mergeable;
     MergedBy           = mergedBy;
     MergeCommitSha     = mergeCommitSha;
     Comments           = comments;
     Commits            = commits;
     Additions          = additions;
     Deletions          = deletions;
     ChangedFiles       = changedFiles;
     Milestone          = milestone;
     Locked             = locked;
     RequestedReviewers = requestedReviewers;
 }
Example #5
0
 public RepositoryTag(string name, GitReference commit, string zipballUrl, string tarballUrl)
 {
     Name = name;
     Commit = commit;
     ZipballUrl = zipballUrl;
     TarballUrl = tarballUrl;
 }
Example #6
0
 private Commit GetCommitFromGithubCommit(GitReference commit)
 {
     return new Commit
     {
         //Author = commit.Author.Name,
         //Message = commit.Message,
         Revision = commit.Sha
     };
 }
Example #7
0
 public Commit(string url, string label, string @ref, string sha, User user, Repository repository, string message, SignatureResponse author, SignatureResponse committer, GitReference tree, IEnumerable <GitReference> parents, int commentCount)
     : base(url, label, @ref, sha, user, repository)
 {
     Message      = message;
     Author       = author;
     Committer    = committer;
     Tree         = tree;
     Parents      = parents;
     CommentCount = commentCount;
 }
Example #8
0
        public Commit(string url, string label, string @ref, string sha, User user, Repository repository, string message, Committer author, Committer committer, GitReference tree, IEnumerable <GitReference> parents, int commentCount)
            : base(url, label, @ref, sha, user, repository)
        {
            Ensure.ArgumentNotNull(parents, nameof(parents));

            Message      = message;
            Author       = author;
            Committer    = committer;
            Tree         = tree;
            Parents      = new ReadOnlyCollection <GitReference>(parents.ToList());
            CommentCount = commentCount;
        }
Example #9
0
        public Commit(string url, string label, string @ref, string sha, User user, Repository repository, string message, Committer author, Committer committer, GitReference tree, IEnumerable<GitReference> parents, int commentCount)
            : base(url, label, @ref, sha, user, repository)
        {
            Ensure.ArgumentNotNull(parents, "parents");

            Message = message;
            Author = author;
            Committer = committer;
            Tree = tree;
            Parents = new ReadOnlyCollection<GitReference>(parents.ToList());
            CommentCount = commentCount;
        }
Example #10
0
#pragma warning disable CS0618 // Type or member is obsolete
        public Branch(string name, GitReference commit, BranchProtection protection)
            : this(name, commit, protection, false)
        {
        }
Example #11
0
 public Branch(string name, GitReference commit, bool @protected)
 {
     Name      = name;
     Commit    = commit;
     Protected = @protected;
 }
Example #12
0
#pragma warning disable CS0618 // Type or member is obsolete
        public Branch(string name, GitReference commit, BranchProtection protection)
        {
            Name = name;
            Commit = commit;
            Protection = protection;
        }
Example #13
0
 public Branch(string name, GitReference commit)
 {
     Name   = name;
     Commit = commit;
 }
Example #14
0
#pragma warning disable CS0618 // Type or member is obsolete
        public Branch(string name, GitReference commit, BranchProtection protection)
            : this(name, commit, protection, false)
        {
        }
Example #15
0
        private static string CreateLink(GitReference reference)
        {
            if (reference.Repository != null)
            {
                var baseHtml = reference.Repository.HtmlUrl + "/tree/" + reference.Ref;
                return string.Format("<a href='{0}'>{1}</a>", baseHtml, reference.Label);
            }

            return "<a href='#'>unknown repository</a>";
        }
Example #16
0
 public Branch(string name, GitReference commit, BranchProtection protection)
 {
     Name       = name;
     Commit     = commit;
     Protection = protection;
 }
Example #17
0
#pragma warning restore CS0618 // Type or member is obsolete

#pragma warning disable CS0618 // Type or member is obsolete
        public Branch(string name, GitReference commit, BranchProtection protection, bool @protected)
            : this(name, commit, @protected)
        {
            Protection = protection;
        }
Example #18
0
        public void PerformsCommitSerialization()
        {
            var tree = new GitReference { Sha = "tree-reference", Url = "tree-url" };
            var parent1 = new GitReference { Sha = "parent1-reference", Url = "parent1-url" };
            var parent2 = new GitReference { Sha = "parent2-reference", Url = "parent2-url" };

            var author = new Signature
            {
                Name = "author-name", 
                Email = "author-email", 
                Date = new DateTime(2013, 10, 15, 13, 40, 14, DateTimeKind.Utc)
            };
            
            var committer = new Signature { 
                Name = "committer-name", 
                Email = "committer-email",
                Date = new DateTime(2013, 06, 29, 10, 12, 50, DateTimeKind.Utc)
            };

            var commit = new Commit
            {
                Sha = "commit-reference",
                Url = "commit-url",
                Message = "commit-message",
                Parents = new[]{ parent1, parent2 },
                Tree = tree,
                Author = author,
                Committer = committer,
            };

            var json = new SimpleJsonSerializer().Serialize(commit);

            const string expectedResult = "{\"message\":\"commit-message\"," +
                                            "\"author\":{" +
                                                "\"name\":\"author-name\"," +
                                                "\"email\":\"author-email\"," +
                                                "\"date\":\"2013-10-15T13:40:14Z\"" +
                                            "}," +
                                            "\"committer\":{" +
                                                "\"name\":\"committer-name\"," +
                                                "\"email\":\"committer-email\"," +
                                                "\"date\":\"2013-06-29T10:12:50Z\"" +
                                            "}," +
                                            "\"tree\":{" +
                                                "\"url\":\"tree-url\"," +
                                                "\"sha\":\"tree-reference\"" +
                                            "}," +
                                            "\"parents\":[{" +
                                                "\"url\":\"parent1-url\"," +
                                                "\"sha\":\"parent1-reference\"" +
                                            "}," +
                                            "{" +
                                                "\"url\":\"parent2-url\"," +
                                                "\"sha\":\"parent2-reference\"" +
                                            "}]," +
                                            "\"comment_count\":0," +
                                            "\"url\":\"commit-url\"," +
                                            "\"sha\":\"commit-reference\"" +
                                          "}";

            Assert.Equal(expectedResult, json);
        }
Example #19
0
 public Branch(string name, GitReference commit, bool @protected)
 {
     Name = name;
     Commit = commit;
     Protected = @protected;
 }
Example #20
0
#pragma warning restore CS0618 // Type or member is obsolete

#pragma warning disable CS0618 // Type or member is obsolete
        public Branch(string name, GitReference commit, BranchProtection protection, bool @protected)
            : this(name, commit, @protected)
        {
            Protection = protection;
        }