// Validate checks if a feed category is valid.
16461
func (c *Category) Validate() error {
	if c.Term == "" {
		return errors.New(ErrValidation, errorMessages, "feed category term must not be empty")
	}
	if c.Scheme != "" {
		if _, err := url.Parse(c.Scheme); err != nil {
			return errors.Annotate(err, ErrValidation, errorMessages, "feed category scheme is not parsable")
		}
	}
	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
}
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
}
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
}
1358484
func Validate(m []Validation) error {
	for _, item := range m {
		v := reflect.ValueOf(item.TargetValue)
		for _, constraint := range item.Constraints {
			var err error
			switch v.Kind() {
			case reflect.Ptr:
				err = validatePtr(v, constraint)
			case reflect.String:
				err = validateString(v, constraint)
			case reflect.Struct:
				err = validateStruct(v, constraint)
			case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
				err = validateInt(v, constraint)
			case reflect.Float32, reflect.Float64:
				err = validateFloat(v, constraint)
			case reflect.Array, reflect.Slice, reflect.Map:
				err = validateArrayMap(v, constraint)
			default:
				err = createError(v, constraint, fmt.Sprintf("unknown type %v", v.Kind()))
			}

			if err != nil {
				return err
			}
		}
	}
	return nil
}
239082
func (o AggregatorOptions) Validate(args []string) error {
	errors := []error{}
	errors = append(errors, o.RecommendedOptions.Validate()...)
	errors = append(errors, o.APIEnablement.Validate(aggregatorscheme.Scheme)...)
	return utilerrors.NewAggregate(errors)
}
1286482
func (b *BoolRule) Validate(cv ctypes.ConfigValue) error {
	// Check that type is correct
	if cv.Type() != BoolType {
		return wrongType(b.key, cv.Type(), BoolType)
	}
	return nil
}
2325
func Validate(label string) error {
	if strings.Contains(label, "z") && strings.Contains(label, "Z") {
		return ErrIncompatibleLabel
	}
	return nil
}
965079
func (s *XPackWatcherAckWatchService) Validate() error {
	var invalid []string
	if s.watchId == "" {
		invalid = append(invalid, "WatchId")
	}
	if len(invalid) > 0 {
		return fmt.Errorf("missing required fields: %v", invalid)
	}
	return nil
}
274143
func (a *AMQPArgs) Validate() error {
	if !a.Enable {
		return nil
	}
	if _, err := amqp.ParseURI(a.URL.String()); err != nil {
		return err
	}
	return nil
}
1203349
func (v *ListMultipartInput) Validate() error {

	if v.UploadID == nil {
		return errors.ParameterRequiredError{
			ParameterName: "UploadID",
			ParentName:    "ListMultipartInput",
		}
	}

	return nil
}
419344
func (m *Mark) Validate(formats strfmt.Registry) error {
	var res []error

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

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
99413
func (l *Link) Validate() error {
	if _, err := url.Parse(l.HRef); err != nil {
		return errors.Annotate(err, ErrValidation, errorMessages, "feed link href is not parsable")
	}
	switch l.Rel {
	case "", AlternateRel, EnclosureRel, RelatedRel, SelfRel, ViaRel:
		// OK.
	default:
		if _, err := url.Parse(l.Rel); err != nil {
			return errors.Annotate(err, ErrValidation, errorMessages, "feed link rel is neither predefined nor parsable")
		}
	}
	return nil
}
665389
func (m *MetricBatch) validate() error {
	charmURL, err := charm.ParseURL(m.doc.CharmURL)
	if err != nil {
		return errors.Trace(err)
	}
	chrm, err := m.st.Charm(charmURL)
	if err != nil {
		return errors.Trace(err)
	}
	chrmMetrics := chrm.Metrics()
	if chrmMetrics == nil {
		return errors.Errorf("charm doesn't implement metrics")
	}
	for _, m := range m.doc.Metrics {
		if err := chrmMetrics.ValidateMetric(m.Key, m.Value); err != nil {
			return errors.Trace(err)
		}
	}
	return nil
}
173920
func (c Channel) Validate() error {
	if c.Title == "" {
		return errors.New(ErrValidation, errorMessages, "channel title must not be empty")
	}
	if c.Description == "" {
		return errors.New(ErrValidation, errorMessages, "channel description must not be empty")
	}
	if c.Link == "" {
		return errors.New(ErrValidation, errorMessages, "channel link must not be empty")
	}
	if _, err := url.Parse(c.Link); err != nil {
		return errors.Annotate(err, ErrParsing, errorMessages, "channel link")
	}
	for _, category := range c.Categories {
		if err := category.Validate(); err != nil {
			return err
		}
	}
	if c.Cloud != nil {
		if err := c.Cloud.Validate(); err != nil {
			return err
		}
	}
	if c.Docs != "" && c.Docs != "http://blogs.law.harvard.edu/tech/rss" {
		return errors.New(ErrValidation, errorMessages, "docs %q is not valid", c.Docs)
	}
	if c.Image != nil {
		if err := c.Image.Validate(); err != nil {
			return err
		}
	}
	if c.Language != "" {
		// TODO(mue) Language has to be validated.
	}
	if c.LastBuildDate != "" {
		if _, err := ParseTime(c.LastBuildDate); err != nil {
			return errors.Annotate(err, ErrParsing, errorMessages, "channel last build date")
		}
	}
	if c.PubDate != "" {
		if _, err := ParseTime(c.PubDate); err != nil {
			return errors.Annotate(err, ErrParsing, errorMessages, "channel publication date")
		}
	}
	if c.SkipDays != nil {
		if err := c.SkipDays.Validate(); err != nil {
			return err
		}
	}
	if c.SkipHours != nil {
		if err := c.SkipHours.Validate(); err != nil {
			return err
		}
	}
	if c.TTL < 0 {
		return errors.New(ErrValidation, errorMessages, "channel ttl is below zero")
	}
	for _, item := range c.Items {
		if err := item.Validate(); err != nil {
			return err
		}
	}
	return nil
}
351004
func (*BytesSchema) Validate(v reflect.Value) bool {
	v = dereference(v)

	return v.Kind() == reflect.Slice && v.Type().Elem().Kind() == reflect.Uint8
}
360416
func (v *ImageProcessInput) Validate() error {

	if v.Action == nil {
		return errors.ParameterRequiredError{
			ParameterName: "Action",
			ParentName:    "ImageProcessInput",
		}
	}

	return nil
}