added new overloads

This commit is contained in:
Alexander Efremov
2016-06-13 15:32:30 +07:00
parent 02c677d832
commit bcf7b9af95
5 changed files with 237 additions and 2 deletions

View File

@@ -3,6 +3,12 @@ using System.Diagnostics.CodeAnalysis;
namespace Octokit.Reactive
{
/// <summary>
/// A client for GitHub's Watching API.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/activity/watching/">Watching API documentation</a> for more information.
/// </remarks>
public interface IObservableWatchedClient
{
/// <summary>
@@ -14,6 +20,14 @@ namespace Octokit.Reactive
/// <returns>A <see cref="IObservable{User}"/> of <see cref="User"/>s watching the passed repository</returns>
IObservable<User> GetAllWatchers(string owner, string name);
/// <summary>
/// Retrieves all of the watchers for the passed repository
/// </summary>
/// <param name="repositoryId">The ID of the repository</param>
/// <exception cref="AuthorizationException">Thrown if the client is not authenticated</exception>
/// <returns>A <see cref="IObservable{User}"/> of <see cref="User"/>s watching the passed repository</returns>
IObservable<User> GetAllWatchers(int repositoryId);
/// <summary>
/// Retrieves all of the watchers for the passed repository
/// </summary>
@@ -24,6 +38,15 @@ namespace Octokit.Reactive
/// <returns>A <see cref="IObservable{User}"/> of <see cref="User"/>s watching the passed repository</returns>
IObservable<User> GetAllWatchers(string owner, string name, ApiOptions options);
/// <summary>
/// Retrieves all of the watchers for the passed repository
/// </summary>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="options">Options for changing the API's response.</param>
/// <exception cref="AuthorizationException">Thrown if the client is not authenticated</exception>
/// <returns>A <see cref="IObservable{User}"/> of <see cref="User"/>s watching the passed repository</returns>
IObservable<User> GetAllWatchers(int repositoryId, ApiOptions options);
/// <summary>
/// Retrieves all of the watched <see cref="Repository"/>(ies) for the current user
/// </summary>
@@ -66,6 +89,14 @@ namespace Octokit.Reactive
/// <returns>A <c>bool</c> representing the success of the operation</returns>
IObservable<bool> CheckWatched(string owner, string name);
/// <summary>
/// Check if a repository is watched by the current authenticated user
/// </summary>
/// <param name="repositoryId">The ID of the repository</param>
/// <exception cref="AuthorizationException">Thrown if the client is not authenticated</exception>
/// <returns>A <c>bool</c> representing the success of the operation</returns>
IObservable<bool> CheckWatched(int repositoryId);
/// <summary>
/// Stars a repository for the authenticated user.
/// </summary>
@@ -75,6 +106,14 @@ namespace Octokit.Reactive
/// <returns>A <c>bool</c> representing the success of starring</returns>
IObservable<Subscription> WatchRepo(string owner, string name, NewSubscription newSubscription);
/// <summary>
/// Stars a repository for the authenticated user.
/// </summary>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="newSubscription">A <see cref="NewSubscription"/> instance describing the new subscription to create</param>
/// <returns>A <c>bool</c> representing the success of starring</returns>
IObservable<Subscription> WatchRepo(int repositoryId, NewSubscription newSubscription);
/// <summary>
/// Unstars a repository for the authenticated user.
/// </summary>
@@ -84,5 +123,14 @@ namespace Octokit.Reactive
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Unwatch",
Justification = "Unwatch is consistent with the GitHub website")]
IObservable<bool> UnwatchRepo(string owner, string name);
/// <summary>
/// Unstars a repository for the authenticated user.
/// </summary>
/// <param name="repositoryId">The ID of the repository</param>
/// <returns>A <c>bool</c> representing the success of the operation</returns>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Unwatch",
Justification = "Unwatch is consistent with the GitHub website")]
IObservable<bool> UnwatchRepo(int repositoryId);
}
}