Class UpdateUserApiRequest
java.lang.Object
com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
com.github.jamesnetherton.zulip.client.api.user.request.UpdateUserApiRequest
- All Implemented Interfaces:
VoidExecutableApiRequest
- Direct Known Subclasses:
UpdateUserByEmailApiRequest
Zulip API request builder to update a user.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUpdateUserApiRequest(ZulipHttpClient client, long userId) Constructs aUpdateUserApiRequest. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Executes the Zulip API request for updating a user.withFullName(String fullName) Sets the updated name of the user.withNewEmail(String newEmail) Sets the updated email address for the user.withProfileData(int id, String value) Sets updated custom profile data for the user.Sets the updated role of the user.Methods inherited from class com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
client, getParam, getParam, getParams, putParam, putParamAsJsonString, putParamAsWrappedObject
-
Field Details
-
FULL_NAME
- See Also:
-
NEW_EMAIL
- See Also:
-
PROFILE_DATA
- See Also:
-
ROLE
- See Also:
-
-
Constructor Details
-
UpdateUserApiRequest
Constructs aUpdateUserApiRequest.- Parameters:
client- The Zulip HTTP clientuserId- The id of the user to update
-
-
Method Details
-
withFullName
Sets the updated name of the user.- Parameters:
fullName- The updated user name- Returns:
- This
UpdateUserApiRequestinstance
-
withRole
Sets the updated role of the user.- Parameters:
role- The updatedUserRole- Returns:
- This
UpdateUserApiRequestinstance
-
withProfileData
Sets updated custom profile data for the user.- Parameters:
id- The id of the custom profile fieldvalue- The updated value for the custom profile field- Returns:
- This
UpdateUserApiRequestinstance
-
withNewEmail
Sets the updated email address for the user.- Parameters:
newEmail- The updated email address- Returns:
- This
UpdateUserApiRequestinstance
-
execute
Executes the Zulip API request for updating a user.- Specified by:
executein interfaceVoidExecutableApiRequest- Throws:
ZulipClientException- if the request was not successful
-