Synchronized XML documentation of IObservableRepoCollaboratorsClient and IRepoCollaboratorsClient

This commit is contained in:
aedampir@gmail.com
2016-05-19 14:55:54 +07:00
parent 8e4a777e18
commit 3ac0ea8efa
4 changed files with 136 additions and 80 deletions
@@ -3,50 +3,76 @@ using System.Reactive;
namespace Octokit.Reactive
{
/// <summary>
/// A client for GitHub's Collaborators on a Repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/">Collaborators API documentation</a> for more details.
/// </remarks>
public interface IObservableRepoCollaboratorsClient
{
/// <summary>
/// Gets all the available collaborators on this repo.
/// Gets all the collaborators on a repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/#list">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="repo">The name of the repository</param>
/// <returns>The list of <see cref="User"/>s for the specified repository.</returns>
IObservable<User> GetAll(string owner, string repo);
/// <param name="name">The name of the repository</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>A <see cref="IObservable{User}"/> of <see cref="User"/>s for the specified repository.</returns>
IObservable<User> GetAll(string owner, string name);
/// <summary>
/// Gets all the available collaborators on this repo.
/// Gets all the collaborators on a repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/#list">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="repo">The name of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>The list of <see cref="User"/>s for the specified repository.</returns>
IObservable<User> GetAll(string owner, string repo, ApiOptions options);
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>A <see cref="IObservable{User}"/> of <see cref="User"/>s for the specified repository.</returns>
IObservable<User> GetAll(string owner, string name, ApiOptions options);
/// <summary>
/// Checks to see if a user is an assignee for a repository.
/// Checks if a user is a collaborator on a repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/#list">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="repo">The name of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="user">Username of the prospective collaborator</param>
/// <returns></returns>
IObservable<bool> IsCollaborator(string owner, string repo, string user);
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns><see cref="bool"/>True if user is a collaborator else false</returns>
IObservable<bool> IsCollaborator(string owner, string name, string user);
/// <summary>
/// Adds a user as a collaborator to a repository.
/// Adds a new collaborator to the repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/#list">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="repo">The name of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="user">Username of the prospective collaborator</param>
/// <returns></returns>
IObservable<Unit> Add(string owner, string repo, string user);
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns><see cref="Unit"/></returns>
IObservable<Unit> Add(string owner, string name, string user);
/// <summary>
/// Removes a user as a collaborator for a repository.
/// Deletes a collaborator from the repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/#list">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="repo">The name of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="user">Username of the prospective collaborator</param>
/// <returns></returns>
IObservable<Unit> Delete(string owner, string repo, string user);
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns><see cref="Unit"/></returns>
IObservable<Unit> Delete(string owner, string name, string user);
}
}
@@ -5,11 +5,21 @@ using Octokit.Reactive.Internal;
namespace Octokit.Reactive
{
/// <summary>
/// A client for GitHub's Collaborators on a Repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/">Collaborators API documentation</a> for more details.
/// </remarks>
public class ObservableRepoCollaboratorsClient : IObservableRepoCollaboratorsClient
{
readonly IRepoCollaboratorsClient _client;
readonly IConnection _connection;
/// <summary>
/// Initializes a new GitHub Repo Collaborators API client.
/// </summary>
/// <param name="client">An IGitHubClient client.</param>
public ObservableRepoCollaboratorsClient(IGitHubClient client)
{
Ensure.ArgumentNotNull(client, "client");
@@ -19,69 +29,89 @@ namespace Octokit.Reactive
}
/// <summary>
/// Gets all the available collaborators on this repo.
/// Gets all the collaborators on a repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/#list">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="repo">The name of the repository</param>
/// <returns>The list of <see cref="User"/>s for the specified repository.</returns>
public IObservable<User> GetAll(string owner, string repo)
/// <param name="name">The name of the repository</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>A <see cref="IObservable{User}"/> of <see cref="User"/>s for the specified repository.</returns>
public IObservable<User> GetAll(string owner, string name)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(repo, "repo");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
return GetAll(owner, repo, ApiOptions.None);
return GetAll(owner, name, ApiOptions.None);
}
/// <summary>
/// Gets all the available collaborators on this repo.
/// Gets all the collaborators on a repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/#list">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="repo">The name of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="options">Options for changing the API response</param>
/// <returns>The list of <see cref="User"/>s for the specified repository.</returns>
public IObservable<User> GetAll(string owner, string repo, ApiOptions options)
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>A <see cref="IObservable{User}"/> of <see cref="User"/>s for the specified repository.</returns>
public IObservable<User> GetAll(string owner, string name, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(repo, "repo");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNull(options, "options");
return _connection.GetAndFlattenAllPages<User>(ApiUrls.RepoCollaborators(owner, repo), options);
return _connection.GetAndFlattenAllPages<User>(ApiUrls.RepoCollaborators(owner, name), options);
}
/// <summary>
/// Checks to see if a user is an assignee for a repository.
/// Checks if a user is a collaborator on a repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/#list">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="repo">The name of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="user">Username of the prospective collaborator</param>
/// <returns></returns>
public IObservable<bool> IsCollaborator(string owner, string repo, string user)
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns><see cref="bool"/>True if user is a collaborator else false</returns>
public IObservable<bool> IsCollaborator(string owner, string name, string user)
{
return _client.IsCollaborator(owner, repo, user).ToObservable();
return _client.IsCollaborator(owner, name, user).ToObservable();
}
/// <summary>
/// Adds a user as a collaborator to a repository.
/// Adds a new collaborator to the repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/#list">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="repo">The name of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="user">Username of the prospective collaborator</param>
/// <returns></returns>
public IObservable<Unit> Add(string owner, string repo, string user)
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns><see cref="Unit"/></returns>
public IObservable<Unit> Add(string owner, string name, string user)
{
return _client.Add(owner, repo, user).ToObservable();
return _client.Add(owner, name, user).ToObservable();
}
/// <summary>
/// Removes a user as a collaborator for a repository.
/// Deletes a collaborator from the repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/#list">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="repo">The name of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="user">Username of the prospective collaborator</param>
/// <returns></returns>
public IObservable<Unit> Delete(string owner, string repo, string user)
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns><see cref="Unit"/></returns>
public IObservable<Unit> Delete(string owner, string name, string user)
{
return _client.Delete(owner, repo, user).ToObservable();
return _client.Delete(owner, name, user).ToObservable();
}
}
}
+16 -16
View File
@@ -22,7 +22,7 @@ namespace Octokit
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>A <see cref="IReadOnlyPagedCollection{User}"/> of <see cref="User"/>.</returns>
/// <returns>A <see cref="IReadOnlyPagedCollection{User}"/> of <see cref="User"/>s for the specified repository.</returns>
Task<IReadOnlyList<User>> GetAll(string owner, string name);
/// <summary>
@@ -33,7 +33,7 @@ namespace Octokit
/// </remarks>
/// <param name="repositoryId">The id of the repository</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>A <see cref="IReadOnlyPagedCollection{User}"/> of <see cref="User"/>.</returns>
/// <returns>A <see cref="IReadOnlyPagedCollection{User}"/> of <see cref="User"/>s for the specified repository.</returns>
Task<IReadOnlyList<User>> GetAll(int repositoryId);
/// <summary>
@@ -46,7 +46,7 @@ namespace Octokit
/// <param name="name">The name of the repository</param>
/// <param name="options">Options for changing the API response</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>A <see cref="IReadOnlyPagedCollection{User}"/> of <see cref="User"/>.</returns>
/// <returns>A <see cref="IReadOnlyPagedCollection{User}"/> of <see cref="User"/>s for the specified repository.</returns>
Task<IReadOnlyList<User>> GetAll(string owner, string name, ApiOptions options);
/// <summary>
@@ -58,80 +58,80 @@ namespace Octokit
/// <param name="repositoryId">The id of the repository</param>
/// <param name="options">Options for changing the API response</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>A <see cref="IReadOnlyPagedCollection{User}"/> of <see cref="User"/>.</returns>
/// <returns>A <see cref="IReadOnlyPagedCollection{User}"/> of <see cref="User"/>s for the specified repository.</returns>
Task<IReadOnlyList<User>> GetAll(int repositoryId, ApiOptions options);
/// <summary>
/// Checks if a user is a collaborator on a repo
/// Checks if a user is a collaborator on a repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/#get">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="user">The name of the user</param>
/// <param name="user">Username of the prospective collaborator</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns><see cref="bool"/>True if user is a collaborator else false</returns>
Task<bool> IsCollaborator(string owner, string name, string user);
/// <summary>
/// Checks if a user is a collaborator on a repo
/// Checks if a user is a collaborator on a repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/#get">API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The id of the repository</param>
/// <param name="user">The name of the user</param>
/// <param name="user">Username of the prospective collaborator</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns><see cref="bool"/>True if user is a collaborator else false</returns>
Task<bool> IsCollaborator(int repositoryId, string user);
/// <summary>
/// Adds a new collaborator to the repo
/// Adds a new collaborator to the repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/#add-collaborator">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="user">The name of the user</param>
/// <param name="user">Username of the new collaborator</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns><see cref="Task"/></returns>
Task Add(string owner, string name, string user);
/// <summary>
/// Adds a new collaborator to the repo
/// Adds a new collaborator to the repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/#add-collaborator">API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The id of the repository</param>
/// <param name="user">The name of the user</param>
/// <param name="user">Username of the new collaborator</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns><see cref="Task"/></returns>
Task Add(int repositoryId, string user);
/// <summary>
/// Deletes a collaborator from the repo
/// Deletes a collaborator from the repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/#remove-collaborator">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="user">The name of the user</param>
/// <param name="user">Username of the removed collaborator</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns><see cref="Task"/></returns>
Task Delete(string owner, string name, string user);
/// <summary>
/// Deletes a collaborator from the repo
/// Deletes a collaborator from the repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/#remove-collaborator">API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The id of the repository</param>
/// <param name="user">The name of the user</param>
/// <param name="user">Username of the removed collaborator</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns><see cref="Task"/></returns>
Task Delete(int repositoryId, string user);
+17 -17
View File
@@ -1,6 +1,6 @@
#if NET_45
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Threading.Tasks;
#endif
namespace Octokit
@@ -31,7 +31,7 @@ namespace Octokit
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>A <see cref="IReadOnlyPagedCollection{User}"/> of <see cref="User"/>.</returns>
/// <returns>A <see cref="IReadOnlyPagedCollection{User}"/> of <see cref="User"/>s for the specified repository.</returns>
public Task<IReadOnlyList<User>> GetAll(string owner, string name)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
@@ -48,7 +48,7 @@ namespace Octokit
/// </remarks>
/// <param name="repositoryId">The id of the repository</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>A <see cref="IReadOnlyPagedCollection{User}"/> of <see cref="User"/>.</returns>
/// <returns>A <see cref="IReadOnlyPagedCollection{User}"/> of <see cref="User"/>s for the specified repository.</returns>
public Task<IReadOnlyList<User>> GetAll(int repositoryId)
{
return GetAll(repositoryId, ApiOptions.None);
@@ -64,7 +64,7 @@ namespace Octokit
/// <param name="name">The name of the repository</param>
/// <param name="options">Options for changing the API response</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>A <see cref="IReadOnlyPagedCollection{User}"/> of <see cref="User"/>.</returns>
/// <returns>A <see cref="IReadOnlyPagedCollection{User}"/> of <see cref="User"/>s for the specified repository.</returns>
public Task<IReadOnlyList<User>> GetAll(string owner, string name, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
@@ -83,21 +83,21 @@ namespace Octokit
/// <param name="repositoryId">The id of the repository</param>
/// <param name="options">Options for changing the API response</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>A <see cref="IReadOnlyPagedCollection{User}"/> of <see cref="User"/>.</returns>
/// <returns>A <see cref="IReadOnlyPagedCollection{User}"/> of <see cref="User"/>s for the specified repository.</returns>
public Task<IReadOnlyList<User>> GetAll(int repositoryId, ApiOptions options)
{
return ApiConnection.GetAll<User>(ApiUrls.RepoCollaborators(repositoryId), options);
}
/// <summary>
/// Checks if a user is a collaborator on a repo
/// Checks if a user is a collaborator on a repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/#get">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="user">The name of the user</param>
/// <param name="user">Username of the prospective collaborator</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns><see cref="bool"/>True if user is a collaborator else false</returns>
public async Task<bool> IsCollaborator(string owner, string name, string user)
@@ -118,13 +118,13 @@ namespace Octokit
}
/// <summary>
/// Checks if a user is a collaborator on a repo
/// Checks if a user is a collaborator on a repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/#get">API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The id of the repository</param>
/// <param name="user">The name of the user</param>
/// <param name="user">Username of the prospective collaborator</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns><see cref="bool"/>True if user is a collaborator else false</returns>
public async Task<bool> IsCollaborator(int repositoryId, string user)
@@ -143,14 +143,14 @@ namespace Octokit
}
/// <summary>
/// Adds a new collaborator to the repo
/// Adds a new collaborator to the repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/#add-collaborator">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="user">The name of the user</param>
/// <param name="user">Username of the new collaborator</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns><see cref="Task"/></returns>
public Task Add(string owner, string name, string user)
@@ -163,13 +163,13 @@ namespace Octokit
}
/// <summary>
/// Adds a new collaborator to the repo
/// Adds a new collaborator to the repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/#add-collaborator">API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The id of the repository</param>
/// <param name="user">The name of the user</param>
/// <param name="user">Username of the new collaborator</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns><see cref="Task"/></returns>
public Task Add(int repositoryId, string user)
@@ -180,14 +180,14 @@ namespace Octokit
}
/// <summary>
/// Deletes a collaborator from the repo
/// Deletes a collaborator from the repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/#remove-collaborator">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="user">The name of the user</param>
/// <param name="user">Username of the removed collaborator</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns><see cref="Task"/></returns>
public Task Delete(string owner, string name, string user)
@@ -200,13 +200,13 @@ namespace Octokit
}
/// <summary>
/// Deletes a collaborator from the repo
/// Deletes a collaborator from the repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/#remove-collaborator">API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The id of the repository</param>
/// <param name="user">The name of the user</param>
/// <param name="user">Username of the removed collaborator</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns><see cref="Task"/></returns>
public Task Delete(int repositoryId, string user)