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