...

Source file src/github.com/datawire/ambassador/v2/pkg/api/envoy/data/accesslog/v3/accesslog.pb.validate.go

Documentation: github.com/datawire/ambassador/v2/pkg/api/envoy/data/accesslog/v3

     1  // Code generated by protoc-gen-validate. DO NOT EDIT.
     2  // source: envoy/data/accesslog/v3/accesslog.proto
     3  
     4  package envoy_data_accesslog_v3
     5  
     6  import (
     7  	"bytes"
     8  	"errors"
     9  	"fmt"
    10  	"net"
    11  	"net/mail"
    12  	"net/url"
    13  	"regexp"
    14  	"strings"
    15  	"time"
    16  	"unicode/utf8"
    17  
    18  	"github.com/golang/protobuf/ptypes"
    19  
    20  	v3 "github.com/datawire/ambassador/v2/pkg/api/envoy/config/core/v3"
    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  	_ = ptypes.DynamicAny{}
    36  
    37  	_ = v3.RequestMethod(0)
    38  )
    39  
    40  // Validate checks the field values on TCPAccessLogEntry with the rules defined
    41  // in the proto definition for this message. If any rules are violated, an
    42  // error is returned.
    43  func (m *TCPAccessLogEntry) Validate() error {
    44  	if m == nil {
    45  		return nil
    46  	}
    47  
    48  	if v, ok := interface{}(m.GetCommonProperties()).(interface{ Validate() error }); ok {
    49  		if err := v.Validate(); err != nil {
    50  			return TCPAccessLogEntryValidationError{
    51  				field:  "CommonProperties",
    52  				reason: "embedded message failed validation",
    53  				cause:  err,
    54  			}
    55  		}
    56  	}
    57  
    58  	if v, ok := interface{}(m.GetConnectionProperties()).(interface{ Validate() error }); ok {
    59  		if err := v.Validate(); err != nil {
    60  			return TCPAccessLogEntryValidationError{
    61  				field:  "ConnectionProperties",
    62  				reason: "embedded message failed validation",
    63  				cause:  err,
    64  			}
    65  		}
    66  	}
    67  
    68  	return nil
    69  }
    70  
    71  // TCPAccessLogEntryValidationError is the validation error returned by
    72  // TCPAccessLogEntry.Validate if the designated constraints aren't met.
    73  type TCPAccessLogEntryValidationError struct {
    74  	field  string
    75  	reason string
    76  	cause  error
    77  	key    bool
    78  }
    79  
    80  // Field function returns field value.
    81  func (e TCPAccessLogEntryValidationError) Field() string { return e.field }
    82  
    83  // Reason function returns reason value.
    84  func (e TCPAccessLogEntryValidationError) Reason() string { return e.reason }
    85  
    86  // Cause function returns cause value.
    87  func (e TCPAccessLogEntryValidationError) Cause() error { return e.cause }
    88  
    89  // Key function returns key value.
    90  func (e TCPAccessLogEntryValidationError) Key() bool { return e.key }
    91  
    92  // ErrorName returns error name.
    93  func (e TCPAccessLogEntryValidationError) ErrorName() string {
    94  	return "TCPAccessLogEntryValidationError"
    95  }
    96  
    97  // Error satisfies the builtin error interface
    98  func (e TCPAccessLogEntryValidationError) Error() string {
    99  	cause := ""
   100  	if e.cause != nil {
   101  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   102  	}
   103  
   104  	key := ""
   105  	if e.key {
   106  		key = "key for "
   107  	}
   108  
   109  	return fmt.Sprintf(
   110  		"invalid %sTCPAccessLogEntry.%s: %s%s",
   111  		key,
   112  		e.field,
   113  		e.reason,
   114  		cause)
   115  }
   116  
   117  var _ error = TCPAccessLogEntryValidationError{}
   118  
   119  var _ interface {
   120  	Field() string
   121  	Reason() string
   122  	Key() bool
   123  	Cause() error
   124  	ErrorName() string
   125  } = TCPAccessLogEntryValidationError{}
   126  
   127  // Validate checks the field values on HTTPAccessLogEntry with the rules
   128  // defined in the proto definition for this message. If any rules are
   129  // violated, an error is returned.
   130  func (m *HTTPAccessLogEntry) Validate() error {
   131  	if m == nil {
   132  		return nil
   133  	}
   134  
   135  	if v, ok := interface{}(m.GetCommonProperties()).(interface{ Validate() error }); ok {
   136  		if err := v.Validate(); err != nil {
   137  			return HTTPAccessLogEntryValidationError{
   138  				field:  "CommonProperties",
   139  				reason: "embedded message failed validation",
   140  				cause:  err,
   141  			}
   142  		}
   143  	}
   144  
   145  	// no validation rules for ProtocolVersion
   146  
   147  	if v, ok := interface{}(m.GetRequest()).(interface{ Validate() error }); ok {
   148  		if err := v.Validate(); err != nil {
   149  			return HTTPAccessLogEntryValidationError{
   150  				field:  "Request",
   151  				reason: "embedded message failed validation",
   152  				cause:  err,
   153  			}
   154  		}
   155  	}
   156  
   157  	if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok {
   158  		if err := v.Validate(); err != nil {
   159  			return HTTPAccessLogEntryValidationError{
   160  				field:  "Response",
   161  				reason: "embedded message failed validation",
   162  				cause:  err,
   163  			}
   164  		}
   165  	}
   166  
   167  	return nil
   168  }
   169  
   170  // HTTPAccessLogEntryValidationError is the validation error returned by
   171  // HTTPAccessLogEntry.Validate if the designated constraints aren't met.
   172  type HTTPAccessLogEntryValidationError struct {
   173  	field  string
   174  	reason string
   175  	cause  error
   176  	key    bool
   177  }
   178  
   179  // Field function returns field value.
   180  func (e HTTPAccessLogEntryValidationError) Field() string { return e.field }
   181  
   182  // Reason function returns reason value.
   183  func (e HTTPAccessLogEntryValidationError) Reason() string { return e.reason }
   184  
   185  // Cause function returns cause value.
   186  func (e HTTPAccessLogEntryValidationError) Cause() error { return e.cause }
   187  
   188  // Key function returns key value.
   189  func (e HTTPAccessLogEntryValidationError) Key() bool { return e.key }
   190  
   191  // ErrorName returns error name.
   192  func (e HTTPAccessLogEntryValidationError) ErrorName() string {
   193  	return "HTTPAccessLogEntryValidationError"
   194  }
   195  
   196  // Error satisfies the builtin error interface
   197  func (e HTTPAccessLogEntryValidationError) Error() string {
   198  	cause := ""
   199  	if e.cause != nil {
   200  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   201  	}
   202  
   203  	key := ""
   204  	if e.key {
   205  		key = "key for "
   206  	}
   207  
   208  	return fmt.Sprintf(
   209  		"invalid %sHTTPAccessLogEntry.%s: %s%s",
   210  		key,
   211  		e.field,
   212  		e.reason,
   213  		cause)
   214  }
   215  
   216  var _ error = HTTPAccessLogEntryValidationError{}
   217  
   218  var _ interface {
   219  	Field() string
   220  	Reason() string
   221  	Key() bool
   222  	Cause() error
   223  	ErrorName() string
   224  } = HTTPAccessLogEntryValidationError{}
   225  
   226  // Validate checks the field values on ConnectionProperties with the rules
   227  // defined in the proto definition for this message. If any rules are
   228  // violated, an error is returned.
   229  func (m *ConnectionProperties) Validate() error {
   230  	if m == nil {
   231  		return nil
   232  	}
   233  
   234  	// no validation rules for ReceivedBytes
   235  
   236  	// no validation rules for SentBytes
   237  
   238  	return nil
   239  }
   240  
   241  // ConnectionPropertiesValidationError is the validation error returned by
   242  // ConnectionProperties.Validate if the designated constraints aren't met.
   243  type ConnectionPropertiesValidationError struct {
   244  	field  string
   245  	reason string
   246  	cause  error
   247  	key    bool
   248  }
   249  
   250  // Field function returns field value.
   251  func (e ConnectionPropertiesValidationError) Field() string { return e.field }
   252  
   253  // Reason function returns reason value.
   254  func (e ConnectionPropertiesValidationError) Reason() string { return e.reason }
   255  
   256  // Cause function returns cause value.
   257  func (e ConnectionPropertiesValidationError) Cause() error { return e.cause }
   258  
   259  // Key function returns key value.
   260  func (e ConnectionPropertiesValidationError) Key() bool { return e.key }
   261  
   262  // ErrorName returns error name.
   263  func (e ConnectionPropertiesValidationError) ErrorName() string {
   264  	return "ConnectionPropertiesValidationError"
   265  }
   266  
   267  // Error satisfies the builtin error interface
   268  func (e ConnectionPropertiesValidationError) Error() string {
   269  	cause := ""
   270  	if e.cause != nil {
   271  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   272  	}
   273  
   274  	key := ""
   275  	if e.key {
   276  		key = "key for "
   277  	}
   278  
   279  	return fmt.Sprintf(
   280  		"invalid %sConnectionProperties.%s: %s%s",
   281  		key,
   282  		e.field,
   283  		e.reason,
   284  		cause)
   285  }
   286  
   287  var _ error = ConnectionPropertiesValidationError{}
   288  
   289  var _ interface {
   290  	Field() string
   291  	Reason() string
   292  	Key() bool
   293  	Cause() error
   294  	ErrorName() string
   295  } = ConnectionPropertiesValidationError{}
   296  
   297  // Validate checks the field values on AccessLogCommon with the rules defined
   298  // in the proto definition for this message. If any rules are violated, an
   299  // error is returned.
   300  func (m *AccessLogCommon) Validate() error {
   301  	if m == nil {
   302  		return nil
   303  	}
   304  
   305  	if val := m.GetSampleRate(); val <= 0 || val > 1 {
   306  		return AccessLogCommonValidationError{
   307  			field:  "SampleRate",
   308  			reason: "value must be inside range (0, 1]",
   309  		}
   310  	}
   311  
   312  	if v, ok := interface{}(m.GetDownstreamRemoteAddress()).(interface{ Validate() error }); ok {
   313  		if err := v.Validate(); err != nil {
   314  			return AccessLogCommonValidationError{
   315  				field:  "DownstreamRemoteAddress",
   316  				reason: "embedded message failed validation",
   317  				cause:  err,
   318  			}
   319  		}
   320  	}
   321  
   322  	if v, ok := interface{}(m.GetDownstreamLocalAddress()).(interface{ Validate() error }); ok {
   323  		if err := v.Validate(); err != nil {
   324  			return AccessLogCommonValidationError{
   325  				field:  "DownstreamLocalAddress",
   326  				reason: "embedded message failed validation",
   327  				cause:  err,
   328  			}
   329  		}
   330  	}
   331  
   332  	if v, ok := interface{}(m.GetTlsProperties()).(interface{ Validate() error }); ok {
   333  		if err := v.Validate(); err != nil {
   334  			return AccessLogCommonValidationError{
   335  				field:  "TlsProperties",
   336  				reason: "embedded message failed validation",
   337  				cause:  err,
   338  			}
   339  		}
   340  	}
   341  
   342  	if v, ok := interface{}(m.GetStartTime()).(interface{ Validate() error }); ok {
   343  		if err := v.Validate(); err != nil {
   344  			return AccessLogCommonValidationError{
   345  				field:  "StartTime",
   346  				reason: "embedded message failed validation",
   347  				cause:  err,
   348  			}
   349  		}
   350  	}
   351  
   352  	if v, ok := interface{}(m.GetTimeToLastRxByte()).(interface{ Validate() error }); ok {
   353  		if err := v.Validate(); err != nil {
   354  			return AccessLogCommonValidationError{
   355  				field:  "TimeToLastRxByte",
   356  				reason: "embedded message failed validation",
   357  				cause:  err,
   358  			}
   359  		}
   360  	}
   361  
   362  	if v, ok := interface{}(m.GetTimeToFirstUpstreamTxByte()).(interface{ Validate() error }); ok {
   363  		if err := v.Validate(); err != nil {
   364  			return AccessLogCommonValidationError{
   365  				field:  "TimeToFirstUpstreamTxByte",
   366  				reason: "embedded message failed validation",
   367  				cause:  err,
   368  			}
   369  		}
   370  	}
   371  
   372  	if v, ok := interface{}(m.GetTimeToLastUpstreamTxByte()).(interface{ Validate() error }); ok {
   373  		if err := v.Validate(); err != nil {
   374  			return AccessLogCommonValidationError{
   375  				field:  "TimeToLastUpstreamTxByte",
   376  				reason: "embedded message failed validation",
   377  				cause:  err,
   378  			}
   379  		}
   380  	}
   381  
   382  	if v, ok := interface{}(m.GetTimeToFirstUpstreamRxByte()).(interface{ Validate() error }); ok {
   383  		if err := v.Validate(); err != nil {
   384  			return AccessLogCommonValidationError{
   385  				field:  "TimeToFirstUpstreamRxByte",
   386  				reason: "embedded message failed validation",
   387  				cause:  err,
   388  			}
   389  		}
   390  	}
   391  
   392  	if v, ok := interface{}(m.GetTimeToLastUpstreamRxByte()).(interface{ Validate() error }); ok {
   393  		if err := v.Validate(); err != nil {
   394  			return AccessLogCommonValidationError{
   395  				field:  "TimeToLastUpstreamRxByte",
   396  				reason: "embedded message failed validation",
   397  				cause:  err,
   398  			}
   399  		}
   400  	}
   401  
   402  	if v, ok := interface{}(m.GetTimeToFirstDownstreamTxByte()).(interface{ Validate() error }); ok {
   403  		if err := v.Validate(); err != nil {
   404  			return AccessLogCommonValidationError{
   405  				field:  "TimeToFirstDownstreamTxByte",
   406  				reason: "embedded message failed validation",
   407  				cause:  err,
   408  			}
   409  		}
   410  	}
   411  
   412  	if v, ok := interface{}(m.GetTimeToLastDownstreamTxByte()).(interface{ Validate() error }); ok {
   413  		if err := v.Validate(); err != nil {
   414  			return AccessLogCommonValidationError{
   415  				field:  "TimeToLastDownstreamTxByte",
   416  				reason: "embedded message failed validation",
   417  				cause:  err,
   418  			}
   419  		}
   420  	}
   421  
   422  	if v, ok := interface{}(m.GetUpstreamRemoteAddress()).(interface{ Validate() error }); ok {
   423  		if err := v.Validate(); err != nil {
   424  			return AccessLogCommonValidationError{
   425  				field:  "UpstreamRemoteAddress",
   426  				reason: "embedded message failed validation",
   427  				cause:  err,
   428  			}
   429  		}
   430  	}
   431  
   432  	if v, ok := interface{}(m.GetUpstreamLocalAddress()).(interface{ Validate() error }); ok {
   433  		if err := v.Validate(); err != nil {
   434  			return AccessLogCommonValidationError{
   435  				field:  "UpstreamLocalAddress",
   436  				reason: "embedded message failed validation",
   437  				cause:  err,
   438  			}
   439  		}
   440  	}
   441  
   442  	// no validation rules for UpstreamCluster
   443  
   444  	if v, ok := interface{}(m.GetResponseFlags()).(interface{ Validate() error }); ok {
   445  		if err := v.Validate(); err != nil {
   446  			return AccessLogCommonValidationError{
   447  				field:  "ResponseFlags",
   448  				reason: "embedded message failed validation",
   449  				cause:  err,
   450  			}
   451  		}
   452  	}
   453  
   454  	if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
   455  		if err := v.Validate(); err != nil {
   456  			return AccessLogCommonValidationError{
   457  				field:  "Metadata",
   458  				reason: "embedded message failed validation",
   459  				cause:  err,
   460  			}
   461  		}
   462  	}
   463  
   464  	// no validation rules for UpstreamTransportFailureReason
   465  
   466  	// no validation rules for RouteName
   467  
   468  	if v, ok := interface{}(m.GetDownstreamDirectRemoteAddress()).(interface{ Validate() error }); ok {
   469  		if err := v.Validate(); err != nil {
   470  			return AccessLogCommonValidationError{
   471  				field:  "DownstreamDirectRemoteAddress",
   472  				reason: "embedded message failed validation",
   473  				cause:  err,
   474  			}
   475  		}
   476  	}
   477  
   478  	for key, val := range m.GetFilterStateObjects() {
   479  		_ = val
   480  
   481  		// no validation rules for FilterStateObjects[key]
   482  
   483  		if v, ok := interface{}(val).(interface{ Validate() error }); ok {
   484  			if err := v.Validate(); err != nil {
   485  				return AccessLogCommonValidationError{
   486  					field:  fmt.Sprintf("FilterStateObjects[%v]", key),
   487  					reason: "embedded message failed validation",
   488  					cause:  err,
   489  				}
   490  			}
   491  		}
   492  
   493  	}
   494  
   495  	return nil
   496  }
   497  
   498  // AccessLogCommonValidationError is the validation error returned by
   499  // AccessLogCommon.Validate if the designated constraints aren't met.
   500  type AccessLogCommonValidationError struct {
   501  	field  string
   502  	reason string
   503  	cause  error
   504  	key    bool
   505  }
   506  
   507  // Field function returns field value.
   508  func (e AccessLogCommonValidationError) Field() string { return e.field }
   509  
   510  // Reason function returns reason value.
   511  func (e AccessLogCommonValidationError) Reason() string { return e.reason }
   512  
   513  // Cause function returns cause value.
   514  func (e AccessLogCommonValidationError) Cause() error { return e.cause }
   515  
   516  // Key function returns key value.
   517  func (e AccessLogCommonValidationError) Key() bool { return e.key }
   518  
   519  // ErrorName returns error name.
   520  func (e AccessLogCommonValidationError) ErrorName() string { return "AccessLogCommonValidationError" }
   521  
   522  // Error satisfies the builtin error interface
   523  func (e AccessLogCommonValidationError) Error() string {
   524  	cause := ""
   525  	if e.cause != nil {
   526  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   527  	}
   528  
   529  	key := ""
   530  	if e.key {
   531  		key = "key for "
   532  	}
   533  
   534  	return fmt.Sprintf(
   535  		"invalid %sAccessLogCommon.%s: %s%s",
   536  		key,
   537  		e.field,
   538  		e.reason,
   539  		cause)
   540  }
   541  
   542  var _ error = AccessLogCommonValidationError{}
   543  
   544  var _ interface {
   545  	Field() string
   546  	Reason() string
   547  	Key() bool
   548  	Cause() error
   549  	ErrorName() string
   550  } = AccessLogCommonValidationError{}
   551  
   552  // Validate checks the field values on ResponseFlags with the rules defined in
   553  // the proto definition for this message. If any rules are violated, an error
   554  // is returned.
   555  func (m *ResponseFlags) Validate() error {
   556  	if m == nil {
   557  		return nil
   558  	}
   559  
   560  	// no validation rules for FailedLocalHealthcheck
   561  
   562  	// no validation rules for NoHealthyUpstream
   563  
   564  	// no validation rules for UpstreamRequestTimeout
   565  
   566  	// no validation rules for LocalReset
   567  
   568  	// no validation rules for UpstreamRemoteReset
   569  
   570  	// no validation rules for UpstreamConnectionFailure
   571  
   572  	// no validation rules for UpstreamConnectionTermination
   573  
   574  	// no validation rules for UpstreamOverflow
   575  
   576  	// no validation rules for NoRouteFound
   577  
   578  	// no validation rules for DelayInjected
   579  
   580  	// no validation rules for FaultInjected
   581  
   582  	// no validation rules for RateLimited
   583  
   584  	if v, ok := interface{}(m.GetUnauthorizedDetails()).(interface{ Validate() error }); ok {
   585  		if err := v.Validate(); err != nil {
   586  			return ResponseFlagsValidationError{
   587  				field:  "UnauthorizedDetails",
   588  				reason: "embedded message failed validation",
   589  				cause:  err,
   590  			}
   591  		}
   592  	}
   593  
   594  	// no validation rules for RateLimitServiceError
   595  
   596  	// no validation rules for DownstreamConnectionTermination
   597  
   598  	// no validation rules for UpstreamRetryLimitExceeded
   599  
   600  	// no validation rules for StreamIdleTimeout
   601  
   602  	// no validation rules for InvalidEnvoyRequestHeaders
   603  
   604  	// no validation rules for DownstreamProtocolError
   605  
   606  	// no validation rules for UpstreamMaxStreamDurationReached
   607  
   608  	// no validation rules for ResponseFromCacheFilter
   609  
   610  	// no validation rules for NoFilterConfigFound
   611  
   612  	// no validation rules for DurationTimeout
   613  
   614  	return nil
   615  }
   616  
   617  // ResponseFlagsValidationError is the validation error returned by
   618  // ResponseFlags.Validate if the designated constraints aren't met.
   619  type ResponseFlagsValidationError struct {
   620  	field  string
   621  	reason string
   622  	cause  error
   623  	key    bool
   624  }
   625  
   626  // Field function returns field value.
   627  func (e ResponseFlagsValidationError) Field() string { return e.field }
   628  
   629  // Reason function returns reason value.
   630  func (e ResponseFlagsValidationError) Reason() string { return e.reason }
   631  
   632  // Cause function returns cause value.
   633  func (e ResponseFlagsValidationError) Cause() error { return e.cause }
   634  
   635  // Key function returns key value.
   636  func (e ResponseFlagsValidationError) Key() bool { return e.key }
   637  
   638  // ErrorName returns error name.
   639  func (e ResponseFlagsValidationError) ErrorName() string { return "ResponseFlagsValidationError" }
   640  
   641  // Error satisfies the builtin error interface
   642  func (e ResponseFlagsValidationError) Error() string {
   643  	cause := ""
   644  	if e.cause != nil {
   645  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   646  	}
   647  
   648  	key := ""
   649  	if e.key {
   650  		key = "key for "
   651  	}
   652  
   653  	return fmt.Sprintf(
   654  		"invalid %sResponseFlags.%s: %s%s",
   655  		key,
   656  		e.field,
   657  		e.reason,
   658  		cause)
   659  }
   660  
   661  var _ error = ResponseFlagsValidationError{}
   662  
   663  var _ interface {
   664  	Field() string
   665  	Reason() string
   666  	Key() bool
   667  	Cause() error
   668  	ErrorName() string
   669  } = ResponseFlagsValidationError{}
   670  
   671  // Validate checks the field values on TLSProperties with the rules defined in
   672  // the proto definition for this message. If any rules are violated, an error
   673  // is returned.
   674  func (m *TLSProperties) Validate() error {
   675  	if m == nil {
   676  		return nil
   677  	}
   678  
   679  	// no validation rules for TlsVersion
   680  
   681  	if v, ok := interface{}(m.GetTlsCipherSuite()).(interface{ Validate() error }); ok {
   682  		if err := v.Validate(); err != nil {
   683  			return TLSPropertiesValidationError{
   684  				field:  "TlsCipherSuite",
   685  				reason: "embedded message failed validation",
   686  				cause:  err,
   687  			}
   688  		}
   689  	}
   690  
   691  	// no validation rules for TlsSniHostname
   692  
   693  	if v, ok := interface{}(m.GetLocalCertificateProperties()).(interface{ Validate() error }); ok {
   694  		if err := v.Validate(); err != nil {
   695  			return TLSPropertiesValidationError{
   696  				field:  "LocalCertificateProperties",
   697  				reason: "embedded message failed validation",
   698  				cause:  err,
   699  			}
   700  		}
   701  	}
   702  
   703  	if v, ok := interface{}(m.GetPeerCertificateProperties()).(interface{ Validate() error }); ok {
   704  		if err := v.Validate(); err != nil {
   705  			return TLSPropertiesValidationError{
   706  				field:  "PeerCertificateProperties",
   707  				reason: "embedded message failed validation",
   708  				cause:  err,
   709  			}
   710  		}
   711  	}
   712  
   713  	// no validation rules for TlsSessionId
   714  
   715  	return nil
   716  }
   717  
   718  // TLSPropertiesValidationError is the validation error returned by
   719  // TLSProperties.Validate if the designated constraints aren't met.
   720  type TLSPropertiesValidationError struct {
   721  	field  string
   722  	reason string
   723  	cause  error
   724  	key    bool
   725  }
   726  
   727  // Field function returns field value.
   728  func (e TLSPropertiesValidationError) Field() string { return e.field }
   729  
   730  // Reason function returns reason value.
   731  func (e TLSPropertiesValidationError) Reason() string { return e.reason }
   732  
   733  // Cause function returns cause value.
   734  func (e TLSPropertiesValidationError) Cause() error { return e.cause }
   735  
   736  // Key function returns key value.
   737  func (e TLSPropertiesValidationError) Key() bool { return e.key }
   738  
   739  // ErrorName returns error name.
   740  func (e TLSPropertiesValidationError) ErrorName() string { return "TLSPropertiesValidationError" }
   741  
   742  // Error satisfies the builtin error interface
   743  func (e TLSPropertiesValidationError) Error() string {
   744  	cause := ""
   745  	if e.cause != nil {
   746  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   747  	}
   748  
   749  	key := ""
   750  	if e.key {
   751  		key = "key for "
   752  	}
   753  
   754  	return fmt.Sprintf(
   755  		"invalid %sTLSProperties.%s: %s%s",
   756  		key,
   757  		e.field,
   758  		e.reason,
   759  		cause)
   760  }
   761  
   762  var _ error = TLSPropertiesValidationError{}
   763  
   764  var _ interface {
   765  	Field() string
   766  	Reason() string
   767  	Key() bool
   768  	Cause() error
   769  	ErrorName() string
   770  } = TLSPropertiesValidationError{}
   771  
   772  // Validate checks the field values on HTTPRequestProperties with the rules
   773  // defined in the proto definition for this message. If any rules are
   774  // violated, an error is returned.
   775  func (m *HTTPRequestProperties) Validate() error {
   776  	if m == nil {
   777  		return nil
   778  	}
   779  
   780  	if _, ok := v3.RequestMethod_name[int32(m.GetRequestMethod())]; !ok {
   781  		return HTTPRequestPropertiesValidationError{
   782  			field:  "RequestMethod",
   783  			reason: "value must be one of the defined enum values",
   784  		}
   785  	}
   786  
   787  	// no validation rules for Scheme
   788  
   789  	// no validation rules for Authority
   790  
   791  	if v, ok := interface{}(m.GetPort()).(interface{ Validate() error }); ok {
   792  		if err := v.Validate(); err != nil {
   793  			return HTTPRequestPropertiesValidationError{
   794  				field:  "Port",
   795  				reason: "embedded message failed validation",
   796  				cause:  err,
   797  			}
   798  		}
   799  	}
   800  
   801  	// no validation rules for Path
   802  
   803  	// no validation rules for UserAgent
   804  
   805  	// no validation rules for Referer
   806  
   807  	// no validation rules for ForwardedFor
   808  
   809  	// no validation rules for RequestId
   810  
   811  	// no validation rules for OriginalPath
   812  
   813  	// no validation rules for RequestHeadersBytes
   814  
   815  	// no validation rules for RequestBodyBytes
   816  
   817  	// no validation rules for RequestHeaders
   818  
   819  	return nil
   820  }
   821  
   822  // HTTPRequestPropertiesValidationError is the validation error returned by
   823  // HTTPRequestProperties.Validate if the designated constraints aren't met.
   824  type HTTPRequestPropertiesValidationError struct {
   825  	field  string
   826  	reason string
   827  	cause  error
   828  	key    bool
   829  }
   830  
   831  // Field function returns field value.
   832  func (e HTTPRequestPropertiesValidationError) Field() string { return e.field }
   833  
   834  // Reason function returns reason value.
   835  func (e HTTPRequestPropertiesValidationError) Reason() string { return e.reason }
   836  
   837  // Cause function returns cause value.
   838  func (e HTTPRequestPropertiesValidationError) Cause() error { return e.cause }
   839  
   840  // Key function returns key value.
   841  func (e HTTPRequestPropertiesValidationError) Key() bool { return e.key }
   842  
   843  // ErrorName returns error name.
   844  func (e HTTPRequestPropertiesValidationError) ErrorName() string {
   845  	return "HTTPRequestPropertiesValidationError"
   846  }
   847  
   848  // Error satisfies the builtin error interface
   849  func (e HTTPRequestPropertiesValidationError) Error() string {
   850  	cause := ""
   851  	if e.cause != nil {
   852  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   853  	}
   854  
   855  	key := ""
   856  	if e.key {
   857  		key = "key for "
   858  	}
   859  
   860  	return fmt.Sprintf(
   861  		"invalid %sHTTPRequestProperties.%s: %s%s",
   862  		key,
   863  		e.field,
   864  		e.reason,
   865  		cause)
   866  }
   867  
   868  var _ error = HTTPRequestPropertiesValidationError{}
   869  
   870  var _ interface {
   871  	Field() string
   872  	Reason() string
   873  	Key() bool
   874  	Cause() error
   875  	ErrorName() string
   876  } = HTTPRequestPropertiesValidationError{}
   877  
   878  // Validate checks the field values on HTTPResponseProperties with the rules
   879  // defined in the proto definition for this message. If any rules are
   880  // violated, an error is returned.
   881  func (m *HTTPResponseProperties) Validate() error {
   882  	if m == nil {
   883  		return nil
   884  	}
   885  
   886  	if v, ok := interface{}(m.GetResponseCode()).(interface{ Validate() error }); ok {
   887  		if err := v.Validate(); err != nil {
   888  			return HTTPResponsePropertiesValidationError{
   889  				field:  "ResponseCode",
   890  				reason: "embedded message failed validation",
   891  				cause:  err,
   892  			}
   893  		}
   894  	}
   895  
   896  	// no validation rules for ResponseHeadersBytes
   897  
   898  	// no validation rules for ResponseBodyBytes
   899  
   900  	// no validation rules for ResponseHeaders
   901  
   902  	// no validation rules for ResponseTrailers
   903  
   904  	// no validation rules for ResponseCodeDetails
   905  
   906  	return nil
   907  }
   908  
   909  // HTTPResponsePropertiesValidationError is the validation error returned by
   910  // HTTPResponseProperties.Validate if the designated constraints aren't met.
   911  type HTTPResponsePropertiesValidationError struct {
   912  	field  string
   913  	reason string
   914  	cause  error
   915  	key    bool
   916  }
   917  
   918  // Field function returns field value.
   919  func (e HTTPResponsePropertiesValidationError) Field() string { return e.field }
   920  
   921  // Reason function returns reason value.
   922  func (e HTTPResponsePropertiesValidationError) Reason() string { return e.reason }
   923  
   924  // Cause function returns cause value.
   925  func (e HTTPResponsePropertiesValidationError) Cause() error { return e.cause }
   926  
   927  // Key function returns key value.
   928  func (e HTTPResponsePropertiesValidationError) Key() bool { return e.key }
   929  
   930  // ErrorName returns error name.
   931  func (e HTTPResponsePropertiesValidationError) ErrorName() string {
   932  	return "HTTPResponsePropertiesValidationError"
   933  }
   934  
   935  // Error satisfies the builtin error interface
   936  func (e HTTPResponsePropertiesValidationError) Error() string {
   937  	cause := ""
   938  	if e.cause != nil {
   939  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
   940  	}
   941  
   942  	key := ""
   943  	if e.key {
   944  		key = "key for "
   945  	}
   946  
   947  	return fmt.Sprintf(
   948  		"invalid %sHTTPResponseProperties.%s: %s%s",
   949  		key,
   950  		e.field,
   951  		e.reason,
   952  		cause)
   953  }
   954  
   955  var _ error = HTTPResponsePropertiesValidationError{}
   956  
   957  var _ interface {
   958  	Field() string
   959  	Reason() string
   960  	Key() bool
   961  	Cause() error
   962  	ErrorName() string
   963  } = HTTPResponsePropertiesValidationError{}
   964  
   965  // Validate checks the field values on ResponseFlags_Unauthorized with the
   966  // rules defined in the proto definition for this message. If any rules are
   967  // violated, an error is returned.
   968  func (m *ResponseFlags_Unauthorized) Validate() error {
   969  	if m == nil {
   970  		return nil
   971  	}
   972  
   973  	// no validation rules for Reason
   974  
   975  	return nil
   976  }
   977  
   978  // ResponseFlags_UnauthorizedValidationError is the validation error returned
   979  // by ResponseFlags_Unauthorized.Validate if the designated constraints aren't met.
   980  type ResponseFlags_UnauthorizedValidationError struct {
   981  	field  string
   982  	reason string
   983  	cause  error
   984  	key    bool
   985  }
   986  
   987  // Field function returns field value.
   988  func (e ResponseFlags_UnauthorizedValidationError) Field() string { return e.field }
   989  
   990  // Reason function returns reason value.
   991  func (e ResponseFlags_UnauthorizedValidationError) Reason() string { return e.reason }
   992  
   993  // Cause function returns cause value.
   994  func (e ResponseFlags_UnauthorizedValidationError) Cause() error { return e.cause }
   995  
   996  // Key function returns key value.
   997  func (e ResponseFlags_UnauthorizedValidationError) Key() bool { return e.key }
   998  
   999  // ErrorName returns error name.
  1000  func (e ResponseFlags_UnauthorizedValidationError) ErrorName() string {
  1001  	return "ResponseFlags_UnauthorizedValidationError"
  1002  }
  1003  
  1004  // Error satisfies the builtin error interface
  1005  func (e ResponseFlags_UnauthorizedValidationError) Error() string {
  1006  	cause := ""
  1007  	if e.cause != nil {
  1008  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1009  	}
  1010  
  1011  	key := ""
  1012  	if e.key {
  1013  		key = "key for "
  1014  	}
  1015  
  1016  	return fmt.Sprintf(
  1017  		"invalid %sResponseFlags_Unauthorized.%s: %s%s",
  1018  		key,
  1019  		e.field,
  1020  		e.reason,
  1021  		cause)
  1022  }
  1023  
  1024  var _ error = ResponseFlags_UnauthorizedValidationError{}
  1025  
  1026  var _ interface {
  1027  	Field() string
  1028  	Reason() string
  1029  	Key() bool
  1030  	Cause() error
  1031  	ErrorName() string
  1032  } = ResponseFlags_UnauthorizedValidationError{}
  1033  
  1034  // Validate checks the field values on TLSProperties_CertificateProperties with
  1035  // the rules defined in the proto definition for this message. If any rules
  1036  // are violated, an error is returned.
  1037  func (m *TLSProperties_CertificateProperties) Validate() error {
  1038  	if m == nil {
  1039  		return nil
  1040  	}
  1041  
  1042  	for idx, item := range m.GetSubjectAltName() {
  1043  		_, _ = idx, item
  1044  
  1045  		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  1046  			if err := v.Validate(); err != nil {
  1047  				return TLSProperties_CertificatePropertiesValidationError{
  1048  					field:  fmt.Sprintf("SubjectAltName[%v]", idx),
  1049  					reason: "embedded message failed validation",
  1050  					cause:  err,
  1051  				}
  1052  			}
  1053  		}
  1054  
  1055  	}
  1056  
  1057  	// no validation rules for Subject
  1058  
  1059  	return nil
  1060  }
  1061  
  1062  // TLSProperties_CertificatePropertiesValidationError is the validation error
  1063  // returned by TLSProperties_CertificateProperties.Validate if the designated
  1064  // constraints aren't met.
  1065  type TLSProperties_CertificatePropertiesValidationError struct {
  1066  	field  string
  1067  	reason string
  1068  	cause  error
  1069  	key    bool
  1070  }
  1071  
  1072  // Field function returns field value.
  1073  func (e TLSProperties_CertificatePropertiesValidationError) Field() string { return e.field }
  1074  
  1075  // Reason function returns reason value.
  1076  func (e TLSProperties_CertificatePropertiesValidationError) Reason() string { return e.reason }
  1077  
  1078  // Cause function returns cause value.
  1079  func (e TLSProperties_CertificatePropertiesValidationError) Cause() error { return e.cause }
  1080  
  1081  // Key function returns key value.
  1082  func (e TLSProperties_CertificatePropertiesValidationError) Key() bool { return e.key }
  1083  
  1084  // ErrorName returns error name.
  1085  func (e TLSProperties_CertificatePropertiesValidationError) ErrorName() string {
  1086  	return "TLSProperties_CertificatePropertiesValidationError"
  1087  }
  1088  
  1089  // Error satisfies the builtin error interface
  1090  func (e TLSProperties_CertificatePropertiesValidationError) Error() string {
  1091  	cause := ""
  1092  	if e.cause != nil {
  1093  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1094  	}
  1095  
  1096  	key := ""
  1097  	if e.key {
  1098  		key = "key for "
  1099  	}
  1100  
  1101  	return fmt.Sprintf(
  1102  		"invalid %sTLSProperties_CertificateProperties.%s: %s%s",
  1103  		key,
  1104  		e.field,
  1105  		e.reason,
  1106  		cause)
  1107  }
  1108  
  1109  var _ error = TLSProperties_CertificatePropertiesValidationError{}
  1110  
  1111  var _ interface {
  1112  	Field() string
  1113  	Reason() string
  1114  	Key() bool
  1115  	Cause() error
  1116  	ErrorName() string
  1117  } = TLSProperties_CertificatePropertiesValidationError{}
  1118  
  1119  // Validate checks the field values on
  1120  // TLSProperties_CertificateProperties_SubjectAltName with the rules defined
  1121  // in the proto definition for this message. If any rules are violated, an
  1122  // error is returned.
  1123  func (m *TLSProperties_CertificateProperties_SubjectAltName) Validate() error {
  1124  	if m == nil {
  1125  		return nil
  1126  	}
  1127  
  1128  	switch m.San.(type) {
  1129  
  1130  	case *TLSProperties_CertificateProperties_SubjectAltName_Uri:
  1131  		// no validation rules for Uri
  1132  
  1133  	case *TLSProperties_CertificateProperties_SubjectAltName_Dns:
  1134  		// no validation rules for Dns
  1135  
  1136  	}
  1137  
  1138  	return nil
  1139  }
  1140  
  1141  // TLSProperties_CertificateProperties_SubjectAltNameValidationError is the
  1142  // validation error returned by
  1143  // TLSProperties_CertificateProperties_SubjectAltName.Validate if the
  1144  // designated constraints aren't met.
  1145  type TLSProperties_CertificateProperties_SubjectAltNameValidationError struct {
  1146  	field  string
  1147  	reason string
  1148  	cause  error
  1149  	key    bool
  1150  }
  1151  
  1152  // Field function returns field value.
  1153  func (e TLSProperties_CertificateProperties_SubjectAltNameValidationError) Field() string {
  1154  	return e.field
  1155  }
  1156  
  1157  // Reason function returns reason value.
  1158  func (e TLSProperties_CertificateProperties_SubjectAltNameValidationError) Reason() string {
  1159  	return e.reason
  1160  }
  1161  
  1162  // Cause function returns cause value.
  1163  func (e TLSProperties_CertificateProperties_SubjectAltNameValidationError) Cause() error {
  1164  	return e.cause
  1165  }
  1166  
  1167  // Key function returns key value.
  1168  func (e TLSProperties_CertificateProperties_SubjectAltNameValidationError) Key() bool { return e.key }
  1169  
  1170  // ErrorName returns error name.
  1171  func (e TLSProperties_CertificateProperties_SubjectAltNameValidationError) ErrorName() string {
  1172  	return "TLSProperties_CertificateProperties_SubjectAltNameValidationError"
  1173  }
  1174  
  1175  // Error satisfies the builtin error interface
  1176  func (e TLSProperties_CertificateProperties_SubjectAltNameValidationError) Error() string {
  1177  	cause := ""
  1178  	if e.cause != nil {
  1179  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1180  	}
  1181  
  1182  	key := ""
  1183  	if e.key {
  1184  		key = "key for "
  1185  	}
  1186  
  1187  	return fmt.Sprintf(
  1188  		"invalid %sTLSProperties_CertificateProperties_SubjectAltName.%s: %s%s",
  1189  		key,
  1190  		e.field,
  1191  		e.reason,
  1192  		cause)
  1193  }
  1194  
  1195  var _ error = TLSProperties_CertificateProperties_SubjectAltNameValidationError{}
  1196  
  1197  var _ interface {
  1198  	Field() string
  1199  	Reason() string
  1200  	Key() bool
  1201  	Cause() error
  1202  	ErrorName() string
  1203  } = TLSProperties_CertificateProperties_SubjectAltNameValidationError{}
  1204  

View as plain text