// Validate cycles through raw data and validate conversions in
// the schema, so we don't get an error/panic later when
// trying to get data out.  Data not in the schema is not
// an error at this point, so we don't worry about it.
493332
func (d *FieldData) Validate() error {
	for field, value := range d.Raw {

		schema, ok := d.Schema[field]
		if !ok {
			continue
		}

		switch schema.Type {
		case TypeBool, TypeInt, TypeMap, TypeDurationSecond, TypeString, TypeLowerCaseString,
			TypeNameString, TypeSlice, TypeStringSlice, TypeCommaStringSlice,
			TypeKVPairs, TypeCommaIntSlice, TypeHeader:
			_, _, err := d.getPrimitive(field, schema)
			if err != nil {
				return errwrap.Wrapf(fmt.Sprintf("error converting input %v for field %q: {{err}}", value, field), err)
			}
		default:
			return fmt.Errorf("unknown field type %q for field %q", schema.Type, field)
		}
	}

	return nil
}
723508
func (*BooleanSchema) Validate(v reflect.Value) bool {
	return dereference(v).Kind() == reflect.Bool
}
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
}
467189
func (*IntSchema) Validate(v reflect.Value) bool {
	return reflect.TypeOf(dereference(v).Interface()).Kind() == reflect.Int32
}
498504
func Validate(v string, ctx *Context) error {
	return (&I{Value: v}).Validate(ctx)
}
773072
func (c Class) Validate(r strfmt.Registry) error {
	return c.Label().Validate(r)
}
968240
func Validate(ls JSONLoader, ld JSONLoader) (*Result, error) {
	// load schema
	schema, err := NewSchema(ls)
	if err != nil {
		return nil, err
	}
	return schema.Validate(ld)
}
916109
func (self *Resource) Validate() error {
	if self.Type == "" {
		return fmt.Errorf("Resource.type is missing but is a required field")
	} else {
		val := Validate(RdlSchema(), "TypeRef", self.Type)
		if !val.Valid {
			return fmt.Errorf("Resource.type does not contain a valid TypeRef (%v)", val.Error)
		}
	}
	if self.Method == "" {
		return fmt.Errorf("Resource.method is missing but is a required field")
	} else {
		val := Validate(RdlSchema(), "String", self.Method)
		if !val.Valid {
			return fmt.Errorf("Resource.method does not contain a valid String (%v)", val.Error)
		}
	}
	if self.Path == "" {
		return fmt.Errorf("Resource.path is missing but is a required field")
	} else {
		val := Validate(RdlSchema(), "String", self.Path)
		if !val.Valid {
			return fmt.Errorf("Resource.path does not contain a valid String (%v)", val.Error)
		}
	}
	if self.Expected == "" {
		return fmt.Errorf("Resource.expected is missing but is a required field")
	} else {
		val := Validate(RdlSchema(), "String", self.Expected)
		if !val.Valid {
			return fmt.Errorf("Resource.expected does not contain a valid String (%v)", val.Error)
		}
	}
	return nil
}
379339
func (kf *KunstructuredFactoryImpl) validate(u unstructured.Unstructured) error {
	kind := u.GetKind()
	if kind == "" {
		return fmt.Errorf("missing kind in object %v", u)
	} else if strings.HasSuffix(kind, "List") {
		return nil
	}
	if u.GetName() == "" {
		return fmt.Errorf("missing metadata.name in object %v", u)
	}
	return nil
}
489855
func (m *Catalog) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
184092
func (m *meta) validate() error {
	if m.magic != magic {
		return ErrInvalid
	} else if m.version != version {
		return ErrVersionMismatch
	} else if m.checksum != 0 && m.checksum != m.sum64() {
		return ErrChecksum
	}
	return nil
}
852294
func (s *Service) Validate() error {
	if err := s.Service.Validate(renderer); err != nil {
		return errors.Trace(err)
	}

	if s.Service.Conf.Transient {
		return errors.NotSupportedf("transient services")
	}

	if s.Service.Conf.AfterStopped != "" {
		return errors.NotSupportedf("Conf.AfterStopped")
	}

	return 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
}
649828
func (self *ExceptionDef) Validate() error {
	if self.Type == "" {
		return fmt.Errorf("ExceptionDef.type is missing but is a required field")
	} else {
		val := Validate(RdlSchema(), "String", self.Type)
		if !val.Valid {
			return fmt.Errorf("ExceptionDef.type does not contain a valid String (%v)", val.Error)
		}
	}
	return nil
}
1210215
func (self *ResourceOutput) Validate() error {
	if self.Name == "" {
		return fmt.Errorf("ResourceOutput.name is missing but is a required field")
	} else {
		val := Validate(RdlSchema(), "Identifier", self.Name)
		if !val.Valid {
			return fmt.Errorf("ResourceOutput.name does not contain a valid Identifier (%v)", val.Error)
		}
	}
	if self.Type == "" {
		return fmt.Errorf("ResourceOutput.type is missing but is a required field")
	} else {
		val := Validate(RdlSchema(), "TypeRef", self.Type)
		if !val.Valid {
			return fmt.Errorf("ResourceOutput.type does not contain a valid TypeRef (%v)", val.Error)
		}
	}
	if self.Header == "" {
		return fmt.Errorf("ResourceOutput.header is missing but is a required field")
	} else {
		val := Validate(RdlSchema(), "String", self.Header)
		if !val.Valid {
			return fmt.Errorf("ResourceOutput.header does not contain a valid String (%v)", val.Error)
		}
	}
	return nil
}
1187577
func (e Error) Validate(v interface{}) error {
	if e.Message == "" {
		return fmt.Errorf("invalid error message %q", e.Message)
	}

	if e.Code <= 0 {
		return fmt.Errorf("invalid error code %d", e.Code)
	}

	return nil
}
556336
func (c Code) Validate(_ interface{}) error {
	if codeRegex.Match([]byte(c)) {
		return nil
	}

	return errInvalidCode
}