/pkg/api/envoy/data/accesslog/v3/accesslog.pb.validate.go

https://github.com/datawire/ambassador · Go · 1202 lines · 786 code · 237 blank · 179 comment · 148 complexity · b878580f39ab873fea00d0656c6d8087 MD5 · raw file

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