// UpdateUser updates the user record. NOTE: It is assumed the pasword
// is NOT hashed when updating the user record
16753
func (f *Facade) UpdateUser(ctx datastore.Context, user userdomain.User) error {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("Facade.UpdateUser"))
	var err error
	logger := plog.WithField("userName", user.Name)
	logger.Debug("Started Facade.UpdateUser")
	defer logger.WithError(err).Debug("Finished Facade.UpdateUser")

	id := strings.TrimSpace(user.Name)
	if id == "" {
		err = errors.New("empty User.Name not allowed")
		return err
	}

	user.Name = id
	user.Password = hashPassword(user.Password)
	err = f.userStore.Put(ctx, userdomain.Key(user.Name), &user)
	return err
}
58806
func (s *UserService) UpdateUser(ctx context.Context, id platform.ID, upd platform.UserUpdate) (*platform.User, error) {
	return s.UpdateUserFn(ctx, id, upd)
}
35089
func (s *Service) PutUser(ctx context.Context, u *influxdb.User) error {
	return s.kv.Update(ctx, func(tx Tx) error {
		return s.putUser(ctx, tx, u)
	})
}
143935
func (s *UsersStore) Update(ctx context.Context, u *chronograf.User) error {
	return s.UpdateF(ctx, u)
}
1367046
func (c *UsersProfileGetCall) User(user string) *UsersProfileGetCall {
	c.user = user
	return c
}
1073345
func (c *FakeUsers) Update(userResource *user.User) (result *user.User, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootUpdateAction(usersResource, userResource), &user.User{})
	if obj == nil {
		return nil, err
	}
	return obj.(*user.User), err
}
178676
func (u *UsersService) Update(params interface{}) (user *User, result *Result) {
	result = u.client.put(u.URL, params, &user)
	return
}
228295
func (c *UserServiceController) Update(ctx *app.UpdateUserServiceContext) error {
	c.UpdateTenant(ctx)
	return ctx.OK([]byte{})
}
85816
func (org *Organization) UpdateUser(user UserChange) error {
	var (
		r userUpdateResponse
		b bytes.Buffer
	)
	err := json.NewEncoder(&b).Encode(user)
	if err != nil {
		return err
	}
	err = org.PPE.put(fmt.Sprintf("/orgs/%s/users/%s", org.PrimaryDomain, user.PrimaryEmail), &b, &r)
	if err != nil {
		return err
	}
	if r.ResultCode != 0 {
		return errors.New(r.Message)
	}
	return nil
}
654910
func (s *UpdateUserOutput) SetUser(v *User) *UpdateUserOutput {
	s.User = v
	return s
}
1039306
func (s *RegisterUserOutput) SetUser(v *User) *RegisterUserOutput {
	s.User = v
	return s
}
996017
func UpdatePerson(db *sql.DB, firstName, lastName string, age uint, newPerson Person) error {
	_, err := db.Exec(
		fmt.Sprintf(
			"UPDATE %s SET %s=?,%s=?,%s=? WHERE %s=? AND %s=? AND %s=?",
			PersonTableName,
			PersonFirstNameCol,
			PersonLastNameCol,
			PersonAgeCol,
			PersonFirstNameCol,
			PersonLastNameCol,
			PersonAgeCol,
		),
		newPerson.FirstName,
		newPerson.LastName,
		newPerson.Age,
		firstName,
		lastName,
		age,
	)
	return err
}
245753
func (us UsersService) Update(user User, token string) (User, error) {
	resp, err := newNetworkClient(us.config).MakeRequest(network.Request{
		Method:        "PUT",
		Path:          fmt.Sprintf("/Users/%s", user.ID),
		Authorization: network.NewTokenAuthorization(token),
		IfMatch:       strconv.Itoa(user.Version),
		Body:          network.NewJSONRequestBody(newUpdateUserDocumentFromUser(user)),
		AcceptableStatusCodes: []int{http.StatusOK},
	})
	if err != nil {
		return User{}, translateError(err)
	}

	var response documents.UserResponse
	err = json.Unmarshal(resp.Body, &response)
	if err != nil {
		return User{}, MalformedResponseError{err}
	}

	return newUserFromResponse(us.config, response), nil
}
1276773
func (db *usersDB) Update(email, fullname string) (schema.User, error) {
	defer db.mutex.Unlock()
	db.mutex.Lock()

	user, ok := db.users[email]
	if !ok {
		return schema.User{}, app.ErrNotFound
	}

	user.Fullname = fullname
	return user, nil
}
724366
func (m *MetaClient) CreateUpdateUser(ctx context.Context, action, name, passwd string) error {
	a := &UserAction{
		Action: action,
		User: &User{
			Name:     name,
			Password: passwd,
		},
	}
	return m.Post(ctx, "/user", a, nil)
}
118725
func (p *Pod) SetUser(user string) *Pod {
	p.User = user
	return p
}
441835
func (e *ErrorEntry) SetUser(u string) *ErrorEntry {
	e.User = u
	return e
}