Update account info from account object.
@param account to be updated
@return this
15040
public CouchDbGoogleAuthenticatorAccount update(final OneTimeTokenAccount account) {
        setId(account.getId());
        setUsername(account.getUsername());
        setSecretKey(account.getSecretKey());
        setValidationCode(account.getValidationCode());
        setScratchCodes(account.getScratchCodes());
        setRegistrationDate(account.getRegistrationDate());
        return this;
    }
597479
private void switchAccountStatus(Account account, Account.Status status,
            UserIdentityContext userIdentityContext) {
        if (logger.isDebugEnabled()) {
            logger.debug("Switching status for account:" + account.getSid() + ",status:" + status);
        }
        switch (status) {
            case CLOSED:
                sendRVDStatusNotification(account,userIdentityContext);
                // then proceed to dependency removal
                removeAccoundDependencies(account.getSid());
                break;
            default:
                break;

        }
        // finally, set and persist account status
        account = account.setStatus(status);
        accountsDao.updateAccount(account);
    }
743472
public function updateAccount(Account $account)
    {
        $response = $this->rest->post(
            static::ACCOUNT_PATH,
            $account->toUpdateParams()
        );

        $this->checkResponse($response);

        return $account->fromResponse($response);
    }
1323018
public AccountAcquisition updateAccountAcquisition(final String accountCode, final AccountAcquisition acquisition) {
        final String path = Account.ACCOUNT_RESOURCE + "/" + accountCode + AccountAcquisition.ACCOUNT_ACQUISITION_RESOURCE;
        return doPUT(path, acquisition, AccountAcquisition.class);
    }
999622
public CustomFields updateCustomField(String accountId, String customFieldId, CustomField customField) throws ApiException {
    return updateCustomField(accountId, customFieldId, customField, null);
  }
1141588
@RequestMapping(value = "{accountId}/update", method = RequestMethod.PUT)
    public Account updateAccount(@PathVariable ID accountId, @RequestBody @Valid AccountInput input) {
        return accountService.updateAccount(accountId, input);
    }
504177
public ChunkedUploadResponse updateChunkedUpload(String accountId, String chunkedUploadId) throws ApiException {
    return updateChunkedUpload(accountId, chunkedUploadId, null);
  }
1045390
public function setService($account = null) {
        if (!empty($account)) {
            $this->setData('TransInfo', [
                'KfAccount' => [
                    '@cdata' => $account
                ]
            ]);
        }
        return $this->setType(MessageEnum::Service);
    }
506613
def account_settings_update(self, data, **kwargs):
        ""
        api_path = "/api/v2/account/settings.json"
        return self.call(api_path, method="PUT", data=data, **kwargs)
1254712
public function addAccount(ChartAccountsAccount $account) {
        foreach ($this->accounts as $current) {
            if ($current->getNumber() === $account->getNumber()) {
                throw new AccountAlreadyExistsException($account);
            }
        }
        $this->accounts[] = $account;
        return $this;
    }
740797
private Account prepareAccountForUpdate(final Account account,
            final MultivaluedMap<String, String> data,
            UserIdentityContext userIdentityContext) {
        Account.Builder accBuilder = Account.builder();
        //copy full incoming account, and let override happen
        //in a separate instance later
        accBuilder.copy(account);


        if (data.containsKey("Status")) {
            Account.Status newStatus = Account.Status.getValueOf(data.getFirst("Status").toLowerCase());
            accBuilder.setStatus(newStatus);
        }
        if (data.containsKey("FriendlyName")) {
            accBuilder.setFriendlyName(data.getFirst("FriendlyName"));
        }
        if (data.containsKey("Password")) {
            // if this is a reset-password operation, we also need to set the account status to active
            if (account.getStatus() == Account.Status.UNINITIALIZED) {
                accBuilder.setStatus(Account.Status.ACTIVE);
            }

            String password = data.getFirst("Password");
            PasswordValidator validator = PasswordValidatorFactory.createDefault();
            if (!validator.isStrongEnough(password)) {
                CustomReasonPhraseType stat = new CustomReasonPhraseType(Response.Status.BAD_REQUEST, "Password too weak");
                throw new WebApplicationException(status(stat).build());
            }
            final String hash = new Md5Hash(data.getFirst("Password")).toString();
            accBuilder.setAuthToken(hash);
        }

        if (data.containsKey("Role")) {
            // Only allow role change for administrators. Multitenancy checks will take care of restricting the modification scope to sub-accounts.
            if (userIdentityContext.getEffectiveAccountRoles().contains(permissionEvaluator.getAdministratorRole())) {
                accBuilder.setRole(data.getFirst("Role"));
            } else {
                CustomReasonPhraseType stat = new CustomReasonPhraseType(Response.Status.FORBIDDEN, "Only Administrator allowed");
                throw new WebApplicationException(status(stat).build());
            }
        }

        return accBuilder.build();
    }
