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

     1  // Code generated by protoc-gen-validate. DO NOT EDIT.
     2  // source: envoy/api/v2/core/protocol.proto
     3  
     4  package envoy_api_v2_core
     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 TcpProtocolOptions with the rules
    37  // defined in the proto definition for this message. If any rules are
    38  // violated, an error is returned.
    39  func (m *TcpProtocolOptions) Validate() error {
    40  	if m == nil {
    41  		return nil
    42  	}
    43  
    44  	return nil
    45  }
    46  
    47  // TcpProtocolOptionsValidationError is the validation error returned by
    48  // TcpProtocolOptions.Validate if the designated constraints aren't met.
    49  type TcpProtocolOptionsValidationError struct {
    50  	field  string
    51  	reason string
    52  	cause  error
    53  	key    bool
    54  }
    55  
    56  // Field function returns field value.
    57  func (e TcpProtocolOptionsValidationError) Field() string { return e.field }
    58  
    59  // Reason function returns reason value.
    60  func (e TcpProtocolOptionsValidationError) Reason() string { return e.reason }
    61  
    62  // Cause function returns cause value.
    63  func (e TcpProtocolOptionsValidationError) Cause() error { return e.cause }
    64  
    65  // Key function returns key value.
    66  func (e TcpProtocolOptionsValidationError) Key() bool { return e.key }
    67  
    68  // ErrorName returns error name.
    69  func (e TcpProtocolOptionsValidationError) ErrorName() string {
    70  	return "TcpProtocolOptionsValidationError"
    71  }
    72  
    73  // Error satisfies the builtin error interface
    74  func (e TcpProtocolOptionsValidationError) Error() string {
    75  	cause := ""
    76  	if e.cause != nil {
    77  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
    78  	}
    79  
    80  	key := ""
    81  	if e.key {
    82  		key = "key for "
    83  	}
    84  
    85  	return fmt.Sprintf(
    86  		"invalid %sTcpProtocolOptions.%s: %s%s",
    87  		key,
    88  		e.field,
    89  		e.reason,
    90  		cause)
    91  }
    92  
    93  var _ error = TcpProtocolOptionsValidationError{}
    94  
    95  var _ interface {
    96  	Field() string
    97  	Reason() string
    98  	Key() bool
    99  	Cause() error
   100  	ErrorName() string
   101  } = TcpProtocolOptionsValidationError{}
   102  
   103  // Validate checks the field values on UpstreamHttpProtocolOptions with the
   104  // rules defined in the proto definition for this message. If any rules are
   105  // violated, an error is returned.
   106  func (m *UpstreamHttpProtocolOptions) Validate() error {
   107  	if m == nil {
   108  		return nil
   109  	}
   110  
   111  	// no validation rules for AutoSni
   112  
   113  	// no validation rules for AutoSanValidation
   114  
   115  	return nil
   116  }
   117  
   118  // UpstreamHttpProtocolOptionsValidationError is the validation error returned
   119  // by UpstreamHttpProtocolOptions.Validate if the designated constraints
   120  // aren't met.
   121  type UpstreamHttpProtocolOptionsValidationError struct {
   122  	field  string
   123  	reason string
   124  	cause  error
   125  	key    bool
   126  }
   127  
   128  // Field function returns field value.
   129  func (e UpstreamHttpProtocolOptionsValidationError) Field() string { return e.field }
   130  
   131  // Reason function returns reason value.
   132  func (e UpstreamHttpProtocolOptionsValidationError) Reason() string { return e.reason }
   133  
   134  // Cause function returns cause value.
   135  func (e UpstreamHttpProtocolOptionsValidationError) Cause() error { return e.cause }
   136  
   137  // Key function returns key value.
   138  func (e UpstreamHttpProtocolOptionsValidationError) Key() bool { return e.key }
   139  
   140  // ErrorName returns error name.
   141  func (e UpstreamHttpProtocolOptionsValidationError) ErrorName() string {
   142  	return "UpstreamHttpProtocolOptionsValidationError"
   143  }
   144  
   145  // Error satisfies the builtin error interface
   146  func (e UpstreamHttpProtocolOptionsValidationError) Error() string {
   147  	cause := ""
   148  	if e.cause != nil {
   149  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   150  	}
   151  
   152  	key := ""
   153  	if e.key {
   154  		key = "key for "
   155  	}
   156  
   157  	return fmt.Sprintf(
   158  		"invalid %sUpstreamHttpProtocolOptions.%s: %s%s",
   159  		key,
   160  		e.field,
   161  		e.reason,
   162  		cause)
   163  }
   164  
   165  var _ error = UpstreamHttpProtocolOptionsValidationError{}
   166  
   167  var _ interface {
   168  	Field() string
   169  	Reason() string
   170  	Key() bool
   171  	Cause() error
   172  	ErrorName() string
   173  } = UpstreamHttpProtocolOptionsValidationError{}
   174  
   175  // Validate checks the field values on HttpProtocolOptions with the rules
   176  // defined in the proto definition for this message. If any rules are
   177  // violated, an error is returned.
   178  func (m *HttpProtocolOptions) Validate() error {
   179  	if m == nil {
   180  		return nil
   181  	}
   182  
   183  	if v, ok := interface{}(m.GetIdleTimeout()).(interface{ Validate() error }); ok {
   184  		if err := v.Validate(); err != nil {
   185  			return HttpProtocolOptionsValidationError{
   186  				field:  "IdleTimeout",
   187  				reason: "embedded message failed validation",
   188  				cause:  err,
   189  			}
   190  		}
   191  	}
   192  
   193  	if v, ok := interface{}(m.GetMaxConnectionDuration()).(interface{ Validate() error }); ok {
   194  		if err := v.Validate(); err != nil {
   195  			return HttpProtocolOptionsValidationError{
   196  				field:  "MaxConnectionDuration",
   197  				reason: "embedded message failed validation",
   198  				cause:  err,
   199  			}
   200  		}
   201  	}
   202  
   203  	if wrapper := m.GetMaxHeadersCount(); wrapper != nil {
   204  
   205  		if wrapper.GetValue() < 1 {
   206  			return HttpProtocolOptionsValidationError{
   207  				field:  "MaxHeadersCount",
   208  				reason: "value must be greater than or equal to 1",
   209  			}
   210  		}
   211  
   212  	}
   213  
   214  	if v, ok := interface{}(m.GetMaxStreamDuration()).(interface{ Validate() error }); ok {
   215  		if err := v.Validate(); err != nil {
   216  			return HttpProtocolOptionsValidationError{
   217  				field:  "MaxStreamDuration",
   218  				reason: "embedded message failed validation",
   219  				cause:  err,
   220  			}
   221  		}
   222  	}
   223  
   224  	// no validation rules for HeadersWithUnderscoresAction
   225  
   226  	return nil
   227  }
   228  
   229  // HttpProtocolOptionsValidationError is the validation error returned by
   230  // HttpProtocolOptions.Validate if the designated constraints aren't met.
   231  type HttpProtocolOptionsValidationError struct {
   232  	field  string
   233  	reason string
   234  	cause  error
   235  	key    bool
   236  }
   237  
   238  // Field function returns field value.
   239  func (e HttpProtocolOptionsValidationError) Field() string { return e.field }
   240  
   241  // Reason function returns reason value.
   242  func (e HttpProtocolOptionsValidationError) Reason() string { return e.reason }
   243  
   244  // Cause function returns cause value.
   245  func (e HttpProtocolOptionsValidationError) Cause() error { return e.cause }
   246  
   247  // Key function returns key value.
   248  func (e HttpProtocolOptionsValidationError) Key() bool { return e.key }
   249  
   250  // ErrorName returns error name.
   251  func (e HttpProtocolOptionsValidationError) ErrorName() string {
   252  	return "HttpProtocolOptionsValidationError"
   253  }
   254  
   255  // Error satisfies the builtin error interface
   256  func (e HttpProtocolOptionsValidationError) Error() string {
   257  	cause := ""
   258  	if e.cause != nil {
   259  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   260  	}
   261  
   262  	key := ""
   263  	if e.key {
   264  		key = "key for "
   265  	}
   266  
   267  	return fmt.Sprintf(
   268  		"invalid %sHttpProtocolOptions.%s: %s%s",
   269  		key,
   270  		e.field,
   271  		e.reason,
   272  		cause)
   273  }
   274  
   275  var _ error = HttpProtocolOptionsValidationError{}
   276  
   277  var _ interface {
   278  	Field() string
   279  	Reason() string
   280  	Key() bool
   281  	Cause() error
   282  	ErrorName() string
   283  } = HttpProtocolOptionsValidationError{}
   284  
   285  // Validate checks the field values on Http1ProtocolOptions with the rules
   286  // defined in the proto definition for this message. If any rules are
   287  // violated, an error is returned.
   288  func (m *Http1ProtocolOptions) Validate() error {
   289  	if m == nil {
   290  		return nil
   291  	}
   292  
   293  	if v, ok := interface{}(m.GetAllowAbsoluteUrl()).(interface{ Validate() error }); ok {
   294  		if err := v.Validate(); err != nil {
   295  			return Http1ProtocolOptionsValidationError{
   296  				field:  "AllowAbsoluteUrl",
   297  				reason: "embedded message failed validation",
   298  				cause:  err,
   299  			}
   300  		}
   301  	}
   302  
   303  	// no validation rules for AcceptHttp_10
   304  
   305  	// no validation rules for DefaultHostForHttp_10
   306  
   307  	if v, ok := interface{}(m.GetHeaderKeyFormat()).(interface{ Validate() error }); ok {
   308  		if err := v.Validate(); err != nil {
   309  			return Http1ProtocolOptionsValidationError{
   310  				field:  "HeaderKeyFormat",
   311  				reason: "embedded message failed validation",
   312  				cause:  err,
   313  			}
   314  		}
   315  	}
   316  
   317  	// no validation rules for EnableTrailers
   318  
   319  	return nil
   320  }
   321  
   322  // Http1ProtocolOptionsValidationError is the validation error returned by
   323  // Http1ProtocolOptions.Validate if the designated constraints aren't met.
   324  type Http1ProtocolOptionsValidationError struct {
   325  	field  string
   326  	reason string
   327  	cause  error
   328  	key    bool
   329  }
   330  
   331  // Field function returns field value.
   332  func (e Http1ProtocolOptionsValidationError) Field() string { return e.field }
   333  
   334  // Reason function returns reason value.
   335  func (e Http1ProtocolOptionsValidationError) Reason() string { return e.reason }
   336  
   337  // Cause function returns cause value.
   338  func (e Http1ProtocolOptionsValidationError) Cause() error { return e.cause }
   339  
   340  // Key function returns key value.
   341  func (e Http1ProtocolOptionsValidationError) Key() bool { return e.key }
   342  
   343  // ErrorName returns error name.
   344  func (e Http1ProtocolOptionsValidationError) ErrorName() string {
   345  	return "Http1ProtocolOptionsValidationError"
   346  }
   347  
   348  // Error satisfies the builtin error interface
   349  func (e Http1ProtocolOptionsValidationError) Error() string {
   350  	cause := ""
   351  	if e.cause != nil {
   352  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   353  	}
   354  
   355  	key := ""
   356  	if e.key {
   357  		key = "key for "
   358  	}
   359  
   360  	return fmt.Sprintf(
   361  		"invalid %sHttp1ProtocolOptions.%s: %s%s",
   362  		key,
   363  		e.field,
   364  		e.reason,
   365  		cause)
   366  }
   367  
   368  var _ error = Http1ProtocolOptionsValidationError{}
   369  
   370  var _ interface {
   371  	Field() string
   372  	Reason() string
   373  	Key() bool
   374  	Cause() error
   375  	ErrorName() string
   376  } = Http1ProtocolOptionsValidationError{}
   377  
   378  // Validate checks the field values on Http2ProtocolOptions with the rules
   379  // defined in the proto definition for this message. If any rules are
   380  // violated, an error is returned.
   381  func (m *Http2ProtocolOptions) Validate() error {
   382  	if m == nil {
   383  		return nil
   384  	}
   385  
   386  	if v, ok := interface{}(m.GetHpackTableSize()).(interface{ Validate() error }); ok {
   387  		if err := v.Validate(); err != nil {
   388  			return Http2ProtocolOptionsValidationError{
   389  				field:  "HpackTableSize",
   390  				reason: "embedded message failed validation",
   391  				cause:  err,
   392  			}
   393  		}
   394  	}
   395  
   396  	if wrapper := m.GetMaxConcurrentStreams(); wrapper != nil {
   397  
   398  		if val := wrapper.GetValue(); val < 1 || val > 2147483647 {
   399  			return Http2ProtocolOptionsValidationError{
   400  				field:  "MaxConcurrentStreams",
   401  				reason: "value must be inside range [1, 2147483647]",
   402  			}
   403  		}
   404  
   405  	}
   406  
   407  	if wrapper := m.GetInitialStreamWindowSize(); wrapper != nil {
   408  
   409  		if val := wrapper.GetValue(); val < 65535 || val > 2147483647 {
   410  			return Http2ProtocolOptionsValidationError{
   411  				field:  "InitialStreamWindowSize",
   412  				reason: "value must be inside range [65535, 2147483647]",
   413  			}
   414  		}
   415  
   416  	}
   417  
   418  	if wrapper := m.GetInitialConnectionWindowSize(); wrapper != nil {
   419  
   420  		if val := wrapper.GetValue(); val < 65535 || val > 2147483647 {
   421  			return Http2ProtocolOptionsValidationError{
   422  				field:  "InitialConnectionWindowSize",
   423  				reason: "value must be inside range [65535, 2147483647]",
   424  			}
   425  		}
   426  
   427  	}
   428  
   429  	// no validation rules for AllowConnect
   430  
   431  	// no validation rules for AllowMetadata
   432  
   433  	if wrapper := m.GetMaxOutboundFrames(); wrapper != nil {
   434  
   435  		if wrapper.GetValue() < 1 {
   436  			return Http2ProtocolOptionsValidationError{
   437  				field:  "MaxOutboundFrames",
   438  				reason: "value must be greater than or equal to 1",
   439  			}
   440  		}
   441  
   442  	}
   443  
   444  	if wrapper := m.GetMaxOutboundControlFrames(); wrapper != nil {
   445  
   446  		if wrapper.GetValue() < 1 {
   447  			return Http2ProtocolOptionsValidationError{
   448  				field:  "MaxOutboundControlFrames",
   449  				reason: "value must be greater than or equal to 1",
   450  			}
   451  		}
   452  
   453  	}
   454  
   455  	if v, ok := interface{}(m.GetMaxConsecutiveInboundFramesWithEmptyPayload()).(interface{ Validate() error }); ok {
   456  		if err := v.Validate(); err != nil {
   457  			return Http2ProtocolOptionsValidationError{
   458  				field:  "MaxConsecutiveInboundFramesWithEmptyPayload",
   459  				reason: "embedded message failed validation",
   460  				cause:  err,
   461  			}
   462  		}
   463  	}
   464  
   465  	if v, ok := interface{}(m.GetMaxInboundPriorityFramesPerStream()).(interface{ Validate() error }); ok {
   466  		if err := v.Validate(); err != nil {
   467  			return Http2ProtocolOptionsValidationError{
   468  				field:  "MaxInboundPriorityFramesPerStream",
   469  				reason: "embedded message failed validation",
   470  				cause:  err,
   471  			}
   472  		}
   473  	}
   474  
   475  	if wrapper := m.GetMaxInboundWindowUpdateFramesPerDataFrameSent(); wrapper != nil {
   476  
   477  		if wrapper.GetValue() < 1 {
   478  			return Http2ProtocolOptionsValidationError{
   479  				field:  "MaxInboundWindowUpdateFramesPerDataFrameSent",
   480  				reason: "value must be greater than or equal to 1",
   481  			}
   482  		}
   483  
   484  	}
   485  
   486  	// no validation rules for StreamErrorOnInvalidHttpMessaging
   487  
   488  	for idx, item := range m.GetCustomSettingsParameters() {
   489  		_, _ = idx, item
   490  
   491  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
   492  			if err := v.Validate(); err != nil {
   493  				return Http2ProtocolOptionsValidationError{
   494  					field:  fmt.Sprintf("CustomSettingsParameters[%v]", idx),
   495  					reason: "embedded message failed validation",
   496  					cause:  err,
   497  				}
   498  			}
   499  		}
   500  
   501  	}
   502  
   503  	return nil
   504  }
   505  
   506  // Http2ProtocolOptionsValidationError is the validation error returned by
   507  // Http2ProtocolOptions.Validate if the designated constraints aren't met.
   508  type Http2ProtocolOptionsValidationError struct {
   509  	field  string
   510  	reason string
   511  	cause  error
   512  	key    bool
   513  }
   514  
   515  // Field function returns field value.
   516  func (e Http2ProtocolOptionsValidationError) Field() string { return e.field }
   517  
   518  // Reason function returns reason value.
   519  func (e Http2ProtocolOptionsValidationError) Reason() string { return e.reason }
   520  
   521  // Cause function returns cause value.
   522  func (e Http2ProtocolOptionsValidationError) Cause() error { return e.cause }
   523  
   524  // Key function returns key value.
   525  func (e Http2ProtocolOptionsValidationError) Key() bool { return e.key }
   526  
   527  // ErrorName returns error name.
   528  func (e Http2ProtocolOptionsValidationError) ErrorName() string {
   529  	return "Http2ProtocolOptionsValidationError"
   530  }
   531  
   532  // Error satisfies the builtin error interface
   533  func (e Http2ProtocolOptionsValidationError) Error() string {
   534  	cause := ""
   535  	if e.cause != nil {
   536  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   537  	}
   538  
   539  	key := ""
   540  	if e.key {
   541  		key = "key for "
   542  	}
   543  
   544  	return fmt.Sprintf(
   545  		"invalid %sHttp2ProtocolOptions.%s: %s%s",
   546  		key,
   547  		e.field,
   548  		e.reason,
   549  		cause)
   550  }
   551  
   552  var _ error = Http2ProtocolOptionsValidationError{}
   553  
   554  var _ interface {
   555  	Field() string
   556  	Reason() string
   557  	Key() bool
   558  	Cause() error
   559  	ErrorName() string
   560  } = Http2ProtocolOptionsValidationError{}
   561  
   562  // Validate checks the field values on GrpcProtocolOptions with the rules
   563  // defined in the proto definition for this message. If any rules are
   564  // violated, an error is returned.
   565  func (m *GrpcProtocolOptions) Validate() error {
   566  	if m == nil {
   567  		return nil
   568  	}
   569  
   570  	if v, ok := interface{}(m.GetHttp2ProtocolOptions()).(interface{ Validate() error }); ok {
   571  		if err := v.Validate(); err != nil {
   572  			return GrpcProtocolOptionsValidationError{
   573  				field:  "Http2ProtocolOptions",
   574  				reason: "embedded message failed validation",
   575  				cause:  err,
   576  			}
   577  		}
   578  	}
   579  
   580  	return nil
   581  }
   582  
   583  // GrpcProtocolOptionsValidationError is the validation error returned by
   584  // GrpcProtocolOptions.Validate if the designated constraints aren't met.
   585  type GrpcProtocolOptionsValidationError struct {
   586  	field  string
   587  	reason string
   588  	cause  error
   589  	key    bool
   590  }
   591  
   592  // Field function returns field value.
   593  func (e GrpcProtocolOptionsValidationError) Field() string { return e.field }
   594  
   595  // Reason function returns reason value.
   596  func (e GrpcProtocolOptionsValidationError) Reason() string { return e.reason }
   597  
   598  // Cause function returns cause value.
   599  func (e GrpcProtocolOptionsValidationError) Cause() error { return e.cause }
   600  
   601  // Key function returns key value.
   602  func (e GrpcProtocolOptionsValidationError) Key() bool { return e.key }
   603  
   604  // ErrorName returns error name.
   605  func (e GrpcProtocolOptionsValidationError) ErrorName() string {
   606  	return "GrpcProtocolOptionsValidationError"
   607  }
   608  
   609  // Error satisfies the builtin error interface
   610  func (e GrpcProtocolOptionsValidationError) Error() string {
   611  	cause := ""
   612  	if e.cause != nil {
   613  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   614  	}
   615  
   616  	key := ""
   617  	if e.key {
   618  		key = "key for "
   619  	}
   620  
   621  	return fmt.Sprintf(
   622  		"invalid %sGrpcProtocolOptions.%s: %s%s",
   623  		key,
   624  		e.field,
   625  		e.reason,
   626  		cause)
   627  }
   628  
   629  var _ error = GrpcProtocolOptionsValidationError{}
   630  
   631  var _ interface {
   632  	Field() string
   633  	Reason() string
   634  	Key() bool
   635  	Cause() error
   636  	ErrorName() string
   637  } = GrpcProtocolOptionsValidationError{}
   638  
   639  // Validate checks the field values on Http1ProtocolOptions_HeaderKeyFormat
   640  // with the rules defined in the proto definition for this message. If any
   641  // rules are violated, an error is returned.
   642  func (m *Http1ProtocolOptions_HeaderKeyFormat) Validate() error {
   643  	if m == nil {
   644  		return nil
   645  	}
   646  
   647  	switch m.HeaderFormat.(type) {
   648  
   649  	case *Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_:
   650  
   651  		if v, ok := interface{}(m.GetProperCaseWords()).(interface{ Validate() error }); ok {
   652  			if err := v.Validate(); err != nil {
   653  				return Http1ProtocolOptions_HeaderKeyFormatValidationError{
   654  					field:  "ProperCaseWords",
   655  					reason: "embedded message failed validation",
   656  					cause:  err,
   657  				}
   658  			}
   659  		}
   660  
   661  	default:
   662  		return Http1ProtocolOptions_HeaderKeyFormatValidationError{
   663  			field:  "HeaderFormat",
   664  			reason: "value is required",
   665  		}
   666  
   667  	}
   668  
   669  	return nil
   670  }
   671  
   672  // Http1ProtocolOptions_HeaderKeyFormatValidationError is the validation error
   673  // returned by Http1ProtocolOptions_HeaderKeyFormat.Validate if the designated
   674  // constraints aren't met.
   675  type Http1ProtocolOptions_HeaderKeyFormatValidationError struct {
   676  	field  string
   677  	reason string
   678  	cause  error
   679  	key    bool
   680  }
   681  
   682  // Field function returns field value.
   683  func (e Http1ProtocolOptions_HeaderKeyFormatValidationError) Field() string { return e.field }
   684  
   685  // Reason function returns reason value.
   686  func (e Http1ProtocolOptions_HeaderKeyFormatValidationError) Reason() string { return e.reason }
   687  
   688  // Cause function returns cause value.
   689  func (e Http1ProtocolOptions_HeaderKeyFormatValidationError) Cause() error { return e.cause }
   690  
   691  // Key function returns key value.
   692  func (e Http1ProtocolOptions_HeaderKeyFormatValidationError) Key() bool { return e.key }
   693  
   694  // ErrorName returns error name.
   695  func (e Http1ProtocolOptions_HeaderKeyFormatValidationError) ErrorName() string {
   696  	return "Http1ProtocolOptions_HeaderKeyFormatValidationError"
   697  }
   698  
   699  // Error satisfies the builtin error interface
   700  func (e Http1ProtocolOptions_HeaderKeyFormatValidationError) Error() string {
   701  	cause := ""
   702  	if e.cause != nil {
   703  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   704  	}
   705  
   706  	key := ""
   707  	if e.key {
   708  		key = "key for "
   709  	}
   710  
   711  	return fmt.Sprintf(
   712  		"invalid %sHttp1ProtocolOptions_HeaderKeyFormat.%s: %s%s",
   713  		key,
   714  		e.field,
   715  		e.reason,
   716  		cause)
   717  }
   718  
   719  var _ error = Http1ProtocolOptions_HeaderKeyFormatValidationError{}
   720  
   721  var _ interface {
   722  	Field() string
   723  	Reason() string
   724  	Key() bool
   725  	Cause() error
   726  	ErrorName() string
   727  } = Http1ProtocolOptions_HeaderKeyFormatValidationError{}
   728  
   729  // Validate checks the field values on
   730  // Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords with the rules defined
   731  // in the proto definition for this message. If any rules are violated, an
   732  // error is returned.
   733  func (m *Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords) Validate() error {
   734  	if m == nil {
   735  		return nil
   736  	}
   737  
   738  	return nil
   739  }
   740  
   741  // Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError is the
   742  // validation error returned by
   743  // Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords.Validate if the
   744  // designated constraints aren't met.
   745  type Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError struct {
   746  	field  string
   747  	reason string
   748  	cause  error
   749  	key    bool
   750  }
   751  
   752  // Field function returns field value.
   753  func (e Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError) Field() string {
   754  	return e.field
   755  }
   756  
   757  // Reason function returns reason value.
   758  func (e Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError) Reason() string {
   759  	return e.reason
   760  }
   761  
   762  // Cause function returns cause value.
   763  func (e Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError) Cause() error {
   764  	return e.cause
   765  }
   766  
   767  // Key function returns key value.
   768  func (e Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError) Key() bool { return e.key }
   769  
   770  // ErrorName returns error name.
   771  func (e Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError) ErrorName() string {
   772  	return "Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError"
   773  }
   774  
   775  // Error satisfies the builtin error interface
   776  func (e Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError) Error() string {
   777  	cause := ""
   778  	if e.cause != nil {
   779  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   780  	}
   781  
   782  	key := ""
   783  	if e.key {
   784  		key = "key for "
   785  	}
   786  
   787  	return fmt.Sprintf(
   788  		"invalid %sHttp1ProtocolOptions_HeaderKeyFormat_ProperCaseWords.%s: %s%s",
   789  		key,
   790  		e.field,
   791  		e.reason,
   792  		cause)
   793  }
   794  
   795  var _ error = Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError{}
   796  
   797  var _ interface {
   798  	Field() string
   799  	Reason() string
   800  	Key() bool
   801  	Cause() error
   802  	ErrorName() string
   803  } = Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError{}
   804  
   805  // Validate checks the field values on Http2ProtocolOptions_SettingsParameter
   806  // with the rules defined in the proto definition for this message. If any
   807  // rules are violated, an error is returned.
   808  func (m *Http2ProtocolOptions_SettingsParameter) Validate() error {
   809  	if m == nil {
   810  		return nil
   811  	}
   812  
   813  	if wrapper := m.GetIdentifier(); wrapper != nil {
   814  
   815  		if val := wrapper.GetValue(); val < 1 || val > 65536 {
   816  			return Http2ProtocolOptions_SettingsParameterValidationError{
   817  				field:  "Identifier",
   818  				reason: "value must be inside range [1, 65536]",
   819  			}
   820  		}
   821  
   822  	} else {
   823  		return Http2ProtocolOptions_SettingsParameterValidationError{
   824  			field:  "Identifier",
   825  			reason: "value is required and must not be nil.",
   826  		}
   827  	}
   828  
   829  	if m.GetValue() == nil {
   830  		return Http2ProtocolOptions_SettingsParameterValidationError{
   831  			field:  "Value",
   832  			reason: "value is required",
   833  		}
   834  	}
   835  
   836  	if v, ok := interface{}(m.GetValue()).(interface{ Validate() error }); ok {
   837  		if err := v.Validate(); err != nil {
   838  			return Http2ProtocolOptions_SettingsParameterValidationError{
   839  				field:  "Value",
   840  				reason: "embedded message failed validation",
   841  				cause:  err,
   842  			}
   843  		}
   844  	}
   845  
   846  	return nil
   847  }
   848  
   849  // Http2ProtocolOptions_SettingsParameterValidationError is the validation
   850  // error returned by Http2ProtocolOptions_SettingsParameter.Validate if the
   851  // designated constraints aren't met.
   852  type Http2ProtocolOptions_SettingsParameterValidationError struct {
   853  	field  string
   854  	reason string
   855  	cause  error
   856  	key    bool
   857  }
   858  
   859  // Field function returns field value.
   860  func (e Http2ProtocolOptions_SettingsParameterValidationError) Field() string { return e.field }
   861  
   862  // Reason function returns reason value.
   863  func (e Http2ProtocolOptions_SettingsParameterValidationError) Reason() string { return e.reason }
   864  
   865  // Cause function returns cause value.
   866  func (e Http2ProtocolOptions_SettingsParameterValidationError) Cause() error { return e.cause }
   867  
   868  // Key function returns key value.
   869  func (e Http2ProtocolOptions_SettingsParameterValidationError) Key() bool { return e.key }
   870  
   871  // ErrorName returns error name.
   872  func (e Http2ProtocolOptions_SettingsParameterValidationError) ErrorName() string {
   873  	return "Http2ProtocolOptions_SettingsParameterValidationError"
   874  }
   875  
   876  // Error satisfies the builtin error interface
   877  func (e Http2ProtocolOptions_SettingsParameterValidationError) Error() string {
   878  	cause := ""
   879  	if e.cause != nil {
   880  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   881  	}
   882  
   883  	key := ""
   884  	if e.key {
   885  		key = "key for "
   886  	}
   887  
   888  	return fmt.Sprintf(
   889  		"invalid %sHttp2ProtocolOptions_SettingsParameter.%s: %s%s",
   890  		key,
   891  		e.field,
   892  		e.reason,
   893  		cause)
   894  }
   895  
   896  var _ error = Http2ProtocolOptions_SettingsParameterValidationError{}
   897  
   898  var _ interface {
   899  	Field() string
   900  	Reason() string
   901  	Key() bool
   902  	Cause() error
   903  	ErrorName() string
   904  } = Http2ProtocolOptions_SettingsParameterValidationError{}