@@ -1313,6 +1313,26 @@ public void addSamlGroupLink(Object groupIdOrPath, String samlGroupName, AccessL
13131313 addSamlGroupLink (groupIdOrPath , samlGroupName , groupAccess .toValue ());
13141314 }
13151315
1316+ /**
1317+ * Adds an SAML group link.
1318+ *
1319+ * <pre><code>GitLab Endpoint: POST /groups/:id/saml_group_links</code></pre>
1320+ *
1321+ * @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
1322+ * @param samlGroupName the name of the SAML group
1323+ * @param groupAccess the minimum access level for members of the SAML group
1324+ * @param memberRoleId the id of the custom member role to assign
1325+ * @throws GitLabApiException if any exception occurs
1326+ */
1327+ public void addSamlGroupLink (Object groupIdOrPath , String samlGroupName , AccessLevel groupAccess , int memberRoleId ) throws GitLabApiException {
1328+
1329+ if (groupAccess == null ) {
1330+ throw new RuntimeException ("groupAccess cannot be null or empty" );
1331+ }
1332+
1333+ addSamlGroupLink (groupIdOrPath , samlGroupName , groupAccess .toValue (), memberRoleId );
1334+ }
1335+
13161336 /**
13171337 * Adds an SAML group link.
13181338 *
@@ -1324,9 +1344,25 @@ public void addSamlGroupLink(Object groupIdOrPath, String samlGroupName, AccessL
13241344 * @throws GitLabApiException if any exception occurs
13251345 */
13261346 public void addSamlGroupLink (Object groupIdOrPath , String samlGroupName , Integer groupAccess ) throws GitLabApiException {
1347+ addSamlGroupLink (groupIdOrPath , samlGroupName , groupAccess , null );
1348+ }
1349+
1350+ /**
1351+ * Adds an SAML group link.
1352+ *
1353+ * <pre><code>GitLab Endpoint: POST /groups/:id/saml_group_links</code></pre>
1354+ *
1355+ * @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
1356+ * @param samlGroupName the name of the SAML group
1357+ * @param groupAccess the minimum access level for members of the SAML group
1358+ * @param memberRoleId the id of the custom member role to assign
1359+ * @throws GitLabApiException if any exception occurs
1360+ */
1361+ public void addSamlGroupLink (Object groupIdOrPath , String samlGroupName , Integer groupAccess , Integer memberRoleId ) throws GitLabApiException {
13271362 GitLabApiForm formData = new GitLabApiForm ()
13281363 .withParam ("saml_group_name" , samlGroupName , true )
1329- .withParam ("access_level" , groupAccess , true );
1364+ .withParam ("access_level" , groupAccess , true )
1365+ .withParam ("member_role_id" , memberRoleId );
13301366 post (Response .Status .CREATED , formData , "groups" , getGroupIdOrPath (groupIdOrPath ), "saml_group_links" );
13311367 }
13321368
@@ -1886,7 +1922,7 @@ public Group setGroupAvatar(Object groupIdOrPath, File avatarFile) throws GitLab
18861922 * Only working with GitLab 14.0 and above.
18871923 *
18881924 * <pre><code>GitLab Endpoint: GET /groups/:id/avatar</code></pre>
1889- *
1925+ *
18901926 * @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
18911927 * @return an InputStream to read the raw file from
18921928 * @throws GitLabApiException if any exception occurs
@@ -2139,7 +2175,7 @@ public GroupAccessToken createGroupAccessToken(Object groupIdOrPath, String name
21392175 public GroupAccessToken rotateGroupAccessToken (Object groupIdOrPath , Long tokenId ) throws GitLabApiException {
21402176 return rotateGroupAccessToken (groupIdOrPath , tokenId , null );
21412177 }
2142-
2178+
21432179
21442180 /**
21452181 * Rotate a group access token. Revokes the previous token and creates a new token that expires in one week.
0 commit comments