// Validate checks the field values on HealthCheck_CustomHealthCheck with the
// rules defined in the proto definition for this message. If any rules are
// violated, an error is returned.
557275
func (m *HealthCheck_CustomHealthCheck) Validate() error {
	if m == nil {
		return nil
	}

	if len(m.GetName()) < 1 {
		return HealthCheck_CustomHealthCheckValidationError{
			field:  "Name",
			reason: "value length must be at least 1 bytes",
		}
	}

	switch m.ConfigType.(type) {

	case *HealthCheck_CustomHealthCheck_Config:

		{
			tmp := m.GetConfig()

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return HealthCheck_CustomHealthCheckValidationError{
						field:  "Config",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	case *HealthCheck_CustomHealthCheck_TypedConfig:

		{
			tmp := m.GetTypedConfig()

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return HealthCheck_CustomHealthCheckValidationError{
						field:  "TypedConfig",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	}

	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
}
260821
func (m *ResponseFlags) Validate() error {
	if m == nil {
		return nil
	}

	// no validation rules for FailedLocalHealthcheck

	// no validation rules for NoHealthyUpstream

	// no validation rules for UpstreamRequestTimeout

	// no validation rules for LocalReset

	// no validation rules for UpstreamRemoteReset

	// no validation rules for UpstreamConnectionFailure

	// no validation rules for UpstreamConnectionTermination

	// no validation rules for UpstreamOverflow

	// no validation rules for NoRouteFound

	// no validation rules for DelayInjected

	// no validation rules for FaultInjected

	// no validation rules for RateLimited

	{
		tmp := m.GetUnauthorizedDetails()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return ResponseFlagsValidationError{
					field:  "UnauthorizedDetails",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	// no validation rules for RateLimitServiceError

	// no validation rules for DownstreamConnectionTermination

	// no validation rules for UpstreamRetryLimitExceeded

	// no validation rules for StreamIdleTimeout

	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
}
1150094
func (m *HealthCheck_HttpHealthCheck) Validate() error {
	if m == nil {
		return nil
	}

	// no validation rules for Host

	if len(m.GetPath()) < 1 {
		return HealthCheck_HttpHealthCheckValidationError{
			field:  "Path",
			reason: "value length must be at least 1 bytes",
		}
	}

	{
		tmp := m.GetSend()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return HealthCheck_HttpHealthCheckValidationError{
					field:  "Send",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	{
		tmp := m.GetReceive()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return HealthCheck_HttpHealthCheckValidationError{
					field:  "Receive",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	// no validation rules for ServiceName

	if len(m.GetRequestHeadersToAdd()) > 1000 {
		return HealthCheck_HttpHealthCheckValidationError{
			field:  "RequestHeadersToAdd",
			reason: "value must contain no more than 1000 item(s)",
		}
	}

	for idx, item := range m.GetRequestHeadersToAdd() {
		_, _ = idx, item

		{
			tmp := item

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return HealthCheck_HttpHealthCheckValidationError{
						field:  fmt.Sprintf("RequestHeadersToAdd[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	}

	// no validation rules for UseHttp2

	for idx, item := range m.GetExpectedStatuses() {
		_, _ = idx, item

		{
			tmp := item

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return HealthCheck_HttpHealthCheckValidationError{
						field:  fmt.Sprintf("ExpectedStatuses[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	}

	return nil
}
741198
func (a *APS) Validate() error {
	if a == nil {
		return ErrIncomplete
	}

	// must have a body or a badge (or custom data)
	if len(a.Alert.Body) == 0 && a.Badge == badge.Preserve {
		return ErrIncomplete
	}
	return nil
}
488733
func (m *HealthCheckEjectUnhealthy) Validate() error {
	if m == nil {
		return nil
	}

	if _, ok := HealthCheckFailureType_name[int32(m.GetFailureType())]; !ok {
		return HealthCheckEjectUnhealthyValidationError{
			field:  "FailureType",
			reason: "value must be one of the defined enum values",
		}
	}

	return nil
}
1366046
func (s *SnapshotCreateRepositoryService) Validate() error {
	var invalid []string
	if s.repository == "" {
		invalid = append(invalid, "Repository")
	}
	if s.bodyString == "" && s.bodyJson == nil && len(s.settings) == 0 {
		invalid = append(invalid, "BodyJson")
	}
	if len(invalid) > 0 {
		return fmt.Errorf("missing required fields: %v", invalid)
	}
	return nil
}
549930
func (m *RequirementRule) Validate() error {
	if m == nil {
		return nil
	}

	if m.GetMatch() == nil {
		return RequirementRuleValidationError{
			field:  "Match",
			reason: "value is required",
		}
	}

	{
		tmp := m.GetMatch()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return RequirementRuleValidationError{
					field:  "Match",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	{
		tmp := m.GetRequires()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return RequirementRuleValidationError{
					field:  "Requires",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	return nil
}
1091369
func (r *notNilRule) Validate(value interface{}) error {
	_, isNil := Indirect(value)
	if isNil {
		return errors.New(r.message)
	}
	return nil
}
193924
func (m *HealthCheckFailure) Validate() error {
	if m == nil {
		return nil
	}

	if _, ok := HealthCheckFailureType_name[int32(m.GetFailureType())]; !ok {
		return HealthCheckFailureValidationError{
			field:  "FailureType",
			reason: "value must be one of the defined enum values",
		}
	}

	// no validation rules for FirstCheck

	return nil
}
1189031
func (val AnnotationValue) Validate(_ interface{}) error {
	if annotationValueRegex.Match([]byte(val)) {
		return nil
	}

	return errInvalidAnnotationValue
}
542630
func (v *PutBucketNotificationInput) Validate() error {

	if len(v.Notifications) == 0 {
		return errors.ParameterRequiredError{
			ParameterName: "Notifications",
			ParentName:    "PutBucketNotificationInput",
		}
	}

	if len(v.Notifications) > 0 {
		for _, property := range v.Notifications {
			if err := property.Validate(); err != nil {
				return err
			}
		}
	}

	return nil
}
432111
func (ex *exampleValidator) Validate() (errs *Result) {
	errs = new(Result)
	if ex == nil || ex.SpecValidator == nil {
		return errs
	}
	ex.resetVisited()
	errs.Merge(ex.validateExampleValueValidAgainstSchema()) // error -

	return errs
}
226583
func (m *HealthCheckSpecifier) Validate() error {
	if m == nil {
		return nil
	}

	for idx, item := range m.GetClusterHealthChecks() {
		_, _ = idx, item

		{
			tmp := item

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return HealthCheckSpecifierValidationError{
						field:  fmt.Sprintf("ClusterHealthChecks[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	}

	{
		tmp := m.GetInterval()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return HealthCheckSpecifierValidationError{
					field:  "Interval",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	return nil
}
177470
func (m *HealthCheckEvent) Validate() error {
	if m == nil {
		return nil
	}

	if _, ok := HealthCheckerType_name[int32(m.GetHealthCheckerType())]; !ok {
		return HealthCheckEventValidationError{
			field:  "HealthCheckerType",
			reason: "value must be one of the defined enum values",
		}
	}

	{
		tmp := m.GetHost()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return HealthCheckEventValidationError{
					field:  "Host",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	if len(m.GetClusterName()) < 1 {
		return HealthCheckEventValidationError{
			field:  "ClusterName",
			reason: "value length must be at least 1 bytes",
		}
	}

	{
		tmp := m.GetTimestamp()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return HealthCheckEventValidationError{
					field:  "Timestamp",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	switch m.Event.(type) {

	case *HealthCheckEvent_EjectUnhealthyEvent:

		{
			tmp := m.GetEjectUnhealthyEvent()

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return HealthCheckEventValidationError{
						field:  "EjectUnhealthyEvent",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	case *HealthCheckEvent_AddHealthyEvent:

		{
			tmp := m.GetAddHealthyEvent()

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return HealthCheckEventValidationError{
						field:  "AddHealthyEvent",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	case *HealthCheckEvent_HealthCheckFailureEvent:

		{
			tmp := m.GetHealthCheckFailureEvent()

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return HealthCheckEventValidationError{
						field:  "HealthCheckFailureEvent",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	case *HealthCheckEvent_DegradedHealthyHost:

		{
			tmp := m.GetDegradedHealthyHost()

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return HealthCheckEventValidationError{
						field:  "DegradedHealthyHost",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	case *HealthCheckEvent_NoLongerDegradedHost:

		{
			tmp := m.GetNoLongerDegradedHost()

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return HealthCheckEventValidationError{
						field:  "NoLongerDegradedHost",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	default:
		return HealthCheckEventValidationError{
			field:  "Event",
			reason: "value is required",
		}

	}

	return nil
}
1059662
func (c *Config) Validate() error {
	for format := range c.Overrides {
		if _, err := Get(format); err != nil {
			return err
		}
	}
	return nil
}