github.com/hxx258456/ccgo@v0.0.5-0.20230213014102-48b35f46f66f/go-control-plane/envoy/api/v2/cluster.pb.validate.go (about)

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