// UserSettings returns the settings for a given user
437367
func (s *Session) UserSettings() (st *Settings, err error) {

	body, err := s.RequestWithBucketID("GET", EndpointUserSettings("@me"), nil, EndpointUserSettings(""))
	if err != nil {
		return
	}

	err = unmarshal(body, &st)
	return
}
604150
func (s *CreateBrokerRequest) SetUsers(v []*User) *CreateBrokerRequest {
	s.Users = v
	return s
}
500634
func updateSettings(c context.Context) error {
	// Load the settings from luci-config.
	cs := cfgclient.CurrentServiceConfigSet(c)
	lucicfg := GetConfigService(c)
	cfg, err := lucicfg.GetConfig(c, cs, "settings.cfg", false)
	if err != nil {
		return errors.Annotate(err, "loading settings.cfg from luci-config").Err()
	}

	// Do the revision check & swap in a datastore transaction.
	return datastore.RunInTransaction(c, func(c context.Context) error {
		oldSettings := Settings{}
		err := datastore.Get(c, &oldSettings)
		switch err {
		case datastore.ErrNoSuchEntity:
			// This might be the first time this has run, so a warning here is ok.
			logging.WithError(err).Warningf(c, "no existing service config")
		case nil:
			// Continue
		default:
			return errors.Annotate(err, "loading existing config").Err()
		}
		// Check to see if we need to update
		if oldSettings.Revision == cfg.Revision {
			logging.Debugf(c, "revisions matched (%s), no need to update", cfg.Revision)
			return nil
		}
		newSettings := Settings{Revision: cfg.Revision}
		if err := proto.UnmarshalText(cfg.Content, &newSettings.Settings); err != nil {
			return errors.Annotate(err, "unmarshalling proto").Err()
		}
		ctx := &validation.Context{Context: c}
		ctx.SetFile("settings.cfg")
		validateSettings(ctx, &newSettings.Settings)
		if err := ctx.Finalize(); err != nil {
			return errors.Annotate(err, "validating settings").Err()
		}
		return datastore.Put(c, &newSettings)
	}, nil)
}
427662
func (s *IndicesPutTemplateService) FlatSettings(flatSettings bool) *IndicesPutTemplateService {
	s.flatSettings = &flatSettings
	return s
}
822507
func (s *ClusterStateService) FlatSettings(flatSettings bool) *ClusterStateService {
	s.flatSettings = &flatSettings
	return s
}
478956
func (s *StartTranscriptionJobInput) SetSettings(v *Settings) *StartTranscriptionJobInput {
	s.Settings = v
	return s
}
336229
func (s *GetStageOutput) SetRouteSettings(v map[string]*RouteSettings) *GetStageOutput {
	s.RouteSettings = v
	return s
}
410459
func (s *Participants) SetUsers(v []*UserMetadata) *Participants {
	s.Users = v
	return s
}
293663
func (s *ListUsersOutput) SetUsers(v []*User) *ListUsersOutput {
	s.Users = v
	return s
}
199629
func (s *SearchUsersOutput) SetUsers(v []*UserData) *SearchUsersOutput {
	s.Users = v
	return s
}
1269760
func readSettings(db Database, collection, key string) (*Settings, error) {
	s := newSettings(db, collection, key)
	if err := s.Read(); err != nil {
		return nil, err
	}
	return s, nil
}
469391
func (s *JobTemplate) SetSettings(v *JobTemplateSettings) *JobTemplate {
	s.Settings = v
	return s
}
1050480
func (s *ListUsersResponse) SetUsers(v []*UserSummary) *ListUsersResponse {
	s.Users = v
	return s
}
1025624
func (s *CreateConfigurationTemplateInput) SetOptionSettings(v []*ConfigurationOptionSetting) *CreateConfigurationTemplateInput {
	s.OptionSettings = v
	return s
}
314864
func (s *DescribeUsersOutput) SetUsers(v []*User) *DescribeUsersOutput {
	s.Users = v
	return s
}
811945
func (s *IndicesGetTemplateService) FlatSettings(flatSettings bool) *IndicesGetTemplateService {
	s.flatSettings = &flatSettings
	return s
}
640433
func (s *TraceSummary) SetUsers(v []*TraceUser) *TraceSummary {
	s.Users = v
	return s
}