code: @PUT
      @Produces(MediaType.APPLICATION_JSON)
      @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
      @Path("/{userId}/email")
      @Description("Update user email")
      public PrincipalUserDto updateUserEmail(@Context HttpServletRequest req,
          @PathParam("userId") final BigInteger userId,
          @FormParam("email") final String email) {
          if (userId == null || userId.compareTo(BigInteger.ZERO) < 1) {
              throw new WebApplicationException("User Id cannot be null and must be a positive non-zero number.", Status.BAD_REQUEST);
          }
          if (email == null || email.isEmpty()) {
              throw new WebApplicationException("Cannot update with null or empty email.", Status.BAD_REQUEST);
          }
  
          PrincipalUser remoteUser = getRemoteUser(req);
          PrincipalUser user = _uService.findUserByPrimaryKey(userId);
  
          validateResourceAuthorization(req, user, remoteUser);
          if (user == null) {
              throw new WebApplicationException(Response.Status.NOT_FOUND.getReasonPhrase(), Response.Status.NOT_FOUND);
          }
          user.setEmail(email);
          user = _uService.updateUser(user);
          return PrincipalUserDto.transformToDto(user);
      }
docs: Updates the user email.
  
  @param   req     The HTTP request.
  @param   userId  The ID of the user to update.
  @param   email   The new email address.
  
  @return  The updated user DTO.
  
  @throws  WebApplicationException  If an error occurs.