Package com.atlan.api

Class UsersEndpoint


public class UsersEndpoint extends HeraclesEndpoint
API endpoints for interacting with Atlan's users.
  • Field Details

    • DEFAULT_PROJECTIONS

      public static final List<String> DEFAULT_PROJECTIONS
  • Constructor Details

    • UsersEndpoint

      public UsersEndpoint(AtlanClient client)
  • Method Details

    • list

      public UserResponse list(UserRequest request) throws AtlanException
      Retrieve users defined in Atlan.
      Parameters:
      request - containing details about which users to retrieve
      Returns:
      a list of the users in Atlan
      Throws:
      AtlanException - on any API communication issue
    • list

      public UserResponse list(UserRequest request, RequestOptions options) throws AtlanException
      Retrieve users defined in Atlan.
      Parameters:
      request - containing details about which users to retrieve
      options - to override default client settings
      Returns:
      a list of the users in Atlan
      Throws:
      AtlanException - on any API communication issue
    • list

      public UserResponse list(String filter, String sort, boolean count, int offset, int limit) throws AtlanException
      Retrieves a list of the users defined in Atlan.
      Parameters:
      filter - which users to retrieve
      sort - property by which to sort the results
      count - whether to return the total number of records (true) or not (false)
      offset - starting point for results to return, for paging
      limit - maximum number of results to be returned
      Returns:
      a list of users that match the provided criteria
      Throws:
      AtlanException - on any API communication issue
    • list

      public UserResponse list(String filter, String sort, boolean count, int offset, int limit, RequestOptions options) throws AtlanException
      Retrieves a list of the users defined in Atlan.
      Parameters:
      filter - which users to retrieve
      sort - property by which to sort the results
      count - whether to return the total number of records (true) or not (false)
      offset - starting point for results to return, for paging
      limit - maximum number of results to be returned
      options - to override default client settings
      Returns:
      a list of users that match the provided criteria
      Throws:
      AtlanException - on any API communication issue
    • list

      public UserResponse list(String filter) throws AtlanException
      Retrieves a list of the users defined in Atlan.
      Parameters:
      filter - which users to retrieve
      Returns:
      a list of users that match the provided criteria
      Throws:
      AtlanException - on any API communication issue
    • list

      public UserResponse list(String filter, RequestOptions options) throws AtlanException
      Retrieves a list of the users defined in Atlan.
      Parameters:
      filter - which users to retrieve
      options - to override default client settings
      Returns:
      a list of users that match the provided criteria
      Throws:
      AtlanException - on any API communication issue
    • list

      public List<AtlanUser> list() throws AtlanException
      Retrieve all users defined in Atlan.
      Returns:
      a list of all the users in Atlan
      Throws:
      AtlanException - on any API communication issue
    • list

      public List<AtlanUser> list(RequestOptions options) throws AtlanException
      Retrieve all users defined in Atlan.
      Parameters:
      options - to override default client settings
      Returns:
      a list of all the users in Atlan
      Throws:
      AtlanException - on any API communication issue
    • list

      public List<AtlanUser> list(int pageSize, RequestOptions options) throws AtlanException
      Retrieve all users defined in Atlan.
      Parameters:
      pageSize - maximum number of users to retrieve per request
      options - to override default client settings
      Returns:
      a list of all the users in Atlan
      Throws:
      AtlanException - on any API communication issue
    • getByEmail

      public 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 List<AtlanUser> getByEmail(String email, RequestOptions options) 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
      options - to override default client settings
      Returns:
      all users whose email addresses contain the provided string
      Throws:
      AtlanException - on any error during API invocation
    • getByEmails

      public List<AtlanUser> getByEmails(List<String> emails) throws AtlanException
      Retrieves all users with the email addresses provided.
      Parameters:
      emails - list of email addresses for which to retrieve users
      Returns:
      all users who have one of the provided email addresses
      Throws:
      AtlanException - on any error during API invocation
    • getByEmails

      public List<AtlanUser> getByEmails(List<String> emails, RequestOptions options) throws AtlanException
      Retrieves all users with the email addresses provided.
      Parameters:
      emails - list of email addresses for which to retrieve users
      options - to override default client settings
      Returns:
      all users who have one of the provided email addresses
      Throws:
      AtlanException - on any error during API invocation
    • getByUsername

      public 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 AtlanUser getByUsername(String user, RequestOptions options) 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
      options - to override default client settings
      Returns:
      the user with that username
      Throws:
      AtlanException - on any error during API invocation
    • getByUsernames

      public List<AtlanUser> getByUsernames(List<String> users) throws AtlanException
      Retrieves users based on a list of usernames. (This attempts an exact match on username rather than a contains search.)
      Parameters:
      users - the usernames by which to find the users
      Returns:
      the users with one of those usernames
      Throws:
      AtlanException - on any error during API invocation
    • getByUsernames

      public List<AtlanUser> getByUsernames(List<String> users, RequestOptions options) throws AtlanException
      Retrieves users based on a list of usernames. (This attempts an exact match on username rather than a contains search.)
      Parameters:
      users - the usernames by which to find the users
      options - to override default client settings
      Returns:
      the users with one of those usernames
      Throws:
      AtlanException - on any error during API invocation
    • getByGuid

      public AtlanUser getByGuid(String guid) throws AtlanException
      Retrieves the user with a unique ID (GUID) that exactly matches the provided string.
      Parameters:
      guid - unique identifier by which to retrieve the user
      Returns:
      the user whose GUID matches the provided string, or null if there is none
      Throws:
      AtlanException - on any error during API invocation
    • getByGuid

      public AtlanUser getByGuid(String guid, RequestOptions options) throws AtlanException
      Retrieves the user with a unique ID (GUID) that exactly matches the provided string.
      Parameters:
      guid - unique identifier by which to retrieve the user
      options - to override default client settings
      Returns:
      the user whose GUID matches the provided string, or null if there is none
      Throws:
      AtlanException - on any error during API invocation
    • create

      public void create(AtlanUser user) throws AtlanException
      Create a new user.
      Parameters:
      user - the details of the new user
      Throws:
      AtlanException - on any API communication issue
    • create

      public void create(AtlanUser user, RequestOptions options) throws AtlanException
      Create a new user.
      Parameters:
      user - the details of the new user
      options - to override default client settings
      Throws:
      AtlanException - on any API communication issue
    • create

      public AtlanUser create(AtlanUser user, boolean returnUser) throws AtlanException
      Create a new user.
      Parameters:
      user - the details of the new user
      returnUser - if true, lookup and return the created user as well
      Returns:
      the created user
      Throws:
      AtlanException - on any API communication issue
    • create

      public AtlanUser create(AtlanUser user, boolean returnUser, RequestOptions options) throws AtlanException
      Create a new user.
      Parameters:
      user - the details of the new user
      returnUser - if true, lookup and return the created user as well
      options - to override default client settings
      Returns:
      the created user
      Throws:
      AtlanException - on any API communication issue
    • create

      public void create(List<AtlanUser> users) throws AtlanException
      Create multiple new users.
      Parameters:
      users - the details of the new users
      Throws:
      AtlanException - on any API communication issue
    • create

      public void create(List<AtlanUser> users, RequestOptions options) throws AtlanException
      Create multiple new users.
      Parameters:
      users - the details of the new users
      options - to override default client settings
      Throws:
      AtlanException - on any API communication issue
    • create

      public List<AtlanUser> create(List<AtlanUser> users, boolean returnUsers) throws AtlanException
      Create multiple new users.
      Parameters:
      users - the details of the new users
      returnUsers - if true, lookup and return the created users as well
      Returns:
      the created users
      Throws:
      AtlanException - on any API communication issue
    • create

      public List<AtlanUser> create(List<AtlanUser> users, boolean returnUsers, RequestOptions options) throws AtlanException
      Create multiple new users.
      Parameters:
      users - the details of the new users
      returnUsers - if true, lookup and return the created users as well
      options - to override default client settings
      Returns:
      the created users
      Throws:
      AtlanException - on any API communication issue
    • update

      public UserMinimalResponse update(String id, AtlanUser user) throws AtlanException
      Update a user. 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:
      id - unique identifier (GUID) of the user to update
      user - the details to update on the user
      Returns:
      basic details about the updated user
      Throws:
      AtlanException - on any API communication issue
    • update

      public UserMinimalResponse update(String id, AtlanUser user, RequestOptions options) throws AtlanException
      Update a user. 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:
      id - unique identifier (GUID) of the user to update
      user - the details to update on the user
      options - to override default client settings
      Returns:
      basic details about the updated user
      Throws:
      AtlanException - on any API communication issue
    • listGroups

      public GroupResponse listGroups(String id, GroupRequest request) throws AtlanException
      Retrieve the groups this user belongs to.
      Parameters:
      id - unique identifier (GUID) of the user
      request - containing details about which groups to retrieve
      Returns:
      groups this user belongs to
      Throws:
      AtlanException - on any API communication issue
    • listGroups

      public GroupResponse listGroups(String id, GroupRequest request, RequestOptions options) throws AtlanException
      Retrieve the groups this user belongs to.
      Parameters:
      id - unique identifier (GUID) of the user
      request - containing details about which groups to retrieve
      options - to override default client settings
      Returns:
      groups this user belongs to
      Throws:
      AtlanException - on any API communication issue
    • listGroups

      public GroupResponse listGroups(String id) throws AtlanException
      Retrieve the groups this user belongs to.
      Parameters:
      id - unique identifier (GUID) of the user
      Returns:
      groups this user belongs to
      Throws:
      AtlanException - on any API communication issue
    • listGroups

      public GroupResponse listGroups(String id, RequestOptions options) throws AtlanException
      Retrieve the groups this user belongs to.
      Parameters:
      id - unique identifier (GUID) of the user
      options - to override default client settings
      Returns:
      groups this user belongs to
      Throws:
      AtlanException - on any API communication issue
    • addToGroups

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

      public void addToGroups(String id, List<String> groupIds, RequestOptions options) throws AtlanException
      Add a user to one or more groups.
      Parameters:
      id - unique identifier (GUID) of the user to add into groups
      groupIds - unique identifiers (GUIDs) of the groups to add the user into
      options - to override default client settings
      Throws:
      AtlanException - on any API communication issue
    • changeRole

      public void changeRole(String id, String roleId) throws AtlanException
      Change the role of a user.
      Parameters:
      id - unique identifier (GUID) of the user whose role should be changed
      roleId - unique identifier (GUID) of the role to move the user into
      Throws:
      AtlanException - on any API communication issue
    • changeRole

      public void changeRole(String id, String roleId, RequestOptions options) throws AtlanException
      Change the role of a user.
      Parameters:
      id - unique identifier (GUID) of the user whose role should be changed
      roleId - unique identifier (GUID) of the role to move the user into
      options - to override default client settings
      Throws:
      AtlanException - on any API communication issue
    • getCurrentUser

      public UserMinimalResponse getCurrentUser() throws AtlanException
      Retrieve the current user (representing the API token).
      Returns:
      minimalist details about the current user (API token)
      Throws:
      AtlanException - on any API communication issue
    • getCurrentUser

      public UserMinimalResponse getCurrentUser(RequestOptions options) throws AtlanException
      Retrieve the current user (representing the API token).
      Parameters:
      options - to override default client settings
      Returns:
      minimalist details about the current user (API token)
      Throws:
      AtlanException - on any API communication issue
    • listSessions

      public SessionResponse listSessions(String id) throws AtlanException
      Retrieve the sessions for a given user.
      Parameters:
      id - unique identifier (GUID) of the user whose sessions should be retrieved
      Returns:
      the list of sessions for that user
      Throws:
      AtlanException - on any API communication issue
    • listSessions

      public SessionResponse listSessions(String id, RequestOptions options) throws AtlanException
      Retrieve the sessions for a given user.
      Parameters:
      id - unique identifier (GUID) of the user whose sessions should be retrieved
      options - to override default client options
      Returns:
      the list of sessions for that user
      Throws:
      AtlanException - on any API communication issue