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

     1  // Code generated by protoc-gen-validate. DO NOT EDIT.
     2  // source: envoy/api/v2/route/route_components.proto
     3  
     4  package envoy_api_v2_route
     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  	core "github.com/hxx258456/ccgo/go-control-plane/envoy/api/v2/core"
    21  )
    22  
    23  // ensure the imports are used
    24  var (
    25  	_ = bytes.MinRead
    26  	_ = errors.New("")
    27  	_ = fmt.Print
    28  	_ = utf8.UTFMax
    29  	_ = (*regexp.Regexp)(nil)
    30  	_ = (*strings.Reader)(nil)
    31  	_ = net.IPv4len
    32  	_ = time.Duration(0)
    33  	_ = (*url.URL)(nil)
    34  	_ = (*mail.Address)(nil)
    35  	_ = anypb.Any{}
    36  
    37  	_ = core.RoutingPriority(0)
    38  
    39  	_ = core.RequestMethod(0)
    40  )
    41  
    42  // Validate checks the field values on VirtualHost with the rules defined in
    43  // the proto definition for this message. If any rules are violated, an error
    44  // is returned.
    45  func (m *VirtualHost) Validate() error {
    46  	if m == nil {
    47  		return nil
    48  	}
    49  
    50  	if len(m.GetName()) < 1 {
    51  		return VirtualHostValidationError{
    52  			field:  "Name",
    53  			reason: "value length must be at least 1 bytes",
    54  		}
    55  	}
    56  
    57  	if len(m.GetDomains()) < 1 {
    58  		return VirtualHostValidationError{
    59  			field:  "Domains",
    60  			reason: "value must contain at least 1 item(s)",
    61  		}
    62  	}
    63  
    64  	for idx, item := range m.GetDomains() {
    65  		_, _ = idx, item
    66  
    67  		if !_VirtualHost_Domains_Pattern.MatchString(item) {
    68  			return VirtualHostValidationError{
    69  				field:  fmt.Sprintf("Domains[%v]", idx),
    70  				reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
    71  			}
    72  		}
    73  
    74  	}
    75  
    76  	for idx, item := range m.GetRoutes() {
    77  		_, _ = idx, item
    78  
    79  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
    80  			if err := v.Validate(); err != nil {
    81  				return VirtualHostValidationError{
    82  					field:  fmt.Sprintf("Routes[%v]", idx),
    83  					reason: "embedded message failed validation",
    84  					cause:  err,
    85  				}
    86  			}
    87  		}
    88  
    89  	}
    90  
    91  	if _, ok := VirtualHost_TlsRequirementType_name[int32(m.GetRequireTls())]; !ok {
    92  		return VirtualHostValidationError{
    93  			field:  "RequireTls",
    94  			reason: "value must be one of the defined enum values",
    95  		}
    96  	}
    97  
    98  	for idx, item := range m.GetVirtualClusters() {
    99  		_, _ = idx, item
   100  
   101  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   102  			if err := v.Validate(); err != nil {
   103  				return VirtualHostValidationError{
   104  					field:  fmt.Sprintf("VirtualClusters[%v]", idx),
   105  					reason: "embedded message failed validation",
   106  					cause:  err,
   107  				}
   108  			}
   109  		}
   110  
   111  	}
   112  
   113  	for idx, item := range m.GetRateLimits() {
   114  		_, _ = idx, item
   115  
   116  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   117  			if err := v.Validate(); err != nil {
   118  				return VirtualHostValidationError{
   119  					field:  fmt.Sprintf("RateLimits[%v]", idx),
   120  					reason: "embedded message failed validation",
   121  					cause:  err,
   122  				}
   123  			}
   124  		}
   125  
   126  	}
   127  
   128  	if len(m.GetRequestHeadersToAdd()) > 1000 {
   129  		return VirtualHostValidationError{
   130  			field:  "RequestHeadersToAdd",
   131  			reason: "value must contain no more than 1000 item(s)",
   132  		}
   133  	}
   134  
   135  	for idx, item := range m.GetRequestHeadersToAdd() {
   136  		_, _ = idx, item
   137  
   138  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   139  			if err := v.Validate(); err != nil {
   140  				return VirtualHostValidationError{
   141  					field:  fmt.Sprintf("RequestHeadersToAdd[%v]", idx),
   142  					reason: "embedded message failed validation",
   143  					cause:  err,
   144  				}
   145  			}
   146  		}
   147  
   148  	}
   149  
   150  	if len(m.GetResponseHeadersToAdd()) > 1000 {
   151  		return VirtualHostValidationError{
   152  			field:  "ResponseHeadersToAdd",
   153  			reason: "value must contain no more than 1000 item(s)",
   154  		}
   155  	}
   156  
   157  	for idx, item := range m.GetResponseHeadersToAdd() {
   158  		_, _ = idx, item
   159  
   160  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   161  			if err := v.Validate(); err != nil {
   162  				return VirtualHostValidationError{
   163  					field:  fmt.Sprintf("ResponseHeadersToAdd[%v]", idx),
   164  					reason: "embedded message failed validation",
   165  					cause:  err,
   166  				}
   167  			}
   168  		}
   169  
   170  	}
   171  
   172  	if v, ok := interface{}(m.GetCors()).(interface{ Validate() error }); ok {
   173  		if err := v.Validate(); err != nil {
   174  			return VirtualHostValidationError{
   175  				field:  "Cors",
   176  				reason: "embedded message failed validation",
   177  				cause:  err,
   178  			}
   179  		}
   180  	}
   181  
   182  	for key, val := range m.GetPerFilterConfig() {
   183  		_ = val
   184  
   185  		// no validation rules for PerFilterConfig[key]
   186  
   187  		if v, ok := interface{}(val).(interface{ Validate() error }); ok {
   188  			if err := v.Validate(); err != nil {
   189  				return VirtualHostValidationError{
   190  					field:  fmt.Sprintf("PerFilterConfig[%v]", key),
   191  					reason: "embedded message failed validation",
   192  					cause:  err,
   193  				}
   194  			}
   195  		}
   196  
   197  	}
   198  
   199  	for key, val := range m.GetTypedPerFilterConfig() {
   200  		_ = val
   201  
   202  		// no validation rules for TypedPerFilterConfig[key]
   203  
   204  		if v, ok := interface{}(val).(interface{ Validate() error }); ok {
   205  			if err := v.Validate(); err != nil {
   206  				return VirtualHostValidationError{
   207  					field:  fmt.Sprintf("TypedPerFilterConfig[%v]", key),
   208  					reason: "embedded message failed validation",
   209  					cause:  err,
   210  				}
   211  			}
   212  		}
   213  
   214  	}
   215  
   216  	// no validation rules for IncludeRequestAttemptCount
   217  
   218  	// no validation rules for IncludeAttemptCountInResponse
   219  
   220  	if v, ok := interface{}(m.GetRetryPolicy()).(interface{ Validate() error }); ok {
   221  		if err := v.Validate(); err != nil {
   222  			return VirtualHostValidationError{
   223  				field:  "RetryPolicy",
   224  				reason: "embedded message failed validation",
   225  				cause:  err,
   226  			}
   227  		}
   228  	}
   229  
   230  	if v, ok := interface{}(m.GetRetryPolicyTypedConfig()).(interface{ Validate() error }); ok {
   231  		if err := v.Validate(); err != nil {
   232  			return VirtualHostValidationError{
   233  				field:  "RetryPolicyTypedConfig",
   234  				reason: "embedded message failed validation",
   235  				cause:  err,
   236  			}
   237  		}
   238  	}
   239  
   240  	if v, ok := interface{}(m.GetHedgePolicy()).(interface{ Validate() error }); ok {
   241  		if err := v.Validate(); err != nil {
   242  			return VirtualHostValidationError{
   243  				field:  "HedgePolicy",
   244  				reason: "embedded message failed validation",
   245  				cause:  err,
   246  			}
   247  		}
   248  	}
   249  
   250  	if v, ok := interface{}(m.GetPerRequestBufferLimitBytes()).(interface{ Validate() error }); ok {
   251  		if err := v.Validate(); err != nil {
   252  			return VirtualHostValidationError{
   253  				field:  "PerRequestBufferLimitBytes",
   254  				reason: "embedded message failed validation",
   255  				cause:  err,
   256  			}
   257  		}
   258  	}
   259  
   260  	return nil
   261  }
   262  
   263  // VirtualHostValidationError is the validation error returned by
   264  // VirtualHost.Validate if the designated constraints aren't met.
   265  type VirtualHostValidationError struct {
   266  	field  string
   267  	reason string
   268  	cause  error
   269  	key    bool
   270  }
   271  
   272  // Field function returns field value.
   273  func (e VirtualHostValidationError) Field() string { return e.field }
   274  
   275  // Reason function returns reason value.
   276  func (e VirtualHostValidationError) Reason() string { return e.reason }
   277  
   278  // Cause function returns cause value.
   279  func (e VirtualHostValidationError) Cause() error { return e.cause }
   280  
   281  // Key function returns key value.
   282  func (e VirtualHostValidationError) Key() bool { return e.key }
   283  
   284  // ErrorName returns error name.
   285  func (e VirtualHostValidationError) ErrorName() string { return "VirtualHostValidationError" }
   286  
   287  // Error satisfies the builtin error interface
   288  func (e VirtualHostValidationError) Error() string {
   289  	cause := ""
   290  	if e.cause != nil {
   291  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   292  	}
   293  
   294  	key := ""
   295  	if e.key {
   296  		key = "key for "
   297  	}
   298  
   299  	return fmt.Sprintf(
   300  		"invalid %sVirtualHost.%s: %s%s",
   301  		key,
   302  		e.field,
   303  		e.reason,
   304  		cause)
   305  }
   306  
   307  var _ error = VirtualHostValidationError{}
   308  
   309  var _ interface {
   310  	Field() string
   311  	Reason() string
   312  	Key() bool
   313  	Cause() error
   314  	ErrorName() string
   315  } = VirtualHostValidationError{}
   316  
   317  var _VirtualHost_Domains_Pattern = regexp.MustCompile("^[^\x00\n\r]*$")
   318  
   319  // Validate checks the field values on FilterAction with the rules defined in
   320  // the proto definition for this message. If any rules are violated, an error
   321  // is returned.
   322  func (m *FilterAction) Validate() error {
   323  	if m == nil {
   324  		return nil
   325  	}
   326  
   327  	if v, ok := interface{}(m.GetAction()).(interface{ Validate() error }); ok {
   328  		if err := v.Validate(); err != nil {
   329  			return FilterActionValidationError{
   330  				field:  "Action",
   331  				reason: "embedded message failed validation",
   332  				cause:  err,
   333  			}
   334  		}
   335  	}
   336  
   337  	return nil
   338  }
   339  
   340  // FilterActionValidationError is the validation error returned by
   341  // FilterAction.Validate if the designated constraints aren't met.
   342  type FilterActionValidationError struct {
   343  	field  string
   344  	reason string
   345  	cause  error
   346  	key    bool
   347  }
   348  
   349  // Field function returns field value.
   350  func (e FilterActionValidationError) Field() string { return e.field }
   351  
   352  // Reason function returns reason value.
   353  func (e FilterActionValidationError) Reason() string { return e.reason }
   354  
   355  // Cause function returns cause value.
   356  func (e FilterActionValidationError) Cause() error { return e.cause }
   357  
   358  // Key function returns key value.
   359  func (e FilterActionValidationError) Key() bool { return e.key }
   360  
   361  // ErrorName returns error name.
   362  func (e FilterActionValidationError) ErrorName() string { return "FilterActionValidationError" }
   363  
   364  // Error satisfies the builtin error interface
   365  func (e FilterActionValidationError) Error() string {
   366  	cause := ""
   367  	if e.cause != nil {
   368  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   369  	}
   370  
   371  	key := ""
   372  	if e.key {
   373  		key = "key for "
   374  	}
   375  
   376  	return fmt.Sprintf(
   377  		"invalid %sFilterAction.%s: %s%s",
   378  		key,
   379  		e.field,
   380  		e.reason,
   381  		cause)
   382  }
   383  
   384  var _ error = FilterActionValidationError{}
   385  
   386  var _ interface {
   387  	Field() string
   388  	Reason() string
   389  	Key() bool
   390  	Cause() error
   391  	ErrorName() string
   392  } = FilterActionValidationError{}
   393  
   394  // Validate checks the field values on Route with the rules defined in the
   395  // proto definition for this message. If any rules are violated, an error is returned.
   396  func (m *Route) Validate() error {
   397  	if m == nil {
   398  		return nil
   399  	}
   400  
   401  	// no validation rules for Name
   402  
   403  	if m.GetMatch() == nil {
   404  		return RouteValidationError{
   405  			field:  "Match",
   406  			reason: "value is required",
   407  		}
   408  	}
   409  
   410  	if v, ok := interface{}(m.GetMatch()).(interface{ Validate() error }); ok {
   411  		if err := v.Validate(); err != nil {
   412  			return RouteValidationError{
   413  				field:  "Match",
   414  				reason: "embedded message failed validation",
   415  				cause:  err,
   416  			}
   417  		}
   418  	}
   419  
   420  	if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
   421  		if err := v.Validate(); err != nil {
   422  			return RouteValidationError{
   423  				field:  "Metadata",
   424  				reason: "embedded message failed validation",
   425  				cause:  err,
   426  			}
   427  		}
   428  	}
   429  
   430  	if v, ok := interface{}(m.GetDecorator()).(interface{ Validate() error }); ok {
   431  		if err := v.Validate(); err != nil {
   432  			return RouteValidationError{
   433  				field:  "Decorator",
   434  				reason: "embedded message failed validation",
   435  				cause:  err,
   436  			}
   437  		}
   438  	}
   439  
   440  	for key, val := range m.GetPerFilterConfig() {
   441  		_ = val
   442  
   443  		// no validation rules for PerFilterConfig[key]
   444  
   445  		if v, ok := interface{}(val).(interface{ Validate() error }); ok {
   446  			if err := v.Validate(); err != nil {
   447  				return RouteValidationError{
   448  					field:  fmt.Sprintf("PerFilterConfig[%v]", key),
   449  					reason: "embedded message failed validation",
   450  					cause:  err,
   451  				}
   452  			}
   453  		}
   454  
   455  	}
   456  
   457  	for key, val := range m.GetTypedPerFilterConfig() {
   458  		_ = val
   459  
   460  		// no validation rules for TypedPerFilterConfig[key]
   461  
   462  		if v, ok := interface{}(val).(interface{ Validate() error }); ok {
   463  			if err := v.Validate(); err != nil {
   464  				return RouteValidationError{
   465  					field:  fmt.Sprintf("TypedPerFilterConfig[%v]", key),
   466  					reason: "embedded message failed validation",
   467  					cause:  err,
   468  				}
   469  			}
   470  		}
   471  
   472  	}
   473  
   474  	if len(m.GetRequestHeadersToAdd()) > 1000 {
   475  		return RouteValidationError{
   476  			field:  "RequestHeadersToAdd",
   477  			reason: "value must contain no more than 1000 item(s)",
   478  		}
   479  	}
   480  
   481  	for idx, item := range m.GetRequestHeadersToAdd() {
   482  		_, _ = idx, item
   483  
   484  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   485  			if err := v.Validate(); err != nil {
   486  				return RouteValidationError{
   487  					field:  fmt.Sprintf("RequestHeadersToAdd[%v]", idx),
   488  					reason: "embedded message failed validation",
   489  					cause:  err,
   490  				}
   491  			}
   492  		}
   493  
   494  	}
   495  
   496  	if len(m.GetResponseHeadersToAdd()) > 1000 {
   497  		return RouteValidationError{
   498  			field:  "ResponseHeadersToAdd",
   499  			reason: "value must contain no more than 1000 item(s)",
   500  		}
   501  	}
   502  
   503  	for idx, item := range m.GetResponseHeadersToAdd() {
   504  		_, _ = idx, item
   505  
   506  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   507  			if err := v.Validate(); err != nil {
   508  				return RouteValidationError{
   509  					field:  fmt.Sprintf("ResponseHeadersToAdd[%v]", idx),
   510  					reason: "embedded message failed validation",
   511  					cause:  err,
   512  				}
   513  			}
   514  		}
   515  
   516  	}
   517  
   518  	if v, ok := interface{}(m.GetTracing()).(interface{ Validate() error }); ok {
   519  		if err := v.Validate(); err != nil {
   520  			return RouteValidationError{
   521  				field:  "Tracing",
   522  				reason: "embedded message failed validation",
   523  				cause:  err,
   524  			}
   525  		}
   526  	}
   527  
   528  	if v, ok := interface{}(m.GetPerRequestBufferLimitBytes()).(interface{ Validate() error }); ok {
   529  		if err := v.Validate(); err != nil {
   530  			return RouteValidationError{
   531  				field:  "PerRequestBufferLimitBytes",
   532  				reason: "embedded message failed validation",
   533  				cause:  err,
   534  			}
   535  		}
   536  	}
   537  
   538  	switch m.Action.(type) {
   539  
   540  	case *Route_Route:
   541  
   542  		if v, ok := interface{}(m.GetRoute()).(interface{ Validate() error }); ok {
   543  			if err := v.Validate(); err != nil {
   544  				return RouteValidationError{
   545  					field:  "Route",
   546  					reason: "embedded message failed validation",
   547  					cause:  err,
   548  				}
   549  			}
   550  		}
   551  
   552  	case *Route_Redirect:
   553  
   554  		if v, ok := interface{}(m.GetRedirect()).(interface{ Validate() error }); ok {
   555  			if err := v.Validate(); err != nil {
   556  				return RouteValidationError{
   557  					field:  "Redirect",
   558  					reason: "embedded message failed validation",
   559  					cause:  err,
   560  				}
   561  			}
   562  		}
   563  
   564  	case *Route_DirectResponse:
   565  
   566  		if v, ok := interface{}(m.GetDirectResponse()).(interface{ Validate() error }); ok {
   567  			if err := v.Validate(); err != nil {
   568  				return RouteValidationError{
   569  					field:  "DirectResponse",
   570  					reason: "embedded message failed validation",
   571  					cause:  err,
   572  				}
   573  			}
   574  		}
   575  
   576  	case *Route_FilterAction:
   577  
   578  		if v, ok := interface{}(m.GetFilterAction()).(interface{ Validate() error }); ok {
   579  			if err := v.Validate(); err != nil {
   580  				return RouteValidationError{
   581  					field:  "FilterAction",
   582  					reason: "embedded message failed validation",
   583  					cause:  err,
   584  				}
   585  			}
   586  		}
   587  
   588  	default:
   589  		return RouteValidationError{
   590  			field:  "Action",
   591  			reason: "value is required",
   592  		}
   593  
   594  	}
   595  
   596  	return nil
   597  }
   598  
   599  // RouteValidationError is the validation error returned by Route.Validate if
   600  // the designated constraints aren't met.
   601  type RouteValidationError struct {
   602  	field  string
   603  	reason string
   604  	cause  error
   605  	key    bool
   606  }
   607  
   608  // Field function returns field value.
   609  func (e RouteValidationError) Field() string { return e.field }
   610  
   611  // Reason function returns reason value.
   612  func (e RouteValidationError) Reason() string { return e.reason }
   613  
   614  // Cause function returns cause value.
   615  func (e RouteValidationError) Cause() error { return e.cause }
   616  
   617  // Key function returns key value.
   618  func (e RouteValidationError) Key() bool { return e.key }
   619  
   620  // ErrorName returns error name.
   621  func (e RouteValidationError) ErrorName() string { return "RouteValidationError" }
   622  
   623  // Error satisfies the builtin error interface
   624  func (e RouteValidationError) Error() string {
   625  	cause := ""
   626  	if e.cause != nil {
   627  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   628  	}
   629  
   630  	key := ""
   631  	if e.key {
   632  		key = "key for "
   633  	}
   634  
   635  	return fmt.Sprintf(
   636  		"invalid %sRoute.%s: %s%s",
   637  		key,
   638  		e.field,
   639  		e.reason,
   640  		cause)
   641  }
   642  
   643  var _ error = RouteValidationError{}
   644  
   645  var _ interface {
   646  	Field() string
   647  	Reason() string
   648  	Key() bool
   649  	Cause() error
   650  	ErrorName() string
   651  } = RouteValidationError{}
   652  
   653  // Validate checks the field values on WeightedCluster with the rules defined
   654  // in the proto definition for this message. If any rules are violated, an
   655  // error is returned.
   656  func (m *WeightedCluster) Validate() error {
   657  	if m == nil {
   658  		return nil
   659  	}
   660  
   661  	if len(m.GetClusters()) < 1 {
   662  		return WeightedClusterValidationError{
   663  			field:  "Clusters",
   664  			reason: "value must contain at least 1 item(s)",
   665  		}
   666  	}
   667  
   668  	for idx, item := range m.GetClusters() {
   669  		_, _ = idx, item
   670  
   671  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   672  			if err := v.Validate(); err != nil {
   673  				return WeightedClusterValidationError{
   674  					field:  fmt.Sprintf("Clusters[%v]", idx),
   675  					reason: "embedded message failed validation",
   676  					cause:  err,
   677  				}
   678  			}
   679  		}
   680  
   681  	}
   682  
   683  	if wrapper := m.GetTotalWeight(); wrapper != nil {
   684  
   685  		if wrapper.GetValue() < 1 {
   686  			return WeightedClusterValidationError{
   687  				field:  "TotalWeight",
   688  				reason: "value must be greater than or equal to 1",
   689  			}
   690  		}
   691  
   692  	}
   693  
   694  	// no validation rules for RuntimeKeyPrefix
   695  
   696  	return nil
   697  }
   698  
   699  // WeightedClusterValidationError is the validation error returned by
   700  // WeightedCluster.Validate if the designated constraints aren't met.
   701  type WeightedClusterValidationError struct {
   702  	field  string
   703  	reason string
   704  	cause  error
   705  	key    bool
   706  }
   707  
   708  // Field function returns field value.
   709  func (e WeightedClusterValidationError) Field() string { return e.field }
   710  
   711  // Reason function returns reason value.
   712  func (e WeightedClusterValidationError) Reason() string { return e.reason }
   713  
   714  // Cause function returns cause value.
   715  func (e WeightedClusterValidationError) Cause() error { return e.cause }
   716  
   717  // Key function returns key value.
   718  func (e WeightedClusterValidationError) Key() bool { return e.key }
   719  
   720  // ErrorName returns error name.
   721  func (e WeightedClusterValidationError) ErrorName() string { return "WeightedClusterValidationError" }
   722  
   723  // Error satisfies the builtin error interface
   724  func (e WeightedClusterValidationError) Error() string {
   725  	cause := ""
   726  	if e.cause != nil {
   727  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   728  	}
   729  
   730  	key := ""
   731  	if e.key {
   732  		key = "key for "
   733  	}
   734  
   735  	return fmt.Sprintf(
   736  		"invalid %sWeightedCluster.%s: %s%s",
   737  		key,
   738  		e.field,
   739  		e.reason,
   740  		cause)
   741  }
   742  
   743  var _ error = WeightedClusterValidationError{}
   744  
   745  var _ interface {
   746  	Field() string
   747  	Reason() string
   748  	Key() bool
   749  	Cause() error
   750  	ErrorName() string
   751  } = WeightedClusterValidationError{}
   752  
   753  // Validate checks the field values on RouteMatch with the rules defined in the
   754  // proto definition for this message. If any rules are violated, an error is returned.
   755  func (m *RouteMatch) Validate() error {
   756  	if m == nil {
   757  		return nil
   758  	}
   759  
   760  	if v, ok := interface{}(m.GetCaseSensitive()).(interface{ Validate() error }); ok {
   761  		if err := v.Validate(); err != nil {
   762  			return RouteMatchValidationError{
   763  				field:  "CaseSensitive",
   764  				reason: "embedded message failed validation",
   765  				cause:  err,
   766  			}
   767  		}
   768  	}
   769  
   770  	if v, ok := interface{}(m.GetRuntimeFraction()).(interface{ Validate() error }); ok {
   771  		if err := v.Validate(); err != nil {
   772  			return RouteMatchValidationError{
   773  				field:  "RuntimeFraction",
   774  				reason: "embedded message failed validation",
   775  				cause:  err,
   776  			}
   777  		}
   778  	}
   779  
   780  	for idx, item := range m.GetHeaders() {
   781  		_, _ = idx, item
   782  
   783  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   784  			if err := v.Validate(); err != nil {
   785  				return RouteMatchValidationError{
   786  					field:  fmt.Sprintf("Headers[%v]", idx),
   787  					reason: "embedded message failed validation",
   788  					cause:  err,
   789  				}
   790  			}
   791  		}
   792  
   793  	}
   794  
   795  	for idx, item := range m.GetQueryParameters() {
   796  		_, _ = idx, item
   797  
   798  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   799  			if err := v.Validate(); err != nil {
   800  				return RouteMatchValidationError{
   801  					field:  fmt.Sprintf("QueryParameters[%v]", idx),
   802  					reason: "embedded message failed validation",
   803  					cause:  err,
   804  				}
   805  			}
   806  		}
   807  
   808  	}
   809  
   810  	if v, ok := interface{}(m.GetGrpc()).(interface{ Validate() error }); ok {
   811  		if err := v.Validate(); err != nil {
   812  			return RouteMatchValidationError{
   813  				field:  "Grpc",
   814  				reason: "embedded message failed validation",
   815  				cause:  err,
   816  			}
   817  		}
   818  	}
   819  
   820  	if v, ok := interface{}(m.GetTlsContext()).(interface{ Validate() error }); ok {
   821  		if err := v.Validate(); err != nil {
   822  			return RouteMatchValidationError{
   823  				field:  "TlsContext",
   824  				reason: "embedded message failed validation",
   825  				cause:  err,
   826  			}
   827  		}
   828  	}
   829  
   830  	switch m.PathSpecifier.(type) {
   831  
   832  	case *RouteMatch_Prefix:
   833  		// no validation rules for Prefix
   834  
   835  	case *RouteMatch_Path:
   836  		// no validation rules for Path
   837  
   838  	case *RouteMatch_Regex:
   839  
   840  		if len(m.GetRegex()) > 1024 {
   841  			return RouteMatchValidationError{
   842  				field:  "Regex",
   843  				reason: "value length must be at most 1024 bytes",
   844  			}
   845  		}
   846  
   847  	case *RouteMatch_SafeRegex:
   848  
   849  		if m.GetSafeRegex() == nil {
   850  			return RouteMatchValidationError{
   851  				field:  "SafeRegex",
   852  				reason: "value is required",
   853  			}
   854  		}
   855  
   856  		if v, ok := interface{}(m.GetSafeRegex()).(interface{ Validate() error }); ok {
   857  			if err := v.Validate(); err != nil {
   858  				return RouteMatchValidationError{
   859  					field:  "SafeRegex",
   860  					reason: "embedded message failed validation",
   861  					cause:  err,
   862  				}
   863  			}
   864  		}
   865  
   866  	default:
   867  		return RouteMatchValidationError{
   868  			field:  "PathSpecifier",
   869  			reason: "value is required",
   870  		}
   871  
   872  	}
   873  
   874  	return nil
   875  }
   876  
   877  // RouteMatchValidationError is the validation error returned by
   878  // RouteMatch.Validate if the designated constraints aren't met.
   879  type RouteMatchValidationError struct {
   880  	field  string
   881  	reason string
   882  	cause  error
   883  	key    bool
   884  }
   885  
   886  // Field function returns field value.
   887  func (e RouteMatchValidationError) Field() string { return e.field }
   888  
   889  // Reason function returns reason value.
   890  func (e RouteMatchValidationError) Reason() string { return e.reason }
   891  
   892  // Cause function returns cause value.
   893  func (e RouteMatchValidationError) Cause() error { return e.cause }
   894  
   895  // Key function returns key value.
   896  func (e RouteMatchValidationError) Key() bool { return e.key }
   897  
   898  // ErrorName returns error name.
   899  func (e RouteMatchValidationError) ErrorName() string { return "RouteMatchValidationError" }
   900  
   901  // Error satisfies the builtin error interface
   902  func (e RouteMatchValidationError) Error() string {
   903  	cause := ""
   904  	if e.cause != nil {
   905  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   906  	}
   907  
   908  	key := ""
   909  	if e.key {
   910  		key = "key for "
   911  	}
   912  
   913  	return fmt.Sprintf(
   914  		"invalid %sRouteMatch.%s: %s%s",
   915  		key,
   916  		e.field,
   917  		e.reason,
   918  		cause)
   919  }
   920  
   921  var _ error = RouteMatchValidationError{}
   922  
   923  var _ interface {
   924  	Field() string
   925  	Reason() string
   926  	Key() bool
   927  	Cause() error
   928  	ErrorName() string
   929  } = RouteMatchValidationError{}
   930  
   931  // Validate checks the field values on CorsPolicy with the rules defined in the
   932  // proto definition for this message. If any rules are violated, an error is returned.
   933  func (m *CorsPolicy) Validate() error {
   934  	if m == nil {
   935  		return nil
   936  	}
   937  
   938  	for idx, item := range m.GetAllowOriginRegex() {
   939  		_, _ = idx, item
   940  
   941  		if len(item) > 1024 {
   942  			return CorsPolicyValidationError{
   943  				field:  fmt.Sprintf("AllowOriginRegex[%v]", idx),
   944  				reason: "value length must be at most 1024 bytes",
   945  			}
   946  		}
   947  
   948  	}
   949  
   950  	for idx, item := range m.GetAllowOriginStringMatch() {
   951  		_, _ = idx, item
   952  
   953  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   954  			if err := v.Validate(); err != nil {
   955  				return CorsPolicyValidationError{
   956  					field:  fmt.Sprintf("AllowOriginStringMatch[%v]", idx),
   957  					reason: "embedded message failed validation",
   958  					cause:  err,
   959  				}
   960  			}
   961  		}
   962  
   963  	}
   964  
   965  	// no validation rules for AllowMethods
   966  
   967  	// no validation rules for AllowHeaders
   968  
   969  	// no validation rules for ExposeHeaders
   970  
   971  	// no validation rules for MaxAge
   972  
   973  	if v, ok := interface{}(m.GetAllowCredentials()).(interface{ Validate() error }); ok {
   974  		if err := v.Validate(); err != nil {
   975  			return CorsPolicyValidationError{
   976  				field:  "AllowCredentials",
   977  				reason: "embedded message failed validation",
   978  				cause:  err,
   979  			}
   980  		}
   981  	}
   982  
   983  	if v, ok := interface{}(m.GetShadowEnabled()).(interface{ Validate() error }); ok {
   984  		if err := v.Validate(); err != nil {
   985  			return CorsPolicyValidationError{
   986  				field:  "ShadowEnabled",
   987  				reason: "embedded message failed validation",
   988  				cause:  err,
   989  			}
   990  		}
   991  	}
   992  
   993  	switch m.EnabledSpecifier.(type) {
   994  
   995  	case *CorsPolicy_Enabled:
   996  
   997  		if v, ok := interface{}(m.GetEnabled()).(interface{ Validate() error }); ok {
   998  			if err := v.Validate(); err != nil {
   999  				return CorsPolicyValidationError{
  1000  					field:  "Enabled",
  1001  					reason: "embedded message failed validation",
  1002  					cause:  err,
  1003  				}
  1004  			}
  1005  		}
  1006  
  1007  	case *CorsPolicy_FilterEnabled:
  1008  
  1009  		if v, ok := interface{}(m.GetFilterEnabled()).(interface{ Validate() error }); ok {
  1010  			if err := v.Validate(); err != nil {
  1011  				return CorsPolicyValidationError{
  1012  					field:  "FilterEnabled",
  1013  					reason: "embedded message failed validation",
  1014  					cause:  err,
  1015  				}
  1016  			}
  1017  		}
  1018  
  1019  	}
  1020  
  1021  	return nil
  1022  }
  1023  
  1024  // CorsPolicyValidationError is the validation error returned by
  1025  // CorsPolicy.Validate if the designated constraints aren't met.
  1026  type CorsPolicyValidationError struct {
  1027  	field  string
  1028  	reason string
  1029  	cause  error
  1030  	key    bool
  1031  }
  1032  
  1033  // Field function returns field value.
  1034  func (e CorsPolicyValidationError) Field() string { return e.field }
  1035  
  1036  // Reason function returns reason value.
  1037  func (e CorsPolicyValidationError) Reason() string { return e.reason }
  1038  
  1039  // Cause function returns cause value.
  1040  func (e CorsPolicyValidationError) Cause() error { return e.cause }
  1041  
  1042  // Key function returns key value.
  1043  func (e CorsPolicyValidationError) Key() bool { return e.key }
  1044  
  1045  // ErrorName returns error name.
  1046  func (e CorsPolicyValidationError) ErrorName() string { return "CorsPolicyValidationError" }
  1047  
  1048  // Error satisfies the builtin error interface
  1049  func (e CorsPolicyValidationError) Error() string {
  1050  	cause := ""
  1051  	if e.cause != nil {
  1052  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1053  	}
  1054  
  1055  	key := ""
  1056  	if e.key {
  1057  		key = "key for "
  1058  	}
  1059  
  1060  	return fmt.Sprintf(
  1061  		"invalid %sCorsPolicy.%s: %s%s",
  1062  		key,
  1063  		e.field,
  1064  		e.reason,
  1065  		cause)
  1066  }
  1067  
  1068  var _ error = CorsPolicyValidationError{}
  1069  
  1070  var _ interface {
  1071  	Field() string
  1072  	Reason() string
  1073  	Key() bool
  1074  	Cause() error
  1075  	ErrorName() string
  1076  } = CorsPolicyValidationError{}
  1077  
  1078  // Validate checks the field values on RouteAction with the rules defined in
  1079  // the proto definition for this message. If any rules are violated, an error
  1080  // is returned.
  1081  func (m *RouteAction) Validate() error {
  1082  	if m == nil {
  1083  		return nil
  1084  	}
  1085  
  1086  	if _, ok := RouteAction_ClusterNotFoundResponseCode_name[int32(m.GetClusterNotFoundResponseCode())]; !ok {
  1087  		return RouteActionValidationError{
  1088  			field:  "ClusterNotFoundResponseCode",
  1089  			reason: "value must be one of the defined enum values",
  1090  		}
  1091  	}
  1092  
  1093  	if v, ok := interface{}(m.GetMetadataMatch()).(interface{ Validate() error }); ok {
  1094  		if err := v.Validate(); err != nil {
  1095  			return RouteActionValidationError{
  1096  				field:  "MetadataMatch",
  1097  				reason: "embedded message failed validation",
  1098  				cause:  err,
  1099  			}
  1100  		}
  1101  	}
  1102  
  1103  	if !_RouteAction_PrefixRewrite_Pattern.MatchString(m.GetPrefixRewrite()) {
  1104  		return RouteActionValidationError{
  1105  			field:  "PrefixRewrite",
  1106  			reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
  1107  		}
  1108  	}
  1109  
  1110  	if v, ok := interface{}(m.GetRegexRewrite()).(interface{ Validate() error }); ok {
  1111  		if err := v.Validate(); err != nil {
  1112  			return RouteActionValidationError{
  1113  				field:  "RegexRewrite",
  1114  				reason: "embedded message failed validation",
  1115  				cause:  err,
  1116  			}
  1117  		}
  1118  	}
  1119  
  1120  	if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok {
  1121  		if err := v.Validate(); err != nil {
  1122  			return RouteActionValidationError{
  1123  				field:  "Timeout",
  1124  				reason: "embedded message failed validation",
  1125  				cause:  err,
  1126  			}
  1127  		}
  1128  	}
  1129  
  1130  	if v, ok := interface{}(m.GetIdleTimeout()).(interface{ Validate() error }); ok {
  1131  		if err := v.Validate(); err != nil {
  1132  			return RouteActionValidationError{
  1133  				field:  "IdleTimeout",
  1134  				reason: "embedded message failed validation",
  1135  				cause:  err,
  1136  			}
  1137  		}
  1138  	}
  1139  
  1140  	if v, ok := interface{}(m.GetRetryPolicy()).(interface{ Validate() error }); ok {
  1141  		if err := v.Validate(); err != nil {
  1142  			return RouteActionValidationError{
  1143  				field:  "RetryPolicy",
  1144  				reason: "embedded message failed validation",
  1145  				cause:  err,
  1146  			}
  1147  		}
  1148  	}
  1149  
  1150  	if v, ok := interface{}(m.GetRetryPolicyTypedConfig()).(interface{ Validate() error }); ok {
  1151  		if err := v.Validate(); err != nil {
  1152  			return RouteActionValidationError{
  1153  				field:  "RetryPolicyTypedConfig",
  1154  				reason: "embedded message failed validation",
  1155  				cause:  err,
  1156  			}
  1157  		}
  1158  	}
  1159  
  1160  	if v, ok := interface{}(m.GetRequestMirrorPolicy()).(interface{ Validate() error }); ok {
  1161  		if err := v.Validate(); err != nil {
  1162  			return RouteActionValidationError{
  1163  				field:  "RequestMirrorPolicy",
  1164  				reason: "embedded message failed validation",
  1165  				cause:  err,
  1166  			}
  1167  		}
  1168  	}
  1169  
  1170  	for idx, item := range m.GetRequestMirrorPolicies() {
  1171  		_, _ = idx, item
  1172  
  1173  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  1174  			if err := v.Validate(); err != nil {
  1175  				return RouteActionValidationError{
  1176  					field:  fmt.Sprintf("RequestMirrorPolicies[%v]", idx),
  1177  					reason: "embedded message failed validation",
  1178  					cause:  err,
  1179  				}
  1180  			}
  1181  		}
  1182  
  1183  	}
  1184  
  1185  	if _, ok := core.RoutingPriority_name[int32(m.GetPriority())]; !ok {
  1186  		return RouteActionValidationError{
  1187  			field:  "Priority",
  1188  			reason: "value must be one of the defined enum values",
  1189  		}
  1190  	}
  1191  
  1192  	for idx, item := range m.GetRateLimits() {
  1193  		_, _ = idx, item
  1194  
  1195  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  1196  			if err := v.Validate(); err != nil {
  1197  				return RouteActionValidationError{
  1198  					field:  fmt.Sprintf("RateLimits[%v]", idx),
  1199  					reason: "embedded message failed validation",
  1200  					cause:  err,
  1201  				}
  1202  			}
  1203  		}
  1204  
  1205  	}
  1206  
  1207  	if v, ok := interface{}(m.GetIncludeVhRateLimits()).(interface{ Validate() error }); ok {
  1208  		if err := v.Validate(); err != nil {
  1209  			return RouteActionValidationError{
  1210  				field:  "IncludeVhRateLimits",
  1211  				reason: "embedded message failed validation",
  1212  				cause:  err,
  1213  			}
  1214  		}
  1215  	}
  1216  
  1217  	for idx, item := range m.GetHashPolicy() {
  1218  		_, _ = idx, item
  1219  
  1220  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  1221  			if err := v.Validate(); err != nil {
  1222  				return RouteActionValidationError{
  1223  					field:  fmt.Sprintf("HashPolicy[%v]", idx),
  1224  					reason: "embedded message failed validation",
  1225  					cause:  err,
  1226  				}
  1227  			}
  1228  		}
  1229  
  1230  	}
  1231  
  1232  	if v, ok := interface{}(m.GetCors()).(interface{ Validate() error }); ok {
  1233  		if err := v.Validate(); err != nil {
  1234  			return RouteActionValidationError{
  1235  				field:  "Cors",
  1236  				reason: "embedded message failed validation",
  1237  				cause:  err,
  1238  			}
  1239  		}
  1240  	}
  1241  
  1242  	if v, ok := interface{}(m.GetMaxGrpcTimeout()).(interface{ Validate() error }); ok {
  1243  		if err := v.Validate(); err != nil {
  1244  			return RouteActionValidationError{
  1245  				field:  "MaxGrpcTimeout",
  1246  				reason: "embedded message failed validation",
  1247  				cause:  err,
  1248  			}
  1249  		}
  1250  	}
  1251  
  1252  	if v, ok := interface{}(m.GetGrpcTimeoutOffset()).(interface{ Validate() error }); ok {
  1253  		if err := v.Validate(); err != nil {
  1254  			return RouteActionValidationError{
  1255  				field:  "GrpcTimeoutOffset",
  1256  				reason: "embedded message failed validation",
  1257  				cause:  err,
  1258  			}
  1259  		}
  1260  	}
  1261  
  1262  	for idx, item := range m.GetUpgradeConfigs() {
  1263  		_, _ = idx, item
  1264  
  1265  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  1266  			if err := v.Validate(); err != nil {
  1267  				return RouteActionValidationError{
  1268  					field:  fmt.Sprintf("UpgradeConfigs[%v]", idx),
  1269  					reason: "embedded message failed validation",
  1270  					cause:  err,
  1271  				}
  1272  			}
  1273  		}
  1274  
  1275  	}
  1276  
  1277  	// no validation rules for InternalRedirectAction
  1278  
  1279  	if v, ok := interface{}(m.GetMaxInternalRedirects()).(interface{ Validate() error }); ok {
  1280  		if err := v.Validate(); err != nil {
  1281  			return RouteActionValidationError{
  1282  				field:  "MaxInternalRedirects",
  1283  				reason: "embedded message failed validation",
  1284  				cause:  err,
  1285  			}
  1286  		}
  1287  	}
  1288  
  1289  	if v, ok := interface{}(m.GetHedgePolicy()).(interface{ Validate() error }); ok {
  1290  		if err := v.Validate(); err != nil {
  1291  			return RouteActionValidationError{
  1292  				field:  "HedgePolicy",
  1293  				reason: "embedded message failed validation",
  1294  				cause:  err,
  1295  			}
  1296  		}
  1297  	}
  1298  
  1299  	switch m.ClusterSpecifier.(type) {
  1300  
  1301  	case *RouteAction_Cluster:
  1302  
  1303  		if len(m.GetCluster()) < 1 {
  1304  			return RouteActionValidationError{
  1305  				field:  "Cluster",
  1306  				reason: "value length must be at least 1 bytes",
  1307  			}
  1308  		}
  1309  
  1310  	case *RouteAction_ClusterHeader:
  1311  
  1312  		if len(m.GetClusterHeader()) < 1 {
  1313  			return RouteActionValidationError{
  1314  				field:  "ClusterHeader",
  1315  				reason: "value length must be at least 1 bytes",
  1316  			}
  1317  		}
  1318  
  1319  		if !_RouteAction_ClusterHeader_Pattern.MatchString(m.GetClusterHeader()) {
  1320  			return RouteActionValidationError{
  1321  				field:  "ClusterHeader",
  1322  				reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
  1323  			}
  1324  		}
  1325  
  1326  	case *RouteAction_WeightedClusters:
  1327  
  1328  		if v, ok := interface{}(m.GetWeightedClusters()).(interface{ Validate() error }); ok {
  1329  			if err := v.Validate(); err != nil {
  1330  				return RouteActionValidationError{
  1331  					field:  "WeightedClusters",
  1332  					reason: "embedded message failed validation",
  1333  					cause:  err,
  1334  				}
  1335  			}
  1336  		}
  1337  
  1338  	default:
  1339  		return RouteActionValidationError{
  1340  			field:  "ClusterSpecifier",
  1341  			reason: "value is required",
  1342  		}
  1343  
  1344  	}
  1345  
  1346  	switch m.HostRewriteSpecifier.(type) {
  1347  
  1348  	case *RouteAction_HostRewrite:
  1349  
  1350  		if !_RouteAction_HostRewrite_Pattern.MatchString(m.GetHostRewrite()) {
  1351  			return RouteActionValidationError{
  1352  				field:  "HostRewrite",
  1353  				reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
  1354  			}
  1355  		}
  1356  
  1357  	case *RouteAction_AutoHostRewrite:
  1358  
  1359  		if v, ok := interface{}(m.GetAutoHostRewrite()).(interface{ Validate() error }); ok {
  1360  			if err := v.Validate(); err != nil {
  1361  				return RouteActionValidationError{
  1362  					field:  "AutoHostRewrite",
  1363  					reason: "embedded message failed validation",
  1364  					cause:  err,
  1365  				}
  1366  			}
  1367  		}
  1368  
  1369  	case *RouteAction_AutoHostRewriteHeader:
  1370  
  1371  		if !_RouteAction_AutoHostRewriteHeader_Pattern.MatchString(m.GetAutoHostRewriteHeader()) {
  1372  			return RouteActionValidationError{
  1373  				field:  "AutoHostRewriteHeader",
  1374  				reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
  1375  			}
  1376  		}
  1377  
  1378  	}
  1379  
  1380  	return nil
  1381  }
  1382  
  1383  // RouteActionValidationError is the validation error returned by
  1384  // RouteAction.Validate if the designated constraints aren't met.
  1385  type RouteActionValidationError struct {
  1386  	field  string
  1387  	reason string
  1388  	cause  error
  1389  	key    bool
  1390  }
  1391  
  1392  // Field function returns field value.
  1393  func (e RouteActionValidationError) Field() string { return e.field }
  1394  
  1395  // Reason function returns reason value.
  1396  func (e RouteActionValidationError) Reason() string { return e.reason }
  1397  
  1398  // Cause function returns cause value.
  1399  func (e RouteActionValidationError) Cause() error { return e.cause }
  1400  
  1401  // Key function returns key value.
  1402  func (e RouteActionValidationError) Key() bool { return e.key }
  1403  
  1404  // ErrorName returns error name.
  1405  func (e RouteActionValidationError) ErrorName() string { return "RouteActionValidationError" }
  1406  
  1407  // Error satisfies the builtin error interface
  1408  func (e RouteActionValidationError) Error() string {
  1409  	cause := ""
  1410  	if e.cause != nil {
  1411  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1412  	}
  1413  
  1414  	key := ""
  1415  	if e.key {
  1416  		key = "key for "
  1417  	}
  1418  
  1419  	return fmt.Sprintf(
  1420  		"invalid %sRouteAction.%s: %s%s",
  1421  		key,
  1422  		e.field,
  1423  		e.reason,
  1424  		cause)
  1425  }
  1426  
  1427  var _ error = RouteActionValidationError{}
  1428  
  1429  var _ interface {
  1430  	Field() string
  1431  	Reason() string
  1432  	Key() bool
  1433  	Cause() error
  1434  	ErrorName() string
  1435  } = RouteActionValidationError{}
  1436  
  1437  var _RouteAction_ClusterHeader_Pattern = regexp.MustCompile("^[^\x00\n\r]*$")
  1438  
  1439  var _RouteAction_PrefixRewrite_Pattern = regexp.MustCompile("^[^\x00\n\r]*$")
  1440  
  1441  var _RouteAction_HostRewrite_Pattern = regexp.MustCompile("^[^\x00\n\r]*$")
  1442  
  1443  var _RouteAction_AutoHostRewriteHeader_Pattern = regexp.MustCompile("^[^\x00\n\r]*$")
  1444  
  1445  // Validate checks the field values on RetryPolicy with the rules defined in
  1446  // the proto definition for this message. If any rules are violated, an error
  1447  // is returned.
  1448  func (m *RetryPolicy) Validate() error {
  1449  	if m == nil {
  1450  		return nil
  1451  	}
  1452  
  1453  	// no validation rules for RetryOn
  1454  
  1455  	if v, ok := interface{}(m.GetNumRetries()).(interface{ Validate() error }); ok {
  1456  		if err := v.Validate(); err != nil {
  1457  			return RetryPolicyValidationError{
  1458  				field:  "NumRetries",
  1459  				reason: "embedded message failed validation",
  1460  				cause:  err,
  1461  			}
  1462  		}
  1463  	}
  1464  
  1465  	if v, ok := interface{}(m.GetPerTryTimeout()).(interface{ Validate() error }); ok {
  1466  		if err := v.Validate(); err != nil {
  1467  			return RetryPolicyValidationError{
  1468  				field:  "PerTryTimeout",
  1469  				reason: "embedded message failed validation",
  1470  				cause:  err,
  1471  			}
  1472  		}
  1473  	}
  1474  
  1475  	if v, ok := interface{}(m.GetRetryPriority()).(interface{ Validate() error }); ok {
  1476  		if err := v.Validate(); err != nil {
  1477  			return RetryPolicyValidationError{
  1478  				field:  "RetryPriority",
  1479  				reason: "embedded message failed validation",
  1480  				cause:  err,
  1481  			}
  1482  		}
  1483  	}
  1484  
  1485  	for idx, item := range m.GetRetryHostPredicate() {
  1486  		_, _ = idx, item
  1487  
  1488  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  1489  			if err := v.Validate(); err != nil {
  1490  				return RetryPolicyValidationError{
  1491  					field:  fmt.Sprintf("RetryHostPredicate[%v]", idx),
  1492  					reason: "embedded message failed validation",
  1493  					cause:  err,
  1494  				}
  1495  			}
  1496  		}
  1497  
  1498  	}
  1499  
  1500  	// no validation rules for HostSelectionRetryMaxAttempts
  1501  
  1502  	if v, ok := interface{}(m.GetRetryBackOff()).(interface{ Validate() error }); ok {
  1503  		if err := v.Validate(); err != nil {
  1504  			return RetryPolicyValidationError{
  1505  				field:  "RetryBackOff",
  1506  				reason: "embedded message failed validation",
  1507  				cause:  err,
  1508  			}
  1509  		}
  1510  	}
  1511  
  1512  	for idx, item := range m.GetRetriableHeaders() {
  1513  		_, _ = idx, item
  1514  
  1515  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  1516  			if err := v.Validate(); err != nil {
  1517  				return RetryPolicyValidationError{
  1518  					field:  fmt.Sprintf("RetriableHeaders[%v]", idx),
  1519  					reason: "embedded message failed validation",
  1520  					cause:  err,
  1521  				}
  1522  			}
  1523  		}
  1524  
  1525  	}
  1526  
  1527  	for idx, item := range m.GetRetriableRequestHeaders() {
  1528  		_, _ = idx, item
  1529  
  1530  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  1531  			if err := v.Validate(); err != nil {
  1532  				return RetryPolicyValidationError{
  1533  					field:  fmt.Sprintf("RetriableRequestHeaders[%v]", idx),
  1534  					reason: "embedded message failed validation",
  1535  					cause:  err,
  1536  				}
  1537  			}
  1538  		}
  1539  
  1540  	}
  1541  
  1542  	return nil
  1543  }
  1544  
  1545  // RetryPolicyValidationError is the validation error returned by
  1546  // RetryPolicy.Validate if the designated constraints aren't met.
  1547  type RetryPolicyValidationError struct {
  1548  	field  string
  1549  	reason string
  1550  	cause  error
  1551  	key    bool
  1552  }
  1553  
  1554  // Field function returns field value.
  1555  func (e RetryPolicyValidationError) Field() string { return e.field }
  1556  
  1557  // Reason function returns reason value.
  1558  func (e RetryPolicyValidationError) Reason() string { return e.reason }
  1559  
  1560  // Cause function returns cause value.
  1561  func (e RetryPolicyValidationError) Cause() error { return e.cause }
  1562  
  1563  // Key function returns key value.
  1564  func (e RetryPolicyValidationError) Key() bool { return e.key }
  1565  
  1566  // ErrorName returns error name.
  1567  func (e RetryPolicyValidationError) ErrorName() string { return "RetryPolicyValidationError" }
  1568  
  1569  // Error satisfies the builtin error interface
  1570  func (e RetryPolicyValidationError) Error() string {
  1571  	cause := ""
  1572  	if e.cause != nil {
  1573  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1574  	}
  1575  
  1576  	key := ""
  1577  	if e.key {
  1578  		key = "key for "
  1579  	}
  1580  
  1581  	return fmt.Sprintf(
  1582  		"invalid %sRetryPolicy.%s: %s%s",
  1583  		key,
  1584  		e.field,
  1585  		e.reason,
  1586  		cause)
  1587  }
  1588  
  1589  var _ error = RetryPolicyValidationError{}
  1590  
  1591  var _ interface {
  1592  	Field() string
  1593  	Reason() string
  1594  	Key() bool
  1595  	Cause() error
  1596  	ErrorName() string
  1597  } = RetryPolicyValidationError{}
  1598  
  1599  // Validate checks the field values on HedgePolicy with the rules defined in
  1600  // the proto definition for this message. If any rules are violated, an error
  1601  // is returned.
  1602  func (m *HedgePolicy) Validate() error {
  1603  	if m == nil {
  1604  		return nil
  1605  	}
  1606  
  1607  	if wrapper := m.GetInitialRequests(); wrapper != nil {
  1608  
  1609  		if wrapper.GetValue() < 1 {
  1610  			return HedgePolicyValidationError{
  1611  				field:  "InitialRequests",
  1612  				reason: "value must be greater than or equal to 1",
  1613  			}
  1614  		}
  1615  
  1616  	}
  1617  
  1618  	if v, ok := interface{}(m.GetAdditionalRequestChance()).(interface{ Validate() error }); ok {
  1619  		if err := v.Validate(); err != nil {
  1620  			return HedgePolicyValidationError{
  1621  				field:  "AdditionalRequestChance",
  1622  				reason: "embedded message failed validation",
  1623  				cause:  err,
  1624  			}
  1625  		}
  1626  	}
  1627  
  1628  	// no validation rules for HedgeOnPerTryTimeout
  1629  
  1630  	return nil
  1631  }
  1632  
  1633  // HedgePolicyValidationError is the validation error returned by
  1634  // HedgePolicy.Validate if the designated constraints aren't met.
  1635  type HedgePolicyValidationError struct {
  1636  	field  string
  1637  	reason string
  1638  	cause  error
  1639  	key    bool
  1640  }
  1641  
  1642  // Field function returns field value.
  1643  func (e HedgePolicyValidationError) Field() string { return e.field }
  1644  
  1645  // Reason function returns reason value.
  1646  func (e HedgePolicyValidationError) Reason() string { return e.reason }
  1647  
  1648  // Cause function returns cause value.
  1649  func (e HedgePolicyValidationError) Cause() error { return e.cause }
  1650  
  1651  // Key function returns key value.
  1652  func (e HedgePolicyValidationError) Key() bool { return e.key }
  1653  
  1654  // ErrorName returns error name.
  1655  func (e HedgePolicyValidationError) ErrorName() string { return "HedgePolicyValidationError" }
  1656  
  1657  // Error satisfies the builtin error interface
  1658  func (e HedgePolicyValidationError) Error() string {
  1659  	cause := ""
  1660  	if e.cause != nil {
  1661  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1662  	}
  1663  
  1664  	key := ""
  1665  	if e.key {
  1666  		key = "key for "
  1667  	}
  1668  
  1669  	return fmt.Sprintf(
  1670  		"invalid %sHedgePolicy.%s: %s%s",
  1671  		key,
  1672  		e.field,
  1673  		e.reason,
  1674  		cause)
  1675  }
  1676  
  1677  var _ error = HedgePolicyValidationError{}
  1678  
  1679  var _ interface {
  1680  	Field() string
  1681  	Reason() string
  1682  	Key() bool
  1683  	Cause() error
  1684  	ErrorName() string
  1685  } = HedgePolicyValidationError{}
  1686  
  1687  // Validate checks the field values on RedirectAction with the rules defined in
  1688  // the proto definition for this message. If any rules are violated, an error
  1689  // is returned.
  1690  func (m *RedirectAction) Validate() error {
  1691  	if m == nil {
  1692  		return nil
  1693  	}
  1694  
  1695  	if !_RedirectAction_HostRedirect_Pattern.MatchString(m.GetHostRedirect()) {
  1696  		return RedirectActionValidationError{
  1697  			field:  "HostRedirect",
  1698  			reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
  1699  		}
  1700  	}
  1701  
  1702  	// no validation rules for PortRedirect
  1703  
  1704  	if _, ok := RedirectAction_RedirectResponseCode_name[int32(m.GetResponseCode())]; !ok {
  1705  		return RedirectActionValidationError{
  1706  			field:  "ResponseCode",
  1707  			reason: "value must be one of the defined enum values",
  1708  		}
  1709  	}
  1710  
  1711  	// no validation rules for StripQuery
  1712  
  1713  	switch m.SchemeRewriteSpecifier.(type) {
  1714  
  1715  	case *RedirectAction_HttpsRedirect:
  1716  		// no validation rules for HttpsRedirect
  1717  
  1718  	case *RedirectAction_SchemeRedirect:
  1719  		// no validation rules for SchemeRedirect
  1720  
  1721  	}
  1722  
  1723  	switch m.PathRewriteSpecifier.(type) {
  1724  
  1725  	case *RedirectAction_PathRedirect:
  1726  
  1727  		if !_RedirectAction_PathRedirect_Pattern.MatchString(m.GetPathRedirect()) {
  1728  			return RedirectActionValidationError{
  1729  				field:  "PathRedirect",
  1730  				reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
  1731  			}
  1732  		}
  1733  
  1734  	case *RedirectAction_PrefixRewrite:
  1735  
  1736  		if !_RedirectAction_PrefixRewrite_Pattern.MatchString(m.GetPrefixRewrite()) {
  1737  			return RedirectActionValidationError{
  1738  				field:  "PrefixRewrite",
  1739  				reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
  1740  			}
  1741  		}
  1742  
  1743  	}
  1744  
  1745  	return nil
  1746  }
  1747  
  1748  // RedirectActionValidationError is the validation error returned by
  1749  // RedirectAction.Validate if the designated constraints aren't met.
  1750  type RedirectActionValidationError struct {
  1751  	field  string
  1752  	reason string
  1753  	cause  error
  1754  	key    bool
  1755  }
  1756  
  1757  // Field function returns field value.
  1758  func (e RedirectActionValidationError) Field() string { return e.field }
  1759  
  1760  // Reason function returns reason value.
  1761  func (e RedirectActionValidationError) Reason() string { return e.reason }
  1762  
  1763  // Cause function returns cause value.
  1764  func (e RedirectActionValidationError) Cause() error { return e.cause }
  1765  
  1766  // Key function returns key value.
  1767  func (e RedirectActionValidationError) Key() bool { return e.key }
  1768  
  1769  // ErrorName returns error name.
  1770  func (e RedirectActionValidationError) ErrorName() string { return "RedirectActionValidationError" }
  1771  
  1772  // Error satisfies the builtin error interface
  1773  func (e RedirectActionValidationError) Error() string {
  1774  	cause := ""
  1775  	if e.cause != nil {
  1776  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1777  	}
  1778  
  1779  	key := ""
  1780  	if e.key {
  1781  		key = "key for "
  1782  	}
  1783  
  1784  	return fmt.Sprintf(
  1785  		"invalid %sRedirectAction.%s: %s%s",
  1786  		key,
  1787  		e.field,
  1788  		e.reason,
  1789  		cause)
  1790  }
  1791  
  1792  var _ error = RedirectActionValidationError{}
  1793  
  1794  var _ interface {
  1795  	Field() string
  1796  	Reason() string
  1797  	Key() bool
  1798  	Cause() error
  1799  	ErrorName() string
  1800  } = RedirectActionValidationError{}
  1801  
  1802  var _RedirectAction_HostRedirect_Pattern = regexp.MustCompile("^[^\x00\n\r]*$")
  1803  
  1804  var _RedirectAction_PathRedirect_Pattern = regexp.MustCompile("^[^\x00\n\r]*$")
  1805  
  1806  var _RedirectAction_PrefixRewrite_Pattern = regexp.MustCompile("^[^\x00\n\r]*$")
  1807  
  1808  // Validate checks the field values on DirectResponseAction with the rules
  1809  // defined in the proto definition for this message. If any rules are
  1810  // violated, an error is returned.
  1811  func (m *DirectResponseAction) Validate() error {
  1812  	if m == nil {
  1813  		return nil
  1814  	}
  1815  
  1816  	if val := m.GetStatus(); val < 100 || val >= 600 {
  1817  		return DirectResponseActionValidationError{
  1818  			field:  "Status",
  1819  			reason: "value must be inside range [100, 600)",
  1820  		}
  1821  	}
  1822  
  1823  	if v, ok := interface{}(m.GetBody()).(interface{ Validate() error }); ok {
  1824  		if err := v.Validate(); err != nil {
  1825  			return DirectResponseActionValidationError{
  1826  				field:  "Body",
  1827  				reason: "embedded message failed validation",
  1828  				cause:  err,
  1829  			}
  1830  		}
  1831  	}
  1832  
  1833  	return nil
  1834  }
  1835  
  1836  // DirectResponseActionValidationError is the validation error returned by
  1837  // DirectResponseAction.Validate if the designated constraints aren't met.
  1838  type DirectResponseActionValidationError struct {
  1839  	field  string
  1840  	reason string
  1841  	cause  error
  1842  	key    bool
  1843  }
  1844  
  1845  // Field function returns field value.
  1846  func (e DirectResponseActionValidationError) Field() string { return e.field }
  1847  
  1848  // Reason function returns reason value.
  1849  func (e DirectResponseActionValidationError) Reason() string { return e.reason }
  1850  
  1851  // Cause function returns cause value.
  1852  func (e DirectResponseActionValidationError) Cause() error { return e.cause }
  1853  
  1854  // Key function returns key value.
  1855  func (e DirectResponseActionValidationError) Key() bool { return e.key }
  1856  
  1857  // ErrorName returns error name.
  1858  func (e DirectResponseActionValidationError) ErrorName() string {
  1859  	return "DirectResponseActionValidationError"
  1860  }
  1861  
  1862  // Error satisfies the builtin error interface
  1863  func (e DirectResponseActionValidationError) Error() string {
  1864  	cause := ""
  1865  	if e.cause != nil {
  1866  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1867  	}
  1868  
  1869  	key := ""
  1870  	if e.key {
  1871  		key = "key for "
  1872  	}
  1873  
  1874  	return fmt.Sprintf(
  1875  		"invalid %sDirectResponseAction.%s: %s%s",
  1876  		key,
  1877  		e.field,
  1878  		e.reason,
  1879  		cause)
  1880  }
  1881  
  1882  var _ error = DirectResponseActionValidationError{}
  1883  
  1884  var _ interface {
  1885  	Field() string
  1886  	Reason() string
  1887  	Key() bool
  1888  	Cause() error
  1889  	ErrorName() string
  1890  } = DirectResponseActionValidationError{}
  1891  
  1892  // Validate checks the field values on Decorator with the rules defined in the
  1893  // proto definition for this message. If any rules are violated, an error is returned.
  1894  func (m *Decorator) Validate() error {
  1895  	if m == nil {
  1896  		return nil
  1897  	}
  1898  
  1899  	if len(m.GetOperation()) < 1 {
  1900  		return DecoratorValidationError{
  1901  			field:  "Operation",
  1902  			reason: "value length must be at least 1 bytes",
  1903  		}
  1904  	}
  1905  
  1906  	if v, ok := interface{}(m.GetPropagate()).(interface{ Validate() error }); ok {
  1907  		if err := v.Validate(); err != nil {
  1908  			return DecoratorValidationError{
  1909  				field:  "Propagate",
  1910  				reason: "embedded message failed validation",
  1911  				cause:  err,
  1912  			}
  1913  		}
  1914  	}
  1915  
  1916  	return nil
  1917  }
  1918  
  1919  // DecoratorValidationError is the validation error returned by
  1920  // Decorator.Validate if the designated constraints aren't met.
  1921  type DecoratorValidationError struct {
  1922  	field  string
  1923  	reason string
  1924  	cause  error
  1925  	key    bool
  1926  }
  1927  
  1928  // Field function returns field value.
  1929  func (e DecoratorValidationError) Field() string { return e.field }
  1930  
  1931  // Reason function returns reason value.
  1932  func (e DecoratorValidationError) Reason() string { return e.reason }
  1933  
  1934  // Cause function returns cause value.
  1935  func (e DecoratorValidationError) Cause() error { return e.cause }
  1936  
  1937  // Key function returns key value.
  1938  func (e DecoratorValidationError) Key() bool { return e.key }
  1939  
  1940  // ErrorName returns error name.
  1941  func (e DecoratorValidationError) ErrorName() string { return "DecoratorValidationError" }
  1942  
  1943  // Error satisfies the builtin error interface
  1944  func (e DecoratorValidationError) Error() string {
  1945  	cause := ""
  1946  	if e.cause != nil {
  1947  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1948  	}
  1949  
  1950  	key := ""
  1951  	if e.key {
  1952  		key = "key for "
  1953  	}
  1954  
  1955  	return fmt.Sprintf(
  1956  		"invalid %sDecorator.%s: %s%s",
  1957  		key,
  1958  		e.field,
  1959  		e.reason,
  1960  		cause)
  1961  }
  1962  
  1963  var _ error = DecoratorValidationError{}
  1964  
  1965  var _ interface {
  1966  	Field() string
  1967  	Reason() string
  1968  	Key() bool
  1969  	Cause() error
  1970  	ErrorName() string
  1971  } = DecoratorValidationError{}
  1972  
  1973  // Validate checks the field values on Tracing with the rules defined in the
  1974  // proto definition for this message. If any rules are violated, an error is returned.
  1975  func (m *Tracing) Validate() error {
  1976  	if m == nil {
  1977  		return nil
  1978  	}
  1979  
  1980  	if v, ok := interface{}(m.GetClientSampling()).(interface{ Validate() error }); ok {
  1981  		if err := v.Validate(); err != nil {
  1982  			return TracingValidationError{
  1983  				field:  "ClientSampling",
  1984  				reason: "embedded message failed validation",
  1985  				cause:  err,
  1986  			}
  1987  		}
  1988  	}
  1989  
  1990  	if v, ok := interface{}(m.GetRandomSampling()).(interface{ Validate() error }); ok {
  1991  		if err := v.Validate(); err != nil {
  1992  			return TracingValidationError{
  1993  				field:  "RandomSampling",
  1994  				reason: "embedded message failed validation",
  1995  				cause:  err,
  1996  			}
  1997  		}
  1998  	}
  1999  
  2000  	if v, ok := interface{}(m.GetOverallSampling()).(interface{ Validate() error }); ok {
  2001  		if err := v.Validate(); err != nil {
  2002  			return TracingValidationError{
  2003  				field:  "OverallSampling",
  2004  				reason: "embedded message failed validation",
  2005  				cause:  err,
  2006  			}
  2007  		}
  2008  	}
  2009  
  2010  	for idx, item := range m.GetCustomTags() {
  2011  		_, _ = idx, item
  2012  
  2013  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  2014  			if err := v.Validate(); err != nil {
  2015  				return TracingValidationError{
  2016  					field:  fmt.Sprintf("CustomTags[%v]", idx),
  2017  					reason: "embedded message failed validation",
  2018  					cause:  err,
  2019  				}
  2020  			}
  2021  		}
  2022  
  2023  	}
  2024  
  2025  	return nil
  2026  }
  2027  
  2028  // TracingValidationError is the validation error returned by Tracing.Validate
  2029  // if the designated constraints aren't met.
  2030  type TracingValidationError struct {
  2031  	field  string
  2032  	reason string
  2033  	cause  error
  2034  	key    bool
  2035  }
  2036  
  2037  // Field function returns field value.
  2038  func (e TracingValidationError) Field() string { return e.field }
  2039  
  2040  // Reason function returns reason value.
  2041  func (e TracingValidationError) Reason() string { return e.reason }
  2042  
  2043  // Cause function returns cause value.
  2044  func (e TracingValidationError) Cause() error { return e.cause }
  2045  
  2046  // Key function returns key value.
  2047  func (e TracingValidationError) Key() bool { return e.key }
  2048  
  2049  // ErrorName returns error name.
  2050  func (e TracingValidationError) ErrorName() string { return "TracingValidationError" }
  2051  
  2052  // Error satisfies the builtin error interface
  2053  func (e TracingValidationError) Error() string {
  2054  	cause := ""
  2055  	if e.cause != nil {
  2056  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  2057  	}
  2058  
  2059  	key := ""
  2060  	if e.key {
  2061  		key = "key for "
  2062  	}
  2063  
  2064  	return fmt.Sprintf(
  2065  		"invalid %sTracing.%s: %s%s",
  2066  		key,
  2067  		e.field,
  2068  		e.reason,
  2069  		cause)
  2070  }
  2071  
  2072  var _ error = TracingValidationError{}
  2073  
  2074  var _ interface {
  2075  	Field() string
  2076  	Reason() string
  2077  	Key() bool
  2078  	Cause() error
  2079  	ErrorName() string
  2080  } = TracingValidationError{}
  2081  
  2082  // Validate checks the field values on VirtualCluster with the rules defined in
  2083  // the proto definition for this message. If any rules are violated, an error
  2084  // is returned.
  2085  func (m *VirtualCluster) Validate() error {
  2086  	if m == nil {
  2087  		return nil
  2088  	}
  2089  
  2090  	if len(m.GetPattern()) > 1024 {
  2091  		return VirtualClusterValidationError{
  2092  			field:  "Pattern",
  2093  			reason: "value length must be at most 1024 bytes",
  2094  		}
  2095  	}
  2096  
  2097  	for idx, item := range m.GetHeaders() {
  2098  		_, _ = idx, item
  2099  
  2100  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  2101  			if err := v.Validate(); err != nil {
  2102  				return VirtualClusterValidationError{
  2103  					field:  fmt.Sprintf("Headers[%v]", idx),
  2104  					reason: "embedded message failed validation",
  2105  					cause:  err,
  2106  				}
  2107  			}
  2108  		}
  2109  
  2110  	}
  2111  
  2112  	if len(m.GetName()) < 1 {
  2113  		return VirtualClusterValidationError{
  2114  			field:  "Name",
  2115  			reason: "value length must be at least 1 bytes",
  2116  		}
  2117  	}
  2118  
  2119  	// no validation rules for Method
  2120  
  2121  	return nil
  2122  }
  2123  
  2124  // VirtualClusterValidationError is the validation error returned by
  2125  // VirtualCluster.Validate if the designated constraints aren't met.
  2126  type VirtualClusterValidationError struct {
  2127  	field  string
  2128  	reason string
  2129  	cause  error
  2130  	key    bool
  2131  }
  2132  
  2133  // Field function returns field value.
  2134  func (e VirtualClusterValidationError) Field() string { return e.field }
  2135  
  2136  // Reason function returns reason value.
  2137  func (e VirtualClusterValidationError) Reason() string { return e.reason }
  2138  
  2139  // Cause function returns cause value.
  2140  func (e VirtualClusterValidationError) Cause() error { return e.cause }
  2141  
  2142  // Key function returns key value.
  2143  func (e VirtualClusterValidationError) Key() bool { return e.key }
  2144  
  2145  // ErrorName returns error name.
  2146  func (e VirtualClusterValidationError) ErrorName() string { return "VirtualClusterValidationError" }
  2147  
  2148  // Error satisfies the builtin error interface
  2149  func (e VirtualClusterValidationError) Error() string {
  2150  	cause := ""
  2151  	if e.cause != nil {
  2152  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  2153  	}
  2154  
  2155  	key := ""
  2156  	if e.key {
  2157  		key = "key for "
  2158  	}
  2159  
  2160  	return fmt.Sprintf(
  2161  		"invalid %sVirtualCluster.%s: %s%s",
  2162  		key,
  2163  		e.field,
  2164  		e.reason,
  2165  		cause)
  2166  }
  2167  
  2168  var _ error = VirtualClusterValidationError{}
  2169  
  2170  var _ interface {
  2171  	Field() string
  2172  	Reason() string
  2173  	Key() bool
  2174  	Cause() error
  2175  	ErrorName() string
  2176  } = VirtualClusterValidationError{}
  2177  
  2178  // Validate checks the field values on RateLimit with the rules defined in the
  2179  // proto definition for this message. If any rules are violated, an error is returned.
  2180  func (m *RateLimit) Validate() error {
  2181  	if m == nil {
  2182  		return nil
  2183  	}
  2184  
  2185  	if wrapper := m.GetStage(); wrapper != nil {
  2186  
  2187  		if wrapper.GetValue() > 10 {
  2188  			return RateLimitValidationError{
  2189  				field:  "Stage",
  2190  				reason: "value must be less than or equal to 10",
  2191  			}
  2192  		}
  2193  
  2194  	}
  2195  
  2196  	// no validation rules for DisableKey
  2197  
  2198  	if len(m.GetActions()) < 1 {
  2199  		return RateLimitValidationError{
  2200  			field:  "Actions",
  2201  			reason: "value must contain at least 1 item(s)",
  2202  		}
  2203  	}
  2204  
  2205  	for idx, item := range m.GetActions() {
  2206  		_, _ = idx, item
  2207  
  2208  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  2209  			if err := v.Validate(); err != nil {
  2210  				return RateLimitValidationError{
  2211  					field:  fmt.Sprintf("Actions[%v]", idx),
  2212  					reason: "embedded message failed validation",
  2213  					cause:  err,
  2214  				}
  2215  			}
  2216  		}
  2217  
  2218  	}
  2219  
  2220  	return nil
  2221  }
  2222  
  2223  // RateLimitValidationError is the validation error returned by
  2224  // RateLimit.Validate if the designated constraints aren't met.
  2225  type RateLimitValidationError struct {
  2226  	field  string
  2227  	reason string
  2228  	cause  error
  2229  	key    bool
  2230  }
  2231  
  2232  // Field function returns field value.
  2233  func (e RateLimitValidationError) Field() string { return e.field }
  2234  
  2235  // Reason function returns reason value.
  2236  func (e RateLimitValidationError) Reason() string { return e.reason }
  2237  
  2238  // Cause function returns cause value.
  2239  func (e RateLimitValidationError) Cause() error { return e.cause }
  2240  
  2241  // Key function returns key value.
  2242  func (e RateLimitValidationError) Key() bool { return e.key }
  2243  
  2244  // ErrorName returns error name.
  2245  func (e RateLimitValidationError) ErrorName() string { return "RateLimitValidationError" }
  2246  
  2247  // Error satisfies the builtin error interface
  2248  func (e RateLimitValidationError) Error() string {
  2249  	cause := ""
  2250  	if e.cause != nil {
  2251  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  2252  	}
  2253  
  2254  	key := ""
  2255  	if e.key {
  2256  		key = "key for "
  2257  	}
  2258  
  2259  	return fmt.Sprintf(
  2260  		"invalid %sRateLimit.%s: %s%s",
  2261  		key,
  2262  		e.field,
  2263  		e.reason,
  2264  		cause)
  2265  }
  2266  
  2267  var _ error = RateLimitValidationError{}
  2268  
  2269  var _ interface {
  2270  	Field() string
  2271  	Reason() string
  2272  	Key() bool
  2273  	Cause() error
  2274  	ErrorName() string
  2275  } = RateLimitValidationError{}
  2276  
  2277  // Validate checks the field values on HeaderMatcher with the rules defined in
  2278  // the proto definition for this message. If any rules are violated, an error
  2279  // is returned.
  2280  func (m *HeaderMatcher) Validate() error {
  2281  	if m == nil {
  2282  		return nil
  2283  	}
  2284  
  2285  	if len(m.GetName()) < 1 {
  2286  		return HeaderMatcherValidationError{
  2287  			field:  "Name",
  2288  			reason: "value length must be at least 1 bytes",
  2289  		}
  2290  	}
  2291  
  2292  	if !_HeaderMatcher_Name_Pattern.MatchString(m.GetName()) {
  2293  		return HeaderMatcherValidationError{
  2294  			field:  "Name",
  2295  			reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
  2296  		}
  2297  	}
  2298  
  2299  	// no validation rules for InvertMatch
  2300  
  2301  	switch m.HeaderMatchSpecifier.(type) {
  2302  
  2303  	case *HeaderMatcher_ExactMatch:
  2304  		// no validation rules for ExactMatch
  2305  
  2306  	case *HeaderMatcher_RegexMatch:
  2307  
  2308  		if len(m.GetRegexMatch()) > 1024 {
  2309  			return HeaderMatcherValidationError{
  2310  				field:  "RegexMatch",
  2311  				reason: "value length must be at most 1024 bytes",
  2312  			}
  2313  		}
  2314  
  2315  	case *HeaderMatcher_SafeRegexMatch:
  2316  
  2317  		if v, ok := interface{}(m.GetSafeRegexMatch()).(interface{ Validate() error }); ok {
  2318  			if err := v.Validate(); err != nil {
  2319  				return HeaderMatcherValidationError{
  2320  					field:  "SafeRegexMatch",
  2321  					reason: "embedded message failed validation",
  2322  					cause:  err,
  2323  				}
  2324  			}
  2325  		}
  2326  
  2327  	case *HeaderMatcher_RangeMatch:
  2328  
  2329  		if v, ok := interface{}(m.GetRangeMatch()).(interface{ Validate() error }); ok {
  2330  			if err := v.Validate(); err != nil {
  2331  				return HeaderMatcherValidationError{
  2332  					field:  "RangeMatch",
  2333  					reason: "embedded message failed validation",
  2334  					cause:  err,
  2335  				}
  2336  			}
  2337  		}
  2338  
  2339  	case *HeaderMatcher_PresentMatch:
  2340  		// no validation rules for PresentMatch
  2341  
  2342  	case *HeaderMatcher_PrefixMatch:
  2343  
  2344  		if len(m.GetPrefixMatch()) < 1 {
  2345  			return HeaderMatcherValidationError{
  2346  				field:  "PrefixMatch",
  2347  				reason: "value length must be at least 1 bytes",
  2348  			}
  2349  		}
  2350  
  2351  	case *HeaderMatcher_SuffixMatch:
  2352  
  2353  		if len(m.GetSuffixMatch()) < 1 {
  2354  			return HeaderMatcherValidationError{
  2355  				field:  "SuffixMatch",
  2356  				reason: "value length must be at least 1 bytes",
  2357  			}
  2358  		}
  2359  
  2360  	}
  2361  
  2362  	return nil
  2363  }
  2364  
  2365  // HeaderMatcherValidationError is the validation error returned by
  2366  // HeaderMatcher.Validate if the designated constraints aren't met.
  2367  type HeaderMatcherValidationError struct {
  2368  	field  string
  2369  	reason string
  2370  	cause  error
  2371  	key    bool
  2372  }
  2373  
  2374  // Field function returns field value.
  2375  func (e HeaderMatcherValidationError) Field() string { return e.field }
  2376  
  2377  // Reason function returns reason value.
  2378  func (e HeaderMatcherValidationError) Reason() string { return e.reason }
  2379  
  2380  // Cause function returns cause value.
  2381  func (e HeaderMatcherValidationError) Cause() error { return e.cause }
  2382  
  2383  // Key function returns key value.
  2384  func (e HeaderMatcherValidationError) Key() bool { return e.key }
  2385  
  2386  // ErrorName returns error name.
  2387  func (e HeaderMatcherValidationError) ErrorName() string { return "HeaderMatcherValidationError" }
  2388  
  2389  // Error satisfies the builtin error interface
  2390  func (e HeaderMatcherValidationError) Error() string {
  2391  	cause := ""
  2392  	if e.cause != nil {
  2393  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  2394  	}
  2395  
  2396  	key := ""
  2397  	if e.key {
  2398  		key = "key for "
  2399  	}
  2400  
  2401  	return fmt.Sprintf(
  2402  		"invalid %sHeaderMatcher.%s: %s%s",
  2403  		key,
  2404  		e.field,
  2405  		e.reason,
  2406  		cause)
  2407  }
  2408  
  2409  var _ error = HeaderMatcherValidationError{}
  2410  
  2411  var _ interface {
  2412  	Field() string
  2413  	Reason() string
  2414  	Key() bool
  2415  	Cause() error
  2416  	ErrorName() string
  2417  } = HeaderMatcherValidationError{}
  2418  
  2419  var _HeaderMatcher_Name_Pattern = regexp.MustCompile("^[^\x00\n\r]*$")
  2420  
  2421  // Validate checks the field values on QueryParameterMatcher with the rules
  2422  // defined in the proto definition for this message. If any rules are
  2423  // violated, an error is returned.
  2424  func (m *QueryParameterMatcher) Validate() error {
  2425  	if m == nil {
  2426  		return nil
  2427  	}
  2428  
  2429  	if l := len(m.GetName()); l < 1 || l > 1024 {
  2430  		return QueryParameterMatcherValidationError{
  2431  			field:  "Name",
  2432  			reason: "value length must be between 1 and 1024 bytes, inclusive",
  2433  		}
  2434  	}
  2435  
  2436  	// no validation rules for Value
  2437  
  2438  	if v, ok := interface{}(m.GetRegex()).(interface{ Validate() error }); ok {
  2439  		if err := v.Validate(); err != nil {
  2440  			return QueryParameterMatcherValidationError{
  2441  				field:  "Regex",
  2442  				reason: "embedded message failed validation",
  2443  				cause:  err,
  2444  			}
  2445  		}
  2446  	}
  2447  
  2448  	switch m.QueryParameterMatchSpecifier.(type) {
  2449  
  2450  	case *QueryParameterMatcher_StringMatch:
  2451  
  2452  		if m.GetStringMatch() == nil {
  2453  			return QueryParameterMatcherValidationError{
  2454  				field:  "StringMatch",
  2455  				reason: "value is required",
  2456  			}
  2457  		}
  2458  
  2459  		if v, ok := interface{}(m.GetStringMatch()).(interface{ Validate() error }); ok {
  2460  			if err := v.Validate(); err != nil {
  2461  				return QueryParameterMatcherValidationError{
  2462  					field:  "StringMatch",
  2463  					reason: "embedded message failed validation",
  2464  					cause:  err,
  2465  				}
  2466  			}
  2467  		}
  2468  
  2469  	case *QueryParameterMatcher_PresentMatch:
  2470  		// no validation rules for PresentMatch
  2471  
  2472  	}
  2473  
  2474  	return nil
  2475  }
  2476  
  2477  // QueryParameterMatcherValidationError is the validation error returned by
  2478  // QueryParameterMatcher.Validate if the designated constraints aren't met.
  2479  type QueryParameterMatcherValidationError struct {
  2480  	field  string
  2481  	reason string
  2482  	cause  error
  2483  	key    bool
  2484  }
  2485  
  2486  // Field function returns field value.
  2487  func (e QueryParameterMatcherValidationError) Field() string { return e.field }
  2488  
  2489  // Reason function returns reason value.
  2490  func (e QueryParameterMatcherValidationError) Reason() string { return e.reason }
  2491  
  2492  // Cause function returns cause value.
  2493  func (e QueryParameterMatcherValidationError) Cause() error { return e.cause }
  2494  
  2495  // Key function returns key value.
  2496  func (e QueryParameterMatcherValidationError) Key() bool { return e.key }
  2497  
  2498  // ErrorName returns error name.
  2499  func (e QueryParameterMatcherValidationError) ErrorName() string {
  2500  	return "QueryParameterMatcherValidationError"
  2501  }
  2502  
  2503  // Error satisfies the builtin error interface
  2504  func (e QueryParameterMatcherValidationError) Error() string {
  2505  	cause := ""
  2506  	if e.cause != nil {
  2507  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  2508  	}
  2509  
  2510  	key := ""
  2511  	if e.key {
  2512  		key = "key for "
  2513  	}
  2514  
  2515  	return fmt.Sprintf(
  2516  		"invalid %sQueryParameterMatcher.%s: %s%s",
  2517  		key,
  2518  		e.field,
  2519  		e.reason,
  2520  		cause)
  2521  }
  2522  
  2523  var _ error = QueryParameterMatcherValidationError{}
  2524  
  2525  var _ interface {
  2526  	Field() string
  2527  	Reason() string
  2528  	Key() bool
  2529  	Cause() error
  2530  	ErrorName() string
  2531  } = QueryParameterMatcherValidationError{}
  2532  
  2533  // Validate checks the field values on WeightedCluster_ClusterWeight with the
  2534  // rules defined in the proto definition for this message. If any rules are
  2535  // violated, an error is returned.
  2536  func (m *WeightedCluster_ClusterWeight) Validate() error {
  2537  	if m == nil {
  2538  		return nil
  2539  	}
  2540  
  2541  	if len(m.GetName()) < 1 {
  2542  		return WeightedCluster_ClusterWeightValidationError{
  2543  			field:  "Name",
  2544  			reason: "value length must be at least 1 bytes",
  2545  		}
  2546  	}
  2547  
  2548  	if v, ok := interface{}(m.GetWeight()).(interface{ Validate() error }); ok {
  2549  		if err := v.Validate(); err != nil {
  2550  			return WeightedCluster_ClusterWeightValidationError{
  2551  				field:  "Weight",
  2552  				reason: "embedded message failed validation",
  2553  				cause:  err,
  2554  			}
  2555  		}
  2556  	}
  2557  
  2558  	if v, ok := interface{}(m.GetMetadataMatch()).(interface{ Validate() error }); ok {
  2559  		if err := v.Validate(); err != nil {
  2560  			return WeightedCluster_ClusterWeightValidationError{
  2561  				field:  "MetadataMatch",
  2562  				reason: "embedded message failed validation",
  2563  				cause:  err,
  2564  			}
  2565  		}
  2566  	}
  2567  
  2568  	if len(m.GetRequestHeadersToAdd()) > 1000 {
  2569  		return WeightedCluster_ClusterWeightValidationError{
  2570  			field:  "RequestHeadersToAdd",
  2571  			reason: "value must contain no more than 1000 item(s)",
  2572  		}
  2573  	}
  2574  
  2575  	for idx, item := range m.GetRequestHeadersToAdd() {
  2576  		_, _ = idx, item
  2577  
  2578  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  2579  			if err := v.Validate(); err != nil {
  2580  				return WeightedCluster_ClusterWeightValidationError{
  2581  					field:  fmt.Sprintf("RequestHeadersToAdd[%v]", idx),
  2582  					reason: "embedded message failed validation",
  2583  					cause:  err,
  2584  				}
  2585  			}
  2586  		}
  2587  
  2588  	}
  2589  
  2590  	if len(m.GetResponseHeadersToAdd()) > 1000 {
  2591  		return WeightedCluster_ClusterWeightValidationError{
  2592  			field:  "ResponseHeadersToAdd",
  2593  			reason: "value must contain no more than 1000 item(s)",
  2594  		}
  2595  	}
  2596  
  2597  	for idx, item := range m.GetResponseHeadersToAdd() {
  2598  		_, _ = idx, item
  2599  
  2600  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  2601  			if err := v.Validate(); err != nil {
  2602  				return WeightedCluster_ClusterWeightValidationError{
  2603  					field:  fmt.Sprintf("ResponseHeadersToAdd[%v]", idx),
  2604  					reason: "embedded message failed validation",
  2605  					cause:  err,
  2606  				}
  2607  			}
  2608  		}
  2609  
  2610  	}
  2611  
  2612  	for key, val := range m.GetPerFilterConfig() {
  2613  		_ = val
  2614  
  2615  		// no validation rules for PerFilterConfig[key]
  2616  
  2617  		if v, ok := interface{}(val).(interface{ Validate() error }); ok {
  2618  			if err := v.Validate(); err != nil {
  2619  				return WeightedCluster_ClusterWeightValidationError{
  2620  					field:  fmt.Sprintf("PerFilterConfig[%v]", key),
  2621  					reason: "embedded message failed validation",
  2622  					cause:  err,
  2623  				}
  2624  			}
  2625  		}
  2626  
  2627  	}
  2628  
  2629  	for key, val := range m.GetTypedPerFilterConfig() {
  2630  		_ = val
  2631  
  2632  		// no validation rules for TypedPerFilterConfig[key]
  2633  
  2634  		if v, ok := interface{}(val).(interface{ Validate() error }); ok {
  2635  			if err := v.Validate(); err != nil {
  2636  				return WeightedCluster_ClusterWeightValidationError{
  2637  					field:  fmt.Sprintf("TypedPerFilterConfig[%v]", key),
  2638  					reason: "embedded message failed validation",
  2639  					cause:  err,
  2640  				}
  2641  			}
  2642  		}
  2643  
  2644  	}
  2645  
  2646  	return nil
  2647  }
  2648  
  2649  // WeightedCluster_ClusterWeightValidationError is the validation error
  2650  // returned by WeightedCluster_ClusterWeight.Validate if the designated
  2651  // constraints aren't met.
  2652  type WeightedCluster_ClusterWeightValidationError struct {
  2653  	field  string
  2654  	reason string
  2655  	cause  error
  2656  	key    bool
  2657  }
  2658  
  2659  // Field function returns field value.
  2660  func (e WeightedCluster_ClusterWeightValidationError) Field() string { return e.field }
  2661  
  2662  // Reason function returns reason value.
  2663  func (e WeightedCluster_ClusterWeightValidationError) Reason() string { return e.reason }
  2664  
  2665  // Cause function returns cause value.
  2666  func (e WeightedCluster_ClusterWeightValidationError) Cause() error { return e.cause }
  2667  
  2668  // Key function returns key value.
  2669  func (e WeightedCluster_ClusterWeightValidationError) Key() bool { return e.key }
  2670  
  2671  // ErrorName returns error name.
  2672  func (e WeightedCluster_ClusterWeightValidationError) ErrorName() string {
  2673  	return "WeightedCluster_ClusterWeightValidationError"
  2674  }
  2675  
  2676  // Error satisfies the builtin error interface
  2677  func (e WeightedCluster_ClusterWeightValidationError) Error() string {
  2678  	cause := ""
  2679  	if e.cause != nil {
  2680  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  2681  	}
  2682  
  2683  	key := ""
  2684  	if e.key {
  2685  		key = "key for "
  2686  	}
  2687  
  2688  	return fmt.Sprintf(
  2689  		"invalid %sWeightedCluster_ClusterWeight.%s: %s%s",
  2690  		key,
  2691  		e.field,
  2692  		e.reason,
  2693  		cause)
  2694  }
  2695  
  2696  var _ error = WeightedCluster_ClusterWeightValidationError{}
  2697  
  2698  var _ interface {
  2699  	Field() string
  2700  	Reason() string
  2701  	Key() bool
  2702  	Cause() error
  2703  	ErrorName() string
  2704  } = WeightedCluster_ClusterWeightValidationError{}
  2705  
  2706  // Validate checks the field values on RouteMatch_GrpcRouteMatchOptions with
  2707  // the rules defined in the proto definition for this message. If any rules
  2708  // are violated, an error is returned.
  2709  func (m *RouteMatch_GrpcRouteMatchOptions) Validate() error {
  2710  	if m == nil {
  2711  		return nil
  2712  	}
  2713  
  2714  	return nil
  2715  }
  2716  
  2717  // RouteMatch_GrpcRouteMatchOptionsValidationError is the validation error
  2718  // returned by RouteMatch_GrpcRouteMatchOptions.Validate if the designated
  2719  // constraints aren't met.
  2720  type RouteMatch_GrpcRouteMatchOptionsValidationError struct {
  2721  	field  string
  2722  	reason string
  2723  	cause  error
  2724  	key    bool
  2725  }
  2726  
  2727  // Field function returns field value.
  2728  func (e RouteMatch_GrpcRouteMatchOptionsValidationError) Field() string { return e.field }
  2729  
  2730  // Reason function returns reason value.
  2731  func (e RouteMatch_GrpcRouteMatchOptionsValidationError) Reason() string { return e.reason }
  2732  
  2733  // Cause function returns cause value.
  2734  func (e RouteMatch_GrpcRouteMatchOptionsValidationError) Cause() error { return e.cause }
  2735  
  2736  // Key function returns key value.
  2737  func (e RouteMatch_GrpcRouteMatchOptionsValidationError) Key() bool { return e.key }
  2738  
  2739  // ErrorName returns error name.
  2740  func (e RouteMatch_GrpcRouteMatchOptionsValidationError) ErrorName() string {
  2741  	return "RouteMatch_GrpcRouteMatchOptionsValidationError"
  2742  }
  2743  
  2744  // Error satisfies the builtin error interface
  2745  func (e RouteMatch_GrpcRouteMatchOptionsValidationError) Error() string {
  2746  	cause := ""
  2747  	if e.cause != nil {
  2748  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  2749  	}
  2750  
  2751  	key := ""
  2752  	if e.key {
  2753  		key = "key for "
  2754  	}
  2755  
  2756  	return fmt.Sprintf(
  2757  		"invalid %sRouteMatch_GrpcRouteMatchOptions.%s: %s%s",
  2758  		key,
  2759  		e.field,
  2760  		e.reason,
  2761  		cause)
  2762  }
  2763  
  2764  var _ error = RouteMatch_GrpcRouteMatchOptionsValidationError{}
  2765  
  2766  var _ interface {
  2767  	Field() string
  2768  	Reason() string
  2769  	Key() bool
  2770  	Cause() error
  2771  	ErrorName() string
  2772  } = RouteMatch_GrpcRouteMatchOptionsValidationError{}
  2773  
  2774  // Validate checks the field values on RouteMatch_TlsContextMatchOptions with
  2775  // the rules defined in the proto definition for this message. If any rules
  2776  // are violated, an error is returned.
  2777  func (m *RouteMatch_TlsContextMatchOptions) Validate() error {
  2778  	if m == nil {
  2779  		return nil
  2780  	}
  2781  
  2782  	if v, ok := interface{}(m.GetPresented()).(interface{ Validate() error }); ok {
  2783  		if err := v.Validate(); err != nil {
  2784  			return RouteMatch_TlsContextMatchOptionsValidationError{
  2785  				field:  "Presented",
  2786  				reason: "embedded message failed validation",
  2787  				cause:  err,
  2788  			}
  2789  		}
  2790  	}
  2791  
  2792  	if v, ok := interface{}(m.GetValidated()).(interface{ Validate() error }); ok {
  2793  		if err := v.Validate(); err != nil {
  2794  			return RouteMatch_TlsContextMatchOptionsValidationError{
  2795  				field:  "Validated",
  2796  				reason: "embedded message failed validation",
  2797  				cause:  err,
  2798  			}
  2799  		}
  2800  	}
  2801  
  2802  	return nil
  2803  }
  2804  
  2805  // RouteMatch_TlsContextMatchOptionsValidationError is the validation error
  2806  // returned by RouteMatch_TlsContextMatchOptions.Validate if the designated
  2807  // constraints aren't met.
  2808  type RouteMatch_TlsContextMatchOptionsValidationError struct {
  2809  	field  string
  2810  	reason string
  2811  	cause  error
  2812  	key    bool
  2813  }
  2814  
  2815  // Field function returns field value.
  2816  func (e RouteMatch_TlsContextMatchOptionsValidationError) Field() string { return e.field }
  2817  
  2818  // Reason function returns reason value.
  2819  func (e RouteMatch_TlsContextMatchOptionsValidationError) Reason() string { return e.reason }
  2820  
  2821  // Cause function returns cause value.
  2822  func (e RouteMatch_TlsContextMatchOptionsValidationError) Cause() error { return e.cause }
  2823  
  2824  // Key function returns key value.
  2825  func (e RouteMatch_TlsContextMatchOptionsValidationError) Key() bool { return e.key }
  2826  
  2827  // ErrorName returns error name.
  2828  func (e RouteMatch_TlsContextMatchOptionsValidationError) ErrorName() string {
  2829  	return "RouteMatch_TlsContextMatchOptionsValidationError"
  2830  }
  2831  
  2832  // Error satisfies the builtin error interface
  2833  func (e RouteMatch_TlsContextMatchOptionsValidationError) Error() string {
  2834  	cause := ""
  2835  	if e.cause != nil {
  2836  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  2837  	}
  2838  
  2839  	key := ""
  2840  	if e.key {
  2841  		key = "key for "
  2842  	}
  2843  
  2844  	return fmt.Sprintf(
  2845  		"invalid %sRouteMatch_TlsContextMatchOptions.%s: %s%s",
  2846  		key,
  2847  		e.field,
  2848  		e.reason,
  2849  		cause)
  2850  }
  2851  
  2852  var _ error = RouteMatch_TlsContextMatchOptionsValidationError{}
  2853  
  2854  var _ interface {
  2855  	Field() string
  2856  	Reason() string
  2857  	Key() bool
  2858  	Cause() error
  2859  	ErrorName() string
  2860  } = RouteMatch_TlsContextMatchOptionsValidationError{}
  2861  
  2862  // Validate checks the field values on RouteAction_RequestMirrorPolicy with the
  2863  // rules defined in the proto definition for this message. If any rules are
  2864  // violated, an error is returned.
  2865  func (m *RouteAction_RequestMirrorPolicy) Validate() error {
  2866  	if m == nil {
  2867  		return nil
  2868  	}
  2869  
  2870  	if len(m.GetCluster()) < 1 {
  2871  		return RouteAction_RequestMirrorPolicyValidationError{
  2872  			field:  "Cluster",
  2873  			reason: "value length must be at least 1 bytes",
  2874  		}
  2875  	}
  2876  
  2877  	// no validation rules for RuntimeKey
  2878  
  2879  	if v, ok := interface{}(m.GetRuntimeFraction()).(interface{ Validate() error }); ok {
  2880  		if err := v.Validate(); err != nil {
  2881  			return RouteAction_RequestMirrorPolicyValidationError{
  2882  				field:  "RuntimeFraction",
  2883  				reason: "embedded message failed validation",
  2884  				cause:  err,
  2885  			}
  2886  		}
  2887  	}
  2888  
  2889  	if v, ok := interface{}(m.GetTraceSampled()).(interface{ Validate() error }); ok {
  2890  		if err := v.Validate(); err != nil {
  2891  			return RouteAction_RequestMirrorPolicyValidationError{
  2892  				field:  "TraceSampled",
  2893  				reason: "embedded message failed validation",
  2894  				cause:  err,
  2895  			}
  2896  		}
  2897  	}
  2898  
  2899  	return nil
  2900  }
  2901  
  2902  // RouteAction_RequestMirrorPolicyValidationError is the validation error
  2903  // returned by RouteAction_RequestMirrorPolicy.Validate if the designated
  2904  // constraints aren't met.
  2905  type RouteAction_RequestMirrorPolicyValidationError struct {
  2906  	field  string
  2907  	reason string
  2908  	cause  error
  2909  	key    bool
  2910  }
  2911  
  2912  // Field function returns field value.
  2913  func (e RouteAction_RequestMirrorPolicyValidationError) Field() string { return e.field }
  2914  
  2915  // Reason function returns reason value.
  2916  func (e RouteAction_RequestMirrorPolicyValidationError) Reason() string { return e.reason }
  2917  
  2918  // Cause function returns cause value.
  2919  func (e RouteAction_RequestMirrorPolicyValidationError) Cause() error { return e.cause }
  2920  
  2921  // Key function returns key value.
  2922  func (e RouteAction_RequestMirrorPolicyValidationError) Key() bool { return e.key }
  2923  
  2924  // ErrorName returns error name.
  2925  func (e RouteAction_RequestMirrorPolicyValidationError) ErrorName() string {
  2926  	return "RouteAction_RequestMirrorPolicyValidationError"
  2927  }
  2928  
  2929  // Error satisfies the builtin error interface
  2930  func (e RouteAction_RequestMirrorPolicyValidationError) Error() string {
  2931  	cause := ""
  2932  	if e.cause != nil {
  2933  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  2934  	}
  2935  
  2936  	key := ""
  2937  	if e.key {
  2938  		key = "key for "
  2939  	}
  2940  
  2941  	return fmt.Sprintf(
  2942  		"invalid %sRouteAction_RequestMirrorPolicy.%s: %s%s",
  2943  		key,
  2944  		e.field,
  2945  		e.reason,
  2946  		cause)
  2947  }
  2948  
  2949  var _ error = RouteAction_RequestMirrorPolicyValidationError{}
  2950  
  2951  var _ interface {
  2952  	Field() string
  2953  	Reason() string
  2954  	Key() bool
  2955  	Cause() error
  2956  	ErrorName() string
  2957  } = RouteAction_RequestMirrorPolicyValidationError{}
  2958  
  2959  // Validate checks the field values on RouteAction_HashPolicy with the rules
  2960  // defined in the proto definition for this message. If any rules are
  2961  // violated, an error is returned.
  2962  func (m *RouteAction_HashPolicy) Validate() error {
  2963  	if m == nil {
  2964  		return nil
  2965  	}
  2966  
  2967  	// no validation rules for Terminal
  2968  
  2969  	switch m.PolicySpecifier.(type) {
  2970  
  2971  	case *RouteAction_HashPolicy_Header_:
  2972  
  2973  		if v, ok := interface{}(m.GetHeader()).(interface{ Validate() error }); ok {
  2974  			if err := v.Validate(); err != nil {
  2975  				return RouteAction_HashPolicyValidationError{
  2976  					field:  "Header",
  2977  					reason: "embedded message failed validation",
  2978  					cause:  err,
  2979  				}
  2980  			}
  2981  		}
  2982  
  2983  	case *RouteAction_HashPolicy_Cookie_:
  2984  
  2985  		if v, ok := interface{}(m.GetCookie()).(interface{ Validate() error }); ok {
  2986  			if err := v.Validate(); err != nil {
  2987  				return RouteAction_HashPolicyValidationError{
  2988  					field:  "Cookie",
  2989  					reason: "embedded message failed validation",
  2990  					cause:  err,
  2991  				}
  2992  			}
  2993  		}
  2994  
  2995  	case *RouteAction_HashPolicy_ConnectionProperties_:
  2996  
  2997  		if v, ok := interface{}(m.GetConnectionProperties()).(interface{ Validate() error }); ok {
  2998  			if err := v.Validate(); err != nil {
  2999  				return RouteAction_HashPolicyValidationError{
  3000  					field:  "ConnectionProperties",
  3001  					reason: "embedded message failed validation",
  3002  					cause:  err,
  3003  				}
  3004  			}
  3005  		}
  3006  
  3007  	case *RouteAction_HashPolicy_QueryParameter_:
  3008  
  3009  		if v, ok := interface{}(m.GetQueryParameter()).(interface{ Validate() error }); ok {
  3010  			if err := v.Validate(); err != nil {
  3011  				return RouteAction_HashPolicyValidationError{
  3012  					field:  "QueryParameter",
  3013  					reason: "embedded message failed validation",
  3014  					cause:  err,
  3015  				}
  3016  			}
  3017  		}
  3018  
  3019  	case *RouteAction_HashPolicy_FilterState_:
  3020  
  3021  		if v, ok := interface{}(m.GetFilterState()).(interface{ Validate() error }); ok {
  3022  			if err := v.Validate(); err != nil {
  3023  				return RouteAction_HashPolicyValidationError{
  3024  					field:  "FilterState",
  3025  					reason: "embedded message failed validation",
  3026  					cause:  err,
  3027  				}
  3028  			}
  3029  		}
  3030  
  3031  	default:
  3032  		return RouteAction_HashPolicyValidationError{
  3033  			field:  "PolicySpecifier",
  3034  			reason: "value is required",
  3035  		}
  3036  
  3037  	}
  3038  
  3039  	return nil
  3040  }
  3041  
  3042  // RouteAction_HashPolicyValidationError is the validation error returned by
  3043  // RouteAction_HashPolicy.Validate if the designated constraints aren't met.
  3044  type RouteAction_HashPolicyValidationError struct {
  3045  	field  string
  3046  	reason string
  3047  	cause  error
  3048  	key    bool
  3049  }
  3050  
  3051  // Field function returns field value.
  3052  func (e RouteAction_HashPolicyValidationError) Field() string { return e.field }
  3053  
  3054  // Reason function returns reason value.
  3055  func (e RouteAction_HashPolicyValidationError) Reason() string { return e.reason }
  3056  
  3057  // Cause function returns cause value.
  3058  func (e RouteAction_HashPolicyValidationError) Cause() error { return e.cause }
  3059  
  3060  // Key function returns key value.
  3061  func (e RouteAction_HashPolicyValidationError) Key() bool { return e.key }
  3062  
  3063  // ErrorName returns error name.
  3064  func (e RouteAction_HashPolicyValidationError) ErrorName() string {
  3065  	return "RouteAction_HashPolicyValidationError"
  3066  }
  3067  
  3068  // Error satisfies the builtin error interface
  3069  func (e RouteAction_HashPolicyValidationError) Error() string {
  3070  	cause := ""
  3071  	if e.cause != nil {
  3072  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  3073  	}
  3074  
  3075  	key := ""
  3076  	if e.key {
  3077  		key = "key for "
  3078  	}
  3079  
  3080  	return fmt.Sprintf(
  3081  		"invalid %sRouteAction_HashPolicy.%s: %s%s",
  3082  		key,
  3083  		e.field,
  3084  		e.reason,
  3085  		cause)
  3086  }
  3087  
  3088  var _ error = RouteAction_HashPolicyValidationError{}
  3089  
  3090  var _ interface {
  3091  	Field() string
  3092  	Reason() string
  3093  	Key() bool
  3094  	Cause() error
  3095  	ErrorName() string
  3096  } = RouteAction_HashPolicyValidationError{}
  3097  
  3098  // Validate checks the field values on RouteAction_UpgradeConfig with the rules
  3099  // defined in the proto definition for this message. If any rules are
  3100  // violated, an error is returned.
  3101  func (m *RouteAction_UpgradeConfig) Validate() error {
  3102  	if m == nil {
  3103  		return nil
  3104  	}
  3105  
  3106  	if !_RouteAction_UpgradeConfig_UpgradeType_Pattern.MatchString(m.GetUpgradeType()) {
  3107  		return RouteAction_UpgradeConfigValidationError{
  3108  			field:  "UpgradeType",
  3109  			reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
  3110  		}
  3111  	}
  3112  
  3113  	if v, ok := interface{}(m.GetEnabled()).(interface{ Validate() error }); ok {
  3114  		if err := v.Validate(); err != nil {
  3115  			return RouteAction_UpgradeConfigValidationError{
  3116  				field:  "Enabled",
  3117  				reason: "embedded message failed validation",
  3118  				cause:  err,
  3119  			}
  3120  		}
  3121  	}
  3122  
  3123  	return nil
  3124  }
  3125  
  3126  // RouteAction_UpgradeConfigValidationError is the validation error returned by
  3127  // RouteAction_UpgradeConfig.Validate if the designated constraints aren't met.
  3128  type RouteAction_UpgradeConfigValidationError struct {
  3129  	field  string
  3130  	reason string
  3131  	cause  error
  3132  	key    bool
  3133  }
  3134  
  3135  // Field function returns field value.
  3136  func (e RouteAction_UpgradeConfigValidationError) Field() string { return e.field }
  3137  
  3138  // Reason function returns reason value.
  3139  func (e RouteAction_UpgradeConfigValidationError) Reason() string { return e.reason }
  3140  
  3141  // Cause function returns cause value.
  3142  func (e RouteAction_UpgradeConfigValidationError) Cause() error { return e.cause }
  3143  
  3144  // Key function returns key value.
  3145  func (e RouteAction_UpgradeConfigValidationError) Key() bool { return e.key }
  3146  
  3147  // ErrorName returns error name.
  3148  func (e RouteAction_UpgradeConfigValidationError) ErrorName() string {
  3149  	return "RouteAction_UpgradeConfigValidationError"
  3150  }
  3151  
  3152  // Error satisfies the builtin error interface
  3153  func (e RouteAction_UpgradeConfigValidationError) Error() string {
  3154  	cause := ""
  3155  	if e.cause != nil {
  3156  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  3157  	}
  3158  
  3159  	key := ""
  3160  	if e.key {
  3161  		key = "key for "
  3162  	}
  3163  
  3164  	return fmt.Sprintf(
  3165  		"invalid %sRouteAction_UpgradeConfig.%s: %s%s",
  3166  		key,
  3167  		e.field,
  3168  		e.reason,
  3169  		cause)
  3170  }
  3171  
  3172  var _ error = RouteAction_UpgradeConfigValidationError{}
  3173  
  3174  var _ interface {
  3175  	Field() string
  3176  	Reason() string
  3177  	Key() bool
  3178  	Cause() error
  3179  	ErrorName() string
  3180  } = RouteAction_UpgradeConfigValidationError{}
  3181  
  3182  var _RouteAction_UpgradeConfig_UpgradeType_Pattern = regexp.MustCompile("^[^\x00\n\r]*$")
  3183  
  3184  // Validate checks the field values on RouteAction_HashPolicy_Header with the
  3185  // rules defined in the proto definition for this message. If any rules are
  3186  // violated, an error is returned.
  3187  func (m *RouteAction_HashPolicy_Header) Validate() error {
  3188  	if m == nil {
  3189  		return nil
  3190  	}
  3191  
  3192  	if len(m.GetHeaderName()) < 1 {
  3193  		return RouteAction_HashPolicy_HeaderValidationError{
  3194  			field:  "HeaderName",
  3195  			reason: "value length must be at least 1 bytes",
  3196  		}
  3197  	}
  3198  
  3199  	if !_RouteAction_HashPolicy_Header_HeaderName_Pattern.MatchString(m.GetHeaderName()) {
  3200  		return RouteAction_HashPolicy_HeaderValidationError{
  3201  			field:  "HeaderName",
  3202  			reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
  3203  		}
  3204  	}
  3205  
  3206  	return nil
  3207  }
  3208  
  3209  // RouteAction_HashPolicy_HeaderValidationError is the validation error
  3210  // returned by RouteAction_HashPolicy_Header.Validate if the designated
  3211  // constraints aren't met.
  3212  type RouteAction_HashPolicy_HeaderValidationError struct {
  3213  	field  string
  3214  	reason string
  3215  	cause  error
  3216  	key    bool
  3217  }
  3218  
  3219  // Field function returns field value.
  3220  func (e RouteAction_HashPolicy_HeaderValidationError) Field() string { return e.field }
  3221  
  3222  // Reason function returns reason value.
  3223  func (e RouteAction_HashPolicy_HeaderValidationError) Reason() string { return e.reason }
  3224  
  3225  // Cause function returns cause value.
  3226  func (e RouteAction_HashPolicy_HeaderValidationError) Cause() error { return e.cause }
  3227  
  3228  // Key function returns key value.
  3229  func (e RouteAction_HashPolicy_HeaderValidationError) Key() bool { return e.key }
  3230  
  3231  // ErrorName returns error name.
  3232  func (e RouteAction_HashPolicy_HeaderValidationError) ErrorName() string {
  3233  	return "RouteAction_HashPolicy_HeaderValidationError"
  3234  }
  3235  
  3236  // Error satisfies the builtin error interface
  3237  func (e RouteAction_HashPolicy_HeaderValidationError) Error() string {
  3238  	cause := ""
  3239  	if e.cause != nil {
  3240  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  3241  	}
  3242  
  3243  	key := ""
  3244  	if e.key {
  3245  		key = "key for "
  3246  	}
  3247  
  3248  	return fmt.Sprintf(
  3249  		"invalid %sRouteAction_HashPolicy_Header.%s: %s%s",
  3250  		key,
  3251  		e.field,
  3252  		e.reason,
  3253  		cause)
  3254  }
  3255  
  3256  var _ error = RouteAction_HashPolicy_HeaderValidationError{}
  3257  
  3258  var _ interface {
  3259  	Field() string
  3260  	Reason() string
  3261  	Key() bool
  3262  	Cause() error
  3263  	ErrorName() string
  3264  } = RouteAction_HashPolicy_HeaderValidationError{}
  3265  
  3266  var _RouteAction_HashPolicy_Header_HeaderName_Pattern = regexp.MustCompile("^[^\x00\n\r]*$")
  3267  
  3268  // Validate checks the field values on RouteAction_HashPolicy_Cookie with the
  3269  // rules defined in the proto definition for this message. If any rules are
  3270  // violated, an error is returned.
  3271  func (m *RouteAction_HashPolicy_Cookie) Validate() error {
  3272  	if m == nil {
  3273  		return nil
  3274  	}
  3275  
  3276  	if len(m.GetName()) < 1 {
  3277  		return RouteAction_HashPolicy_CookieValidationError{
  3278  			field:  "Name",
  3279  			reason: "value length must be at least 1 bytes",
  3280  		}
  3281  	}
  3282  
  3283  	if v, ok := interface{}(m.GetTtl()).(interface{ Validate() error }); ok {
  3284  		if err := v.Validate(); err != nil {
  3285  			return RouteAction_HashPolicy_CookieValidationError{
  3286  				field:  "Ttl",
  3287  				reason: "embedded message failed validation",
  3288  				cause:  err,
  3289  			}
  3290  		}
  3291  	}
  3292  
  3293  	// no validation rules for Path
  3294  
  3295  	return nil
  3296  }
  3297  
  3298  // RouteAction_HashPolicy_CookieValidationError is the validation error
  3299  // returned by RouteAction_HashPolicy_Cookie.Validate if the designated
  3300  // constraints aren't met.
  3301  type RouteAction_HashPolicy_CookieValidationError struct {
  3302  	field  string
  3303  	reason string
  3304  	cause  error
  3305  	key    bool
  3306  }
  3307  
  3308  // Field function returns field value.
  3309  func (e RouteAction_HashPolicy_CookieValidationError) Field() string { return e.field }
  3310  
  3311  // Reason function returns reason value.
  3312  func (e RouteAction_HashPolicy_CookieValidationError) Reason() string { return e.reason }
  3313  
  3314  // Cause function returns cause value.
  3315  func (e RouteAction_HashPolicy_CookieValidationError) Cause() error { return e.cause }
  3316  
  3317  // Key function returns key value.
  3318  func (e RouteAction_HashPolicy_CookieValidationError) Key() bool { return e.key }
  3319  
  3320  // ErrorName returns error name.
  3321  func (e RouteAction_HashPolicy_CookieValidationError) ErrorName() string {
  3322  	return "RouteAction_HashPolicy_CookieValidationError"
  3323  }
  3324  
  3325  // Error satisfies the builtin error interface
  3326  func (e RouteAction_HashPolicy_CookieValidationError) Error() string {
  3327  	cause := ""
  3328  	if e.cause != nil {
  3329  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  3330  	}
  3331  
  3332  	key := ""
  3333  	if e.key {
  3334  		key = "key for "
  3335  	}
  3336  
  3337  	return fmt.Sprintf(
  3338  		"invalid %sRouteAction_HashPolicy_Cookie.%s: %s%s",
  3339  		key,
  3340  		e.field,
  3341  		e.reason,
  3342  		cause)
  3343  }
  3344  
  3345  var _ error = RouteAction_HashPolicy_CookieValidationError{}
  3346  
  3347  var _ interface {
  3348  	Field() string
  3349  	Reason() string
  3350  	Key() bool
  3351  	Cause() error
  3352  	ErrorName() string
  3353  } = RouteAction_HashPolicy_CookieValidationError{}
  3354  
  3355  // Validate checks the field values on
  3356  // RouteAction_HashPolicy_ConnectionProperties with the rules defined in the
  3357  // proto definition for this message. If any rules are violated, an error is returned.
  3358  func (m *RouteAction_HashPolicy_ConnectionProperties) Validate() error {
  3359  	if m == nil {
  3360  		return nil
  3361  	}
  3362  
  3363  	// no validation rules for SourceIp
  3364  
  3365  	return nil
  3366  }
  3367  
  3368  // RouteAction_HashPolicy_ConnectionPropertiesValidationError is the validation
  3369  // error returned by RouteAction_HashPolicy_ConnectionProperties.Validate if
  3370  // the designated constraints aren't met.
  3371  type RouteAction_HashPolicy_ConnectionPropertiesValidationError struct {
  3372  	field  string
  3373  	reason string
  3374  	cause  error
  3375  	key    bool
  3376  }
  3377  
  3378  // Field function returns field value.
  3379  func (e RouteAction_HashPolicy_ConnectionPropertiesValidationError) Field() string { return e.field }
  3380  
  3381  // Reason function returns reason value.
  3382  func (e RouteAction_HashPolicy_ConnectionPropertiesValidationError) Reason() string { return e.reason }
  3383  
  3384  // Cause function returns cause value.
  3385  func (e RouteAction_HashPolicy_ConnectionPropertiesValidationError) Cause() error { return e.cause }
  3386  
  3387  // Key function returns key value.
  3388  func (e RouteAction_HashPolicy_ConnectionPropertiesValidationError) Key() bool { return e.key }
  3389  
  3390  // ErrorName returns error name.
  3391  func (e RouteAction_HashPolicy_ConnectionPropertiesValidationError) ErrorName() string {
  3392  	return "RouteAction_HashPolicy_ConnectionPropertiesValidationError"
  3393  }
  3394  
  3395  // Error satisfies the builtin error interface
  3396  func (e RouteAction_HashPolicy_ConnectionPropertiesValidationError) Error() string {
  3397  	cause := ""
  3398  	if e.cause != nil {
  3399  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  3400  	}
  3401  
  3402  	key := ""
  3403  	if e.key {
  3404  		key = "key for "
  3405  	}
  3406  
  3407  	return fmt.Sprintf(
  3408  		"invalid %sRouteAction_HashPolicy_ConnectionProperties.%s: %s%s",
  3409  		key,
  3410  		e.field,
  3411  		e.reason,
  3412  		cause)
  3413  }
  3414  
  3415  var _ error = RouteAction_HashPolicy_ConnectionPropertiesValidationError{}
  3416  
  3417  var _ interface {
  3418  	Field() string
  3419  	Reason() string
  3420  	Key() bool
  3421  	Cause() error
  3422  	ErrorName() string
  3423  } = RouteAction_HashPolicy_ConnectionPropertiesValidationError{}
  3424  
  3425  // Validate checks the field values on RouteAction_HashPolicy_QueryParameter
  3426  // with the rules defined in the proto definition for this message. If any
  3427  // rules are violated, an error is returned.
  3428  func (m *RouteAction_HashPolicy_QueryParameter) Validate() error {
  3429  	if m == nil {
  3430  		return nil
  3431  	}
  3432  
  3433  	if len(m.GetName()) < 1 {
  3434  		return RouteAction_HashPolicy_QueryParameterValidationError{
  3435  			field:  "Name",
  3436  			reason: "value length must be at least 1 bytes",
  3437  		}
  3438  	}
  3439  
  3440  	return nil
  3441  }
  3442  
  3443  // RouteAction_HashPolicy_QueryParameterValidationError is the validation error
  3444  // returned by RouteAction_HashPolicy_QueryParameter.Validate if the
  3445  // designated constraints aren't met.
  3446  type RouteAction_HashPolicy_QueryParameterValidationError struct {
  3447  	field  string
  3448  	reason string
  3449  	cause  error
  3450  	key    bool
  3451  }
  3452  
  3453  // Field function returns field value.
  3454  func (e RouteAction_HashPolicy_QueryParameterValidationError) Field() string { return e.field }
  3455  
  3456  // Reason function returns reason value.
  3457  func (e RouteAction_HashPolicy_QueryParameterValidationError) Reason() string { return e.reason }
  3458  
  3459  // Cause function returns cause value.
  3460  func (e RouteAction_HashPolicy_QueryParameterValidationError) Cause() error { return e.cause }
  3461  
  3462  // Key function returns key value.
  3463  func (e RouteAction_HashPolicy_QueryParameterValidationError) Key() bool { return e.key }
  3464  
  3465  // ErrorName returns error name.
  3466  func (e RouteAction_HashPolicy_QueryParameterValidationError) ErrorName() string {
  3467  	return "RouteAction_HashPolicy_QueryParameterValidationError"
  3468  }
  3469  
  3470  // Error satisfies the builtin error interface
  3471  func (e RouteAction_HashPolicy_QueryParameterValidationError) Error() string {
  3472  	cause := ""
  3473  	if e.cause != nil {
  3474  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  3475  	}
  3476  
  3477  	key := ""
  3478  	if e.key {
  3479  		key = "key for "
  3480  	}
  3481  
  3482  	return fmt.Sprintf(
  3483  		"invalid %sRouteAction_HashPolicy_QueryParameter.%s: %s%s",
  3484  		key,
  3485  		e.field,
  3486  		e.reason,
  3487  		cause)
  3488  }
  3489  
  3490  var _ error = RouteAction_HashPolicy_QueryParameterValidationError{}
  3491  
  3492  var _ interface {
  3493  	Field() string
  3494  	Reason() string
  3495  	Key() bool
  3496  	Cause() error
  3497  	ErrorName() string
  3498  } = RouteAction_HashPolicy_QueryParameterValidationError{}
  3499  
  3500  // Validate checks the field values on RouteAction_HashPolicy_FilterState with
  3501  // the rules defined in the proto definition for this message. If any rules
  3502  // are violated, an error is returned.
  3503  func (m *RouteAction_HashPolicy_FilterState) Validate() error {
  3504  	if m == nil {
  3505  		return nil
  3506  	}
  3507  
  3508  	if len(m.GetKey()) < 1 {
  3509  		return RouteAction_HashPolicy_FilterStateValidationError{
  3510  			field:  "Key",
  3511  			reason: "value length must be at least 1 bytes",
  3512  		}
  3513  	}
  3514  
  3515  	return nil
  3516  }
  3517  
  3518  // RouteAction_HashPolicy_FilterStateValidationError is the validation error
  3519  // returned by RouteAction_HashPolicy_FilterState.Validate if the designated
  3520  // constraints aren't met.
  3521  type RouteAction_HashPolicy_FilterStateValidationError struct {
  3522  	field  string
  3523  	reason string
  3524  	cause  error
  3525  	key    bool
  3526  }
  3527  
  3528  // Field function returns field value.
  3529  func (e RouteAction_HashPolicy_FilterStateValidationError) Field() string { return e.field }
  3530  
  3531  // Reason function returns reason value.
  3532  func (e RouteAction_HashPolicy_FilterStateValidationError) Reason() string { return e.reason }
  3533  
  3534  // Cause function returns cause value.
  3535  func (e RouteAction_HashPolicy_FilterStateValidationError) Cause() error { return e.cause }
  3536  
  3537  // Key function returns key value.
  3538  func (e RouteAction_HashPolicy_FilterStateValidationError) Key() bool { return e.key }
  3539  
  3540  // ErrorName returns error name.
  3541  func (e RouteAction_HashPolicy_FilterStateValidationError) ErrorName() string {
  3542  	return "RouteAction_HashPolicy_FilterStateValidationError"
  3543  }
  3544  
  3545  // Error satisfies the builtin error interface
  3546  func (e RouteAction_HashPolicy_FilterStateValidationError) Error() string {
  3547  	cause := ""
  3548  	if e.cause != nil {
  3549  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  3550  	}
  3551  
  3552  	key := ""
  3553  	if e.key {
  3554  		key = "key for "
  3555  	}
  3556  
  3557  	return fmt.Sprintf(
  3558  		"invalid %sRouteAction_HashPolicy_FilterState.%s: %s%s",
  3559  		key,
  3560  		e.field,
  3561  		e.reason,
  3562  		cause)
  3563  }
  3564  
  3565  var _ error = RouteAction_HashPolicy_FilterStateValidationError{}
  3566  
  3567  var _ interface {
  3568  	Field() string
  3569  	Reason() string
  3570  	Key() bool
  3571  	Cause() error
  3572  	ErrorName() string
  3573  } = RouteAction_HashPolicy_FilterStateValidationError{}
  3574  
  3575  // Validate checks the field values on RetryPolicy_RetryPriority with the rules
  3576  // defined in the proto definition for this message. If any rules are
  3577  // violated, an error is returned.
  3578  func (m *RetryPolicy_RetryPriority) Validate() error {
  3579  	if m == nil {
  3580  		return nil
  3581  	}
  3582  
  3583  	if len(m.GetName()) < 1 {
  3584  		return RetryPolicy_RetryPriorityValidationError{
  3585  			field:  "Name",
  3586  			reason: "value length must be at least 1 bytes",
  3587  		}
  3588  	}
  3589  
  3590  	switch m.ConfigType.(type) {
  3591  
  3592  	case *RetryPolicy_RetryPriority_Config:
  3593  
  3594  		if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok {
  3595  			if err := v.Validate(); err != nil {
  3596  				return RetryPolicy_RetryPriorityValidationError{
  3597  					field:  "Config",
  3598  					reason: "embedded message failed validation",
  3599  					cause:  err,
  3600  				}
  3601  			}
  3602  		}
  3603  
  3604  	case *RetryPolicy_RetryPriority_TypedConfig:
  3605  
  3606  		if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok {
  3607  			if err := v.Validate(); err != nil {
  3608  				return RetryPolicy_RetryPriorityValidationError{
  3609  					field:  "TypedConfig",
  3610  					reason: "embedded message failed validation",
  3611  					cause:  err,
  3612  				}
  3613  			}
  3614  		}
  3615  
  3616  	}
  3617  
  3618  	return nil
  3619  }
  3620  
  3621  // RetryPolicy_RetryPriorityValidationError is the validation error returned by
  3622  // RetryPolicy_RetryPriority.Validate if the designated constraints aren't met.
  3623  type RetryPolicy_RetryPriorityValidationError struct {
  3624  	field  string
  3625  	reason string
  3626  	cause  error
  3627  	key    bool
  3628  }
  3629  
  3630  // Field function returns field value.
  3631  func (e RetryPolicy_RetryPriorityValidationError) Field() string { return e.field }
  3632  
  3633  // Reason function returns reason value.
  3634  func (e RetryPolicy_RetryPriorityValidationError) Reason() string { return e.reason }
  3635  
  3636  // Cause function returns cause value.
  3637  func (e RetryPolicy_RetryPriorityValidationError) Cause() error { return e.cause }
  3638  
  3639  // Key function returns key value.
  3640  func (e RetryPolicy_RetryPriorityValidationError) Key() bool { return e.key }
  3641  
  3642  // ErrorName returns error name.
  3643  func (e RetryPolicy_RetryPriorityValidationError) ErrorName() string {
  3644  	return "RetryPolicy_RetryPriorityValidationError"
  3645  }
  3646  
  3647  // Error satisfies the builtin error interface
  3648  func (e RetryPolicy_RetryPriorityValidationError) Error() string {
  3649  	cause := ""
  3650  	if e.cause != nil {
  3651  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  3652  	}
  3653  
  3654  	key := ""
  3655  	if e.key {
  3656  		key = "key for "
  3657  	}
  3658  
  3659  	return fmt.Sprintf(
  3660  		"invalid %sRetryPolicy_RetryPriority.%s: %s%s",
  3661  		key,
  3662  		e.field,
  3663  		e.reason,
  3664  		cause)
  3665  }
  3666  
  3667  var _ error = RetryPolicy_RetryPriorityValidationError{}
  3668  
  3669  var _ interface {
  3670  	Field() string
  3671  	Reason() string
  3672  	Key() bool
  3673  	Cause() error
  3674  	ErrorName() string
  3675  } = RetryPolicy_RetryPriorityValidationError{}
  3676  
  3677  // Validate checks the field values on RetryPolicy_RetryHostPredicate with the
  3678  // rules defined in the proto definition for this message. If any rules are
  3679  // violated, an error is returned.
  3680  func (m *RetryPolicy_RetryHostPredicate) Validate() error {
  3681  	if m == nil {
  3682  		return nil
  3683  	}
  3684  
  3685  	if len(m.GetName()) < 1 {
  3686  		return RetryPolicy_RetryHostPredicateValidationError{
  3687  			field:  "Name",
  3688  			reason: "value length must be at least 1 bytes",
  3689  		}
  3690  	}
  3691  
  3692  	switch m.ConfigType.(type) {
  3693  
  3694  	case *RetryPolicy_RetryHostPredicate_Config:
  3695  
  3696  		if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok {
  3697  			if err := v.Validate(); err != nil {
  3698  				return RetryPolicy_RetryHostPredicateValidationError{
  3699  					field:  "Config",
  3700  					reason: "embedded message failed validation",
  3701  					cause:  err,
  3702  				}
  3703  			}
  3704  		}
  3705  
  3706  	case *RetryPolicy_RetryHostPredicate_TypedConfig:
  3707  
  3708  		if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok {
  3709  			if err := v.Validate(); err != nil {
  3710  				return RetryPolicy_RetryHostPredicateValidationError{
  3711  					field:  "TypedConfig",
  3712  					reason: "embedded message failed validation",
  3713  					cause:  err,
  3714  				}
  3715  			}
  3716  		}
  3717  
  3718  	}
  3719  
  3720  	return nil
  3721  }
  3722  
  3723  // RetryPolicy_RetryHostPredicateValidationError is the validation error
  3724  // returned by RetryPolicy_RetryHostPredicate.Validate if the designated
  3725  // constraints aren't met.
  3726  type RetryPolicy_RetryHostPredicateValidationError struct {
  3727  	field  string
  3728  	reason string
  3729  	cause  error
  3730  	key    bool
  3731  }
  3732  
  3733  // Field function returns field value.
  3734  func (e RetryPolicy_RetryHostPredicateValidationError) Field() string { return e.field }
  3735  
  3736  // Reason function returns reason value.
  3737  func (e RetryPolicy_RetryHostPredicateValidationError) Reason() string { return e.reason }
  3738  
  3739  // Cause function returns cause value.
  3740  func (e RetryPolicy_RetryHostPredicateValidationError) Cause() error { return e.cause }
  3741  
  3742  // Key function returns key value.
  3743  func (e RetryPolicy_RetryHostPredicateValidationError) Key() bool { return e.key }
  3744  
  3745  // ErrorName returns error name.
  3746  func (e RetryPolicy_RetryHostPredicateValidationError) ErrorName() string {
  3747  	return "RetryPolicy_RetryHostPredicateValidationError"
  3748  }
  3749  
  3750  // Error satisfies the builtin error interface
  3751  func (e RetryPolicy_RetryHostPredicateValidationError) Error() string {
  3752  	cause := ""
  3753  	if e.cause != nil {
  3754  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  3755  	}
  3756  
  3757  	key := ""
  3758  	if e.key {
  3759  		key = "key for "
  3760  	}
  3761  
  3762  	return fmt.Sprintf(
  3763  		"invalid %sRetryPolicy_RetryHostPredicate.%s: %s%s",
  3764  		key,
  3765  		e.field,
  3766  		e.reason,
  3767  		cause)
  3768  }
  3769  
  3770  var _ error = RetryPolicy_RetryHostPredicateValidationError{}
  3771  
  3772  var _ interface {
  3773  	Field() string
  3774  	Reason() string
  3775  	Key() bool
  3776  	Cause() error
  3777  	ErrorName() string
  3778  } = RetryPolicy_RetryHostPredicateValidationError{}
  3779  
  3780  // Validate checks the field values on RetryPolicy_RetryBackOff with the rules
  3781  // defined in the proto definition for this message. If any rules are
  3782  // violated, an error is returned.
  3783  func (m *RetryPolicy_RetryBackOff) Validate() error {
  3784  	if m == nil {
  3785  		return nil
  3786  	}
  3787  
  3788  	if m.GetBaseInterval() == nil {
  3789  		return RetryPolicy_RetryBackOffValidationError{
  3790  			field:  "BaseInterval",
  3791  			reason: "value is required",
  3792  		}
  3793  	}
  3794  
  3795  	if d := m.GetBaseInterval(); d != nil {
  3796  		dur, err := d.AsDuration(), d.CheckValid()
  3797  		if err != nil {
  3798  			return RetryPolicy_RetryBackOffValidationError{
  3799  				field:  "BaseInterval",
  3800  				reason: "value is not a valid duration",
  3801  				cause:  err,
  3802  			}
  3803  		}
  3804  
  3805  		gt := time.Duration(0*time.Second + 0*time.Nanosecond)
  3806  
  3807  		if dur <= gt {
  3808  			return RetryPolicy_RetryBackOffValidationError{
  3809  				field:  "BaseInterval",
  3810  				reason: "value must be greater than 0s",
  3811  			}
  3812  		}
  3813  
  3814  	}
  3815  
  3816  	if d := m.GetMaxInterval(); d != nil {
  3817  		dur, err := d.AsDuration(), d.CheckValid()
  3818  		if err != nil {
  3819  			return RetryPolicy_RetryBackOffValidationError{
  3820  				field:  "MaxInterval",
  3821  				reason: "value is not a valid duration",
  3822  				cause:  err,
  3823  			}
  3824  		}
  3825  
  3826  		gt := time.Duration(0*time.Second + 0*time.Nanosecond)
  3827  
  3828  		if dur <= gt {
  3829  			return RetryPolicy_RetryBackOffValidationError{
  3830  				field:  "MaxInterval",
  3831  				reason: "value must be greater than 0s",
  3832  			}
  3833  		}
  3834  
  3835  	}
  3836  
  3837  	return nil
  3838  }
  3839  
  3840  // RetryPolicy_RetryBackOffValidationError is the validation error returned by
  3841  // RetryPolicy_RetryBackOff.Validate if the designated constraints aren't met.
  3842  type RetryPolicy_RetryBackOffValidationError struct {
  3843  	field  string
  3844  	reason string
  3845  	cause  error
  3846  	key    bool
  3847  }
  3848  
  3849  // Field function returns field value.
  3850  func (e RetryPolicy_RetryBackOffValidationError) Field() string { return e.field }
  3851  
  3852  // Reason function returns reason value.
  3853  func (e RetryPolicy_RetryBackOffValidationError) Reason() string { return e.reason }
  3854  
  3855  // Cause function returns cause value.
  3856  func (e RetryPolicy_RetryBackOffValidationError) Cause() error { return e.cause }
  3857  
  3858  // Key function returns key value.
  3859  func (e RetryPolicy_RetryBackOffValidationError) Key() bool { return e.key }
  3860  
  3861  // ErrorName returns error name.
  3862  func (e RetryPolicy_RetryBackOffValidationError) ErrorName() string {
  3863  	return "RetryPolicy_RetryBackOffValidationError"
  3864  }
  3865  
  3866  // Error satisfies the builtin error interface
  3867  func (e RetryPolicy_RetryBackOffValidationError) Error() string {
  3868  	cause := ""
  3869  	if e.cause != nil {
  3870  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  3871  	}
  3872  
  3873  	key := ""
  3874  	if e.key {
  3875  		key = "key for "
  3876  	}
  3877  
  3878  	return fmt.Sprintf(
  3879  		"invalid %sRetryPolicy_RetryBackOff.%s: %s%s",
  3880  		key,
  3881  		e.field,
  3882  		e.reason,
  3883  		cause)
  3884  }
  3885  
  3886  var _ error = RetryPolicy_RetryBackOffValidationError{}
  3887  
  3888  var _ interface {
  3889  	Field() string
  3890  	Reason() string
  3891  	Key() bool
  3892  	Cause() error
  3893  	ErrorName() string
  3894  } = RetryPolicy_RetryBackOffValidationError{}
  3895  
  3896  // Validate checks the field values on RateLimit_Action with the rules defined
  3897  // in the proto definition for this message. If any rules are violated, an
  3898  // error is returned.
  3899  func (m *RateLimit_Action) Validate() error {
  3900  	if m == nil {
  3901  		return nil
  3902  	}
  3903  
  3904  	switch m.ActionSpecifier.(type) {
  3905  
  3906  	case *RateLimit_Action_SourceCluster_:
  3907  
  3908  		if v, ok := interface{}(m.GetSourceCluster()).(interface{ Validate() error }); ok {
  3909  			if err := v.Validate(); err != nil {
  3910  				return RateLimit_ActionValidationError{
  3911  					field:  "SourceCluster",
  3912  					reason: "embedded message failed validation",
  3913  					cause:  err,
  3914  				}
  3915  			}
  3916  		}
  3917  
  3918  	case *RateLimit_Action_DestinationCluster_:
  3919  
  3920  		if v, ok := interface{}(m.GetDestinationCluster()).(interface{ Validate() error }); ok {
  3921  			if err := v.Validate(); err != nil {
  3922  				return RateLimit_ActionValidationError{
  3923  					field:  "DestinationCluster",
  3924  					reason: "embedded message failed validation",
  3925  					cause:  err,
  3926  				}
  3927  			}
  3928  		}
  3929  
  3930  	case *RateLimit_Action_RequestHeaders_:
  3931  
  3932  		if v, ok := interface{}(m.GetRequestHeaders()).(interface{ Validate() error }); ok {
  3933  			if err := v.Validate(); err != nil {
  3934  				return RateLimit_ActionValidationError{
  3935  					field:  "RequestHeaders",
  3936  					reason: "embedded message failed validation",
  3937  					cause:  err,
  3938  				}
  3939  			}
  3940  		}
  3941  
  3942  	case *RateLimit_Action_RemoteAddress_:
  3943  
  3944  		if v, ok := interface{}(m.GetRemoteAddress()).(interface{ Validate() error }); ok {
  3945  			if err := v.Validate(); err != nil {
  3946  				return RateLimit_ActionValidationError{
  3947  					field:  "RemoteAddress",
  3948  					reason: "embedded message failed validation",
  3949  					cause:  err,
  3950  				}
  3951  			}
  3952  		}
  3953  
  3954  	case *RateLimit_Action_GenericKey_:
  3955  
  3956  		if v, ok := interface{}(m.GetGenericKey()).(interface{ Validate() error }); ok {
  3957  			if err := v.Validate(); err != nil {
  3958  				return RateLimit_ActionValidationError{
  3959  					field:  "GenericKey",
  3960  					reason: "embedded message failed validation",
  3961  					cause:  err,
  3962  				}
  3963  			}
  3964  		}
  3965  
  3966  	case *RateLimit_Action_HeaderValueMatch_:
  3967  
  3968  		if v, ok := interface{}(m.GetHeaderValueMatch()).(interface{ Validate() error }); ok {
  3969  			if err := v.Validate(); err != nil {
  3970  				return RateLimit_ActionValidationError{
  3971  					field:  "HeaderValueMatch",
  3972  					reason: "embedded message failed validation",
  3973  					cause:  err,
  3974  				}
  3975  			}
  3976  		}
  3977  
  3978  	default:
  3979  		return RateLimit_ActionValidationError{
  3980  			field:  "ActionSpecifier",
  3981  			reason: "value is required",
  3982  		}
  3983  
  3984  	}
  3985  
  3986  	return nil
  3987  }
  3988  
  3989  // RateLimit_ActionValidationError is the validation error returned by
  3990  // RateLimit_Action.Validate if the designated constraints aren't met.
  3991  type RateLimit_ActionValidationError struct {
  3992  	field  string
  3993  	reason string
  3994  	cause  error
  3995  	key    bool
  3996  }
  3997  
  3998  // Field function returns field value.
  3999  func (e RateLimit_ActionValidationError) Field() string { return e.field }
  4000  
  4001  // Reason function returns reason value.
  4002  func (e RateLimit_ActionValidationError) Reason() string { return e.reason }
  4003  
  4004  // Cause function returns cause value.
  4005  func (e RateLimit_ActionValidationError) Cause() error { return e.cause }
  4006  
  4007  // Key function returns key value.
  4008  func (e RateLimit_ActionValidationError) Key() bool { return e.key }
  4009  
  4010  // ErrorName returns error name.
  4011  func (e RateLimit_ActionValidationError) ErrorName() string { return "RateLimit_ActionValidationError" }
  4012  
  4013  // Error satisfies the builtin error interface
  4014  func (e RateLimit_ActionValidationError) Error() string {
  4015  	cause := ""
  4016  	if e.cause != nil {
  4017  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  4018  	}
  4019  
  4020  	key := ""
  4021  	if e.key {
  4022  		key = "key for "
  4023  	}
  4024  
  4025  	return fmt.Sprintf(
  4026  		"invalid %sRateLimit_Action.%s: %s%s",
  4027  		key,
  4028  		e.field,
  4029  		e.reason,
  4030  		cause)
  4031  }
  4032  
  4033  var _ error = RateLimit_ActionValidationError{}
  4034  
  4035  var _ interface {
  4036  	Field() string
  4037  	Reason() string
  4038  	Key() bool
  4039  	Cause() error
  4040  	ErrorName() string
  4041  } = RateLimit_ActionValidationError{}
  4042  
  4043  // Validate checks the field values on RateLimit_Action_SourceCluster with the
  4044  // rules defined in the proto definition for this message. If any rules are
  4045  // violated, an error is returned.
  4046  func (m *RateLimit_Action_SourceCluster) Validate() error {
  4047  	if m == nil {
  4048  		return nil
  4049  	}
  4050  
  4051  	return nil
  4052  }
  4053  
  4054  // RateLimit_Action_SourceClusterValidationError is the validation error
  4055  // returned by RateLimit_Action_SourceCluster.Validate if the designated
  4056  // constraints aren't met.
  4057  type RateLimit_Action_SourceClusterValidationError struct {
  4058  	field  string
  4059  	reason string
  4060  	cause  error
  4061  	key    bool
  4062  }
  4063  
  4064  // Field function returns field value.
  4065  func (e RateLimit_Action_SourceClusterValidationError) Field() string { return e.field }
  4066  
  4067  // Reason function returns reason value.
  4068  func (e RateLimit_Action_SourceClusterValidationError) Reason() string { return e.reason }
  4069  
  4070  // Cause function returns cause value.
  4071  func (e RateLimit_Action_SourceClusterValidationError) Cause() error { return e.cause }
  4072  
  4073  // Key function returns key value.
  4074  func (e RateLimit_Action_SourceClusterValidationError) Key() bool { return e.key }
  4075  
  4076  // ErrorName returns error name.
  4077  func (e RateLimit_Action_SourceClusterValidationError) ErrorName() string {
  4078  	return "RateLimit_Action_SourceClusterValidationError"
  4079  }
  4080  
  4081  // Error satisfies the builtin error interface
  4082  func (e RateLimit_Action_SourceClusterValidationError) Error() string {
  4083  	cause := ""
  4084  	if e.cause != nil {
  4085  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  4086  	}
  4087  
  4088  	key := ""
  4089  	if e.key {
  4090  		key = "key for "
  4091  	}
  4092  
  4093  	return fmt.Sprintf(
  4094  		"invalid %sRateLimit_Action_SourceCluster.%s: %s%s",
  4095  		key,
  4096  		e.field,
  4097  		e.reason,
  4098  		cause)
  4099  }
  4100  
  4101  var _ error = RateLimit_Action_SourceClusterValidationError{}
  4102  
  4103  var _ interface {
  4104  	Field() string
  4105  	Reason() string
  4106  	Key() bool
  4107  	Cause() error
  4108  	ErrorName() string
  4109  } = RateLimit_Action_SourceClusterValidationError{}
  4110  
  4111  // Validate checks the field values on RateLimit_Action_DestinationCluster with
  4112  // the rules defined in the proto definition for this message. If any rules
  4113  // are violated, an error is returned.
  4114  func (m *RateLimit_Action_DestinationCluster) Validate() error {
  4115  	if m == nil {
  4116  		return nil
  4117  	}
  4118  
  4119  	return nil
  4120  }
  4121  
  4122  // RateLimit_Action_DestinationClusterValidationError is the validation error
  4123  // returned by RateLimit_Action_DestinationCluster.Validate if the designated
  4124  // constraints aren't met.
  4125  type RateLimit_Action_DestinationClusterValidationError struct {
  4126  	field  string
  4127  	reason string
  4128  	cause  error
  4129  	key    bool
  4130  }
  4131  
  4132  // Field function returns field value.
  4133  func (e RateLimit_Action_DestinationClusterValidationError) Field() string { return e.field }
  4134  
  4135  // Reason function returns reason value.
  4136  func (e RateLimit_Action_DestinationClusterValidationError) Reason() string { return e.reason }
  4137  
  4138  // Cause function returns cause value.
  4139  func (e RateLimit_Action_DestinationClusterValidationError) Cause() error { return e.cause }
  4140  
  4141  // Key function returns key value.
  4142  func (e RateLimit_Action_DestinationClusterValidationError) Key() bool { return e.key }
  4143  
  4144  // ErrorName returns error name.
  4145  func (e RateLimit_Action_DestinationClusterValidationError) ErrorName() string {
  4146  	return "RateLimit_Action_DestinationClusterValidationError"
  4147  }
  4148  
  4149  // Error satisfies the builtin error interface
  4150  func (e RateLimit_Action_DestinationClusterValidationError) Error() string {
  4151  	cause := ""
  4152  	if e.cause != nil {
  4153  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  4154  	}
  4155  
  4156  	key := ""
  4157  	if e.key {
  4158  		key = "key for "
  4159  	}
  4160  
  4161  	return fmt.Sprintf(
  4162  		"invalid %sRateLimit_Action_DestinationCluster.%s: %s%s",
  4163  		key,
  4164  		e.field,
  4165  		e.reason,
  4166  		cause)
  4167  }
  4168  
  4169  var _ error = RateLimit_Action_DestinationClusterValidationError{}
  4170  
  4171  var _ interface {
  4172  	Field() string
  4173  	Reason() string
  4174  	Key() bool
  4175  	Cause() error
  4176  	ErrorName() string
  4177  } = RateLimit_Action_DestinationClusterValidationError{}
  4178  
  4179  // Validate checks the field values on RateLimit_Action_RequestHeaders with the
  4180  // rules defined in the proto definition for this message. If any rules are
  4181  // violated, an error is returned.
  4182  func (m *RateLimit_Action_RequestHeaders) Validate() error {
  4183  	if m == nil {
  4184  		return nil
  4185  	}
  4186  
  4187  	if len(m.GetHeaderName()) < 1 {
  4188  		return RateLimit_Action_RequestHeadersValidationError{
  4189  			field:  "HeaderName",
  4190  			reason: "value length must be at least 1 bytes",
  4191  		}
  4192  	}
  4193  
  4194  	if !_RateLimit_Action_RequestHeaders_HeaderName_Pattern.MatchString(m.GetHeaderName()) {
  4195  		return RateLimit_Action_RequestHeadersValidationError{
  4196  			field:  "HeaderName",
  4197  			reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
  4198  		}
  4199  	}
  4200  
  4201  	if len(m.GetDescriptorKey()) < 1 {
  4202  		return RateLimit_Action_RequestHeadersValidationError{
  4203  			field:  "DescriptorKey",
  4204  			reason: "value length must be at least 1 bytes",
  4205  		}
  4206  	}
  4207  
  4208  	return nil
  4209  }
  4210  
  4211  // RateLimit_Action_RequestHeadersValidationError is the validation error
  4212  // returned by RateLimit_Action_RequestHeaders.Validate if the designated
  4213  // constraints aren't met.
  4214  type RateLimit_Action_RequestHeadersValidationError struct {
  4215  	field  string
  4216  	reason string
  4217  	cause  error
  4218  	key    bool
  4219  }
  4220  
  4221  // Field function returns field value.
  4222  func (e RateLimit_Action_RequestHeadersValidationError) Field() string { return e.field }
  4223  
  4224  // Reason function returns reason value.
  4225  func (e RateLimit_Action_RequestHeadersValidationError) Reason() string { return e.reason }
  4226  
  4227  // Cause function returns cause value.
  4228  func (e RateLimit_Action_RequestHeadersValidationError) Cause() error { return e.cause }
  4229  
  4230  // Key function returns key value.
  4231  func (e RateLimit_Action_RequestHeadersValidationError) Key() bool { return e.key }
  4232  
  4233  // ErrorName returns error name.
  4234  func (e RateLimit_Action_RequestHeadersValidationError) ErrorName() string {
  4235  	return "RateLimit_Action_RequestHeadersValidationError"
  4236  }
  4237  
  4238  // Error satisfies the builtin error interface
  4239  func (e RateLimit_Action_RequestHeadersValidationError) Error() string {
  4240  	cause := ""
  4241  	if e.cause != nil {
  4242  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  4243  	}
  4244  
  4245  	key := ""
  4246  	if e.key {
  4247  		key = "key for "
  4248  	}
  4249  
  4250  	return fmt.Sprintf(
  4251  		"invalid %sRateLimit_Action_RequestHeaders.%s: %s%s",
  4252  		key,
  4253  		e.field,
  4254  		e.reason,
  4255  		cause)
  4256  }
  4257  
  4258  var _ error = RateLimit_Action_RequestHeadersValidationError{}
  4259  
  4260  var _ interface {
  4261  	Field() string
  4262  	Reason() string
  4263  	Key() bool
  4264  	Cause() error
  4265  	ErrorName() string
  4266  } = RateLimit_Action_RequestHeadersValidationError{}
  4267  
  4268  var _RateLimit_Action_RequestHeaders_HeaderName_Pattern = regexp.MustCompile("^[^\x00\n\r]*$")
  4269  
  4270  // Validate checks the field values on RateLimit_Action_RemoteAddress with the
  4271  // rules defined in the proto definition for this message. If any rules are
  4272  // violated, an error is returned.
  4273  func (m *RateLimit_Action_RemoteAddress) Validate() error {
  4274  	if m == nil {
  4275  		return nil
  4276  	}
  4277  
  4278  	return nil
  4279  }
  4280  
  4281  // RateLimit_Action_RemoteAddressValidationError is the validation error
  4282  // returned by RateLimit_Action_RemoteAddress.Validate if the designated
  4283  // constraints aren't met.
  4284  type RateLimit_Action_RemoteAddressValidationError struct {
  4285  	field  string
  4286  	reason string
  4287  	cause  error
  4288  	key    bool
  4289  }
  4290  
  4291  // Field function returns field value.
  4292  func (e RateLimit_Action_RemoteAddressValidationError) Field() string { return e.field }
  4293  
  4294  // Reason function returns reason value.
  4295  func (e RateLimit_Action_RemoteAddressValidationError) Reason() string { return e.reason }
  4296  
  4297  // Cause function returns cause value.
  4298  func (e RateLimit_Action_RemoteAddressValidationError) Cause() error { return e.cause }
  4299  
  4300  // Key function returns key value.
  4301  func (e RateLimit_Action_RemoteAddressValidationError) Key() bool { return e.key }
  4302  
  4303  // ErrorName returns error name.
  4304  func (e RateLimit_Action_RemoteAddressValidationError) ErrorName() string {
  4305  	return "RateLimit_Action_RemoteAddressValidationError"
  4306  }
  4307  
  4308  // Error satisfies the builtin error interface
  4309  func (e RateLimit_Action_RemoteAddressValidationError) Error() string {
  4310  	cause := ""
  4311  	if e.cause != nil {
  4312  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  4313  	}
  4314  
  4315  	key := ""
  4316  	if e.key {
  4317  		key = "key for "
  4318  	}
  4319  
  4320  	return fmt.Sprintf(
  4321  		"invalid %sRateLimit_Action_RemoteAddress.%s: %s%s",
  4322  		key,
  4323  		e.field,
  4324  		e.reason,
  4325  		cause)
  4326  }
  4327  
  4328  var _ error = RateLimit_Action_RemoteAddressValidationError{}
  4329  
  4330  var _ interface {
  4331  	Field() string
  4332  	Reason() string
  4333  	Key() bool
  4334  	Cause() error
  4335  	ErrorName() string
  4336  } = RateLimit_Action_RemoteAddressValidationError{}
  4337  
  4338  // Validate checks the field values on RateLimit_Action_GenericKey with the
  4339  // rules defined in the proto definition for this message. If any rules are
  4340  // violated, an error is returned.
  4341  func (m *RateLimit_Action_GenericKey) Validate() error {
  4342  	if m == nil {
  4343  		return nil
  4344  	}
  4345  
  4346  	if len(m.GetDescriptorValue()) < 1 {
  4347  		return RateLimit_Action_GenericKeyValidationError{
  4348  			field:  "DescriptorValue",
  4349  			reason: "value length must be at least 1 bytes",
  4350  		}
  4351  	}
  4352  
  4353  	return nil
  4354  }
  4355  
  4356  // RateLimit_Action_GenericKeyValidationError is the validation error returned
  4357  // by RateLimit_Action_GenericKey.Validate if the designated constraints
  4358  // aren't met.
  4359  type RateLimit_Action_GenericKeyValidationError struct {
  4360  	field  string
  4361  	reason string
  4362  	cause  error
  4363  	key    bool
  4364  }
  4365  
  4366  // Field function returns field value.
  4367  func (e RateLimit_Action_GenericKeyValidationError) Field() string { return e.field }
  4368  
  4369  // Reason function returns reason value.
  4370  func (e RateLimit_Action_GenericKeyValidationError) Reason() string { return e.reason }
  4371  
  4372  // Cause function returns cause value.
  4373  func (e RateLimit_Action_GenericKeyValidationError) Cause() error { return e.cause }
  4374  
  4375  // Key function returns key value.
  4376  func (e RateLimit_Action_GenericKeyValidationError) Key() bool { return e.key }
  4377  
  4378  // ErrorName returns error name.
  4379  func (e RateLimit_Action_GenericKeyValidationError) ErrorName() string {
  4380  	return "RateLimit_Action_GenericKeyValidationError"
  4381  }
  4382  
  4383  // Error satisfies the builtin error interface
  4384  func (e RateLimit_Action_GenericKeyValidationError) Error() string {
  4385  	cause := ""
  4386  	if e.cause != nil {
  4387  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  4388  	}
  4389  
  4390  	key := ""
  4391  	if e.key {
  4392  		key = "key for "
  4393  	}
  4394  
  4395  	return fmt.Sprintf(
  4396  		"invalid %sRateLimit_Action_GenericKey.%s: %s%s",
  4397  		key,
  4398  		e.field,
  4399  		e.reason,
  4400  		cause)
  4401  }
  4402  
  4403  var _ error = RateLimit_Action_GenericKeyValidationError{}
  4404  
  4405  var _ interface {
  4406  	Field() string
  4407  	Reason() string
  4408  	Key() bool
  4409  	Cause() error
  4410  	ErrorName() string
  4411  } = RateLimit_Action_GenericKeyValidationError{}
  4412  
  4413  // Validate checks the field values on RateLimit_Action_HeaderValueMatch with
  4414  // the rules defined in the proto definition for this message. If any rules
  4415  // are violated, an error is returned.
  4416  func (m *RateLimit_Action_HeaderValueMatch) Validate() error {
  4417  	if m == nil {
  4418  		return nil
  4419  	}
  4420  
  4421  	if len(m.GetDescriptorValue()) < 1 {
  4422  		return RateLimit_Action_HeaderValueMatchValidationError{
  4423  			field:  "DescriptorValue",
  4424  			reason: "value length must be at least 1 bytes",
  4425  		}
  4426  	}
  4427  
  4428  	if v, ok := interface{}(m.GetExpectMatch()).(interface{ Validate() error }); ok {
  4429  		if err := v.Validate(); err != nil {
  4430  			return RateLimit_Action_HeaderValueMatchValidationError{
  4431  				field:  "ExpectMatch",
  4432  				reason: "embedded message failed validation",
  4433  				cause:  err,
  4434  			}
  4435  		}
  4436  	}
  4437  
  4438  	if len(m.GetHeaders()) < 1 {
  4439  		return RateLimit_Action_HeaderValueMatchValidationError{
  4440  			field:  "Headers",
  4441  			reason: "value must contain at least 1 item(s)",
  4442  		}
  4443  	}
  4444  
  4445  	for idx, item := range m.GetHeaders() {
  4446  		_, _ = idx, item
  4447  
  4448  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  4449  			if err := v.Validate(); err != nil {
  4450  				return RateLimit_Action_HeaderValueMatchValidationError{
  4451  					field:  fmt.Sprintf("Headers[%v]", idx),
  4452  					reason: "embedded message failed validation",
  4453  					cause:  err,
  4454  				}
  4455  			}
  4456  		}
  4457  
  4458  	}
  4459  
  4460  	return nil
  4461  }
  4462  
  4463  // RateLimit_Action_HeaderValueMatchValidationError is the validation error
  4464  // returned by RateLimit_Action_HeaderValueMatch.Validate if the designated
  4465  // constraints aren't met.
  4466  type RateLimit_Action_HeaderValueMatchValidationError struct {
  4467  	field  string
  4468  	reason string
  4469  	cause  error
  4470  	key    bool
  4471  }
  4472  
  4473  // Field function returns field value.
  4474  func (e RateLimit_Action_HeaderValueMatchValidationError) Field() string { return e.field }
  4475  
  4476  // Reason function returns reason value.
  4477  func (e RateLimit_Action_HeaderValueMatchValidationError) Reason() string { return e.reason }
  4478  
  4479  // Cause function returns cause value.
  4480  func (e RateLimit_Action_HeaderValueMatchValidationError) Cause() error { return e.cause }
  4481  
  4482  // Key function returns key value.
  4483  func (e RateLimit_Action_HeaderValueMatchValidationError) Key() bool { return e.key }
  4484  
  4485  // ErrorName returns error name.
  4486  func (e RateLimit_Action_HeaderValueMatchValidationError) ErrorName() string {
  4487  	return "RateLimit_Action_HeaderValueMatchValidationError"
  4488  }
  4489  
  4490  // Error satisfies the builtin error interface
  4491  func (e RateLimit_Action_HeaderValueMatchValidationError) Error() string {
  4492  	cause := ""
  4493  	if e.cause != nil {
  4494  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  4495  	}
  4496  
  4497  	key := ""
  4498  	if e.key {
  4499  		key = "key for "
  4500  	}
  4501  
  4502  	return fmt.Sprintf(
  4503  		"invalid %sRateLimit_Action_HeaderValueMatch.%s: %s%s",
  4504  		key,
  4505  		e.field,
  4506  		e.reason,
  4507  		cause)
  4508  }
  4509  
  4510  var _ error = RateLimit_Action_HeaderValueMatchValidationError{}
  4511  
  4512  var _ interface {
  4513  	Field() string
  4514  	Reason() string
  4515  	Key() bool
  4516  	Cause() error
  4517  	ErrorName() string
  4518  } = RateLimit_Action_HeaderValueMatchValidationError{}