Class AtlanUser

java.lang.Object
com.atlan.model.core.AtlanObject
com.atlan.model.admin.AtlanUser
All Implemented Interfaces:
Serializable

public class AtlanUser extends AtlanObject
See Also:
  • Constructor Details

  • Method Details

    • creator

      public static AtlanUser.AtlanUserBuilder<?,?> creator(String email, String roleName)
      Builds the minimal object necessary to create (invite) a user.
      Parameters:
      email - email address of the user
      roleName - name of the role for the user ($admin, $member, or $guest)
      Returns:
      the minimal request necessary to update the user, as a builder
    • updater

      public static AtlanUser.AtlanUserBuilder<?,?> updater(String id)
      Builds the minimal object necessary to update a user.
      Parameters:
      id - unique identifier (GUID) of the user
      Returns:
      the minimal request necessary to update the user, as a builder
    • create

      public void create() throws AtlanException
      Send this user to Atlan to create the user in Atlan.
      Throws:
      AtlanException - on any error during API invocation
    • create

      public void create(AtlanClient client) throws AtlanException
      Send this user to Atlan to create the user in Atlan.
      Parameters:
      client - connectivity to the Atlan tenant on which to create the user
      Throws:
      AtlanException - on any error during API invocation
    • create

      public AtlanUser create(boolean returnUser) throws AtlanException
      Send this user to Atlan to create the user in Atlan, and return the created user. Note: this will make 2 API calls, one to create the user and a second to retrieve the created user.
      Parameters:
      returnUser - whether to return the created user (true) or not (false)
      Returns:
      the created user
      Throws:
      AtlanException - on any error during API invocation
    • create

      public AtlanUser create(AtlanClient client, boolean returnUser) throws AtlanException
      Send this user to Atlan to create the user in Atlan, and return the created user. Note: this will make 2 API calls, one to create the user and a second to retrieve the created user.
      Parameters:
      client - connectivity to the Atlan tenant on which to create the user
      returnUser - whether to return the created user (true) or not (false)
      Returns:
      the created user
      Throws:
      AtlanException - on any error during API invocation
    • update

      public UserMinimalResponse update() throws AtlanException
      Send this user to Atlan to update the user in Atlan. Note: you can only update users that have already signed up to Atlan. Users that are only invited (but have not yet logged in) cannot be updated.
      Throws:
      AtlanException - on any error during API invocation
    • update

      public UserMinimalResponse update(AtlanClient client) throws AtlanException
      Send this user to Atlan to update the user in Atlan. Note: you can only update users that have already signed up to Atlan. Users that are only invited (but have not yet logged in) cannot be updated.
      Parameters:
      client - connectivity to the Atlan tenant where the user should be updated
      Throws:
      AtlanException - on any error during API invocation
    • addToGroups

      public void addToGroups(List<String> groupIds) throws AtlanException
      Add this user to one or more groups.
      Parameters:
      groupIds - unique identifiers (GUIDs) of the groups to add the user into
      Throws:
      AtlanException - on any API communication issue
    • addToGroups

      public void addToGroups(AtlanClient client, List<String> groupIds) throws AtlanException
      Add this user to one or more groups.
      Parameters:
      client - connectivity to the Atlan tenant where the user should be added to one or more groups
      groupIds - unique identifiers (GUIDs) of the groups to add the user into
      Throws:
      AtlanException - on any API communication issue
    • fetchGroups

      public GroupResponse fetchGroups() throws AtlanException
      Fetch the groups this user belongs to.
      Returns:
      details of the groups the user belongs to
      Throws:
      AtlanException - on any API communication issue
    • fetchGroups

      public GroupResponse fetchGroups(AtlanClient client) throws AtlanException
      Fetch the groups this user belongs to.
      Parameters:
      client - connectivity to the Atlan tenant from which the groups for the user should be fetched
      Returns:
      details of the groups the user belongs to
      Throws:
      AtlanException - on any API communication issue
    • list

      public static List<AtlanUser> list() throws AtlanException
      Retrieves all users currently defined in Atlan.
      Returns:
      the list of users currently defined in Atlan
      Throws:
      AtlanException - on any error during API invocation
    • list

      public static List<AtlanUser> list(AtlanClient client) throws AtlanException
      Retrieves all users currently defined in Atlan.
      Parameters:
      client - connectivity to the Atlan tenant from which users should be listed
      Returns:
      the list of users currently defined in Atlan
      Throws:
      AtlanException - on any error during API invocation
    • getByEmail

      public static List<AtlanUser> getByEmail(String email) throws AtlanException
      Retrieves all users with email addresses that contain the provided email. (This could include a complete email address, in which case there should be at most a single item in the returned list, or could be a partial email address such as "@example.com" to retrieve all users with that domain in their email address.)
      Parameters:
      email - on which to filter the users
      Returns:
      all users whose email addresses contain the provided string
      Throws:
      AtlanException - on any error during API invocation
    • getByEmail

      public static List<AtlanUser> getByEmail(AtlanClient client, String email) throws AtlanException
      Retrieves all users with email addresses that contain the provided email. (This could include a complete email address, in which case there should be at most a single item in the returned list, or could be a partial email address such as "@example.com" to retrieve all users with that domain in their email address.)
      Parameters:
      client - connectivity to the Atlan tenant from which to list users
      email - on which to filter the users
      Returns:
      all users whose email addresses contain the provided string
      Throws:
      AtlanException - on any error during API invocation
    • getByUsername

      public static AtlanUser getByUsername(String user) throws AtlanException
      Retrieves a user based on the username. (This attempts an exact match on username rather than a contains search.)
      Parameters:
      user - the username by which to find the user
      Returns:
      the user with that username
      Throws:
      AtlanException - on any error during API invocation
    • getByUsername

      public static AtlanUser getByUsername(AtlanClient client, String user) throws AtlanException
      Retrieves a user based on the username. (This attempts an exact match on username rather than a contains search.)
      Parameters:
      client - connectivity to the Atlan tenant from which to retrieve the user
      user - the username by which to find the user
      Returns:
      the user with that username
      Throws:
      AtlanException - on any error during API invocation
    • changeRole

      public void changeRole(String roleId) throws AtlanException
      Change the role of this user.
      Parameters:
      roleId - unique identifier (GUID) of the role to move the user into
      Throws:
      AtlanException - on any API communication issue
    • changeRole

      public void changeRole(AtlanClient client, String roleId) throws AtlanException
      Change the role of this user.
      Parameters:
      client - connectivity to the Atlan tenant in which to change the user's role
      roleId - unique identifier (GUID) of the role to move the user into
      Throws:
      AtlanException - on any API communication issue
    • fetchSessions

      public SessionResponse fetchSessions() throws AtlanException
      Retrieve the sessions for this user.
      Returns:
      the list of sessions for this user
      Throws:
      AtlanException - on any API communication issue
    • fetchSessions

      public SessionResponse fetchSessions(AtlanClient client) throws AtlanException
      Retrieve the sessions for this user.
      Parameters:
      client - connectivity to the Atlan tenant from which to retrieve the user's sessions
      Returns:
      the list of sessions for this user
      Throws:
      AtlanException - on any API communication issue
    • builder

      public static AtlanUser.AtlanUserBuilder<?,?> builder()
    • toBuilder

      public AtlanUser.AtlanUserBuilder<?,?> toBuilder()
    • getUsername

      public String getUsername()
      Username of the user within Atlan.
    • getId

      public String getId()
      Unique identifier (GUID) of the user within Atlan.
    • getWorkspaceRole

      public String getWorkspaceRole()
      Name of the role of the user within Atlan.
    • getEmail

      public String getEmail()
      Email address of the user.
    • getEmailVerified

      public Boolean getEmailVerified()
      When true, the email address of the user has been verified.
    • getEnabled

      public Boolean getEnabled()
      When true, the user is enabled. When false, the user has been deactivated.
    • getFirstName

      public String getFirstName()
      First name of the user.
    • getLastName

      public String getLastName()
      Last name (surname) of the user.
    • getAttributes

      public AtlanUser.UserAttributes getAttributes()
      Detailed attributes of the user.
    • getCreatedTimestamp

      public Long getCreatedTimestamp()
      Time (epoch) at which the user was created, in milliseconds.
    • getLastLoginTime

      public Long getLastLoginTime()
      Time (epoch) at which the user last logged into Atlan.
    • getGroupCount

      public Long getGroupCount()
      Number of groups to which the user belongs.
    • getDefaultRoles

      public List<String> getDefaultRoles()
      TBC
    • getRoles

      public List<String> getRoles()
      TBC
    • getDecentralizedRoles

      public String getDecentralizedRoles()
      TBC
    • getPersonas

      public SortedSet<AtlanUser.Persona> getPersonas()
      Personas the user is associated with.
    • getPurposes

      public SortedSet<String> getPurposes()
      Purposes the user is associated with.
    • getAdminEvents

      public List<AdminEvent> getAdminEvents()
      List of administration-related events for this user.
    • getLoginEvents

      public List<KeycloakEvent> getLoginEvents()
      List of login-related events for this user.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class AtlanObject
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class AtlanObject
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AtlanObject
    • toString

      public String toString()
      Description copied from class: AtlanObject
      Overrides:
      toString in class AtlanObject