@@ -310,41 +310,40 @@ public Pager<User> findUsers(String emailOrUsername, int itemsPerPage) throws Gi
310
310
}
311
311
312
312
/**
313
- * Creates a new user. Note only administrators can create new users.
313
+ * <p> Creates a new user. Note only administrators can create new users.
314
314
* Either password or reset_password should be specified (reset_password takes priority).
315
315
*
316
316
* If both the User object's projectsLimit and the parameter projectsLimit is specified
317
- * the parameter will take precedence.
317
+ * the parameter will take precedence.</p>
318
318
*
319
- * POST /users
319
+ * <pre> POST /users</pre>
320
320
*
321
- * email (required) - Email
322
- * password (optional) - Password
323
- * reset_password (optional) - Send user password reset link - true or false(default)
321
+ * The following properties of the provided User instance can be set during creation:<pre><code> email (required) - Email
324
322
* username (required) - Username
325
323
* name (required) - Name
326
324
* skype (optional) - Skype ID
327
325
* linkedin (optional) - LinkedIn
328
326
* twitter (optional) - Twitter account
329
- * website_url (optional) - Website URL
327
+ * websiteUrl (optional) - Website URL
330
328
* organization (optional) - Organization name
331
- * projects_limit (optional) - Number of projects user can create
332
- * extern_uid (optional) - External UID
329
+ * projectsLimit (optional) - Number of projects user can create
330
+ * externUid (optional) - External UID
333
331
* provider (optional) - External provider name
334
332
* bio (optional) - User's biography
335
333
* location (optional) - User's location
336
334
* admin (optional) - User is admin - true or false (default)
337
- * can_create_group (optional) - User can create groups - true or false
338
- * skip_confirmation (optional) - Skip confirmation - true or false (default)
335
+ * canCreateGroup (optional) - User can create groups - true or false
336
+ * skipConfirmation (optional) - Skip confirmation - true or false (default)
339
337
* external (optional) - Flags the user as external - true or false(default)
340
- * avatar (optional) - Image file for user's avatar
341
- * shared_runners_minutes_limit (optional) - Pipeline minutes quota for this user
338
+ * sharedRunnersMinutesLimit (optional) - Pipeline minutes quota for this user
339
+ *</code></pre>
342
340
*
343
341
* @param user the User instance with the user info to create
344
342
* @param password the password for the new user
345
343
* @param projectsLimit the maximum number of project
346
344
* @return created User instance
347
345
* @throws GitLabApiException if any exception occurs
346
+ * @deprecated Will be removed in version 5.0, replaced by {@link #createUser(User, CharSequence, boolean)}
348
347
*/
349
348
public User createUser (User user , CharSequence password , Integer projectsLimit ) throws GitLabApiException {
350
349
Form formData = userToForm (user , projectsLimit , password , null , true );
@@ -353,34 +352,30 @@ public User createUser(User user, CharSequence password, Integer projectsLimit)
353
352
}
354
353
355
354
/**
356
- * Creates a new user. Note only administrators can create new users.
357
- * Either password or reset_password should be specified (reset_password takes priority).
358
- *
359
- * Creates a user with reset_password being <code>true</code>
355
+ * <p>Creates a new user. Note only administrators can create new users.
356
+ * Either password or resetPassword should be specified (resetPassword takes priority).</p>
360
357
*
361
- * POST /users
358
+ * <pre> POST /users</pre>
362
359
*
363
- * email (required) - Email
364
- * password (optional) - Password
365
- * reset_password (optional) - Send user password reset link - true or false(default)
360
+ * The following properties of the provided User instance can be set during creation:<pre><code> email (required) - Email
366
361
* username (required) - Username
367
362
* name (required) - Name
368
363
* skype (optional) - Skype ID
369
364
* linkedin (optional) - LinkedIn
370
365
* twitter (optional) - Twitter account
371
- * website_url (optional) - Website URL
366
+ * websiteUrl (optional) - Website URL
372
367
* organization (optional) - Organization name
373
- * projects_limit (optional) - Number of projects user can create
374
- * extern_uid (optional) - External UID
368
+ * projectsLimit (optional) - Number of projects user can create
369
+ * externUid (optional) - External UID
375
370
* provider (optional) - External provider name
376
371
* bio (optional) - User's biography
377
372
* location (optional) - User's location
378
373
* admin (optional) - User is admin - true or false (default)
379
- * can_create_group (optional) - User can create groups - true or false
380
- * skip_confirmation (optional) - Skip confirmation - true or false (default)
374
+ * canCreateGroup (optional) - User can create groups - true or false
375
+ * skipConfirmation (optional) - Skip confirmation - true or false (default)
381
376
* external (optional) - Flags the user as external - true or false(default)
382
- * avatar (optional) - Image file for user's avatar
383
- * shared_runners_minutes_limit (optional) - Pipeline minutes quota for this user
377
+ * sharedRunnersMinutesLimit (optional) - Pipeline minutes quota for this user
378
+ *</code></pre>
384
379
*
385
380
* @param user the User instance with the user info to create
386
381
* @param password the password for the new user
@@ -394,38 +389,75 @@ public User createUser(User user, CharSequence password, boolean resetPassword)
394
389
return (response .readEntity (User .class ));
395
390
}
396
391
392
+ /**
393
+ * <p>Modifies an existing user. Only administrators can change attributes of a user.</p>
394
+ *
395
+ * <pre>PUT /users</pre>
396
+ *
397
+ * The following properties of the provided User instance can be set during update:<pre><code> email (required) - Email
398
+ * username (required) - Username
399
+ * name (required) - Name
400
+ * skype (optional) - Skype ID
401
+ * linkedin (optional) - LinkedIn
402
+ * twitter (optional) - Twitter account
403
+ * websiteUrl (optional) - Website URL
404
+ * organization (optional) - Organization name
405
+ * projectsLimit (optional) - Number of projects user can create
406
+ * externUid (optional) - External UID
407
+ * provider (optional) - External provider name
408
+ * bio (optional) - User's biography
409
+ * location (optional) - User's location
410
+ * admin (optional) - User is admin - true or false (default)
411
+ * canCreateGroup (optional) - User can create groups - true or false
412
+ * skipConfirmation (optional) - Skip confirmation - true or false (default)
413
+ * external (optional) - Flags the user as external - true or false(default)
414
+ * sharedRunnersMinutesLimit (optional) - Pipeline minutes quota for this user
415
+ *</code></pre>
416
+ *
417
+ * @param user the User instance with the user info to modify
418
+ * @param password the new password for the user
419
+ * @return the modified User instance
420
+ * @throws GitLabApiException if any exception occurs
421
+ */
422
+ public User updateUser (User user , CharSequence password ) throws GitLabApiException {
423
+ Form form = userToForm (user , null , password , false , false );
424
+ Response response = put (Response .Status .OK , form .asMap (), "users" , user .getId ());
425
+ return (response .readEntity (User .class ));
426
+ }
427
+
397
428
/**
398
429
* Modifies an existing user. Only administrators can change attributes of a user.
399
430
*
400
- * PUT /users/:id
401
- *
402
- * email - Email
403
- * username - Username
404
- * name - Name
405
- * password - Password
406
- * skype - Skype ID
407
- * linkedin - LinkedIn
408
- * twitter - Twitter account
409
- * website_url - Website URL
410
- * organization - Organization name
411
- * projects_limit - Limit projects each user can create
412
- * extern_uid - External UID
413
- * provider - External provider name
414
- * bio - User's biography
431
+ * <pre>PUT /users/:id</pre>
432
+ *
433
+ * The following properties of the provided User instance can be set during update:<pre><code> email (required) - Email
434
+ * username (required) - Username
435
+ * name (required) - Name
436
+ * skype (optional) - Skype ID
437
+ * linkedin (optional) - LinkedIn
438
+ * twitter (optional) - Twitter account
439
+ * websiteUrl (optional) - Website URL
440
+ * organization (optional) - Organization name
441
+ * projectsLimit (optional) - Number of projects user can create
442
+ * externUid (optional) - External UID
443
+ * provider (optional) - External provider name
444
+ * bio (optional) - User's biography
415
445
* location (optional) - User's location
416
446
* admin (optional) - User is admin - true or false (default)
417
- * can_create_group (optional) - User can create groups - true or false
418
- * skip_reconfirmation (optional) - Skip reconfirmation - true or false (default)
447
+ * canCreateGroup (optional) - User can create groups - true or false
448
+ * skipConfirmation (optional) - Skip confirmation - true or false (default)
419
449
* external (optional) - Flags the user as external - true or false(default)
420
- * shared_runners_minutes_limit (optional) - Pipeline minutes quota for this user
421
- * avatar (optional) - Image file for user's avatar
450
+ * sharedRunnersMinutesLimit (optional) - Pipeline minutes quota for this user
451
+ *</code></pre>
422
452
*
423
453
* @param user the User instance with the user info to modify
424
454
* @param password the new password for the user
425
455
* @param projectsLimit the maximum number of project
426
456
* @return the modified User instance
427
457
* @throws GitLabApiException if any exception occurs
458
+ * @deprecated Will be removed in version 5.0, replaced by {@link #updateUser(User, CharSequence)}
428
459
*/
460
+ @ Deprecated
429
461
public User modifyUser (User user , CharSequence password , Integer projectsLimit ) throws GitLabApiException {
430
462
Form form = userToForm (user , projectsLimit , password , false , false );
431
463
Response response = put (Response .Status .OK , form .asMap (), "users" , user .getId ());
0 commit comments