using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
namespace Octokit
{
///
/// A client for GitHub's Watching API.
///
///
/// See the Watching API documentation for more information.
///
public interface IWatchedClient
{
///
/// Retrieves all of the watchers for the passed repository.
///
/// The owner of the repository
/// The name of the repository
/// Thrown if the client is not authenticated.
Task> GetAllWatchers(string owner, string name);
///
/// Retrieves all of the watchers for the passed repository.
///
/// The Id of the repository
/// Thrown if the client is not authenticated.
Task> GetAllWatchers(long repositoryId);
///
/// Retrieves all of the watchers for the passed repository.
///
/// The owner of the repository
/// The name of the repository
/// Options for changing API's response.
/// Thrown if the client is not authenticated.
Task> GetAllWatchers(string owner, string name, ApiOptions options);
///
/// Retrieves all of the watchers for the passed repository.
///
/// The Id of the repository
/// Options for changing API's response.
/// Thrown if the client is not authenticated.
Task> GetAllWatchers(long repositoryId, ApiOptions options);
///
/// Retrieves all of the watched (ies) for the current user.
///
/// Thrown if the client is not authenticated.
///
/// A of (ies) watched by the current authenticated user.
///
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
Task> GetAllForCurrent();
///
/// Retrieves all of the watched (ies) for the current user.
///
/// Options for changing API's response.
/// Thrown if the client is not authenticated.
///
/// A of (ies) watched by the current authenticated user.
///
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
Task> GetAllForCurrent(ApiOptions options);
///
/// Retrieves all of the (ies) watched by the specified user.
///
/// The login of the user
/// Thrown if the client is not authenticated.
///
/// A (ies) watched by the specified user.
///
Task> GetAllForUser(string user);
///
/// Retrieves all of the (ies) watched by the specified user.
///
/// The login of the user
/// Options for changing API's response.
/// Thrown if the client is not authenticated.
///
/// A (ies) watched by the specified user.
///
Task> GetAllForUser(string user, ApiOptions options);
///
/// Check if a repository is watched by the current authenticated user.
///
/// The owner of the repository
/// The name of the repository
/// Thrown if the client is not authenticated.
Task CheckWatched(string owner, string name);
///
/// Check if a repository is watched by the current authenticated user.
///
/// The Id of the repository
/// Thrown if the client is not authenticated.
Task CheckWatched(long repositoryId);
///
/// Watches a repository for the authenticated user.
///
/// The owner of the repository to star
/// The name of the repository to star
/// A instance describing the new subscription to create
Task WatchRepo(string owner, string name, NewSubscription newSubscription);
///
/// Watches a repository for the authenticated user.
///
/// The Id of the repository
/// A instance describing the new subscription to create
Task WatchRepo(long repositoryId, NewSubscription newSubscription);
///
/// Unwatches a repository for the authenticated user.
///
/// The owner of the repository to unstar
/// The name of the repository to unstar
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Unwatch",
Justification = "Unwatch is consistent with the GitHub website")]
Task UnwatchRepo(string owner, string name);
///
/// Unwatches a repository for the authenticated user.
///
/// The Id of the repository
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Unwatch",
Justification = "Unwatch is consistent with the GitHub website")]
Task UnwatchRepo(long repositoryId);
}
}