add request and response for commit comment reactions

This commit is contained in:
maddin2016
2016-05-25 12:14:34 +02:00
parent 7c993503c7
commit 3d39207723
2 changed files with 111 additions and 0 deletions
@@ -0,0 +1,50 @@
using System.Diagnostics;
using System.Globalization;
namespace Octokit
{
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class NewCommitCommentReaction
{
/// <summary>
/// Initializes a new instance of the <see cref="NewCommitCommentReaction"/> class.
/// </summary>
/// <param name="content">The reaction type.</param>
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;
}
}
/// <summary>
/// The reaction type (required)
/// </summary>
public Reaction Content { get; private set; }
internal string DebuggerDisplay
{
get
{
return string.Format(CultureInfo.InvariantCulture, "Content: {0}", Content);
}
}
}
}
@@ -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;
}
/// <summary>
/// The Id for this reaction.
/// </summary>
public int Id { get; protected set; }
/// <summary>
/// The UserId.
/// </summary>
public int UserId { get; protected set; }
/// <summary>
/// The reaction type for this commit comment.
/// </summary>
[Parameter(Key = "content")]
public Reaction Content { get; protected set; }
internal string DebuggerDisplay
{
get
{
return string.Format(CultureInfo.InvariantCulture, "Id: {0}, Reaction: {1}", Id, Content);
}
}
}
}