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

	{
		tmp := m.GetBootstrap()

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

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

	{
		tmp := m.GetLastUpdated()

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

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

	return nil
}
652643
func (m *RoutesConfigDump_DynamicRouteConfig) Validate() error {
	if m == nil {
		return nil
	}

	// no validation rules for VersionInfo

	{
		tmp := m.GetRouteConfig()

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

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

	{
		tmp := m.GetLastUpdated()

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

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

	return nil
}
925868
func (config Config) Validate() error {
	if config.State == nil {
		return errors.NotValidf("nil State")
	}
	if config.APIHostPortsSetter == nil {
		return errors.NotValidf("nil APIHostPortsSetter")
	}
	if config.MongoSession == nil {
		return errors.NotValidf("nil MongoSession")
	}
	if config.Clock == nil {
		return errors.NotValidf("nil Clock")
	}
	if config.Hub == nil {
		return errors.NotValidf("nil Hub")
	}
	if config.MongoPort <= 0 {
		return errors.NotValidf("non-positive MongoPort")
	}
	if config.APIPort <= 0 {
		return errors.NotValidf("non-positive APIPort")
	}
	// TODO Juju 3.0: make ControllerAPIPort required.
	return nil
}
1220922
func (i UpdateWAFConfigSetInput) validate() error {
	if i.ConfigSetID == "" {
		return ErrMissingConfigSetID
	}

	if len(i.WAFList) == 0 {
		return ErrMissingWAFList
	}

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

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

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

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

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
164612
func (config Config) Validate() error {
	if config.RestoreInfoWatcher == nil {
		return errors.NotValidf("nil RestoreInfoWatcher")
	}
	return nil
}
30283
func (cfg RawConfig) Validate() error {
	if err := cfg.validateHost(); err != nil {
		return errors.Trace(err)
	}

	if cfg.Enabled || cfg.ClientKey != "" || cfg.ClientCert != "" || cfg.CACert != "" {
		if _, err := cfg.tlsConfig(); err != nil {
			return errors.Annotate(err, "validating TLS config")
		}
	}
	return nil
}
186570
func (cc *Config) Validate() error {
	if len(cc.BrokerList) == 0 {
		return ErrConfigNoBrokers
	}

	if cc.ReadTimeout < time.Millisecond {
		return ErrConfigInvalidReadTimeout
	}

	if cc.WriteTimeout < time.Millisecond {
		return ErrConfigInvalidWriteTimeout
	}

	if cc.ConnectTimeout < time.Millisecond {
		return ErrConfigInvalidConnectTimeout
	}

	if cc.KeepAliveTimeout < time.Millisecond {
		return ErrConfigInvalidKeepAliveTimeout
	}

	if cc.FetchSize < 1 {
		return ErrConfigInvalidFetchSize
	}

	if cc.MetadataRetries < 0 {
		return ErrConfigInvalidMetadataRetries
	}

	if cc.MetadataBackoff < time.Millisecond {
		return ErrConfigInvalidMetadataBackoff
	}

	if cc.MetadataTTL < time.Millisecond {
		return ErrConfigInvalidMetadataTTL
	}

	if cc.CommitOffsetRetries < 0 {
		return ErrConfigInvalidCommitOffsetRetries
	}

	if cc.CommitOffsetBackoff < time.Millisecond {
		return ErrConfigInvalidCommitOffsetBackoff
	}

	if cc.ConsumerMetadataRetries < 0 {
		return ErrConfigInvalidConsumerMetadataRetries
	}

	if cc.ConsumerMetadataBackoff < time.Millisecond {
		return ErrConfigInvalidConsumerMetadataBackoff
	}

	if cc.ClientID == "" {
		return ErrConfigEmptyClientID
	}

	return nil
}
86025
func (config Config) Validate() error {
	if config.ModelUUID == "" {
		return errors.NotValidf("empty model uuid")
	}
	if config.RelationsFacade == nil {
		return errors.NotValidf("nil Facade")
	}
	if config.NewRemoteModelFacadeFunc == nil {
		return errors.NotValidf("nil Remote Model Facade func")
	}
	if config.Clock == nil {
		return errors.NotValidf("nil Clock")
	}
	return nil
}
754479
func (config Config) Validate() error {
	if config.APIInfo == nil {
		return errors.NotValidf("nil APIInfo")
	}
	if config.Authenticator == nil {
		return errors.NotValidf("nil Authenticator")
	}
	if config.DialConn == nil {
		return errors.NotValidf("nil DialConn")
	}
	if config.Hub == nil {
		return errors.NotValidf("nil Hub")
	}
	if config.Mux == nil {
		return errors.NotValidf("nil Mux")
	}
	if config.Path == "" {
		return errors.NotValidf("empty Path")
	}
	if config.LocalID == "" {
		return errors.NotValidf("empty LocalID")
	}
	if config.TLSConfig == nil {
		return errors.NotValidf("nil TLSConfig")
	}
	return nil
}
21928
func (m *DoubleMatcher) Validate() error {
	if m == nil {
		return nil
	}

	switch m.MatchPattern.(type) {

	case *DoubleMatcher_Range:

		{
			tmp := m.GetRange()

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

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

	case *DoubleMatcher_Exact:
		// no validation rules for Exact

	default:
		return DoubleMatcherValidationError{
			field:  "MatchPattern",
			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
}
588982
func (conf *Config) Validate() error {
	errors := tgo.NewErrorStack()
	errors.SetFormat(tgo.ErrorStackFormatCSV)

	for _, config := range conf.Plugins {
		if config.Typename == "" {
			errors.Pushf("Plugin type is not set for '%s'", config.ID)
			continue
		}

		pluginType := TypeRegistry.GetTypeOf(config.Typename)
		if pluginType == nil {
			if suggestion := suggestType(config.Typename); suggestion != "" {
				errors.Pushf("Type '%s' used for '%s' not found. Did you mean '%s'?", config.Typename, config.ID, suggestion)
			} else {
				errors.Pushf("Type '%s' used for '%s' not found", config.Typename, config.ID)
			}

			continue // ### continue ###
		}

		switch {
		case pluginType.Implements(consumerInterface):
			continue

		case pluginType.Implements(producerInterface):
			continue

		case pluginType.Implements(routerInterface):
			continue
		}

		errors.Pushf("Type '%s' used for '%s' does not implement a common interface", config.Typename, config.ID)
		getClosestMatch(pluginType, &errors)
	}

	return errors.OrNil()
}
1006537
func (conf PluginConfig) Validate() error {
	errors := tgo.NewErrorStack()
	errors.SetFormat(tgo.ErrorStackFormatCSV)
	for key := range conf.Settings {
		if _, exists := conf.validKeys[key]; !exists {
			if suggestion := conf.suggestKey(key); suggestion != "" {
				errors.Pushf("Unknown configuration key '%s' in '%s'. Did you mean '%s'?", key, conf.Typename, suggestion)
			} else {
				errors.Pushf("Unknown configuration key '%s' in '%s", key, conf.Typename)
			}
		}
	}
	return errors.OrNil()
}
870728
func (config FlagConfig) Validate() error {
	if config.Clock == nil {
		return errors.NotValidf("nil Clock")
	}
	if config.Facade == nil {
		return errors.NotValidf("nil Facade")
	}
	if config.Duration <= 0 {
		return errors.NotValidf("non-positive Duration")
	}
	return nil
}
692975
func (s ConfigMapGeneratorV1) validate() error {
	if len(s.Name) == 0 {
		return fmt.Errorf("name must be specified")
	}
	if len(s.EnvFileSource) > 0 && (len(s.FileSources) > 0 || len(s.LiteralSources) > 0) {
		return fmt.Errorf("from-env-file cannot be combined with from-file or from-literal")
	}
	return nil
}
260724
func (config Config) Validate() error {
	if config.Hub == nil {
		return errors.NotValidf("nil Hub")
	}
	if config.Raft == nil {
		return errors.NotValidf("nil Raft")
	}
	return nil
}