github.com/hxx258456/ccgo@v0.0.5-0.20230213014102-48b35f46f66f/go-control-plane/envoy/service/ext_proc/v3alpha/external_processor.pb.validate.go (about)

     1  // Code generated by protoc-gen-validate. DO NOT EDIT.
     2  // source: envoy/service/ext_proc/v3alpha/external_processor.proto
     3  
     4  package envoy_service_ext_proc_v3alpha
     5  
     6  import (
     7  	"bytes"
     8  	"errors"
     9  	"fmt"
    10  	"net"
    11  	"net/mail"
    12  	"net/url"
    13  	"regexp"
    14  	"strings"
    15  	"time"
    16  	"unicode/utf8"
    17  
    18  	"google.golang.org/protobuf/types/known/anypb"
    19  )
    20  
    21  // ensure the imports are used
    22  var (
    23  	_ = bytes.MinRead
    24  	_ = errors.New("")
    25  	_ = fmt.Print
    26  	_ = utf8.UTFMax
    27  	_ = (*regexp.Regexp)(nil)
    28  	_ = (*strings.Reader)(nil)
    29  	_ = net.IPv4len
    30  	_ = time.Duration(0)
    31  	_ = (*url.URL)(nil)
    32  	_ = (*mail.Address)(nil)
    33  	_ = anypb.Any{}
    34  )
    35  
    36  // Validate checks the field values on ProcessingRequest with the rules defined
    37  // in the proto definition for this message. If any rules are violated, an
    38  // error is returned.
    39  func (m *ProcessingRequest) Validate() error {
    40  	if m == nil {
    41  		return nil
    42  	}
    43  
    44  	// no validation rules for AsyncMode
    45  
    46  	switch m.Request.(type) {
    47  
    48  	case *ProcessingRequest_RequestHeaders:
    49  
    50  		if v, ok := interface{}(m.GetRequestHeaders()).(interface{ Validate() error }); ok {
    51  			if err := v.Validate(); err != nil {
    52  				return ProcessingRequestValidationError{
    53  					field:  "RequestHeaders",
    54  					reason: "embedded message failed validation",
    55  					cause:  err,
    56  				}
    57  			}
    58  		}
    59  
    60  	case *ProcessingRequest_ResponseHeaders:
    61  
    62  		if v, ok := interface{}(m.GetResponseHeaders()).(interface{ Validate() error }); ok {
    63  			if err := v.Validate(); err != nil {
    64  				return ProcessingRequestValidationError{
    65  					field:  "ResponseHeaders",
    66  					reason: "embedded message failed validation",
    67  					cause:  err,
    68  				}
    69  			}
    70  		}
    71  
    72  	case *ProcessingRequest_RequestBody:
    73  
    74  		if v, ok := interface{}(m.GetRequestBody()).(interface{ Validate() error }); ok {
    75  			if err := v.Validate(); err != nil {
    76  				return ProcessingRequestValidationError{
    77  					field:  "RequestBody",
    78  					reason: "embedded message failed validation",
    79  					cause:  err,
    80  				}
    81  			}
    82  		}
    83  
    84  	case *ProcessingRequest_ResponseBody:
    85  
    86  		if v, ok := interface{}(m.GetResponseBody()).(interface{ Validate() error }); ok {
    87  			if err := v.Validate(); err != nil {
    88  				return ProcessingRequestValidationError{
    89  					field:  "ResponseBody",
    90  					reason: "embedded message failed validation",
    91  					cause:  err,
    92  				}
    93  			}
    94  		}
    95  
    96  	case *ProcessingRequest_RequestTrailers:
    97  
    98  		if v, ok := interface{}(m.GetRequestTrailers()).(interface{ Validate() error }); ok {
    99  			if err := v.Validate(); err != nil {
   100  				return ProcessingRequestValidationError{
   101  					field:  "RequestTrailers",
   102  					reason: "embedded message failed validation",
   103  					cause:  err,
   104  				}
   105  			}
   106  		}
   107  
   108  	case *ProcessingRequest_ResponseTrailers:
   109  
   110  		if v, ok := interface{}(m.GetResponseTrailers()).(interface{ Validate() error }); ok {
   111  			if err := v.Validate(); err != nil {
   112  				return ProcessingRequestValidationError{
   113  					field:  "ResponseTrailers",
   114  					reason: "embedded message failed validation",
   115  					cause:  err,
   116  				}
   117  			}
   118  		}
   119  
   120  	default:
   121  		return ProcessingRequestValidationError{
   122  			field:  "Request",
   123  			reason: "value is required",
   124  		}
   125  
   126  	}
   127  
   128  	return nil
   129  }
   130  
   131  // ProcessingRequestValidationError is the validation error returned by
   132  // ProcessingRequest.Validate if the designated constraints aren't met.
   133  type ProcessingRequestValidationError struct {
   134  	field  string
   135  	reason string
   136  	cause  error
   137  	key    bool
   138  }
   139  
   140  // Field function returns field value.
   141  func (e ProcessingRequestValidationError) Field() string { return e.field }
   142  
   143  // Reason function returns reason value.
   144  func (e ProcessingRequestValidationError) Reason() string { return e.reason }
   145  
   146  // Cause function returns cause value.
   147  func (e ProcessingRequestValidationError) Cause() error { return e.cause }
   148  
   149  // Key function returns key value.
   150  func (e ProcessingRequestValidationError) Key() bool { return e.key }
   151  
   152  // ErrorName returns error name.
   153  func (e ProcessingRequestValidationError) ErrorName() string {
   154  	return "ProcessingRequestValidationError"
   155  }
   156  
   157  // Error satisfies the builtin error interface
   158  func (e ProcessingRequestValidationError) Error() string {
   159  	cause := ""
   160  	if e.cause != nil {
   161  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   162  	}
   163  
   164  	key := ""
   165  	if e.key {
   166  		key = "key for "
   167  	}
   168  
   169  	return fmt.Sprintf(
   170  		"invalid %sProcessingRequest.%s: %s%s",
   171  		key,
   172  		e.field,
   173  		e.reason,
   174  		cause)
   175  }
   176  
   177  var _ error = ProcessingRequestValidationError{}
   178  
   179  var _ interface {
   180  	Field() string
   181  	Reason() string
   182  	Key() bool
   183  	Cause() error
   184  	ErrorName() string
   185  } = ProcessingRequestValidationError{}
   186  
   187  // Validate checks the field values on ProcessingResponse with the rules
   188  // defined in the proto definition for this message. If any rules are
   189  // violated, an error is returned.
   190  func (m *ProcessingResponse) Validate() error {
   191  	if m == nil {
   192  		return nil
   193  	}
   194  
   195  	if v, ok := interface{}(m.GetDynamicMetadata()).(interface{ Validate() error }); ok {
   196  		if err := v.Validate(); err != nil {
   197  			return ProcessingResponseValidationError{
   198  				field:  "DynamicMetadata",
   199  				reason: "embedded message failed validation",
   200  				cause:  err,
   201  			}
   202  		}
   203  	}
   204  
   205  	if v, ok := interface{}(m.GetModeOverride()).(interface{ Validate() error }); ok {
   206  		if err := v.Validate(); err != nil {
   207  			return ProcessingResponseValidationError{
   208  				field:  "ModeOverride",
   209  				reason: "embedded message failed validation",
   210  				cause:  err,
   211  			}
   212  		}
   213  	}
   214  
   215  	switch m.Response.(type) {
   216  
   217  	case *ProcessingResponse_RequestHeaders:
   218  
   219  		if v, ok := interface{}(m.GetRequestHeaders()).(interface{ Validate() error }); ok {
   220  			if err := v.Validate(); err != nil {
   221  				return ProcessingResponseValidationError{
   222  					field:  "RequestHeaders",
   223  					reason: "embedded message failed validation",
   224  					cause:  err,
   225  				}
   226  			}
   227  		}
   228  
   229  	case *ProcessingResponse_ResponseHeaders:
   230  
   231  		if v, ok := interface{}(m.GetResponseHeaders()).(interface{ Validate() error }); ok {
   232  			if err := v.Validate(); err != nil {
   233  				return ProcessingResponseValidationError{
   234  					field:  "ResponseHeaders",
   235  					reason: "embedded message failed validation",
   236  					cause:  err,
   237  				}
   238  			}
   239  		}
   240  
   241  	case *ProcessingResponse_RequestBody:
   242  
   243  		if v, ok := interface{}(m.GetRequestBody()).(interface{ Validate() error }); ok {
   244  			if err := v.Validate(); err != nil {
   245  				return ProcessingResponseValidationError{
   246  					field:  "RequestBody",
   247  					reason: "embedded message failed validation",
   248  					cause:  err,
   249  				}
   250  			}
   251  		}
   252  
   253  	case *ProcessingResponse_ResponseBody:
   254  
   255  		if v, ok := interface{}(m.GetResponseBody()).(interface{ Validate() error }); ok {
   256  			if err := v.Validate(); err != nil {
   257  				return ProcessingResponseValidationError{
   258  					field:  "ResponseBody",
   259  					reason: "embedded message failed validation",
   260  					cause:  err,
   261  				}
   262  			}
   263  		}
   264  
   265  	case *ProcessingResponse_RequestTrailers:
   266  
   267  		if v, ok := interface{}(m.GetRequestTrailers()).(interface{ Validate() error }); ok {
   268  			if err := v.Validate(); err != nil {
   269  				return ProcessingResponseValidationError{
   270  					field:  "RequestTrailers",
   271  					reason: "embedded message failed validation",
   272  					cause:  err,
   273  				}
   274  			}
   275  		}
   276  
   277  	case *ProcessingResponse_ResponseTrailers:
   278  
   279  		if v, ok := interface{}(m.GetResponseTrailers()).(interface{ Validate() error }); ok {
   280  			if err := v.Validate(); err != nil {
   281  				return ProcessingResponseValidationError{
   282  					field:  "ResponseTrailers",
   283  					reason: "embedded message failed validation",
   284  					cause:  err,
   285  				}
   286  			}
   287  		}
   288  
   289  	case *ProcessingResponse_ImmediateResponse:
   290  
   291  		if v, ok := interface{}(m.GetImmediateResponse()).(interface{ Validate() error }); ok {
   292  			if err := v.Validate(); err != nil {
   293  				return ProcessingResponseValidationError{
   294  					field:  "ImmediateResponse",
   295  					reason: "embedded message failed validation",
   296  					cause:  err,
   297  				}
   298  			}
   299  		}
   300  
   301  	default:
   302  		return ProcessingResponseValidationError{
   303  			field:  "Response",
   304  			reason: "value is required",
   305  		}
   306  
   307  	}
   308  
   309  	return nil
   310  }
   311  
   312  // ProcessingResponseValidationError is the validation error returned by
   313  // ProcessingResponse.Validate if the designated constraints aren't met.
   314  type ProcessingResponseValidationError struct {
   315  	field  string
   316  	reason string
   317  	cause  error
   318  	key    bool
   319  }
   320  
   321  // Field function returns field value.
   322  func (e ProcessingResponseValidationError) Field() string { return e.field }
   323  
   324  // Reason function returns reason value.
   325  func (e ProcessingResponseValidationError) Reason() string { return e.reason }
   326  
   327  // Cause function returns cause value.
   328  func (e ProcessingResponseValidationError) Cause() error { return e.cause }
   329  
   330  // Key function returns key value.
   331  func (e ProcessingResponseValidationError) Key() bool { return e.key }
   332  
   333  // ErrorName returns error name.
   334  func (e ProcessingResponseValidationError) ErrorName() string {
   335  	return "ProcessingResponseValidationError"
   336  }
   337  
   338  // Error satisfies the builtin error interface
   339  func (e ProcessingResponseValidationError) Error() string {
   340  	cause := ""
   341  	if e.cause != nil {
   342  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   343  	}
   344  
   345  	key := ""
   346  	if e.key {
   347  		key = "key for "
   348  	}
   349  
   350  	return fmt.Sprintf(
   351  		"invalid %sProcessingResponse.%s: %s%s",
   352  		key,
   353  		e.field,
   354  		e.reason,
   355  		cause)
   356  }
   357  
   358  var _ error = ProcessingResponseValidationError{}
   359  
   360  var _ interface {
   361  	Field() string
   362  	Reason() string
   363  	Key() bool
   364  	Cause() error
   365  	ErrorName() string
   366  } = ProcessingResponseValidationError{}
   367  
   368  // Validate checks the field values on HttpHeaders with the rules defined in
   369  // the proto definition for this message. If any rules are violated, an error
   370  // is returned.
   371  func (m *HttpHeaders) Validate() error {
   372  	if m == nil {
   373  		return nil
   374  	}
   375  
   376  	if v, ok := interface{}(m.GetHeaders()).(interface{ Validate() error }); ok {
   377  		if err := v.Validate(); err != nil {
   378  			return HttpHeadersValidationError{
   379  				field:  "Headers",
   380  				reason: "embedded message failed validation",
   381  				cause:  err,
   382  			}
   383  		}
   384  	}
   385  
   386  	for key, val := range m.GetAttributes() {
   387  		_ = val
   388  
   389  		// no validation rules for Attributes[key]
   390  
   391  		if v, ok := interface{}(val).(interface{ Validate() error }); ok {
   392  			if err := v.Validate(); err != nil {
   393  				return HttpHeadersValidationError{
   394  					field:  fmt.Sprintf("Attributes[%v]", key),
   395  					reason: "embedded message failed validation",
   396  					cause:  err,
   397  				}
   398  			}
   399  		}
   400  
   401  	}
   402  
   403  	// no validation rules for EndOfStream
   404  
   405  	return nil
   406  }
   407  
   408  // HttpHeadersValidationError is the validation error returned by
   409  // HttpHeaders.Validate if the designated constraints aren't met.
   410  type HttpHeadersValidationError struct {
   411  	field  string
   412  	reason string
   413  	cause  error
   414  	key    bool
   415  }
   416  
   417  // Field function returns field value.
   418  func (e HttpHeadersValidationError) Field() string { return e.field }
   419  
   420  // Reason function returns reason value.
   421  func (e HttpHeadersValidationError) Reason() string { return e.reason }
   422  
   423  // Cause function returns cause value.
   424  func (e HttpHeadersValidationError) Cause() error { return e.cause }
   425  
   426  // Key function returns key value.
   427  func (e HttpHeadersValidationError) Key() bool { return e.key }
   428  
   429  // ErrorName returns error name.
   430  func (e HttpHeadersValidationError) ErrorName() string { return "HttpHeadersValidationError" }
   431  
   432  // Error satisfies the builtin error interface
   433  func (e HttpHeadersValidationError) Error() string {
   434  	cause := ""
   435  	if e.cause != nil {
   436  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   437  	}
   438  
   439  	key := ""
   440  	if e.key {
   441  		key = "key for "
   442  	}
   443  
   444  	return fmt.Sprintf(
   445  		"invalid %sHttpHeaders.%s: %s%s",
   446  		key,
   447  		e.field,
   448  		e.reason,
   449  		cause)
   450  }
   451  
   452  var _ error = HttpHeadersValidationError{}
   453  
   454  var _ interface {
   455  	Field() string
   456  	Reason() string
   457  	Key() bool
   458  	Cause() error
   459  	ErrorName() string
   460  } = HttpHeadersValidationError{}
   461  
   462  // Validate checks the field values on HttpBody with the rules defined in the
   463  // proto definition for this message. If any rules are violated, an error is returned.
   464  func (m *HttpBody) Validate() error {
   465  	if m == nil {
   466  		return nil
   467  	}
   468  
   469  	// no validation rules for Body
   470  
   471  	// no validation rules for EndOfStream
   472  
   473  	return nil
   474  }
   475  
   476  // HttpBodyValidationError is the validation error returned by
   477  // HttpBody.Validate if the designated constraints aren't met.
   478  type HttpBodyValidationError struct {
   479  	field  string
   480  	reason string
   481  	cause  error
   482  	key    bool
   483  }
   484  
   485  // Field function returns field value.
   486  func (e HttpBodyValidationError) Field() string { return e.field }
   487  
   488  // Reason function returns reason value.
   489  func (e HttpBodyValidationError) Reason() string { return e.reason }
   490  
   491  // Cause function returns cause value.
   492  func (e HttpBodyValidationError) Cause() error { return e.cause }
   493  
   494  // Key function returns key value.
   495  func (e HttpBodyValidationError) Key() bool { return e.key }
   496  
   497  // ErrorName returns error name.
   498  func (e HttpBodyValidationError) ErrorName() string { return "HttpBodyValidationError" }
   499  
   500  // Error satisfies the builtin error interface
   501  func (e HttpBodyValidationError) Error() string {
   502  	cause := ""
   503  	if e.cause != nil {
   504  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   505  	}
   506  
   507  	key := ""
   508  	if e.key {
   509  		key = "key for "
   510  	}
   511  
   512  	return fmt.Sprintf(
   513  		"invalid %sHttpBody.%s: %s%s",
   514  		key,
   515  		e.field,
   516  		e.reason,
   517  		cause)
   518  }
   519  
   520  var _ error = HttpBodyValidationError{}
   521  
   522  var _ interface {
   523  	Field() string
   524  	Reason() string
   525  	Key() bool
   526  	Cause() error
   527  	ErrorName() string
   528  } = HttpBodyValidationError{}
   529  
   530  // Validate checks the field values on HttpTrailers with the rules defined in
   531  // the proto definition for this message. If any rules are violated, an error
   532  // is returned.
   533  func (m *HttpTrailers) Validate() error {
   534  	if m == nil {
   535  		return nil
   536  	}
   537  
   538  	if v, ok := interface{}(m.GetTrailers()).(interface{ Validate() error }); ok {
   539  		if err := v.Validate(); err != nil {
   540  			return HttpTrailersValidationError{
   541  				field:  "Trailers",
   542  				reason: "embedded message failed validation",
   543  				cause:  err,
   544  			}
   545  		}
   546  	}
   547  
   548  	return nil
   549  }
   550  
   551  // HttpTrailersValidationError is the validation error returned by
   552  // HttpTrailers.Validate if the designated constraints aren't met.
   553  type HttpTrailersValidationError struct {
   554  	field  string
   555  	reason string
   556  	cause  error
   557  	key    bool
   558  }
   559  
   560  // Field function returns field value.
   561  func (e HttpTrailersValidationError) Field() string { return e.field }
   562  
   563  // Reason function returns reason value.
   564  func (e HttpTrailersValidationError) Reason() string { return e.reason }
   565  
   566  // Cause function returns cause value.
   567  func (e HttpTrailersValidationError) Cause() error { return e.cause }
   568  
   569  // Key function returns key value.
   570  func (e HttpTrailersValidationError) Key() bool { return e.key }
   571  
   572  // ErrorName returns error name.
   573  func (e HttpTrailersValidationError) ErrorName() string { return "HttpTrailersValidationError" }
   574  
   575  // Error satisfies the builtin error interface
   576  func (e HttpTrailersValidationError) Error() string {
   577  	cause := ""
   578  	if e.cause != nil {
   579  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   580  	}
   581  
   582  	key := ""
   583  	if e.key {
   584  		key = "key for "
   585  	}
   586  
   587  	return fmt.Sprintf(
   588  		"invalid %sHttpTrailers.%s: %s%s",
   589  		key,
   590  		e.field,
   591  		e.reason,
   592  		cause)
   593  }
   594  
   595  var _ error = HttpTrailersValidationError{}
   596  
   597  var _ interface {
   598  	Field() string
   599  	Reason() string
   600  	Key() bool
   601  	Cause() error
   602  	ErrorName() string
   603  } = HttpTrailersValidationError{}
   604  
   605  // Validate checks the field values on HeadersResponse with the rules defined
   606  // in the proto definition for this message. If any rules are violated, an
   607  // error is returned.
   608  func (m *HeadersResponse) Validate() error {
   609  	if m == nil {
   610  		return nil
   611  	}
   612  
   613  	if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok {
   614  		if err := v.Validate(); err != nil {
   615  			return HeadersResponseValidationError{
   616  				field:  "Response",
   617  				reason: "embedded message failed validation",
   618  				cause:  err,
   619  			}
   620  		}
   621  	}
   622  
   623  	return nil
   624  }
   625  
   626  // HeadersResponseValidationError is the validation error returned by
   627  // HeadersResponse.Validate if the designated constraints aren't met.
   628  type HeadersResponseValidationError struct {
   629  	field  string
   630  	reason string
   631  	cause  error
   632  	key    bool
   633  }
   634  
   635  // Field function returns field value.
   636  func (e HeadersResponseValidationError) Field() string { return e.field }
   637  
   638  // Reason function returns reason value.
   639  func (e HeadersResponseValidationError) Reason() string { return e.reason }
   640  
   641  // Cause function returns cause value.
   642  func (e HeadersResponseValidationError) Cause() error { return e.cause }
   643  
   644  // Key function returns key value.
   645  func (e HeadersResponseValidationError) Key() bool { return e.key }
   646  
   647  // ErrorName returns error name.
   648  func (e HeadersResponseValidationError) ErrorName() string { return "HeadersResponseValidationError" }
   649  
   650  // Error satisfies the builtin error interface
   651  func (e HeadersResponseValidationError) Error() string {
   652  	cause := ""
   653  	if e.cause != nil {
   654  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   655  	}
   656  
   657  	key := ""
   658  	if e.key {
   659  		key = "key for "
   660  	}
   661  
   662  	return fmt.Sprintf(
   663  		"invalid %sHeadersResponse.%s: %s%s",
   664  		key,
   665  		e.field,
   666  		e.reason,
   667  		cause)
   668  }
   669  
   670  var _ error = HeadersResponseValidationError{}
   671  
   672  var _ interface {
   673  	Field() string
   674  	Reason() string
   675  	Key() bool
   676  	Cause() error
   677  	ErrorName() string
   678  } = HeadersResponseValidationError{}
   679  
   680  // Validate checks the field values on TrailersResponse with the rules defined
   681  // in the proto definition for this message. If any rules are violated, an
   682  // error is returned.
   683  func (m *TrailersResponse) Validate() error {
   684  	if m == nil {
   685  		return nil
   686  	}
   687  
   688  	if v, ok := interface{}(m.GetHeaderMutation()).(interface{ Validate() error }); ok {
   689  		if err := v.Validate(); err != nil {
   690  			return TrailersResponseValidationError{
   691  				field:  "HeaderMutation",
   692  				reason: "embedded message failed validation",
   693  				cause:  err,
   694  			}
   695  		}
   696  	}
   697  
   698  	return nil
   699  }
   700  
   701  // TrailersResponseValidationError is the validation error returned by
   702  // TrailersResponse.Validate if the designated constraints aren't met.
   703  type TrailersResponseValidationError struct {
   704  	field  string
   705  	reason string
   706  	cause  error
   707  	key    bool
   708  }
   709  
   710  // Field function returns field value.
   711  func (e TrailersResponseValidationError) Field() string { return e.field }
   712  
   713  // Reason function returns reason value.
   714  func (e TrailersResponseValidationError) Reason() string { return e.reason }
   715  
   716  // Cause function returns cause value.
   717  func (e TrailersResponseValidationError) Cause() error { return e.cause }
   718  
   719  // Key function returns key value.
   720  func (e TrailersResponseValidationError) Key() bool { return e.key }
   721  
   722  // ErrorName returns error name.
   723  func (e TrailersResponseValidationError) ErrorName() string { return "TrailersResponseValidationError" }
   724  
   725  // Error satisfies the builtin error interface
   726  func (e TrailersResponseValidationError) Error() string {
   727  	cause := ""
   728  	if e.cause != nil {
   729  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   730  	}
   731  
   732  	key := ""
   733  	if e.key {
   734  		key = "key for "
   735  	}
   736  
   737  	return fmt.Sprintf(
   738  		"invalid %sTrailersResponse.%s: %s%s",
   739  		key,
   740  		e.field,
   741  		e.reason,
   742  		cause)
   743  }
   744  
   745  var _ error = TrailersResponseValidationError{}
   746  
   747  var _ interface {
   748  	Field() string
   749  	Reason() string
   750  	Key() bool
   751  	Cause() error
   752  	ErrorName() string
   753  } = TrailersResponseValidationError{}
   754  
   755  // Validate checks the field values on BodyResponse with the rules defined in
   756  // the proto definition for this message. If any rules are violated, an error
   757  // is returned.
   758  func (m *BodyResponse) Validate() error {
   759  	if m == nil {
   760  		return nil
   761  	}
   762  
   763  	if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok {
   764  		if err := v.Validate(); err != nil {
   765  			return BodyResponseValidationError{
   766  				field:  "Response",
   767  				reason: "embedded message failed validation",
   768  				cause:  err,
   769  			}
   770  		}
   771  	}
   772  
   773  	return nil
   774  }
   775  
   776  // BodyResponseValidationError is the validation error returned by
   777  // BodyResponse.Validate if the designated constraints aren't met.
   778  type BodyResponseValidationError struct {
   779  	field  string
   780  	reason string
   781  	cause  error
   782  	key    bool
   783  }
   784  
   785  // Field function returns field value.
   786  func (e BodyResponseValidationError) Field() string { return e.field }
   787  
   788  // Reason function returns reason value.
   789  func (e BodyResponseValidationError) Reason() string { return e.reason }
   790  
   791  // Cause function returns cause value.
   792  func (e BodyResponseValidationError) Cause() error { return e.cause }
   793  
   794  // Key function returns key value.
   795  func (e BodyResponseValidationError) Key() bool { return e.key }
   796  
   797  // ErrorName returns error name.
   798  func (e BodyResponseValidationError) ErrorName() string { return "BodyResponseValidationError" }
   799  
   800  // Error satisfies the builtin error interface
   801  func (e BodyResponseValidationError) Error() string {
   802  	cause := ""
   803  	if e.cause != nil {
   804  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   805  	}
   806  
   807  	key := ""
   808  	if e.key {
   809  		key = "key for "
   810  	}
   811  
   812  	return fmt.Sprintf(
   813  		"invalid %sBodyResponse.%s: %s%s",
   814  		key,
   815  		e.field,
   816  		e.reason,
   817  		cause)
   818  }
   819  
   820  var _ error = BodyResponseValidationError{}
   821  
   822  var _ interface {
   823  	Field() string
   824  	Reason() string
   825  	Key() bool
   826  	Cause() error
   827  	ErrorName() string
   828  } = BodyResponseValidationError{}
   829  
   830  // Validate checks the field values on CommonResponse with the rules defined in
   831  // the proto definition for this message. If any rules are violated, an error
   832  // is returned.
   833  func (m *CommonResponse) Validate() error {
   834  	if m == nil {
   835  		return nil
   836  	}
   837  
   838  	if _, ok := CommonResponse_ResponseStatus_name[int32(m.GetStatus())]; !ok {
   839  		return CommonResponseValidationError{
   840  			field:  "Status",
   841  			reason: "value must be one of the defined enum values",
   842  		}
   843  	}
   844  
   845  	if v, ok := interface{}(m.GetHeaderMutation()).(interface{ Validate() error }); ok {
   846  		if err := v.Validate(); err != nil {
   847  			return CommonResponseValidationError{
   848  				field:  "HeaderMutation",
   849  				reason: "embedded message failed validation",
   850  				cause:  err,
   851  			}
   852  		}
   853  	}
   854  
   855  	if v, ok := interface{}(m.GetBodyMutation()).(interface{ Validate() error }); ok {
   856  		if err := v.Validate(); err != nil {
   857  			return CommonResponseValidationError{
   858  				field:  "BodyMutation",
   859  				reason: "embedded message failed validation",
   860  				cause:  err,
   861  			}
   862  		}
   863  	}
   864  
   865  	if v, ok := interface{}(m.GetTrailers()).(interface{ Validate() error }); ok {
   866  		if err := v.Validate(); err != nil {
   867  			return CommonResponseValidationError{
   868  				field:  "Trailers",
   869  				reason: "embedded message failed validation",
   870  				cause:  err,
   871  			}
   872  		}
   873  	}
   874  
   875  	// no validation rules for ClearRouteCache
   876  
   877  	return nil
   878  }
   879  
   880  // CommonResponseValidationError is the validation error returned by
   881  // CommonResponse.Validate if the designated constraints aren't met.
   882  type CommonResponseValidationError struct {
   883  	field  string
   884  	reason string
   885  	cause  error
   886  	key    bool
   887  }
   888  
   889  // Field function returns field value.
   890  func (e CommonResponseValidationError) Field() string { return e.field }
   891  
   892  // Reason function returns reason value.
   893  func (e CommonResponseValidationError) Reason() string { return e.reason }
   894  
   895  // Cause function returns cause value.
   896  func (e CommonResponseValidationError) Cause() error { return e.cause }
   897  
   898  // Key function returns key value.
   899  func (e CommonResponseValidationError) Key() bool { return e.key }
   900  
   901  // ErrorName returns error name.
   902  func (e CommonResponseValidationError) ErrorName() string { return "CommonResponseValidationError" }
   903  
   904  // Error satisfies the builtin error interface
   905  func (e CommonResponseValidationError) Error() string {
   906  	cause := ""
   907  	if e.cause != nil {
   908  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   909  	}
   910  
   911  	key := ""
   912  	if e.key {
   913  		key = "key for "
   914  	}
   915  
   916  	return fmt.Sprintf(
   917  		"invalid %sCommonResponse.%s: %s%s",
   918  		key,
   919  		e.field,
   920  		e.reason,
   921  		cause)
   922  }
   923  
   924  var _ error = CommonResponseValidationError{}
   925  
   926  var _ interface {
   927  	Field() string
   928  	Reason() string
   929  	Key() bool
   930  	Cause() error
   931  	ErrorName() string
   932  } = CommonResponseValidationError{}
   933  
   934  // Validate checks the field values on ImmediateResponse with the rules defined
   935  // in the proto definition for this message. If any rules are violated, an
   936  // error is returned.
   937  func (m *ImmediateResponse) Validate() error {
   938  	if m == nil {
   939  		return nil
   940  	}
   941  
   942  	if m.GetStatus() == nil {
   943  		return ImmediateResponseValidationError{
   944  			field:  "Status",
   945  			reason: "value is required",
   946  		}
   947  	}
   948  
   949  	if v, ok := interface{}(m.GetStatus()).(interface{ Validate() error }); ok {
   950  		if err := v.Validate(); err != nil {
   951  			return ImmediateResponseValidationError{
   952  				field:  "Status",
   953  				reason: "embedded message failed validation",
   954  				cause:  err,
   955  			}
   956  		}
   957  	}
   958  
   959  	if v, ok := interface{}(m.GetHeaders()).(interface{ Validate() error }); ok {
   960  		if err := v.Validate(); err != nil {
   961  			return ImmediateResponseValidationError{
   962  				field:  "Headers",
   963  				reason: "embedded message failed validation",
   964  				cause:  err,
   965  			}
   966  		}
   967  	}
   968  
   969  	// no validation rules for Body
   970  
   971  	if v, ok := interface{}(m.GetGrpcStatus()).(interface{ Validate() error }); ok {
   972  		if err := v.Validate(); err != nil {
   973  			return ImmediateResponseValidationError{
   974  				field:  "GrpcStatus",
   975  				reason: "embedded message failed validation",
   976  				cause:  err,
   977  			}
   978  		}
   979  	}
   980  
   981  	// no validation rules for Details
   982  
   983  	return nil
   984  }
   985  
   986  // ImmediateResponseValidationError is the validation error returned by
   987  // ImmediateResponse.Validate if the designated constraints aren't met.
   988  type ImmediateResponseValidationError struct {
   989  	field  string
   990  	reason string
   991  	cause  error
   992  	key    bool
   993  }
   994  
   995  // Field function returns field value.
   996  func (e ImmediateResponseValidationError) Field() string { return e.field }
   997  
   998  // Reason function returns reason value.
   999  func (e ImmediateResponseValidationError) Reason() string { return e.reason }
  1000  
  1001  // Cause function returns cause value.
  1002  func (e ImmediateResponseValidationError) Cause() error { return e.cause }
  1003  
  1004  // Key function returns key value.
  1005  func (e ImmediateResponseValidationError) Key() bool { return e.key }
  1006  
  1007  // ErrorName returns error name.
  1008  func (e ImmediateResponseValidationError) ErrorName() string {
  1009  	return "ImmediateResponseValidationError"
  1010  }
  1011  
  1012  // Error satisfies the builtin error interface
  1013  func (e ImmediateResponseValidationError) Error() string {
  1014  	cause := ""
  1015  	if e.cause != nil {
  1016  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1017  	}
  1018  
  1019  	key := ""
  1020  	if e.key {
  1021  		key = "key for "
  1022  	}
  1023  
  1024  	return fmt.Sprintf(
  1025  		"invalid %sImmediateResponse.%s: %s%s",
  1026  		key,
  1027  		e.field,
  1028  		e.reason,
  1029  		cause)
  1030  }
  1031  
  1032  var _ error = ImmediateResponseValidationError{}
  1033  
  1034  var _ interface {
  1035  	Field() string
  1036  	Reason() string
  1037  	Key() bool
  1038  	Cause() error
  1039  	ErrorName() string
  1040  } = ImmediateResponseValidationError{}
  1041  
  1042  // Validate checks the field values on GrpcStatus with the rules defined in the
  1043  // proto definition for this message. If any rules are violated, an error is returned.
  1044  func (m *GrpcStatus) Validate() error {
  1045  	if m == nil {
  1046  		return nil
  1047  	}
  1048  
  1049  	// no validation rules for Status
  1050  
  1051  	return nil
  1052  }
  1053  
  1054  // GrpcStatusValidationError is the validation error returned by
  1055  // GrpcStatus.Validate if the designated constraints aren't met.
  1056  type GrpcStatusValidationError struct {
  1057  	field  string
  1058  	reason string
  1059  	cause  error
  1060  	key    bool
  1061  }
  1062  
  1063  // Field function returns field value.
  1064  func (e GrpcStatusValidationError) Field() string { return e.field }
  1065  
  1066  // Reason function returns reason value.
  1067  func (e GrpcStatusValidationError) Reason() string { return e.reason }
  1068  
  1069  // Cause function returns cause value.
  1070  func (e GrpcStatusValidationError) Cause() error { return e.cause }
  1071  
  1072  // Key function returns key value.
  1073  func (e GrpcStatusValidationError) Key() bool { return e.key }
  1074  
  1075  // ErrorName returns error name.
  1076  func (e GrpcStatusValidationError) ErrorName() string { return "GrpcStatusValidationError" }
  1077  
  1078  // Error satisfies the builtin error interface
  1079  func (e GrpcStatusValidationError) Error() string {
  1080  	cause := ""
  1081  	if e.cause != nil {
  1082  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1083  	}
  1084  
  1085  	key := ""
  1086  	if e.key {
  1087  		key = "key for "
  1088  	}
  1089  
  1090  	return fmt.Sprintf(
  1091  		"invalid %sGrpcStatus.%s: %s%s",
  1092  		key,
  1093  		e.field,
  1094  		e.reason,
  1095  		cause)
  1096  }
  1097  
  1098  var _ error = GrpcStatusValidationError{}
  1099  
  1100  var _ interface {
  1101  	Field() string
  1102  	Reason() string
  1103  	Key() bool
  1104  	Cause() error
  1105  	ErrorName() string
  1106  } = GrpcStatusValidationError{}
  1107  
  1108  // Validate checks the field values on HeaderMutation with the rules defined in
  1109  // the proto definition for this message. If any rules are violated, an error
  1110  // is returned.
  1111  func (m *HeaderMutation) Validate() error {
  1112  	if m == nil {
  1113  		return nil
  1114  	}
  1115  
  1116  	for idx, item := range m.GetSetHeaders() {
  1117  		_, _ = idx, item
  1118  
  1119  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  1120  			if err := v.Validate(); err != nil {
  1121  				return HeaderMutationValidationError{
  1122  					field:  fmt.Sprintf("SetHeaders[%v]", idx),
  1123  					reason: "embedded message failed validation",
  1124  					cause:  err,
  1125  				}
  1126  			}
  1127  		}
  1128  
  1129  	}
  1130  
  1131  	return nil
  1132  }
  1133  
  1134  // HeaderMutationValidationError is the validation error returned by
  1135  // HeaderMutation.Validate if the designated constraints aren't met.
  1136  type HeaderMutationValidationError struct {
  1137  	field  string
  1138  	reason string
  1139  	cause  error
  1140  	key    bool
  1141  }
  1142  
  1143  // Field function returns field value.
  1144  func (e HeaderMutationValidationError) Field() string { return e.field }
  1145  
  1146  // Reason function returns reason value.
  1147  func (e HeaderMutationValidationError) Reason() string { return e.reason }
  1148  
  1149  // Cause function returns cause value.
  1150  func (e HeaderMutationValidationError) Cause() error { return e.cause }
  1151  
  1152  // Key function returns key value.
  1153  func (e HeaderMutationValidationError) Key() bool { return e.key }
  1154  
  1155  // ErrorName returns error name.
  1156  func (e HeaderMutationValidationError) ErrorName() string { return "HeaderMutationValidationError" }
  1157  
  1158  // Error satisfies the builtin error interface
  1159  func (e HeaderMutationValidationError) Error() string {
  1160  	cause := ""
  1161  	if e.cause != nil {
  1162  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1163  	}
  1164  
  1165  	key := ""
  1166  	if e.key {
  1167  		key = "key for "
  1168  	}
  1169  
  1170  	return fmt.Sprintf(
  1171  		"invalid %sHeaderMutation.%s: %s%s",
  1172  		key,
  1173  		e.field,
  1174  		e.reason,
  1175  		cause)
  1176  }
  1177  
  1178  var _ error = HeaderMutationValidationError{}
  1179  
  1180  var _ interface {
  1181  	Field() string
  1182  	Reason() string
  1183  	Key() bool
  1184  	Cause() error
  1185  	ErrorName() string
  1186  } = HeaderMutationValidationError{}
  1187  
  1188  // Validate checks the field values on BodyMutation with the rules defined in
  1189  // the proto definition for this message. If any rules are violated, an error
  1190  // is returned.
  1191  func (m *BodyMutation) Validate() error {
  1192  	if m == nil {
  1193  		return nil
  1194  	}
  1195  
  1196  	switch m.Mutation.(type) {
  1197  
  1198  	case *BodyMutation_Body:
  1199  		// no validation rules for Body
  1200  
  1201  	case *BodyMutation_ClearBody:
  1202  		// no validation rules for ClearBody
  1203  
  1204  	}
  1205  
  1206  	return nil
  1207  }
  1208  
  1209  // BodyMutationValidationError is the validation error returned by
  1210  // BodyMutation.Validate if the designated constraints aren't met.
  1211  type BodyMutationValidationError struct {
  1212  	field  string
  1213  	reason string
  1214  	cause  error
  1215  	key    bool
  1216  }
  1217  
  1218  // Field function returns field value.
  1219  func (e BodyMutationValidationError) Field() string { return e.field }
  1220  
  1221  // Reason function returns reason value.
  1222  func (e BodyMutationValidationError) Reason() string { return e.reason }
  1223  
  1224  // Cause function returns cause value.
  1225  func (e BodyMutationValidationError) Cause() error { return e.cause }
  1226  
  1227  // Key function returns key value.
  1228  func (e BodyMutationValidationError) Key() bool { return e.key }
  1229  
  1230  // ErrorName returns error name.
  1231  func (e BodyMutationValidationError) ErrorName() string { return "BodyMutationValidationError" }
  1232  
  1233  // Error satisfies the builtin error interface
  1234  func (e BodyMutationValidationError) Error() string {
  1235  	cause := ""
  1236  	if e.cause != nil {
  1237  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1238  	}
  1239  
  1240  	key := ""
  1241  	if e.key {
  1242  		key = "key for "
  1243  	}
  1244  
  1245  	return fmt.Sprintf(
  1246  		"invalid %sBodyMutation.%s: %s%s",
  1247  		key,
  1248  		e.field,
  1249  		e.reason,
  1250  		cause)
  1251  }
  1252  
  1253  var _ error = BodyMutationValidationError{}
  1254  
  1255  var _ interface {
  1256  	Field() string
  1257  	Reason() string
  1258  	Key() bool
  1259  	Cause() error
  1260  	ErrorName() string
  1261  } = BodyMutationValidationError{}