mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-05 03:30:34 +00:00
add delete method for reaction client
This commit is contained in:
@@ -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/
|
||||
/// </remarks>
|
||||
IObservablePullRequestReviewCommentReactionsClient PullRequestReviewComment { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Delete a reaction.
|
||||
/// </summary>
|
||||
/// <remarks>https://developer.github.com/v3/reactions/#delete-a-reaction</remarks>
|
||||
/// <param name="number">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
IObservable<Unit> Delete(int number);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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/
|
||||
/// </remarks>
|
||||
public IObservablePullRequestReviewCommentReactionsClient PullRequestReviewComment { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Delete a reaction.
|
||||
/// </summary>
|
||||
/// <remarks>https://developer.github.com/v3/reactions/#delete-a-reaction</remarks>
|
||||
/// <param name="number">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
public IObservable<Unit> Delete(int number)
|
||||
{
|
||||
return _client.Delete(number).ToObservable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace Octokit
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Octokit
|
||||
{
|
||||
/// <summary>
|
||||
/// 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/
|
||||
/// </remarks>
|
||||
IPullRequestReviewCommentReactionsClient PullRequestReviewComment { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Delete a reaction.
|
||||
/// </summary>
|
||||
/// <remarks>https://developer.github.com/v3/reactions/#delete-a-reaction</remarks>
|
||||
/// <param name="number">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
Task Delete(int number);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Octokit
|
||||
{
|
||||
@@ -47,6 +48,17 @@ namespace Octokit
|
||||
/// <remarks>
|
||||
/// Refer to the API documentation for more information: https://developer.github.com/v3/reactions/
|
||||
/// </remarks>
|
||||
public IPullRequestReviewCommentReactionsClient PullRequestReviewComment { get; private set; }
|
||||
public IPullRequestReviewCommentReactionsClient PullRequestReviewComment { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Delete a reaction.
|
||||
/// </summary>
|
||||
/// <remarks>https://developer.github.com/v3/reactions/#delete-a-reaction</remarks>
|
||||
/// <param name="number">The reaction id</param>
|
||||
/// <returns></returns>
|
||||
public Task Delete(int number)
|
||||
{
|
||||
return ApiConnection.Delete(ApiUrls.Reactions(number));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2926,5 +2926,15 @@ namespace Octokit
|
||||
{
|
||||
return "repositories/{0}/subscribers".FormatUri(repositoryId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the <see cref="Uri"/> for deleting a reaction.
|
||||
/// </summary>
|
||||
/// <param name="number">The reaction number</param>
|
||||
/// <returns>The <see cref="Uri"/> that lists the watched repositories for the authenticated user.</returns>
|
||||
public static Uri Reactions(int number)
|
||||
{
|
||||
return "reactions/{0}".FormatUri(number);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user