mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-05 03:30:34 +00:00
Add Reactions property to IssueComment object
This commit is contained in:
@@ -11,6 +11,9 @@ namespace Octokit
|
||||
/// </remarks>
|
||||
public class IssueCommentsClient : ApiClient, IIssueCommentsClient
|
||||
{
|
||||
//TODO: Remove this once PR #1335 has been merged
|
||||
public const string ReactionsPreview = "application/vnd.github.squirrel-girl-preview";
|
||||
|
||||
/// <summary>
|
||||
/// Instantiates a new GitHub Issue Comments API client.
|
||||
/// </summary>
|
||||
@@ -32,7 +35,8 @@ namespace Octokit
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||
|
||||
return ApiConnection.Get<IssueComment>(ApiUrls.IssueComment(owner, name, id));
|
||||
//TODO: Use AcceptHeaders.ReactionsPreview once PR #1335 has been merged
|
||||
return ApiConnection.Get<IssueComment>(ApiUrls.IssueComment(owner, name, id), null, ReactionsPreview);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -64,7 +68,8 @@ namespace Octokit
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||
Ensure.ArgumentNotNull(options, "options");
|
||||
|
||||
return ApiConnection.GetAll<IssueComment>(ApiUrls.IssueComments(owner, name), options);
|
||||
//TODO: Use AcceptHeaders.ReactionsPreview once PR #1335 has been merged
|
||||
return ApiConnection.GetAll<IssueComment>(ApiUrls.IssueComments(owner, name), null, ReactionsPreview, options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -97,7 +102,8 @@ namespace Octokit
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||
Ensure.ArgumentNotNull(options, "options");
|
||||
|
||||
return ApiConnection.GetAll<IssueComment>(ApiUrls.IssueComments(owner, name, number), options);
|
||||
//TODO: Use AcceptHeaders.ReactionsPreview once PR #1335 has been merged
|
||||
return ApiConnection.GetAll<IssueComment>(ApiUrls.IssueComments(owner, name, number), null, ReactionsPreview, options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -55,6 +55,8 @@ namespace Octokit
|
||||
/// </summary>
|
||||
public User User { get; protected set; }
|
||||
|
||||
public IssueCommentReactions Reactions { get; set; }
|
||||
|
||||
internal string DebuggerDisplay
|
||||
{
|
||||
get { return string.Format(CultureInfo.InvariantCulture, "Id: {0} CreatedAt: {1}", Id, CreatedAt); }
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using Octokit.Internal;
|
||||
|
||||
namespace Octokit
|
||||
{
|
||||
public class IssueCommentReactions
|
||||
{
|
||||
public int TotalCount { get; set; }
|
||||
[Parameter(Key = "+1")]
|
||||
public int Plus1 { get; set; }
|
||||
[Parameter(Key = "-1")]
|
||||
public int Minus1 { get; set; }
|
||||
public int Laugh { get; set; }
|
||||
public int Confused { get; set; }
|
||||
public int Heart { get; set; }
|
||||
public int Hooray { get; set; }
|
||||
public Uri Url { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -483,6 +483,7 @@
|
||||
<Compile Include="Clients\UserGpgKeysClient.cs" />
|
||||
<Compile Include="Models\Request\NewGpgKey.cs" />
|
||||
<Compile Include="Models\Response\GpgKey.cs" />
|
||||
<Compile Include="Models\Response\IssueCommentReactions.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -494,6 +494,7 @@
|
||||
<Compile Include="Clients\UserGpgKeysClient.cs" />
|
||||
<Compile Include="Models\Request\NewGpgKey.cs" />
|
||||
<Compile Include="Models\Response\GpgKey.cs" />
|
||||
<Compile Include="Models\Response\IssueCommentReactions.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -490,6 +490,7 @@
|
||||
<Compile Include="Clients\UserGpgKeysClient.cs" />
|
||||
<Compile Include="Models\Request\NewGpgKey.cs" />
|
||||
<Compile Include="Models\Response\GpgKey.cs" />
|
||||
<Compile Include="Models\Response\IssueCommentReactions.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
|
||||
@@ -480,6 +480,7 @@
|
||||
<Compile Include="Clients\UserGpgKeysClient.cs" />
|
||||
<Compile Include="Models\Request\NewGpgKey.cs" />
|
||||
<Compile Include="Models\Response\GpgKey.cs" />
|
||||
<Compile Include="Models\Response\IssueCommentReactions.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CodeAnalysisDictionary Include="..\CustomDictionary.xml">
|
||||
|
||||
@@ -487,6 +487,7 @@
|
||||
<Compile Include="Clients\UserGpgKeysClient.cs" />
|
||||
<Compile Include="Models\Request\NewGpgKey.cs" />
|
||||
<Compile Include="Models\Response\GpgKey.cs" />
|
||||
<Compile Include="Models\Response\IssueCommentReactions.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CodeAnalysisDictionary Include="..\CustomDictionary.xml">
|
||||
|
||||
@@ -189,6 +189,7 @@
|
||||
<Compile Include="Models\Response\Enterprise\AdminStatsUsers.cs" />
|
||||
<Compile Include="Models\Response\GitIgnoreTemplate.cs" />
|
||||
<Compile Include="Models\Response\GpgKey.cs" />
|
||||
<Compile Include="Models\Response\IssueCommentReactions.cs" />
|
||||
<Compile Include="Models\Response\License.cs" />
|
||||
<Compile Include="Models\Response\LicenseMetadata.cs" />
|
||||
<Compile Include="Models\Response\Merge.cs" />
|
||||
|
||||
Reference in New Issue
Block a user