gitee.com/ks-custle/core-gm@v0.0.0-20230922171213-b83bdd97b62c/go-control-plane/envoy/config/cluster/v3/cluster.pb.validate.go (about)

     1  // Code generated by protoc-gen-validate. DO NOT EDIT.
     2  // source: envoy/config/cluster/v3/cluster.proto
     3  
     4  package envoy_config_cluster_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  	"google.golang.org/protobuf/types/known/anypb"
    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  	_ = anypb.Any{}
    34  )
    35  
    36  // Validate checks the field values on ClusterCollection with the rules defined
    37  // in the proto definition for this message. If any rules are violated, an
    38  // error is returned.
    39  func (m *ClusterCollection) Validate() error {
    40  	if m == nil {
    41  		return nil
    42  	}
    43  
    44  	if v, ok := interface{}(m.GetEntries()).(interface{ Validate() error }); ok {
    45  		if err := v.Validate(); err != nil {
    46  			return ClusterCollectionValidationError{
    47  				field:  "Entries",
    48  				reason: "embedded message failed validation",
    49  				cause:  err,
    50  			}
    51  		}
    52  	}
    53  
    54  	return nil
    55  }
    56  
    57  // ClusterCollectionValidationError is the validation error returned by
    58  // ClusterCollection.Validate if the designated constraints aren't met.
    59  type ClusterCollectionValidationError struct {
    60  	field  string
    61  	reason string
    62  	cause  error
    63  	key    bool
    64  }
    65  
    66  // Field function returns field value.
    67  func (e ClusterCollectionValidationError) Field() string { return e.field }
    68  
    69  // Reason function returns reason value.
    70  func (e ClusterCollectionValidationError) Reason() string { return e.reason }
    71  
    72  // Cause function returns cause value.
    73  func (e ClusterCollectionValidationError) Cause() error { return e.cause }
    74  
    75  // Key function returns key value.
    76  func (e ClusterCollectionValidationError) Key() bool { return e.key }
    77  
    78  // ErrorName returns error name.
    79  func (e ClusterCollectionValidationError) ErrorName() string {
    80  	return "ClusterCollectionValidationError"
    81  }
    82  
    83  // Error satisfies the builtin error interface
    84  func (e ClusterCollectionValidationError) Error() string {
    85  	cause := ""
    86  	if e.cause != nil {
    87  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
    88  	}
    89  
    90  	key := ""
    91  	if e.key {
    92  		key = "key for "
    93  	}
    94  
    95  	return fmt.Sprintf(
    96  		"invalid %sClusterCollection.%s: %s%s",
    97  		key,
    98  		e.field,
    99  		e.reason,
   100  		cause)
   101  }
   102  
   103  var _ error = ClusterCollectionValidationError{}
   104  
   105  var _ interface {
   106  	Field() string
   107  	Reason() string
   108  	Key() bool
   109  	Cause() error
   110  	ErrorName() string
   111  } = ClusterCollectionValidationError{}
   112  
   113  // Validate checks the field values on Cluster with the rules defined in the
   114  // proto definition for this message. If any rules are violated, an error is returned.
   115  func (m *Cluster) Validate() error {
   116  	if m == nil {
   117  		return nil
   118  	}
   119  
   120  	for idx, item := range m.GetTransportSocketMatches() {
   121  		_, _ = idx, item
   122  
   123  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   124  			if err := v.Validate(); err != nil {
   125  				return ClusterValidationError{
   126  					field:  fmt.Sprintf("TransportSocketMatches[%v]", idx),
   127  					reason: "embedded message failed validation",
   128  					cause:  err,
   129  				}
   130  			}
   131  		}
   132  
   133  	}
   134  
   135  	if utf8.RuneCountInString(m.GetName()) < 1 {
   136  		return ClusterValidationError{
   137  			field:  "Name",
   138  			reason: "value length must be at least 1 runes",
   139  		}
   140  	}
   141  
   142  	// no validation rules for AltStatName
   143  
   144  	if v, ok := interface{}(m.GetEdsClusterConfig()).(interface{ Validate() error }); ok {
   145  		if err := v.Validate(); err != nil {
   146  			return ClusterValidationError{
   147  				field:  "EdsClusterConfig",
   148  				reason: "embedded message failed validation",
   149  				cause:  err,
   150  			}
   151  		}
   152  	}
   153  
   154  	if d := m.GetConnectTimeout(); d != nil {
   155  		dur, err := d.AsDuration(), d.CheckValid()
   156  		if err != nil {
   157  			return ClusterValidationError{
   158  				field:  "ConnectTimeout",
   159  				reason: "value is not a valid duration",
   160  				cause:  err,
   161  			}
   162  		}
   163  
   164  		gt := time.Duration(0*time.Second + 0*time.Nanosecond)
   165  
   166  		if dur <= gt {
   167  			return ClusterValidationError{
   168  				field:  "ConnectTimeout",
   169  				reason: "value must be greater than 0s",
   170  			}
   171  		}
   172  
   173  	}
   174  
   175  	if v, ok := interface{}(m.GetPerConnectionBufferLimitBytes()).(interface{ Validate() error }); ok {
   176  		if err := v.Validate(); err != nil {
   177  			return ClusterValidationError{
   178  				field:  "PerConnectionBufferLimitBytes",
   179  				reason: "embedded message failed validation",
   180  				cause:  err,
   181  			}
   182  		}
   183  	}
   184  
   185  	if _, ok := Cluster_LbPolicy_name[int32(m.GetLbPolicy())]; !ok {
   186  		return ClusterValidationError{
   187  			field:  "LbPolicy",
   188  			reason: "value must be one of the defined enum values",
   189  		}
   190  	}
   191  
   192  	if v, ok := interface{}(m.GetLoadAssignment()).(interface{ Validate() error }); ok {
   193  		if err := v.Validate(); err != nil {
   194  			return ClusterValidationError{
   195  				field:  "LoadAssignment",
   196  				reason: "embedded message failed validation",
   197  				cause:  err,
   198  			}
   199  		}
   200  	}
   201  
   202  	for idx, item := range m.GetHealthChecks() {
   203  		_, _ = idx, item
   204  
   205  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   206  			if err := v.Validate(); err != nil {
   207  				return ClusterValidationError{
   208  					field:  fmt.Sprintf("HealthChecks[%v]", idx),
   209  					reason: "embedded message failed validation",
   210  					cause:  err,
   211  				}
   212  			}
   213  		}
   214  
   215  	}
   216  
   217  	if v, ok := interface{}(m.GetMaxRequestsPerConnection()).(interface{ Validate() error }); ok {
   218  		if err := v.Validate(); err != nil {
   219  			return ClusterValidationError{
   220  				field:  "MaxRequestsPerConnection",
   221  				reason: "embedded message failed validation",
   222  				cause:  err,
   223  			}
   224  		}
   225  	}
   226  
   227  	if v, ok := interface{}(m.GetCircuitBreakers()).(interface{ Validate() error }); ok {
   228  		if err := v.Validate(); err != nil {
   229  			return ClusterValidationError{
   230  				field:  "CircuitBreakers",
   231  				reason: "embedded message failed validation",
   232  				cause:  err,
   233  			}
   234  		}
   235  	}
   236  
   237  	if v, ok := interface{}(m.GetUpstreamHttpProtocolOptions()).(interface{ Validate() error }); ok {
   238  		if err := v.Validate(); err != nil {
   239  			return ClusterValidationError{
   240  				field:  "UpstreamHttpProtocolOptions",
   241  				reason: "embedded message failed validation",
   242  				cause:  err,
   243  			}
   244  		}
   245  	}
   246  
   247  	if v, ok := interface{}(m.GetCommonHttpProtocolOptions()).(interface{ Validate() error }); ok {
   248  		if err := v.Validate(); err != nil {
   249  			return ClusterValidationError{
   250  				field:  "CommonHttpProtocolOptions",
   251  				reason: "embedded message failed validation",
   252  				cause:  err,
   253  			}
   254  		}
   255  	}
   256  
   257  	if v, ok := interface{}(m.GetHttpProtocolOptions()).(interface{ Validate() error }); ok {
   258  		if err := v.Validate(); err != nil {
   259  			return ClusterValidationError{
   260  				field:  "HttpProtocolOptions",
   261  				reason: "embedded message failed validation",
   262  				cause:  err,
   263  			}
   264  		}
   265  	}
   266  
   267  	if v, ok := interface{}(m.GetHttp2ProtocolOptions()).(interface{ Validate() error }); ok {
   268  		if err := v.Validate(); err != nil {
   269  			return ClusterValidationError{
   270  				field:  "Http2ProtocolOptions",
   271  				reason: "embedded message failed validation",
   272  				cause:  err,
   273  			}
   274  		}
   275  	}
   276  
   277  	for key, val := range m.GetTypedExtensionProtocolOptions() {
   278  		_ = val
   279  
   280  		// no validation rules for TypedExtensionProtocolOptions[key]
   281  
   282  		if v, ok := interface{}(val).(interface{ Validate() error }); ok {
   283  			if err := v.Validate(); err != nil {
   284  				return ClusterValidationError{
   285  					field:  fmt.Sprintf("TypedExtensionProtocolOptions[%v]", key),
   286  					reason: "embedded message failed validation",
   287  					cause:  err,
   288  				}
   289  			}
   290  		}
   291  
   292  	}
   293  
   294  	if d := m.GetDnsRefreshRate(); d != nil {
   295  		dur, err := d.AsDuration(), d.CheckValid()
   296  		if err != nil {
   297  			return ClusterValidationError{
   298  				field:  "DnsRefreshRate",
   299  				reason: "value is not a valid duration",
   300  				cause:  err,
   301  			}
   302  		}
   303  
   304  		gt := time.Duration(0*time.Second + 1000000*time.Nanosecond)
   305  
   306  		if dur <= gt {
   307  			return ClusterValidationError{
   308  				field:  "DnsRefreshRate",
   309  				reason: "value must be greater than 1ms",
   310  			}
   311  		}
   312  
   313  	}
   314  
   315  	if v, ok := interface{}(m.GetDnsFailureRefreshRate()).(interface{ Validate() error }); ok {
   316  		if err := v.Validate(); err != nil {
   317  			return ClusterValidationError{
   318  				field:  "DnsFailureRefreshRate",
   319  				reason: "embedded message failed validation",
   320  				cause:  err,
   321  			}
   322  		}
   323  	}
   324  
   325  	// no validation rules for RespectDnsTtl
   326  
   327  	if _, ok := Cluster_DnsLookupFamily_name[int32(m.GetDnsLookupFamily())]; !ok {
   328  		return ClusterValidationError{
   329  			field:  "DnsLookupFamily",
   330  			reason: "value must be one of the defined enum values",
   331  		}
   332  	}
   333  
   334  	for idx, item := range m.GetDnsResolvers() {
   335  		_, _ = idx, item
   336  
   337  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   338  			if err := v.Validate(); err != nil {
   339  				return ClusterValidationError{
   340  					field:  fmt.Sprintf("DnsResolvers[%v]", idx),
   341  					reason: "embedded message failed validation",
   342  					cause:  err,
   343  				}
   344  			}
   345  		}
   346  
   347  	}
   348  
   349  	// no validation rules for UseTcpForDnsLookups
   350  
   351  	if v, ok := interface{}(m.GetDnsResolutionConfig()).(interface{ Validate() error }); ok {
   352  		if err := v.Validate(); err != nil {
   353  			return ClusterValidationError{
   354  				field:  "DnsResolutionConfig",
   355  				reason: "embedded message failed validation",
   356  				cause:  err,
   357  			}
   358  		}
   359  	}
   360  
   361  	if v, ok := interface{}(m.GetTypedDnsResolverConfig()).(interface{ Validate() error }); ok {
   362  		if err := v.Validate(); err != nil {
   363  			return ClusterValidationError{
   364  				field:  "TypedDnsResolverConfig",
   365  				reason: "embedded message failed validation",
   366  				cause:  err,
   367  			}
   368  		}
   369  	}
   370  
   371  	if v, ok := interface{}(m.GetWaitForWarmOnInit()).(interface{ Validate() error }); ok {
   372  		if err := v.Validate(); err != nil {
   373  			return ClusterValidationError{
   374  				field:  "WaitForWarmOnInit",
   375  				reason: "embedded message failed validation",
   376  				cause:  err,
   377  			}
   378  		}
   379  	}
   380  
   381  	if v, ok := interface{}(m.GetOutlierDetection()).(interface{ Validate() error }); ok {
   382  		if err := v.Validate(); err != nil {
   383  			return ClusterValidationError{
   384  				field:  "OutlierDetection",
   385  				reason: "embedded message failed validation",
   386  				cause:  err,
   387  			}
   388  		}
   389  	}
   390  
   391  	if d := m.GetCleanupInterval(); d != nil {
   392  		dur, err := d.AsDuration(), d.CheckValid()
   393  		if err != nil {
   394  			return ClusterValidationError{
   395  				field:  "CleanupInterval",
   396  				reason: "value is not a valid duration",
   397  				cause:  err,
   398  			}
   399  		}
   400  
   401  		gt := time.Duration(0*time.Second + 0*time.Nanosecond)
   402  
   403  		if dur <= gt {
   404  			return ClusterValidationError{
   405  				field:  "CleanupInterval",
   406  				reason: "value must be greater than 0s",
   407  			}
   408  		}
   409  
   410  	}
   411  
   412  	if v, ok := interface{}(m.GetUpstreamBindConfig()).(interface{ Validate() error }); ok {
   413  		if err := v.Validate(); err != nil {
   414  			return ClusterValidationError{
   415  				field:  "UpstreamBindConfig",
   416  				reason: "embedded message failed validation",
   417  				cause:  err,
   418  			}
   419  		}
   420  	}
   421  
   422  	if v, ok := interface{}(m.GetLbSubsetConfig()).(interface{ Validate() error }); ok {
   423  		if err := v.Validate(); err != nil {
   424  			return ClusterValidationError{
   425  				field:  "LbSubsetConfig",
   426  				reason: "embedded message failed validation",
   427  				cause:  err,
   428  			}
   429  		}
   430  	}
   431  
   432  	if v, ok := interface{}(m.GetCommonLbConfig()).(interface{ Validate() error }); ok {
   433  		if err := v.Validate(); err != nil {
   434  			return ClusterValidationError{
   435  				field:  "CommonLbConfig",
   436  				reason: "embedded message failed validation",
   437  				cause:  err,
   438  			}
   439  		}
   440  	}
   441  
   442  	if v, ok := interface{}(m.GetTransportSocket()).(interface{ Validate() error }); ok {
   443  		if err := v.Validate(); err != nil {
   444  			return ClusterValidationError{
   445  				field:  "TransportSocket",
   446  				reason: "embedded message failed validation",
   447  				cause:  err,
   448  			}
   449  		}
   450  	}
   451  
   452  	if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
   453  		if err := v.Validate(); err != nil {
   454  			return ClusterValidationError{
   455  				field:  "Metadata",
   456  				reason: "embedded message failed validation",
   457  				cause:  err,
   458  			}
   459  		}
   460  	}
   461  
   462  	// no validation rules for ProtocolSelection
   463  
   464  	if v, ok := interface{}(m.GetUpstreamConnectionOptions()).(interface{ Validate() error }); ok {
   465  		if err := v.Validate(); err != nil {
   466  			return ClusterValidationError{
   467  				field:  "UpstreamConnectionOptions",
   468  				reason: "embedded message failed validation",
   469  				cause:  err,
   470  			}
   471  		}
   472  	}
   473  
   474  	// no validation rules for CloseConnectionsOnHostHealthFailure
   475  
   476  	// no validation rules for IgnoreHealthOnHostRemoval
   477  
   478  	for idx, item := range m.GetFilters() {
   479  		_, _ = idx, item
   480  
   481  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   482  			if err := v.Validate(); err != nil {
   483  				return ClusterValidationError{
   484  					field:  fmt.Sprintf("Filters[%v]", idx),
   485  					reason: "embedded message failed validation",
   486  					cause:  err,
   487  				}
   488  			}
   489  		}
   490  
   491  	}
   492  
   493  	if v, ok := interface{}(m.GetLoadBalancingPolicy()).(interface{ Validate() error }); ok {
   494  		if err := v.Validate(); err != nil {
   495  			return ClusterValidationError{
   496  				field:  "LoadBalancingPolicy",
   497  				reason: "embedded message failed validation",
   498  				cause:  err,
   499  			}
   500  		}
   501  	}
   502  
   503  	if v, ok := interface{}(m.GetLrsServer()).(interface{ Validate() error }); ok {
   504  		if err := v.Validate(); err != nil {
   505  			return ClusterValidationError{
   506  				field:  "LrsServer",
   507  				reason: "embedded message failed validation",
   508  				cause:  err,
   509  			}
   510  		}
   511  	}
   512  
   513  	// no validation rules for TrackTimeoutBudgets
   514  
   515  	if v, ok := interface{}(m.GetUpstreamConfig()).(interface{ Validate() error }); ok {
   516  		if err := v.Validate(); err != nil {
   517  			return ClusterValidationError{
   518  				field:  "UpstreamConfig",
   519  				reason: "embedded message failed validation",
   520  				cause:  err,
   521  			}
   522  		}
   523  	}
   524  
   525  	if v, ok := interface{}(m.GetTrackClusterStats()).(interface{ Validate() error }); ok {
   526  		if err := v.Validate(); err != nil {
   527  			return ClusterValidationError{
   528  				field:  "TrackClusterStats",
   529  				reason: "embedded message failed validation",
   530  				cause:  err,
   531  			}
   532  		}
   533  	}
   534  
   535  	if v, ok := interface{}(m.GetPreconnectPolicy()).(interface{ Validate() error }); ok {
   536  		if err := v.Validate(); err != nil {
   537  			return ClusterValidationError{
   538  				field:  "PreconnectPolicy",
   539  				reason: "embedded message failed validation",
   540  				cause:  err,
   541  			}
   542  		}
   543  	}
   544  
   545  	// no validation rules for ConnectionPoolPerDownstreamConnection
   546  
   547  	for idx, item := range m.GetHiddenEnvoyDeprecatedHosts() {
   548  		_, _ = idx, item
   549  
   550  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   551  			if err := v.Validate(); err != nil {
   552  				return ClusterValidationError{
   553  					field:  fmt.Sprintf("HiddenEnvoyDeprecatedHosts[%v]", idx),
   554  					reason: "embedded message failed validation",
   555  					cause:  err,
   556  				}
   557  			}
   558  		}
   559  
   560  	}
   561  
   562  	if v, ok := interface{}(m.GetHiddenEnvoyDeprecatedTlsContext()).(interface{ Validate() error }); ok {
   563  		if err := v.Validate(); err != nil {
   564  			return ClusterValidationError{
   565  				field:  "HiddenEnvoyDeprecatedTlsContext",
   566  				reason: "embedded message failed validation",
   567  				cause:  err,
   568  			}
   569  		}
   570  	}
   571  
   572  	for key, val := range m.GetHiddenEnvoyDeprecatedExtensionProtocolOptions() {
   573  		_ = val
   574  
   575  		// no validation rules for HiddenEnvoyDeprecatedExtensionProtocolOptions[key]
   576  
   577  		if v, ok := interface{}(val).(interface{ Validate() error }); ok {
   578  			if err := v.Validate(); err != nil {
   579  				return ClusterValidationError{
   580  					field:  fmt.Sprintf("HiddenEnvoyDeprecatedExtensionProtocolOptions[%v]", key),
   581  					reason: "embedded message failed validation",
   582  					cause:  err,
   583  				}
   584  			}
   585  		}
   586  
   587  	}
   588  
   589  	switch m.ClusterDiscoveryType.(type) {
   590  
   591  	case *Cluster_Type:
   592  
   593  		if _, ok := Cluster_DiscoveryType_name[int32(m.GetType())]; !ok {
   594  			return ClusterValidationError{
   595  				field:  "Type",
   596  				reason: "value must be one of the defined enum values",
   597  			}
   598  		}
   599  
   600  	case *Cluster_ClusterType:
   601  
   602  		if v, ok := interface{}(m.GetClusterType()).(interface{ Validate() error }); ok {
   603  			if err := v.Validate(); err != nil {
   604  				return ClusterValidationError{
   605  					field:  "ClusterType",
   606  					reason: "embedded message failed validation",
   607  					cause:  err,
   608  				}
   609  			}
   610  		}
   611  
   612  	}
   613  
   614  	switch m.LbConfig.(type) {
   615  
   616  	case *Cluster_RingHashLbConfig_:
   617  
   618  		if v, ok := interface{}(m.GetRingHashLbConfig()).(interface{ Validate() error }); ok {
   619  			if err := v.Validate(); err != nil {
   620  				return ClusterValidationError{
   621  					field:  "RingHashLbConfig",
   622  					reason: "embedded message failed validation",
   623  					cause:  err,
   624  				}
   625  			}
   626  		}
   627  
   628  	case *Cluster_MaglevLbConfig_:
   629  
   630  		if v, ok := interface{}(m.GetMaglevLbConfig()).(interface{ Validate() error }); ok {
   631  			if err := v.Validate(); err != nil {
   632  				return ClusterValidationError{
   633  					field:  "MaglevLbConfig",
   634  					reason: "embedded message failed validation",
   635  					cause:  err,
   636  				}
   637  			}
   638  		}
   639  
   640  	case *Cluster_OriginalDstLbConfig_:
   641  
   642  		if v, ok := interface{}(m.GetOriginalDstLbConfig()).(interface{ Validate() error }); ok {
   643  			if err := v.Validate(); err != nil {
   644  				return ClusterValidationError{
   645  					field:  "OriginalDstLbConfig",
   646  					reason: "embedded message failed validation",
   647  					cause:  err,
   648  				}
   649  			}
   650  		}
   651  
   652  	case *Cluster_LeastRequestLbConfig_:
   653  
   654  		if v, ok := interface{}(m.GetLeastRequestLbConfig()).(interface{ Validate() error }); ok {
   655  			if err := v.Validate(); err != nil {
   656  				return ClusterValidationError{
   657  					field:  "LeastRequestLbConfig",
   658  					reason: "embedded message failed validation",
   659  					cause:  err,
   660  				}
   661  			}
   662  		}
   663  
   664  	}
   665  
   666  	return nil
   667  }
   668  
   669  // ClusterValidationError is the validation error returned by Cluster.Validate
   670  // if the designated constraints aren't met.
   671  type ClusterValidationError struct {
   672  	field  string
   673  	reason string
   674  	cause  error
   675  	key    bool
   676  }
   677  
   678  // Field function returns field value.
   679  func (e ClusterValidationError) Field() string { return e.field }
   680  
   681  // Reason function returns reason value.
   682  func (e ClusterValidationError) Reason() string { return e.reason }
   683  
   684  // Cause function returns cause value.
   685  func (e ClusterValidationError) Cause() error { return e.cause }
   686  
   687  // Key function returns key value.
   688  func (e ClusterValidationError) Key() bool { return e.key }
   689  
   690  // ErrorName returns error name.
   691  func (e ClusterValidationError) ErrorName() string { return "ClusterValidationError" }
   692  
   693  // Error satisfies the builtin error interface
   694  func (e ClusterValidationError) Error() string {
   695  	cause := ""
   696  	if e.cause != nil {
   697  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   698  	}
   699  
   700  	key := ""
   701  	if e.key {
   702  		key = "key for "
   703  	}
   704  
   705  	return fmt.Sprintf(
   706  		"invalid %sCluster.%s: %s%s",
   707  		key,
   708  		e.field,
   709  		e.reason,
   710  		cause)
   711  }
   712  
   713  var _ error = ClusterValidationError{}
   714  
   715  var _ interface {
   716  	Field() string
   717  	Reason() string
   718  	Key() bool
   719  	Cause() error
   720  	ErrorName() string
   721  } = ClusterValidationError{}
   722  
   723  // Validate checks the field values on LoadBalancingPolicy with the rules
   724  // defined in the proto definition for this message. If any rules are
   725  // violated, an error is returned.
   726  func (m *LoadBalancingPolicy) Validate() error {
   727  	if m == nil {
   728  		return nil
   729  	}
   730  
   731  	for idx, item := range m.GetPolicies() {
   732  		_, _ = idx, item
   733  
   734  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   735  			if err := v.Validate(); err != nil {
   736  				return LoadBalancingPolicyValidationError{
   737  					field:  fmt.Sprintf("Policies[%v]", idx),
   738  					reason: "embedded message failed validation",
   739  					cause:  err,
   740  				}
   741  			}
   742  		}
   743  
   744  	}
   745  
   746  	return nil
   747  }
   748  
   749  // LoadBalancingPolicyValidationError is the validation error returned by
   750  // LoadBalancingPolicy.Validate if the designated constraints aren't met.
   751  type LoadBalancingPolicyValidationError struct {
   752  	field  string
   753  	reason string
   754  	cause  error
   755  	key    bool
   756  }
   757  
   758  // Field function returns field value.
   759  func (e LoadBalancingPolicyValidationError) Field() string { return e.field }
   760  
   761  // Reason function returns reason value.
   762  func (e LoadBalancingPolicyValidationError) Reason() string { return e.reason }
   763  
   764  // Cause function returns cause value.
   765  func (e LoadBalancingPolicyValidationError) Cause() error { return e.cause }
   766  
   767  // Key function returns key value.
   768  func (e LoadBalancingPolicyValidationError) Key() bool { return e.key }
   769  
   770  // ErrorName returns error name.
   771  func (e LoadBalancingPolicyValidationError) ErrorName() string {
   772  	return "LoadBalancingPolicyValidationError"
   773  }
   774  
   775  // Error satisfies the builtin error interface
   776  func (e LoadBalancingPolicyValidationError) Error() string {
   777  	cause := ""
   778  	if e.cause != nil {
   779  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   780  	}
   781  
   782  	key := ""
   783  	if e.key {
   784  		key = "key for "
   785  	}
   786  
   787  	return fmt.Sprintf(
   788  		"invalid %sLoadBalancingPolicy.%s: %s%s",
   789  		key,
   790  		e.field,
   791  		e.reason,
   792  		cause)
   793  }
   794  
   795  var _ error = LoadBalancingPolicyValidationError{}
   796  
   797  var _ interface {
   798  	Field() string
   799  	Reason() string
   800  	Key() bool
   801  	Cause() error
   802  	ErrorName() string
   803  } = LoadBalancingPolicyValidationError{}
   804  
   805  // Validate checks the field values on UpstreamBindConfig with the rules
   806  // defined in the proto definition for this message. If any rules are
   807  // violated, an error is returned.
   808  func (m *UpstreamBindConfig) Validate() error {
   809  	if m == nil {
   810  		return nil
   811  	}
   812  
   813  	if v, ok := interface{}(m.GetSourceAddress()).(interface{ Validate() error }); ok {
   814  		if err := v.Validate(); err != nil {
   815  			return UpstreamBindConfigValidationError{
   816  				field:  "SourceAddress",
   817  				reason: "embedded message failed validation",
   818  				cause:  err,
   819  			}
   820  		}
   821  	}
   822  
   823  	return nil
   824  }
   825  
   826  // UpstreamBindConfigValidationError is the validation error returned by
   827  // UpstreamBindConfig.Validate if the designated constraints aren't met.
   828  type UpstreamBindConfigValidationError struct {
   829  	field  string
   830  	reason string
   831  	cause  error
   832  	key    bool
   833  }
   834  
   835  // Field function returns field value.
   836  func (e UpstreamBindConfigValidationError) Field() string { return e.field }
   837  
   838  // Reason function returns reason value.
   839  func (e UpstreamBindConfigValidationError) Reason() string { return e.reason }
   840  
   841  // Cause function returns cause value.
   842  func (e UpstreamBindConfigValidationError) Cause() error { return e.cause }
   843  
   844  // Key function returns key value.
   845  func (e UpstreamBindConfigValidationError) Key() bool { return e.key }
   846  
   847  // ErrorName returns error name.
   848  func (e UpstreamBindConfigValidationError) ErrorName() string {
   849  	return "UpstreamBindConfigValidationError"
   850  }
   851  
   852  // Error satisfies the builtin error interface
   853  func (e UpstreamBindConfigValidationError) Error() string {
   854  	cause := ""
   855  	if e.cause != nil {
   856  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   857  	}
   858  
   859  	key := ""
   860  	if e.key {
   861  		key = "key for "
   862  	}
   863  
   864  	return fmt.Sprintf(
   865  		"invalid %sUpstreamBindConfig.%s: %s%s",
   866  		key,
   867  		e.field,
   868  		e.reason,
   869  		cause)
   870  }
   871  
   872  var _ error = UpstreamBindConfigValidationError{}
   873  
   874  var _ interface {
   875  	Field() string
   876  	Reason() string
   877  	Key() bool
   878  	Cause() error
   879  	ErrorName() string
   880  } = UpstreamBindConfigValidationError{}
   881  
   882  // Validate checks the field values on UpstreamConnectionOptions with the rules
   883  // defined in the proto definition for this message. If any rules are
   884  // violated, an error is returned.
   885  func (m *UpstreamConnectionOptions) Validate() error {
   886  	if m == nil {
   887  		return nil
   888  	}
   889  
   890  	if v, ok := interface{}(m.GetTcpKeepalive()).(interface{ Validate() error }); ok {
   891  		if err := v.Validate(); err != nil {
   892  			return UpstreamConnectionOptionsValidationError{
   893  				field:  "TcpKeepalive",
   894  				reason: "embedded message failed validation",
   895  				cause:  err,
   896  			}
   897  		}
   898  	}
   899  
   900  	return nil
   901  }
   902  
   903  // UpstreamConnectionOptionsValidationError is the validation error returned by
   904  // UpstreamConnectionOptions.Validate if the designated constraints aren't met.
   905  type UpstreamConnectionOptionsValidationError struct {
   906  	field  string
   907  	reason string
   908  	cause  error
   909  	key    bool
   910  }
   911  
   912  // Field function returns field value.
   913  func (e UpstreamConnectionOptionsValidationError) Field() string { return e.field }
   914  
   915  // Reason function returns reason value.
   916  func (e UpstreamConnectionOptionsValidationError) Reason() string { return e.reason }
   917  
   918  // Cause function returns cause value.
   919  func (e UpstreamConnectionOptionsValidationError) Cause() error { return e.cause }
   920  
   921  // Key function returns key value.
   922  func (e UpstreamConnectionOptionsValidationError) Key() bool { return e.key }
   923  
   924  // ErrorName returns error name.
   925  func (e UpstreamConnectionOptionsValidationError) ErrorName() string {
   926  	return "UpstreamConnectionOptionsValidationError"
   927  }
   928  
   929  // Error satisfies the builtin error interface
   930  func (e UpstreamConnectionOptionsValidationError) Error() string {
   931  	cause := ""
   932  	if e.cause != nil {
   933  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   934  	}
   935  
   936  	key := ""
   937  	if e.key {
   938  		key = "key for "
   939  	}
   940  
   941  	return fmt.Sprintf(
   942  		"invalid %sUpstreamConnectionOptions.%s: %s%s",
   943  		key,
   944  		e.field,
   945  		e.reason,
   946  		cause)
   947  }
   948  
   949  var _ error = UpstreamConnectionOptionsValidationError{}
   950  
   951  var _ interface {
   952  	Field() string
   953  	Reason() string
   954  	Key() bool
   955  	Cause() error
   956  	ErrorName() string
   957  } = UpstreamConnectionOptionsValidationError{}
   958  
   959  // Validate checks the field values on TrackClusterStats with the rules defined
   960  // in the proto definition for this message. If any rules are violated, an
   961  // error is returned.
   962  func (m *TrackClusterStats) Validate() error {
   963  	if m == nil {
   964  		return nil
   965  	}
   966  
   967  	// no validation rules for TimeoutBudgets
   968  
   969  	// no validation rules for RequestResponseSizes
   970  
   971  	return nil
   972  }
   973  
   974  // TrackClusterStatsValidationError is the validation error returned by
   975  // TrackClusterStats.Validate if the designated constraints aren't met.
   976  type TrackClusterStatsValidationError struct {
   977  	field  string
   978  	reason string
   979  	cause  error
   980  	key    bool
   981  }
   982  
   983  // Field function returns field value.
   984  func (e TrackClusterStatsValidationError) Field() string { return e.field }
   985  
   986  // Reason function returns reason value.
   987  func (e TrackClusterStatsValidationError) Reason() string { return e.reason }
   988  
   989  // Cause function returns cause value.
   990  func (e TrackClusterStatsValidationError) Cause() error { return e.cause }
   991  
   992  // Key function returns key value.
   993  func (e TrackClusterStatsValidationError) Key() bool { return e.key }
   994  
   995  // ErrorName returns error name.
   996  func (e TrackClusterStatsValidationError) ErrorName() string {
   997  	return "TrackClusterStatsValidationError"
   998  }
   999  
  1000  // Error satisfies the builtin error interface
  1001  func (e TrackClusterStatsValidationError) Error() string {
  1002  	cause := ""
  1003  	if e.cause != nil {
  1004  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1005  	}
  1006  
  1007  	key := ""
  1008  	if e.key {
  1009  		key = "key for "
  1010  	}
  1011  
  1012  	return fmt.Sprintf(
  1013  		"invalid %sTrackClusterStats.%s: %s%s",
  1014  		key,
  1015  		e.field,
  1016  		e.reason,
  1017  		cause)
  1018  }
  1019  
  1020  var _ error = TrackClusterStatsValidationError{}
  1021  
  1022  var _ interface {
  1023  	Field() string
  1024  	Reason() string
  1025  	Key() bool
  1026  	Cause() error
  1027  	ErrorName() string
  1028  } = TrackClusterStatsValidationError{}
  1029  
  1030  // Validate checks the field values on Cluster_TransportSocketMatch with the
  1031  // rules defined in the proto definition for this message. If any rules are
  1032  // violated, an error is returned.
  1033  func (m *Cluster_TransportSocketMatch) Validate() error {
  1034  	if m == nil {
  1035  		return nil
  1036  	}
  1037  
  1038  	if utf8.RuneCountInString(m.GetName()) < 1 {
  1039  		return Cluster_TransportSocketMatchValidationError{
  1040  			field:  "Name",
  1041  			reason: "value length must be at least 1 runes",
  1042  		}
  1043  	}
  1044  
  1045  	if v, ok := interface{}(m.GetMatch()).(interface{ Validate() error }); ok {
  1046  		if err := v.Validate(); err != nil {
  1047  			return Cluster_TransportSocketMatchValidationError{
  1048  				field:  "Match",
  1049  				reason: "embedded message failed validation",
  1050  				cause:  err,
  1051  			}
  1052  		}
  1053  	}
  1054  
  1055  	if v, ok := interface{}(m.GetTransportSocket()).(interface{ Validate() error }); ok {
  1056  		if err := v.Validate(); err != nil {
  1057  			return Cluster_TransportSocketMatchValidationError{
  1058  				field:  "TransportSocket",
  1059  				reason: "embedded message failed validation",
  1060  				cause:  err,
  1061  			}
  1062  		}
  1063  	}
  1064  
  1065  	return nil
  1066  }
  1067  
  1068  // Cluster_TransportSocketMatchValidationError is the validation error returned
  1069  // by Cluster_TransportSocketMatch.Validate if the designated constraints
  1070  // aren't met.
  1071  type Cluster_TransportSocketMatchValidationError struct {
  1072  	field  string
  1073  	reason string
  1074  	cause  error
  1075  	key    bool
  1076  }
  1077  
  1078  // Field function returns field value.
  1079  func (e Cluster_TransportSocketMatchValidationError) Field() string { return e.field }
  1080  
  1081  // Reason function returns reason value.
  1082  func (e Cluster_TransportSocketMatchValidationError) Reason() string { return e.reason }
  1083  
  1084  // Cause function returns cause value.
  1085  func (e Cluster_TransportSocketMatchValidationError) Cause() error { return e.cause }
  1086  
  1087  // Key function returns key value.
  1088  func (e Cluster_TransportSocketMatchValidationError) Key() bool { return e.key }
  1089  
  1090  // ErrorName returns error name.
  1091  func (e Cluster_TransportSocketMatchValidationError) ErrorName() string {
  1092  	return "Cluster_TransportSocketMatchValidationError"
  1093  }
  1094  
  1095  // Error satisfies the builtin error interface
  1096  func (e Cluster_TransportSocketMatchValidationError) Error() string {
  1097  	cause := ""
  1098  	if e.cause != nil {
  1099  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1100  	}
  1101  
  1102  	key := ""
  1103  	if e.key {
  1104  		key = "key for "
  1105  	}
  1106  
  1107  	return fmt.Sprintf(
  1108  		"invalid %sCluster_TransportSocketMatch.%s: %s%s",
  1109  		key,
  1110  		e.field,
  1111  		e.reason,
  1112  		cause)
  1113  }
  1114  
  1115  var _ error = Cluster_TransportSocketMatchValidationError{}
  1116  
  1117  var _ interface {
  1118  	Field() string
  1119  	Reason() string
  1120  	Key() bool
  1121  	Cause() error
  1122  	ErrorName() string
  1123  } = Cluster_TransportSocketMatchValidationError{}
  1124  
  1125  // Validate checks the field values on Cluster_CustomClusterType with the rules
  1126  // defined in the proto definition for this message. If any rules are
  1127  // violated, an error is returned.
  1128  func (m *Cluster_CustomClusterType) Validate() error {
  1129  	if m == nil {
  1130  		return nil
  1131  	}
  1132  
  1133  	if utf8.RuneCountInString(m.GetName()) < 1 {
  1134  		return Cluster_CustomClusterTypeValidationError{
  1135  			field:  "Name",
  1136  			reason: "value length must be at least 1 runes",
  1137  		}
  1138  	}
  1139  
  1140  	if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok {
  1141  		if err := v.Validate(); err != nil {
  1142  			return Cluster_CustomClusterTypeValidationError{
  1143  				field:  "TypedConfig",
  1144  				reason: "embedded message failed validation",
  1145  				cause:  err,
  1146  			}
  1147  		}
  1148  	}
  1149  
  1150  	return nil
  1151  }
  1152  
  1153  // Cluster_CustomClusterTypeValidationError is the validation error returned by
  1154  // Cluster_CustomClusterType.Validate if the designated constraints aren't met.
  1155  type Cluster_CustomClusterTypeValidationError struct {
  1156  	field  string
  1157  	reason string
  1158  	cause  error
  1159  	key    bool
  1160  }
  1161  
  1162  // Field function returns field value.
  1163  func (e Cluster_CustomClusterTypeValidationError) Field() string { return e.field }
  1164  
  1165  // Reason function returns reason value.
  1166  func (e Cluster_CustomClusterTypeValidationError) Reason() string { return e.reason }
  1167  
  1168  // Cause function returns cause value.
  1169  func (e Cluster_CustomClusterTypeValidationError) Cause() error { return e.cause }
  1170  
  1171  // Key function returns key value.
  1172  func (e Cluster_CustomClusterTypeValidationError) Key() bool { return e.key }
  1173  
  1174  // ErrorName returns error name.
  1175  func (e Cluster_CustomClusterTypeValidationError) ErrorName() string {
  1176  	return "Cluster_CustomClusterTypeValidationError"
  1177  }
  1178  
  1179  // Error satisfies the builtin error interface
  1180  func (e Cluster_CustomClusterTypeValidationError) Error() string {
  1181  	cause := ""
  1182  	if e.cause != nil {
  1183  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1184  	}
  1185  
  1186  	key := ""
  1187  	if e.key {
  1188  		key = "key for "
  1189  	}
  1190  
  1191  	return fmt.Sprintf(
  1192  		"invalid %sCluster_CustomClusterType.%s: %s%s",
  1193  		key,
  1194  		e.field,
  1195  		e.reason,
  1196  		cause)
  1197  }
  1198  
  1199  var _ error = Cluster_CustomClusterTypeValidationError{}
  1200  
  1201  var _ interface {
  1202  	Field() string
  1203  	Reason() string
  1204  	Key() bool
  1205  	Cause() error
  1206  	ErrorName() string
  1207  } = Cluster_CustomClusterTypeValidationError{}
  1208  
  1209  // Validate checks the field values on Cluster_EdsClusterConfig with the rules
  1210  // defined in the proto definition for this message. If any rules are
  1211  // violated, an error is returned.
  1212  func (m *Cluster_EdsClusterConfig) Validate() error {
  1213  	if m == nil {
  1214  		return nil
  1215  	}
  1216  
  1217  	if v, ok := interface{}(m.GetEdsConfig()).(interface{ Validate() error }); ok {
  1218  		if err := v.Validate(); err != nil {
  1219  			return Cluster_EdsClusterConfigValidationError{
  1220  				field:  "EdsConfig",
  1221  				reason: "embedded message failed validation",
  1222  				cause:  err,
  1223  			}
  1224  		}
  1225  	}
  1226  
  1227  	// no validation rules for ServiceName
  1228  
  1229  	return nil
  1230  }
  1231  
  1232  // Cluster_EdsClusterConfigValidationError is the validation error returned by
  1233  // Cluster_EdsClusterConfig.Validate if the designated constraints aren't met.
  1234  type Cluster_EdsClusterConfigValidationError struct {
  1235  	field  string
  1236  	reason string
  1237  	cause  error
  1238  	key    bool
  1239  }
  1240  
  1241  // Field function returns field value.
  1242  func (e Cluster_EdsClusterConfigValidationError) Field() string { return e.field }
  1243  
  1244  // Reason function returns reason value.
  1245  func (e Cluster_EdsClusterConfigValidationError) Reason() string { return e.reason }
  1246  
  1247  // Cause function returns cause value.
  1248  func (e Cluster_EdsClusterConfigValidationError) Cause() error { return e.cause }
  1249  
  1250  // Key function returns key value.
  1251  func (e Cluster_EdsClusterConfigValidationError) Key() bool { return e.key }
  1252  
  1253  // ErrorName returns error name.
  1254  func (e Cluster_EdsClusterConfigValidationError) ErrorName() string {
  1255  	return "Cluster_EdsClusterConfigValidationError"
  1256  }
  1257  
  1258  // Error satisfies the builtin error interface
  1259  func (e Cluster_EdsClusterConfigValidationError) Error() string {
  1260  	cause := ""
  1261  	if e.cause != nil {
  1262  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1263  	}
  1264  
  1265  	key := ""
  1266  	if e.key {
  1267  		key = "key for "
  1268  	}
  1269  
  1270  	return fmt.Sprintf(
  1271  		"invalid %sCluster_EdsClusterConfig.%s: %s%s",
  1272  		key,
  1273  		e.field,
  1274  		e.reason,
  1275  		cause)
  1276  }
  1277  
  1278  var _ error = Cluster_EdsClusterConfigValidationError{}
  1279  
  1280  var _ interface {
  1281  	Field() string
  1282  	Reason() string
  1283  	Key() bool
  1284  	Cause() error
  1285  	ErrorName() string
  1286  } = Cluster_EdsClusterConfigValidationError{}
  1287  
  1288  // Validate checks the field values on Cluster_LbSubsetConfig with the rules
  1289  // defined in the proto definition for this message. If any rules are
  1290  // violated, an error is returned.
  1291  func (m *Cluster_LbSubsetConfig) Validate() error {
  1292  	if m == nil {
  1293  		return nil
  1294  	}
  1295  
  1296  	if _, ok := Cluster_LbSubsetConfig_LbSubsetFallbackPolicy_name[int32(m.GetFallbackPolicy())]; !ok {
  1297  		return Cluster_LbSubsetConfigValidationError{
  1298  			field:  "FallbackPolicy",
  1299  			reason: "value must be one of the defined enum values",
  1300  		}
  1301  	}
  1302  
  1303  	if v, ok := interface{}(m.GetDefaultSubset()).(interface{ Validate() error }); ok {
  1304  		if err := v.Validate(); err != nil {
  1305  			return Cluster_LbSubsetConfigValidationError{
  1306  				field:  "DefaultSubset",
  1307  				reason: "embedded message failed validation",
  1308  				cause:  err,
  1309  			}
  1310  		}
  1311  	}
  1312  
  1313  	for idx, item := range m.GetSubsetSelectors() {
  1314  		_, _ = idx, item
  1315  
  1316  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  1317  			if err := v.Validate(); err != nil {
  1318  				return Cluster_LbSubsetConfigValidationError{
  1319  					field:  fmt.Sprintf("SubsetSelectors[%v]", idx),
  1320  					reason: "embedded message failed validation",
  1321  					cause:  err,
  1322  				}
  1323  			}
  1324  		}
  1325  
  1326  	}
  1327  
  1328  	// no validation rules for LocalityWeightAware
  1329  
  1330  	// no validation rules for ScaleLocalityWeight
  1331  
  1332  	// no validation rules for PanicModeAny
  1333  
  1334  	// no validation rules for ListAsAny
  1335  
  1336  	return nil
  1337  }
  1338  
  1339  // Cluster_LbSubsetConfigValidationError is the validation error returned by
  1340  // Cluster_LbSubsetConfig.Validate if the designated constraints aren't met.
  1341  type Cluster_LbSubsetConfigValidationError struct {
  1342  	field  string
  1343  	reason string
  1344  	cause  error
  1345  	key    bool
  1346  }
  1347  
  1348  // Field function returns field value.
  1349  func (e Cluster_LbSubsetConfigValidationError) Field() string { return e.field }
  1350  
  1351  // Reason function returns reason value.
  1352  func (e Cluster_LbSubsetConfigValidationError) Reason() string { return e.reason }
  1353  
  1354  // Cause function returns cause value.
  1355  func (e Cluster_LbSubsetConfigValidationError) Cause() error { return e.cause }
  1356  
  1357  // Key function returns key value.
  1358  func (e Cluster_LbSubsetConfigValidationError) Key() bool { return e.key }
  1359  
  1360  // ErrorName returns error name.
  1361  func (e Cluster_LbSubsetConfigValidationError) ErrorName() string {
  1362  	return "Cluster_LbSubsetConfigValidationError"
  1363  }
  1364  
  1365  // Error satisfies the builtin error interface
  1366  func (e Cluster_LbSubsetConfigValidationError) Error() string {
  1367  	cause := ""
  1368  	if e.cause != nil {
  1369  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1370  	}
  1371  
  1372  	key := ""
  1373  	if e.key {
  1374  		key = "key for "
  1375  	}
  1376  
  1377  	return fmt.Sprintf(
  1378  		"invalid %sCluster_LbSubsetConfig.%s: %s%s",
  1379  		key,
  1380  		e.field,
  1381  		e.reason,
  1382  		cause)
  1383  }
  1384  
  1385  var _ error = Cluster_LbSubsetConfigValidationError{}
  1386  
  1387  var _ interface {
  1388  	Field() string
  1389  	Reason() string
  1390  	Key() bool
  1391  	Cause() error
  1392  	ErrorName() string
  1393  } = Cluster_LbSubsetConfigValidationError{}
  1394  
  1395  // Validate checks the field values on Cluster_LeastRequestLbConfig with the
  1396  // rules defined in the proto definition for this message. If any rules are
  1397  // violated, an error is returned.
  1398  func (m *Cluster_LeastRequestLbConfig) Validate() error {
  1399  	if m == nil {
  1400  		return nil
  1401  	}
  1402  
  1403  	if wrapper := m.GetChoiceCount(); wrapper != nil {
  1404  
  1405  		if wrapper.GetValue() < 2 {
  1406  			return Cluster_LeastRequestLbConfigValidationError{
  1407  				field:  "ChoiceCount",
  1408  				reason: "value must be greater than or equal to 2",
  1409  			}
  1410  		}
  1411  
  1412  	}
  1413  
  1414  	if v, ok := interface{}(m.GetActiveRequestBias()).(interface{ Validate() error }); ok {
  1415  		if err := v.Validate(); err != nil {
  1416  			return Cluster_LeastRequestLbConfigValidationError{
  1417  				field:  "ActiveRequestBias",
  1418  				reason: "embedded message failed validation",
  1419  				cause:  err,
  1420  			}
  1421  		}
  1422  	}
  1423  
  1424  	return nil
  1425  }
  1426  
  1427  // Cluster_LeastRequestLbConfigValidationError is the validation error returned
  1428  // by Cluster_LeastRequestLbConfig.Validate if the designated constraints
  1429  // aren't met.
  1430  type Cluster_LeastRequestLbConfigValidationError struct {
  1431  	field  string
  1432  	reason string
  1433  	cause  error
  1434  	key    bool
  1435  }
  1436  
  1437  // Field function returns field value.
  1438  func (e Cluster_LeastRequestLbConfigValidationError) Field() string { return e.field }
  1439  
  1440  // Reason function returns reason value.
  1441  func (e Cluster_LeastRequestLbConfigValidationError) Reason() string { return e.reason }
  1442  
  1443  // Cause function returns cause value.
  1444  func (e Cluster_LeastRequestLbConfigValidationError) Cause() error { return e.cause }
  1445  
  1446  // Key function returns key value.
  1447  func (e Cluster_LeastRequestLbConfigValidationError) Key() bool { return e.key }
  1448  
  1449  // ErrorName returns error name.
  1450  func (e Cluster_LeastRequestLbConfigValidationError) ErrorName() string {
  1451  	return "Cluster_LeastRequestLbConfigValidationError"
  1452  }
  1453  
  1454  // Error satisfies the builtin error interface
  1455  func (e Cluster_LeastRequestLbConfigValidationError) Error() string {
  1456  	cause := ""
  1457  	if e.cause != nil {
  1458  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1459  	}
  1460  
  1461  	key := ""
  1462  	if e.key {
  1463  		key = "key for "
  1464  	}
  1465  
  1466  	return fmt.Sprintf(
  1467  		"invalid %sCluster_LeastRequestLbConfig.%s: %s%s",
  1468  		key,
  1469  		e.field,
  1470  		e.reason,
  1471  		cause)
  1472  }
  1473  
  1474  var _ error = Cluster_LeastRequestLbConfigValidationError{}
  1475  
  1476  var _ interface {
  1477  	Field() string
  1478  	Reason() string
  1479  	Key() bool
  1480  	Cause() error
  1481  	ErrorName() string
  1482  } = Cluster_LeastRequestLbConfigValidationError{}
  1483  
  1484  // Validate checks the field values on Cluster_RingHashLbConfig with the rules
  1485  // defined in the proto definition for this message. If any rules are
  1486  // violated, an error is returned.
  1487  func (m *Cluster_RingHashLbConfig) Validate() error {
  1488  	if m == nil {
  1489  		return nil
  1490  	}
  1491  
  1492  	if wrapper := m.GetMinimumRingSize(); wrapper != nil {
  1493  
  1494  		if wrapper.GetValue() > 8388608 {
  1495  			return Cluster_RingHashLbConfigValidationError{
  1496  				field:  "MinimumRingSize",
  1497  				reason: "value must be less than or equal to 8388608",
  1498  			}
  1499  		}
  1500  
  1501  	}
  1502  
  1503  	if _, ok := Cluster_RingHashLbConfig_HashFunction_name[int32(m.GetHashFunction())]; !ok {
  1504  		return Cluster_RingHashLbConfigValidationError{
  1505  			field:  "HashFunction",
  1506  			reason: "value must be one of the defined enum values",
  1507  		}
  1508  	}
  1509  
  1510  	if wrapper := m.GetMaximumRingSize(); wrapper != nil {
  1511  
  1512  		if wrapper.GetValue() > 8388608 {
  1513  			return Cluster_RingHashLbConfigValidationError{
  1514  				field:  "MaximumRingSize",
  1515  				reason: "value must be less than or equal to 8388608",
  1516  			}
  1517  		}
  1518  
  1519  	}
  1520  
  1521  	return nil
  1522  }
  1523  
  1524  // Cluster_RingHashLbConfigValidationError is the validation error returned by
  1525  // Cluster_RingHashLbConfig.Validate if the designated constraints aren't met.
  1526  type Cluster_RingHashLbConfigValidationError struct {
  1527  	field  string
  1528  	reason string
  1529  	cause  error
  1530  	key    bool
  1531  }
  1532  
  1533  // Field function returns field value.
  1534  func (e Cluster_RingHashLbConfigValidationError) Field() string { return e.field }
  1535  
  1536  // Reason function returns reason value.
  1537  func (e Cluster_RingHashLbConfigValidationError) Reason() string { return e.reason }
  1538  
  1539  // Cause function returns cause value.
  1540  func (e Cluster_RingHashLbConfigValidationError) Cause() error { return e.cause }
  1541  
  1542  // Key function returns key value.
  1543  func (e Cluster_RingHashLbConfigValidationError) Key() bool { return e.key }
  1544  
  1545  // ErrorName returns error name.
  1546  func (e Cluster_RingHashLbConfigValidationError) ErrorName() string {
  1547  	return "Cluster_RingHashLbConfigValidationError"
  1548  }
  1549  
  1550  // Error satisfies the builtin error interface
  1551  func (e Cluster_RingHashLbConfigValidationError) Error() string {
  1552  	cause := ""
  1553  	if e.cause != nil {
  1554  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1555  	}
  1556  
  1557  	key := ""
  1558  	if e.key {
  1559  		key = "key for "
  1560  	}
  1561  
  1562  	return fmt.Sprintf(
  1563  		"invalid %sCluster_RingHashLbConfig.%s: %s%s",
  1564  		key,
  1565  		e.field,
  1566  		e.reason,
  1567  		cause)
  1568  }
  1569  
  1570  var _ error = Cluster_RingHashLbConfigValidationError{}
  1571  
  1572  var _ interface {
  1573  	Field() string
  1574  	Reason() string
  1575  	Key() bool
  1576  	Cause() error
  1577  	ErrorName() string
  1578  } = Cluster_RingHashLbConfigValidationError{}
  1579  
  1580  // Validate checks the field values on Cluster_MaglevLbConfig with the rules
  1581  // defined in the proto definition for this message. If any rules are
  1582  // violated, an error is returned.
  1583  func (m *Cluster_MaglevLbConfig) Validate() error {
  1584  	if m == nil {
  1585  		return nil
  1586  	}
  1587  
  1588  	if wrapper := m.GetTableSize(); wrapper != nil {
  1589  
  1590  		if wrapper.GetValue() > 5000011 {
  1591  			return Cluster_MaglevLbConfigValidationError{
  1592  				field:  "TableSize",
  1593  				reason: "value must be less than or equal to 5000011",
  1594  			}
  1595  		}
  1596  
  1597  	}
  1598  
  1599  	return nil
  1600  }
  1601  
  1602  // Cluster_MaglevLbConfigValidationError is the validation error returned by
  1603  // Cluster_MaglevLbConfig.Validate if the designated constraints aren't met.
  1604  type Cluster_MaglevLbConfigValidationError struct {
  1605  	field  string
  1606  	reason string
  1607  	cause  error
  1608  	key    bool
  1609  }
  1610  
  1611  // Field function returns field value.
  1612  func (e Cluster_MaglevLbConfigValidationError) Field() string { return e.field }
  1613  
  1614  // Reason function returns reason value.
  1615  func (e Cluster_MaglevLbConfigValidationError) Reason() string { return e.reason }
  1616  
  1617  // Cause function returns cause value.
  1618  func (e Cluster_MaglevLbConfigValidationError) Cause() error { return e.cause }
  1619  
  1620  // Key function returns key value.
  1621  func (e Cluster_MaglevLbConfigValidationError) Key() bool { return e.key }
  1622  
  1623  // ErrorName returns error name.
  1624  func (e Cluster_MaglevLbConfigValidationError) ErrorName() string {
  1625  	return "Cluster_MaglevLbConfigValidationError"
  1626  }
  1627  
  1628  // Error satisfies the builtin error interface
  1629  func (e Cluster_MaglevLbConfigValidationError) Error() string {
  1630  	cause := ""
  1631  	if e.cause != nil {
  1632  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1633  	}
  1634  
  1635  	key := ""
  1636  	if e.key {
  1637  		key = "key for "
  1638  	}
  1639  
  1640  	return fmt.Sprintf(
  1641  		"invalid %sCluster_MaglevLbConfig.%s: %s%s",
  1642  		key,
  1643  		e.field,
  1644  		e.reason,
  1645  		cause)
  1646  }
  1647  
  1648  var _ error = Cluster_MaglevLbConfigValidationError{}
  1649  
  1650  var _ interface {
  1651  	Field() string
  1652  	Reason() string
  1653  	Key() bool
  1654  	Cause() error
  1655  	ErrorName() string
  1656  } = Cluster_MaglevLbConfigValidationError{}
  1657  
  1658  // Validate checks the field values on Cluster_OriginalDstLbConfig with the
  1659  // rules defined in the proto definition for this message. If any rules are
  1660  // violated, an error is returned.
  1661  func (m *Cluster_OriginalDstLbConfig) Validate() error {
  1662  	if m == nil {
  1663  		return nil
  1664  	}
  1665  
  1666  	// no validation rules for UseHttpHeader
  1667  
  1668  	return nil
  1669  }
  1670  
  1671  // Cluster_OriginalDstLbConfigValidationError is the validation error returned
  1672  // by Cluster_OriginalDstLbConfig.Validate if the designated constraints
  1673  // aren't met.
  1674  type Cluster_OriginalDstLbConfigValidationError struct {
  1675  	field  string
  1676  	reason string
  1677  	cause  error
  1678  	key    bool
  1679  }
  1680  
  1681  // Field function returns field value.
  1682  func (e Cluster_OriginalDstLbConfigValidationError) Field() string { return e.field }
  1683  
  1684  // Reason function returns reason value.
  1685  func (e Cluster_OriginalDstLbConfigValidationError) Reason() string { return e.reason }
  1686  
  1687  // Cause function returns cause value.
  1688  func (e Cluster_OriginalDstLbConfigValidationError) Cause() error { return e.cause }
  1689  
  1690  // Key function returns key value.
  1691  func (e Cluster_OriginalDstLbConfigValidationError) Key() bool { return e.key }
  1692  
  1693  // ErrorName returns error name.
  1694  func (e Cluster_OriginalDstLbConfigValidationError) ErrorName() string {
  1695  	return "Cluster_OriginalDstLbConfigValidationError"
  1696  }
  1697  
  1698  // Error satisfies the builtin error interface
  1699  func (e Cluster_OriginalDstLbConfigValidationError) Error() string {
  1700  	cause := ""
  1701  	if e.cause != nil {
  1702  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1703  	}
  1704  
  1705  	key := ""
  1706  	if e.key {
  1707  		key = "key for "
  1708  	}
  1709  
  1710  	return fmt.Sprintf(
  1711  		"invalid %sCluster_OriginalDstLbConfig.%s: %s%s",
  1712  		key,
  1713  		e.field,
  1714  		e.reason,
  1715  		cause)
  1716  }
  1717  
  1718  var _ error = Cluster_OriginalDstLbConfigValidationError{}
  1719  
  1720  var _ interface {
  1721  	Field() string
  1722  	Reason() string
  1723  	Key() bool
  1724  	Cause() error
  1725  	ErrorName() string
  1726  } = Cluster_OriginalDstLbConfigValidationError{}
  1727  
  1728  // Validate checks the field values on Cluster_CommonLbConfig with the rules
  1729  // defined in the proto definition for this message. If any rules are
  1730  // violated, an error is returned.
  1731  func (m *Cluster_CommonLbConfig) Validate() error {
  1732  	if m == nil {
  1733  		return nil
  1734  	}
  1735  
  1736  	if v, ok := interface{}(m.GetHealthyPanicThreshold()).(interface{ Validate() error }); ok {
  1737  		if err := v.Validate(); err != nil {
  1738  			return Cluster_CommonLbConfigValidationError{
  1739  				field:  "HealthyPanicThreshold",
  1740  				reason: "embedded message failed validation",
  1741  				cause:  err,
  1742  			}
  1743  		}
  1744  	}
  1745  
  1746  	if v, ok := interface{}(m.GetUpdateMergeWindow()).(interface{ Validate() error }); ok {
  1747  		if err := v.Validate(); err != nil {
  1748  			return Cluster_CommonLbConfigValidationError{
  1749  				field:  "UpdateMergeWindow",
  1750  				reason: "embedded message failed validation",
  1751  				cause:  err,
  1752  			}
  1753  		}
  1754  	}
  1755  
  1756  	// no validation rules for IgnoreNewHostsUntilFirstHc
  1757  
  1758  	// no validation rules for CloseConnectionsOnHostSetChange
  1759  
  1760  	if v, ok := interface{}(m.GetConsistentHashingLbConfig()).(interface{ Validate() error }); ok {
  1761  		if err := v.Validate(); err != nil {
  1762  			return Cluster_CommonLbConfigValidationError{
  1763  				field:  "ConsistentHashingLbConfig",
  1764  				reason: "embedded message failed validation",
  1765  				cause:  err,
  1766  			}
  1767  		}
  1768  	}
  1769  
  1770  	switch m.LocalityConfigSpecifier.(type) {
  1771  
  1772  	case *Cluster_CommonLbConfig_ZoneAwareLbConfig_:
  1773  
  1774  		if v, ok := interface{}(m.GetZoneAwareLbConfig()).(interface{ Validate() error }); ok {
  1775  			if err := v.Validate(); err != nil {
  1776  				return Cluster_CommonLbConfigValidationError{
  1777  					field:  "ZoneAwareLbConfig",
  1778  					reason: "embedded message failed validation",
  1779  					cause:  err,
  1780  				}
  1781  			}
  1782  		}
  1783  
  1784  	case *Cluster_CommonLbConfig_LocalityWeightedLbConfig_:
  1785  
  1786  		if v, ok := interface{}(m.GetLocalityWeightedLbConfig()).(interface{ Validate() error }); ok {
  1787  			if err := v.Validate(); err != nil {
  1788  				return Cluster_CommonLbConfigValidationError{
  1789  					field:  "LocalityWeightedLbConfig",
  1790  					reason: "embedded message failed validation",
  1791  					cause:  err,
  1792  				}
  1793  			}
  1794  		}
  1795  
  1796  	}
  1797  
  1798  	return nil
  1799  }
  1800  
  1801  // Cluster_CommonLbConfigValidationError is the validation error returned by
  1802  // Cluster_CommonLbConfig.Validate if the designated constraints aren't met.
  1803  type Cluster_CommonLbConfigValidationError struct {
  1804  	field  string
  1805  	reason string
  1806  	cause  error
  1807  	key    bool
  1808  }
  1809  
  1810  // Field function returns field value.
  1811  func (e Cluster_CommonLbConfigValidationError) Field() string { return e.field }
  1812  
  1813  // Reason function returns reason value.
  1814  func (e Cluster_CommonLbConfigValidationError) Reason() string { return e.reason }
  1815  
  1816  // Cause function returns cause value.
  1817  func (e Cluster_CommonLbConfigValidationError) Cause() error { return e.cause }
  1818  
  1819  // Key function returns key value.
  1820  func (e Cluster_CommonLbConfigValidationError) Key() bool { return e.key }
  1821  
  1822  // ErrorName returns error name.
  1823  func (e Cluster_CommonLbConfigValidationError) ErrorName() string {
  1824  	return "Cluster_CommonLbConfigValidationError"
  1825  }
  1826  
  1827  // Error satisfies the builtin error interface
  1828  func (e Cluster_CommonLbConfigValidationError) Error() string {
  1829  	cause := ""
  1830  	if e.cause != nil {
  1831  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1832  	}
  1833  
  1834  	key := ""
  1835  	if e.key {
  1836  		key = "key for "
  1837  	}
  1838  
  1839  	return fmt.Sprintf(
  1840  		"invalid %sCluster_CommonLbConfig.%s: %s%s",
  1841  		key,
  1842  		e.field,
  1843  		e.reason,
  1844  		cause)
  1845  }
  1846  
  1847  var _ error = Cluster_CommonLbConfigValidationError{}
  1848  
  1849  var _ interface {
  1850  	Field() string
  1851  	Reason() string
  1852  	Key() bool
  1853  	Cause() error
  1854  	ErrorName() string
  1855  } = Cluster_CommonLbConfigValidationError{}
  1856  
  1857  // Validate checks the field values on Cluster_RefreshRate with the rules
  1858  // defined in the proto definition for this message. If any rules are
  1859  // violated, an error is returned.
  1860  func (m *Cluster_RefreshRate) Validate() error {
  1861  	if m == nil {
  1862  		return nil
  1863  	}
  1864  
  1865  	if m.GetBaseInterval() == nil {
  1866  		return Cluster_RefreshRateValidationError{
  1867  			field:  "BaseInterval",
  1868  			reason: "value is required",
  1869  		}
  1870  	}
  1871  
  1872  	if d := m.GetBaseInterval(); d != nil {
  1873  		dur, err := d.AsDuration(), d.CheckValid()
  1874  		if err != nil {
  1875  			return Cluster_RefreshRateValidationError{
  1876  				field:  "BaseInterval",
  1877  				reason: "value is not a valid duration",
  1878  				cause:  err,
  1879  			}
  1880  		}
  1881  
  1882  		gt := time.Duration(0*time.Second + 1000000*time.Nanosecond)
  1883  
  1884  		if dur <= gt {
  1885  			return Cluster_RefreshRateValidationError{
  1886  				field:  "BaseInterval",
  1887  				reason: "value must be greater than 1ms",
  1888  			}
  1889  		}
  1890  
  1891  	}
  1892  
  1893  	if d := m.GetMaxInterval(); d != nil {
  1894  		dur, err := d.AsDuration(), d.CheckValid()
  1895  		if err != nil {
  1896  			return Cluster_RefreshRateValidationError{
  1897  				field:  "MaxInterval",
  1898  				reason: "value is not a valid duration",
  1899  				cause:  err,
  1900  			}
  1901  		}
  1902  
  1903  		gt := time.Duration(0*time.Second + 1000000*time.Nanosecond)
  1904  
  1905  		if dur <= gt {
  1906  			return Cluster_RefreshRateValidationError{
  1907  				field:  "MaxInterval",
  1908  				reason: "value must be greater than 1ms",
  1909  			}
  1910  		}
  1911  
  1912  	}
  1913  
  1914  	return nil
  1915  }
  1916  
  1917  // Cluster_RefreshRateValidationError is the validation error returned by
  1918  // Cluster_RefreshRate.Validate if the designated constraints aren't met.
  1919  type Cluster_RefreshRateValidationError struct {
  1920  	field  string
  1921  	reason string
  1922  	cause  error
  1923  	key    bool
  1924  }
  1925  
  1926  // Field function returns field value.
  1927  func (e Cluster_RefreshRateValidationError) Field() string { return e.field }
  1928  
  1929  // Reason function returns reason value.
  1930  func (e Cluster_RefreshRateValidationError) Reason() string { return e.reason }
  1931  
  1932  // Cause function returns cause value.
  1933  func (e Cluster_RefreshRateValidationError) Cause() error { return e.cause }
  1934  
  1935  // Key function returns key value.
  1936  func (e Cluster_RefreshRateValidationError) Key() bool { return e.key }
  1937  
  1938  // ErrorName returns error name.
  1939  func (e Cluster_RefreshRateValidationError) ErrorName() string {
  1940  	return "Cluster_RefreshRateValidationError"
  1941  }
  1942  
  1943  // Error satisfies the builtin error interface
  1944  func (e Cluster_RefreshRateValidationError) Error() string {
  1945  	cause := ""
  1946  	if e.cause != nil {
  1947  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1948  	}
  1949  
  1950  	key := ""
  1951  	if e.key {
  1952  		key = "key for "
  1953  	}
  1954  
  1955  	return fmt.Sprintf(
  1956  		"invalid %sCluster_RefreshRate.%s: %s%s",
  1957  		key,
  1958  		e.field,
  1959  		e.reason,
  1960  		cause)
  1961  }
  1962  
  1963  var _ error = Cluster_RefreshRateValidationError{}
  1964  
  1965  var _ interface {
  1966  	Field() string
  1967  	Reason() string
  1968  	Key() bool
  1969  	Cause() error
  1970  	ErrorName() string
  1971  } = Cluster_RefreshRateValidationError{}
  1972  
  1973  // Validate checks the field values on Cluster_PreconnectPolicy with the rules
  1974  // defined in the proto definition for this message. If any rules are
  1975  // violated, an error is returned.
  1976  func (m *Cluster_PreconnectPolicy) Validate() error {
  1977  	if m == nil {
  1978  		return nil
  1979  	}
  1980  
  1981  	if wrapper := m.GetPerUpstreamPreconnectRatio(); wrapper != nil {
  1982  
  1983  		if val := wrapper.GetValue(); val < 1 || val > 3 {
  1984  			return Cluster_PreconnectPolicyValidationError{
  1985  				field:  "PerUpstreamPreconnectRatio",
  1986  				reason: "value must be inside range [1, 3]",
  1987  			}
  1988  		}
  1989  
  1990  	}
  1991  
  1992  	if wrapper := m.GetPredictivePreconnectRatio(); wrapper != nil {
  1993  
  1994  		if val := wrapper.GetValue(); val < 1 || val > 3 {
  1995  			return Cluster_PreconnectPolicyValidationError{
  1996  				field:  "PredictivePreconnectRatio",
  1997  				reason: "value must be inside range [1, 3]",
  1998  			}
  1999  		}
  2000  
  2001  	}
  2002  
  2003  	return nil
  2004  }
  2005  
  2006  // Cluster_PreconnectPolicyValidationError is the validation error returned by
  2007  // Cluster_PreconnectPolicy.Validate if the designated constraints aren't met.
  2008  type Cluster_PreconnectPolicyValidationError struct {
  2009  	field  string
  2010  	reason string
  2011  	cause  error
  2012  	key    bool
  2013  }
  2014  
  2015  // Field function returns field value.
  2016  func (e Cluster_PreconnectPolicyValidationError) Field() string { return e.field }
  2017  
  2018  // Reason function returns reason value.
  2019  func (e Cluster_PreconnectPolicyValidationError) Reason() string { return e.reason }
  2020  
  2021  // Cause function returns cause value.
  2022  func (e Cluster_PreconnectPolicyValidationError) Cause() error { return e.cause }
  2023  
  2024  // Key function returns key value.
  2025  func (e Cluster_PreconnectPolicyValidationError) Key() bool { return e.key }
  2026  
  2027  // ErrorName returns error name.
  2028  func (e Cluster_PreconnectPolicyValidationError) ErrorName() string {
  2029  	return "Cluster_PreconnectPolicyValidationError"
  2030  }
  2031  
  2032  // Error satisfies the builtin error interface
  2033  func (e Cluster_PreconnectPolicyValidationError) Error() string {
  2034  	cause := ""
  2035  	if e.cause != nil {
  2036  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  2037  	}
  2038  
  2039  	key := ""
  2040  	if e.key {
  2041  		key = "key for "
  2042  	}
  2043  
  2044  	return fmt.Sprintf(
  2045  		"invalid %sCluster_PreconnectPolicy.%s: %s%s",
  2046  		key,
  2047  		e.field,
  2048  		e.reason,
  2049  		cause)
  2050  }
  2051  
  2052  var _ error = Cluster_PreconnectPolicyValidationError{}
  2053  
  2054  var _ interface {
  2055  	Field() string
  2056  	Reason() string
  2057  	Key() bool
  2058  	Cause() error
  2059  	ErrorName() string
  2060  } = Cluster_PreconnectPolicyValidationError{}
  2061  
  2062  // Validate checks the field values on Cluster_LbSubsetConfig_LbSubsetSelector
  2063  // with the rules defined in the proto definition for this message. If any
  2064  // rules are violated, an error is returned.
  2065  func (m *Cluster_LbSubsetConfig_LbSubsetSelector) Validate() error {
  2066  	if m == nil {
  2067  		return nil
  2068  	}
  2069  
  2070  	// no validation rules for SingleHostPerSubset
  2071  
  2072  	if _, ok := Cluster_LbSubsetConfig_LbSubsetSelector_LbSubsetSelectorFallbackPolicy_name[int32(m.GetFallbackPolicy())]; !ok {
  2073  		return Cluster_LbSubsetConfig_LbSubsetSelectorValidationError{
  2074  			field:  "FallbackPolicy",
  2075  			reason: "value must be one of the defined enum values",
  2076  		}
  2077  	}
  2078  
  2079  	return nil
  2080  }
  2081  
  2082  // Cluster_LbSubsetConfig_LbSubsetSelectorValidationError is the validation
  2083  // error returned by Cluster_LbSubsetConfig_LbSubsetSelector.Validate if the
  2084  // designated constraints aren't met.
  2085  type Cluster_LbSubsetConfig_LbSubsetSelectorValidationError struct {
  2086  	field  string
  2087  	reason string
  2088  	cause  error
  2089  	key    bool
  2090  }
  2091  
  2092  // Field function returns field value.
  2093  func (e Cluster_LbSubsetConfig_LbSubsetSelectorValidationError) Field() string { return e.field }
  2094  
  2095  // Reason function returns reason value.
  2096  func (e Cluster_LbSubsetConfig_LbSubsetSelectorValidationError) Reason() string { return e.reason }
  2097  
  2098  // Cause function returns cause value.
  2099  func (e Cluster_LbSubsetConfig_LbSubsetSelectorValidationError) Cause() error { return e.cause }
  2100  
  2101  // Key function returns key value.
  2102  func (e Cluster_LbSubsetConfig_LbSubsetSelectorValidationError) Key() bool { return e.key }
  2103  
  2104  // ErrorName returns error name.
  2105  func (e Cluster_LbSubsetConfig_LbSubsetSelectorValidationError) ErrorName() string {
  2106  	return "Cluster_LbSubsetConfig_LbSubsetSelectorValidationError"
  2107  }
  2108  
  2109  // Error satisfies the builtin error interface
  2110  func (e Cluster_LbSubsetConfig_LbSubsetSelectorValidationError) Error() string {
  2111  	cause := ""
  2112  	if e.cause != nil {
  2113  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  2114  	}
  2115  
  2116  	key := ""
  2117  	if e.key {
  2118  		key = "key for "
  2119  	}
  2120  
  2121  	return fmt.Sprintf(
  2122  		"invalid %sCluster_LbSubsetConfig_LbSubsetSelector.%s: %s%s",
  2123  		key,
  2124  		e.field,
  2125  		e.reason,
  2126  		cause)
  2127  }
  2128  
  2129  var _ error = Cluster_LbSubsetConfig_LbSubsetSelectorValidationError{}
  2130  
  2131  var _ interface {
  2132  	Field() string
  2133  	Reason() string
  2134  	Key() bool
  2135  	Cause() error
  2136  	ErrorName() string
  2137  } = Cluster_LbSubsetConfig_LbSubsetSelectorValidationError{}
  2138  
  2139  // Validate checks the field values on Cluster_CommonLbConfig_ZoneAwareLbConfig
  2140  // with the rules defined in the proto definition for this message. If any
  2141  // rules are violated, an error is returned.
  2142  func (m *Cluster_CommonLbConfig_ZoneAwareLbConfig) Validate() error {
  2143  	if m == nil {
  2144  		return nil
  2145  	}
  2146  
  2147  	if v, ok := interface{}(m.GetRoutingEnabled()).(interface{ Validate() error }); ok {
  2148  		if err := v.Validate(); err != nil {
  2149  			return Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError{
  2150  				field:  "RoutingEnabled",
  2151  				reason: "embedded message failed validation",
  2152  				cause:  err,
  2153  			}
  2154  		}
  2155  	}
  2156  
  2157  	if v, ok := interface{}(m.GetMinClusterSize()).(interface{ Validate() error }); ok {
  2158  		if err := v.Validate(); err != nil {
  2159  			return Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError{
  2160  				field:  "MinClusterSize",
  2161  				reason: "embedded message failed validation",
  2162  				cause:  err,
  2163  			}
  2164  		}
  2165  	}
  2166  
  2167  	// no validation rules for FailTrafficOnPanic
  2168  
  2169  	return nil
  2170  }
  2171  
  2172  // Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError is the validation
  2173  // error returned by Cluster_CommonLbConfig_ZoneAwareLbConfig.Validate if the
  2174  // designated constraints aren't met.
  2175  type Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError struct {
  2176  	field  string
  2177  	reason string
  2178  	cause  error
  2179  	key    bool
  2180  }
  2181  
  2182  // Field function returns field value.
  2183  func (e Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError) Field() string { return e.field }
  2184  
  2185  // Reason function returns reason value.
  2186  func (e Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError) Reason() string { return e.reason }
  2187  
  2188  // Cause function returns cause value.
  2189  func (e Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError) Cause() error { return e.cause }
  2190  
  2191  // Key function returns key value.
  2192  func (e Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError) Key() bool { return e.key }
  2193  
  2194  // ErrorName returns error name.
  2195  func (e Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError) ErrorName() string {
  2196  	return "Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError"
  2197  }
  2198  
  2199  // Error satisfies the builtin error interface
  2200  func (e Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError) Error() string {
  2201  	cause := ""
  2202  	if e.cause != nil {
  2203  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  2204  	}
  2205  
  2206  	key := ""
  2207  	if e.key {
  2208  		key = "key for "
  2209  	}
  2210  
  2211  	return fmt.Sprintf(
  2212  		"invalid %sCluster_CommonLbConfig_ZoneAwareLbConfig.%s: %s%s",
  2213  		key,
  2214  		e.field,
  2215  		e.reason,
  2216  		cause)
  2217  }
  2218  
  2219  var _ error = Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError{}
  2220  
  2221  var _ interface {
  2222  	Field() string
  2223  	Reason() string
  2224  	Key() bool
  2225  	Cause() error
  2226  	ErrorName() string
  2227  } = Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError{}
  2228  
  2229  // Validate checks the field values on
  2230  // Cluster_CommonLbConfig_LocalityWeightedLbConfig with the rules defined in
  2231  // the proto definition for this message. If any rules are violated, an error
  2232  // is returned.
  2233  func (m *Cluster_CommonLbConfig_LocalityWeightedLbConfig) Validate() error {
  2234  	if m == nil {
  2235  		return nil
  2236  	}
  2237  
  2238  	return nil
  2239  }
  2240  
  2241  // Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError is the
  2242  // validation error returned by
  2243  // Cluster_CommonLbConfig_LocalityWeightedLbConfig.Validate if the designated
  2244  // constraints aren't met.
  2245  type Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError struct {
  2246  	field  string
  2247  	reason string
  2248  	cause  error
  2249  	key    bool
  2250  }
  2251  
  2252  // Field function returns field value.
  2253  func (e Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError) Field() string {
  2254  	return e.field
  2255  }
  2256  
  2257  // Reason function returns reason value.
  2258  func (e Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError) Reason() string {
  2259  	return e.reason
  2260  }
  2261  
  2262  // Cause function returns cause value.
  2263  func (e Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError) Cause() error { return e.cause }
  2264  
  2265  // Key function returns key value.
  2266  func (e Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError) Key() bool { return e.key }
  2267  
  2268  // ErrorName returns error name.
  2269  func (e Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError) ErrorName() string {
  2270  	return "Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError"
  2271  }
  2272  
  2273  // Error satisfies the builtin error interface
  2274  func (e Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError) Error() string {
  2275  	cause := ""
  2276  	if e.cause != nil {
  2277  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  2278  	}
  2279  
  2280  	key := ""
  2281  	if e.key {
  2282  		key = "key for "
  2283  	}
  2284  
  2285  	return fmt.Sprintf(
  2286  		"invalid %sCluster_CommonLbConfig_LocalityWeightedLbConfig.%s: %s%s",
  2287  		key,
  2288  		e.field,
  2289  		e.reason,
  2290  		cause)
  2291  }
  2292  
  2293  var _ error = Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError{}
  2294  
  2295  var _ interface {
  2296  	Field() string
  2297  	Reason() string
  2298  	Key() bool
  2299  	Cause() error
  2300  	ErrorName() string
  2301  } = Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError{}
  2302  
  2303  // Validate checks the field values on
  2304  // Cluster_CommonLbConfig_ConsistentHashingLbConfig with the rules defined in
  2305  // the proto definition for this message. If any rules are violated, an error
  2306  // is returned.
  2307  func (m *Cluster_CommonLbConfig_ConsistentHashingLbConfig) Validate() error {
  2308  	if m == nil {
  2309  		return nil
  2310  	}
  2311  
  2312  	// no validation rules for UseHostnameForHashing
  2313  
  2314  	if wrapper := m.GetHashBalanceFactor(); wrapper != nil {
  2315  
  2316  		if wrapper.GetValue() < 100 {
  2317  			return Cluster_CommonLbConfig_ConsistentHashingLbConfigValidationError{
  2318  				field:  "HashBalanceFactor",
  2319  				reason: "value must be greater than or equal to 100",
  2320  			}
  2321  		}
  2322  
  2323  	}
  2324  
  2325  	return nil
  2326  }
  2327  
  2328  // Cluster_CommonLbConfig_ConsistentHashingLbConfigValidationError is the
  2329  // validation error returned by
  2330  // Cluster_CommonLbConfig_ConsistentHashingLbConfig.Validate if the designated
  2331  // constraints aren't met.
  2332  type Cluster_CommonLbConfig_ConsistentHashingLbConfigValidationError struct {
  2333  	field  string
  2334  	reason string
  2335  	cause  error
  2336  	key    bool
  2337  }
  2338  
  2339  // Field function returns field value.
  2340  func (e Cluster_CommonLbConfig_ConsistentHashingLbConfigValidationError) Field() string {
  2341  	return e.field
  2342  }
  2343  
  2344  // Reason function returns reason value.
  2345  func (e Cluster_CommonLbConfig_ConsistentHashingLbConfigValidationError) Reason() string {
  2346  	return e.reason
  2347  }
  2348  
  2349  // Cause function returns cause value.
  2350  func (e Cluster_CommonLbConfig_ConsistentHashingLbConfigValidationError) Cause() error {
  2351  	return e.cause
  2352  }
  2353  
  2354  // Key function returns key value.
  2355  func (e Cluster_CommonLbConfig_ConsistentHashingLbConfigValidationError) Key() bool { return e.key }
  2356  
  2357  // ErrorName returns error name.
  2358  func (e Cluster_CommonLbConfig_ConsistentHashingLbConfigValidationError) ErrorName() string {
  2359  	return "Cluster_CommonLbConfig_ConsistentHashingLbConfigValidationError"
  2360  }
  2361  
  2362  // Error satisfies the builtin error interface
  2363  func (e Cluster_CommonLbConfig_ConsistentHashingLbConfigValidationError) Error() string {
  2364  	cause := ""
  2365  	if e.cause != nil {
  2366  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  2367  	}
  2368  
  2369  	key := ""
  2370  	if e.key {
  2371  		key = "key for "
  2372  	}
  2373  
  2374  	return fmt.Sprintf(
  2375  		"invalid %sCluster_CommonLbConfig_ConsistentHashingLbConfig.%s: %s%s",
  2376  		key,
  2377  		e.field,
  2378  		e.reason,
  2379  		cause)
  2380  }
  2381  
  2382  var _ error = Cluster_CommonLbConfig_ConsistentHashingLbConfigValidationError{}
  2383  
  2384  var _ interface {
  2385  	Field() string
  2386  	Reason() string
  2387  	Key() bool
  2388  	Cause() error
  2389  	ErrorName() string
  2390  } = Cluster_CommonLbConfig_ConsistentHashingLbConfigValidationError{}
  2391  
  2392  // Validate checks the field values on LoadBalancingPolicy_Policy with the
  2393  // rules defined in the proto definition for this message. If any rules are
  2394  // violated, an error is returned.
  2395  func (m *LoadBalancingPolicy_Policy) Validate() error {
  2396  	if m == nil {
  2397  		return nil
  2398  	}
  2399  
  2400  	if v, ok := interface{}(m.GetTypedExtensionConfig()).(interface{ Validate() error }); ok {
  2401  		if err := v.Validate(); err != nil {
  2402  			return LoadBalancingPolicy_PolicyValidationError{
  2403  				field:  "TypedExtensionConfig",
  2404  				reason: "embedded message failed validation",
  2405  				cause:  err,
  2406  			}
  2407  		}
  2408  	}
  2409  
  2410  	if v, ok := interface{}(m.GetHiddenEnvoyDeprecatedConfig()).(interface{ Validate() error }); ok {
  2411  		if err := v.Validate(); err != nil {
  2412  			return LoadBalancingPolicy_PolicyValidationError{
  2413  				field:  "HiddenEnvoyDeprecatedConfig",
  2414  				reason: "embedded message failed validation",
  2415  				cause:  err,
  2416  			}
  2417  		}
  2418  	}
  2419  
  2420  	return nil
  2421  }
  2422  
  2423  // LoadBalancingPolicy_PolicyValidationError is the validation error returned
  2424  // by LoadBalancingPolicy_Policy.Validate if the designated constraints aren't met.
  2425  type LoadBalancingPolicy_PolicyValidationError struct {
  2426  	field  string
  2427  	reason string
  2428  	cause  error
  2429  	key    bool
  2430  }
  2431  
  2432  // Field function returns field value.
  2433  func (e LoadBalancingPolicy_PolicyValidationError) Field() string { return e.field }
  2434  
  2435  // Reason function returns reason value.
  2436  func (e LoadBalancingPolicy_PolicyValidationError) Reason() string { return e.reason }
  2437  
  2438  // Cause function returns cause value.
  2439  func (e LoadBalancingPolicy_PolicyValidationError) Cause() error { return e.cause }
  2440  
  2441  // Key function returns key value.
  2442  func (e LoadBalancingPolicy_PolicyValidationError) Key() bool { return e.key }
  2443  
  2444  // ErrorName returns error name.
  2445  func (e LoadBalancingPolicy_PolicyValidationError) ErrorName() string {
  2446  	return "LoadBalancingPolicy_PolicyValidationError"
  2447  }
  2448  
  2449  // Error satisfies the builtin error interface
  2450  func (e LoadBalancingPolicy_PolicyValidationError) Error() string {
  2451  	cause := ""
  2452  	if e.cause != nil {
  2453  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  2454  	}
  2455  
  2456  	key := ""
  2457  	if e.key {
  2458  		key = "key for "
  2459  	}
  2460  
  2461  	return fmt.Sprintf(
  2462  		"invalid %sLoadBalancingPolicy_Policy.%s: %s%s",
  2463  		key,
  2464  		e.field,
  2465  		e.reason,
  2466  		cause)
  2467  }
  2468  
  2469  var _ error = LoadBalancingPolicy_PolicyValidationError{}
  2470  
  2471  var _ interface {
  2472  	Field() string
  2473  	Reason() string
  2474  	Key() bool
  2475  	Cause() error
  2476  	ErrorName() string
  2477  } = LoadBalancingPolicy_PolicyValidationError{}