diff --git a/Octokit/Models/Request/NewCommitCommentReaction.cs b/Octokit/Models/Request/NewCommitCommentReaction.cs new file mode 100644 index 00000000..20bcc556 --- /dev/null +++ b/Octokit/Models/Request/NewCommitCommentReaction.cs @@ -0,0 +1,50 @@ +using System.Diagnostics; +using System.Globalization; + +namespace Octokit +{ + [DebuggerDisplay("{DebuggerDisplay,nq}")] + public class NewCommitCommentReaction + { + /// + /// Initializes a new instance of the class. + /// + /// The reaction type. + public NewCommitCommentReaction(Reaction content) + { + switch (content){ + case Reaction.Plus1: + Content = Reaction.Plus1; + break; + case Reaction.Minus1: + Content = Reaction.Minus1; + break; + case Reaction.Laugh: + Content = Reaction.Laugh; + break; + case Reaction.Hooray: + Content = Reaction.Hooray; + break; + case Reaction.Heart: + Content = Reaction.Heart; + break; + case Reaction.Confused: + Content = Reaction.Confused; + break; + } + } + + /// + /// The reaction type (required) + /// + public Reaction Content { get; private set; } + + internal string DebuggerDisplay + { + get + { + return string.Format(CultureInfo.InvariantCulture, "Content: {0}", Content); + } + } + } +} diff --git a/Octokit/Models/Response/CommitCommentReaction.cs b/Octokit/Models/Response/CommitCommentReaction.cs new file mode 100644 index 00000000..6def0a99 --- /dev/null +++ b/Octokit/Models/Response/CommitCommentReaction.cs @@ -0,0 +1,61 @@ +using Octokit.Internal; +using System; +using System.Diagnostics; +using System.Globalization; + +namespace Octokit +{ + public enum Reaction + { + [Parameter(Value = "plus_one")] + Plus1 = 0, + [Parameter(Value = "minus_one")] + Minus1 = 1, + [Parameter(Value = "laugh")] + Laugh = 2, + [Parameter(Value = "confused")] + Confused = 3, + [Parameter(Value = "heart")] + Heart = 4, + [Parameter(Value = "hooray")] + Hooray = 5 + } + + [DebuggerDisplay("{DebuggerDisplay,nq}")] + public class CommitCommentReaction + { + public CommitCommentReaction() { } + + public CommitCommentReaction(int id, int userId, Reaction content) + { + Id = id; + UserId = userId; + Content = content; + } + + /// + /// The Id for this reaction. + /// + public int Id { get; protected set; } + + /// + /// The UserId. + /// + public int UserId { get; protected set; } + + /// + /// The reaction type for this commit comment. + /// + [Parameter(Key = "content")] + public Reaction Content { get; protected set; } + + internal string DebuggerDisplay + { + get + { + return string.Format(CultureInfo.InvariantCulture, "Id: {0}, Reaction: {1}", Id, Content); + } + } + } +} +