// WithValidator returns the ListOpts with validator set.
762755
func (opts *ListOpts) WithValidator(validator ValidatorFctType) *ListOpts {
	opts.validator = validator
	return opts
}
121880
func (o *PutTemplatesLibraryIdentifierParams) WithIdentifier(identifier string) *PutTemplatesLibraryIdentifierParams {
	o.Identifier = identifier
	return o
}
1339329
func WithLemmatizer(l lingo.Lemmatizer) ConsOpt {
	fn := func(p *Tagger) {
		p.Lemmatizer = l
	}
	return fn
}
1198193
func (instanceApi *InstanceApi) ListWithOptions(options map[string]string) ([]Instance, error) {
	data, err := instanceApi.entityService.List(options)
	if err != nil {
		return nil, err
	}
	return parseInstanceList(data), nil
}
862381
func WithLogger(ctx context.Context, l Logger) context.Context {
	return context.WithValue(ctx, loggerKey, l)
}
812744
func (k *kubernetesClient) ConstraintsValidator(ctx context.ProviderCallContext) (constraints.Validator, error) {
	validator := constraints.NewValidator()
	validator.RegisterUnsupported(unsupportedConstraints)
	return validator, nil
}
1164747
func (o *DeleteNodesIdentifierTagsTagnameParams) WithIdentifier(identifier string) *DeleteNodesIdentifierTagsTagnameParams {
	o.Identifier = identifier
	return o
}
201841
func ComposeValidators(validators ...Validator) Validator {
	// return a validator that calls each one sequentially
	return func(val interface{}) error {
		// execute each validator
		for _, validator := range validators {
			// if the answer's value is not valid
			if err := validator(val); err != nil {
				// return the error
				return err
			}
		}
		// we passed all validators, the answer is valid
		return nil
	}
}
466949
func NewValidator() *Validator {
	v := &Validator{}
	v.SetTag("validate")
	v.SetValidationFunc("req", ReqValidator)
	v.SetValidationFunc("d", DefaultValidator)
	v.SetValidationFunc("min", MinValidator)
	v.SetValidationFunc("max", MaxValidator)
	v.SetValidationFunc("minLen", MinLenValidator)
	v.SetValidationFunc("maxLen", MaxLenValidator)
	v.SetValidationFunc("email", EmailValidator)
	v.SetValidationFunc("enum", EnumValidator)
	v.SetValidationFunc("regexp", RegExpValidator)
	return v
}
329981
func IntegerValidator(input string) (interface{}, error) {
	if input == "" {
		return nil, nil
	}

	i, err := strconv.Atoi(input)
	if err != nil {
		return nil, err
	}

	return i, nil
}
199385
func (res *Resource) AddValidator(validator *Validator) {
	for idx, v := range res.Validators {
		if v.Name == validator.Name {
			res.Validators[idx] = validator
			return
		}
	}

	res.Validators = append(res.Validators, validator)
}
1278565
func (c *Config) WithLogger(logger log.Logger) *Config {
	c.Logger = logger
	return c
}
479454
func (vpcApi *VpcApi) ListWithOptions(options map[string]string) ([]Vpc, error) {
	data, err := vpcApi.entityService.List(options)
	if err != nil {
		return nil, err
	}
	return parseVpcList(data), nil
}
1061063
func MinValidator(param string, v reflect.Value) (ValidationResult, error) {
	switch v.Kind() {
	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
		pInt, err := strconv.ParseInt(param, 0, 64)
		if err != nil {
			return 0, ErrInvalidConfigValue
		}
		if v.Int() < pInt {
			return ValidationNG, nil
		}
	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
		pUint, err := strconv.ParseUint(param, 0, 64)
		if err != nil {
			return 0, ErrInvalidConfigValue
		}
		if v.Uint() < pUint {
			return ValidationNG, nil
		}
	case reflect.Float32, reflect.Float64:
		pFloat, err := strconv.ParseFloat(param, 64)
		if err != nil {
			return 0, ErrInvalidConfigValue
		}
		if v.Float() < pFloat {
			return ValidationNG, nil
		}
	default:
		return 0, ErrValidateUnsupportedType
	}

	return ValidationOK, nil
}
761013
func WithLogger(ctx context.Context, logger Logger) context.Context {
	return context.WithValue(ctx, loggerKey{}, logger)
}
757277
func (o *GetNodesIdentifierCatalogsParams) WithIdentifier(identifier string) *GetNodesIdentifierCatalogsParams {
	o.Identifier = identifier
	return o
}
238258
func WithExpirationProvider(expirationProvider ExpirationProvider, expiryType ExpirationType) options.Opt {
	return func(p options.Params) {
		logger.Debug("Checking expirationProviderSetter")
		if setter, ok := p.(expirationProviderSetter); ok {
			setter.SetExpirationProvider(expirationProvider, expiryType)
		}
	}
}