Skip to content

Commit b968efe

Browse files
authored
Merge pull request #9 from VAllens/get-descendant-groups
Added get descendant groups API
2 parents af3b343 + 33caf61 commit b968efe

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/GitLabApiClient/GroupsClient.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ public async Task<Group> GetAsync(GroupId groupId) =>
5959
public async Task<IList<Group>> GetSubgroupsAsync(GroupId groupId) =>
6060
await _httpFacade.GetPagedList<Group>($"groups/{groupId}/subgroups");
6161

62+
/// <summary>
63+
/// Get a list of visible descendant groups of this group.
64+
/// This endpoint can be accessed without authentication if the group is publicly accessible.
65+
/// </summary>
66+
/// <param name="groupId">The ID, path or <see cref="Group"/> of the group.</param>
67+
public async Task<IList<Group>> GetDescendantGroupsAsync(GroupId groupId) =>
68+
await _httpFacade.GetPagedList<Group>($"groups/{groupId}/descendant_groups");
69+
6270
/// <summary>
6371
/// Get all groups that match your string in their name or path.
6472
/// </summary>

src/GitLabApiClient/IGroupsClient.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ public interface IGroupsClient
2828
/// <param name="groupId">The ID, path or <see cref="Group"/> of the group.</param>
2929
Task<IList<Group>> GetSubgroupsAsync(GroupId groupId);
3030

31+
/// <summary>
32+
/// Get a list of visible descendant groups of this group.
33+
/// This endpoint can be accessed without authentication if the group is publicly accessible.
34+
/// </summary>
35+
/// <param name="groupId">The ID, path or <see cref="Group"/> of the group.</param>
36+
Task<IList<Group>> GetDescendantGroupsAsync(GroupId groupId);
37+
3138
/// <summary>
3239
/// Get all groups that match your string in their name or path.
3340
/// </summary>

0 commit comments

Comments
 (0)