// SetPassword sets the Password field's value.
6878
func (s *CreateEndpointInput) SetPassword(v string) *CreateEndpointInput {
	s.Password = &v
	return s
}
902919
func (s *MemberFabricConfiguration) SetAdminPassword(v string) *MemberFabricConfiguration {
	s.AdminPassword = &v
	return s
}
1094965
func (s *Source) SetPassword(v string) *Source {
	s.Password = &v
	return s
}
285400
func (u *modelUserEntity) SetPassword(pass string) error {
	if u.user == nil {
		return errors.New("cannot set password on external user")
	}
	return u.user.SetPassword(pass)
}
491291
func (m *Machine) SetMongoPassword(password string) error {
	if !m.IsManager() {
		return errors.NotSupportedf("setting mongo password for non-controller machine %v", m)
	}
	return mongo.SetAdminMongoPassword(m.st.session, m.Tag().String(), password)
}
540347
func (s *ChangePasswordInput) SetOldPassword(v string) *ChangePasswordInput {
	s.OldPassword = &v
	return s
}
1189488
func (o *ClientOptions) SetPassword(p string) *ClientOptions {
	o.Password = p
	return o
}
870438
func (s *InputSourceRequest) SetPasswordParam(v string) *InputSourceRequest {
	s.PasswordParam = &v
	return s
}
1088520
func (s *AwsSecurityFindingFilters) SetKeyword(v []*KeywordFilter) *AwsSecurityFindingFilters {
	s.Keyword = v
	return s
}
1298003
func (s *RdsDbInstance) SetDbPassword(v string) *RdsDbInstance {
	s.DbPassword = &v
	return s
}
853749
func (s *TestIdentityProviderInput) SetUserPassword(v string) *TestIdentityProviderInput {
	s.UserPassword = &v
	return s
}
146193
func (s *RedshiftDestinationUpdate) SetPassword(v string) *RedshiftDestinationUpdate {
	s.Password = &v
	return s
}
1297841
func (u *Unit) setPasswordHash(passwordHash string) error {
	ops := []txn.Op{{
		C:      unitsC,
		Id:     u.doc.DocID,
		Assert: notDeadDoc,
		Update: bson.D{{"$set", bson.D{{"passwordhash", passwordHash}}}},
	}}
	err := u.st.db().RunTransaction(ops)
	if err != nil {
		return fmt.Errorf("cannot set password of unit %q: %v", u, onAbort(err, ErrDead))
	}
	u.doc.PasswordHash = passwordHash
	return nil
}
1046018
func (s *UserPoolPolicyType) SetPasswordPolicy(v *PasswordPolicyType) *UserPoolPolicyType {
	s.PasswordPolicy = v
	return s
}
444688
func (s *OutputDestinationSettings) SetPasswordParam(v string) *OutputDestinationSettings {
	s.PasswordParam = &v
	return s
}
838431
func (api *UserManagerAPI) SetPassword(args params.EntityPasswords) (params.ErrorResults, error) {
	if err := api.check.ChangeAllowed(); err != nil {
		return params.ErrorResults{}, errors.Trace(err)
	}

	var result params.ErrorResults

	if len(args.Changes) == 0 {
		return result, nil
	}

	// Create the results list to populate.
	result.Results = make([]params.ErrorResult, len(args.Changes))
	for i, arg := range args.Changes {
		if err := api.setPassword(arg); err != nil {
			result.Results[i].Error = common.ServerError(err)
		}
	}
	return result, nil
}
416264
func (u *User) SetPassword(password string) error {
	if err := u.ensureNotDeleted(); err != nil {
		return errors.Annotate(err, "cannot set password")
	}
	salt, err := utils.RandomSalt()
	if err != nil {
		return err
	}
	return u.SetPasswordHash(utils.UserPasswordHash(password, salt), salt)
}