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

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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();
}
}
}

View File

@@ -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();
}
}
}

View File

@@ -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();
}
}
}

View File

@@ -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();
}
}
}