remove collab from a repo

This commit is contained in:
Haroon
2013-11-13 12:20:30 +00:00
parent 95ccc20963
commit d182927ffa
2 changed files with 29 additions and 0 deletions
@@ -43,5 +43,15 @@ namespace Octokit
/// <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/#get">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);
}
}
@@ -92,5 +92,24 @@ namespace Octokit
return ApiConnection.Put<object>(endpoint, null);
}
/// <summary>
/// Deletes a collaborator from the 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="Task"/></returns>
public Task Delete(string owner, string repo, string user)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(repo, "repo");
Ensure.ArgumentNotNullOrEmptyString(user, "user");
var endpoint = "repos/{0}/{1}/collaborators/{2}".FormatUri(owner, repo, user);
return ApiConnection.Delete(endpoint);
}
}
}