Interface RolesApi

All Known Implementing Classes:
RolesApiImpl

public interface RolesApi
Also needs Team Feature enabled
See Also:
  • Method Details

    • list

      List<Role> list()
      Returns:
      a list of all Roles in the account, sorted by creation date, newest first.
    • list

      Pagination<Role> list(int page, int perPage)
      Parameters:
      page - the page number
      perPage - how many results to return for one page. Max 100
      Returns:
      a list of all Roles in the account, sorted by creation date, newest first.
    • get

      Role get(Reference<Role> roleReference)
      Return an existing Role.
      Parameters:
      roleReference - a reference to an existing Role
      Returns:
      the full Role object
    • create

      Role create(RoleInfo roleInfo)
      Create a new Role
      Parameters:
      roleInfo - creation information
      Returns:
      the created Role
    • update

      Role update(Reference<Role> roleReference, RoleInfo toChange)
      Updates the specific role by setting the values of the parameters passed. Any parameters not provided will be left unchanged
      Parameters:
      roleReference - An existing Role to be updated
      toChange - the changes to be performed
      Returns:
      the updated Role
    • addUser

      Role addUser(Reference<Role> roleReference, Reference<User> userReference)
      Add a role to a user
      Parameters:
      roleReference - the role to be assigned
      userReference - the user that will be assigned the role
      Returns:
      the updated Role
    • removeUser

      Role removeUser(Reference<Role> roleReference, Reference<User> userReference)
      Removes the given role from the given user
      Parameters:
      roleReference - the role to be removed
      userReference - the user that will lose the role
      Returns:
      the updated Role
    • delete

      void delete(Reference<Role> roleReference)
      Delete an existing Role. Will unlink it from any users assigned to it.
      Parameters:
      roleReference - a reference to the Role to be deleted