More team client repository methods

- Added teams client interface methods for AddRepository,
RemoveRepository and IsRepositoryManagedByTeam.
- Added Uri for the aforementioned methods.
This commit is contained in:
Jason Kanaris
2014-07-15 23:24:28 -04:00
parent 4363b8f270
commit 468741b0da
2 changed files with 48 additions and 0 deletions
+36
View File
@@ -101,5 +101,41 @@ namespace Octokit
/// </remarks>
/// <returns>A list of the team's <see cref="Repository"/>(ies).</returns>
Task<IReadOnlyList<Repository>> GetRepositories(int id);
/// <summary>
/// Adds a <see cref="Repository"/> to a <see cref="Team"/>.
/// </summary>
/// <param name="id">The team identifier.</param>
/// <param name="org">Org to associate the repo with.</param>
/// <param name="repo">Name of the repo.</param>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/orgs/teams/#add-team-repo">API documentation</a> for more information.
/// </remarks>
/// <returns></returns>
Task<bool> AddRepository(int id, string org, string repo);
/// <summary>
/// Removes a <see cref="Repository"/> from a <see cref="Team"/>.
/// </summary>
/// <param name="id">The team identifier.</param>
/// <param name="owner">Owner of the org the team is associated with.</param>
/// <param name="repo">Name of the repo.</param>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/orgs/teams/#remove-team-repo">API documentation</a> for more information.
/// </remarks>
/// <returns></returns>
Task<bool> RemoveRepository(int id, string owner, string repo);
/// <summary>
/// Gets whether or not the given repository is managed by the given team.
/// </summary>
/// <param name="id">The team identifier</param>
/// <param name="owner">Owner of the org the team is associated with.</param>
/// <param name="repo">Name of the repo.</param>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/orgs/teams/#get-team-repo">API documentation</a> for more information.
/// </remarks>
/// <returns></returns>
Task<bool> IsRepositoryManagedByTeam(int id, string owner, string repo);
}
}
+12
View File
@@ -954,6 +954,18 @@ namespace Octokit
return "teams/{0}/members".FormatUri(id);
}
/// <summary>
/// returns the <see cref="Uri"/> for adding/removing repo to/from a team and also checking if a team manages a repo.
/// </summary>
/// <param name="id">The team id</param>
/// <param name="orgOrOwner">The org or owner (of the org)</param>
/// <param name="repo">Name of the repo</param>
/// <returns></returns>
public static Uri TeamRepository(int id, string orgOrOwner, string repo)
{
return "teams/{0}/repos/{1}/{2}".FormatUri(id, orgOrOwner, repo);
}
/// <summary>
/// returns the <see cref="Uri"/> for listing team repositories
/// </summary>