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

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

- - ### Method Detail

    - #### serviceName

          default java.lang.String serviceName()

      Specified by:
        `serviceName` in interface `ApiService`

    - #### createUser

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

    - #### updateUser

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

    - #### updateUsersRest

          @PUT
          javax.ws.rs.core.Response updateUsersRest​(java.util.Collection<UserAccount> userAccounts)

    - #### updatePassword

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

    - #### deleteUserRest

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

    - #### findUsers

          @GET
          java.util.List<UserAccount> findUsers​(@QueryParam("email")
                                                java.lang.String email,
                                                @QueryParam("fullName")
                                                java.lang.String fullName,
                                                @QueryParam("loginAllowed")
                                                java.lang.Boolean loginAllowed,
                                                @QueryParam("external")
                                                java.lang.Boolean external,
                                                @QueryParam("lastActiveAfter")
                                                java.util.Date lastActiveAfter,
                                                @QueryParam("lastActiveBefore")
                                                java.util.Date lastActiveBefore,
                                                @DefaultValue("0") @QueryParam("page")
                                                java.lang.Long page,
                                                @DefaultValue("100") @QueryParam("resultsPerPage")
                                                java.lang.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")
                              java.lang.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​(java.util.Collection<UserAccount> userAccounts)

      Updates a collection of users
      Parameters:
        `userAccounts` - Collection of user properties

    - #### updatePassword

          void updatePassword​(java.lang.String username,
                              java.lang.String currentPassword,
                              java.lang.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​(java.lang.String username)

      Deletes a user.
      Parameters:
        `username` - The identifier of the user