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

	if _, ok := Cluster_LbSubsetConfig_LbSubsetFallbackPolicy_name[int32(m.GetFallbackPolicy())]; !ok {
		return Cluster_LbSubsetConfigValidationError{
			field:  "FallbackPolicy",
			reason: "value must be one of the defined enum values",
		}
	}

	{
		tmp := m.GetDefaultSubset()

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

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

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

		{
			tmp := item

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

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

	}

	// no validation rules for LocalityWeightAware

	// no validation rules for ScaleLocalityWeight

	// no validation rules for PanicModeAny

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

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

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

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

	if wrapper := m.GetChoiceCount(); wrapper != nil {

		if wrapper.GetValue() < 2 {
			return Cluster_LeastRequestLbConfigValidationError{
				field:  "ChoiceCount",
				reason: "value must be greater than or equal to 2",
			}
		}

	}

	return nil
}
1076141
func (c *WorkerConfig) Validate() error {
	if c.Origin == "" {
		return errors.NotValidf("missing origin")
	}
	if c.Hub == nil {
		return errors.NotValidf("missing hub")
	}
	if c.Recorder == nil {
		return errors.NotValidf("missing recorder")
	}
	if c.Logger == nil {
		return errors.NotValidf("missing logger")
	}
	return nil
}
626824
func (c Config) Validate() error {
	if c.Name == "" {
		return errors.NotValidf("empty Name")
	}
	if string(c.ContainerType) == "" {
		return errors.NotValidf("empty ContainerType")
	}
	if c.APICaller == nil {
		return errors.NotValidf("nil APICaller")
	}
	if c.AgentConfig == nil {
		return errors.NotValidf("nil AgentConfig")
	}
	if c.MachineTag.Id() == "" {
		return errors.NotValidf("empty MachineTag")
	}
	if c.MachineLock == nil {
		return errors.NotValidf("nil MachineLock")
	}
	if c.GetNetConfig == nil {
		return errors.NotValidf("nil GetNetConfig")
	}
	return nil
}
396635
func (m *Cluster) Validate() error {
	if m == nil {
		return nil
	}

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

	// no validation rules for AltStatName

	{
		tmp := m.GetEdsClusterConfig()

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

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

	if true {
		dur := m.GetConnectTimeout()

		gt := time.Duration(0*time.Second + 0*time.Nanosecond)

		if dur <= gt {
			return ClusterValidationError{
				field:  "ConnectTimeout",
				reason: "value must be greater than 0s",
			}
		}

	}

	{
		tmp := m.GetPerConnectionBufferLimitBytes()

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

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

	if _, ok := Cluster_LbPolicy_name[int32(m.GetLbPolicy())]; !ok {
		return ClusterValidationError{
			field:  "LbPolicy",
			reason: "value must be one of the defined enum values",
		}
	}

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

		{
			tmp := item

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

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

	}

	{
		tmp := m.GetLoadAssignment()

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

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

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

		{
			tmp := item

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

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

	}

	{
		tmp := m.GetMaxRequestsPerConnection()

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

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

	{
		tmp := m.GetCircuitBreakers()

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

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

	{
		tmp := m.GetTlsContext()

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

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

	{
		tmp := m.GetCommonHttpProtocolOptions()

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

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

	{
		tmp := m.GetHttpProtocolOptions()

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

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

	{
		tmp := m.GetHttp2ProtocolOptions()

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

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

	// no validation rules for ExtensionProtocolOptions

	// no validation rules for TypedExtensionProtocolOptions

	if d := m.GetDnsRefreshRate(); d != nil {
		dur := *d

		gt := time.Duration(0*time.Second + 0*time.Nanosecond)

		if dur <= gt {
			return ClusterValidationError{
				field:  "DnsRefreshRate",
				reason: "value must be greater than 0s",
			}
		}

	}

	if _, ok := Cluster_DnsLookupFamily_name[int32(m.GetDnsLookupFamily())]; !ok {
		return ClusterValidationError{
			field:  "DnsLookupFamily",
			reason: "value must be one of the defined enum values",
		}
	}

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

		{
			tmp := item

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

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

	}

	{
		tmp := m.GetOutlierDetection()

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

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

	if d := m.GetCleanupInterval(); d != nil {
		dur := *d

		gt := time.Duration(0*time.Second + 0*time.Nanosecond)

		if dur <= gt {
			return ClusterValidationError{
				field:  "CleanupInterval",
				reason: "value must be greater than 0s",
			}
		}

	}

	{
		tmp := m.GetUpstreamBindConfig()

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

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

	{
		tmp := m.GetLbSubsetConfig()

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

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

	{
		tmp := m.GetCommonLbConfig()

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

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

	{
		tmp := m.GetTransportSocket()

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

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

	{
		tmp := m.GetMetadata()

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

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

	// no validation rules for ProtocolSelection

	{
		tmp := m.GetUpstreamConnectionOptions()

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

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

	// no validation rules for CloseConnectionsOnHostHealthFailure

	// no validation rules for DrainConnectionsOnHostRemoval

	switch m.ClusterDiscoveryType.(type) {

	case *Cluster_Type:

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

	case *Cluster_ClusterType:

		{
			tmp := m.GetClusterType()

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

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

	}

	switch m.LbConfig.(type) {

	case *Cluster_RingHashLbConfig_:

		{
			tmp := m.GetRingHashLbConfig()

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

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

	case *Cluster_OriginalDstLbConfig_:

		{
			tmp := m.GetOriginalDstLbConfig()

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

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

	case *Cluster_LeastRequestLbConfig_:

		{
			tmp := m.GetLeastRequestLbConfig()

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

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

	}

	return nil
}
812754
func (c Config) Validate() error {
	if c.GetCollection == nil {
		return errors.NotValidf("nil GetCollection")
	}
	if c.GetStorage == nil {
		return errors.NotValidf("nil GetStorage")
	}
	return nil
}
312190
func (c *Config) Validate() error {
	if err := c.validateTemplates(); err != nil {
		return err
	}

	return nil
}
255728
func (m *ClusterStatus) Validate() error {
	if m == nil {
		return nil
	}

	// no validation rules for Name

	// no validation rules for AddedViaApi

	{
		tmp := m.GetSuccessRateEjectionThreshold()

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

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

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

		{
			tmp := item

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

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

	}

	return nil
}
339049
func (config Config) Validate() error {
	if config.AgentName == "" {
		return errors.NotValidf("empty AgentName")
	}
	if config.TLSConfig == nil {
		return errors.NotValidf("nil TLSConfig")
	}
	if config.Mux == nil {
		return errors.NotValidf("nil Mux")
	}
	if config.PrometheusRegisterer == nil {
		return errors.NotValidf("nil PrometheusRegisterer")
	}
	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
}
854927
func (m *ClusterLoadAssignment_Policy_DropOverload) Validate() error {
	if m == nil {
		return nil
	}

	if len(m.GetCategory()) < 1 {
		return ClusterLoadAssignment_Policy_DropOverloadValidationError{
			field:  "Category",
			reason: "value length must be at least 1 bytes",
		}
	}

	{
		tmp := m.GetDropPercentage()

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

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

	return nil
}
82615
func (config ManifoldConfig) Validate() error {
	if config.ClockName == "" {
		return errors.NotValidf("empty ClockName")
	}
	if config.AgentName == "" {
		return errors.NotValidf("empty AgentName")
	}
	if config.TransportName == "" {
		return errors.NotValidf("empty TransportName")
	}
	if config.FSM == nil {
		return errors.NotValidf("nil FSM")
	}
	if config.Logger == nil {
		return errors.NotValidf("nil Logger")
	}
	if config.NewWorker == nil {
		return errors.NotValidf("nil NewWorker")
	}
	return nil
}
116947
func (m *ClusterHealthCheck) Validate() error {
	if m == nil {
		return nil
	}

	// no validation rules for ClusterName

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

		{
			tmp := item

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

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

	}

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

		{
			tmp := item

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

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

	}

	return nil
}
51421
func (c *OpenshiftAPIExtraConfig) Validate() error {
	ret := []error{}

	if c.KubeInformers == nil {
		ret = append(ret, fmt.Errorf("KubeInformers is required"))
	}
	if c.QuotaInformers == nil {
		ret = append(ret, fmt.Errorf("QuotaInformers is required"))
	}
	if c.SecurityInformers == nil {
		ret = append(ret, fmt.Errorf("SecurityInformers is required"))
	}
	if c.RuleResolver == nil {
		ret = append(ret, fmt.Errorf("RuleResolver is required"))
	}
	if c.SubjectLocator == nil {
		ret = append(ret, fmt.Errorf("SubjectLocator is required"))
	}
	if c.RegistryHostnameRetriever == nil {
		ret = append(ret, fmt.Errorf("RegistryHostnameRetriever is required"))
	}
	if c.RouteAllocator == nil {
		ret = append(ret, fmt.Errorf("RouteAllocator is required"))
	}
	if c.ProjectAuthorizationCache == nil {
		ret = append(ret, fmt.Errorf("ProjectAuthorizationCache is required"))
	}
	if c.ProjectCache == nil {
		ret = append(ret, fmt.Errorf("ProjectCache is required"))
	}
	if c.ClusterQuotaMappingController == nil {
		ret = append(ret, fmt.Errorf("ClusterQuotaMappingController is required"))
	}
	if c.RESTMapper == nil {
		ret = append(ret, fmt.Errorf("RESTMapper is required"))
	}

	return utilerrors.NewAggregate(ret)
}
329540
func (m *WeightedCluster_ClusterWeight) Validate() error {
	if m == nil {
		return nil
	}

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

	{
		tmp := m.GetWeight()

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

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

	{
		tmp := m.GetMetadataMatch()

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

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

	if len(m.GetRequestHeadersToAdd()) > 1000 {
		return WeightedCluster_ClusterWeightValidationError{
			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 WeightedCluster_ClusterWeightValidationError{
						field:  fmt.Sprintf("RequestHeadersToAdd[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	}

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

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

		{
			tmp := item

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

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

	}

	// no validation rules for PerFilterConfig

	// no validation rules for TypedPerFilterConfig

	return nil
}
1022276
func (s *ClusterRerouteService) Validate() error {
	if s.body == nil && len(s.commands) == 0 {
		return errors.New("missing allocate commands or raw body")
	}
	return nil
}