@@ -1313,6 +1313,26 @@ public void addSamlGroupLink(Object groupIdOrPath, String samlGroupName, AccessL
1313
1313
addSamlGroupLink (groupIdOrPath , samlGroupName , groupAccess .toValue ());
1314
1314
}
1315
1315
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
+
1316
1336
/**
1317
1337
* Adds an SAML group link.
1318
1338
*
@@ -1324,9 +1344,25 @@ public void addSamlGroupLink(Object groupIdOrPath, String samlGroupName, AccessL
1324
1344
* @throws GitLabApiException if any exception occurs
1325
1345
*/
1326
1346
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 {
1327
1362
GitLabApiForm formData = new GitLabApiForm ()
1328
1363
.withParam ("saml_group_name" , samlGroupName , true )
1329
- .withParam ("access_level" , groupAccess , true );
1364
+ .withParam ("access_level" , groupAccess , true )
1365
+ .withParam ("member_role_id" , memberRoleId );
1330
1366
post (Response .Status .CREATED , formData , "groups" , getGroupIdOrPath (groupIdOrPath ), "saml_group_links" );
1331
1367
}
1332
1368
@@ -1886,7 +1922,7 @@ public Group setGroupAvatar(Object groupIdOrPath, File avatarFile) throws GitLab
1886
1922
* Only working with GitLab 14.0 and above.
1887
1923
*
1888
1924
* <pre><code>GitLab Endpoint: GET /groups/:id/avatar</code></pre>
1889
- *
1925
+ *
1890
1926
* @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
1891
1927
* @return an InputStream to read the raw file from
1892
1928
* @throws GitLabApiException if any exception occurs
@@ -2139,7 +2175,7 @@ public GroupAccessToken createGroupAccessToken(Object groupIdOrPath, String name
2139
2175
public GroupAccessToken rotateGroupAccessToken (Object groupIdOrPath , Long tokenId ) throws GitLabApiException {
2140
2176
return rotateGroupAccessToken (groupIdOrPath , tokenId , null );
2141
2177
}
2142
-
2178
+
2143
2179
2144
2180
/**
2145
2181
* Rotate a group access token. Revokes the previous token and creates a new token that expires in one week.
0 commit comments