// Validate ensures that all conditions have been met on every field in the
// populated struct. Validation should occur after the request has been
// deserialized into the struct.
779949
func Validate(req *http.Request, userStruct FieldMapper) error {
	err := validate(Errors{}, req, userStruct)
	if len(err) > 0 {
		return err
	}

	return nil
}
1051463
func (s *XPackSecurityPutRoleMappingService) Validate() error {
	var invalid []string
	if s.name == "" {
		invalid = append(invalid, "Name")
	}
	if s.body == nil {
		invalid = append(invalid, "Body")
	}
	if len(invalid) > 0 {
		return fmt.Errorf("missing required fields: %v", invalid)
	}
	return nil
}
670203
func (*FloatSchema) Validate(v reflect.Value) bool {
	return reflect.TypeOf(dereference(v).Interface()).Kind() == reflect.Float32
}
991174
func (v *Validator) Validate(i interface{}) error {
	value := reflects.Indirect(reflect.ValueOf(i))
	if value.Kind() != reflect.Struct {
		return errors.New("valid: target value must be a struct")
	}

	key := v.Tag
	if key == "" {
		key = Tag
	}
	ctx := &Context{messages: messages}
	sv := reflects.StructOf(value)
	return sv.VisitFields(func(fv reflect.Value, fi *reflect.StructField) error {
		rules, err := v.parseRules(fi.Tag.Get(key))
		if err != nil {
			return err
		}

		if len(rules) == 0 {
			fv = reflects.Indirect(fv)
			if fv.Kind() == reflect.Struct && fv.IsValid() {
				return v.Validate(fv.Interface())
			}
			return nil
		}

		ctx.Value, ctx.Info = fv, fi
		for name, info := range rules {
			if r := v.getRule(name); r != nil {
				if err = r(ctx, &info); err != nil {
					return &Error{Field: fi.Name, Rule: name, cause: err}
				}
			} else {
				return errors.New("unknown rule: " + name)
			}
		}
		return nil
	})
}
472783
func (m *Graphobject) Validate(formats strfmt.Registry) error {
	var res []error

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

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
787644
func (d *defaultValidator) Validate() (errs *Result) {
	errs = new(Result)
	if d == nil || d.SpecValidator == nil {
		return errs
	}
	d.resetVisited()
	errs.Merge(d.validateDefaultValueValidAgainstSchema()) // error -
	return errs
}
182811
func (val *Validation) Validate(checkers ...Checker) *Validation {

	for _, checker := range checkers {
		if pass, msg := checker(); !pass {
			if val == nil {
				val = &Validation{}
			}

			val.Errors = append(val.Errors, msg)
		}
	}

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

	return nil
}
807763
func (pTypeDef *SymTest) Validate() error {
	if pTypeDef.Symmap == nil {
		return fmt.Errorf("SymTest: Missing required field: symmap")
	}
	if pTypeDef.Symary == nil {
		return fmt.Errorf("SymTest: Missing required field: symary")
	}
	if pTypeDef.Sym == "" {
		return fmt.Errorf("SymTest: Missing required field: sym")
	}
	return nil
}
214094
func (templateStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList {
	return validation.ValidateTemplate(obj.(*templateapi.Template))
}
312190
func (c *Config) Validate() error {
	if err := c.validateTemplates(); err != nil {
		return err
	}

	return nil
}
621278
func (pTypeDef *StringTest) Validate() error {
	if pTypeDef.Name == "" {
		return fmt.Errorf("StringTest: Missing required field: name")
	}
	if pTypeDef.Parent == "" {
		return fmt.Errorf("StringTest: Missing required field: parent")
	}
	return nil
}
638746
func (e *Error) Validate(r *http.Request, response bool) *Error {

	switch {
	case e.Status == 0:
		return ISE(fmt.Sprintf("No HTTP Status set for error %+v\n", e))
	case e.Status < 400 || e.Status > 600:
		return ISE(fmt.Sprintf("HTTP Status out of valid range for error %+v\n", e))
	case e.Status == 422 && e.Source.Pointer == "":
		return ISE(fmt.Sprintf("Source Pointer must be set for 422 Status error"))
	}

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

	// This needs to be a slice
	return v.Kind() == reflect.Slice || v.Kind() == reflect.Array
}
377746
func (u User) Validate() error {
	if u.Login == "" {
		return NewValidationError(errors.New("invalid user login"))
	}
	if u.Email != "" {
		if _, err := mail.ParseAddress(u.Email); err != nil {
			return NewValidationError(err)
		}
	}

	return nil
}
140520
func (s *RecursiveSchema) Validate(v reflect.Value) bool {
	return s.Actual.Validate(v)
}
693906
func (v *Validator) Validate(h http.Handler) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		if err := v.ValidRequest(r); err != nil {
			http.Error(w, "", http.StatusUnauthorized)
			return
		}
		h.ServeHTTP(w, r)
	})
}