1193381
public <T> T update(T entity) {
		if (entity == null) {
			throw new ApitraryOrmException("Cannot update null entity");
		}

		log.debug("Updating " + entity.getClass());

		PutRequest request = new PutRequest();
		request.setEntity(resolveApitraryEntity(entity));
		request.setId(resolveApitraryEntityId(entity));

		String payload = marshall(entity);

		request.setRequestPayload(payload);

		PutResponse response = resolveApitraryClient().send(request);

		if (HttpStatus.No_Content.ordinal() != response.getStatusCode()) {
			if (HttpStatus.Not_Found.ordinal() == response.getStatusCode()) {
				throw new ApitraryOrmUpdateException("Cannot update object: object with given id does not exist.");
			} else {
				String statusMessage = (String) new PutResponseUnmarshaller().unMarshall(response, entity);
				throw new ApitraryOrmUpdateException(statusMessage);
			}
		}
		return entity;
	}
479276
public void removeAccount(Account accountToDelete) {
        // Thou shalt not delete root
        if (accountToDelete.getId().equals(rootAccount.getId()))
            return;

        Account parent = findParent(accountToDelete);
        if (parent != null) {
            removeAccount(parent, accountToDelete);
            setDirty(true);
        }
    }
669676
@Override
    public Uid update(final ObjectClass objclass,
            final Uid uid,
            final Set<Attribute> replaceAttributes,
            final OperationOptions options) {

        // check objectclass
        if (objclass == null || (!objclass.equals(ObjectClass.ACCOUNT))) {
            throw new IllegalArgumentException("Invalid objectclass");
        }

        // check accountid
        if (uid == null) {
            throw new IllegalArgumentException("No uid specified");
        }

        // check attributes
        if (replaceAttributes == null || replaceAttributes.isEmpty()) {
            throw new IllegalArgumentException("No attribute specified");
        }

        // get web service client
        final Provisioning provisioning = connection.getProvisioning();
        if (provisioning == null) {
            throw new IllegalStateException("Web Service client not found");
        }

        // to be user in order to pass information to the web service
        final List<WSAttributeValue> attributes = new ArrayList<WSAttributeValue>();

        // retrieve attributes
        for (Attribute attr : replaceAttributes) {
            final WSAttribute wsAttribute = new WSAttribute(attr.getName());

            if (attr.is(Name.NAME)) {
                wsAttribute.setKey(true);
                wsAttribute.setNullable(false);
            }

            if (attr.is(OperationalAttributeInfos.PASSWORD.getName())) {
                wsAttribute.setName(
                        OperationalAttributeInfos.PASSWORD.getName());
                wsAttribute.setPassword(true);
            }

            if (LOG.isOk()) {
                LOG.ok("\nAttribute: "
                        + "\n\tName: " + wsAttribute.getName()
                        + "\n\tType: " + wsAttribute.getType()
                        + "\n\tIsKey: " + wsAttribute.isKey()
                        + "\n\tIsPassword: " + wsAttribute.isPassword());
            }

            final WSAttributeValue wsAttributeValue = new WSAttributeValue(wsAttribute);
            attributes.add(wsAttributeValue);

            final List<Object> value = attr.getValue();
            if (value != null && value.size() == 1
                    && (value.get(0) instanceof GuardedString || value.get(0) instanceof GuardedByteArray)) {

                wsAttributeValue.addValue(value.toString());
            } else {
                wsAttributeValue.setValues(value);
            }
        }

        Uid uuid = null;
        try {
            // user creation
            uuid = new Uid(provisioning.update(uid.getUidValue(), attributes));
        } catch (ProvisioningException e) {
            throw new ConnectorException("Update failed", e);
        } catch (Throwable t) {
            throw new ConnectorException("Communication exception", t);
        }

        return uuid;
    }
322385
@RequestMapping(value = "/update", method = RequestMethod.POST)
	public @ResponseBody
	void update(
			@RequestParam(value = "username", required = true) String username,
			@RequestParam(value = "name", required = false) String name,
			@RequestParam(value = "surname", required = false) String surname,
			@RequestParam(value = "telephoneNumber", required = false) String telephoneNumber) {
		logger.debug("Received request to update account");

		accountService.update(new Account(username, name, surname,
				telephoneNumber));

	}
421306
public void addAccountInfo(CmsAccountInfo info) {

        if (m_accountInfos == null) {
            m_accountInfos = new ArrayList<CmsAccountInfo>();
        }
        m_accountInfos.add(info);
    }
309553
public IndexCommitBuilder update(Object object) {
        updateModelClassSet(object);
        getUpdateList(object.getClass()).add((OpenEngSBModel) object);
        return this;
    }