// HasSetting モバイルゲートウェイ設定を保持しているか
547317
func (m *MobileGateway) HasSetting() bool {
	return m.Settings != nil && m.Settings.MobileGateway != nil
}
1154216
func (collection Collection) GetSEOSetting(context *qor.Context, name string, objects ...interface{}) Setting {
	var (
		seoSetting Setting
		db         = context.GetDB()
		seo        = collection.GetSEO(name)
	)

	// If passed objects has customzied SEO Setting field
	for _, obj := range objects {
		if value := reflect.Indirect(reflect.ValueOf(obj)); value.IsValid() && value.Kind() == reflect.Struct {
			for i := 0; i < value.NumField(); i++ {
				if value.Field(i).Type() == reflect.TypeOf(Setting{}) {
					seoSetting = value.Field(i).Interface().(Setting)
					break
				}
			}
		}
	}

	if !seoSetting.EnabledCustomize {
		globalSeoSetting := collection.SettingResource.NewStruct().(QorSEOSettingInterface)
		if !db.Where("name = ?", name).First(globalSeoSetting).RecordNotFound() {
			seoSetting = globalSeoSetting.GetSEOSetting()
		}
	}

	siteWideSetting := collection.SettingResource.NewStruct()
	db.Where("is_global_seo = ? AND name = ?", true, collection.Name).First(siteWideSetting)
	tagValues := siteWideSetting.(QorSEOSettingInterface).GetGlobalSetting()

	if tagValues == nil {
		tagValues = map[string]string{}
	}

	if seo.Context != nil {
		for key, value := range seo.Context(objects...) {
			tagValues[key] = value
		}
	}

	return replaceTags(seoSetting, seo.Varibles, tagValues)
}
1206808
func (s *UpdateJobTemplateInput) SetSettings(v *JobTemplateSettings) *UpdateJobTemplateInput {
	s.Settings = v
	return s
}
187959
func (s *TranscriptionJob) SetSettings(v *Settings) *TranscriptionJob {
	s.Settings = v
	return s
}
1314786
func (chat *Chat) SaveSetting(key string, value interface{}) error {

	key = strings.ToLower(key)
	serviceID := chat.ctx.getServiceID()
	var cd chatData
	_, err := chat.ctx.db.C("chats").FindId(chat.ID).Select(bson.M{"settings." + serviceID: 1}).
		Apply(
		mgo.Change{
			Update: bson.M{
				"$set":         bson.M{"settings." + serviceID + "." + key: value},
				"$setOnInsert": bson.M{"createdat": time.Now()},
			},
			Upsert:    true,
			ReturnNew: true,
		},
		&cd)

	if err == nil && chat.data != nil && chat.data.Settings != nil && cd.Settings != nil && cd.Settings[serviceID] != nil {
		chat.data.Settings[serviceID] = cd.Settings[serviceID]
	}

	return err
}
405099
func Setting(setting string) (string, error) {
	args := []string{"apply", "--environment", "production", "--configprint", setting}

	out, err := exec.Command(AIOCmd("puppet", "puppet"), args...).Output()
	if err != nil {
		return "", fmt.Errorf("could not run 'puppet %s': %s: %s", strings.Join(args, " "), err, out)
	}

	return strings.Replace(string(out), "\n", "", -1), nil
}
1173490
func (o *DistributedOption) SetProfiling(isProfiling bool) *DistributedOption {
	o.IsProfiling = isProfiling
	return o
}
280442
func (c *Client) UpdateCacheSetting(i *UpdateCacheSettingInput) (*CacheSetting, error) {
	if i.Service == "" {
		return nil, ErrMissingService
	}

	if i.Version == 0 {
		return nil, ErrMissingVersion
	}

	if i.Name == "" {
		return nil, ErrMissingName
	}

	path := fmt.Sprintf("/service/%s/version/%d/cache_settings/%s", i.Service, i.Version, i.Name)
	resp, err := c.PutForm(path, i, nil)
	if err != nil {
		return nil, err
	}

	var cs *CacheSetting
	if err := decodeJSON(&cs, resp.Body); err != nil {
		return nil, err
	}
	return cs, nil
}
425807
func (s *CreateStackInput) SetUserSettings(v []*UserSetting) *CreateStackInput {
	s.UserSettings = v
	return s
}
239365
func (f field) HasOption(option string) bool {
	return f.options.Has(option)
}
735686
func (m *HoltLinearMovAvgModel) Settings() map[string]interface{} {
	settings := make(map[string]interface{})
	if m.alpha != nil {
		settings["alpha"] = *m.alpha
	}
	if m.beta != nil {
		settings["beta"] = *m.beta
	}
	return settings
}
385932
func (ru *RelationUnit) Settings() (*Settings, error) {
	s, err := readSettings(ru.st.db(), settingsC, ru.key())
	if err != nil {
		return nil, errors.Annotatef(err, "unit %q", ru.unitName)
	}
	return s, nil
}
140360
func (p *WebPage) SetSettings(settings WebPageSettings) error {
	req := map[string]interface{}{
		"ref": p.ref.id,
		"settings": webPageSettingsJSON{
			JavascriptEnabled:             settings.JavascriptEnabled,
			LoadImages:                    settings.LoadImages,
			LocalToRemoteURLAccessEnabled: settings.LocalToRemoteURLAccessEnabled,
			UserAgent:                     settings.UserAgent,
			Username:                      settings.Username,
			Password:                      settings.Password,
			XSSAuditingEnabled:            settings.XSSAuditingEnabled,
			WebSecurityEnabled:            settings.WebSecurityEnabled,
			ResourceTimeout:               int(settings.ResourceTimeout / time.Millisecond),
		},
	}
	return p.ref.process.doJSON("POST", "/webpage/SetSettings", req, nil)
}
56993
func (m *EWMAMovAvgModel) Settings() map[string]interface{} {
	settings := make(map[string]interface{})
	if m.alpha != nil {
		settings["alpha"] = *m.alpha
	}
	return settings
}
622090
func (user *User) Settings(out interface{}) error {
	data, err := user.getData()

	if err != nil {
		return err
	}
	serviceID := user.ctx.getServiceID()

	if _, ok := data.Settings[serviceID]; ok {
		// TODO: workaround that creepy bindInterfaceToInterface
		err = bindInterfaceToInterface(data.Settings[serviceID], out)
		return err
	}

	// Not a error – just empty settings
	return nil
}
775904
func (s *OutputSettings) SetHlsSettings(v *HlsSettings) *OutputSettings {
	s.HlsSettings = v
	return s
}
1367332
func (s *Endpoint) SetMongoDbSettings(v *MongoDbSettings) *Endpoint {
	s.MongoDbSettings = v
	return s
}