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; }
public RepositoryTag(string name, GitReference commit, string zipballUrl, string tarballUrl) { Name = name; Commit = commit; ZipballUrl = zipballUrl; TarballUrl = tarballUrl; }
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; }
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; }
private Commit GetCommitFromGithubCommit(GitReference commit) { return new Commit { //Author = commit.Author.Name, //Message = commit.Message, Revision = commit.Sha }; }
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; }
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; }
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; }
#pragma warning disable CS0618 // Type or member is obsolete public Branch(string name, GitReference commit, BranchProtection protection) : this(name, commit, protection, false) { }
public Branch(string name, GitReference commit, bool @protected) { Name = name; Commit = commit; Protected = @protected; }
#pragma warning disable CS0618 // Type or member is obsolete public Branch(string name, GitReference commit, BranchProtection protection) { Name = name; Commit = commit; Protection = protection; }
public Branch(string name, GitReference commit) { Name = name; Commit = commit; }
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>"; }
public Branch(string name, GitReference commit, BranchProtection protection) { Name = name; Commit = commit; Protection = protection; }
#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; }
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); }