feat: Adds 4 new Reaction delete routes and obsoleting existing routes (#2494)

This commit is contained in:
Chris Simpson
2022-07-22 17:28:30 +01:00
committed by GitHub
parent 4f4ef5ba73
commit 251c3a26fc
22 changed files with 738 additions and 12 deletions
@@ -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));
}
}
}