...

Source file src/github.com/datawire/ambassador/v2/pkg/api/envoy/config/bootstrap/v3/bootstrap.pb.validate.go

Documentation: github.com/datawire/ambassador/v2/pkg/api/envoy/config/bootstrap/v3

     1  // Code generated by protoc-gen-validate. DO NOT EDIT.
     2  // source: envoy/config/bootstrap/v3/bootstrap.proto
     3  
     4  package envoy_config_bootstrap_v3
     5  
     6  import (
     7  	"bytes"
     8  	"errors"
     9  	"fmt"
    10  	"net"
    11  	"net/mail"
    12  	"net/url"
    13  	"regexp"
    14  	"strings"
    15  	"time"
    16  	"unicode/utf8"
    17  
    18  	"github.com/golang/protobuf/ptypes"
    19  )
    20  
    21  // ensure the imports are used
    22  var (
    23  	_ = bytes.MinRead
    24  	_ = errors.New("")
    25  	_ = fmt.Print
    26  	_ = utf8.UTFMax
    27  	_ = (*regexp.Regexp)(nil)
    28  	_ = (*strings.Reader)(nil)
    29  	_ = net.IPv4len
    30  	_ = time.Duration(0)
    31  	_ = (*url.URL)(nil)
    32  	_ = (*mail.Address)(nil)
    33  	_ = ptypes.DynamicAny{}
    34  )
    35  
    36  // Validate checks the field values on Bootstrap with the rules defined in the
    37  // proto definition for this message. If any rules are violated, an error is returned.
    38  func (m *Bootstrap) Validate() error {
    39  	if m == nil {
    40  		return nil
    41  	}
    42  
    43  	if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok {
    44  		if err := v.Validate(); err != nil {
    45  			return BootstrapValidationError{
    46  				field:  "Node",
    47  				reason: "embedded message failed validation",
    48  				cause:  err,
    49  			}
    50  		}
    51  	}
    52  
    53  	if v, ok := interface{}(m.GetStaticResources()).(interface{ Validate() error }); ok {
    54  		if err := v.Validate(); err != nil {
    55  			return BootstrapValidationError{
    56  				field:  "StaticResources",
    57  				reason: "embedded message failed validation",
    58  				cause:  err,
    59  			}
    60  		}
    61  	}
    62  
    63  	if v, ok := interface{}(m.GetDynamicResources()).(interface{ Validate() error }); ok {
    64  		if err := v.Validate(); err != nil {
    65  			return BootstrapValidationError{
    66  				field:  "DynamicResources",
    67  				reason: "embedded message failed validation",
    68  				cause:  err,
    69  			}
    70  		}
    71  	}
    72  
    73  	if v, ok := interface{}(m.GetClusterManager()).(interface{ Validate() error }); ok {
    74  		if err := v.Validate(); err != nil {
    75  			return BootstrapValidationError{
    76  				field:  "ClusterManager",
    77  				reason: "embedded message failed validation",
    78  				cause:  err,
    79  			}
    80  		}
    81  	}
    82  
    83  	if v, ok := interface{}(m.GetHdsConfig()).(interface{ Validate() error }); ok {
    84  		if err := v.Validate(); err != nil {
    85  			return BootstrapValidationError{
    86  				field:  "HdsConfig",
    87  				reason: "embedded message failed validation",
    88  				cause:  err,
    89  			}
    90  		}
    91  	}
    92  
    93  	// no validation rules for FlagsPath
    94  
    95  	for idx, item := range m.GetStatsSinks() {
    96  		_, _ = idx, item
    97  
    98  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
    99  			if err := v.Validate(); err != nil {
   100  				return BootstrapValidationError{
   101  					field:  fmt.Sprintf("StatsSinks[%v]", idx),
   102  					reason: "embedded message failed validation",
   103  					cause:  err,
   104  				}
   105  			}
   106  		}
   107  
   108  	}
   109  
   110  	if v, ok := interface{}(m.GetStatsConfig()).(interface{ Validate() error }); ok {
   111  		if err := v.Validate(); err != nil {
   112  			return BootstrapValidationError{
   113  				field:  "StatsConfig",
   114  				reason: "embedded message failed validation",
   115  				cause:  err,
   116  			}
   117  		}
   118  	}
   119  
   120  	if d := m.GetStatsFlushInterval(); d != nil {
   121  		dur, err := ptypes.Duration(d)
   122  		if err != nil {
   123  			return BootstrapValidationError{
   124  				field:  "StatsFlushInterval",
   125  				reason: "value is not a valid duration",
   126  				cause:  err,
   127  			}
   128  		}
   129  
   130  		lt := time.Duration(300*time.Second + 0*time.Nanosecond)
   131  		gte := time.Duration(0*time.Second + 1000000*time.Nanosecond)
   132  
   133  		if dur < gte || dur >= lt {
   134  			return BootstrapValidationError{
   135  				field:  "StatsFlushInterval",
   136  				reason: "value must be inside range [1ms, 5m0s)",
   137  			}
   138  		}
   139  
   140  	}
   141  
   142  	if v, ok := interface{}(m.GetWatchdog()).(interface{ Validate() error }); ok {
   143  		if err := v.Validate(); err != nil {
   144  			return BootstrapValidationError{
   145  				field:  "Watchdog",
   146  				reason: "embedded message failed validation",
   147  				cause:  err,
   148  			}
   149  		}
   150  	}
   151  
   152  	if v, ok := interface{}(m.GetWatchdogs()).(interface{ Validate() error }); ok {
   153  		if err := v.Validate(); err != nil {
   154  			return BootstrapValidationError{
   155  				field:  "Watchdogs",
   156  				reason: "embedded message failed validation",
   157  				cause:  err,
   158  			}
   159  		}
   160  	}
   161  
   162  	if v, ok := interface{}(m.GetTracing()).(interface{ Validate() error }); ok {
   163  		if err := v.Validate(); err != nil {
   164  			return BootstrapValidationError{
   165  				field:  "Tracing",
   166  				reason: "embedded message failed validation",
   167  				cause:  err,
   168  			}
   169  		}
   170  	}
   171  
   172  	if v, ok := interface{}(m.GetLayeredRuntime()).(interface{ Validate() error }); ok {
   173  		if err := v.Validate(); err != nil {
   174  			return BootstrapValidationError{
   175  				field:  "LayeredRuntime",
   176  				reason: "embedded message failed validation",
   177  				cause:  err,
   178  			}
   179  		}
   180  	}
   181  
   182  	if v, ok := interface{}(m.GetAdmin()).(interface{ Validate() error }); ok {
   183  		if err := v.Validate(); err != nil {
   184  			return BootstrapValidationError{
   185  				field:  "Admin",
   186  				reason: "embedded message failed validation",
   187  				cause:  err,
   188  			}
   189  		}
   190  	}
   191  
   192  	if v, ok := interface{}(m.GetOverloadManager()).(interface{ Validate() error }); ok {
   193  		if err := v.Validate(); err != nil {
   194  			return BootstrapValidationError{
   195  				field:  "OverloadManager",
   196  				reason: "embedded message failed validation",
   197  				cause:  err,
   198  			}
   199  		}
   200  	}
   201  
   202  	// no validation rules for EnableDispatcherStats
   203  
   204  	// no validation rules for HeaderPrefix
   205  
   206  	if v, ok := interface{}(m.GetStatsServerVersionOverride()).(interface{ Validate() error }); ok {
   207  		if err := v.Validate(); err != nil {
   208  			return BootstrapValidationError{
   209  				field:  "StatsServerVersionOverride",
   210  				reason: "embedded message failed validation",
   211  				cause:  err,
   212  			}
   213  		}
   214  	}
   215  
   216  	// no validation rules for UseTcpForDnsLookups
   217  
   218  	for idx, item := range m.GetBootstrapExtensions() {
   219  		_, _ = idx, item
   220  
   221  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   222  			if err := v.Validate(); err != nil {
   223  				return BootstrapValidationError{
   224  					field:  fmt.Sprintf("BootstrapExtensions[%v]", idx),
   225  					reason: "embedded message failed validation",
   226  					cause:  err,
   227  				}
   228  			}
   229  		}
   230  
   231  	}
   232  
   233  	for idx, item := range m.GetFatalActions() {
   234  		_, _ = idx, item
   235  
   236  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   237  			if err := v.Validate(); err != nil {
   238  				return BootstrapValidationError{
   239  					field:  fmt.Sprintf("FatalActions[%v]", idx),
   240  					reason: "embedded message failed validation",
   241  					cause:  err,
   242  				}
   243  			}
   244  		}
   245  
   246  	}
   247  
   248  	for idx, item := range m.GetConfigSources() {
   249  		_, _ = idx, item
   250  
   251  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   252  			if err := v.Validate(); err != nil {
   253  				return BootstrapValidationError{
   254  					field:  fmt.Sprintf("ConfigSources[%v]", idx),
   255  					reason: "embedded message failed validation",
   256  					cause:  err,
   257  				}
   258  			}
   259  		}
   260  
   261  	}
   262  
   263  	if v, ok := interface{}(m.GetDefaultConfigSource()).(interface{ Validate() error }); ok {
   264  		if err := v.Validate(); err != nil {
   265  			return BootstrapValidationError{
   266  				field:  "DefaultConfigSource",
   267  				reason: "embedded message failed validation",
   268  				cause:  err,
   269  			}
   270  		}
   271  	}
   272  
   273  	// no validation rules for DefaultSocketInterface
   274  
   275  	for key, val := range m.GetCertificateProviderInstances() {
   276  		_ = val
   277  
   278  		// no validation rules for CertificateProviderInstances[key]
   279  
   280  		if v, ok := interface{}(val).(interface{ Validate() error }); ok {
   281  			if err := v.Validate(); err != nil {
   282  				return BootstrapValidationError{
   283  					field:  fmt.Sprintf("CertificateProviderInstances[%v]", key),
   284  					reason: "embedded message failed validation",
   285  					cause:  err,
   286  				}
   287  			}
   288  		}
   289  
   290  	}
   291  
   292  	if v, ok := interface{}(m.GetHiddenEnvoyDeprecatedRuntime()).(interface{ Validate() error }); ok {
   293  		if err := v.Validate(); err != nil {
   294  			return BootstrapValidationError{
   295  				field:  "HiddenEnvoyDeprecatedRuntime",
   296  				reason: "embedded message failed validation",
   297  				cause:  err,
   298  			}
   299  		}
   300  	}
   301  
   302  	switch m.StatsFlush.(type) {
   303  
   304  	case *Bootstrap_StatsFlushOnAdmin:
   305  
   306  		if m.GetStatsFlushOnAdmin() != true {
   307  			return BootstrapValidationError{
   308  				field:  "StatsFlushOnAdmin",
   309  				reason: "value must equal true",
   310  			}
   311  		}
   312  
   313  	}
   314  
   315  	return nil
   316  }
   317  
   318  // BootstrapValidationError is the validation error returned by
   319  // Bootstrap.Validate if the designated constraints aren't met.
   320  type BootstrapValidationError struct {
   321  	field  string
   322  	reason string
   323  	cause  error
   324  	key    bool
   325  }
   326  
   327  // Field function returns field value.
   328  func (e BootstrapValidationError) Field() string { return e.field }
   329  
   330  // Reason function returns reason value.
   331  func (e BootstrapValidationError) Reason() string { return e.reason }
   332  
   333  // Cause function returns cause value.
   334  func (e BootstrapValidationError) Cause() error { return e.cause }
   335  
   336  // Key function returns key value.
   337  func (e BootstrapValidationError) Key() bool { return e.key }
   338  
   339  // ErrorName returns error name.
   340  func (e BootstrapValidationError) ErrorName() string { return "BootstrapValidationError" }
   341  
   342  // Error satisfies the builtin error interface
   343  func (e BootstrapValidationError) Error() string {
   344  	cause := ""
   345  	if e.cause != nil {
   346  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   347  	}
   348  
   349  	key := ""
   350  	if e.key {
   351  		key = "key for "
   352  	}
   353  
   354  	return fmt.Sprintf(
   355  		"invalid %sBootstrap.%s: %s%s",
   356  		key,
   357  		e.field,
   358  		e.reason,
   359  		cause)
   360  }
   361  
   362  var _ error = BootstrapValidationError{}
   363  
   364  var _ interface {
   365  	Field() string
   366  	Reason() string
   367  	Key() bool
   368  	Cause() error
   369  	ErrorName() string
   370  } = BootstrapValidationError{}
   371  
   372  // Validate checks the field values on Admin with the rules defined in the
   373  // proto definition for this message. If any rules are violated, an error is returned.
   374  func (m *Admin) Validate() error {
   375  	if m == nil {
   376  		return nil
   377  	}
   378  
   379  	// no validation rules for AccessLogPath
   380  
   381  	// no validation rules for ProfilePath
   382  
   383  	if v, ok := interface{}(m.GetAddress()).(interface{ Validate() error }); ok {
   384  		if err := v.Validate(); err != nil {
   385  			return AdminValidationError{
   386  				field:  "Address",
   387  				reason: "embedded message failed validation",
   388  				cause:  err,
   389  			}
   390  		}
   391  	}
   392  
   393  	for idx, item := range m.GetSocketOptions() {
   394  		_, _ = idx, item
   395  
   396  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   397  			if err := v.Validate(); err != nil {
   398  				return AdminValidationError{
   399  					field:  fmt.Sprintf("SocketOptions[%v]", idx),
   400  					reason: "embedded message failed validation",
   401  					cause:  err,
   402  				}
   403  			}
   404  		}
   405  
   406  	}
   407  
   408  	return nil
   409  }
   410  
   411  // AdminValidationError is the validation error returned by Admin.Validate if
   412  // the designated constraints aren't met.
   413  type AdminValidationError struct {
   414  	field  string
   415  	reason string
   416  	cause  error
   417  	key    bool
   418  }
   419  
   420  // Field function returns field value.
   421  func (e AdminValidationError) Field() string { return e.field }
   422  
   423  // Reason function returns reason value.
   424  func (e AdminValidationError) Reason() string { return e.reason }
   425  
   426  // Cause function returns cause value.
   427  func (e AdminValidationError) Cause() error { return e.cause }
   428  
   429  // Key function returns key value.
   430  func (e AdminValidationError) Key() bool { return e.key }
   431  
   432  // ErrorName returns error name.
   433  func (e AdminValidationError) ErrorName() string { return "AdminValidationError" }
   434  
   435  // Error satisfies the builtin error interface
   436  func (e AdminValidationError) Error() string {
   437  	cause := ""
   438  	if e.cause != nil {
   439  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   440  	}
   441  
   442  	key := ""
   443  	if e.key {
   444  		key = "key for "
   445  	}
   446  
   447  	return fmt.Sprintf(
   448  		"invalid %sAdmin.%s: %s%s",
   449  		key,
   450  		e.field,
   451  		e.reason,
   452  		cause)
   453  }
   454  
   455  var _ error = AdminValidationError{}
   456  
   457  var _ interface {
   458  	Field() string
   459  	Reason() string
   460  	Key() bool
   461  	Cause() error
   462  	ErrorName() string
   463  } = AdminValidationError{}
   464  
   465  // Validate checks the field values on ClusterManager with the rules defined in
   466  // the proto definition for this message. If any rules are violated, an error
   467  // is returned.
   468  func (m *ClusterManager) Validate() error {
   469  	if m == nil {
   470  		return nil
   471  	}
   472  
   473  	// no validation rules for LocalClusterName
   474  
   475  	if v, ok := interface{}(m.GetOutlierDetection()).(interface{ Validate() error }); ok {
   476  		if err := v.Validate(); err != nil {
   477  			return ClusterManagerValidationError{
   478  				field:  "OutlierDetection",
   479  				reason: "embedded message failed validation",
   480  				cause:  err,
   481  			}
   482  		}
   483  	}
   484  
   485  	if v, ok := interface{}(m.GetUpstreamBindConfig()).(interface{ Validate() error }); ok {
   486  		if err := v.Validate(); err != nil {
   487  			return ClusterManagerValidationError{
   488  				field:  "UpstreamBindConfig",
   489  				reason: "embedded message failed validation",
   490  				cause:  err,
   491  			}
   492  		}
   493  	}
   494  
   495  	if v, ok := interface{}(m.GetLoadStatsConfig()).(interface{ Validate() error }); ok {
   496  		if err := v.Validate(); err != nil {
   497  			return ClusterManagerValidationError{
   498  				field:  "LoadStatsConfig",
   499  				reason: "embedded message failed validation",
   500  				cause:  err,
   501  			}
   502  		}
   503  	}
   504  
   505  	return nil
   506  }
   507  
   508  // ClusterManagerValidationError is the validation error returned by
   509  // ClusterManager.Validate if the designated constraints aren't met.
   510  type ClusterManagerValidationError struct {
   511  	field  string
   512  	reason string
   513  	cause  error
   514  	key    bool
   515  }
   516  
   517  // Field function returns field value.
   518  func (e ClusterManagerValidationError) Field() string { return e.field }
   519  
   520  // Reason function returns reason value.
   521  func (e ClusterManagerValidationError) Reason() string { return e.reason }
   522  
   523  // Cause function returns cause value.
   524  func (e ClusterManagerValidationError) Cause() error { return e.cause }
   525  
   526  // Key function returns key value.
   527  func (e ClusterManagerValidationError) Key() bool { return e.key }
   528  
   529  // ErrorName returns error name.
   530  func (e ClusterManagerValidationError) ErrorName() string { return "ClusterManagerValidationError" }
   531  
   532  // Error satisfies the builtin error interface
   533  func (e ClusterManagerValidationError) Error() string {
   534  	cause := ""
   535  	if e.cause != nil {
   536  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   537  	}
   538  
   539  	key := ""
   540  	if e.key {
   541  		key = "key for "
   542  	}
   543  
   544  	return fmt.Sprintf(
   545  		"invalid %sClusterManager.%s: %s%s",
   546  		key,
   547  		e.field,
   548  		e.reason,
   549  		cause)
   550  }
   551  
   552  var _ error = ClusterManagerValidationError{}
   553  
   554  var _ interface {
   555  	Field() string
   556  	Reason() string
   557  	Key() bool
   558  	Cause() error
   559  	ErrorName() string
   560  } = ClusterManagerValidationError{}
   561  
   562  // Validate checks the field values on Watchdogs with the rules defined in the
   563  // proto definition for this message. If any rules are violated, an error is returned.
   564  func (m *Watchdogs) Validate() error {
   565  	if m == nil {
   566  		return nil
   567  	}
   568  
   569  	if v, ok := interface{}(m.GetMainThreadWatchdog()).(interface{ Validate() error }); ok {
   570  		if err := v.Validate(); err != nil {
   571  			return WatchdogsValidationError{
   572  				field:  "MainThreadWatchdog",
   573  				reason: "embedded message failed validation",
   574  				cause:  err,
   575  			}
   576  		}
   577  	}
   578  
   579  	if v, ok := interface{}(m.GetWorkerWatchdog()).(interface{ Validate() error }); ok {
   580  		if err := v.Validate(); err != nil {
   581  			return WatchdogsValidationError{
   582  				field:  "WorkerWatchdog",
   583  				reason: "embedded message failed validation",
   584  				cause:  err,
   585  			}
   586  		}
   587  	}
   588  
   589  	return nil
   590  }
   591  
   592  // WatchdogsValidationError is the validation error returned by
   593  // Watchdogs.Validate if the designated constraints aren't met.
   594  type WatchdogsValidationError struct {
   595  	field  string
   596  	reason string
   597  	cause  error
   598  	key    bool
   599  }
   600  
   601  // Field function returns field value.
   602  func (e WatchdogsValidationError) Field() string { return e.field }
   603  
   604  // Reason function returns reason value.
   605  func (e WatchdogsValidationError) Reason() string { return e.reason }
   606  
   607  // Cause function returns cause value.
   608  func (e WatchdogsValidationError) Cause() error { return e.cause }
   609  
   610  // Key function returns key value.
   611  func (e WatchdogsValidationError) Key() bool { return e.key }
   612  
   613  // ErrorName returns error name.
   614  func (e WatchdogsValidationError) ErrorName() string { return "WatchdogsValidationError" }
   615  
   616  // Error satisfies the builtin error interface
   617  func (e WatchdogsValidationError) Error() string {
   618  	cause := ""
   619  	if e.cause != nil {
   620  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   621  	}
   622  
   623  	key := ""
   624  	if e.key {
   625  		key = "key for "
   626  	}
   627  
   628  	return fmt.Sprintf(
   629  		"invalid %sWatchdogs.%s: %s%s",
   630  		key,
   631  		e.field,
   632  		e.reason,
   633  		cause)
   634  }
   635  
   636  var _ error = WatchdogsValidationError{}
   637  
   638  var _ interface {
   639  	Field() string
   640  	Reason() string
   641  	Key() bool
   642  	Cause() error
   643  	ErrorName() string
   644  } = WatchdogsValidationError{}
   645  
   646  // Validate checks the field values on Watchdog with the rules defined in the
   647  // proto definition for this message. If any rules are violated, an error is returned.
   648  func (m *Watchdog) Validate() error {
   649  	if m == nil {
   650  		return nil
   651  	}
   652  
   653  	for idx, item := range m.GetActions() {
   654  		_, _ = idx, item
   655  
   656  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   657  			if err := v.Validate(); err != nil {
   658  				return WatchdogValidationError{
   659  					field:  fmt.Sprintf("Actions[%v]", idx),
   660  					reason: "embedded message failed validation",
   661  					cause:  err,
   662  				}
   663  			}
   664  		}
   665  
   666  	}
   667  
   668  	if v, ok := interface{}(m.GetMissTimeout()).(interface{ Validate() error }); ok {
   669  		if err := v.Validate(); err != nil {
   670  			return WatchdogValidationError{
   671  				field:  "MissTimeout",
   672  				reason: "embedded message failed validation",
   673  				cause:  err,
   674  			}
   675  		}
   676  	}
   677  
   678  	if v, ok := interface{}(m.GetMegamissTimeout()).(interface{ Validate() error }); ok {
   679  		if err := v.Validate(); err != nil {
   680  			return WatchdogValidationError{
   681  				field:  "MegamissTimeout",
   682  				reason: "embedded message failed validation",
   683  				cause:  err,
   684  			}
   685  		}
   686  	}
   687  
   688  	if v, ok := interface{}(m.GetKillTimeout()).(interface{ Validate() error }); ok {
   689  		if err := v.Validate(); err != nil {
   690  			return WatchdogValidationError{
   691  				field:  "KillTimeout",
   692  				reason: "embedded message failed validation",
   693  				cause:  err,
   694  			}
   695  		}
   696  	}
   697  
   698  	if d := m.GetMaxKillTimeoutJitter(); d != nil {
   699  		dur, err := ptypes.Duration(d)
   700  		if err != nil {
   701  			return WatchdogValidationError{
   702  				field:  "MaxKillTimeoutJitter",
   703  				reason: "value is not a valid duration",
   704  				cause:  err,
   705  			}
   706  		}
   707  
   708  		gte := time.Duration(0*time.Second + 0*time.Nanosecond)
   709  
   710  		if dur < gte {
   711  			return WatchdogValidationError{
   712  				field:  "MaxKillTimeoutJitter",
   713  				reason: "value must be greater than or equal to 0s",
   714  			}
   715  		}
   716  
   717  	}
   718  
   719  	if v, ok := interface{}(m.GetMultikillTimeout()).(interface{ Validate() error }); ok {
   720  		if err := v.Validate(); err != nil {
   721  			return WatchdogValidationError{
   722  				field:  "MultikillTimeout",
   723  				reason: "embedded message failed validation",
   724  				cause:  err,
   725  			}
   726  		}
   727  	}
   728  
   729  	if v, ok := interface{}(m.GetMultikillThreshold()).(interface{ Validate() error }); ok {
   730  		if err := v.Validate(); err != nil {
   731  			return WatchdogValidationError{
   732  				field:  "MultikillThreshold",
   733  				reason: "embedded message failed validation",
   734  				cause:  err,
   735  			}
   736  		}
   737  	}
   738  
   739  	return nil
   740  }
   741  
   742  // WatchdogValidationError is the validation error returned by
   743  // Watchdog.Validate if the designated constraints aren't met.
   744  type WatchdogValidationError struct {
   745  	field  string
   746  	reason string
   747  	cause  error
   748  	key    bool
   749  }
   750  
   751  // Field function returns field value.
   752  func (e WatchdogValidationError) Field() string { return e.field }
   753  
   754  // Reason function returns reason value.
   755  func (e WatchdogValidationError) Reason() string { return e.reason }
   756  
   757  // Cause function returns cause value.
   758  func (e WatchdogValidationError) Cause() error { return e.cause }
   759  
   760  // Key function returns key value.
   761  func (e WatchdogValidationError) Key() bool { return e.key }
   762  
   763  // ErrorName returns error name.
   764  func (e WatchdogValidationError) ErrorName() string { return "WatchdogValidationError" }
   765  
   766  // Error satisfies the builtin error interface
   767  func (e WatchdogValidationError) Error() string {
   768  	cause := ""
   769  	if e.cause != nil {
   770  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   771  	}
   772  
   773  	key := ""
   774  	if e.key {
   775  		key = "key for "
   776  	}
   777  
   778  	return fmt.Sprintf(
   779  		"invalid %sWatchdog.%s: %s%s",
   780  		key,
   781  		e.field,
   782  		e.reason,
   783  		cause)
   784  }
   785  
   786  var _ error = WatchdogValidationError{}
   787  
   788  var _ interface {
   789  	Field() string
   790  	Reason() string
   791  	Key() bool
   792  	Cause() error
   793  	ErrorName() string
   794  } = WatchdogValidationError{}
   795  
   796  // Validate checks the field values on FatalAction with the rules defined in
   797  // the proto definition for this message. If any rules are violated, an error
   798  // is returned.
   799  func (m *FatalAction) Validate() error {
   800  	if m == nil {
   801  		return nil
   802  	}
   803  
   804  	if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok {
   805  		if err := v.Validate(); err != nil {
   806  			return FatalActionValidationError{
   807  				field:  "Config",
   808  				reason: "embedded message failed validation",
   809  				cause:  err,
   810  			}
   811  		}
   812  	}
   813  
   814  	return nil
   815  }
   816  
   817  // FatalActionValidationError is the validation error returned by
   818  // FatalAction.Validate if the designated constraints aren't met.
   819  type FatalActionValidationError struct {
   820  	field  string
   821  	reason string
   822  	cause  error
   823  	key    bool
   824  }
   825  
   826  // Field function returns field value.
   827  func (e FatalActionValidationError) Field() string { return e.field }
   828  
   829  // Reason function returns reason value.
   830  func (e FatalActionValidationError) Reason() string { return e.reason }
   831  
   832  // Cause function returns cause value.
   833  func (e FatalActionValidationError) Cause() error { return e.cause }
   834  
   835  // Key function returns key value.
   836  func (e FatalActionValidationError) Key() bool { return e.key }
   837  
   838  // ErrorName returns error name.
   839  func (e FatalActionValidationError) ErrorName() string { return "FatalActionValidationError" }
   840  
   841  // Error satisfies the builtin error interface
   842  func (e FatalActionValidationError) Error() string {
   843  	cause := ""
   844  	if e.cause != nil {
   845  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   846  	}
   847  
   848  	key := ""
   849  	if e.key {
   850  		key = "key for "
   851  	}
   852  
   853  	return fmt.Sprintf(
   854  		"invalid %sFatalAction.%s: %s%s",
   855  		key,
   856  		e.field,
   857  		e.reason,
   858  		cause)
   859  }
   860  
   861  var _ error = FatalActionValidationError{}
   862  
   863  var _ interface {
   864  	Field() string
   865  	Reason() string
   866  	Key() bool
   867  	Cause() error
   868  	ErrorName() string
   869  } = FatalActionValidationError{}
   870  
   871  // Validate checks the field values on Runtime with the rules defined in the
   872  // proto definition for this message. If any rules are violated, an error is returned.
   873  func (m *Runtime) Validate() error {
   874  	if m == nil {
   875  		return nil
   876  	}
   877  
   878  	// no validation rules for SymlinkRoot
   879  
   880  	// no validation rules for Subdirectory
   881  
   882  	// no validation rules for OverrideSubdirectory
   883  
   884  	if v, ok := interface{}(m.GetBase()).(interface{ Validate() error }); ok {
   885  		if err := v.Validate(); err != nil {
   886  			return RuntimeValidationError{
   887  				field:  "Base",
   888  				reason: "embedded message failed validation",
   889  				cause:  err,
   890  			}
   891  		}
   892  	}
   893  
   894  	return nil
   895  }
   896  
   897  // RuntimeValidationError is the validation error returned by Runtime.Validate
   898  // if the designated constraints aren't met.
   899  type RuntimeValidationError struct {
   900  	field  string
   901  	reason string
   902  	cause  error
   903  	key    bool
   904  }
   905  
   906  // Field function returns field value.
   907  func (e RuntimeValidationError) Field() string { return e.field }
   908  
   909  // Reason function returns reason value.
   910  func (e RuntimeValidationError) Reason() string { return e.reason }
   911  
   912  // Cause function returns cause value.
   913  func (e RuntimeValidationError) Cause() error { return e.cause }
   914  
   915  // Key function returns key value.
   916  func (e RuntimeValidationError) Key() bool { return e.key }
   917  
   918  // ErrorName returns error name.
   919  func (e RuntimeValidationError) ErrorName() string { return "RuntimeValidationError" }
   920  
   921  // Error satisfies the builtin error interface
   922  func (e RuntimeValidationError) Error() string {
   923  	cause := ""
   924  	if e.cause != nil {
   925  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   926  	}
   927  
   928  	key := ""
   929  	if e.key {
   930  		key = "key for "
   931  	}
   932  
   933  	return fmt.Sprintf(
   934  		"invalid %sRuntime.%s: %s%s",
   935  		key,
   936  		e.field,
   937  		e.reason,
   938  		cause)
   939  }
   940  
   941  var _ error = RuntimeValidationError{}
   942  
   943  var _ interface {
   944  	Field() string
   945  	Reason() string
   946  	Key() bool
   947  	Cause() error
   948  	ErrorName() string
   949  } = RuntimeValidationError{}
   950  
   951  // Validate checks the field values on RuntimeLayer with the rules defined in
   952  // the proto definition for this message. If any rules are violated, an error
   953  // is returned.
   954  func (m *RuntimeLayer) Validate() error {
   955  	if m == nil {
   956  		return nil
   957  	}
   958  
   959  	if utf8.RuneCountInString(m.GetName()) < 1 {
   960  		return RuntimeLayerValidationError{
   961  			field:  "Name",
   962  			reason: "value length must be at least 1 runes",
   963  		}
   964  	}
   965  
   966  	switch m.LayerSpecifier.(type) {
   967  
   968  	case *RuntimeLayer_StaticLayer:
   969  
   970  		if v, ok := interface{}(m.GetStaticLayer()).(interface{ Validate() error }); ok {
   971  			if err := v.Validate(); err != nil {
   972  				return RuntimeLayerValidationError{
   973  					field:  "StaticLayer",
   974  					reason: "embedded message failed validation",
   975  					cause:  err,
   976  				}
   977  			}
   978  		}
   979  
   980  	case *RuntimeLayer_DiskLayer_:
   981  
   982  		if v, ok := interface{}(m.GetDiskLayer()).(interface{ Validate() error }); ok {
   983  			if err := v.Validate(); err != nil {
   984  				return RuntimeLayerValidationError{
   985  					field:  "DiskLayer",
   986  					reason: "embedded message failed validation",
   987  					cause:  err,
   988  				}
   989  			}
   990  		}
   991  
   992  	case *RuntimeLayer_AdminLayer_:
   993  
   994  		if v, ok := interface{}(m.GetAdminLayer()).(interface{ Validate() error }); ok {
   995  			if err := v.Validate(); err != nil {
   996  				return RuntimeLayerValidationError{
   997  					field:  "AdminLayer",
   998  					reason: "embedded message failed validation",
   999  					cause:  err,
  1000  				}
  1001  			}
  1002  		}
  1003  
  1004  	case *RuntimeLayer_RtdsLayer_:
  1005  
  1006  		if v, ok := interface{}(m.GetRtdsLayer()).(interface{ Validate() error }); ok {
  1007  			if err := v.Validate(); err != nil {
  1008  				return RuntimeLayerValidationError{
  1009  					field:  "RtdsLayer",
  1010  					reason: "embedded message failed validation",
  1011  					cause:  err,
  1012  				}
  1013  			}
  1014  		}
  1015  
  1016  	default:
  1017  		return RuntimeLayerValidationError{
  1018  			field:  "LayerSpecifier",
  1019  			reason: "value is required",
  1020  		}
  1021  
  1022  	}
  1023  
  1024  	return nil
  1025  }
  1026  
  1027  // RuntimeLayerValidationError is the validation error returned by
  1028  // RuntimeLayer.Validate if the designated constraints aren't met.
  1029  type RuntimeLayerValidationError struct {
  1030  	field  string
  1031  	reason string
  1032  	cause  error
  1033  	key    bool
  1034  }
  1035  
  1036  // Field function returns field value.
  1037  func (e RuntimeLayerValidationError) Field() string { return e.field }
  1038  
  1039  // Reason function returns reason value.
  1040  func (e RuntimeLayerValidationError) Reason() string { return e.reason }
  1041  
  1042  // Cause function returns cause value.
  1043  func (e RuntimeLayerValidationError) Cause() error { return e.cause }
  1044  
  1045  // Key function returns key value.
  1046  func (e RuntimeLayerValidationError) Key() bool { return e.key }
  1047  
  1048  // ErrorName returns error name.
  1049  func (e RuntimeLayerValidationError) ErrorName() string { return "RuntimeLayerValidationError" }
  1050  
  1051  // Error satisfies the builtin error interface
  1052  func (e RuntimeLayerValidationError) Error() string {
  1053  	cause := ""
  1054  	if e.cause != nil {
  1055  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1056  	}
  1057  
  1058  	key := ""
  1059  	if e.key {
  1060  		key = "key for "
  1061  	}
  1062  
  1063  	return fmt.Sprintf(
  1064  		"invalid %sRuntimeLayer.%s: %s%s",
  1065  		key,
  1066  		e.field,
  1067  		e.reason,
  1068  		cause)
  1069  }
  1070  
  1071  var _ error = RuntimeLayerValidationError{}
  1072  
  1073  var _ interface {
  1074  	Field() string
  1075  	Reason() string
  1076  	Key() bool
  1077  	Cause() error
  1078  	ErrorName() string
  1079  } = RuntimeLayerValidationError{}
  1080  
  1081  // Validate checks the field values on LayeredRuntime with the rules defined in
  1082  // the proto definition for this message. If any rules are violated, an error
  1083  // is returned.
  1084  func (m *LayeredRuntime) Validate() error {
  1085  	if m == nil {
  1086  		return nil
  1087  	}
  1088  
  1089  	for idx, item := range m.GetLayers() {
  1090  		_, _ = idx, item
  1091  
  1092  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  1093  			if err := v.Validate(); err != nil {
  1094  				return LayeredRuntimeValidationError{
  1095  					field:  fmt.Sprintf("Layers[%v]", idx),
  1096  					reason: "embedded message failed validation",
  1097  					cause:  err,
  1098  				}
  1099  			}
  1100  		}
  1101  
  1102  	}
  1103  
  1104  	return nil
  1105  }
  1106  
  1107  // LayeredRuntimeValidationError is the validation error returned by
  1108  // LayeredRuntime.Validate if the designated constraints aren't met.
  1109  type LayeredRuntimeValidationError struct {
  1110  	field  string
  1111  	reason string
  1112  	cause  error
  1113  	key    bool
  1114  }
  1115  
  1116  // Field function returns field value.
  1117  func (e LayeredRuntimeValidationError) Field() string { return e.field }
  1118  
  1119  // Reason function returns reason value.
  1120  func (e LayeredRuntimeValidationError) Reason() string { return e.reason }
  1121  
  1122  // Cause function returns cause value.
  1123  func (e LayeredRuntimeValidationError) Cause() error { return e.cause }
  1124  
  1125  // Key function returns key value.
  1126  func (e LayeredRuntimeValidationError) Key() bool { return e.key }
  1127  
  1128  // ErrorName returns error name.
  1129  func (e LayeredRuntimeValidationError) ErrorName() string { return "LayeredRuntimeValidationError" }
  1130  
  1131  // Error satisfies the builtin error interface
  1132  func (e LayeredRuntimeValidationError) Error() string {
  1133  	cause := ""
  1134  	if e.cause != nil {
  1135  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1136  	}
  1137  
  1138  	key := ""
  1139  	if e.key {
  1140  		key = "key for "
  1141  	}
  1142  
  1143  	return fmt.Sprintf(
  1144  		"invalid %sLayeredRuntime.%s: %s%s",
  1145  		key,
  1146  		e.field,
  1147  		e.reason,
  1148  		cause)
  1149  }
  1150  
  1151  var _ error = LayeredRuntimeValidationError{}
  1152  
  1153  var _ interface {
  1154  	Field() string
  1155  	Reason() string
  1156  	Key() bool
  1157  	Cause() error
  1158  	ErrorName() string
  1159  } = LayeredRuntimeValidationError{}
  1160  
  1161  // Validate checks the field values on Bootstrap_StaticResources with the rules
  1162  // defined in the proto definition for this message. If any rules are
  1163  // violated, an error is returned.
  1164  func (m *Bootstrap_StaticResources) Validate() error {
  1165  	if m == nil {
  1166  		return nil
  1167  	}
  1168  
  1169  	for idx, item := range m.GetListeners() {
  1170  		_, _ = idx, item
  1171  
  1172  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  1173  			if err := v.Validate(); err != nil {
  1174  				return Bootstrap_StaticResourcesValidationError{
  1175  					field:  fmt.Sprintf("Listeners[%v]", idx),
  1176  					reason: "embedded message failed validation",
  1177  					cause:  err,
  1178  				}
  1179  			}
  1180  		}
  1181  
  1182  	}
  1183  
  1184  	for idx, item := range m.GetClusters() {
  1185  		_, _ = idx, item
  1186  
  1187  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  1188  			if err := v.Validate(); err != nil {
  1189  				return Bootstrap_StaticResourcesValidationError{
  1190  					field:  fmt.Sprintf("Clusters[%v]", idx),
  1191  					reason: "embedded message failed validation",
  1192  					cause:  err,
  1193  				}
  1194  			}
  1195  		}
  1196  
  1197  	}
  1198  
  1199  	for idx, item := range m.GetSecrets() {
  1200  		_, _ = idx, item
  1201  
  1202  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  1203  			if err := v.Validate(); err != nil {
  1204  				return Bootstrap_StaticResourcesValidationError{
  1205  					field:  fmt.Sprintf("Secrets[%v]", idx),
  1206  					reason: "embedded message failed validation",
  1207  					cause:  err,
  1208  				}
  1209  			}
  1210  		}
  1211  
  1212  	}
  1213  
  1214  	return nil
  1215  }
  1216  
  1217  // Bootstrap_StaticResourcesValidationError is the validation error returned by
  1218  // Bootstrap_StaticResources.Validate if the designated constraints aren't met.
  1219  type Bootstrap_StaticResourcesValidationError struct {
  1220  	field  string
  1221  	reason string
  1222  	cause  error
  1223  	key    bool
  1224  }
  1225  
  1226  // Field function returns field value.
  1227  func (e Bootstrap_StaticResourcesValidationError) Field() string { return e.field }
  1228  
  1229  // Reason function returns reason value.
  1230  func (e Bootstrap_StaticResourcesValidationError) Reason() string { return e.reason }
  1231  
  1232  // Cause function returns cause value.
  1233  func (e Bootstrap_StaticResourcesValidationError) Cause() error { return e.cause }
  1234  
  1235  // Key function returns key value.
  1236  func (e Bootstrap_StaticResourcesValidationError) Key() bool { return e.key }
  1237  
  1238  // ErrorName returns error name.
  1239  func (e Bootstrap_StaticResourcesValidationError) ErrorName() string {
  1240  	return "Bootstrap_StaticResourcesValidationError"
  1241  }
  1242  
  1243  // Error satisfies the builtin error interface
  1244  func (e Bootstrap_StaticResourcesValidationError) Error() string {
  1245  	cause := ""
  1246  	if e.cause != nil {
  1247  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1248  	}
  1249  
  1250  	key := ""
  1251  	if e.key {
  1252  		key = "key for "
  1253  	}
  1254  
  1255  	return fmt.Sprintf(
  1256  		"invalid %sBootstrap_StaticResources.%s: %s%s",
  1257  		key,
  1258  		e.field,
  1259  		e.reason,
  1260  		cause)
  1261  }
  1262  
  1263  var _ error = Bootstrap_StaticResourcesValidationError{}
  1264  
  1265  var _ interface {
  1266  	Field() string
  1267  	Reason() string
  1268  	Key() bool
  1269  	Cause() error
  1270  	ErrorName() string
  1271  } = Bootstrap_StaticResourcesValidationError{}
  1272  
  1273  // Validate checks the field values on Bootstrap_DynamicResources with the
  1274  // rules defined in the proto definition for this message. If any rules are
  1275  // violated, an error is returned.
  1276  func (m *Bootstrap_DynamicResources) Validate() error {
  1277  	if m == nil {
  1278  		return nil
  1279  	}
  1280  
  1281  	if v, ok := interface{}(m.GetLdsConfig()).(interface{ Validate() error }); ok {
  1282  		if err := v.Validate(); err != nil {
  1283  			return Bootstrap_DynamicResourcesValidationError{
  1284  				field:  "LdsConfig",
  1285  				reason: "embedded message failed validation",
  1286  				cause:  err,
  1287  			}
  1288  		}
  1289  	}
  1290  
  1291  	// no validation rules for LdsResourcesLocator
  1292  
  1293  	if v, ok := interface{}(m.GetCdsConfig()).(interface{ Validate() error }); ok {
  1294  		if err := v.Validate(); err != nil {
  1295  			return Bootstrap_DynamicResourcesValidationError{
  1296  				field:  "CdsConfig",
  1297  				reason: "embedded message failed validation",
  1298  				cause:  err,
  1299  			}
  1300  		}
  1301  	}
  1302  
  1303  	// no validation rules for CdsResourcesLocator
  1304  
  1305  	if v, ok := interface{}(m.GetAdsConfig()).(interface{ Validate() error }); ok {
  1306  		if err := v.Validate(); err != nil {
  1307  			return Bootstrap_DynamicResourcesValidationError{
  1308  				field:  "AdsConfig",
  1309  				reason: "embedded message failed validation",
  1310  				cause:  err,
  1311  			}
  1312  		}
  1313  	}
  1314  
  1315  	return nil
  1316  }
  1317  
  1318  // Bootstrap_DynamicResourcesValidationError is the validation error returned
  1319  // by Bootstrap_DynamicResources.Validate if the designated constraints aren't met.
  1320  type Bootstrap_DynamicResourcesValidationError struct {
  1321  	field  string
  1322  	reason string
  1323  	cause  error
  1324  	key    bool
  1325  }
  1326  
  1327  // Field function returns field value.
  1328  func (e Bootstrap_DynamicResourcesValidationError) Field() string { return e.field }
  1329  
  1330  // Reason function returns reason value.
  1331  func (e Bootstrap_DynamicResourcesValidationError) Reason() string { return e.reason }
  1332  
  1333  // Cause function returns cause value.
  1334  func (e Bootstrap_DynamicResourcesValidationError) Cause() error { return e.cause }
  1335  
  1336  // Key function returns key value.
  1337  func (e Bootstrap_DynamicResourcesValidationError) Key() bool { return e.key }
  1338  
  1339  // ErrorName returns error name.
  1340  func (e Bootstrap_DynamicResourcesValidationError) ErrorName() string {
  1341  	return "Bootstrap_DynamicResourcesValidationError"
  1342  }
  1343  
  1344  // Error satisfies the builtin error interface
  1345  func (e Bootstrap_DynamicResourcesValidationError) Error() string {
  1346  	cause := ""
  1347  	if e.cause != nil {
  1348  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1349  	}
  1350  
  1351  	key := ""
  1352  	if e.key {
  1353  		key = "key for "
  1354  	}
  1355  
  1356  	return fmt.Sprintf(
  1357  		"invalid %sBootstrap_DynamicResources.%s: %s%s",
  1358  		key,
  1359  		e.field,
  1360  		e.reason,
  1361  		cause)
  1362  }
  1363  
  1364  var _ error = Bootstrap_DynamicResourcesValidationError{}
  1365  
  1366  var _ interface {
  1367  	Field() string
  1368  	Reason() string
  1369  	Key() bool
  1370  	Cause() error
  1371  	ErrorName() string
  1372  } = Bootstrap_DynamicResourcesValidationError{}
  1373  
  1374  // Validate checks the field values on ClusterManager_OutlierDetection with the
  1375  // rules defined in the proto definition for this message. If any rules are
  1376  // violated, an error is returned.
  1377  func (m *ClusterManager_OutlierDetection) Validate() error {
  1378  	if m == nil {
  1379  		return nil
  1380  	}
  1381  
  1382  	// no validation rules for EventLogPath
  1383  
  1384  	if v, ok := interface{}(m.GetEventService()).(interface{ Validate() error }); ok {
  1385  		if err := v.Validate(); err != nil {
  1386  			return ClusterManager_OutlierDetectionValidationError{
  1387  				field:  "EventService",
  1388  				reason: "embedded message failed validation",
  1389  				cause:  err,
  1390  			}
  1391  		}
  1392  	}
  1393  
  1394  	return nil
  1395  }
  1396  
  1397  // ClusterManager_OutlierDetectionValidationError is the validation error
  1398  // returned by ClusterManager_OutlierDetection.Validate if the designated
  1399  // constraints aren't met.
  1400  type ClusterManager_OutlierDetectionValidationError struct {
  1401  	field  string
  1402  	reason string
  1403  	cause  error
  1404  	key    bool
  1405  }
  1406  
  1407  // Field function returns field value.
  1408  func (e ClusterManager_OutlierDetectionValidationError) Field() string { return e.field }
  1409  
  1410  // Reason function returns reason value.
  1411  func (e ClusterManager_OutlierDetectionValidationError) Reason() string { return e.reason }
  1412  
  1413  // Cause function returns cause value.
  1414  func (e ClusterManager_OutlierDetectionValidationError) Cause() error { return e.cause }
  1415  
  1416  // Key function returns key value.
  1417  func (e ClusterManager_OutlierDetectionValidationError) Key() bool { return e.key }
  1418  
  1419  // ErrorName returns error name.
  1420  func (e ClusterManager_OutlierDetectionValidationError) ErrorName() string {
  1421  	return "ClusterManager_OutlierDetectionValidationError"
  1422  }
  1423  
  1424  // Error satisfies the builtin error interface
  1425  func (e ClusterManager_OutlierDetectionValidationError) Error() string {
  1426  	cause := ""
  1427  	if e.cause != nil {
  1428  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1429  	}
  1430  
  1431  	key := ""
  1432  	if e.key {
  1433  		key = "key for "
  1434  	}
  1435  
  1436  	return fmt.Sprintf(
  1437  		"invalid %sClusterManager_OutlierDetection.%s: %s%s",
  1438  		key,
  1439  		e.field,
  1440  		e.reason,
  1441  		cause)
  1442  }
  1443  
  1444  var _ error = ClusterManager_OutlierDetectionValidationError{}
  1445  
  1446  var _ interface {
  1447  	Field() string
  1448  	Reason() string
  1449  	Key() bool
  1450  	Cause() error
  1451  	ErrorName() string
  1452  } = ClusterManager_OutlierDetectionValidationError{}
  1453  
  1454  // Validate checks the field values on Watchdog_WatchdogAction with the rules
  1455  // defined in the proto definition for this message. If any rules are
  1456  // violated, an error is returned.
  1457  func (m *Watchdog_WatchdogAction) Validate() error {
  1458  	if m == nil {
  1459  		return nil
  1460  	}
  1461  
  1462  	if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok {
  1463  		if err := v.Validate(); err != nil {
  1464  			return Watchdog_WatchdogActionValidationError{
  1465  				field:  "Config",
  1466  				reason: "embedded message failed validation",
  1467  				cause:  err,
  1468  			}
  1469  		}
  1470  	}
  1471  
  1472  	if _, ok := Watchdog_WatchdogAction_WatchdogEvent_name[int32(m.GetEvent())]; !ok {
  1473  		return Watchdog_WatchdogActionValidationError{
  1474  			field:  "Event",
  1475  			reason: "value must be one of the defined enum values",
  1476  		}
  1477  	}
  1478  
  1479  	return nil
  1480  }
  1481  
  1482  // Watchdog_WatchdogActionValidationError is the validation error returned by
  1483  // Watchdog_WatchdogAction.Validate if the designated constraints aren't met.
  1484  type Watchdog_WatchdogActionValidationError struct {
  1485  	field  string
  1486  	reason string
  1487  	cause  error
  1488  	key    bool
  1489  }
  1490  
  1491  // Field function returns field value.
  1492  func (e Watchdog_WatchdogActionValidationError) Field() string { return e.field }
  1493  
  1494  // Reason function returns reason value.
  1495  func (e Watchdog_WatchdogActionValidationError) Reason() string { return e.reason }
  1496  
  1497  // Cause function returns cause value.
  1498  func (e Watchdog_WatchdogActionValidationError) Cause() error { return e.cause }
  1499  
  1500  // Key function returns key value.
  1501  func (e Watchdog_WatchdogActionValidationError) Key() bool { return e.key }
  1502  
  1503  // ErrorName returns error name.
  1504  func (e Watchdog_WatchdogActionValidationError) ErrorName() string {
  1505  	return "Watchdog_WatchdogActionValidationError"
  1506  }
  1507  
  1508  // Error satisfies the builtin error interface
  1509  func (e Watchdog_WatchdogActionValidationError) Error() string {
  1510  	cause := ""
  1511  	if e.cause != nil {
  1512  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1513  	}
  1514  
  1515  	key := ""
  1516  	if e.key {
  1517  		key = "key for "
  1518  	}
  1519  
  1520  	return fmt.Sprintf(
  1521  		"invalid %sWatchdog_WatchdogAction.%s: %s%s",
  1522  		key,
  1523  		e.field,
  1524  		e.reason,
  1525  		cause)
  1526  }
  1527  
  1528  var _ error = Watchdog_WatchdogActionValidationError{}
  1529  
  1530  var _ interface {
  1531  	Field() string
  1532  	Reason() string
  1533  	Key() bool
  1534  	Cause() error
  1535  	ErrorName() string
  1536  } = Watchdog_WatchdogActionValidationError{}
  1537  
  1538  // Validate checks the field values on RuntimeLayer_DiskLayer with the rules
  1539  // defined in the proto definition for this message. If any rules are
  1540  // violated, an error is returned.
  1541  func (m *RuntimeLayer_DiskLayer) Validate() error {
  1542  	if m == nil {
  1543  		return nil
  1544  	}
  1545  
  1546  	// no validation rules for SymlinkRoot
  1547  
  1548  	// no validation rules for Subdirectory
  1549  
  1550  	// no validation rules for AppendServiceCluster
  1551  
  1552  	return nil
  1553  }
  1554  
  1555  // RuntimeLayer_DiskLayerValidationError is the validation error returned by
  1556  // RuntimeLayer_DiskLayer.Validate if the designated constraints aren't met.
  1557  type RuntimeLayer_DiskLayerValidationError struct {
  1558  	field  string
  1559  	reason string
  1560  	cause  error
  1561  	key    bool
  1562  }
  1563  
  1564  // Field function returns field value.
  1565  func (e RuntimeLayer_DiskLayerValidationError) Field() string { return e.field }
  1566  
  1567  // Reason function returns reason value.
  1568  func (e RuntimeLayer_DiskLayerValidationError) Reason() string { return e.reason }
  1569  
  1570  // Cause function returns cause value.
  1571  func (e RuntimeLayer_DiskLayerValidationError) Cause() error { return e.cause }
  1572  
  1573  // Key function returns key value.
  1574  func (e RuntimeLayer_DiskLayerValidationError) Key() bool { return e.key }
  1575  
  1576  // ErrorName returns error name.
  1577  func (e RuntimeLayer_DiskLayerValidationError) ErrorName() string {
  1578  	return "RuntimeLayer_DiskLayerValidationError"
  1579  }
  1580  
  1581  // Error satisfies the builtin error interface
  1582  func (e RuntimeLayer_DiskLayerValidationError) Error() string {
  1583  	cause := ""
  1584  	if e.cause != nil {
  1585  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1586  	}
  1587  
  1588  	key := ""
  1589  	if e.key {
  1590  		key = "key for "
  1591  	}
  1592  
  1593  	return fmt.Sprintf(
  1594  		"invalid %sRuntimeLayer_DiskLayer.%s: %s%s",
  1595  		key,
  1596  		e.field,
  1597  		e.reason,
  1598  		cause)
  1599  }
  1600  
  1601  var _ error = RuntimeLayer_DiskLayerValidationError{}
  1602  
  1603  var _ interface {
  1604  	Field() string
  1605  	Reason() string
  1606  	Key() bool
  1607  	Cause() error
  1608  	ErrorName() string
  1609  } = RuntimeLayer_DiskLayerValidationError{}
  1610  
  1611  // Validate checks the field values on RuntimeLayer_AdminLayer with the rules
  1612  // defined in the proto definition for this message. If any rules are
  1613  // violated, an error is returned.
  1614  func (m *RuntimeLayer_AdminLayer) Validate() error {
  1615  	if m == nil {
  1616  		return nil
  1617  	}
  1618  
  1619  	return nil
  1620  }
  1621  
  1622  // RuntimeLayer_AdminLayerValidationError is the validation error returned by
  1623  // RuntimeLayer_AdminLayer.Validate if the designated constraints aren't met.
  1624  type RuntimeLayer_AdminLayerValidationError struct {
  1625  	field  string
  1626  	reason string
  1627  	cause  error
  1628  	key    bool
  1629  }
  1630  
  1631  // Field function returns field value.
  1632  func (e RuntimeLayer_AdminLayerValidationError) Field() string { return e.field }
  1633  
  1634  // Reason function returns reason value.
  1635  func (e RuntimeLayer_AdminLayerValidationError) Reason() string { return e.reason }
  1636  
  1637  // Cause function returns cause value.
  1638  func (e RuntimeLayer_AdminLayerValidationError) Cause() error { return e.cause }
  1639  
  1640  // Key function returns key value.
  1641  func (e RuntimeLayer_AdminLayerValidationError) Key() bool { return e.key }
  1642  
  1643  // ErrorName returns error name.
  1644  func (e RuntimeLayer_AdminLayerValidationError) ErrorName() string {
  1645  	return "RuntimeLayer_AdminLayerValidationError"
  1646  }
  1647  
  1648  // Error satisfies the builtin error interface
  1649  func (e RuntimeLayer_AdminLayerValidationError) Error() string {
  1650  	cause := ""
  1651  	if e.cause != nil {
  1652  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1653  	}
  1654  
  1655  	key := ""
  1656  	if e.key {
  1657  		key = "key for "
  1658  	}
  1659  
  1660  	return fmt.Sprintf(
  1661  		"invalid %sRuntimeLayer_AdminLayer.%s: %s%s",
  1662  		key,
  1663  		e.field,
  1664  		e.reason,
  1665  		cause)
  1666  }
  1667  
  1668  var _ error = RuntimeLayer_AdminLayerValidationError{}
  1669  
  1670  var _ interface {
  1671  	Field() string
  1672  	Reason() string
  1673  	Key() bool
  1674  	Cause() error
  1675  	ErrorName() string
  1676  } = RuntimeLayer_AdminLayerValidationError{}
  1677  
  1678  // Validate checks the field values on RuntimeLayer_RtdsLayer with the rules
  1679  // defined in the proto definition for this message. If any rules are
  1680  // violated, an error is returned.
  1681  func (m *RuntimeLayer_RtdsLayer) Validate() error {
  1682  	if m == nil {
  1683  		return nil
  1684  	}
  1685  
  1686  	// no validation rules for Name
  1687  
  1688  	if v, ok := interface{}(m.GetRtdsConfig()).(interface{ Validate() error }); ok {
  1689  		if err := v.Validate(); err != nil {
  1690  			return RuntimeLayer_RtdsLayerValidationError{
  1691  				field:  "RtdsConfig",
  1692  				reason: "embedded message failed validation",
  1693  				cause:  err,
  1694  			}
  1695  		}
  1696  	}
  1697  
  1698  	return nil
  1699  }
  1700  
  1701  // RuntimeLayer_RtdsLayerValidationError is the validation error returned by
  1702  // RuntimeLayer_RtdsLayer.Validate if the designated constraints aren't met.
  1703  type RuntimeLayer_RtdsLayerValidationError struct {
  1704  	field  string
  1705  	reason string
  1706  	cause  error
  1707  	key    bool
  1708  }
  1709  
  1710  // Field function returns field value.
  1711  func (e RuntimeLayer_RtdsLayerValidationError) Field() string { return e.field }
  1712  
  1713  // Reason function returns reason value.
  1714  func (e RuntimeLayer_RtdsLayerValidationError) Reason() string { return e.reason }
  1715  
  1716  // Cause function returns cause value.
  1717  func (e RuntimeLayer_RtdsLayerValidationError) Cause() error { return e.cause }
  1718  
  1719  // Key function returns key value.
  1720  func (e RuntimeLayer_RtdsLayerValidationError) Key() bool { return e.key }
  1721  
  1722  // ErrorName returns error name.
  1723  func (e RuntimeLayer_RtdsLayerValidationError) ErrorName() string {
  1724  	return "RuntimeLayer_RtdsLayerValidationError"
  1725  }
  1726  
  1727  // Error satisfies the builtin error interface
  1728  func (e RuntimeLayer_RtdsLayerValidationError) Error() string {
  1729  	cause := ""
  1730  	if e.cause != nil {
  1731  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1732  	}
  1733  
  1734  	key := ""
  1735  	if e.key {
  1736  		key = "key for "
  1737  	}
  1738  
  1739  	return fmt.Sprintf(
  1740  		"invalid %sRuntimeLayer_RtdsLayer.%s: %s%s",
  1741  		key,
  1742  		e.field,
  1743  		e.reason,
  1744  		cause)
  1745  }
  1746  
  1747  var _ error = RuntimeLayer_RtdsLayerValidationError{}
  1748  
  1749  var _ interface {
  1750  	Field() string
  1751  	Reason() string
  1752  	Key() bool
  1753  	Cause() error
  1754  	ErrorName() string
  1755  } = RuntimeLayer_RtdsLayerValidationError{}
  1756  

View as plain text