Package com.xebialabs.xlrelease.api.v1

# Interface UserApi

All Superinterfaces:
  `ApiService`

@Path("/api/v1/users") @Consumes("application/json") @Produces("application/json") public interface UserApi extends ApiService
Operations with users.

- ## Field Summary

  ### Fields inherited from interface com.xebialabs.xlrelease.api.ApiService

  `DEFAULT_RESULTS_PER_PAGE, DEFAULT_RESULTS_PER_PAGE_STRING, DEPTH, ORDER_BY, PAGE, PAGE_IS_OFFSET, RESULTS_PER_PAGE, ROLE_IDS_DATA`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `UserAccount`
  `createUser(UserAccount userAccount)`
  Creates a new user
  `jakarta.ws.rs.core.Response`
  `createUser(String username, UserAccount userAccount)`
  `void`
  `deleteUser(String username)`
  Deletes a user.
  `jakarta.ws.rs.core.Response`
  `deleteUserRest(String username)`
  `List<UserAccount>`
  `findUsers(String email, String fullName, Boolean loginAllowed, Boolean external, Date lastActiveAfter, Date lastActiveBefore, Long page, Long resultsPerPage)`
  Returns the users in the system.
  `UserAccount`
  `getUser(String username)`
  Returns a single user
  `default String`
  `serviceName()`
  `jakarta.ws.rs.core.Response`
  `updatePassword(String username, ChangePasswordView changePasswordView)`
  `void`
  `updatePassword(String username, String currentPassword, String newPassword)`
  Updates a user password.
  `UserAccount`
  `updateUser(UserAccount userAccount)`
  Updates a user.
  `jakarta.ws.rs.core.Response`
  `updateUser(String username, UserAccount userAccount)`
  `void`
  `updateUsers(Collection<UserAccount> userAccounts)`
  Updates a collection of users
  `jakarta.ws.rs.core.Response`
  `updateUsersRest(Collection<UserAccount> userAccounts)`

- ## Method Details

  - ### serviceName

    default String serviceName()
    Specified by:
      `serviceName` in interface `ApiService`

  - ### createUser

    @POST @Path("/{username:[^/]+}") jakarta.ws.rs.core.Response createUser(@PathParam("username") String username, UserAccount userAccount)

  - ### updateUser

    @PUT @Path("/{username:.*}") jakarta.ws.rs.core.Response updateUser(@PathParam("username") String username, UserAccount userAccount)

  - ### updateUsersRest

    @PUT jakarta.ws.rs.core.Response updateUsersRest(Collection<UserAccount> userAccounts)

  - ### updatePassword

    @POST @Path("/{username:[^/]+}/password") jakarta.ws.rs.core.Response updatePassword(@PathParam("username") String username, ChangePasswordView changePasswordView)

  - ### deleteUserRest

    @DELETE @Path("/{username:.*}") jakarta.ws.rs.core.Response deleteUserRest(@PathParam("username") String username)

  - ### findUsers

    @GET List<UserAccount> findUsers(@QueryParam("email") String email, @QueryParam("fullName") String fullName, @QueryParam("loginAllowed") Boolean loginAllowed, @QueryParam("external") Boolean external, @QueryParam("lastActiveAfter") Date lastActiveAfter, @QueryParam("lastActiveBefore") Date lastActiveBefore, @DefaultValue("0") @QueryParam("page") Long page, @DefaultValue("100") @QueryParam("resultsPerPage") Long resultsPerPage)
    Returns the users in the system.
    Parameters:
      `email` - The (optional) email of the user
      `fullName` - The (optional) full name of the user
      `loginAllowed` - The (optional) flag for login permission
      `external` - The (optional) flag for external users
      `page` - The (optional) page of results to return. Default value is 0
      `resultsPerPage` - The (optional) number of results per page. Default value is 100
    Returns:
      users found

  - ### getUser

    @GET @Path("/{username:.*}") UserAccount getUser(@PathParam("username") String username)
    Returns a single user
    Parameters:
      `username` - the identifier of the user
    Returns:
      user found

  - ### createUser

    UserAccount createUser(UserAccount userAccount)
    Creates a new user
    Parameters:
      `userAccount` - The user properties
    Returns:
      the new user created

  - ### updateUser

    UserAccount updateUser(UserAccount userAccount)
    Updates a user.
    Parameters:
      `userAccount` - The user properties
    Returns:
      the updated user

  - ### updateUsers

    void updateUsers(Collection<UserAccount> userAccounts)
    Updates a collection of users
    Parameters:
      `userAccounts` - Collection of user properties

  - ### updatePassword

    void updatePassword(String username, String currentPassword, String newPassword)
    Updates a user password. External users can't be updated with this operation.
    Parameters:
      `username` - The identifier of the user.
      `currentPassword` - Current password of the user, it only has to be supplied when changing your own password.
      `newPassword` - The new password.

  - ### deleteUser

    void deleteUser(String username)
    Deletes a user.
    Parameters:
      `username` - The identifier of the user