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