Class UsersClient

java.lang.Object
com.dtsx.astra.sdk.AbstractApiClient
com.dtsx.astra.sdk.org.UsersClient

public class UsersClient extends AbstractApiClient
Client to work with Users.
  • Constructor Details

    • UsersClient

      public UsersClient(String token)
      As immutable object use builder to initiate the object.
      Parameters:
      token - authenticated token
    • UsersClient

      public UsersClient(String token, ApiLocator.AstraEnvironment env)
      Constructor.
      Parameters:
      token - current token.
  • Method Details

    • findAll

      public Stream<User> findAll()
      List users in organization.
      Returns:
      list of roles in target organization.
    • find

      public Optional<User> find(String userId)
      Retrieve user information from its id.
      Parameters:
      userId - user identifier
      Returns:
      user information
    • findByEmail

      public Optional<User> findByEmail(String email)
      Retrieve a suer from his email.
      Parameters:
      email - user email
      Returns:
      user iif exist
    • exist

      public boolean exist(String userId)
      Check if a role is present
      Parameters:
      userId - user identifier
      Returns:
      iif the user exists
    • existByEmail

      public boolean existByEmail(String userEmail)
      Delete a user from its email.
      Parameters:
      userEmail - user emails
      Returns:
      if the user exists
    • delete

      public void delete(String userId)
      Delete a role from its id.
      Parameters:
      userId - user identifier
    • deleteByEmail

      public void deleteByEmail(String userEmail)
      Delete a user from its email.
      Parameters:
      userEmail - user emails
    • invite

      public void invite(String email, String... roles)
      Invite a user.
      Parameters:
      email - user email
      roles - list of roles to assign
    • updateRoles

      public void updateRoles(String userId, String... roles)
      Replace roles of users.
      Parameters:
      userId - user identifier
      roles - replace existing roles of a user
    • getEndpointUsers

      public String getEndpointUsers()
      Endpoint to access schema for namespace.
      Returns:
      endpoint