// Validate checks the field values on HealthCheckEvent with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
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
}
815458
func (m *ThresholdTrigger) Validate() error {
	if m == nil {
		return nil
	}

	if val := m.GetValue(); val < 0 || val > 1 {
		return ThresholdTriggerValidationError{
			field:  "Value",
			reason: "value must be inside range [0, 1]",
		}
	}

	return nil
}
759025
func (m *OutlierDetectionEvent) Validate() error {
	if m == nil {
		return nil
	}

	if _, ok := OutlierEjectionType_name[int32(m.GetType())]; !ok {
		return OutlierDetectionEventValidationError{
			field:  "Type",
			reason: "value must be one of the defined enum values",
		}
	}

	{
		tmp := m.GetTimestamp()

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

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

	{
		tmp := m.GetSecsSinceLastAction()

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

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

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

	if len(m.GetUpstreamUrl()) < 1 {
		return OutlierDetectionEventValidationError{
			field:  "UpstreamUrl",
			reason: "value length must be at least 1 bytes",
		}
	}

	if _, ok := Action_name[int32(m.GetAction())]; !ok {
		return OutlierDetectionEventValidationError{
			field:  "Action",
			reason: "value must be one of the defined enum values",
		}
	}

	// no validation rules for NumEjections

	// no validation rules for Enforced

	switch m.Event.(type) {

	case *OutlierDetectionEvent_EjectSuccessRateEvent:

		{
			tmp := m.GetEjectSuccessRateEvent()

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

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

	case *OutlierDetectionEvent_EjectConsecutiveEvent:

		{
			tmp := m.GetEjectConsecutiveEvent()

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

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

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

	}

	return nil
}
1266499
func (m *Listener_DeprecatedV1) Validate() error {
	if m == nil {
		return nil
	}

	{
		tmp := m.GetBindToPort()

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

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

	return nil
}
84174
func (m *StreamTracesMessage) Validate() error {
	if m == nil {
		return nil
	}

	{
		tmp := m.GetIdentifier()

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

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

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

		{
			tmp := item

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

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

	}

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

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

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
1039881
func (m *HealthCheck_Payload) Validate() error {
	if m == nil {
		return nil
	}

	switch m.Payload.(type) {

	case *HealthCheck_Payload_Text:

		if len(m.GetText()) < 1 {
			return HealthCheck_PayloadValidationError{
				field:  "Text",
				reason: "value length must be at least 1 bytes",
			}
		}

	case *HealthCheck_Payload_Binary:
		// no validation rules for Binary

	default:
		return HealthCheck_PayloadValidationError{
			field:  "Payload",
			reason: "value is required",
		}

	}

	return nil
}
1179809
func (c *Config) Validate() error {
	if c.SocketName == "" {
		return errors.NotValidf("empty SocketName")
	}
	if c.PrometheusGatherer == nil {
		return errors.NotValidf("nil PrometheusGatherer")
	}
	return nil
}
694222
func (m *NodeElement) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
1097301
func (c *GroupsCreateCall) Validate(validate bool) *GroupsCreateCall {
	c.validate = validate
	return c
}
834990
func Validate(validators ...Validator) *Errors {
	errors := NewErrors()

	wait.Wait(len(validators), func(index int) {
		validator := validators[index]
		validator.IsValid(errors)
	})

	return errors
}
742525
func (m *Matcher) Validate() error {
	if !m.Name.IsValid() {
		return fmt.Errorf("invalid name %q", m.Name)
	}
	if m.IsRegex {
		if _, err := regexp.Compile(m.Value); err != nil {
			return fmt.Errorf("invalid regular expression %q", m.Value)
		}
	} else if !LabelValue(m.Value).IsValid() || len(m.Value) == 0 {
		return fmt.Errorf("invalid value %q", m.Value)
	}
	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
}
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
}
1244512
func (m *EndpointHealth) Validate() error {
	if m == nil {
		return nil
	}

	{
		tmp := m.GetEndpoint()

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

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

	// no validation rules for HealthStatus

	return nil
}
666436
func (o *CiliumHealthAPI) Validate() error {
	var unregistered []string

	if o.JSONConsumer == nil {
		unregistered = append(unregistered, "JSONConsumer")
	}

	if o.JSONProducer == nil {
		unregistered = append(unregistered, "JSONProducer")
	}

	if o.GetHealthzHandler == nil {
		unregistered = append(unregistered, "GetHealthzHandler")
	}

	if o.GetHelloHandler == nil {
		unregistered = append(unregistered, "GetHelloHandler")
	}

	if o.ConnectivityGetStatusHandler == nil {
		unregistered = append(unregistered, "connectivity.GetStatusHandler")
	}

	if o.ConnectivityPutStatusProbeHandler == nil {
		unregistered = append(unregistered, "connectivity.PutStatusProbeHandler")
	}

	if len(unregistered) > 0 {
		return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", "))
	}

	return nil
}
232820
func Validate(validators ...Validatable) error {
	for i := range validators {
		if err := validators[i](); err != nil {
			return err
		}
	}
	return nil
}