diff --git a/Octokit/Models/Common/AuthorAssociation.cs b/Octokit/Models/Common/AuthorAssociation.cs new file mode 100644 index 0000000000..2661c6d487 --- /dev/null +++ b/Octokit/Models/Common/AuthorAssociation.cs @@ -0,0 +1,52 @@ +using Octokit.Internal; + +namespace Octokit +{ + /// + /// States of a Team/Organization Membership + /// + public enum AuthorAssociation + { + /// + /// Author has been invited to collaborate on the repository. + /// + [Parameter(Value = "COLLABORATOR")] + Collaborator, + + /// + /// Author has previously committed to the repository. + /// + [Parameter(Value = "CONTRIBUTOR")] + Contributor, + + /// + /// Author has not previously committed to GitHub. + /// + [Parameter(Value = "FIRST_TIMER")] + FirstTimer, + + /// + /// Author has not previously committed to the repository. + /// + [Parameter(Value = "FIRST_TIME_CONTRIBUTOR")] + FirstTimeContributor, + + /// + /// Author is a member of the organization that owns the repository. + /// + [Parameter(Value = "MEMBER")] + Member, + + /// + /// Author is the owner of the repository. + /// + [Parameter(Value = "OWNER")] + Owner, + + /// + /// Author has no association with the repository. + /// + [Parameter(Value = "NONE")] + None + } +} diff --git a/Octokit/Models/Response/IssueComment.cs b/Octokit/Models/Response/IssueComment.cs index 989fe65ea7..9ef576f89d 100644 --- a/Octokit/Models/Response/IssueComment.cs +++ b/Octokit/Models/Response/IssueComment.cs @@ -10,7 +10,7 @@ public class IssueComment { public IssueComment() { } - public IssueComment(int id, string nodeId, string url, string htmlUrl, string body, DateTimeOffset createdAt, DateTimeOffset? updatedAt, User user, ReactionSummary reactions) + public IssueComment(int id, string nodeId, string url, string htmlUrl, string body, DateTimeOffset createdAt, DateTimeOffset? updatedAt, User user, ReactionSummary reactions, AuthorAssociation authorAssociation) { Id = id; NodeId = nodeId; @@ -21,6 +21,7 @@ public IssueComment(int id, string nodeId, string url, string htmlUrl, string bo UpdatedAt = updatedAt; User = user; Reactions = reactions; + AuthorAssociation = authorAssociation; } /// @@ -63,6 +64,11 @@ public IssueComment(int id, string nodeId, string url, string htmlUrl, string bo /// public User User { get; protected set; } + /// + /// The comment author association with repository. + /// + public StringEnum AuthorAssociation { get; protected set; } + /// /// The reaction summary for this comment. /// diff --git a/Octokit/Models/Response/PullRequestReview.cs b/Octokit/Models/Response/PullRequestReview.cs index e6e1d33c40..4334b2a256 100644 --- a/Octokit/Models/Response/PullRequestReview.cs +++ b/Octokit/Models/Response/PullRequestReview.cs @@ -15,7 +15,7 @@ public PullRequestReview(long id) Id = id; } - public PullRequestReview(long id, string nodeId, string commitId, User user, string body, string htmlUrl, string pullRequestUrl, PullRequestReviewState state) + public PullRequestReview(long id, string nodeId, string commitId, User user, string body, string htmlUrl, string pullRequestUrl, PullRequestReviewState state, AuthorAssociation authorAssociation) { Id = id; NodeId = nodeId; @@ -25,6 +25,7 @@ public PullRequestReview(long id, string nodeId, string commitId, User user, str HtmlUrl = htmlUrl; PullRequestUrl = pullRequestUrl; State = state; + AuthorAssociation = authorAssociation; } /// @@ -67,6 +68,11 @@ public PullRequestReview(long id, string nodeId, string commitId, User user, str /// public string PullRequestUrl { get; protected set; } + /// + /// The comment author association with repository. + /// + public StringEnum AuthorAssociation { get; protected set; } + internal string DebuggerDisplay { get { return string.Format(CultureInfo.InvariantCulture, "Id: {0}, State: {1}, User: {2}", Id, State.DebuggerDisplay, User.DebuggerDisplay); } diff --git a/Octokit/Models/Response/PullRequestReviewComment.cs b/Octokit/Models/Response/PullRequestReviewComment.cs index d6a71d424a..6f2a96734b 100644 --- a/Octokit/Models/Response/PullRequestReviewComment.cs +++ b/Octokit/Models/Response/PullRequestReviewComment.cs @@ -15,7 +15,7 @@ public PullRequestReviewComment(int id) Id = id; } - public PullRequestReviewComment(string url, int id, string nodeId, string diffHunk, string path, int? position, int? originalPosition, string commitId, string originalCommitId, User user, string body, DateTimeOffset createdAt, DateTimeOffset updatedAt, string htmlUrl, string pullRequestUrl, ReactionSummary reactions, int? inReplyToId, int? pullRequestReviewId) + public PullRequestReviewComment(string url, int id, string nodeId, string diffHunk, string path, int? position, int? originalPosition, string commitId, string originalCommitId, User user, string body, DateTimeOffset createdAt, DateTimeOffset updatedAt, string htmlUrl, string pullRequestUrl, ReactionSummary reactions, int? inReplyToId, int? pullRequestReviewId, AuthorAssociation authorAssociation) { PullRequestReviewId = pullRequestReviewId; Url = url; @@ -35,6 +35,7 @@ public PullRequestReviewComment(string url, int id, string nodeId, string diffHu PullRequestUrl = pullRequestUrl; Reactions = reactions; InReplyToId = inReplyToId; + AuthorAssociation = authorAssociation; } /// @@ -127,6 +128,11 @@ public PullRequestReviewComment(string url, int id, string nodeId, string diffHu /// public int? PullRequestReviewId { get; protected set; } + /// + /// The comment author association with repository. + /// + public StringEnum AuthorAssociation { get; protected set; } + internal string DebuggerDisplay { get { return string.Format(CultureInfo.InvariantCulture, "Id: {0}, Path: {1}, User: {2}, Url: {3}", Id, Path, User.DebuggerDisplay, Url); }