def update_user(self, auth, username, update):
        """
        Updates the user with username ``username`` according to ``update``.

        :param auth.Authentication auth: authentication object, must be admin-level
        :param str username: username of user to update
        :param GogsUserUpdate update: a ``GogsUserUpdate`` object describing the requested update
        :return: the updated user
        :rtype: GogsUser
        :raises NetworkFailure: if there is an error communicating with the server
        :raises ApiFailure: if the request cannot be serviced
        """
        path = "/admin/users/{}".format(username)
        response = self.patch(path, auth=auth, data=update.as_dict())
        return GogsUser.from_json(response.json())