// SaveAccount "persists" the account.
6168
func (db *DB) SaveAccount(model AccountModel) {
	db.Lock()
	defer db.Unlock()
	db.accounts[model.ID] = &model
}
594936
func NewAccountReset(g *libkb.GlobalContext, usernameOrEmail string) *AccountReset {
	return &AccountReset{
		Contextified:    libkb.NewContextified(g),
		usernameOrEmail: usernameOrEmail,
	}
}
942895
func (s *Server) SystemAccount() *Account {
	s.mu.Lock()
	defer s.mu.Unlock()
	if s.sys != nil {
		return s.sys.account
	}
	return nil
}
430096
func (c *Client) EnableAccount(p *EnableAccountParameter) (*Account, error) {
	obj, err := c.Request("enableAccount", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.(*Account), err
}
436816
func (s *GetAccountOutput) SetAccount(v *Account) *GetAccountOutput {
	s.Account = v
	return s
}
450663
func (s *SetVaultNotificationsInput) SetAccountId(v string) *SetVaultNotificationsInput {
	s.AccountId = &v
	return s
}
477436
func (c *Client) DecodeAccount(resp *http.Response) (*Account, error) {
	var decoded Account
	err := c.Decoder.Decode(&decoded, resp.Body, resp.Header.Get("Content-Type"))
	return &decoded, err
}
433737
func (auup *AuthUserUserPermission) Save(db XODB) error {
	if auup.Exists() {
		return auup.Update(db)
	}

	return auup.Insert(db)
}
755280
func putAccountRow(ns walletdb.ReadWriteBucket, scope *KeyScope,
	account uint32, row *dbAccountRow) error {

	scopedBucket, err := fetchWriteScopeBucket(ns, scope)
	if err != nil {
		return err
	}

	bucket := scopedBucket.NestedReadWriteBucket(acctBucketName)

	// Write the serialized value keyed by the account number.
	err = bucket.Put(uint32ToBytes(account), serializeAccountRow(row))
	if err != nil {
		str := fmt.Sprintf("failed to store account %d", account)
		return managerError(ErrDatabase, str, err)
	}
	return nil
}
261098
func (s *Destination) SetAccount(v string) *Destination {
	s.Account = &v
	return s
}
390398
func NewAccount(setts *Settings) (Account, error) {
	if setts == nil {
		setts = DefaultSettings()
	}
	if err := initFuncs(setts); err != nil {
		return nil, err
	}
	id, err := generateID(setts.AddrGen)
	if err != nil {
		return nil, errors.Wrap(err, "unable to generate account id")
	}
	return &account{id: id, setts: setts}, nil
}
1060583
func (s *AccountsService) GetAccount(account string) (*AccountInfo, *Response, error) {
	u := fmt.Sprintf("accounts/%s", account)

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	v := new(AccountInfo)
	resp, err := s.client.Do(req, v)
	if err != nil {
		return nil, resp, err
	}

	return v, resp, err
}
31869
func (c *MemStore) UpdateAccount(controllerName string, details AccountDetails) error {
	c.mu.Lock()
	defer c.mu.Unlock()

	if err := ValidateControllerName(controllerName); err != nil {
		return err
	}
	if err := ValidateAccountDetails(details); err != nil {
		return err
	}
	oldDetails := c.Accounts[controllerName]
	// Only update last known access if it has a value.
	if details.LastKnownAccess == "" {
		details.LastKnownAccess = oldDetails.LastKnownAccess
	}
	c.Accounts[controllerName] = details
	return nil
}
226058
func (s *StackSetOperationResultSummary) SetAccount(v string) *StackSetOperationResultSummary {
	s.Account = &v
	return s
}
16492
func (s *Storage) SaveAuthorize(data *osin.AuthorizeData) (err error) {
	extra, err := assertToString(data.UserData)
	if err != nil {
		return err
	}

	if _, err = s.db.Exec(
		"INSERT INTO authorize (client, code, expires_in, scope, redirect_uri, state, created_at, extra) VALUES ($1, $2, $3, $4, $5, $6, $7, $8)",
		data.Client.GetId(),
		data.Code,
		data.ExpiresIn,
		data.Scope,
		data.RedirectUri,
		data.State,
		data.CreatedAt,
		extra,
	); err != nil {
		return errors.New(err)
	}
	return nil
}
163284
func (s *CreateStackInstancesInput) SetAccounts(v []*string) *CreateStackInstancesInput {
	s.Accounts = v
	return s
}
1021069
func (s *PrivateAccountAPI) NewAccount(password string) (common.Address, error) {
	acc, err := fetchKeystore(s.am).NewAccount(password)
	if err == nil {
		return acc.Address, nil
	}
	return common.Address{}, err
}