// SetOptions applies zero or more OptionsFunc to the receiving Waveform
// struct, manipulating its properties.
426688
func (w *Waveform) SetOptions(options ...OptionsFunc) error {
	for _, o := range options {
		// Do not apply nil function arguments
		if o == nil {
			continue
		}

		if err := o(w); err != nil {
			return err
		}
	}

	return nil
}
1237162
func (s *RedshiftDestinationUpdate) SetRetryOptions(v *RedshiftRetryOptions) *RedshiftDestinationUpdate {
	s.RetryOptions = v
	return s
}
1153803
func (s *CreateConfigurationSetInput) SetSendingOptions(v *SendingOptions) *CreateConfigurationSetInput {
	s.SendingOptions = v
	return s
}
1175486
func (s *SuggesterStatus) SetOptions(v *Suggester) *SuggesterStatus {
	s.Options = v
	return s
}
814136
func (s *ElasticsearchDestinationUpdate) SetRetryOptions(v *ElasticsearchRetryOptions) *ElasticsearchDestinationUpdate {
	s.RetryOptions = v
	return s
}
760699
func (s *AudioParameters) SetCodecOptions(v *AudioCodecOptions) *AudioParameters {
	s.CodecOptions = v
	return s
}
1357863
func setBrokerOption(k, v interface{}) broker.Option {
	return func(o *broker.Options) {
		if o.Context == nil {
			o.Context = context.Background()
		}
		o.Context = context.WithValue(o.Context, k, v)
	}
}
816654
func (s *DescribeConfigurationOptionsInput) SetOptions(v []*OptionSpecification) *DescribeConfigurationOptionsInput {
	s.Options = v
	return s
}
78718
func (e Enum) ValueOptions() []string {
	optionSet := make(map[string]struct{})
	for _, value := range e.Values {
		for option := range value.Options {
			optionSet[option] = struct{}{}
		}
	}
	if len(optionSet) == 0 {
		return nil
	}
	options := make([]string, 0, len(optionSet))
	for option := range optionSet {
		options = append(options, option)
	}
	sort.Strings(options)
	return options
}
1130680
func (s *IndexField) SetDateOptions(v *DateOptions) *IndexField {
	s.DateOptions = v
	return s
}
957214
func (t *Tree) SetWithOptions(key string, opts SetOptions, value interface{}) {
	t.SetPathWithOptions(strings.Split(key, "."), opts, value)
}
756519
func (module *DTGPIOModule) SetOptions(options map[string]interface{}) error {
	v := options["pins"]
	if v == nil {
		return fmt.Errorf("Module '%s' SetOptions() did not get 'pins' values", module.GetName())
	}

	module.definedPins = v.(DTGPIOModulePinDefMap)
	return nil
}
532857
func (o *Options) Set(optFns ...func(*Options)) {
	for _, fn := range optFns {
		fn(o)
	}
}
618688
func (s *Option) SetOptionSettings(v []*OptionSetting) *Option {
	s.OptionSettings = v
	return s
}
1271167
func (s *DescribeConfigurationOptionsOutput) SetOptions(v []*ConfigurationOptionDescription) *DescribeConfigurationOptionsOutput {
	s.Options = v
	return s
}
1033407
func (s *OptionConfiguration) SetOptionSettings(v []*OptionSetting) *OptionConfiguration {
	s.OptionSettings = v
	return s
}
643115
func setOpts(opts map[string]string, supportedOpts workloadRuntimeOpts) error {
	errors := 0

	for key, val := range opts {
		opt, ok := supportedOpts[key]
		if !ok {
			errors++
			log.Errorf("unknown workload runtime configuration key %q", key)
			continue
		}

		if opt.validate != nil {
			if err := opt.validate(val); err != nil {
				log.Errorf("invalid value for key %s: %s", key, err)
				errors++
			}
		}

	}

	// if errors have occurred, print the supported configuration keys to
	// the log
	if errors > 0 {
		log.Error("Supported configuration keys:")
		for key, val := range supportedOpts {
			log.Errorf("  %-12s %s", key, val.description)
		}

		return fmt.Errorf("invalid workload runtime configuration, see log for details")
	}

	// modify the configuration atomically after verification
	for key, val := range opts {
		supportedOpts[key].value = val
	}

	return nil
}