-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathPullRequestReview.cs
99 lines (81 loc) · 2.71 KB
/
PullRequestReview.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
using System;
using System.Diagnostics;
using System.Globalization;
using Octokit.Internal;
namespace Octokit
{
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class PullRequestReview
{
public PullRequestReview() { }
public PullRequestReview(long id)
{
Id = id;
}
public PullRequestReview(long id, string nodeId, string commitId, User user, string body, string htmlUrl, string pullRequestUrl, PullRequestReviewState state, AuthorAssociation authorAssociation)
{
Id = id;
NodeId = nodeId;
CommitId = commitId;
User = user;
Body = body;
HtmlUrl = htmlUrl;
PullRequestUrl = pullRequestUrl;
State = state;
AuthorAssociation = authorAssociation;
}
/// <summary>
/// The review Id.
/// </summary>
public long Id { get; protected set; }
/// <summary>
/// GraphQL Node Id
/// </summary>
public string NodeId { get; protected set; }
/// <summary>
/// The state of the review
/// </summary>
public StringEnum<PullRequestReviewState> State { get; protected set; }
/// <summary>
/// The commit Id the review is associated with.
/// </summary>
public string CommitId { get; protected set; }
/// <summary>
/// The user that created the review.
/// </summary>
public User User { get; protected set; }
/// <summary>
/// The text of the review.
/// </summary>
public string Body { get; protected set; }
/// <summary>
/// The URL for this review on Github.com
/// </summary>
public string HtmlUrl { get; protected set; }
/// <summary>
/// The URL for the pull request via the API.
/// </summary>
public string PullRequestUrl { get; protected set; }
/// <summary>
/// The comment author association with repository.
/// </summary>
public StringEnum<AuthorAssociation> AuthorAssociation { get; protected set; }
internal string DebuggerDisplay
{
get { return string.Format(CultureInfo.InvariantCulture, "Id: {0}, State: {1}, User: {2}", Id, State.DebuggerDisplay, User.DebuggerDisplay); }
}
}
public enum PullRequestReviewState
{
[Parameter(Value = "APPROVED")]
Approved,
[Parameter(Value = "CHANGES_REQUESTED")]
ChangesRequested,
[Parameter(Value = "COMMENTED")]
Commented,
[Parameter(Value = "DISMISSED")]
Dismissed,
[Parameter(Value = "PENDING")]
Pending
}
}