UserRecord.UpdateRequest

public static class UserRecord.UpdateRequest extends Object

A class for updating the attributes of an existing user. An instance of this class can be obtained via a UserRecord object, or from a user ID string. Specify the changes to be made in the user account by calling the various setter methods available in this class.

Public Constructor Summary

UpdateRequest(String uid)
Creates a new UserRecord.UpdateRequest, which can be used to update the attributes of the user identified by the specified user ID.

Public Method Summary

UserRecord.UpdateRequest
setCustomClaims(Map<String, Object> customClaims)
Updates the custom claims associated with this user.
UserRecord.UpdateRequest
setDisabled(boolean disabled)
Enables or disables this user account.
UserRecord.UpdateRequest
setDisplayName(String displayName)
Updates the display name of this user.
UserRecord.UpdateRequest
setEmail(String email)
Updates the email address associated with this user.
UserRecord.UpdateRequest
setEmailVerified(boolean emailVerified)
Updates the email verification status of this account.
UserRecord.UpdateRequest
setPassword(String password)
Updates the password of this user.
UserRecord.UpdateRequest
setPhoneNumber(String phone)
Updates the phone number associated with this user.
UserRecord.UpdateRequest
setPhotoUrl(String photoUrl)
Updates the Photo URL of this user.

Inherited Method Summary

Public Constructors

public UpdateRequest (String uid)

Creates a new UserRecord.UpdateRequest, which can be used to update the attributes of the user identified by the specified user ID. This method allows updating attributes of a user account, without first having to call getUser(String).

Parameters
uid a non-null, non-empty user ID string.
Throws
IllegalArgumentException If the user ID is null or empty.

Public Methods

public UserRecord.UpdateRequest setCustomClaims (Map<String, Object> customClaims)

Updates the custom claims associated with this user. Calling this method with a null argument removes any custom claims from the user account.

Parameters
customClaims a Map of custom claims or null

public UserRecord.UpdateRequest setDisabled (boolean disabled)

Enables or disables this user account.

Parameters
disabled a boolean indicating whether this account should be disabled.

public UserRecord.UpdateRequest setDisplayName (String displayName)

Updates the display name of this user. Calling this method with a null argument removes the display name attribute from the user account.

Parameters
displayName a display name string or null

public UserRecord.UpdateRequest setEmail (String email)

Updates the email address associated with this user.

Parameters
email a non-null, non-empty email address to be associated with the user.

public UserRecord.UpdateRequest setEmailVerified (boolean emailVerified)

Updates the email verification status of this account.

Parameters
emailVerified a boolean indicating whether the email address has been verified.

public UserRecord.UpdateRequest setPassword (String password)

Updates the password of this user.

Parameters
password a new password string that is at least 6 characters long.

public UserRecord.UpdateRequest setPhoneNumber (String phone)

Updates the phone number associated with this user. Calling this method with a null argument removes the phone number from the user account.

Parameters
phone a valid phone number string or null.

public UserRecord.UpdateRequest setPhotoUrl (String photoUrl)

Updates the Photo URL of this user. Calling this method with a null argument removes the photo URL attribute from the user account.

Parameters
photoUrl a valid URL string or null

Send feedback about...

Need help? Visit our support page.