diff --git a/Octokit.Reactive/Clients/IObservableReactionsClient.cs b/Octokit.Reactive/Clients/IObservableReactionsClient.cs
index 8ba0e87b..2cedf69a 100644
--- a/Octokit.Reactive/Clients/IObservableReactionsClient.cs
+++ b/Octokit.Reactive/Clients/IObservableReactionsClient.cs
@@ -1,4 +1,7 @@
-namespace Octokit.Reactive
+using System;
+using System.Reactive;
+
+namespace Octokit.Reactive
{
public interface IObservableReactionsClient
{
@@ -33,5 +36,13 @@
/// Refer to the API documentation for more information: https://developer.github.com/v3/reactions/
///
IObservablePullRequestReviewCommentReactionsClient PullRequestReviewComment { get; }
+
+ ///
+ /// Delete a reaction.
+ ///
+ /// https://developer.github.com/v3/reactions/#delete-a-reaction
+ /// The reaction id
+ ///
+ IObservable Delete(int number);
}
}
diff --git a/Octokit.Reactive/Clients/ObservableReactionsClient.cs b/Octokit.Reactive/Clients/ObservableReactionsClient.cs
index f2f44ae8..3cd3e9b3 100644
--- a/Octokit.Reactive/Clients/ObservableReactionsClient.cs
+++ b/Octokit.Reactive/Clients/ObservableReactionsClient.cs
@@ -1,11 +1,19 @@
-namespace Octokit.Reactive
+using System;
+using System.Reactive;
+using System.Reactive.Threading.Tasks;
+
+namespace Octokit.Reactive
{
public class ObservableReactionsClient : IObservableReactionsClient
{
+ readonly IReactionsClient _client;
+
public ObservableReactionsClient(IGitHubClient client)
{
Ensure.ArgumentNotNull(client, "client");
+ _client = client.Reaction;
+
CommitComment = new ObservableCommitCommentReactionsClient(client);
Issue = new ObservableIssueReactionsClient(client);
IssueComment = new ObservableIssueCommentReactionsClient(client);
@@ -43,5 +51,16 @@
/// Refer to the API documentation for more information: https://developer.github.com/v3/reactions/
///
public IObservablePullRequestReviewCommentReactionsClient PullRequestReviewComment { get; private set; }
+
+ ///
+ /// Delete a reaction.
+ ///
+ /// https://developer.github.com/v3/reactions/#delete-a-reaction
+ /// The reaction id
+ ///
+ public IObservable Delete(int number)
+ {
+ return _client.Delete(number).ToObservable();
+ }
}
}
diff --git a/Octokit/Clients/IReactionsClient.cs b/Octokit/Clients/IReactionsClient.cs
index 08f14c44..fbf76569 100644
--- a/Octokit/Clients/IReactionsClient.cs
+++ b/Octokit/Clients/IReactionsClient.cs
@@ -1,4 +1,6 @@
-namespace Octokit
+using System.Threading.Tasks;
+
+namespace Octokit
{
///
/// A client for GitHub's Reactions Events API.
@@ -39,5 +41,13 @@
/// Refer to the API documentation for more information: https://developer.github.com/v3/reactions/
///
IPullRequestReviewCommentReactionsClient PullRequestReviewComment { get; }
+
+ ///
+ /// Delete a reaction.
+ ///
+ /// https://developer.github.com/v3/reactions/#delete-a-reaction
+ /// The reaction id
+ ///
+ Task Delete(int number);
}
}
diff --git a/Octokit/Clients/ReactionsClient.cs b/Octokit/Clients/ReactionsClient.cs
index 9c1d110b..deb8033a 100644
--- a/Octokit/Clients/ReactionsClient.cs
+++ b/Octokit/Clients/ReactionsClient.cs
@@ -1,4 +1,5 @@
using System;
+using System.Threading.Tasks;
namespace Octokit
{
@@ -47,6 +48,17 @@ namespace Octokit
///
/// Refer to the API documentation for more information: https://developer.github.com/v3/reactions/
///
- public IPullRequestReviewCommentReactionsClient PullRequestReviewComment { get; private set; }
+ public IPullRequestReviewCommentReactionsClient PullRequestReviewComment { get; private set; }
+
+ ///
+ /// Delete a reaction.
+ ///
+ /// https://developer.github.com/v3/reactions/#delete-a-reaction
+ /// The reaction id
+ ///
+ public Task Delete(int number)
+ {
+ return ApiConnection.Delete(ApiUrls.Reactions(number));
+ }
}
}
diff --git a/Octokit/Helpers/ApiUrls.cs b/Octokit/Helpers/ApiUrls.cs
index 2a9c168b..1ad8dc81 100644
--- a/Octokit/Helpers/ApiUrls.cs
+++ b/Octokit/Helpers/ApiUrls.cs
@@ -2926,5 +2926,15 @@ namespace Octokit
{
return "repositories/{0}/subscribers".FormatUri(repositoryId);
}
+
+ ///
+ /// Returns the for deleting a reaction.
+ ///
+ /// The reaction number
+ /// The that lists the watched repositories for the authenticated user.
+ public static Uri Reactions(int number)
+ {
+ return "reactions/{0}".FormatUri(number);
+ }
}
}