// Validate checks that the view definition is consistent: it has a  parent media type and the
// underlying definition type is consistent.
350757
func (v *ViewDefinition) Validate() *dslengine.ValidationErrors {
	verr := new(dslengine.ValidationErrors)
	if v.Parent == nil {
		verr.Add(v, "View must have a parent media type")
	}
	verr.Merge(v.AttributeDefinition.Validate("", v))
	return verr.AsError()
}
723508
func (*BooleanSchema) Validate(v reflect.Value) bool {
	return dereference(v).Kind() == reflect.Bool
}
498504
func Validate(v string, ctx *Context) error {
	return (&I{Value: v}).Validate(ctx)
}
467189
func (*IntSchema) Validate(v reflect.Value) bool {
	return reflect.TypeOf(dereference(v).Interface()).Kind() == reflect.Int32
}
116138
func (autoscalerStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList {
	autoscaler := obj.(*autoscaling.HorizontalPodAutoscaler)
	return validation.ValidateHorizontalPodAutoscaler(autoscaler)
}
756174
func (s SourceType) Validate(interface{}) error {
	switch s {
	case SourceDashboard, SourceCLI, SourceSystem, SourceProvider:
		return nil
	default:
		return manifold.NewError(errors.BadRequestError, fmt.Sprintf("invalid source type %q", s))
	}
}
116491
func (g MayuFlags) Validate() (bool, error) {
	if ok, err := g.ValidateHTTPCertificateUsage(); !ok {
		return ok, err
	}

	if ok, err := g.ValidateHTTPCertificateFileExistance(); !ok {
		return ok, err
	}

	return true, nil
}
670203
func (*FloatSchema) Validate(v reflect.Value) bool {
	return reflect.TypeOf(dereference(v).Interface()).Kind() == reflect.Float32
}
268047
func (imageStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList {
	image := obj.(*imageapi.Image)
	return validation.ValidateImage(image)
}
214736
func (c *addImageMetadataCommand) validate() error {
	if c.Series != "" {
		if _, err := series.SeriesVersion(c.Series); err != nil {
			return errors.Trace(err)
		}
	}
	return nil
}
945338
func (p *Type) Validate() error {
	if p.BaseType != nil {
		p.Variant = TypeVariantBaseType
	} else if p.StructTypeDef != nil {
		p.Variant = TypeVariantStructTypeDef
	} else if p.MapTypeDef != nil {
		p.Variant = TypeVariantMapTypeDef
	} else if p.ArrayTypeDef != nil {
		p.Variant = TypeVariantArrayTypeDef
	} else if p.EnumTypeDef != nil {
		p.Variant = TypeVariantEnumTypeDef
	} else if p.UnionTypeDef != nil {
		p.Variant = TypeVariantUnionTypeDef
	} else if p.StringTypeDef != nil {
		p.Variant = TypeVariantStringTypeDef
	} else if p.BytesTypeDef != nil {
		p.Variant = TypeVariantBytesTypeDef
	} else if p.NumberTypeDef != nil {
		p.Variant = TypeVariantNumberTypeDef
	} else if p.AliasTypeDef != nil {
		p.Variant = TypeVariantAliasTypeDef
	} else {
		return fmt.Errorf("Type: Missing required variant")
	}
	return nil
}
87078
func (s *UnionSchema) Validate(v reflect.Value) bool {
	v = dereference(v)
	for i := range s.Types {
		if t := s.Types[i]; t.Validate(v) {
			return true
		}
	}

	return false
}
488322
func (v *TransitionType) Validate() error {

	if v.StorageClass == nil {
		return errors.ParameterRequiredError{
			ParameterName: "StorageClass",
			ParentName:    "Transition",
		}
	}

	return nil
}
298594
func (m *FilterConfig) Validate() error {
	if m == nil {
		return nil
	}

	if len(m.GetContentType()) < 1 {
		return FilterConfigValidationError{
			field:  "ContentType",
			reason: "value length must be at least 1 bytes",
		}
	}

	// no validation rules for WithholdGrpcFrames

	return nil
}
20985
func (v *GranteeType) Validate() error {

	if v.Type == nil {
		return errors.ParameterRequiredError{
			ParameterName: "Type",
			ParentName:    "Grantee",
		}
	}

	if v.Type != nil {
		typeValidValues := []string{"user", "group"}
		typeParameterValue := fmt.Sprint(*v.Type)

		typeIsValid := false
		for _, value := range typeValidValues {
			if value == typeParameterValue {
				typeIsValid = true
			}
		}

		if !typeIsValid {
			return errors.ParameterValueNotAllowedError{
				ParameterName:  "Type",
				ParameterValue: typeParameterValue,
				AllowedValues:  typeValidValues,
			}
		}
	}

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