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

	if m.GetHostSuccessRate() > 100 {
		return OutlierEjectSuccessRateValidationError{
			field:  "HostSuccessRate",
			reason: "value must be less than or equal to 100",
		}
	}

	if m.GetClusterAverageSuccessRate() > 100 {
		return OutlierEjectSuccessRateValidationError{
			field:  "ClusterAverageSuccessRate",
			reason: "value must be less than or equal to 100",
		}
	}

	if m.GetClusterSuccessRateEjectionThreshold() > 100 {
		return OutlierEjectSuccessRateValidationError{
			field:  "ClusterSuccessRateEjectionThreshold",
			reason: "value must be less than or equal to 100",
		}
	}

	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
}
1339707
func (mutatingWebhookConfigurationStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList {
	ic := obj.(*admissionregistration.MutatingWebhookConfiguration)
	return validation.ValidateMutatingWebhookConfiguration(ic)
}
232820
func Validate(validators ...Validatable) error {
	for i := range validators {
		if err := validators[i](); err != nil {
			return err
		}
	}
	return nil
}
480402
func (m *HttpService) Validate() error {
	if m == nil {
		return nil
	}

	{
		tmp := m.GetServerUri()

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

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

	// no validation rules for PathPrefix

	{
		tmp := m.GetAuthorizationRequest()

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

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

	{
		tmp := m.GetAuthorizationResponse()

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

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

	return nil
}
41999
func (m *BufferSettings) Validate() error {
	if m == nil {
		return nil
	}

	if m.GetMaxRequestBytes() <= 0 {
		return BufferSettingsValidationError{
			field:  "MaxRequestBytes",
			reason: "value must be greater than 0",
		}
	}

	// no validation rules for AllowPartialMessage

	return nil
}
305754
func (m *FractionalPercent) Validate() error {
	if m == nil {
		return nil
	}

	// no validation rules for Numerator

	if _, ok := FractionalPercent_DenominatorType_name[int32(m.GetDenominator())]; !ok {
		return FractionalPercentValidationError{
			field:  "Denominator",
			reason: "value must be one of the defined enum values",
		}
	}

	return nil
}
820462
func (s Spec) Validate() error {
	if s.Cancel == nil {
		if !s.NoCancel {
			return errors.NotValidf("missing Cancel")
		}
	}
	if s.Worker == "" {
		return errors.NotValidf("mssing Worker")
	}
	return nil
}
679258
func (m *StreamMetricsMessage_Identifier) Validate() error {
	if m == nil {
		return nil
	}

	if m.GetNode() == nil {
		return StreamMetricsMessage_IdentifierValidationError{
			field:  "Node",
			reason: "value is required",
		}
	}

	{
		tmp := m.GetNode()

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

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

	return nil
}
748054
func (o *RolloutStatusOptions) Validate() error {
	if len(o.BuilderArgs) == 0 && cmdutil.IsFilenameSliceEmpty(o.FilenameOptions.Filenames, o.FilenameOptions.Kustomize) {
		return fmt.Errorf("required resource not specified")
	}

	if o.Revision < 0 {
		return fmt.Errorf("revision must be a positive integer: %v", o.Revision)
	}

	return nil
}
441447
func (m *HTTPAccessLogEntry) Validate() error {
	if m == nil {
		return nil
	}

	{
		tmp := m.GetCommonProperties()

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

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

	// no validation rules for ProtocolVersion

	{
		tmp := m.GetRequest()

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

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

	{
		tmp := m.GetResponse()

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

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

	return nil
}
646359
func (m *RBAC) Validate() error {
	if m == nil {
		return nil
	}

	{
		tmp := m.GetRules()

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

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

	{
		tmp := m.GetShadowRules()

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

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

	return nil
}
1334581
func (v KnownServiceValue) Validate() error {
	switch v {
	case SSHRule, JujuControllerRule, JujuApplicationOfferRule:
		return nil
	}
	return errors.NotValidf("known service %q", v)
}
255384
func (c *MockSSHClient) Validate() error {
	if c.MockValidate != nil {
		return c.MockValidate()
	}
	return ErrNotImplemented
}
49653
func (m *RateLimitResponse_DescriptorStatus) Validate() error {
	if m == nil {
		return nil
	}

	// no validation rules for Code

	{
		tmp := m.GetCurrentLimit()

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

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

	// no validation rules for LimitRemaining

	return nil
}
1051844
func (r *ThresholdRule) Validate(value interface{}) error {
	value, isNil := Indirect(value)
	if isNil || IsEmpty(value) {
		return nil
	}

	rv := reflect.ValueOf(r.threshold)
	switch rv.Kind() {
	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
		v, err := ToInt(value)
		if err != nil {
			return err
		}
		if r.compareInt(rv.Int(), v) {
			return nil
		}

	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
		v, err := ToUint(value)
		if err != nil {
			return err
		}
		if r.compareUint(rv.Uint(), v) {
			return nil
		}

	case reflect.Float32, reflect.Float64:
		v, err := ToFloat(value)
		if err != nil {
			return err
		}
		if r.compareFloat(rv.Float(), v) {
			return nil
		}

	case reflect.Struct:
		t, ok := r.threshold.(time.Time)
		if !ok {
			return fmt.Errorf("type not supported: %v", rv.Type())
		}
		v, ok := value.(time.Time)
		if !ok {
			return fmt.Errorf("cannot convert %v to time.Time", reflect.TypeOf(value))
		}
		if v.IsZero() || r.compareTime(t, v) {
			return nil
		}

	default:
		return fmt.Errorf("type not supported: %v", rv.Type())
	}

	return errors.New(r.message)
}
1347508
func (m *HttpBufferedTrace) Validate() error {
	if m == nil {
		return nil
	}

	{
		tmp := m.GetRequest()

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

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

	{
		tmp := m.GetResponse()

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

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

	return nil
}