mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-08 12:42:32 +00:00
added GetAllForCurrent to find teams for the current user
This commit is contained in:
@@ -31,6 +31,14 @@ namespace Octokit.Reactive
|
||||
/// <returns>A list of the orgs's teams <see cref="Team"/>s.</returns>
|
||||
IObservable<Team> GetAll(string org);
|
||||
|
||||
/// <summary>
|
||||
/// Returns all <see cref="Team" />s for the current user.
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>A list of the user's <see cref="Team"/>s.</returns>
|
||||
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
|
||||
IObservable<Team> GetAllForCurrent();
|
||||
|
||||
/// <summary>
|
||||
/// Returns all members of the given team.
|
||||
/// </summary>
|
||||
|
||||
@@ -51,6 +51,16 @@ namespace Octokit.Reactive
|
||||
return _connection.GetAndFlattenAllPages<Team>(ApiUrls.OrganizationTeams(org));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all <see cref="Team" />s for the current user.
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>A list of the user's <see cref="Team"/>s.</returns>
|
||||
public IObservable<Team> GetAllForCurrent()
|
||||
{
|
||||
return _connection.GetAndFlattenAllPages<Team>(ApiUrls.UserTeams());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all members of the given team.
|
||||
/// </summary>
|
||||
|
||||
@@ -34,6 +34,13 @@ namespace Octokit
|
||||
/// <returns>A list of the orgs's teams <see cref="Team"/>s.</returns>
|
||||
Task<IReadOnlyList<Team>> GetAll(string org);
|
||||
|
||||
/// <summary>
|
||||
/// Returns all <see cref="Team" />s for the current user.
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>A list of the user's <see cref="Team"/>s.</returns>
|
||||
Task<IReadOnlyList<Team>> GetAllForCurrent();
|
||||
|
||||
/// <summary>
|
||||
/// Returns all members of the given team.
|
||||
/// </summary>
|
||||
|
||||
@@ -52,6 +52,17 @@ namespace Octokit
|
||||
return ApiConnection.GetAll<Team>(endpoint);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all <see cref="Team" />s for the current user.
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>A list of the user's <see cref="Team"/>s.</returns>
|
||||
public Task<IReadOnlyList<Team>> GetAllForCurrent()
|
||||
{
|
||||
var endpoint = ApiUrls.UserTeams();
|
||||
return ApiConnection.GetAll<Team>(endpoint);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all members of the given team.
|
||||
/// </summary>
|
||||
|
||||
@@ -1148,6 +1148,16 @@ namespace Octokit
|
||||
return "orgs/{0}/teams".FormatUri(organization);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the <see cref="Uri"/> to discover teams
|
||||
/// for the current user
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static Uri UserTeams()
|
||||
{
|
||||
return "user/teams".FormatUri();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the <see cref="Uri"/> for teams
|
||||
/// use for getting, updating, or deleting a <see cref="Team"/>.
|
||||
|
||||
Reference in New Issue
Block a user