-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathIRepoCollaboratorsClient.cs
71 lines (66 loc) · 3.32 KB
/
IRepoCollaboratorsClient.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#if NET_45
using System.Threading.Tasks;
using System.Collections.Generic;
#endif
namespace Octokit
{
/// <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 IRepoCollaboratorsClient
{
/// <summary>
/// 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>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>A <see cref="IReadOnlyPagedCollection{User}"/> of <see cref="User"/>.</returns>
Task<IReadOnlyList<User>> GetAll(string owner, string repo);
/// <summary>
/// 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="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>
Task<IReadOnlyList<User>> GetAll(string owner, string repo, ApiOptions options);
/// <summary>
/// Checks if a user is a collaborator on a repo
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/#get">API documentation</a> for more information.
/// </remarks>
/// <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 repo, string user);
/// <summary>
/// Adds a new collaborator to the repo
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/#add-collaborator">API documentation</a> for more information.
/// </remarks>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns><see cref="Task"/></returns>
Task Add(string owner, string repo, string user);
/// <summary>
/// Deletes a collaborator from the repo
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/collaborators/#remove-collaborator">API documentation</a> for more information.
/// </remarks>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns><see cref="Task"/></returns>
Task Delete(string owner, string repo, string user);
}
}