java.lang.Object
com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
com.github.jamesnetherton.zulip.client.api.user.request.GetUserApiRequest
All Implemented Interfaces:
ExecutableApiRequest<User>

public class GetUserApiRequest extends ZulipApiRequest implements ExecutableApiRequest<User>
Zulip API request builder for getting a user.
See Also:
  • Field Details

  • Constructor Details

    • GetUserApiRequest

      public GetUserApiRequest(ZulipHttpClient client, long userId)
      Constructs a GetUserApiRequest.
      Parameters:
      client - The Zulip HTTP client
      userId - The id of the user to get
    • GetUserApiRequest

      public GetUserApiRequest(ZulipHttpClient client, String email)
      Constructs a GetUserApiRequest.
      Parameters:
      client - The Zulip HTTP client
      email - The Zulip display email address of the user to get
  • Method Details

    • withClientGravatar

      public GetUserApiRequest withClientGravatar(boolean gravatar)
      Sets whether to include the user gravatar image URL in the response.
      Parameters:
      gravatar - true to include the gravatar image URL in the response. false to not include the gravatar image URL in the response
      Returns:
      This GetUserApiRequest instance
    • withIncludeCustomProfileFields

      public GetUserApiRequest withIncludeCustomProfileFields(boolean includeCustomProfileFields)
      Sets whether to include the user custom profile fields in the response.
      Parameters:
      includeCustomProfileFields - true to include user custom profile fields in the response. false to not include user custom profile fields in the response
      Returns:
      This GetUserApiRequest instance
    • execute

      public User execute() throws ZulipClientException
      Executes the Zulip API request for getting a user.
      Specified by:
      execute in interface ExecutableApiRequest<User>
      Returns:
      User object that matched the request user id
      Throws:
      ZulipClientException - if the request was not successful