Updates a user info at Gitkit server.

@param user user info to be updated.
@return the updated user info
@throws GitkitClientException for invalid request
@throws GitkitServerException for server error
510417
public GitkitUser updateUser(GitkitUser user)
      throws GitkitClientException, GitkitServerException {
    try {
      return jsonToUser(rpcHelper.updateAccount(user));
    } catch (JSONException e) {
      throw new GitkitServerException(e);
    }
  }
33985
public GitkitUser validateToken(String token) throws GitkitClientException {
    JsonObject jsonToken = validateTokenToJson(token);
    if (jsonToken == null) {
      return null;
    }
    return new GitkitUser()
        .setLocalId(jsonToken.get(JsonTokenHelper.ID_TOKEN_USER_ID).getAsString())
        .setEmail(jsonToken.get(JsonTokenHelper.ID_TOKEN_EMAIL).getAsString())
        .setCurrentProvider(jsonToken.has(JsonTokenHelper.ID_TOKEN_PROVIDER)
            ? jsonToken.get(JsonTokenHelper.ID_TOKEN_PROVIDER).getAsString()
            : null)
        .setName(jsonToken.has(JsonTokenHelper.ID_TOKEN_DISPLAY_NAME)
            ? jsonToken.get(JsonTokenHelper.ID_TOKEN_DISPLAY_NAME).getAsString()
            : null)
        .setPhotoUrl(jsonToken.has(JsonTokenHelper.ID_TOKEN_PHOTO_URL)
            ? jsonToken.get(JsonTokenHelper.ID_TOKEN_PHOTO_URL).getAsString()
            : null);
  }
1293397
public GitlabUser createUser(CreateUserRequest request) throws IOException {
        String tailUrl = GitlabUser.USERS_URL + request.toQuery().toString();
        return dispatch().to(tailUrl, GitlabUser.class);
    }
920529
public static base_response update(nitro_service client, systemuser resource) throws Exception {
		systemuser updateresource = new systemuser();
		updateresource.username = resource.username;
		updateresource.password = resource.password;
		updateresource.externalauth = resource.externalauth;
		updateresource.promptstring = resource.promptstring;
		updateresource.timeout = resource.timeout;
		return updateresource.update_resource(client);
	}
1227346
public Request<User> create(User user) {
        Asserts.assertNotNull(user, "user");

        String url = baseUrl
                .newBuilder()
                .addPathSegments("api/v2/users")
                .build()
                .toString();
        CustomRequest<User> request = new CustomRequest<>(this.client, url, "POST", new TypeReference<User>() {
        });
        request.addHeader("Authorization", "Bearer " + apiToken);
        request.setBody(user);
        return request;
    }
597240
public static mpsuser update(nitro_service client, mpsuser resource) throws Exception
	{
		resource.validate("modify");
		return ((mpsuser[]) resource.update_resource(client))[0];
	}
707634
def update_user_info(self, **kwargs):
        

        if kwargs:
            self.config.update(kwargs)

        method, url = get_URL('user_update')

        res = getattr(self.session, method)(url, params=self.config)

        if res.status_code == 200:
            return True

        hellraiser(res)
1308719
def custom_update_user(sender, instance, attributes, user_modified, **kargs):
    
    for k, v in attributes.items():
        u = set.intersection(set(v), set([u'true', u'false']))
        if u:
            setattr(instance, k, u.pop() == u'true')
    return True
347013
public Iterator<GitkitUser> getAllUsers(final Integer resultsPerRequest) {
    return new DownloadIterator<GitkitUser>() {

      private String nextPageToken = null;

      @Override
      protected Iterator<GitkitUser> getNextResults() {
        try {
          JSONObject response = rpcHelper.downloadAccount(nextPageToken, resultsPerRequest);
          nextPageToken = response.has("nextPageToken")
              ? response.getString("nextPageToken")
              : null;
          if (response.has("users")) {
            return jsonToList(response.getJSONArray("users")).iterator();
          }
        } catch (JSONException e) {
          logger.warning(e.getMessage());
        } catch (GitkitServerException e) {
          logger.warning(e.getMessage());
        } catch (GitkitClientException e) {
          logger.warning(e.getMessage());
        }
        return ImmutableSet.<GitkitUser>of().iterator();
      }
    };
  }
861764
public Optional<User> getOptionalUser(int userId) {
        try {
            return (Optional.ofNullable(getUser(userId)));
        } catch (GitLabApiException glae) {
            return (GitLabApi.createOptionalFromException(glae));
        }
    }
1039078
def UpdateUser(self, user, ssh_keys):
    
    if not bool(USER_REGEX.match(user)):
      self.logger.warning('Invalid user account name %s.', user)
      return False
    if not self._GetUser(user):
      # User does not exist. Attempt to create the user and add them to the
      # appropriate user groups.
      if not (self._AddUser(user)
              and self._UpdateUserGroups(user, self.groups)):
        return False
    # Add the user to the google sudoers group.
    if not self._UpdateSudoer(user, sudoer=True):
      return False

    # Don't try to manage account SSH keys with a shell set to disable
    # logins. This helps avoid problems caused by operator and root sharing
    # a home directory in CentOS and RHEL.
    pw_entry = self._GetUser(user)
    if pw_entry and os.path.basename(pw_entry.pw_shell) == 'nologin':
      message = 'Not updating user %s. User set `nologin` as login shell.'
      self.logger.debug(message, user)
      return True

    try:
      self._UpdateAuthorizedKeys(user, ssh_keys)
    except (IOError, OSError) as e:
      message = 'Could not update the authorized keys file for user %s. %s.'
      self.logger.warning(message, user, str(e))
      return False
    else:
      return True
963819
public Optional<PartnerUser> update(long partnerId, long accountId, PartnerUser user)
    {
        return Optional.of(HTTP.PUT(String.format("/v2/partners/%d/accounts/%d/users", partnerId, accountId), user, PARTNER_USERS).get().iterator().next());
    }
1327236
public void addUser(PrincipalUser user) {
        SystemAssert.requireArgument(user != null, "Null user can not be added.");
        users.add(user);
    }
496916
public ServerUpdater setNickname(User user, String nickname) {
        delegate.setNickname(user, nickname);
        return this;
    }
527503
public void blockUser(Integer userId) throws GitLabApiException {
        if (userId == null) {
            throw new RuntimeException("userId cannot be null");
        }

        if (isApiVersion(ApiVersion.V3)) {
            put(Response.Status.CREATED, null, "users", userId, "block");
        } else {
            post(Response.Status.CREATED, (Form) null, "users", userId, "block");
        }
    }
863223
def update_user(self, user, name=None, password=None, host=None):
        
        return self._user_manager.update(user, name=name, password=password,
                host=host)
890171
public ServerUpdater addRolesToUser(User user, Collection<Role> roles) {
        delegate.addRolesToUser(user, roles);
        return this;
    }