Skip to content

Commit

Permalink
Merge pull request #9 from VAllens/get-descendant-groups
Browse files Browse the repository at this point in the history
Added get descendant groups API
  • Loading branch information
cnblogs-dudu authored Dec 2, 2023
2 parents af3b343 + 33caf61 commit b968efe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/GitLabApiClient/GroupsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ public async Task<Group> GetAsync(GroupId groupId) =>
public async Task<IList<Group>> GetSubgroupsAsync(GroupId groupId) =>
await _httpFacade.GetPagedList<Group>($"groups/{groupId}/subgroups");

/// <summary>
/// Get a list of visible descendant groups of this group.
/// This endpoint can be accessed without authentication if the group is publicly accessible.
/// </summary>
/// <param name="groupId">The ID, path or <see cref="Group"/> of the group.</param>
public async Task<IList<Group>> GetDescendantGroupsAsync(GroupId groupId) =>
await _httpFacade.GetPagedList<Group>($"groups/{groupId}/descendant_groups");

/// <summary>
/// Get all groups that match your string in their name or path.
/// </summary>
Expand Down
7 changes: 7 additions & 0 deletions src/GitLabApiClient/IGroupsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ public interface IGroupsClient
/// <param name="groupId">The ID, path or <see cref="Group"/> of the group.</param>
Task<IList<Group>> GetSubgroupsAsync(GroupId groupId);

/// <summary>
/// Get a list of visible descendant groups of this group.
/// This endpoint can be accessed without authentication if the group is publicly accessible.
/// </summary>
/// <param name="groupId">The ID, path or <see cref="Group"/> of the group.</param>
Task<IList<Group>> GetDescendantGroupsAsync(GroupId groupId);

/// <summary>
/// Get all groups that match your string in their name or path.
/// </summary>
Expand Down

0 comments on commit b968efe

Please sign in to comment.