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

https://github.com/datawire/ambassador · Go · 1198 lines · 786 code · 235 blank · 177 comment · 148 complexity · b891e0509ae54849872c75e936c5cca1 MD5 · raw file

  1. // Code generated by protoc-gen-validate. DO NOT EDIT.
  2. // source: envoy/data/accesslog/v2/accesslog.proto
  3. package envoy_data_accesslog_v2
  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. core "github.com/datawire/ambassador/pkg/api/envoy/api/v2/core"
  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. _ = core.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. return nil
  498. }
  499. // ResponseFlagsValidationError is the validation error returned by
  500. // ResponseFlags.Validate if the designated constraints aren't met.
  501. type ResponseFlagsValidationError struct {
  502. field string
  503. reason string
  504. cause error
  505. key bool
  506. }
  507. // Field function returns field value.
  508. func (e ResponseFlagsValidationError) Field() string { return e.field }
  509. // Reason function returns reason value.
  510. func (e ResponseFlagsValidationError) Reason() string { return e.reason }
  511. // Cause function returns cause value.
  512. func (e ResponseFlagsValidationError) Cause() error { return e.cause }
  513. // Key function returns key value.
  514. func (e ResponseFlagsValidationError) Key() bool { return e.key }
  515. // ErrorName returns error name.
  516. func (e ResponseFlagsValidationError) ErrorName() string { return "ResponseFlagsValidationError" }
  517. // Error satisfies the builtin error interface
  518. func (e ResponseFlagsValidationError) Error() string {
  519. cause := ""
  520. if e.cause != nil {
  521. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  522. }
  523. key := ""
  524. if e.key {
  525. key = "key for "
  526. }
  527. return fmt.Sprintf(
  528. "invalid %sResponseFlags.%s: %s%s",
  529. key,
  530. e.field,
  531. e.reason,
  532. cause)
  533. }
  534. var _ error = ResponseFlagsValidationError{}
  535. var _ interface {
  536. Field() string
  537. Reason() string
  538. Key() bool
  539. Cause() error
  540. ErrorName() string
  541. } = ResponseFlagsValidationError{}
  542. // Validate checks the field values on TLSProperties with the rules defined in
  543. // the proto definition for this message. If any rules are violated, an error
  544. // is returned.
  545. func (m *TLSProperties) Validate() error {
  546. if m == nil {
  547. return nil
  548. }
  549. // no validation rules for TlsVersion
  550. if v, ok := interface{}(m.GetTlsCipherSuite()).(interface{ Validate() error }); ok {
  551. if err := v.Validate(); err != nil {
  552. return TLSPropertiesValidationError{
  553. field: "TlsCipherSuite",
  554. reason: "embedded message failed validation",
  555. cause: err,
  556. }
  557. }
  558. }
  559. // no validation rules for TlsSniHostname
  560. if v, ok := interface{}(m.GetLocalCertificateProperties()).(interface{ Validate() error }); ok {
  561. if err := v.Validate(); err != nil {
  562. return TLSPropertiesValidationError{
  563. field: "LocalCertificateProperties",
  564. reason: "embedded message failed validation",
  565. cause: err,
  566. }
  567. }
  568. }
  569. if v, ok := interface{}(m.GetPeerCertificateProperties()).(interface{ Validate() error }); ok {
  570. if err := v.Validate(); err != nil {
  571. return TLSPropertiesValidationError{
  572. field: "PeerCertificateProperties",
  573. reason: "embedded message failed validation",
  574. cause: err,
  575. }
  576. }
  577. }
  578. // no validation rules for TlsSessionId
  579. return nil
  580. }
  581. // TLSPropertiesValidationError is the validation error returned by
  582. // TLSProperties.Validate if the designated constraints aren't met.
  583. type TLSPropertiesValidationError struct {
  584. field string
  585. reason string
  586. cause error
  587. key bool
  588. }
  589. // Field function returns field value.
  590. func (e TLSPropertiesValidationError) Field() string { return e.field }
  591. // Reason function returns reason value.
  592. func (e TLSPropertiesValidationError) Reason() string { return e.reason }
  593. // Cause function returns cause value.
  594. func (e TLSPropertiesValidationError) Cause() error { return e.cause }
  595. // Key function returns key value.
  596. func (e TLSPropertiesValidationError) Key() bool { return e.key }
  597. // ErrorName returns error name.
  598. func (e TLSPropertiesValidationError) ErrorName() string { return "TLSPropertiesValidationError" }
  599. // Error satisfies the builtin error interface
  600. func (e TLSPropertiesValidationError) Error() string {
  601. cause := ""
  602. if e.cause != nil {
  603. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  604. }
  605. key := ""
  606. if e.key {
  607. key = "key for "
  608. }
  609. return fmt.Sprintf(
  610. "invalid %sTLSProperties.%s: %s%s",
  611. key,
  612. e.field,
  613. e.reason,
  614. cause)
  615. }
  616. var _ error = TLSPropertiesValidationError{}
  617. var _ interface {
  618. Field() string
  619. Reason() string
  620. Key() bool
  621. Cause() error
  622. ErrorName() string
  623. } = TLSPropertiesValidationError{}
  624. // Validate checks the field values on HTTPRequestProperties with the rules
  625. // defined in the proto definition for this message. If any rules are
  626. // violated, an error is returned.
  627. func (m *HTTPRequestProperties) Validate() error {
  628. if m == nil {
  629. return nil
  630. }
  631. if _, ok := core.RequestMethod_name[int32(m.GetRequestMethod())]; !ok {
  632. return HTTPRequestPropertiesValidationError{
  633. field: "RequestMethod",
  634. reason: "value must be one of the defined enum values",
  635. }
  636. }
  637. // no validation rules for Scheme
  638. // no validation rules for Authority
  639. if v, ok := interface{}(m.GetPort()).(interface{ Validate() error }); ok {
  640. if err := v.Validate(); err != nil {
  641. return HTTPRequestPropertiesValidationError{
  642. field: "Port",
  643. reason: "embedded message failed validation",
  644. cause: err,
  645. }
  646. }
  647. }
  648. // no validation rules for Path
  649. // no validation rules for UserAgent
  650. // no validation rules for Referer
  651. // no validation rules for ForwardedFor
  652. // no validation rules for RequestId
  653. // no validation rules for OriginalPath
  654. // no validation rules for RequestHeadersBytes
  655. // no validation rules for RequestBodyBytes
  656. // no validation rules for RequestHeaders
  657. return nil
  658. }
  659. // HTTPRequestPropertiesValidationError is the validation error returned by
  660. // HTTPRequestProperties.Validate if the designated constraints aren't met.
  661. type HTTPRequestPropertiesValidationError struct {
  662. field string
  663. reason string
  664. cause error
  665. key bool
  666. }
  667. // Field function returns field value.
  668. func (e HTTPRequestPropertiesValidationError) Field() string { return e.field }
  669. // Reason function returns reason value.
  670. func (e HTTPRequestPropertiesValidationError) Reason() string { return e.reason }
  671. // Cause function returns cause value.
  672. func (e HTTPRequestPropertiesValidationError) Cause() error { return e.cause }
  673. // Key function returns key value.
  674. func (e HTTPRequestPropertiesValidationError) Key() bool { return e.key }
  675. // ErrorName returns error name.
  676. func (e HTTPRequestPropertiesValidationError) ErrorName() string {
  677. return "HTTPRequestPropertiesValidationError"
  678. }
  679. // Error satisfies the builtin error interface
  680. func (e HTTPRequestPropertiesValidationError) Error() string {
  681. cause := ""
  682. if e.cause != nil {
  683. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  684. }
  685. key := ""
  686. if e.key {
  687. key = "key for "
  688. }
  689. return fmt.Sprintf(
  690. "invalid %sHTTPRequestProperties.%s: %s%s",
  691. key,
  692. e.field,
  693. e.reason,
  694. cause)
  695. }
  696. var _ error = HTTPRequestPropertiesValidationError{}
  697. var _ interface {
  698. Field() string
  699. Reason() string
  700. Key() bool
  701. Cause() error
  702. ErrorName() string
  703. } = HTTPRequestPropertiesValidationError{}
  704. // Validate checks the field values on HTTPResponseProperties with the rules
  705. // defined in the proto definition for this message. If any rules are
  706. // violated, an error is returned.
  707. func (m *HTTPResponseProperties) Validate() error {
  708. if m == nil {
  709. return nil
  710. }
  711. if v, ok := interface{}(m.GetResponseCode()).(interface{ Validate() error }); ok {
  712. if err := v.Validate(); err != nil {
  713. return HTTPResponsePropertiesValidationError{
  714. field: "ResponseCode",
  715. reason: "embedded message failed validation",
  716. cause: err,
  717. }
  718. }
  719. }
  720. // no validation rules for ResponseHeadersBytes
  721. // no validation rules for ResponseBodyBytes
  722. // no validation rules for ResponseHeaders
  723. // no validation rules for ResponseTrailers
  724. // no validation rules for ResponseCodeDetails
  725. return nil
  726. }
  727. // HTTPResponsePropertiesValidationError is the validation error returned by
  728. // HTTPResponseProperties.Validate if the designated constraints aren't met.
  729. type HTTPResponsePropertiesValidationError struct {
  730. field string
  731. reason string
  732. cause error
  733. key bool
  734. }
  735. // Field function returns field value.
  736. func (e HTTPResponsePropertiesValidationError) Field() string { return e.field }
  737. // Reason function returns reason value.
  738. func (e HTTPResponsePropertiesValidationError) Reason() string { return e.reason }
  739. // Cause function returns cause value.
  740. func (e HTTPResponsePropertiesValidationError) Cause() error { return e.cause }
  741. // Key function returns key value.
  742. func (e HTTPResponsePropertiesValidationError) Key() bool { return e.key }
  743. // ErrorName returns error name.
  744. func (e HTTPResponsePropertiesValidationError) ErrorName() string {
  745. return "HTTPResponsePropertiesValidationError"
  746. }
  747. // Error satisfies the builtin error interface
  748. func (e HTTPResponsePropertiesValidationError) Error() string {
  749. cause := ""
  750. if e.cause != nil {
  751. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  752. }
  753. key := ""
  754. if e.key {
  755. key = "key for "
  756. }
  757. return fmt.Sprintf(
  758. "invalid %sHTTPResponseProperties.%s: %s%s",
  759. key,
  760. e.field,
  761. e.reason,
  762. cause)
  763. }
  764. var _ error = HTTPResponsePropertiesValidationError{}
  765. var _ interface {
  766. Field() string
  767. Reason() string
  768. Key() bool
  769. Cause() error
  770. ErrorName() string
  771. } = HTTPResponsePropertiesValidationError{}
  772. // Validate checks the field values on ResponseFlags_Unauthorized with the
  773. // rules defined in the proto definition for this message. If any rules are
  774. // violated, an error is returned.
  775. func (m *ResponseFlags_Unauthorized) Validate() error {
  776. if m == nil {
  777. return nil
  778. }
  779. // no validation rules for Reason
  780. return nil
  781. }
  782. // ResponseFlags_UnauthorizedValidationError is the validation error returned
  783. // by ResponseFlags_Unauthorized.Validate if the designated constraints aren't met.
  784. type ResponseFlags_UnauthorizedValidationError struct {
  785. field string
  786. reason string
  787. cause error
  788. key bool
  789. }
  790. // Field function returns field value.
  791. func (e ResponseFlags_UnauthorizedValidationError) Field() string { return e.field }
  792. // Reason function returns reason value.
  793. func (e ResponseFlags_UnauthorizedValidationError) Reason() string { return e.reason }
  794. // Cause function returns cause value.
  795. func (e ResponseFlags_UnauthorizedValidationError) Cause() error { return e.cause }
  796. // Key function returns key value.
  797. func (e ResponseFlags_UnauthorizedValidationError) Key() bool { return e.key }
  798. // ErrorName returns error name.
  799. func (e ResponseFlags_UnauthorizedValidationError) ErrorName() string {
  800. return "ResponseFlags_UnauthorizedValidationError"
  801. }
  802. // Error satisfies the builtin error interface
  803. func (e ResponseFlags_UnauthorizedValidationError) Error() string {
  804. cause := ""
  805. if e.cause != nil {
  806. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  807. }
  808. key := ""
  809. if e.key {
  810. key = "key for "
  811. }
  812. return fmt.Sprintf(
  813. "invalid %sResponseFlags_Unauthorized.%s: %s%s",
  814. key,
  815. e.field,
  816. e.reason,
  817. cause)
  818. }
  819. var _ error = ResponseFlags_UnauthorizedValidationError{}
  820. var _ interface {
  821. Field() string
  822. Reason() string
  823. Key() bool
  824. Cause() error
  825. ErrorName() string
  826. } = ResponseFlags_UnauthorizedValidationError{}
  827. // Validate checks the field values on TLSProperties_CertificateProperties with
  828. // the rules defined in the proto definition for this message. If any rules
  829. // are violated, an error is returned.
  830. func (m *TLSProperties_CertificateProperties) Validate() error {
  831. if m == nil {
  832. return nil
  833. }
  834. for idx, item := range m.GetSubjectAltName() {
  835. _, _ = idx, item
  836. if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  837. if err := v.Validate(); err != nil {
  838. return TLSProperties_CertificatePropertiesValidationError{
  839. field: fmt.Sprintf("SubjectAltName[%v]", idx),
  840. reason: "embedded message failed validation",
  841. cause: err,
  842. }
  843. }
  844. }
  845. }
  846. // no validation rules for Subject
  847. return nil
  848. }
  849. // TLSProperties_CertificatePropertiesValidationError is the validation error
  850. // returned by TLSProperties_CertificateProperties.Validate if the designated
  851. // constraints aren't met.
  852. type TLSProperties_CertificatePropertiesValidationError struct {
  853. field string
  854. reason string
  855. cause error
  856. key bool
  857. }
  858. // Field function returns field value.
  859. func (e TLSProperties_CertificatePropertiesValidationError) Field() string { return e.field }
  860. // Reason function returns reason value.
  861. func (e TLSProperties_CertificatePropertiesValidationError) Reason() string { return e.reason }
  862. // Cause function returns cause value.
  863. func (e TLSProperties_CertificatePropertiesValidationError) Cause() error { return e.cause }
  864. // Key function returns key value.
  865. func (e TLSProperties_CertificatePropertiesValidationError) Key() bool { return e.key }
  866. // ErrorName returns error name.
  867. func (e TLSProperties_CertificatePropertiesValidationError) ErrorName() string {
  868. return "TLSProperties_CertificatePropertiesValidationError"
  869. }
  870. // Error satisfies the builtin error interface
  871. func (e TLSProperties_CertificatePropertiesValidationError) Error() string {
  872. cause := ""
  873. if e.cause != nil {
  874. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  875. }
  876. key := ""
  877. if e.key {
  878. key = "key for "
  879. }
  880. return fmt.Sprintf(
  881. "invalid %sTLSProperties_CertificateProperties.%s: %s%s",
  882. key,
  883. e.field,
  884. e.reason,
  885. cause)
  886. }
  887. var _ error = TLSProperties_CertificatePropertiesValidationError{}
  888. var _ interface {
  889. Field() string
  890. Reason() string
  891. Key() bool
  892. Cause() error
  893. ErrorName() string
  894. } = TLSProperties_CertificatePropertiesValidationError{}
  895. // Validate checks the field values on
  896. // TLSProperties_CertificateProperties_SubjectAltName with the rules defined
  897. // in the proto definition for this message. If any rules are violated, an
  898. // error is returned.
  899. func (m *TLSProperties_CertificateProperties_SubjectAltName) Validate() error {
  900. if m == nil {
  901. return nil
  902. }
  903. switch m.San.(type) {
  904. case *TLSProperties_CertificateProperties_SubjectAltName_Uri:
  905. // no validation rules for Uri
  906. case *TLSProperties_CertificateProperties_SubjectAltName_Dns:
  907. // no validation rules for Dns
  908. }
  909. return nil
  910. }
  911. // TLSProperties_CertificateProperties_SubjectAltNameValidationError is the
  912. // validation error returned by
  913. // TLSProperties_CertificateProperties_SubjectAltName.Validate if the
  914. // designated constraints aren't met.
  915. type TLSProperties_CertificateProperties_SubjectAltNameValidationError struct {
  916. field string
  917. reason string
  918. cause error
  919. key bool
  920. }
  921. // Field function returns field value.
  922. func (e TLSProperties_CertificateProperties_SubjectAltNameValidationError) Field() string {
  923. return e.field
  924. }
  925. // Reason function returns reason value.
  926. func (e TLSProperties_CertificateProperties_SubjectAltNameValidationError) Reason() string {
  927. return e.reason
  928. }
  929. // Cause function returns cause value.
  930. func (e TLSProperties_CertificateProperties_SubjectAltNameValidationError) Cause() error {
  931. return e.cause
  932. }
  933. // Key function returns key value.
  934. func (e TLSProperties_CertificateProperties_SubjectAltNameValidationError) Key() bool { return e.key }
  935. // ErrorName returns error name.
  936. func (e TLSProperties_CertificateProperties_SubjectAltNameValidationError) ErrorName() string {
  937. return "TLSProperties_CertificateProperties_SubjectAltNameValidationError"
  938. }
  939. // Error satisfies the builtin error interface
  940. func (e TLSProperties_CertificateProperties_SubjectAltNameValidationError) Error() string {
  941. cause := ""
  942. if e.cause != nil {
  943. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  944. }
  945. key := ""
  946. if e.key {
  947. key = "key for "
  948. }
  949. return fmt.Sprintf(
  950. "invalid %sTLSProperties_CertificateProperties_SubjectAltName.%s: %s%s",
  951. key,
  952. e.field,
  953. e.reason,
  954. cause)
  955. }
  956. var _ error = TLSProperties_CertificateProperties_SubjectAltNameValidationError{}
  957. var _ interface {
  958. Field() string
  959. Reason() string
  960. Key() bool
  961. Cause() error
  962. ErrorName() string
  963. } = TLSProperties_CertificateProperties_SubjectAltNameValidationError{}