mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-03 03:01:31 +00:00
feat: Adds 4 new Reaction delete routes and obsoleting existing routes (#2494)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Reactive;
|
||||
|
||||
namespace Octokit.Reactive
|
||||
{
|
||||
@@ -70,5 +71,26 @@ namespace Octokit.Reactive
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
/// <returns></returns>
|
||||
IObservable<Reaction> GetAll(long repositoryId, int number, ApiOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Commit Comment
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-a-commit-comment-reaction</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="commentId">The comment id</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
IObservable<Unit> Delete(string owner, string name, int commentId, int reactionId);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Commit Comment
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-a-commit-comment-reaction</remarks>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="commentId">The comment id</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
IObservable<Unit> Delete(long repositoryId, int commentId, int reactionId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Reactive;
|
||||
|
||||
namespace Octokit.Reactive
|
||||
{
|
||||
@@ -64,5 +65,26 @@ namespace Octokit.Reactive
|
||||
/// <param name="number">The comment id</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
IObservable<Reaction> GetAll(long repositoryId, int number, ApiOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Issue Comment
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-an-issue-comment-reaction</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="commentId">The comment id</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
IObservable<Unit> Delete(string owner, string name, int commentId, int reactionId);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Commit Comment
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-an-issue-comment-reaction</remarks>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="commentId">The comment id</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
IObservable<Unit> Delete(long repositoryId, int commentId, int reactionId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Reactive;
|
||||
|
||||
namespace Octokit.Reactive
|
||||
{
|
||||
@@ -64,5 +65,26 @@ namespace Octokit.Reactive
|
||||
/// <param name="number">The issue id</param>
|
||||
/// <param name="reaction">The reaction to create </param>
|
||||
IObservable<Reaction> Create(long repositoryId, int number, NewReaction reaction);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Issue
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-an-issue-reaction</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="issueNumber">The issue number</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
IObservable<Unit> Delete(string owner, string name, int issueNumber, int reactionId);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Issue
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-an-issue-reaction</remarks>
|
||||
/// <param name="repositoryId">The owner of the repository</param>
|
||||
/// <param name="issueNumber">The issue number</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
IObservable<Unit> Delete(long repositoryId, int issueNumber, int reactionId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Reactive;
|
||||
|
||||
namespace Octokit.Reactive
|
||||
{
|
||||
@@ -64,5 +65,26 @@ namespace Octokit.Reactive
|
||||
/// <param name="number">The comment id</param>
|
||||
/// <param name="reaction">The reaction to create</param>
|
||||
IObservable<Reaction> Create(long repositoryId, int number, NewReaction reaction);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Pull Request comment
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-a-pull-request-comment-reaction</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="commentId">The comment id</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
IObservable<Unit> Delete(string owner, string name, int commentId, int reactionId);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Pull Request comment
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-a-pull-request-comment-reaction</remarks>
|
||||
/// <param name="repositoryId">The owner of the repository</param>
|
||||
/// <param name="commentId">The comment id</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
IObservable<Unit> Delete(long repositoryId, int commentId, int reactionId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Reactive;
|
||||
using System.Reactive.Threading.Tasks;
|
||||
using Octokit.Reactive.Internal;
|
||||
|
||||
@@ -113,5 +114,38 @@ namespace Octokit.Reactive
|
||||
|
||||
return _connection.GetAndFlattenAllPages<Reaction>(ApiUrls.CommitCommentReactions(repositoryId, number), null, AcceptHeaders.ReactionsPreview, options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Commit Comment
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-a-commit-comment-reaction</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="commentId">The comment id</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
public IObservable<Unit> Delete(string owner, string name, int commentId, int reactionId)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
|
||||
Ensure.ArgumentNotNull(reactionId, nameof(reactionId));
|
||||
|
||||
return _client.Delete(owner, name, commentId, reactionId).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Commit Comment
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-a-commit-comment-reaction</remarks>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="commentId">The comment id</param>
|
||||
/// <param name="reactionid">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
public IObservable<Unit> Delete(long repositoryId, int commentId, int reactionid)
|
||||
{
|
||||
Ensure.ArgumentNotNull(reactionid, nameof(reactionid));
|
||||
|
||||
return _client.Delete(repositoryId, commentId, reactionid).ToObservable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Reactive;
|
||||
using System.Reactive.Threading.Tasks;
|
||||
using Octokit.Reactive.Internal;
|
||||
|
||||
@@ -110,5 +111,38 @@ namespace Octokit.Reactive
|
||||
|
||||
return _connection.GetAndFlattenAllPages<Reaction>(ApiUrls.IssueCommentReactions(repositoryId, number), null, AcceptHeaders.ReactionsPreview, options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Issue Comment
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-an-issue-comment-reaction</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="commentId">The comment id</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
public IObservable<Unit> Delete(string owner, string name, int commentId, int reactionId)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
|
||||
Ensure.ArgumentNotNull(reactionId, nameof(reactionId));
|
||||
|
||||
return _client.Delete(owner, name, commentId, reactionId).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Commit Comment
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-an-issue-comment-reaction</remarks>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="commentId">The comment id</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
public IObservable<Unit> Delete(long repositoryId, int commentId, int reactionId)
|
||||
{
|
||||
Ensure.ArgumentNotNull(reactionId, nameof(reactionId));
|
||||
|
||||
return _client.Delete(repositoryId, commentId, reactionId).ToObservable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Reactive;
|
||||
using System.Reactive.Threading.Tasks;
|
||||
using Octokit.Reactive.Internal;
|
||||
|
||||
@@ -107,5 +108,38 @@ namespace Octokit.Reactive
|
||||
|
||||
return _client.Create(repositoryId, number, reaction).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Issue
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-an-issue-reaction</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="issueNumber">The issue number</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
public IObservable<Unit> Delete(string owner, string name, int issueNumber, int reactionId)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
|
||||
Ensure.ArgumentNotNull(reactionId, nameof(reactionId));
|
||||
|
||||
return _client.Delete(owner, name, issueNumber, reactionId).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Issue
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-an-issue-reaction</remarks>
|
||||
/// <param name="repositoryId">The owner of the repository</param>
|
||||
/// <param name="issueNumber">The issue number</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
public IObservable<Unit> Delete(long repositoryId, int issueNumber, int reactionId)
|
||||
{
|
||||
Ensure.ArgumentNotNull(reactionId, nameof(reactionId));
|
||||
|
||||
return _client.Delete(repositoryId, issueNumber, reactionId).ToObservable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Reactive;
|
||||
using System.Reactive.Threading.Tasks;
|
||||
using Octokit.Reactive.Internal;
|
||||
|
||||
@@ -41,7 +42,7 @@ namespace Octokit.Reactive
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
|
||||
Ensure.ArgumentNotNull(options, nameof(options));
|
||||
|
||||
return _connection.GetAndFlattenAllPages<Reaction>(ApiUrls.PullRequestReviewCommentReaction(owner, name, number), null, AcceptHeaders.ReactionsPreview, options);
|
||||
return _connection.GetAndFlattenAllPages<Reaction>(ApiUrls.PullRequestReviewCommentReactions(owner, name, number), null, AcceptHeaders.ReactionsPreview, options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -66,7 +67,7 @@ namespace Octokit.Reactive
|
||||
{
|
||||
Ensure.ArgumentNotNull(options, nameof(options));
|
||||
|
||||
return _connection.GetAndFlattenAllPages<Reaction>(ApiUrls.PullRequestReviewCommentReaction(repositoryId, number), null, AcceptHeaders.ReactionsPreview, options);
|
||||
return _connection.GetAndFlattenAllPages<Reaction>(ApiUrls.PullRequestReviewCommentReactions(repositoryId, number), null, AcceptHeaders.ReactionsPreview, options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -99,5 +100,38 @@ namespace Octokit.Reactive
|
||||
|
||||
return _client.Create(repositoryId, number, reaction).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Pull Request comment
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-a-pull-request-comment-reaction</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="commentId">The comment id</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
public IObservable<Unit> Delete(string owner, string name, int commentId, int reactionId)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
|
||||
Ensure.ArgumentNotNull(reactionId, nameof(reactionId));
|
||||
|
||||
return _client.Delete(owner, name, commentId, reactionId).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Pull Request comment
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-a-pull-request-comment-reaction</remarks>
|
||||
/// <param name="repositoryId">The owner of the repository</param>
|
||||
/// <param name="commentId">The comment id</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
public IObservable<Unit> Delete(long repositoryId, int commentId, int reactionId)
|
||||
{
|
||||
Ensure.ArgumentNotNull(reactionId, nameof(reactionId));
|
||||
|
||||
return _client.Delete(repositoryId, commentId, reactionId).ToObservable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -352,6 +352,54 @@ public class CommitCommentReactionsClientTests
|
||||
Assert.Equal(result.User.Id, reaction.User.Id);
|
||||
}
|
||||
|
||||
|
||||
[IntegrationTest]
|
||||
public async Task CanDeleteReaction()
|
||||
{
|
||||
var commit = await SetupCommitForRepository(_github);
|
||||
|
||||
var comment = new NewCommitComment("test");
|
||||
|
||||
var result = await _github.Repository.Comment.Create(_context.RepositoryOwner, _context.RepositoryName,
|
||||
commit.Sha, comment);
|
||||
|
||||
foreach (ReactionType reactionType in Enum.GetValues(typeof(ReactionType)))
|
||||
{
|
||||
var newReaction = new NewReaction(reactionType);
|
||||
|
||||
var reaction = await _github.Reaction.CommitComment.Create(_context.RepositoryOwner, _context.RepositoryName, result.Id, newReaction);
|
||||
|
||||
await _github.Reaction.CommitComment.Delete(_context.RepositoryOwner, _context.RepositoryName, result.Id, reaction.Id);
|
||||
}
|
||||
|
||||
var finalComments = await _github.Reaction.CommitComment.GetAll(_context.RepositoryOwner, _context.RepositoryName, result.Id);
|
||||
|
||||
Assert.Empty(finalComments);
|
||||
}
|
||||
|
||||
[IntegrationTest]
|
||||
public async Task CanDeleteReactionWithRepositoryId()
|
||||
{
|
||||
var commit = await SetupCommitForRepository(_github);
|
||||
|
||||
var comment = new NewCommitComment("test");
|
||||
|
||||
var result = await _github.Repository.Comment.Create(_context.RepositoryId, commit.Sha, comment);
|
||||
|
||||
foreach (ReactionType reactionType in Enum.GetValues(typeof(ReactionType)))
|
||||
{
|
||||
var newReaction = new NewReaction(reactionType);
|
||||
|
||||
var reaction = await _github.Reaction.CommitComment.Create(_context.RepositoryId, result.Id, newReaction);
|
||||
|
||||
await _github.Reaction.CommitComment.Delete(_context.RepositoryId, result.Id, reaction.Id);
|
||||
}
|
||||
|
||||
var finalComments = await _github.Reaction.CommitComment.GetAll(_context.RepositoryId, result.Id);
|
||||
|
||||
Assert.Empty(finalComments);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_context.Dispose();
|
||||
|
||||
@@ -322,6 +322,55 @@ public class IssueCommentReactionsClientTests
|
||||
Assert.Equal(issueComment.User.Id, issueCommentReaction.User.Id);
|
||||
}
|
||||
|
||||
[IntegrationTest]
|
||||
public async Task CanDeleteReaction()
|
||||
{
|
||||
var newIssue = new NewIssue("a test issue") { Body = "A new unassigned issue" };
|
||||
var issue = await _issuesClient.Create(_context.RepositoryOwner, _context.RepositoryName, newIssue);
|
||||
|
||||
Assert.NotNull(issue);
|
||||
|
||||
var issueComment = await _issuesClient.Comment.Create(_context.RepositoryOwner, _context.RepositoryName, issue.Number, "A test comment");
|
||||
|
||||
foreach (ReactionType reactionType in Enum.GetValues(typeof(ReactionType)))
|
||||
{
|
||||
var newReaction = new NewReaction(reactionType);
|
||||
|
||||
var reaction = await _github.Reaction.IssueComment.Create(_context.RepositoryOwner, _context.RepositoryName, issueComment.Id, newReaction);
|
||||
|
||||
await _github.Reaction.IssueComment.Delete(_context.RepositoryOwner, _context.RepositoryName, issueComment.Id, reaction.Id);
|
||||
}
|
||||
|
||||
var allReactions = await _github.Reaction.IssueComment.GetAll(_context.RepositoryOwner, _context.RepositoryName, issueComment.Id);
|
||||
|
||||
Assert.Empty(allReactions);
|
||||
}
|
||||
|
||||
[IntegrationTest]
|
||||
public async Task CanDeleteReactionWithRepositoryId()
|
||||
{
|
||||
var newIssue = new NewIssue("a test issue") { Body = "A new unassigned issue" };
|
||||
var issue = await _issuesClient.Create(_context.RepositoryId, newIssue);
|
||||
|
||||
Assert.NotNull(issue);
|
||||
|
||||
var issueComment = await _issuesClient.Comment.Create(_context.RepositoryId, issue.Number, "A test comment");
|
||||
|
||||
Assert.NotNull(issueComment);
|
||||
|
||||
foreach (ReactionType reactionType in Enum.GetValues(typeof(ReactionType)))
|
||||
{
|
||||
var newReaction = new NewReaction(reactionType);
|
||||
|
||||
var reaction = await _github.Reaction.IssueComment.Create(_context.RepositoryId, issueComment.Id, newReaction);
|
||||
await _github.Reaction.IssueComment.Delete(_context.RepositoryId, issueComment.Id, reaction.Id);
|
||||
}
|
||||
|
||||
var allReactions = await _github.Reaction.IssueComment.GetAll(_context.RepositoryId, issueComment.Id);
|
||||
|
||||
Assert.Empty(allReactions);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_context.Dispose();
|
||||
|
||||
@@ -286,6 +286,49 @@ public class IssueReactionsClientTests
|
||||
Assert.Equal(issue.User.Id, issueReaction.User.Id);
|
||||
}
|
||||
|
||||
[IntegrationTest]
|
||||
public async Task CanDeleteReaction()
|
||||
{
|
||||
var newIssue = new NewIssue("a test issue") { Body = "A new unassigned issue" };
|
||||
var issue = await _issuesClient.Create(_context.RepositoryOwner, _context.RepositoryName, newIssue);
|
||||
|
||||
Assert.NotNull(issue);
|
||||
|
||||
foreach (ReactionType reactionType in Enum.GetValues(typeof(ReactionType)))
|
||||
{
|
||||
var newReaction = new NewReaction(reactionType);
|
||||
|
||||
var reaction = await _github.Reaction.Issue.Create(_context.RepositoryOwner, _context.RepositoryName, issue.Number, newReaction);
|
||||
await _github.Reaction.Issue.Delete(_context.RepositoryOwner, _context.RepositoryName, issue.Number, reaction.Id);
|
||||
}
|
||||
|
||||
var allReactions = await _github.Reaction.Issue.GetAll(_context.RepositoryOwner, _context.RepositoryName, issue.Number);
|
||||
|
||||
Assert.Empty(allReactions);
|
||||
}
|
||||
|
||||
[IntegrationTest]
|
||||
public async Task CanDeleteReactionWithRepositoryId()
|
||||
{
|
||||
var newIssue = new NewIssue("a test issue") { Body = "A new unassigned issue" };
|
||||
var issue = await _issuesClient.Create(_context.RepositoryOwner, _context.RepositoryName, newIssue);
|
||||
|
||||
Assert.NotNull(issue);
|
||||
|
||||
foreach (ReactionType reactionType in Enum.GetValues(typeof(ReactionType)))
|
||||
{
|
||||
var newReaction = new NewReaction(reactionType);
|
||||
|
||||
var reaction = await _github.Reaction.Issue.Create(_context.RepositoryOwner, _context.RepositoryName, issue.Number, newReaction);
|
||||
await _github.Reaction.Issue.Delete(_context.RepositoryId, issue.Number, reaction.Id);
|
||||
}
|
||||
|
||||
var allReactions = await _github.Reaction.Issue.GetAll(_context.RepositoryId, issue.Number);
|
||||
|
||||
Assert.Empty(allReactions);
|
||||
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_context.Dispose();
|
||||
|
||||
@@ -339,6 +339,60 @@ public class PullRequestReviewCommentReactionsClientTests : IDisposable
|
||||
Assert.Equal(commentFromGitHub.User.Id, pullRequestReviewCommentReaction.User.Id);
|
||||
}
|
||||
|
||||
[IntegrationTest]
|
||||
public async Task CanDeleteReaction()
|
||||
{
|
||||
var pullRequest = await CreatePullRequest(_context);
|
||||
|
||||
const string body = "A review comment message";
|
||||
const int position = 1;
|
||||
|
||||
var createdComment = await CreateComment(body, position, pullRequest.Sha, pullRequest.Number);
|
||||
|
||||
var commentFromGitHub = await _client.GetComment(Helper.UserName, _context.RepositoryName, createdComment.Id);
|
||||
|
||||
AssertComment(commentFromGitHub, body, position);
|
||||
|
||||
foreach (ReactionType reactionType in Enum.GetValues(typeof(ReactionType)))
|
||||
{
|
||||
var newReaction = new NewReaction(reactionType);
|
||||
|
||||
var reaction = await _github.Reaction.PullRequestReviewComment.Create(_context.RepositoryOwner, _context.RepositoryName, commentFromGitHub.Id, newReaction);
|
||||
await _github.Reaction.PullRequestReviewComment.Delete(_context.RepositoryOwner, _context.RepositoryName, commentFromGitHub.Id, reaction.Id);
|
||||
}
|
||||
|
||||
var allReactions = await _github.Reaction.PullRequestReviewComment.GetAll(_context.RepositoryOwner, _context.RepositoryName, commentFromGitHub.Id);
|
||||
|
||||
Assert.Empty(allReactions);
|
||||
}
|
||||
|
||||
[IntegrationTest]
|
||||
public async Task CanDeleteReactionWithRepositoryId()
|
||||
{
|
||||
var pullRequest = await CreatePullRequest(_context);
|
||||
|
||||
const string body = "A review comment message";
|
||||
const int position = 1;
|
||||
|
||||
var createdComment = await CreateComment(body, position, pullRequest.Sha, pullRequest.Number);
|
||||
|
||||
var commentFromGitHub = await _client.GetComment(_context.RepositoryId, createdComment.Id);
|
||||
|
||||
AssertComment(commentFromGitHub, body, position);
|
||||
|
||||
foreach (ReactionType reactionType in Enum.GetValues(typeof(ReactionType)))
|
||||
{
|
||||
var newReaction = new NewReaction(reactionType);
|
||||
|
||||
var reaction = await _github.Reaction.PullRequestReviewComment.Create(_context.RepositoryId, commentFromGitHub.Id, newReaction);
|
||||
await _github.Reaction.PullRequestReviewComment.Delete(_context.RepositoryId, commentFromGitHub.Id, reaction.Id);
|
||||
}
|
||||
|
||||
var allReactions = await _github.Reaction.PullRequestReviewComment.GetAll(_context.RepositoryId, commentFromGitHub.Id);
|
||||
|
||||
Assert.Empty(allReactions);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the base state for testing (creates a repo, a commit in master, a branch, a commit in the branch and a pull request)
|
||||
/// </summary>
|
||||
@@ -349,7 +403,7 @@ public class PullRequestReviewCommentReactionsClientTests : IDisposable
|
||||
|
||||
// Creating a commit in master
|
||||
|
||||
var createdCommitInMaster = await CreateCommit(repoName, "Hello World!", "README.md", "heads/master", "A master commit message");
|
||||
var createdCommitInMaster = await CreateCommit(repoName, "Hello World!", "README.md", "heads/main", "A master commit message");
|
||||
|
||||
// Creating a branch
|
||||
|
||||
@@ -362,7 +416,7 @@ public class PullRequestReviewCommentReactionsClientTests : IDisposable
|
||||
|
||||
// Creating a pull request
|
||||
|
||||
var pullRequest = new NewPullRequest("Nice title for the pull request", branchName, "master");
|
||||
var pullRequest = new NewPullRequest("Nice title for the pull request", branchName, "main");
|
||||
var createdPullRequest = await _github.PullRequest.Create(Helper.UserName, repoName, pullRequest);
|
||||
|
||||
var data = new PullRequestData
|
||||
|
||||
@@ -116,5 +116,37 @@ namespace Octokit
|
||||
|
||||
return ApiConnection.GetAll<Reaction>(ApiUrls.CommitCommentReactions(repositoryId, number), null, AcceptHeaders.ReactionsPreview, options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Commit Comment
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-a-commit-comment-reaction</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="commentId">The comment id</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
[ManualRoute("DELETE", "/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}")]
|
||||
public Task Delete(string owner, string name, int commentId, int reactionId)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
|
||||
|
||||
return ApiConnection.Delete(ApiUrls.CommitCommentReaction(owner, name, commentId, reactionId));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Commit Comment
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-a-commit-comment-reaction</remarks>
|
||||
/// <param name="repositoryId">The owner of the repository</param>
|
||||
/// <param name="commentId">The comment id</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
[ManualRoute("DELETE", "/repositories/{id}/comments/{comment_id}/reactions/{reaction_id}")]
|
||||
public Task Delete(long repositoryId, int commentId, int reactionId)
|
||||
{
|
||||
return ApiConnection.Delete(ApiUrls.CommitCommentReaction(repositoryId, commentId, reactionId));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,5 +71,26 @@ namespace Octokit
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
/// <returns></returns>
|
||||
Task<IReadOnlyList<Reaction>> GetAll(long repositoryId, int number, ApiOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Commit Comment
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-a-commit-comment-reaction</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="commentId">The comment id</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
Task Delete(string owner, string name, int commentId, int reactionId);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Commit Comment
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-a-commit-comment-reaction</remarks>
|
||||
/// <param name="repositoryId">The owner of the repository</param>
|
||||
/// <param name="commentId">The comment id</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
Task Delete(long repositoryId, int commentId, int reactionId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,5 +65,26 @@ namespace Octokit
|
||||
/// <param name="number">The comment id</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
Task<IReadOnlyList<Reaction>> GetAll(long repositoryId, int number, ApiOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Commit Comment
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-a-commit-comment-reaction</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="commentId">The comment id</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
Task Delete(string owner, string name, int commentId, int reactionId);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Commit Comment
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-a-commit-comment-reaction</remarks>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="commentId">The comment id</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
Task Delete(long repositoryId, int commentId, int reactionId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,5 +65,26 @@ namespace Octokit
|
||||
/// <param name="number">The issue id</param>
|
||||
/// <param name="reaction">The reaction to create</param>
|
||||
Task<Reaction> Create(long repositoryId, int number, NewReaction reaction);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Issue
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-an-issue-reaction</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="issueNumber">The issue number</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
Task Delete(string owner, string name, int issueNumber, int reactionId);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Issue
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-an-issue-reaction</remarks>
|
||||
/// <param name="repositoryId">The owner of the repository</param>
|
||||
/// <param name="issueNumber">The issue number</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
Task Delete(long repositoryId, int issueNumber, int reactionId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,5 +65,26 @@ namespace Octokit
|
||||
/// <param name="number">The comment id</param>
|
||||
/// <param name="reaction">The reaction to create</param>
|
||||
Task<Reaction> Create(long repositoryId, int number, NewReaction reaction);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Pull Request comment
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-a-pull-request-comment-reaction</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="commentId">The issue id</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
Task Delete(string owner, string name, int commentId, int reactionId);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Pull Request comment
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-a-pull-request-comment-reaction</remarks>
|
||||
/// <param name="repositoryId">The owner of the repository</param>
|
||||
/// <param name="commentId">The issue id</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
Task Delete(long repositoryId, int commentId, int reactionId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,5 +110,37 @@ namespace Octokit
|
||||
|
||||
return ApiConnection.GetAll<Reaction>(ApiUrls.IssueCommentReactions(repositoryId, number), null, AcceptHeaders.ReactionsPreview, options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Issue Comment
|
||||
/// </summary>
|
||||
/// <remarks>https://developer.github.com/v3/reactions/#list-reactions-for-a-commit-comment</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="commentId">The issue id</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
[ManualRoute("DELETE", "/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}")]
|
||||
public Task Delete(string owner, string name, int commentId, int reactionId)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
|
||||
|
||||
return ApiConnection.Delete(ApiUrls.IssueCommentReaction(owner, name, commentId, reactionId));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Issue Comment
|
||||
/// </summary>
|
||||
/// <remarks>https://developer.github.com/v3/reactions/#list-reactions-for-a-commit-comment</remarks>
|
||||
/// <param name="repositoryId">The owner of the repository</param>
|
||||
/// <param name="commentId">The issue id</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
[ManualRoute("DELETE", "/repositories/{id}/issues/comments/{comment_id}/reactions/{reaction_id}")]
|
||||
public Task Delete(long repositoryId, int commentId, int reactionId)
|
||||
{
|
||||
return ApiConnection.Delete(ApiUrls.IssueCommentReaction(repositoryId, commentId, reactionId));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,5 +110,37 @@ namespace Octokit
|
||||
|
||||
return ApiConnection.Post<Reaction>(ApiUrls.IssueReactions(repositoryId, number), reaction, AcceptHeaders.ReactionsPreview);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Issue
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-an-issue-reaction</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="issueNumber">The issue id</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
[ManualRoute("DELETE", "/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}")]
|
||||
public Task Delete(string owner, string name, int issueNumber, int reactionId)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
|
||||
|
||||
return ApiConnection.Delete(ApiUrls.IssueReaction(owner, name, issueNumber, reactionId));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Issue
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-an-issue-reaction</remarks>
|
||||
/// <param name="repositoryId">The owner of the repository</param>
|
||||
/// <param name="issueNumber">The issue id</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
[ManualRoute("DELETE", "/repositories/{id}/issues/{issue_number}/reactions/{reaction_id}")]
|
||||
public Task Delete(long repositoryId, int issueNumber, int reactionId)
|
||||
{
|
||||
return ApiConnection.Delete(ApiUrls.IssueReaction(repositoryId, issueNumber, reactionId));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Octokit
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
|
||||
Ensure.ArgumentNotNull(options, nameof(options));
|
||||
|
||||
return ApiConnection.GetAll<Reaction>(ApiUrls.PullRequestReviewCommentReaction(owner, name, number), null, AcceptHeaders.ReactionsPreview, options);
|
||||
return ApiConnection.GetAll<Reaction>(ApiUrls.PullRequestReviewCommentReactions(owner, name, number), null, AcceptHeaders.ReactionsPreview, options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -73,7 +73,7 @@ namespace Octokit
|
||||
{
|
||||
Ensure.ArgumentNotNull(options, nameof(options));
|
||||
|
||||
return ApiConnection.GetAll<Reaction>(ApiUrls.PullRequestReviewCommentReaction(repositoryId, number), null, AcceptHeaders.ReactionsPreview, options);
|
||||
return ApiConnection.GetAll<Reaction>(ApiUrls.PullRequestReviewCommentReactions(repositoryId, number), null, AcceptHeaders.ReactionsPreview, options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -92,7 +92,7 @@ namespace Octokit
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
|
||||
Ensure.ArgumentNotNull(reaction, nameof(reaction));
|
||||
|
||||
return ApiConnection.Post<Reaction>(ApiUrls.PullRequestReviewCommentReaction(owner, name, number), reaction, AcceptHeaders.ReactionsPreview);
|
||||
return ApiConnection.Post<Reaction>(ApiUrls.PullRequestReviewCommentReactions(owner, name, number), reaction, AcceptHeaders.ReactionsPreview);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -108,7 +108,39 @@ namespace Octokit
|
||||
{
|
||||
Ensure.ArgumentNotNull(reaction, nameof(reaction));
|
||||
|
||||
return ApiConnection.Post<Reaction>(ApiUrls.PullRequestReviewCommentReaction(repositoryId, number), reaction, AcceptHeaders.ReactionsPreview);
|
||||
return ApiConnection.Post<Reaction>(ApiUrls.PullRequestReviewCommentReactions(repositoryId, number), reaction, AcceptHeaders.ReactionsPreview);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Pull Request comment
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-a-pull-request-comment-reaction</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="commentId">The comment id</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
[ManualRoute("DELETE", "/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}")]
|
||||
public Task Delete(string owner, string name, int commentId, int reactionId)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
|
||||
|
||||
return ApiConnection.Delete(ApiUrls.PullRequestReviewCommentReaction(owner, name, commentId, reactionId));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a reaction for a specified Pull Request comment
|
||||
/// </summary>
|
||||
/// <remarks>https://docs.github.com/en/rest/reactions#delete-a-pull-request-comment-reaction</remarks>
|
||||
/// <param name="repositoryId">The owner of the repository</param>
|
||||
/// <param name="commentId">The comment id</param>
|
||||
/// <param name="reactionId">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
[ManualRoute("DELETE", "/repositories/{id}/pulls/comments/{comment_id}/reactions/{reaction_id}")]
|
||||
public Task Delete(long repositoryId, int commentId, int reactionId)
|
||||
{
|
||||
return ApiConnection.Delete(ApiUrls.PullRequestReviewCommentReaction(repositoryId, commentId, reactionId));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ namespace Octokit
|
||||
/// <returns></returns>
|
||||
[Preview("squirrel-girl")]
|
||||
[ManualRoute("DELETE", "/reactions/{reaction_id}")]
|
||||
[Obsolete("This route no longer works and is replaced with individual routes in each client")]
|
||||
public Task Delete(int number)
|
||||
{
|
||||
return ApiConnection.Delete(ApiUrls.Reactions(number), new object(), AcceptHeaders.ReactionsPreview);
|
||||
|
||||
@@ -479,6 +479,29 @@ namespace Octokit
|
||||
return "repositories/{0}/issues/{1}/reactions".FormatUri(repositoryId, number);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the <see cref="Uri"/> for the reaction of a specified issue.
|
||||
/// </summary>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="number">The issue number</param>
|
||||
/// <returns></returns>
|
||||
public static Uri IssueReaction(string owner, string name, int number, int reaction)
|
||||
{
|
||||
return "repos/{0}/{1}/issues/{2}/reactions/{3}".FormatUri(owner, name, number, reaction);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the <see cref="Uri"/> for the reaction of a specified issue.
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="number">The issue number</param>
|
||||
/// <returns></returns>
|
||||
public static Uri IssueReaction(long repositoryId, int number, int reaction)
|
||||
{
|
||||
return "repositories/{0}/issues/{1}/reactions/{2}".FormatUri(repositoryId, number, reaction);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the <see cref="Uri"/> for the timeline of a specified issue.
|
||||
/// </summary>
|
||||
@@ -560,6 +583,29 @@ namespace Octokit
|
||||
return "repositories/{0}/issues/comments/{1}/reactions".FormatUri(repositoryId, number);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the <see cref="Uri"/> for the reaction of a specified issue comment.
|
||||
/// </summary>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="number">The comment number</param>
|
||||
/// <returns></returns>
|
||||
public static Uri IssueCommentReaction(string owner, string name, int number, int reaction)
|
||||
{
|
||||
return "repos/{0}/{1}/issues/comments/{2}/reactions/{3}".FormatUri(owner, name, number, reaction);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the <see cref="Uri"/> for the reaction of a specified issue comment.
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The owner of the repository</param>
|
||||
/// <param name="number">The comment number</param>
|
||||
/// <returns></returns>
|
||||
public static Uri IssueCommentReaction(long repositoryId, int number, int reaction)
|
||||
{
|
||||
return "repositories/{0}/issues/comments/{1}/reactions/{2}".FormatUri(repositoryId, number, reaction);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the <see cref="Uri"/> for the specified comment.
|
||||
/// </summary>
|
||||
@@ -618,6 +664,31 @@ namespace Octokit
|
||||
return "repositories/{0}/comments/{1}/reactions".FormatUri(repositoryId, number);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the <see cref="Uri"/> for the reaction of a specified commit comment.
|
||||
/// </summary>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="number">The comment number</param>
|
||||
/// <param name="reaction">The reaction number</param>
|
||||
/// <returns></returns>
|
||||
public static Uri CommitCommentReaction(string owner, string name, int number, int reaction)
|
||||
{
|
||||
return "repos/{0}/{1}/comments/{2}/reactions/{3}".FormatUri(owner, name, number, reaction);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the <see cref="Uri"/> for the reaction of a specified commit comment.
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="number">The comment number</param>
|
||||
/// <param name="reaction">The reaction number</param>
|
||||
/// <returns></returns>
|
||||
public static Uri CommitCommentReaction(long repositoryId, int number, int reaction)
|
||||
{
|
||||
return "repositories/{0}/comments/{1}/reactions/{2}".FormatUri(repositoryId, number, reaction);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the <see cref="Uri"/> that returns all of the assignees to which issues may be assigned.
|
||||
/// </summary>
|
||||
@@ -1604,6 +1675,30 @@ namespace Octokit
|
||||
return "repositories/{0}/pulls/{1}/reviews/{2}".FormatUri(repositoryId, number, reviewId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the <see cref="Uri"/> for the reactions of a specified pull request review comment.
|
||||
/// </summary>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="number">The comment number</param>
|
||||
/// <returns></returns>
|
||||
public static Uri PullRequestReviewCommentReactions(string owner, string name, int number)
|
||||
{
|
||||
return "repos/{0}/{1}/pulls/comments/{2}/reactions".FormatUri(owner, name, number);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the <see cref="Uri"/> for the reactions of a specified pull request review comment.
|
||||
/// </summary>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="number">The comment number</param>
|
||||
/// <returns></returns>
|
||||
public static Uri PullRequestReviewCommentReactions(long repositoryId, int number)
|
||||
{
|
||||
return "repositories/{0}/pulls/comments/{1}/reactions".FormatUri(repositoryId, number);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the <see cref="Uri"/> for the reaction of a specified pull request review comment.
|
||||
/// </summary>
|
||||
@@ -1611,9 +1706,9 @@ namespace Octokit
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="number">The comment number</param>
|
||||
/// <returns></returns>
|
||||
public static Uri PullRequestReviewCommentReaction(string owner, string name, int number)
|
||||
public static Uri PullRequestReviewCommentReaction(string owner, string name, int number, int reaction)
|
||||
{
|
||||
return "repos/{0}/{1}/pulls/comments/{2}/reactions".FormatUri(owner, name, number);
|
||||
return "repos/{0}/{1}/pulls/comments/{2}/reactions/{3}".FormatUri(owner, name, number, reaction);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1622,9 +1717,9 @@ namespace Octokit
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="number">The comment number</param>
|
||||
/// <returns></returns>
|
||||
public static Uri PullRequestReviewCommentReaction(long repositoryId, int number)
|
||||
public static Uri PullRequestReviewCommentReaction(long repositoryId, int number, int reaction)
|
||||
{
|
||||
return "repositories/{0}/pulls/comments/{1}/reactions".FormatUri(repositoryId, number);
|
||||
return "repositories/{0}/pulls/comments/{1}/reactions/{2}".FormatUri(repositoryId, number, reaction);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user