@@ -1315,6 +1315,26 @@ public void addSamlGroupLink(Object groupIdOrPath, String samlGroupName, AccessL
13151315 addSamlGroupLink (groupIdOrPath , samlGroupName , groupAccess .toValue ());
13161316 }
13171317
1318+ /**
1319+ * Adds an SAML group link.
1320+ *
1321+ * <pre><code>GitLab Endpoint: POST /groups/:id/saml_group_links</code></pre>
1322+ *
1323+ * @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
1324+ * @param samlGroupName the name of the SAML group
1325+ * @param groupAccess the minimum access level for members of the SAML group
1326+ * @param memberRoleId the id of the custom member role to assign
1327+ * @throws GitLabApiException if any exception occurs
1328+ */
1329+ public void addSamlGroupLink (Object groupIdOrPath , String samlGroupName , AccessLevel groupAccess , int memberRoleId ) throws GitLabApiException {
1330+
1331+ if (groupAccess == null ) {
1332+ throw new RuntimeException ("groupAccess cannot be null or empty" );
1333+ }
1334+
1335+ addSamlGroupLink (groupIdOrPath , samlGroupName , groupAccess .toValue (), memberRoleId );
1336+ }
1337+
13181338 /**
13191339 * Adds an SAML group link.
13201340 *
@@ -1326,9 +1346,25 @@ public void addSamlGroupLink(Object groupIdOrPath, String samlGroupName, AccessL
13261346 * @throws GitLabApiException if any exception occurs
13271347 */
13281348 public void addSamlGroupLink (Object groupIdOrPath , String samlGroupName , Integer groupAccess ) throws GitLabApiException {
1349+ addSamlGroupLink (groupIdOrPath , samlGroupName , groupAccess , null );
1350+ }
1351+
1352+ /**
1353+ * Adds an SAML group link.
1354+ *
1355+ * <pre><code>GitLab Endpoint: POST /groups/:id/saml_group_links</code></pre>
1356+ *
1357+ * @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
1358+ * @param samlGroupName the name of the SAML group
1359+ * @param groupAccess the minimum access level for members of the SAML group
1360+ * @param memberRoleId the id of the custom member role to assign
1361+ * @throws GitLabApiException if any exception occurs
1362+ */
1363+ public void addSamlGroupLink (Object groupIdOrPath , String samlGroupName , Integer groupAccess , Integer memberRoleId ) throws GitLabApiException {
13291364 GitLabApiForm formData = new GitLabApiForm ()
13301365 .withParam ("saml_group_name" , samlGroupName , true )
1331- .withParam ("access_level" , groupAccess , true );
1366+ .withParam ("access_level" , groupAccess , true )
1367+ .withParam ("member_role_id" , memberRoleId );
13321368 post (Response .Status .CREATED , formData , "groups" , getGroupIdOrPath (groupIdOrPath ), "saml_group_links" );
13331369 }
13341370
@@ -1888,7 +1924,7 @@ public Group setGroupAvatar(Object groupIdOrPath, File avatarFile) throws GitLab
18881924 * Only working with GitLab 14.0 and above.
18891925 *
18901926 * <pre><code>GitLab Endpoint: GET /groups/:id/avatar</code></pre>
1891- *
1927+ *
18921928 * @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
18931929 * @return an InputStream to read the raw file from
18941930 * @throws GitLabApiException if any exception occurs
@@ -2141,7 +2177,7 @@ public GroupAccessToken createGroupAccessToken(Object groupIdOrPath, String name
21412177 public GroupAccessToken rotateGroupAccessToken (Object groupIdOrPath , Long tokenId ) throws GitLabApiException {
21422178 return rotateGroupAccessToken (groupIdOrPath , tokenId , null );
21432179 }
2144-
2180+
21452181
21462182 /**
21472183 * Rotate a group access token. Revokes the previous token and creates a new token that expires in one week.
0 commit comments