...

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

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

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

View as plain text