// Validate checks the field values on Trigger with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
771080
func (m *Trigger) Validate() error {
	if m == nil {
		return nil
	}

	if len(m.GetName()) < 1 {
		return TriggerValidationError{
			field:  "Name",
			reason: "value length must be at least 1 bytes",
		}
	}

	switch m.TriggerOneof.(type) {

	case *Trigger_Threshold:

		{
			tmp := m.GetThreshold()

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

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

	default:
		return TriggerValidationError{
			field:  "TriggerOneof",
			reason: "value is required",
		}

	}

	return nil
}
73759
func (nc NotConstraint) Validate(v interface{}) (err error) {
	if pdebug.Enabled {
		g := pdebug.Marker("NotConstraint.Validate").BindError(&err)
		defer g.End()
	}

	if nc.child == nil {
		return errors.New("'not' constraint does not have a child constraint")
	}

	if err := nc.child.Validate(v); err == nil {
		return errors.New("'not' validation failed")
	}
	return nil
}
710315
func (m *StreamTracesMessage_Identifier) Validate() error {
	if m == nil {
		return nil
	}

	if m.GetNode() == nil {
		return StreamTracesMessage_IdentifierValidationError{
			field:  "Node",
			reason: "value is required",
		}
	}

	{
		tmp := m.GetNode()

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

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

	return nil
}
1189031
func (val AnnotationValue) Validate(_ interface{}) error {
	if annotationValueRegex.Match([]byte(val)) {
		return nil
	}

	return errInvalidAnnotationValue
}
721218
func Validate(validators ...Validator) error {
	for _, validator := range validators {
		if err := validator.Validate(); err != nil {
			return err
		}
	}

	return nil
}
70328
func (m *Body) Validate() error {
	if m == nil {
		return nil
	}

	// no validation rules for Truncated

	switch m.BodyType.(type) {

	case *Body_AsBytes:
		// no validation rules for AsBytes

	case *Body_AsString:
		// no validation rules for AsString

	}

	return nil
}
318665
func (s *MapSchema) Validate(v reflect.Value) bool {
	v = dereference(v)

	return v.Kind() == reflect.Map && v.Type().Key().Kind() == reflect.String
}
795560
func (c *AllConstraint) Validate(v interface{}) (err error) {
	if pdebug.Enabled {
		g := pdebug.Marker("AllConstraint.Validate").BindError(&err)
		defer g.End()
	}

	for _, celem := range c.constraints {
		if err := celem.Validate(v); err != nil {
			return err
		}
	}
	return nil
}
396409
func (r *DateRule) Validate(value interface{}) error {
	value, isNil := Indirect(value)
	if isNil || IsEmpty(value) {
		return nil
	}

	str, err := EnsureString(value)
	if err != nil {
		return err
	}

	date, err := time.Parse(r.layout, str)
	if err != nil {
		return errors.New(r.message)
	}

	if !r.min.IsZero() && r.min.After(date) || !r.max.IsZero() && date.After(r.max) {
		return errors.New(r.rangeMessage)
	}

	return nil
}
801219
func (p *ParamValidator) Validate(data interface{}) *Result {
	result := new(Result)
	tpe := reflect.TypeOf(data)
	kind := tpe.Kind()

	// TODO: validate type
	for _, validator := range p.validators {
		if validator.Applies(p.param, kind) {
			if err := validator.Validate(data); err != nil {
				result.Merge(err)
				if err.HasErrors() {
					return result
				}
			}
		}
	}
	return nil
}
432111
func (ex *exampleValidator) Validate() (errs *Result) {
	errs = new(Result)
	if ex == nil || ex.SpecValidator == nil {
		return errs
	}
	ex.resetVisited()
	errs.Merge(ex.validateExampleValueValidAgainstSchema()) // error -

	return errs
}
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
}
498504
func Validate(v string, ctx *Context) error {
	return (&I{Value: v}).Validate(ctx)
}
14229
func (m Reason) Validate(formats strfmt.Registry) error {
	var res []error

	// value enum
	if err := m.validateReasonEnum("", "body", m); err != nil {
		return err
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
993062
func (c *EnumConstraint) Validate(v interface{}) (err error) {
	if pdebug.Enabled {
		g := pdebug.Marker("EnumConstraint.Validate (%s)", v).BindError(&err)
		defer g.End()
	}
	for _, e := range c.enums {
		if e == v {
			return nil
		}
	}
	return errors.New("value is not in enumeration")
}
1059662
func (c *Config) Validate() error {
	for format := range c.Overrides {
		if _, err := Get(format); err != nil {
			return err
		}
	}
	return nil
}
849694
func (i *I) Validate(ctx *Context) error {
	_, err := i.template(ctx)
	return err
}