Files
octokit.net/Octokit/Models/Response/Reaction.cs
Victor 6c43183837 fix: comment id model update to long instead of int
* #2927: comment id model update to long instead of int

* #2927: code review fixes (1)

* #2927: code review fixes (2)

* #2927: comment id model update to long instead of int: unit tests fix

* #2927: code review fixes

* Fixed most names of parameters

---------

Co-authored-by: Victor Vorobyev <victor@myrtle-sa.com>
Co-authored-by: Brian C. Arnold <brian.arnold@spiderrock.net>
2024-06-10 08:12:08 -05:00

77 lines
1.7 KiB
C#

using System.Diagnostics;
using System.Globalization;
using Octokit.Internal;
namespace Octokit
{
public enum ReactionType
{
[Parameter(Value = "+1")]
Plus1,
[Parameter(Value = "-1")]
Minus1,
[Parameter(Value = "laugh")]
Laugh,
[Parameter(Value = "confused")]
Confused,
[Parameter(Value = "heart")]
Heart,
[Parameter(Value = "hooray")]
Hooray,
[Parameter(Value = "rocket")]
Rocket,
[Parameter(Value = "eyes")]
Eyes
}
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class Reaction
{
public Reaction() { }
public Reaction(long id, string nodeId, User user, ReactionType content)
{
Id = id;
NodeId = nodeId;
User = user;
Content = content;
}
/// <summary>
/// The Id for this reaction.
/// </summary>
public long Id { get; private set; }
/// <summary>
/// GraphQL Node Id
/// </summary>
public string NodeId { get; private set; }
/// <summary>
/// Information about the user.
/// </summary>
public User User { get; private set; }
/// <summary>
/// The reaction type for this commit comment.
/// </summary>
[Parameter(Key = "content")]
public StringEnum<ReactionType> Content { get; private set; }
internal string DebuggerDisplay
{
get
{
return string.Format(CultureInfo.InvariantCulture, "Id: {0}, Reaction: {1}", Id, Content);
}
}
}
}