// Validate sets a validation function to run when parsing.
970472
func (a *Application) Validate(validator ApplicationValidator) *Application {
	a.validator = validator
	return a
}
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
}
319457
func (s *Source) Validate() error {
	if s.Source == "" {
		return errors.New(ErrValidation, errorMessages, "item source must not be empty")
	}
	if _, err := url.Parse(s.URL); err != nil {
		return errors.Annotate(err, ErrParsing, errorMessages, "item source URL")
	}
	return nil
}
773072
func (c Class) Validate(r strfmt.Registry) error {
	return c.Label().Validate(r)
}
1347024
func (v *validator) Validate(cons Value) ([]string, error) {
	unsupported := v.checkUnsupported(cons)
	if err := v.checkConflicts(cons); err != nil {
		return unsupported, err
	}
	if err := v.checkValidValues(cons); err != nil {
		return unsupported, err
	}
	return unsupported, nil
}
521580
func (p *Browser) Validate() error {
	if p == nil {
		return ErrIncomplete
	}

	// must have both a title and body. action and url-args are optional.
	if len(p.Alert.Title) == 0 || len(p.Alert.Body) == 0 {
		return ErrIncomplete
	}
	return nil
}
555350
func (list List) Validate(r *http.Request, response bool) *Error {
	for _, object := range list {
		err := object.Validate(r, response)
		if err != nil {
			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
}
556336
func (c Code) Validate(_ interface{}) error {
	if codeRegex.Match([]byte(c)) {
		return nil
	}

	return errInvalidCode
}
304226
func (c *errorCommand) validate() (string, error) {

	if c.curlen > 256+6 {
		return "", fmt.Errorf("invalid ERROR length %d", c.curlen)
	}
	if c.curlen < 7 {
		return "", fmt.Errorf("invalid ERROR length %d", c.curlen)
	}

	srcHeader := c.buf[:6]
	srcReasonSize := c.buf[6:7]
	srcReason := c.buf[7:c.curlen]

	/* Validate the header. */
	if bytes.Compare(srcHeader, []byte{5, 'E', 'R', 'R', 'O', 'R'}) != 0 {
		return "", fmt.Errorf("malformed ERROR header")
	}

	reasonSize := uint8(srcReasonSize[0])
	if int(reasonSize) != len(srcReason) {
		return "", fmt.Errorf("unexpected length for the reason: %d != %d", reasonSize, len(srcReason))
	}

	reason := string(srcReason)

	return reason, nil
}
327475
func (e *RequiredValidator) Validate(s interface{}) error {
	if e.TagName == "" {
		e.TagName = "required"
	}

	if e.TagValue == "" {
		e.TagValue = "true"
	}

	for _, field := range structs.Fields(s) {
		if err := e.processField("", field); err != nil {
			return err
		}
	}

	return nil
}
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
}
893029
func (c *ChannelsRenameCall) Validate(validate bool) *ChannelsRenameCall {
	c.validate = validate
	return c
}
983045
func (o *Options) Validate(args []string) error {
	if len(args) != 0 {
		return errors.New("no arguments are supported")
	}
	if errs := validation.Validate(o.config); len(errs) != 0 {
		return errs.ToAggregate()
	}

	return nil
}
434912
func (c *GroupsRenameCall) Validate(validate bool) *GroupsRenameCall {
	c.validate = validate
	return c
}
721218
func Validate(validators ...Validator) error {
	for _, validator := range validators {
		if err := validator.Validate(); err != nil {
			return err
		}
	}

	return nil
}
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
}