//prepareOptsFromOptions Reads apitxn.Opts from Option array
170285
func (cc *Client) prepareOptsFromOptions(ctx context.Client, options ...RequestOption) (requestOptions, error) {
	txnOpts := requestOptions{}
	for _, option := range options {
		err := option(ctx, &txnOpts)
		if err != nil {
			return txnOpts, errors.WithMessage(err, "Failed to read opts")
		}
	}
	return txnOpts, nil
}
1078470
func (s *CertificateDetail) SetOptions(v *CertificateOptions) *CertificateDetail {
	s.Options = v
	return s
}
677886
func (s *LogConfiguration) SetOptions(v map[string]*string) *LogConfiguration {
	s.Options = v
	return s
}
378357
func (module *ODroidC1AnalogModule) 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.(ODroidC1AnalogModulePinDefMap)
	return nil
}
564228
func (module *BBAnalogModule) 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.(BBAnalogModulePinDefMap)
	return nil
}
1028551
func (s *ConfigurationSettingsDescription) SetOptionSettings(v []*ConfigurationOptionSetting) *ConfigurationSettingsDescription {
	s.OptionSettings = v
	return s
}
184779
func DialOpts(opts *Opts) (*Client, error) {
	var conn net.Conn
	var err error
	if opts.TLS {
		conn, err = tls.Dial("tcp", opts.Addr, opts.TLSConfig)
	} else {
		conn, err = net.DialTimeout("tcp", opts.Addr, 10*time.Second)
	}
	if err != nil {
		return nil, err
	}
	return initClient(conn, opts)
}
972064
func (s *VPCDerivedInfoStatus) SetOptions(v *VPCDerivedInfo) *VPCDerivedInfoStatus {
	s.Options = v
	return s
}
641240
func (s *DomainEntry) SetOptions(v map[string]*string) *DomainEntry {
	s.Options = v
	return s
}
254791
func (r *PURuntime) SetOptions(options OptionsType) {
	r.Lock()
	defer r.Unlock()

	r.options = &options
}
429646
func (p *parser) setOptions(opts []Option) {
	for _, opt := range opts {
		opt(p)
	}
}
1255284
func (c *Client) applyOptions(opts ...ClientOption) error {
	for _, f := range opts {
		if err := f(c); err != nil {
			return err
		}
	}
	return nil
}
1027268
func applyOptions(opts ...Option) options {
	options := options{
		logger: zap.NewNop(),
		tmpl:   _defaultTmpl,
	}
	for _, opt := range opts {
		opt.apply(&options)
	}
	return options
}
1134195
func (s *RequestCertificateInput) SetOptions(v *CertificateOptions) *RequestCertificateInput {
	s.Options = v
	return s
}
728576
func (f *FlattenCmdOptions) SetFlattenOptions(dflt *analysis.FlattenOpts) (res *analysis.FlattenOpts) {
	res = &analysis.FlattenOpts{}
	if dflt != nil {
		*res = *dflt
	}
	if f == nil {
		return
	}
	verboseIsSet := false
	minimalIsSet := false
	//removeUnusedIsSet := false
	expandIsSet := false
	if f.WithExpand {
		res.Expand = true
		expandIsSet = true
	}
	for _, opt := range f.WithFlatten {
		if opt == "verbose" {
			res.Verbose = true
			verboseIsSet = true
		}
		if opt == "noverbose" && !verboseIsSet {
			// verbose flag takes precedence
			res.Verbose = false
			verboseIsSet = true
		}
		if opt == "remove-unused" {
			res.RemoveUnused = true
			//removeUnusedIsSet = true
		}
		if opt == "expand" {
			res.Expand = true
			expandIsSet = true
		}
		if opt == "full" && !minimalIsSet && !expandIsSet {
			// minimal flag takes precedence
			res.Minimal = false
			minimalIsSet = true
		}
		if opt == "minimal" && !expandIsSet {
			// expand flag takes precedence
			res.Minimal = true
			minimalIsSet = true
		}
	}
	return
}
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
}
1183799
func (c *Client) prepareRequestOpts(options ...RequestOption) (requestOptions, error) {
	opts := requestOptions{}
	for _, option := range options {
		err := option(c.ctx, &opts)
		if err != nil {
			return opts, errors.WithMessage(err, "Failed to read request opts")
		}
	}

	// Set defaults for max targets
	if opts.MaxTargets == 0 {
		opts.MaxTargets = maxTargets
	}

	// Set defaults for min targets/matches
	if opts.MinTargets == 0 {
		opts.MinTargets = minTargets
	}

	if opts.MinTargets > opts.MaxTargets {
		opts.MaxTargets = opts.MinTargets
	}

	return opts, nil
}