Class CreateUserCommand

java.lang.Object
org.labkey.remoteapi.Command<ResponseType,org.apache.hc.client5.http.classic.methods.HttpPost>
org.labkey.remoteapi.PostCommand<CreateUserResponse>
org.labkey.remoteapi.security.CreateUserCommand
All Implemented Interfaces:
HasRequiredVersion

public class CreateUserCommand extends PostCommand<CreateUserResponse>
Create a new user account on the server.
  • Constructor Details

    • CreateUserCommand

      public CreateUserCommand(String email)
  • Method Details

    • getEmail

      public String getEmail()
    • setEmail

      public void setEmail(String email)
      Set the email address for the new user.
      Parameters:
      email - The user's email address
    • isSendEmail

      public boolean isSendEmail()
    • setSendEmail

      public void setSendEmail(boolean sendEmail)
      Set to true to send email to the user with login instructions, false to skip email.
      Parameters:
      sendEmail - True to send email, false to skip.
    • createResponse

      protected CreateUserResponse createResponse(String text, int status, String contentType, org.json.JSONObject json)
      Description copied from class: Command
      Creates an instance of the response class, initialized with the response text, the HTTP status code, and parsed JSONObject.

      Override this method to create an instance of a different class that extends CommandResponse

      Overrides:
      createResponse in class Command<CreateUserResponse,org.apache.hc.client5.http.classic.methods.HttpPost>
      Parameters:
      text - The response text from the server.
      status - The HTTP status code.
      contentType - The Content-Type header value.
      json - The parsed JSONObject (or null if no JSON was returned).
      Returns:
      An instance of the response object.
    • getJsonObject

      public org.json.JSONObject getJsonObject()
      Description copied from class: PostCommand
      Returns the JSON object to post or null for no JSON. Override this method to provide parameters as JSON.
      Overrides:
      getJsonObject in class PostCommand<CreateUserResponse>
      Returns:
      The JSON object to post.