...

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

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

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

View as plain text