// Validate returns an error if the mode is unrecognized.
161947
func (p ParanoidMode) Validate() error {
	switch p {
	case NotParanoid, CheckPresence, CheckIntegrity:
		return nil
	default:
		return fmt.Errorf("unrecognized paranoid mode %q", p)
	}
}
116138
func (autoscalerStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList {
	autoscaler := obj.(*autoscaling.HorizontalPodAutoscaler)
	return validation.ValidateHorizontalPodAutoscaler(autoscaler)
}
197553
func (config Config) Validate() error {
	if config.AgentConfig == nil {
		return errors.NotValidf("nil AgentConfig")
	}
	if config.Hub == nil {
		return errors.NotValidf("nil Hub")
	}
	if config.Logger == nil {
		return errors.NotValidf("nil Logger")
	}
	if config.UpdateControllerAPIPort == nil {
		return errors.NotValidf("nil UpdateControllerAPIPort")
	}
	return nil
}
878359
func (config Config) Validate() error {
	if config.FSM == nil {
		return errors.NotValidf("nil FSM")
	}
	if config.Logger == nil {
		return errors.NotValidf("nil Logger")
	}
	if config.StorageDir == "" {
		return errors.NotValidf("empty StorageDir")
	}
	if config.LocalID == "" {
		return errors.NotValidf("empty LocalID")
	}
	if config.SnapshotRetention < 0 {
		return errors.NotValidf("negative SnapshotRetention")
	}
	if config.Transport == nil {
		return errors.NotValidf("nil Transport")
	}
	if config.Clock == nil {
		return errors.NotValidf("nil Clock")
	}
	return nil
}
1076236
func (config Config) Validate() error {
	if config.Facade == nil {
		return errors.NotValidf("nil Facade")
	}
	return nil
}
352648
func (m *MethodMatch_ParameterMatchSpecifier) Validate() error {
	if m == nil {
		return nil
	}

	switch m.ParameterMatchSpecifier.(type) {

	case *MethodMatch_ParameterMatchSpecifier_ExactMatch:
		// no validation rules for ExactMatch

	case *MethodMatch_ParameterMatchSpecifier_RangeMatch:

		{
			tmp := m.GetRangeMatch()

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return MethodMatch_ParameterMatchSpecifierValidationError{
						field:  "RangeMatch",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	}

	return nil
}
834990
func Validate(validators ...Validator) *Errors {
	errors := NewErrors()

	wait.Wait(len(validators), func(index int) {
		validator := validators[index]
		validator.IsValid(errors)
	})

	return errors
}
847097
func (i Ident) Validate() error {
	if err := i.Location.Validate(); err != nil {
		return errors.Wrap(err, "invalid location")
	}
	if err := ValidateNamed(i.Variant, false); err != nil {
		return errors.Wrap(err, "invalid variant")
	}
	return nil
}
877010
func (c *Certificate) Validate() error {
	if len(c.CertPEM) == 0 {
		return errors.NotValidf("missing cert PEM")
	}
	if len(c.KeyPEM) == 0 {
		return errors.NotValidf("missing key PEM")
	}
	return nil
}
1173056
func (m *Service) Validate(formats strfmt.Registry) error {
	var res []error

	if err := m.validateSpec(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateStatus(formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
1166421
func (c Flags) Validate() error {
	var notFilled []string
	for _, v := range c {
		// if no value given (nil) for required flag then it is not valid
		isRequired := v.Default == nil
		val := reflect.ValueOf(v.Value).Elem().String()
		if isRequired && val == "" {
			notFilled = append(notFilled, v.Name)
		}
	}

	if len(notFilled) > 0 {
		if len(notFilled) == 1 {
			return errFlagMissing.Format(notFilled[0])
		}
		return errFlagMissing.Format(strings.Join(notFilled, ","))

	}
	return nil

}
211756
func (m *StringMatcher) Validate() error {
	if m == nil {
		return nil
	}

	switch m.MatchPattern.(type) {

	case *StringMatcher_Exact:
		// no validation rules for Exact

	case *StringMatcher_Prefix:

		if len(m.GetPrefix()) < 1 {
			return StringMatcherValidationError{
				field:  "Prefix",
				reason: "value length must be at least 1 bytes",
			}
		}

	case *StringMatcher_Suffix:

		if len(m.GetSuffix()) < 1 {
			return StringMatcherValidationError{
				field:  "Suffix",
				reason: "value length must be at least 1 bytes",
			}
		}

	case *StringMatcher_Regex:

		if len(m.GetRegex()) > 1024 {
			return StringMatcherValidationError{
				field:  "Regex",
				reason: "value length must be at most 1024 bytes",
			}
		}

	default:
		return StringMatcherValidationError{
			field:  "MatchPattern",
			reason: "value is required",
		}

	}

	return nil
}
489092
func (c *Config) Validate() error {
	if c.Facade == nil {
		return errors.New("missing Facade")
	}
	if c.Clock == nil {
		return errors.New("missing Clock")
	}
	return nil
}
1328661
func Validate(kind string, config Config) error {
	fn, ok := configurations[kind]
	if !ok {
		return errUnknownKind(kind)
	}
	return fn(config)
}
94352
func (m *StatusCodeFilter) Validate() error {
	if m == nil {
		return nil
	}

	if m.GetComparison() == nil {
		return StatusCodeFilterValidationError{
			field:  "Comparison",
			reason: "value is required",
		}
	}

	{
		tmp := m.GetComparison()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return StatusCodeFilterValidationError{
					field:  "Comparison",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	return nil
}
1164624
func (config Config) Validate() error {
	if config.Facade == nil {
		return errors.NotValidf("nil Facade")
	}
	if config.Entity == nil {
		return errors.NotValidf("nil Entity")
	}
	if config.Result == nil {
		return errors.NotValidf("nil Result")
	}
	return nil
}
870728
func (config FlagConfig) Validate() error {
	if config.Clock == nil {
		return errors.NotValidf("nil Clock")
	}
	if config.Facade == nil {
		return errors.NotValidf("nil Facade")
	}
	if config.Duration <= 0 {
		return errors.NotValidf("non-positive Duration")
	}
	return nil
}