From dd3b060d00185f61e221045c73dff81d557715e0 Mon Sep 17 00:00:00 2001 From: Allen Date: Wed, 16 Aug 2023 10:10:48 +0800 Subject: [PATCH 1/2] Added get descendant groups API --- src/GitLabApiClient/GroupsClient.cs | 8 ++++++++ src/GitLabApiClient/IGroupsClient.cs | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/src/GitLabApiClient/GroupsClient.cs b/src/GitLabApiClient/GroupsClient.cs index 11708bbf..656d945c 100644 --- a/src/GitLabApiClient/GroupsClient.cs +++ b/src/GitLabApiClient/GroupsClient.cs @@ -59,6 +59,14 @@ public async Task GetAsync(GroupId groupId) => public async Task> GetSubgroupsAsync(GroupId groupId) => await _httpFacade.GetPagedList($"groups/{groupId}/subgroups"); + /// + /// Get a list of visible descendant groups of this group. + /// This endpoint can be accessed without authentication if the group is publicly accessible. + /// + /// The ID, path or of the group. + public async Task> GetDescendantGroupsAsync(GroupId groupId) => + await _httpFacade.GetPagedList($"groups/{groupId}/descendant_groups"); + /// /// Get all groups that match your string in their name or path. /// diff --git a/src/GitLabApiClient/IGroupsClient.cs b/src/GitLabApiClient/IGroupsClient.cs index f25490fa..2fc65523 100644 --- a/src/GitLabApiClient/IGroupsClient.cs +++ b/src/GitLabApiClient/IGroupsClient.cs @@ -28,6 +28,13 @@ public interface IGroupsClient /// The ID, path or of the group. Task> GetSubgroupsAsync(GroupId groupId); + /// + /// Get a list of visible descendant groups of this group. + /// This endpoint can be accessed without authentication if the group is publicly accessible. + /// + /// The ID, path or of the group. + Task> GetDescendantGroupsAsync(GroupId groupId) + /// /// Get all groups that match your string in their name or path. /// From 33caf61c0bac24d89471d793967264f70ebaa4a0 Mon Sep 17 00:00:00 2001 From: Allen Date: Wed, 16 Aug 2023 10:19:20 +0800 Subject: [PATCH 2/2] Fixed build errors caused by semicolons --- src/GitLabApiClient/IGroupsClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitLabApiClient/IGroupsClient.cs b/src/GitLabApiClient/IGroupsClient.cs index 2fc65523..2c2a25f7 100644 --- a/src/GitLabApiClient/IGroupsClient.cs +++ b/src/GitLabApiClient/IGroupsClient.cs @@ -33,7 +33,7 @@ public interface IGroupsClient /// This endpoint can be accessed without authentication if the group is publicly accessible. /// /// The ID, path or of the group. - Task> GetDescendantGroupsAsync(GroupId groupId) + Task> GetDescendantGroupsAsync(GroupId groupId); /// /// Get all groups that match your string in their name or path.