/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.pb.validate.go

https://github.com/cloudfoundry/bosh-cli · Go · 4121 lines · 3159 code · 520 blank · 442 comment · 790 complexity · 9232fbca7cd4adf6b98b3a43a3108cfe MD5 · raw file

  1. // Code generated by protoc-gen-validate. DO NOT EDIT.
  2. // source: envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto
  3. package envoy_extensions_filters_network_http_connection_manager_v3
  4. import (
  5. "bytes"
  6. "errors"
  7. "fmt"
  8. "net"
  9. "net/mail"
  10. "net/url"
  11. "regexp"
  12. "sort"
  13. "strings"
  14. "time"
  15. "unicode/utf8"
  16. "google.golang.org/protobuf/types/known/anypb"
  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. _ = anypb.Any{}
  31. _ = sort.Sort
  32. )
  33. // Validate checks the field values on HttpConnectionManager with the rules
  34. // defined in the proto definition for this message. If any rules are
  35. // violated, the first error encountered is returned, or nil if there are no violations.
  36. func (m *HttpConnectionManager) Validate() error {
  37. return m.validate(false)
  38. }
  39. // ValidateAll checks the field values on HttpConnectionManager with the rules
  40. // defined in the proto definition for this message. If any rules are
  41. // violated, the result is a list of violation errors wrapped in
  42. // HttpConnectionManagerMultiError, or nil if none found.
  43. func (m *HttpConnectionManager) ValidateAll() error {
  44. return m.validate(true)
  45. }
  46. func (m *HttpConnectionManager) validate(all bool) error {
  47. if m == nil {
  48. return nil
  49. }
  50. var errors []error
  51. if _, ok := HttpConnectionManager_CodecType_name[int32(m.GetCodecType())]; !ok {
  52. err := HttpConnectionManagerValidationError{
  53. field: "CodecType",
  54. reason: "value must be one of the defined enum values",
  55. }
  56. if !all {
  57. return err
  58. }
  59. errors = append(errors, err)
  60. }
  61. if utf8.RuneCountInString(m.GetStatPrefix()) < 1 {
  62. err := HttpConnectionManagerValidationError{
  63. field: "StatPrefix",
  64. reason: "value length must be at least 1 runes",
  65. }
  66. if !all {
  67. return err
  68. }
  69. errors = append(errors, err)
  70. }
  71. for idx, item := range m.GetHttpFilters() {
  72. _, _ = idx, item
  73. if all {
  74. switch v := interface{}(item).(type) {
  75. case interface{ ValidateAll() error }:
  76. if err := v.ValidateAll(); err != nil {
  77. errors = append(errors, HttpConnectionManagerValidationError{
  78. field: fmt.Sprintf("HttpFilters[%v]", idx),
  79. reason: "embedded message failed validation",
  80. cause: err,
  81. })
  82. }
  83. case interface{ Validate() error }:
  84. if err := v.Validate(); err != nil {
  85. errors = append(errors, HttpConnectionManagerValidationError{
  86. field: fmt.Sprintf("HttpFilters[%v]", idx),
  87. reason: "embedded message failed validation",
  88. cause: err,
  89. })
  90. }
  91. }
  92. } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  93. if err := v.Validate(); err != nil {
  94. return HttpConnectionManagerValidationError{
  95. field: fmt.Sprintf("HttpFilters[%v]", idx),
  96. reason: "embedded message failed validation",
  97. cause: err,
  98. }
  99. }
  100. }
  101. }
  102. if all {
  103. switch v := interface{}(m.GetAddUserAgent()).(type) {
  104. case interface{ ValidateAll() error }:
  105. if err := v.ValidateAll(); err != nil {
  106. errors = append(errors, HttpConnectionManagerValidationError{
  107. field: "AddUserAgent",
  108. reason: "embedded message failed validation",
  109. cause: err,
  110. })
  111. }
  112. case interface{ Validate() error }:
  113. if err := v.Validate(); err != nil {
  114. errors = append(errors, HttpConnectionManagerValidationError{
  115. field: "AddUserAgent",
  116. reason: "embedded message failed validation",
  117. cause: err,
  118. })
  119. }
  120. }
  121. } else if v, ok := interface{}(m.GetAddUserAgent()).(interface{ Validate() error }); ok {
  122. if err := v.Validate(); err != nil {
  123. return HttpConnectionManagerValidationError{
  124. field: "AddUserAgent",
  125. reason: "embedded message failed validation",
  126. cause: err,
  127. }
  128. }
  129. }
  130. if all {
  131. switch v := interface{}(m.GetTracing()).(type) {
  132. case interface{ ValidateAll() error }:
  133. if err := v.ValidateAll(); err != nil {
  134. errors = append(errors, HttpConnectionManagerValidationError{
  135. field: "Tracing",
  136. reason: "embedded message failed validation",
  137. cause: err,
  138. })
  139. }
  140. case interface{ Validate() error }:
  141. if err := v.Validate(); err != nil {
  142. errors = append(errors, HttpConnectionManagerValidationError{
  143. field: "Tracing",
  144. reason: "embedded message failed validation",
  145. cause: err,
  146. })
  147. }
  148. }
  149. } else if v, ok := interface{}(m.GetTracing()).(interface{ Validate() error }); ok {
  150. if err := v.Validate(); err != nil {
  151. return HttpConnectionManagerValidationError{
  152. field: "Tracing",
  153. reason: "embedded message failed validation",
  154. cause: err,
  155. }
  156. }
  157. }
  158. if all {
  159. switch v := interface{}(m.GetCommonHttpProtocolOptions()).(type) {
  160. case interface{ ValidateAll() error }:
  161. if err := v.ValidateAll(); err != nil {
  162. errors = append(errors, HttpConnectionManagerValidationError{
  163. field: "CommonHttpProtocolOptions",
  164. reason: "embedded message failed validation",
  165. cause: err,
  166. })
  167. }
  168. case interface{ Validate() error }:
  169. if err := v.Validate(); err != nil {
  170. errors = append(errors, HttpConnectionManagerValidationError{
  171. field: "CommonHttpProtocolOptions",
  172. reason: "embedded message failed validation",
  173. cause: err,
  174. })
  175. }
  176. }
  177. } else if v, ok := interface{}(m.GetCommonHttpProtocolOptions()).(interface{ Validate() error }); ok {
  178. if err := v.Validate(); err != nil {
  179. return HttpConnectionManagerValidationError{
  180. field: "CommonHttpProtocolOptions",
  181. reason: "embedded message failed validation",
  182. cause: err,
  183. }
  184. }
  185. }
  186. if all {
  187. switch v := interface{}(m.GetHttpProtocolOptions()).(type) {
  188. case interface{ ValidateAll() error }:
  189. if err := v.ValidateAll(); err != nil {
  190. errors = append(errors, HttpConnectionManagerValidationError{
  191. field: "HttpProtocolOptions",
  192. reason: "embedded message failed validation",
  193. cause: err,
  194. })
  195. }
  196. case interface{ Validate() error }:
  197. if err := v.Validate(); err != nil {
  198. errors = append(errors, HttpConnectionManagerValidationError{
  199. field: "HttpProtocolOptions",
  200. reason: "embedded message failed validation",
  201. cause: err,
  202. })
  203. }
  204. }
  205. } else if v, ok := interface{}(m.GetHttpProtocolOptions()).(interface{ Validate() error }); ok {
  206. if err := v.Validate(); err != nil {
  207. return HttpConnectionManagerValidationError{
  208. field: "HttpProtocolOptions",
  209. reason: "embedded message failed validation",
  210. cause: err,
  211. }
  212. }
  213. }
  214. if all {
  215. switch v := interface{}(m.GetHttp2ProtocolOptions()).(type) {
  216. case interface{ ValidateAll() error }:
  217. if err := v.ValidateAll(); err != nil {
  218. errors = append(errors, HttpConnectionManagerValidationError{
  219. field: "Http2ProtocolOptions",
  220. reason: "embedded message failed validation",
  221. cause: err,
  222. })
  223. }
  224. case interface{ Validate() error }:
  225. if err := v.Validate(); err != nil {
  226. errors = append(errors, HttpConnectionManagerValidationError{
  227. field: "Http2ProtocolOptions",
  228. reason: "embedded message failed validation",
  229. cause: err,
  230. })
  231. }
  232. }
  233. } else if v, ok := interface{}(m.GetHttp2ProtocolOptions()).(interface{ Validate() error }); ok {
  234. if err := v.Validate(); err != nil {
  235. return HttpConnectionManagerValidationError{
  236. field: "Http2ProtocolOptions",
  237. reason: "embedded message failed validation",
  238. cause: err,
  239. }
  240. }
  241. }
  242. if all {
  243. switch v := interface{}(m.GetHttp3ProtocolOptions()).(type) {
  244. case interface{ ValidateAll() error }:
  245. if err := v.ValidateAll(); err != nil {
  246. errors = append(errors, HttpConnectionManagerValidationError{
  247. field: "Http3ProtocolOptions",
  248. reason: "embedded message failed validation",
  249. cause: err,
  250. })
  251. }
  252. case interface{ Validate() error }:
  253. if err := v.Validate(); err != nil {
  254. errors = append(errors, HttpConnectionManagerValidationError{
  255. field: "Http3ProtocolOptions",
  256. reason: "embedded message failed validation",
  257. cause: err,
  258. })
  259. }
  260. }
  261. } else if v, ok := interface{}(m.GetHttp3ProtocolOptions()).(interface{ Validate() error }); ok {
  262. if err := v.Validate(); err != nil {
  263. return HttpConnectionManagerValidationError{
  264. field: "Http3ProtocolOptions",
  265. reason: "embedded message failed validation",
  266. cause: err,
  267. }
  268. }
  269. }
  270. if !_HttpConnectionManager_ServerName_Pattern.MatchString(m.GetServerName()) {
  271. err := HttpConnectionManagerValidationError{
  272. field: "ServerName",
  273. reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
  274. }
  275. if !all {
  276. return err
  277. }
  278. errors = append(errors, err)
  279. }
  280. if _, ok := HttpConnectionManager_ServerHeaderTransformation_name[int32(m.GetServerHeaderTransformation())]; !ok {
  281. err := HttpConnectionManagerValidationError{
  282. field: "ServerHeaderTransformation",
  283. reason: "value must be one of the defined enum values",
  284. }
  285. if !all {
  286. return err
  287. }
  288. errors = append(errors, err)
  289. }
  290. if all {
  291. switch v := interface{}(m.GetSchemeHeaderTransformation()).(type) {
  292. case interface{ ValidateAll() error }:
  293. if err := v.ValidateAll(); err != nil {
  294. errors = append(errors, HttpConnectionManagerValidationError{
  295. field: "SchemeHeaderTransformation",
  296. reason: "embedded message failed validation",
  297. cause: err,
  298. })
  299. }
  300. case interface{ Validate() error }:
  301. if err := v.Validate(); err != nil {
  302. errors = append(errors, HttpConnectionManagerValidationError{
  303. field: "SchemeHeaderTransformation",
  304. reason: "embedded message failed validation",
  305. cause: err,
  306. })
  307. }
  308. }
  309. } else if v, ok := interface{}(m.GetSchemeHeaderTransformation()).(interface{ Validate() error }); ok {
  310. if err := v.Validate(); err != nil {
  311. return HttpConnectionManagerValidationError{
  312. field: "SchemeHeaderTransformation",
  313. reason: "embedded message failed validation",
  314. cause: err,
  315. }
  316. }
  317. }
  318. if wrapper := m.GetMaxRequestHeadersKb(); wrapper != nil {
  319. if val := wrapper.GetValue(); val <= 0 || val > 8192 {
  320. err := HttpConnectionManagerValidationError{
  321. field: "MaxRequestHeadersKb",
  322. reason: "value must be inside range (0, 8192]",
  323. }
  324. if !all {
  325. return err
  326. }
  327. errors = append(errors, err)
  328. }
  329. }
  330. if all {
  331. switch v := interface{}(m.GetStreamIdleTimeout()).(type) {
  332. case interface{ ValidateAll() error }:
  333. if err := v.ValidateAll(); err != nil {
  334. errors = append(errors, HttpConnectionManagerValidationError{
  335. field: "StreamIdleTimeout",
  336. reason: "embedded message failed validation",
  337. cause: err,
  338. })
  339. }
  340. case interface{ Validate() error }:
  341. if err := v.Validate(); err != nil {
  342. errors = append(errors, HttpConnectionManagerValidationError{
  343. field: "StreamIdleTimeout",
  344. reason: "embedded message failed validation",
  345. cause: err,
  346. })
  347. }
  348. }
  349. } else if v, ok := interface{}(m.GetStreamIdleTimeout()).(interface{ Validate() error }); ok {
  350. if err := v.Validate(); err != nil {
  351. return HttpConnectionManagerValidationError{
  352. field: "StreamIdleTimeout",
  353. reason: "embedded message failed validation",
  354. cause: err,
  355. }
  356. }
  357. }
  358. if all {
  359. switch v := interface{}(m.GetRequestTimeout()).(type) {
  360. case interface{ ValidateAll() error }:
  361. if err := v.ValidateAll(); err != nil {
  362. errors = append(errors, HttpConnectionManagerValidationError{
  363. field: "RequestTimeout",
  364. reason: "embedded message failed validation",
  365. cause: err,
  366. })
  367. }
  368. case interface{ Validate() error }:
  369. if err := v.Validate(); err != nil {
  370. errors = append(errors, HttpConnectionManagerValidationError{
  371. field: "RequestTimeout",
  372. reason: "embedded message failed validation",
  373. cause: err,
  374. })
  375. }
  376. }
  377. } else if v, ok := interface{}(m.GetRequestTimeout()).(interface{ Validate() error }); ok {
  378. if err := v.Validate(); err != nil {
  379. return HttpConnectionManagerValidationError{
  380. field: "RequestTimeout",
  381. reason: "embedded message failed validation",
  382. cause: err,
  383. }
  384. }
  385. }
  386. if d := m.GetRequestHeadersTimeout(); d != nil {
  387. dur, err := d.AsDuration(), d.CheckValid()
  388. if err != nil {
  389. err = HttpConnectionManagerValidationError{
  390. field: "RequestHeadersTimeout",
  391. reason: "value is not a valid duration",
  392. cause: err,
  393. }
  394. if !all {
  395. return err
  396. }
  397. errors = append(errors, err)
  398. } else {
  399. gte := time.Duration(0*time.Second + 0*time.Nanosecond)
  400. if dur < gte {
  401. err := HttpConnectionManagerValidationError{
  402. field: "RequestHeadersTimeout",
  403. reason: "value must be greater than or equal to 0s",
  404. }
  405. if !all {
  406. return err
  407. }
  408. errors = append(errors, err)
  409. }
  410. }
  411. }
  412. if all {
  413. switch v := interface{}(m.GetDrainTimeout()).(type) {
  414. case interface{ ValidateAll() error }:
  415. if err := v.ValidateAll(); err != nil {
  416. errors = append(errors, HttpConnectionManagerValidationError{
  417. field: "DrainTimeout",
  418. reason: "embedded message failed validation",
  419. cause: err,
  420. })
  421. }
  422. case interface{ Validate() error }:
  423. if err := v.Validate(); err != nil {
  424. errors = append(errors, HttpConnectionManagerValidationError{
  425. field: "DrainTimeout",
  426. reason: "embedded message failed validation",
  427. cause: err,
  428. })
  429. }
  430. }
  431. } else if v, ok := interface{}(m.GetDrainTimeout()).(interface{ Validate() error }); ok {
  432. if err := v.Validate(); err != nil {
  433. return HttpConnectionManagerValidationError{
  434. field: "DrainTimeout",
  435. reason: "embedded message failed validation",
  436. cause: err,
  437. }
  438. }
  439. }
  440. if all {
  441. switch v := interface{}(m.GetDelayedCloseTimeout()).(type) {
  442. case interface{ ValidateAll() error }:
  443. if err := v.ValidateAll(); err != nil {
  444. errors = append(errors, HttpConnectionManagerValidationError{
  445. field: "DelayedCloseTimeout",
  446. reason: "embedded message failed validation",
  447. cause: err,
  448. })
  449. }
  450. case interface{ Validate() error }:
  451. if err := v.Validate(); err != nil {
  452. errors = append(errors, HttpConnectionManagerValidationError{
  453. field: "DelayedCloseTimeout",
  454. reason: "embedded message failed validation",
  455. cause: err,
  456. })
  457. }
  458. }
  459. } else if v, ok := interface{}(m.GetDelayedCloseTimeout()).(interface{ Validate() error }); ok {
  460. if err := v.Validate(); err != nil {
  461. return HttpConnectionManagerValidationError{
  462. field: "DelayedCloseTimeout",
  463. reason: "embedded message failed validation",
  464. cause: err,
  465. }
  466. }
  467. }
  468. for idx, item := range m.GetAccessLog() {
  469. _, _ = idx, item
  470. if all {
  471. switch v := interface{}(item).(type) {
  472. case interface{ ValidateAll() error }:
  473. if err := v.ValidateAll(); err != nil {
  474. errors = append(errors, HttpConnectionManagerValidationError{
  475. field: fmt.Sprintf("AccessLog[%v]", idx),
  476. reason: "embedded message failed validation",
  477. cause: err,
  478. })
  479. }
  480. case interface{ Validate() error }:
  481. if err := v.Validate(); err != nil {
  482. errors = append(errors, HttpConnectionManagerValidationError{
  483. field: fmt.Sprintf("AccessLog[%v]", idx),
  484. reason: "embedded message failed validation",
  485. cause: err,
  486. })
  487. }
  488. }
  489. } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  490. if err := v.Validate(); err != nil {
  491. return HttpConnectionManagerValidationError{
  492. field: fmt.Sprintf("AccessLog[%v]", idx),
  493. reason: "embedded message failed validation",
  494. cause: err,
  495. }
  496. }
  497. }
  498. }
  499. if all {
  500. switch v := interface{}(m.GetUseRemoteAddress()).(type) {
  501. case interface{ ValidateAll() error }:
  502. if err := v.ValidateAll(); err != nil {
  503. errors = append(errors, HttpConnectionManagerValidationError{
  504. field: "UseRemoteAddress",
  505. reason: "embedded message failed validation",
  506. cause: err,
  507. })
  508. }
  509. case interface{ Validate() error }:
  510. if err := v.Validate(); err != nil {
  511. errors = append(errors, HttpConnectionManagerValidationError{
  512. field: "UseRemoteAddress",
  513. reason: "embedded message failed validation",
  514. cause: err,
  515. })
  516. }
  517. }
  518. } else if v, ok := interface{}(m.GetUseRemoteAddress()).(interface{ Validate() error }); ok {
  519. if err := v.Validate(); err != nil {
  520. return HttpConnectionManagerValidationError{
  521. field: "UseRemoteAddress",
  522. reason: "embedded message failed validation",
  523. cause: err,
  524. }
  525. }
  526. }
  527. // no validation rules for XffNumTrustedHops
  528. for idx, item := range m.GetOriginalIpDetectionExtensions() {
  529. _, _ = idx, item
  530. if all {
  531. switch v := interface{}(item).(type) {
  532. case interface{ ValidateAll() error }:
  533. if err := v.ValidateAll(); err != nil {
  534. errors = append(errors, HttpConnectionManagerValidationError{
  535. field: fmt.Sprintf("OriginalIpDetectionExtensions[%v]", idx),
  536. reason: "embedded message failed validation",
  537. cause: err,
  538. })
  539. }
  540. case interface{ Validate() error }:
  541. if err := v.Validate(); err != nil {
  542. errors = append(errors, HttpConnectionManagerValidationError{
  543. field: fmt.Sprintf("OriginalIpDetectionExtensions[%v]", idx),
  544. reason: "embedded message failed validation",
  545. cause: err,
  546. })
  547. }
  548. }
  549. } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  550. if err := v.Validate(); err != nil {
  551. return HttpConnectionManagerValidationError{
  552. field: fmt.Sprintf("OriginalIpDetectionExtensions[%v]", idx),
  553. reason: "embedded message failed validation",
  554. cause: err,
  555. }
  556. }
  557. }
  558. }
  559. if all {
  560. switch v := interface{}(m.GetInternalAddressConfig()).(type) {
  561. case interface{ ValidateAll() error }:
  562. if err := v.ValidateAll(); err != nil {
  563. errors = append(errors, HttpConnectionManagerValidationError{
  564. field: "InternalAddressConfig",
  565. reason: "embedded message failed validation",
  566. cause: err,
  567. })
  568. }
  569. case interface{ Validate() error }:
  570. if err := v.Validate(); err != nil {
  571. errors = append(errors, HttpConnectionManagerValidationError{
  572. field: "InternalAddressConfig",
  573. reason: "embedded message failed validation",
  574. cause: err,
  575. })
  576. }
  577. }
  578. } else if v, ok := interface{}(m.GetInternalAddressConfig()).(interface{ Validate() error }); ok {
  579. if err := v.Validate(); err != nil {
  580. return HttpConnectionManagerValidationError{
  581. field: "InternalAddressConfig",
  582. reason: "embedded message failed validation",
  583. cause: err,
  584. }
  585. }
  586. }
  587. // no validation rules for SkipXffAppend
  588. if !_HttpConnectionManager_Via_Pattern.MatchString(m.GetVia()) {
  589. err := HttpConnectionManagerValidationError{
  590. field: "Via",
  591. reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
  592. }
  593. if !all {
  594. return err
  595. }
  596. errors = append(errors, err)
  597. }
  598. if all {
  599. switch v := interface{}(m.GetGenerateRequestId()).(type) {
  600. case interface{ ValidateAll() error }:
  601. if err := v.ValidateAll(); err != nil {
  602. errors = append(errors, HttpConnectionManagerValidationError{
  603. field: "GenerateRequestId",
  604. reason: "embedded message failed validation",
  605. cause: err,
  606. })
  607. }
  608. case interface{ Validate() error }:
  609. if err := v.Validate(); err != nil {
  610. errors = append(errors, HttpConnectionManagerValidationError{
  611. field: "GenerateRequestId",
  612. reason: "embedded message failed validation",
  613. cause: err,
  614. })
  615. }
  616. }
  617. } else if v, ok := interface{}(m.GetGenerateRequestId()).(interface{ Validate() error }); ok {
  618. if err := v.Validate(); err != nil {
  619. return HttpConnectionManagerValidationError{
  620. field: "GenerateRequestId",
  621. reason: "embedded message failed validation",
  622. cause: err,
  623. }
  624. }
  625. }
  626. // no validation rules for PreserveExternalRequestId
  627. // no validation rules for AlwaysSetRequestIdInResponse
  628. if _, ok := HttpConnectionManager_ForwardClientCertDetails_name[int32(m.GetForwardClientCertDetails())]; !ok {
  629. err := HttpConnectionManagerValidationError{
  630. field: "ForwardClientCertDetails",
  631. reason: "value must be one of the defined enum values",
  632. }
  633. if !all {
  634. return err
  635. }
  636. errors = append(errors, err)
  637. }
  638. if all {
  639. switch v := interface{}(m.GetSetCurrentClientCertDetails()).(type) {
  640. case interface{ ValidateAll() error }:
  641. if err := v.ValidateAll(); err != nil {
  642. errors = append(errors, HttpConnectionManagerValidationError{
  643. field: "SetCurrentClientCertDetails",
  644. reason: "embedded message failed validation",
  645. cause: err,
  646. })
  647. }
  648. case interface{ Validate() error }:
  649. if err := v.Validate(); err != nil {
  650. errors = append(errors, HttpConnectionManagerValidationError{
  651. field: "SetCurrentClientCertDetails",
  652. reason: "embedded message failed validation",
  653. cause: err,
  654. })
  655. }
  656. }
  657. } else if v, ok := interface{}(m.GetSetCurrentClientCertDetails()).(interface{ Validate() error }); ok {
  658. if err := v.Validate(); err != nil {
  659. return HttpConnectionManagerValidationError{
  660. field: "SetCurrentClientCertDetails",
  661. reason: "embedded message failed validation",
  662. cause: err,
  663. }
  664. }
  665. }
  666. // no validation rules for Proxy_100Continue
  667. // no validation rules for RepresentIpv4RemoteAddressAsIpv4MappedIpv6
  668. for idx, item := range m.GetUpgradeConfigs() {
  669. _, _ = idx, item
  670. if all {
  671. switch v := interface{}(item).(type) {
  672. case interface{ ValidateAll() error }:
  673. if err := v.ValidateAll(); err != nil {
  674. errors = append(errors, HttpConnectionManagerValidationError{
  675. field: fmt.Sprintf("UpgradeConfigs[%v]", idx),
  676. reason: "embedded message failed validation",
  677. cause: err,
  678. })
  679. }
  680. case interface{ Validate() error }:
  681. if err := v.Validate(); err != nil {
  682. errors = append(errors, HttpConnectionManagerValidationError{
  683. field: fmt.Sprintf("UpgradeConfigs[%v]", idx),
  684. reason: "embedded message failed validation",
  685. cause: err,
  686. })
  687. }
  688. }
  689. } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  690. if err := v.Validate(); err != nil {
  691. return HttpConnectionManagerValidationError{
  692. field: fmt.Sprintf("UpgradeConfigs[%v]", idx),
  693. reason: "embedded message failed validation",
  694. cause: err,
  695. }
  696. }
  697. }
  698. }
  699. if all {
  700. switch v := interface{}(m.GetNormalizePath()).(type) {
  701. case interface{ ValidateAll() error }:
  702. if err := v.ValidateAll(); err != nil {
  703. errors = append(errors, HttpConnectionManagerValidationError{
  704. field: "NormalizePath",
  705. reason: "embedded message failed validation",
  706. cause: err,
  707. })
  708. }
  709. case interface{ Validate() error }:
  710. if err := v.Validate(); err != nil {
  711. errors = append(errors, HttpConnectionManagerValidationError{
  712. field: "NormalizePath",
  713. reason: "embedded message failed validation",
  714. cause: err,
  715. })
  716. }
  717. }
  718. } else if v, ok := interface{}(m.GetNormalizePath()).(interface{ Validate() error }); ok {
  719. if err := v.Validate(); err != nil {
  720. return HttpConnectionManagerValidationError{
  721. field: "NormalizePath",
  722. reason: "embedded message failed validation",
  723. cause: err,
  724. }
  725. }
  726. }
  727. // no validation rules for MergeSlashes
  728. // no validation rules for PathWithEscapedSlashesAction
  729. if all {
  730. switch v := interface{}(m.GetRequestIdExtension()).(type) {
  731. case interface{ ValidateAll() error }:
  732. if err := v.ValidateAll(); err != nil {
  733. errors = append(errors, HttpConnectionManagerValidationError{
  734. field: "RequestIdExtension",
  735. reason: "embedded message failed validation",
  736. cause: err,
  737. })
  738. }
  739. case interface{ Validate() error }:
  740. if err := v.Validate(); err != nil {
  741. errors = append(errors, HttpConnectionManagerValidationError{
  742. field: "RequestIdExtension",
  743. reason: "embedded message failed validation",
  744. cause: err,
  745. })
  746. }
  747. }
  748. } else if v, ok := interface{}(m.GetRequestIdExtension()).(interface{ Validate() error }); ok {
  749. if err := v.Validate(); err != nil {
  750. return HttpConnectionManagerValidationError{
  751. field: "RequestIdExtension",
  752. reason: "embedded message failed validation",
  753. cause: err,
  754. }
  755. }
  756. }
  757. if all {
  758. switch v := interface{}(m.GetLocalReplyConfig()).(type) {
  759. case interface{ ValidateAll() error }:
  760. if err := v.ValidateAll(); err != nil {
  761. errors = append(errors, HttpConnectionManagerValidationError{
  762. field: "LocalReplyConfig",
  763. reason: "embedded message failed validation",
  764. cause: err,
  765. })
  766. }
  767. case interface{ Validate() error }:
  768. if err := v.Validate(); err != nil {
  769. errors = append(errors, HttpConnectionManagerValidationError{
  770. field: "LocalReplyConfig",
  771. reason: "embedded message failed validation",
  772. cause: err,
  773. })
  774. }
  775. }
  776. } else if v, ok := interface{}(m.GetLocalReplyConfig()).(interface{ Validate() error }); ok {
  777. if err := v.Validate(); err != nil {
  778. return HttpConnectionManagerValidationError{
  779. field: "LocalReplyConfig",
  780. reason: "embedded message failed validation",
  781. cause: err,
  782. }
  783. }
  784. }
  785. // no validation rules for StripMatchingHostPort
  786. if all {
  787. switch v := interface{}(m.GetStreamErrorOnInvalidHttpMessage()).(type) {
  788. case interface{ ValidateAll() error }:
  789. if err := v.ValidateAll(); err != nil {
  790. errors = append(errors, HttpConnectionManagerValidationError{
  791. field: "StreamErrorOnInvalidHttpMessage",
  792. reason: "embedded message failed validation",
  793. cause: err,
  794. })
  795. }
  796. case interface{ Validate() error }:
  797. if err := v.Validate(); err != nil {
  798. errors = append(errors, HttpConnectionManagerValidationError{
  799. field: "StreamErrorOnInvalidHttpMessage",
  800. reason: "embedded message failed validation",
  801. cause: err,
  802. })
  803. }
  804. }
  805. } else if v, ok := interface{}(m.GetStreamErrorOnInvalidHttpMessage()).(interface{ Validate() error }); ok {
  806. if err := v.Validate(); err != nil {
  807. return HttpConnectionManagerValidationError{
  808. field: "StreamErrorOnInvalidHttpMessage",
  809. reason: "embedded message failed validation",
  810. cause: err,
  811. }
  812. }
  813. }
  814. if all {
  815. switch v := interface{}(m.GetPathNormalizationOptions()).(type) {
  816. case interface{ ValidateAll() error }:
  817. if err := v.ValidateAll(); err != nil {
  818. errors = append(errors, HttpConnectionManagerValidationError{
  819. field: "PathNormalizationOptions",
  820. reason: "embedded message failed validation",
  821. cause: err,
  822. })
  823. }
  824. case interface{ Validate() error }:
  825. if err := v.Validate(); err != nil {
  826. errors = append(errors, HttpConnectionManagerValidationError{
  827. field: "PathNormalizationOptions",
  828. reason: "embedded message failed validation",
  829. cause: err,
  830. })
  831. }
  832. }
  833. } else if v, ok := interface{}(m.GetPathNormalizationOptions()).(interface{ Validate() error }); ok {
  834. if err := v.Validate(); err != nil {
  835. return HttpConnectionManagerValidationError{
  836. field: "PathNormalizationOptions",
  837. reason: "embedded message failed validation",
  838. cause: err,
  839. }
  840. }
  841. }
  842. // no validation rules for StripTrailingHostDot
  843. switch m.RouteSpecifier.(type) {
  844. case *HttpConnectionManager_Rds:
  845. if all {
  846. switch v := interface{}(m.GetRds()).(type) {
  847. case interface{ ValidateAll() error }:
  848. if err := v.ValidateAll(); err != nil {
  849. errors = append(errors, HttpConnectionManagerValidationError{
  850. field: "Rds",
  851. reason: "embedded message failed validation",
  852. cause: err,
  853. })
  854. }
  855. case interface{ Validate() error }:
  856. if err := v.Validate(); err != nil {
  857. errors = append(errors, HttpConnectionManagerValidationError{
  858. field: "Rds",
  859. reason: "embedded message failed validation",
  860. cause: err,
  861. })
  862. }
  863. }
  864. } else if v, ok := interface{}(m.GetRds()).(interface{ Validate() error }); ok {
  865. if err := v.Validate(); err != nil {
  866. return HttpConnectionManagerValidationError{
  867. field: "Rds",
  868. reason: "embedded message failed validation",
  869. cause: err,
  870. }
  871. }
  872. }
  873. case *HttpConnectionManager_RouteConfig:
  874. if all {
  875. switch v := interface{}(m.GetRouteConfig()).(type) {
  876. case interface{ ValidateAll() error }:
  877. if err := v.ValidateAll(); err != nil {
  878. errors = append(errors, HttpConnectionManagerValidationError{
  879. field: "RouteConfig",
  880. reason: "embedded message failed validation",
  881. cause: err,
  882. })
  883. }
  884. case interface{ Validate() error }:
  885. if err := v.Validate(); err != nil {
  886. errors = append(errors, HttpConnectionManagerValidationError{
  887. field: "RouteConfig",
  888. reason: "embedded message failed validation",
  889. cause: err,
  890. })
  891. }
  892. }
  893. } else if v, ok := interface{}(m.GetRouteConfig()).(interface{ Validate() error }); ok {
  894. if err := v.Validate(); err != nil {
  895. return HttpConnectionManagerValidationError{
  896. field: "RouteConfig",
  897. reason: "embedded message failed validation",
  898. cause: err,
  899. }
  900. }
  901. }
  902. case *HttpConnectionManager_ScopedRoutes:
  903. if all {
  904. switch v := interface{}(m.GetScopedRoutes()).(type) {
  905. case interface{ ValidateAll() error }:
  906. if err := v.ValidateAll(); err != nil {
  907. errors = append(errors, HttpConnectionManagerValidationError{
  908. field: "ScopedRoutes",
  909. reason: "embedded message failed validation",
  910. cause: err,
  911. })
  912. }
  913. case interface{ Validate() error }:
  914. if err := v.Validate(); err != nil {
  915. errors = append(errors, HttpConnectionManagerValidationError{
  916. field: "ScopedRoutes",
  917. reason: "embedded message failed validation",
  918. cause: err,
  919. })
  920. }
  921. }
  922. } else if v, ok := interface{}(m.GetScopedRoutes()).(interface{ Validate() error }); ok {
  923. if err := v.Validate(); err != nil {
  924. return HttpConnectionManagerValidationError{
  925. field: "ScopedRoutes",
  926. reason: "embedded message failed validation",
  927. cause: err,
  928. }
  929. }
  930. }
  931. default:
  932. err := HttpConnectionManagerValidationError{
  933. field: "RouteSpecifier",
  934. reason: "value is required",
  935. }
  936. if !all {
  937. return err
  938. }
  939. errors = append(errors, err)
  940. }
  941. switch m.StripPortMode.(type) {
  942. case *HttpConnectionManager_StripAnyHostPort:
  943. // no validation rules for StripAnyHostPort
  944. }
  945. if len(errors) > 0 {
  946. return HttpConnectionManagerMultiError(errors)
  947. }
  948. return nil
  949. }
  950. // HttpConnectionManagerMultiError is an error wrapping multiple validation
  951. // errors returned by HttpConnectionManager.ValidateAll() if the designated
  952. // constraints aren't met.
  953. type HttpConnectionManagerMultiError []error
  954. // Error returns a concatenation of all the error messages it wraps.
  955. func (m HttpConnectionManagerMultiError) Error() string {
  956. var msgs []string
  957. for _, err := range m {
  958. msgs = append(msgs, err.Error())
  959. }
  960. return strings.Join(msgs, "; ")
  961. }
  962. // AllErrors returns a list of validation violation errors.
  963. func (m HttpConnectionManagerMultiError) AllErrors() []error { return m }
  964. // HttpConnectionManagerValidationError is the validation error returned by
  965. // HttpConnectionManager.Validate if the designated constraints aren't met.
  966. type HttpConnectionManagerValidationError struct {
  967. field string
  968. reason string
  969. cause error
  970. key bool
  971. }
  972. // Field function returns field value.
  973. func (e HttpConnectionManagerValidationError) Field() string { return e.field }
  974. // Reason function returns reason value.
  975. func (e HttpConnectionManagerValidationError) Reason() string { return e.reason }
  976. // Cause function returns cause value.
  977. func (e HttpConnectionManagerValidationError) Cause() error { return e.cause }
  978. // Key function returns key value.
  979. func (e HttpConnectionManagerValidationError) Key() bool { return e.key }
  980. // ErrorName returns error name.
  981. func (e HttpConnectionManagerValidationError) ErrorName() string {
  982. return "HttpConnectionManagerValidationError"
  983. }
  984. // Error satisfies the builtin error interface
  985. func (e HttpConnectionManagerValidationError) Error() string {
  986. cause := ""
  987. if e.cause != nil {
  988. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  989. }
  990. key := ""
  991. if e.key {
  992. key = "key for "
  993. }
  994. return fmt.Sprintf(
  995. "invalid %sHttpConnectionManager.%s: %s%s",
  996. key,
  997. e.field,
  998. e.reason,
  999. cause)
  1000. }
  1001. var _ error = HttpConnectionManagerValidationError{}
  1002. var _ interface {
  1003. Field() string
  1004. Reason() string
  1005. Key() bool
  1006. Cause() error
  1007. ErrorName() string
  1008. } = HttpConnectionManagerValidationError{}
  1009. var _HttpConnectionManager_ServerName_Pattern = regexp.MustCompile("^[^\x00\n\r]*$")
  1010. var _HttpConnectionManager_Via_Pattern = regexp.MustCompile("^[^\x00\n\r]*$")
  1011. // Validate checks the field values on LocalReplyConfig with the rules defined
  1012. // in the proto definition for this message. If any rules are violated, the
  1013. // first error encountered is returned, or nil if there are no violations.
  1014. func (m *LocalReplyConfig) Validate() error {
  1015. return m.validate(false)
  1016. }
  1017. // ValidateAll checks the field values on LocalReplyConfig with the rules
  1018. // defined in the proto definition for this message. If any rules are
  1019. // violated, the result is a list of violation errors wrapped in
  1020. // LocalReplyConfigMultiError, or nil if none found.
  1021. func (m *LocalReplyConfig) ValidateAll() error {
  1022. return m.validate(true)
  1023. }
  1024. func (m *LocalReplyConfig) validate(all bool) error {
  1025. if m == nil {
  1026. return nil
  1027. }
  1028. var errors []error
  1029. for idx, item := range m.GetMappers() {
  1030. _, _ = idx, item
  1031. if all {
  1032. switch v := interface{}(item).(type) {
  1033. case interface{ ValidateAll() error }:
  1034. if err := v.ValidateAll(); err != nil {
  1035. errors = append(errors, LocalReplyConfigValidationError{
  1036. field: fmt.Sprintf("Mappers[%v]", idx),
  1037. reason: "embedded message failed validation",
  1038. cause: err,
  1039. })
  1040. }
  1041. case interface{ Validate() error }:
  1042. if err := v.Validate(); err != nil {
  1043. errors = append(errors, LocalReplyConfigValidationError{
  1044. field: fmt.Sprintf("Mappers[%v]", idx),
  1045. reason: "embedded message failed validation",
  1046. cause: err,
  1047. })
  1048. }
  1049. }
  1050. } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  1051. if err := v.Validate(); err != nil {
  1052. return LocalReplyConfigValidationError{
  1053. field: fmt.Sprintf("Mappers[%v]", idx),
  1054. reason: "embedded message failed validation",
  1055. cause: err,
  1056. }
  1057. }
  1058. }
  1059. }
  1060. if all {
  1061. switch v := interface{}(m.GetBodyFormat()).(type) {
  1062. case interface{ ValidateAll() error }:
  1063. if err := v.ValidateAll(); err != nil {
  1064. errors = append(errors, LocalReplyConfigValidationError{
  1065. field: "BodyFormat",
  1066. reason: "embedded message failed validation",
  1067. cause: err,
  1068. })
  1069. }
  1070. case interface{ Validate() error }:
  1071. if err := v.Validate(); err != nil {
  1072. errors = append(errors, LocalReplyConfigValidationError{
  1073. field: "BodyFormat",
  1074. reason: "embedded message failed validation",
  1075. cause: err,
  1076. })
  1077. }
  1078. }
  1079. } else if v, ok := interface{}(m.GetBodyFormat()).(interface{ Validate() error }); ok {
  1080. if err := v.Validate(); err != nil {
  1081. return LocalReplyConfigValidationError{
  1082. field: "BodyFormat",
  1083. reason: "embedded message failed validation",
  1084. cause: err,
  1085. }
  1086. }
  1087. }
  1088. if len(errors) > 0 {
  1089. return LocalReplyConfigMultiError(errors)
  1090. }
  1091. return nil
  1092. }
  1093. // LocalReplyConfigMultiError is an error wrapping multiple validation errors
  1094. // returned by LocalReplyConfig.ValidateAll() if the designated constraints
  1095. // aren't met.
  1096. type LocalReplyConfigMultiError []error
  1097. // Error returns a concatenation of all the error messages it wraps.
  1098. func (m LocalReplyConfigMultiError) Error() string {
  1099. var msgs []string
  1100. for _, err := range m {
  1101. msgs = append(msgs, err.Error())
  1102. }
  1103. return strings.Join(msgs, "; ")
  1104. }
  1105. // AllErrors returns a list of validation violation errors.
  1106. func (m LocalReplyConfigMultiError) AllErrors() []error { return m }
  1107. // LocalReplyConfigValidationError is the validation error returned by
  1108. // LocalReplyConfig.Validate if the designated constraints aren't met.
  1109. type LocalReplyConfigValidationError struct {
  1110. field string
  1111. reason string
  1112. cause error
  1113. key bool
  1114. }
  1115. // Field function returns field value.
  1116. func (e LocalReplyConfigValidationError) Field() string { return e.field }
  1117. // Reason function returns reason value.
  1118. func (e LocalReplyConfigValidationError) Reason() string { return e.reason }
  1119. // Cause function returns cause value.
  1120. func (e LocalReplyConfigValidationError) Cause() error { return e.cause }
  1121. // Key function returns key value.
  1122. func (e LocalReplyConfigValidationError) Key() bool { return e.key }
  1123. // ErrorName returns error name.
  1124. func (e LocalReplyConfigValidationError) ErrorName() string { return "LocalReplyConfigValidationError" }
  1125. // Error satisfies the builtin error interface
  1126. func (e LocalReplyConfigValidationError) Error() string {
  1127. cause := ""
  1128. if e.cause != nil {
  1129. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1130. }
  1131. key := ""
  1132. if e.key {
  1133. key = "key for "
  1134. }
  1135. return fmt.Sprintf(
  1136. "invalid %sLocalReplyConfig.%s: %s%s",
  1137. key,
  1138. e.field,
  1139. e.reason,
  1140. cause)
  1141. }
  1142. var _ error = LocalReplyConfigValidationError{}
  1143. var _ interface {
  1144. Field() string
  1145. Reason() string
  1146. Key() bool
  1147. Cause() error
  1148. ErrorName() string
  1149. } = LocalReplyConfigValidationError{}
  1150. // Validate checks the field values on ResponseMapper with the rules defined in
  1151. // the proto definition for this message. If any rules are violated, the first
  1152. // error encountered is returned, or nil if there are no violations.
  1153. func (m *ResponseMapper) Validate() error {
  1154. return m.validate(false)
  1155. }
  1156. // ValidateAll checks the field values on ResponseMapper with the rules defined
  1157. // in the proto definition for this message. If any rules are violated, the
  1158. // result is a list of violation errors wrapped in ResponseMapperMultiError,
  1159. // or nil if none found.
  1160. func (m *ResponseMapper) ValidateAll() error {
  1161. return m.validate(true)
  1162. }
  1163. func (m *ResponseMapper) validate(all bool) error {
  1164. if m == nil {
  1165. return nil
  1166. }
  1167. var errors []error
  1168. if m.GetFilter() == nil {
  1169. err := ResponseMapperValidationError{
  1170. field: "Filter",
  1171. reason: "value is required",
  1172. }
  1173. if !all {
  1174. return err
  1175. }
  1176. errors = append(errors, err)
  1177. }
  1178. if all {
  1179. switch v := interface{}(m.GetFilter()).(type) {
  1180. case interface{ ValidateAll() error }:
  1181. if err := v.ValidateAll(); err != nil {
  1182. errors = append(errors, ResponseMapperValidationError{
  1183. field: "Filter",
  1184. reason: "embedded message failed validation",
  1185. cause: err,
  1186. })
  1187. }
  1188. case interface{ Validate() error }:
  1189. if err := v.Validate(); err != nil {
  1190. errors = append(errors, ResponseMapperValidationError{
  1191. field: "Filter",
  1192. reason: "embedded message failed validation",
  1193. cause: err,
  1194. })
  1195. }
  1196. }
  1197. } else if v, ok := interface{}(m.GetFilter()).(interface{ Validate() error }); ok {
  1198. if err := v.Validate(); err != nil {
  1199. return ResponseMapperValidationError{
  1200. field: "Filter",
  1201. reason: "embedded message failed validation",
  1202. cause: err,
  1203. }
  1204. }
  1205. }
  1206. if wrapper := m.GetStatusCode(); wrapper != nil {
  1207. if val := wrapper.GetValue(); val < 200 || val >= 600 {
  1208. err := ResponseMapperValidationError{
  1209. field: "StatusCode",
  1210. reason: "value must be inside range [200, 600)",
  1211. }
  1212. if !all {
  1213. return err
  1214. }
  1215. errors = append(errors, err)
  1216. }
  1217. }
  1218. if all {
  1219. switch v := interface{}(m.GetBody()).(type) {
  1220. case interface{ ValidateAll() error }:
  1221. if err := v.ValidateAll(); err != nil {
  1222. errors = append(errors, ResponseMapperValidationError{
  1223. field: "Body",
  1224. reason: "embedded message failed validation",
  1225. cause: err,
  1226. })
  1227. }
  1228. case interface{ Validate() error }:
  1229. if err := v.Validate(); err != nil {
  1230. errors = append(errors, ResponseMapperValidationError{
  1231. field: "Body",
  1232. reason: "embedded message failed validation",
  1233. cause: err,
  1234. })
  1235. }
  1236. }
  1237. } else if v, ok := interface{}(m.GetBody()).(interface{ Validate() error }); ok {
  1238. if err := v.Validate(); err != nil {
  1239. return ResponseMapperValidationError{
  1240. field: "Body",
  1241. reason: "embedded message failed validation",
  1242. cause: err,
  1243. }
  1244. }
  1245. }
  1246. if all {
  1247. switch v := interface{}(m.GetBodyFormatOverride()).(type) {
  1248. case interface{ ValidateAll() error }:
  1249. if err := v.ValidateAll(); err != nil {
  1250. errors = append(errors, ResponseMapperValidationError{
  1251. field: "BodyFormatOverride",
  1252. reason: "embedded message failed validation",
  1253. cause: err,
  1254. })
  1255. }
  1256. case interface{ Validate() error }:
  1257. if err := v.Validate(); err != nil {
  1258. errors = append(errors, ResponseMapperValidationError{
  1259. field: "BodyFormatOverride",
  1260. reason: "embedded message failed validation",
  1261. cause: err,
  1262. })
  1263. }
  1264. }
  1265. } else if v, ok := interface{}(m.GetBodyFormatOverride()).(interface{ Validate() error }); ok {
  1266. if err := v.Validate(); err != nil {
  1267. return ResponseMapperValidationError{
  1268. field: "BodyFormatOverride",
  1269. reason: "embedded message failed validation",
  1270. cause: err,
  1271. }
  1272. }
  1273. }
  1274. if len(m.GetHeadersToAdd()) > 1000 {
  1275. err := ResponseMapperValidationError{
  1276. field: "HeadersToAdd",
  1277. reason: "value must contain no more than 1000 item(s)",
  1278. }
  1279. if !all {
  1280. return err
  1281. }
  1282. errors = append(errors, err)
  1283. }
  1284. for idx, item := range m.GetHeadersToAdd() {
  1285. _, _ = idx, item
  1286. if all {
  1287. switch v := interface{}(item).(type) {
  1288. case interface{ ValidateAll() error }:
  1289. if err := v.ValidateAll(); err != nil {
  1290. errors = append(errors, ResponseMapperValidationError{
  1291. field: fmt.Sprintf("HeadersToAdd[%v]", idx),
  1292. reason: "embedded message failed validation",
  1293. cause: err,
  1294. })
  1295. }
  1296. case interface{ Validate() error }:
  1297. if err := v.Validate(); err != nil {
  1298. errors = append(errors, ResponseMapperValidationError{
  1299. field: fmt.Sprintf("HeadersToAdd[%v]", idx),
  1300. reason: "embedded message failed validation",
  1301. cause: err,
  1302. })
  1303. }
  1304. }
  1305. } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  1306. if err := v.Validate(); err != nil {
  1307. return ResponseMapperValidationError{
  1308. field: fmt.Sprintf("HeadersToAdd[%v]", idx),
  1309. reason: "embedded message failed validation",
  1310. cause: err,
  1311. }
  1312. }
  1313. }
  1314. }
  1315. if len(errors) > 0 {
  1316. return ResponseMapperMultiError(errors)
  1317. }
  1318. return nil
  1319. }
  1320. // ResponseMapperMultiError is an error wrapping multiple validation errors
  1321. // returned by ResponseMapper.ValidateAll() if the designated constraints
  1322. // aren't met.
  1323. type ResponseMapperMultiError []error
  1324. // Error returns a concatenation of all the error messages it wraps.
  1325. func (m ResponseMapperMultiError) Error() string {
  1326. var msgs []string
  1327. for _, err := range m {
  1328. msgs = append(msgs, err.Error())
  1329. }
  1330. return strings.Join(msgs, "; ")
  1331. }
  1332. // AllErrors returns a list of validation violation errors.
  1333. func (m ResponseMapperMultiError) AllErrors() []error { return m }
  1334. // ResponseMapperValidationError is the validation error returned by
  1335. // ResponseMapper.Validate if the designated constraints aren't met.
  1336. type ResponseMapperValidationError struct {
  1337. field string
  1338. reason string
  1339. cause error
  1340. key bool
  1341. }
  1342. // Field function returns field value.
  1343. func (e ResponseMapperValidationError) Field() string { return e.field }
  1344. // Reason function returns reason value.
  1345. func (e ResponseMapperValidationError) Reason() string { return e.reason }
  1346. // Cause function returns cause value.
  1347. func (e ResponseMapperValidationError) Cause() error { return e.cause }
  1348. // Key function returns key value.
  1349. func (e ResponseMapperValidationError) Key() bool { return e.key }
  1350. // ErrorName returns error name.
  1351. func (e ResponseMapperValidationError) ErrorName() string { return "ResponseMapperValidationError" }
  1352. // Error satisfies the builtin error interface
  1353. func (e ResponseMapperValidationError) Error() string {
  1354. cause := ""
  1355. if e.cause != nil {
  1356. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1357. }
  1358. key := ""
  1359. if e.key {
  1360. key = "key for "
  1361. }
  1362. return fmt.Sprintf(
  1363. "invalid %sResponseMapper.%s: %s%s",
  1364. key,
  1365. e.field,
  1366. e.reason,
  1367. cause)
  1368. }
  1369. var _ error = ResponseMapperValidationError{}
  1370. var _ interface {
  1371. Field() string
  1372. Reason() string
  1373. Key() bool
  1374. Cause() error
  1375. ErrorName() string
  1376. } = ResponseMapperValidationError{}
  1377. // Validate checks the field values on Rds with the rules defined in the proto
  1378. // definition for this message. If any rules are violated, the first error
  1379. // encountered is returned, or nil if there are no violations.
  1380. func (m *Rds) Validate() error {
  1381. return m.validate(false)
  1382. }
  1383. // ValidateAll checks the field values on Rds with the rules defined in the
  1384. // proto definition for this message. If any rules are violated, the result is
  1385. // a list of violation errors wrapped in RdsMultiError, or nil if none found.
  1386. func (m *Rds) ValidateAll() error {
  1387. return m.validate(true)
  1388. }
  1389. func (m *Rds) validate(all bool) error {
  1390. if m == nil {
  1391. return nil
  1392. }
  1393. var errors []error
  1394. if m.GetConfigSource() == nil {
  1395. err := RdsValidationError{
  1396. field: "ConfigSource",
  1397. reason: "value is required",
  1398. }
  1399. if !all {
  1400. return err
  1401. }
  1402. errors = append(errors, err)
  1403. }
  1404. if all {
  1405. switch v := interface{}(m.GetConfigSource()).(type) {
  1406. case interface{ ValidateAll() error }:
  1407. if err := v.ValidateAll(); err != nil {
  1408. errors = append(errors, RdsValidationError{
  1409. field: "ConfigSource",
  1410. reason: "embedded message failed validation",
  1411. cause: err,
  1412. })
  1413. }
  1414. case interface{ Validate() error }:
  1415. if err := v.Validate(); err != nil {
  1416. errors = append(errors, RdsValidationError{
  1417. field: "ConfigSource",
  1418. reason: "embedded message failed validation",
  1419. cause: err,
  1420. })
  1421. }
  1422. }
  1423. } else if v, ok := interface{}(m.GetConfigSource()).(interface{ Validate() error }); ok {
  1424. if err := v.Validate(); err != nil {
  1425. return RdsValidationError{
  1426. field: "ConfigSource",
  1427. reason: "embedded message failed validation",
  1428. cause: err,
  1429. }
  1430. }
  1431. }
  1432. // no validation rules for RouteConfigName
  1433. if len(errors) > 0 {
  1434. return RdsMultiError(errors)
  1435. }
  1436. return nil
  1437. }
  1438. // RdsMultiError is an error wrapping multiple validation errors returned by
  1439. // Rds.ValidateAll() if the designated constraints aren't met.
  1440. type RdsMultiError []error
  1441. // Error returns a concatenation of all the error messages it wraps.
  1442. func (m RdsMultiError) Error() string {
  1443. var msgs []string
  1444. for _, err := range m {
  1445. msgs = append(msgs, err.Error())
  1446. }
  1447. return strings.Join(msgs, "; ")
  1448. }
  1449. // AllErrors returns a list of validation violation errors.
  1450. func (m RdsMultiError) AllErrors() []error { return m }
  1451. // RdsValidationError is the validation error returned by Rds.Validate if the
  1452. // designated constraints aren't met.
  1453. type RdsValidationError struct {
  1454. field string
  1455. reason string
  1456. cause error
  1457. key bool
  1458. }
  1459. // Field function returns field value.
  1460. func (e RdsValidationError) Field() string { return e.field }
  1461. // Reason function returns reason value.
  1462. func (e RdsValidationError) Reason() string { return e.reason }
  1463. // Cause function returns cause value.
  1464. func (e RdsValidationError) Cause() error { return e.cause }
  1465. // Key function returns key value.
  1466. func (e RdsValidationError) Key() bool { return e.key }
  1467. // ErrorName returns error name.
  1468. func (e RdsValidationError) ErrorName() string { return "RdsValidationError" }
  1469. // Error satisfies the builtin error interface
  1470. func (e RdsValidationError) Error() string {
  1471. cause := ""
  1472. if e.cause != nil {
  1473. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1474. }
  1475. key := ""
  1476. if e.key {
  1477. key = "key for "
  1478. }
  1479. return fmt.Sprintf(
  1480. "invalid %sRds.%s: %s%s",
  1481. key,
  1482. e.field,
  1483. e.reason,
  1484. cause)
  1485. }
  1486. var _ error = RdsValidationError{}
  1487. var _ interface {
  1488. Field() string
  1489. Reason() string
  1490. Key() bool
  1491. Cause() error
  1492. ErrorName() string
  1493. } = RdsValidationError{}
  1494. // Validate checks the field values on ScopedRouteConfigurationsList with the
  1495. // rules defined in the proto definition for this message. If any rules are
  1496. // violated, the first error encountered is returned, or nil if there are no violations.
  1497. func (m *ScopedRouteConfigurationsList) Validate() error {
  1498. return m.validate(false)
  1499. }
  1500. // ValidateAll checks the field values on ScopedRouteConfigurationsList with
  1501. // the rules defined in the proto definition for this message. If any rules
  1502. // are violated, the result is a list of violation errors wrapped in
  1503. // ScopedRouteConfigurationsListMultiError, or nil if none found.
  1504. func (m *ScopedRouteConfigurationsList) ValidateAll() error {
  1505. return m.validate(true)
  1506. }
  1507. func (m *ScopedRouteConfigurationsList) validate(all bool) error {
  1508. if m == nil {
  1509. return nil
  1510. }
  1511. var errors []error
  1512. if len(m.GetScopedRouteConfigurations()) < 1 {
  1513. err := ScopedRouteConfigurationsListValidationError{
  1514. field: "ScopedRouteConfigurations",
  1515. reason: "value must contain at least 1 item(s)",
  1516. }
  1517. if !all {
  1518. return err
  1519. }
  1520. errors = append(errors, err)
  1521. }
  1522. for idx, item := range m.GetScopedRouteConfigurations() {
  1523. _, _ = idx, item
  1524. if all {
  1525. switch v := interface{}(item).(type) {
  1526. case interface{ ValidateAll() error }:
  1527. if err := v.ValidateAll(); err != nil {
  1528. errors = append(errors, ScopedRouteConfigurationsListValidationError{
  1529. field: fmt.Sprintf("ScopedRouteConfigurations[%v]", idx),
  1530. reason: "embedded message failed validation",
  1531. cause: err,
  1532. })
  1533. }
  1534. case interface{ Validate() error }:
  1535. if err := v.Validate(); err != nil {
  1536. errors = append(errors, ScopedRouteConfigurationsListValidationError{
  1537. field: fmt.Sprintf("ScopedRouteConfigurations[%v]", idx),
  1538. reason: "embedded message failed validation",
  1539. cause: err,
  1540. })
  1541. }
  1542. }
  1543. } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  1544. if err := v.Validate(); err != nil {
  1545. return ScopedRouteConfigurationsListValidationError{
  1546. field: fmt.Sprintf("ScopedRouteConfigurations[%v]", idx),
  1547. reason: "embedded message failed validation",
  1548. cause: err,
  1549. }
  1550. }
  1551. }
  1552. }
  1553. if len(errors) > 0 {
  1554. return ScopedRouteConfigurationsListMultiError(errors)
  1555. }
  1556. return nil
  1557. }
  1558. // ScopedRouteConfigurationsListMultiError is an error wrapping multiple
  1559. // validation errors returned by ScopedRouteConfigurationsList.ValidateAll()
  1560. // if the designated constraints aren't met.
  1561. type ScopedRouteConfigurationsListMultiError []error
  1562. // Error returns a concatenation of all the error messages it wraps.
  1563. func (m ScopedRouteConfigurationsListMultiError) Error() string {
  1564. var msgs []string
  1565. for _, err := range m {
  1566. msgs = append(msgs, err.Error())
  1567. }
  1568. return strings.Join(msgs, "; ")
  1569. }
  1570. // AllErrors returns a list of validation violation errors.
  1571. func (m ScopedRouteConfigurationsListMultiError) AllErrors() []error { return m }
  1572. // ScopedRouteConfigurationsListValidationError is the validation error
  1573. // returned by ScopedRouteConfigurationsList.Validate if the designated
  1574. // constraints aren't met.
  1575. type ScopedRouteConfigurationsListValidationError struct {
  1576. field string
  1577. reason string
  1578. cause error
  1579. key bool
  1580. }
  1581. // Field function returns field value.
  1582. func (e ScopedRouteConfigurationsListValidationError) Field() string { return e.field }
  1583. // Reason function returns reason value.
  1584. func (e ScopedRouteConfigurationsListValidationError) Reason() string { return e.reason }
  1585. // Cause function returns cause value.
  1586. func (e ScopedRouteConfigurationsListValidationError) Cause() error { return e.cause }
  1587. // Key function returns key value.
  1588. func (e ScopedRouteConfigurationsListValidationError) Key() bool { return e.key }
  1589. // ErrorName returns error name.
  1590. func (e ScopedRouteConfigurationsListValidationError) ErrorName() string {
  1591. return "ScopedRouteConfigurationsListValidationError"
  1592. }
  1593. // Error satisfies the builtin error interface
  1594. func (e ScopedRouteConfigurationsListValidationError) Error() string {
  1595. cause := ""
  1596. if e.cause != nil {
  1597. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1598. }
  1599. key := ""
  1600. if e.key {
  1601. key = "key for "
  1602. }
  1603. return fmt.Sprintf(
  1604. "invalid %sScopedRouteConfigurationsList.%s: %s%s",
  1605. key,
  1606. e.field,
  1607. e.reason,
  1608. cause)
  1609. }
  1610. var _ error = ScopedRouteConfigurationsListValidationError{}
  1611. var _ interface {
  1612. Field() string
  1613. Reason() string
  1614. Key() bool
  1615. Cause() error
  1616. ErrorName() string
  1617. } = ScopedRouteConfigurationsListValidationError{}
  1618. // Validate checks the field values on ScopedRoutes with the rules defined in
  1619. // the proto definition for this message. If any rules are violated, the first
  1620. // error encountered is returned, or nil if there are no violations.
  1621. func (m *ScopedRoutes) Validate() error {
  1622. return m.validate(false)
  1623. }
  1624. // ValidateAll checks the field values on ScopedRoutes with the rules defined
  1625. // in the proto definition for this message. If any rules are violated, the
  1626. // result is a list of violation errors wrapped in ScopedRoutesMultiError, or
  1627. // nil if none found.
  1628. func (m *ScopedRoutes) ValidateAll() error {
  1629. return m.validate(true)
  1630. }
  1631. func (m *ScopedRoutes) validate(all bool) error {
  1632. if m == nil {
  1633. return nil
  1634. }
  1635. var errors []error
  1636. if utf8.RuneCountInString(m.GetName()) < 1 {
  1637. err := ScopedRoutesValidationError{
  1638. field: "Name",
  1639. reason: "value length must be at least 1 runes",
  1640. }
  1641. if !all {
  1642. return err
  1643. }
  1644. errors = append(errors, err)
  1645. }
  1646. if m.GetScopeKeyBuilder() == nil {
  1647. err := ScopedRoutesValidationError{
  1648. field: "ScopeKeyBuilder",
  1649. reason: "value is required",
  1650. }
  1651. if !all {
  1652. return err
  1653. }
  1654. errors = append(errors, err)
  1655. }
  1656. if all {
  1657. switch v := interface{}(m.GetScopeKeyBuilder()).(type) {
  1658. case interface{ ValidateAll() error }:
  1659. if err := v.ValidateAll(); err != nil {
  1660. errors = append(errors, ScopedRoutesValidationError{
  1661. field: "ScopeKeyBuilder",
  1662. reason: "embedded message failed validation",
  1663. cause: err,
  1664. })
  1665. }
  1666. case interface{ Validate() error }:
  1667. if err := v.Validate(); err != nil {
  1668. errors = append(errors, ScopedRoutesValidationError{
  1669. field: "ScopeKeyBuilder",
  1670. reason: "embedded message failed validation",
  1671. cause: err,
  1672. })
  1673. }
  1674. }
  1675. } else if v, ok := interface{}(m.GetScopeKeyBuilder()).(interface{ Validate() error }); ok {
  1676. if err := v.Validate(); err != nil {
  1677. return ScopedRoutesValidationError{
  1678. field: "ScopeKeyBuilder",
  1679. reason: "embedded message failed validation",
  1680. cause: err,
  1681. }
  1682. }
  1683. }
  1684. if all {
  1685. switch v := interface{}(m.GetRdsConfigSource()).(type) {
  1686. case interface{ ValidateAll() error }:
  1687. if err := v.ValidateAll(); err != nil {
  1688. errors = append(errors, ScopedRoutesValidationError{
  1689. field: "RdsConfigSource",
  1690. reason: "embedded message failed validation",
  1691. cause: err,
  1692. })
  1693. }
  1694. case interface{ Validate() error }:
  1695. if err := v.Validate(); err != nil {
  1696. errors = append(errors, ScopedRoutesValidationError{
  1697. field: "RdsConfigSource",
  1698. reason: "embedded message failed validation",
  1699. cause: err,
  1700. })
  1701. }
  1702. }
  1703. } else if v, ok := interface{}(m.GetRdsConfigSource()).(interface{ Validate() error }); ok {
  1704. if err := v.Validate(); err != nil {
  1705. return ScopedRoutesValidationError{
  1706. field: "RdsConfigSource",
  1707. reason: "embedded message failed validation",
  1708. cause: err,
  1709. }
  1710. }
  1711. }
  1712. switch m.ConfigSpecifier.(type) {
  1713. case *ScopedRoutes_ScopedRouteConfigurationsList:
  1714. if all {
  1715. switch v := interface{}(m.GetScopedRouteConfigurationsList()).(type) {
  1716. case interface{ ValidateAll() error }:
  1717. if err := v.ValidateAll(); err != nil {
  1718. errors = append(errors, ScopedRoutesValidationError{
  1719. field: "ScopedRouteConfigurationsList",
  1720. reason: "embedded message failed validation",
  1721. cause: err,
  1722. })
  1723. }
  1724. case interface{ Validate() error }:
  1725. if err := v.Validate(); err != nil {
  1726. errors = append(errors, ScopedRoutesValidationError{
  1727. field: "ScopedRouteConfigurationsList",
  1728. reason: "embedded message failed validation",
  1729. cause: err,
  1730. })
  1731. }
  1732. }
  1733. } else if v, ok := interface{}(m.GetScopedRouteConfigurationsList()).(interface{ Validate() error }); ok {
  1734. if err := v.Validate(); err != nil {
  1735. return ScopedRoutesValidationError{
  1736. field: "ScopedRouteConfigurationsList",
  1737. reason: "embedded message failed validation",
  1738. cause: err,
  1739. }
  1740. }
  1741. }
  1742. case *ScopedRoutes_ScopedRds:
  1743. if all {
  1744. switch v := interface{}(m.GetScopedRds()).(type) {
  1745. case interface{ ValidateAll() error }:
  1746. if err := v.ValidateAll(); err != nil {
  1747. errors = append(errors, ScopedRoutesValidationError{
  1748. field: "ScopedRds",
  1749. reason: "embedded message failed validation",
  1750. cause: err,
  1751. })
  1752. }
  1753. case interface{ Validate() error }:
  1754. if err := v.Validate(); err != nil {
  1755. errors = append(errors, ScopedRoutesValidationError{
  1756. field: "ScopedRds",
  1757. reason: "embedded message failed validation",
  1758. cause: err,
  1759. })
  1760. }
  1761. }
  1762. } else if v, ok := interface{}(m.GetScopedRds()).(interface{ Validate() error }); ok {
  1763. if err := v.Validate(); err != nil {
  1764. return ScopedRoutesValidationError{
  1765. field: "ScopedRds",
  1766. reason: "embedded message failed validation",
  1767. cause: err,
  1768. }
  1769. }
  1770. }
  1771. default:
  1772. err := ScopedRoutesValidationError{
  1773. field: "ConfigSpecifier",
  1774. reason: "value is required",
  1775. }
  1776. if !all {
  1777. return err
  1778. }
  1779. errors = append(errors, err)
  1780. }
  1781. if len(errors) > 0 {
  1782. return ScopedRoutesMultiError(errors)
  1783. }
  1784. return nil
  1785. }
  1786. // ScopedRoutesMultiError is an error wrapping multiple validation errors
  1787. // returned by ScopedRoutes.ValidateAll() if the designated constraints aren't met.
  1788. type ScopedRoutesMultiError []error
  1789. // Error returns a concatenation of all the error messages it wraps.
  1790. func (m ScopedRoutesMultiError) Error() string {
  1791. var msgs []string
  1792. for _, err := range m {
  1793. msgs = append(msgs, err.Error())
  1794. }
  1795. return strings.Join(msgs, "; ")
  1796. }
  1797. // AllErrors returns a list of validation violation errors.
  1798. func (m ScopedRoutesMultiError) AllErrors() []error { return m }
  1799. // ScopedRoutesValidationError is the validation error returned by
  1800. // ScopedRoutes.Validate if the designated constraints aren't met.
  1801. type ScopedRoutesValidationError struct {
  1802. field string
  1803. reason string
  1804. cause error
  1805. key bool
  1806. }
  1807. // Field function returns field value.
  1808. func (e ScopedRoutesValidationError) Field() string { return e.field }
  1809. // Reason function returns reason value.
  1810. func (e ScopedRoutesValidationError) Reason() string { return e.reason }
  1811. // Cause function returns cause value.
  1812. func (e ScopedRoutesValidationError) Cause() error { return e.cause }
  1813. // Key function returns key value.
  1814. func (e ScopedRoutesValidationError) Key() bool { return e.key }
  1815. // ErrorName returns error name.
  1816. func (e ScopedRoutesValidationError) ErrorName() string { return "ScopedRoutesValidationError" }
  1817. // Error satisfies the builtin error interface
  1818. func (e ScopedRoutesValidationError) Error() string {
  1819. cause := ""
  1820. if e.cause != nil {
  1821. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1822. }
  1823. key := ""
  1824. if e.key {
  1825. key = "key for "
  1826. }
  1827. return fmt.Sprintf(
  1828. "invalid %sScopedRoutes.%s: %s%s",
  1829. key,
  1830. e.field,
  1831. e.reason,
  1832. cause)
  1833. }
  1834. var _ error = ScopedRoutesValidationError{}
  1835. var _ interface {
  1836. Field() string
  1837. Reason() string
  1838. Key() bool
  1839. Cause() error
  1840. ErrorName() string
  1841. } = ScopedRoutesValidationError{}
  1842. // Validate checks the field values on ScopedRds with the rules defined in the
  1843. // proto definition for this message. If any rules are violated, the first
  1844. // error encountered is returned, or nil if there are no violations.
  1845. func (m *ScopedRds) Validate() error {
  1846. return m.validate(false)
  1847. }
  1848. // ValidateAll checks the field values on ScopedRds with the rules defined in
  1849. // the proto definition for this message. If any rules are violated, the
  1850. // result is a list of violation errors wrapped in ScopedRdsMultiError, or nil
  1851. // if none found.
  1852. func (m *ScopedRds) ValidateAll() error {
  1853. return m.validate(true)
  1854. }
  1855. func (m *ScopedRds) validate(all bool) error {
  1856. if m == nil {
  1857. return nil
  1858. }
  1859. var errors []error
  1860. if m.GetScopedRdsConfigSource() == nil {
  1861. err := ScopedRdsValidationError{
  1862. field: "ScopedRdsConfigSource",
  1863. reason: "value is required",
  1864. }
  1865. if !all {
  1866. return err
  1867. }
  1868. errors = append(errors, err)
  1869. }
  1870. if all {
  1871. switch v := interface{}(m.GetScopedRdsConfigSource()).(type) {
  1872. case interface{ ValidateAll() error }:
  1873. if err := v.ValidateAll(); err != nil {
  1874. errors = append(errors, ScopedRdsValidationError{
  1875. field: "ScopedRdsConfigSource",
  1876. reason: "embedded message failed validation",
  1877. cause: err,
  1878. })
  1879. }
  1880. case interface{ Validate() error }:
  1881. if err := v.Validate(); err != nil {
  1882. errors = append(errors, ScopedRdsValidationError{
  1883. field: "ScopedRdsConfigSource",
  1884. reason: "embedded message failed validation",
  1885. cause: err,
  1886. })
  1887. }
  1888. }
  1889. } else if v, ok := interface{}(m.GetScopedRdsConfigSource()).(interface{ Validate() error }); ok {
  1890. if err := v.Validate(); err != nil {
  1891. return ScopedRdsValidationError{
  1892. field: "ScopedRdsConfigSource",
  1893. reason: "embedded message failed validation",
  1894. cause: err,
  1895. }
  1896. }
  1897. }
  1898. // no validation rules for SrdsResourcesLocator
  1899. if len(errors) > 0 {
  1900. return ScopedRdsMultiError(errors)
  1901. }
  1902. return nil
  1903. }
  1904. // ScopedRdsMultiError is an error wrapping multiple validation errors returned
  1905. // by ScopedRds.ValidateAll() if the designated constraints aren't met.
  1906. type ScopedRdsMultiError []error
  1907. // Error returns a concatenation of all the error messages it wraps.
  1908. func (m ScopedRdsMultiError) Error() string {
  1909. var msgs []string
  1910. for _, err := range m {
  1911. msgs = append(msgs, err.Error())
  1912. }
  1913. return strings.Join(msgs, "; ")
  1914. }
  1915. // AllErrors returns a list of validation violation errors.
  1916. func (m ScopedRdsMultiError) AllErrors() []error { return m }
  1917. // ScopedRdsValidationError is the validation error returned by
  1918. // ScopedRds.Validate if the designated constraints aren't met.
  1919. type ScopedRdsValidationError struct {
  1920. field string
  1921. reason string
  1922. cause error
  1923. key bool
  1924. }
  1925. // Field function returns field value.
  1926. func (e ScopedRdsValidationError) Field() string { return e.field }
  1927. // Reason function returns reason value.
  1928. func (e ScopedRdsValidationError) Reason() string { return e.reason }
  1929. // Cause function returns cause value.
  1930. func (e ScopedRdsValidationError) Cause() error { return e.cause }
  1931. // Key function returns key value.
  1932. func (e ScopedRdsValidationError) Key() bool { return e.key }
  1933. // ErrorName returns error name.
  1934. func (e ScopedRdsValidationError) ErrorName() string { return "ScopedRdsValidationError" }
  1935. // Error satisfies the builtin error interface
  1936. func (e ScopedRdsValidationError) Error() string {
  1937. cause := ""
  1938. if e.cause != nil {
  1939. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1940. }
  1941. key := ""
  1942. if e.key {
  1943. key = "key for "
  1944. }
  1945. return fmt.Sprintf(
  1946. "invalid %sScopedRds.%s: %s%s",
  1947. key,
  1948. e.field,
  1949. e.reason,
  1950. cause)
  1951. }
  1952. var _ error = ScopedRdsValidationError{}
  1953. var _ interface {
  1954. Field() string
  1955. Reason() string
  1956. Key() bool
  1957. Cause() error
  1958. ErrorName() string
  1959. } = ScopedRdsValidationError{}
  1960. // Validate checks the field values on HttpFilter with the rules defined in the
  1961. // proto definition for this message. If any rules are violated, the first
  1962. // error encountered is returned, or nil if there are no violations.
  1963. func (m *HttpFilter) Validate() error {
  1964. return m.validate(false)
  1965. }
  1966. // ValidateAll checks the field values on HttpFilter with the rules defined in
  1967. // the proto definition for this message. If any rules are violated, the
  1968. // result is a list of violation errors wrapped in HttpFilterMultiError, or
  1969. // nil if none found.
  1970. func (m *HttpFilter) ValidateAll() error {
  1971. return m.validate(true)
  1972. }
  1973. func (m *HttpFilter) validate(all bool) error {
  1974. if m == nil {
  1975. return nil
  1976. }
  1977. var errors []error
  1978. if utf8.RuneCountInString(m.GetName()) < 1 {
  1979. err := HttpFilterValidationError{
  1980. field: "Name",
  1981. reason: "value length must be at least 1 runes",
  1982. }
  1983. if !all {
  1984. return err
  1985. }
  1986. errors = append(errors, err)
  1987. }
  1988. // no validation rules for IsOptional
  1989. switch m.ConfigType.(type) {
  1990. case *HttpFilter_TypedConfig:
  1991. if all {
  1992. switch v := interface{}(m.GetTypedConfig()).(type) {
  1993. case interface{ ValidateAll() error }:
  1994. if err := v.ValidateAll(); err != nil {
  1995. errors = append(errors, HttpFilterValidationError{
  1996. field: "TypedConfig",
  1997. reason: "embedded message failed validation",
  1998. cause: err,
  1999. })
  2000. }
  2001. case interface{ Validate() error }:
  2002. if err := v.Validate(); err != nil {
  2003. errors = append(errors, HttpFilterValidationError{
  2004. field: "TypedConfig",
  2005. reason: "embedded message failed validation",
  2006. cause: err,
  2007. })
  2008. }
  2009. }
  2010. } else if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok {
  2011. if err := v.Validate(); err != nil {
  2012. return HttpFilterValidationError{
  2013. field: "TypedConfig",
  2014. reason: "embedded message failed validation",
  2015. cause: err,
  2016. }
  2017. }
  2018. }
  2019. case *HttpFilter_ConfigDiscovery:
  2020. if all {
  2021. switch v := interface{}(m.GetConfigDiscovery()).(type) {
  2022. case interface{ ValidateAll() error }:
  2023. if err := v.ValidateAll(); err != nil {
  2024. errors = append(errors, HttpFilterValidationError{
  2025. field: "ConfigDiscovery",
  2026. reason: "embedded message failed validation",
  2027. cause: err,
  2028. })
  2029. }
  2030. case interface{ Validate() error }:
  2031. if err := v.Validate(); err != nil {
  2032. errors = append(errors, HttpFilterValidationError{
  2033. field: "ConfigDiscovery",
  2034. reason: "embedded message failed validation",
  2035. cause: err,
  2036. })
  2037. }
  2038. }
  2039. } else if v, ok := interface{}(m.GetConfigDiscovery()).(interface{ Validate() error }); ok {
  2040. if err := v.Validate(); err != nil {
  2041. return HttpFilterValidationError{
  2042. field: "ConfigDiscovery",
  2043. reason: "embedded message failed validation",
  2044. cause: err,
  2045. }
  2046. }
  2047. }
  2048. }
  2049. if len(errors) > 0 {
  2050. return HttpFilterMultiError(errors)
  2051. }
  2052. return nil
  2053. }
  2054. // HttpFilterMultiError is an error wrapping multiple validation errors
  2055. // returned by HttpFilter.ValidateAll() if the designated constraints aren't met.
  2056. type HttpFilterMultiError []error
  2057. // Error returns a concatenation of all the error messages it wraps.
  2058. func (m HttpFilterMultiError) Error() string {
  2059. var msgs []string
  2060. for _, err := range m {
  2061. msgs = append(msgs, err.Error())
  2062. }
  2063. return strings.Join(msgs, "; ")
  2064. }
  2065. // AllErrors returns a list of validation violation errors.
  2066. func (m HttpFilterMultiError) AllErrors() []error { return m }
  2067. // HttpFilterValidationError is the validation error returned by
  2068. // HttpFilter.Validate if the designated constraints aren't met.
  2069. type HttpFilterValidationError struct {
  2070. field string
  2071. reason string
  2072. cause error
  2073. key bool
  2074. }
  2075. // Field function returns field value.
  2076. func (e HttpFilterValidationError) Field() string { return e.field }
  2077. // Reason function returns reason value.
  2078. func (e HttpFilterValidationError) Reason() string { return e.reason }
  2079. // Cause function returns cause value.
  2080. func (e HttpFilterValidationError) Cause() error { return e.cause }
  2081. // Key function returns key value.
  2082. func (e HttpFilterValidationError) Key() bool { return e.key }
  2083. // ErrorName returns error name.
  2084. func (e HttpFilterValidationError) ErrorName() string { return "HttpFilterValidationError" }
  2085. // Error satisfies the builtin error interface
  2086. func (e HttpFilterValidationError) Error() string {
  2087. cause := ""
  2088. if e.cause != nil {
  2089. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  2090. }
  2091. key := ""
  2092. if e.key {
  2093. key = "key for "
  2094. }
  2095. return fmt.Sprintf(
  2096. "invalid %sHttpFilter.%s: %s%s",
  2097. key,
  2098. e.field,
  2099. e.reason,
  2100. cause)
  2101. }
  2102. var _ error = HttpFilterValidationError{}
  2103. var _ interface {
  2104. Field() string
  2105. Reason() string
  2106. Key() bool
  2107. Cause() error
  2108. ErrorName() string
  2109. } = HttpFilterValidationError{}
  2110. // Validate checks the field values on RequestIDExtension with the rules
  2111. // defined in the proto definition for this message. If any rules are
  2112. // violated, the first error encountered is returned, or nil if there are no violations.
  2113. func (m *RequestIDExtension) Validate() error {
  2114. return m.validate(false)
  2115. }
  2116. // ValidateAll checks the field values on RequestIDExtension with the rules
  2117. // defined in the proto definition for this message. If any rules are
  2118. // violated, the result is a list of violation errors wrapped in
  2119. // RequestIDExtensionMultiError, or nil if none found.
  2120. func (m *RequestIDExtension) ValidateAll() error {
  2121. return m.validate(true)
  2122. }
  2123. func (m *RequestIDExtension) validate(all bool) error {
  2124. if m == nil {
  2125. return nil
  2126. }
  2127. var errors []error
  2128. if all {
  2129. switch v := interface{}(m.GetTypedConfig()).(type) {
  2130. case interface{ ValidateAll() error }:
  2131. if err := v.ValidateAll(); err != nil {
  2132. errors = append(errors, RequestIDExtensionValidationError{
  2133. field: "TypedConfig",
  2134. reason: "embedded message failed validation",
  2135. cause: err,
  2136. })
  2137. }
  2138. case interface{ Validate() error }:
  2139. if err := v.Validate(); err != nil {
  2140. errors = append(errors, RequestIDExtensionValidationError{
  2141. field: "TypedConfig",
  2142. reason: "embedded message failed validation",
  2143. cause: err,
  2144. })
  2145. }
  2146. }
  2147. } else if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok {
  2148. if err := v.Validate(); err != nil {
  2149. return RequestIDExtensionValidationError{
  2150. field: "TypedConfig",
  2151. reason: "embedded message failed validation",
  2152. cause: err,
  2153. }
  2154. }
  2155. }
  2156. if len(errors) > 0 {
  2157. return RequestIDExtensionMultiError(errors)
  2158. }
  2159. return nil
  2160. }
  2161. // RequestIDExtensionMultiError is an error wrapping multiple validation errors
  2162. // returned by RequestIDExtension.ValidateAll() if the designated constraints
  2163. // aren't met.
  2164. type RequestIDExtensionMultiError []error
  2165. // Error returns a concatenation of all the error messages it wraps.
  2166. func (m RequestIDExtensionMultiError) Error() string {
  2167. var msgs []string
  2168. for _, err := range m {
  2169. msgs = append(msgs, err.Error())
  2170. }
  2171. return strings.Join(msgs, "; ")
  2172. }
  2173. // AllErrors returns a list of validation violation errors.
  2174. func (m RequestIDExtensionMultiError) AllErrors() []error { return m }
  2175. // RequestIDExtensionValidationError is the validation error returned by
  2176. // RequestIDExtension.Validate if the designated constraints aren't met.
  2177. type RequestIDExtensionValidationError struct {
  2178. field string
  2179. reason string
  2180. cause error
  2181. key bool
  2182. }
  2183. // Field function returns field value.
  2184. func (e RequestIDExtensionValidationError) Field() string { return e.field }
  2185. // Reason function returns reason value.
  2186. func (e RequestIDExtensionValidationError) Reason() string { return e.reason }
  2187. // Cause function returns cause value.
  2188. func (e RequestIDExtensionValidationError) Cause() error { return e.cause }
  2189. // Key function returns key value.
  2190. func (e RequestIDExtensionValidationError) Key() bool { return e.key }
  2191. // ErrorName returns error name.
  2192. func (e RequestIDExtensionValidationError) ErrorName() string {
  2193. return "RequestIDExtensionValidationError"
  2194. }
  2195. // Error satisfies the builtin error interface
  2196. func (e RequestIDExtensionValidationError) Error() string {
  2197. cause := ""
  2198. if e.cause != nil {
  2199. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  2200. }
  2201. key := ""
  2202. if e.key {
  2203. key = "key for "
  2204. }
  2205. return fmt.Sprintf(
  2206. "invalid %sRequestIDExtension.%s: %s%s",
  2207. key,
  2208. e.field,
  2209. e.reason,
  2210. cause)
  2211. }
  2212. var _ error = RequestIDExtensionValidationError{}
  2213. var _ interface {
  2214. Field() string
  2215. Reason() string
  2216. Key() bool
  2217. Cause() error
  2218. ErrorName() string
  2219. } = RequestIDExtensionValidationError{}
  2220. // Validate checks the field values on EnvoyMobileHttpConnectionManager with
  2221. // the rules defined in the proto definition for this message. If any rules
  2222. // are violated, the first error encountered is returned, or nil if there are
  2223. // no violations.
  2224. func (m *EnvoyMobileHttpConnectionManager) Validate() error {
  2225. return m.validate(false)
  2226. }
  2227. // ValidateAll checks the field values on EnvoyMobileHttpConnectionManager with
  2228. // the rules defined in the proto definition for this message. If any rules
  2229. // are violated, the result is a list of violation errors wrapped in
  2230. // EnvoyMobileHttpConnectionManagerMultiError, or nil if none found.
  2231. func (m *EnvoyMobileHttpConnectionManager) ValidateAll() error {
  2232. return m.validate(true)
  2233. }
  2234. func (m *EnvoyMobileHttpConnectionManager) validate(all bool) error {
  2235. if m == nil {
  2236. return nil
  2237. }
  2238. var errors []error
  2239. if all {
  2240. switch v := interface{}(m.GetConfig()).(type) {
  2241. case interface{ ValidateAll() error }:
  2242. if err := v.ValidateAll(); err != nil {
  2243. errors = append(errors, EnvoyMobileHttpConnectionManagerValidationError{
  2244. field: "Config",
  2245. reason: "embedded message failed validation",
  2246. cause: err,
  2247. })
  2248. }
  2249. case interface{ Validate() error }:
  2250. if err := v.Validate(); err != nil {
  2251. errors = append(errors, EnvoyMobileHttpConnectionManagerValidationError{
  2252. field: "Config",
  2253. reason: "embedded message failed validation",
  2254. cause: err,
  2255. })
  2256. }
  2257. }
  2258. } else if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok {
  2259. if err := v.Validate(); err != nil {
  2260. return EnvoyMobileHttpConnectionManagerValidationError{
  2261. field: "Config",
  2262. reason: "embedded message failed validation",
  2263. cause: err,
  2264. }
  2265. }
  2266. }
  2267. if len(errors) > 0 {
  2268. return EnvoyMobileHttpConnectionManagerMultiError(errors)
  2269. }
  2270. return nil
  2271. }
  2272. // EnvoyMobileHttpConnectionManagerMultiError is an error wrapping multiple
  2273. // validation errors returned by
  2274. // EnvoyMobileHttpConnectionManager.ValidateAll() if the designated
  2275. // constraints aren't met.
  2276. type EnvoyMobileHttpConnectionManagerMultiError []error
  2277. // Error returns a concatenation of all the error messages it wraps.
  2278. func (m EnvoyMobileHttpConnectionManagerMultiError) Error() string {
  2279. var msgs []string
  2280. for _, err := range m {
  2281. msgs = append(msgs, err.Error())
  2282. }
  2283. return strings.Join(msgs, "; ")
  2284. }
  2285. // AllErrors returns a list of validation violation errors.
  2286. func (m EnvoyMobileHttpConnectionManagerMultiError) AllErrors() []error { return m }
  2287. // EnvoyMobileHttpConnectionManagerValidationError is the validation error
  2288. // returned by EnvoyMobileHttpConnectionManager.Validate if the designated
  2289. // constraints aren't met.
  2290. type EnvoyMobileHttpConnectionManagerValidationError struct {
  2291. field string
  2292. reason string
  2293. cause error
  2294. key bool
  2295. }
  2296. // Field function returns field value.
  2297. func (e EnvoyMobileHttpConnectionManagerValidationError) Field() string { return e.field }
  2298. // Reason function returns reason value.
  2299. func (e EnvoyMobileHttpConnectionManagerValidationError) Reason() string { return e.reason }
  2300. // Cause function returns cause value.
  2301. func (e EnvoyMobileHttpConnectionManagerValidationError) Cause() error { return e.cause }
  2302. // Key function returns key value.
  2303. func (e EnvoyMobileHttpConnectionManagerValidationError) Key() bool { return e.key }
  2304. // ErrorName returns error name.
  2305. func (e EnvoyMobileHttpConnectionManagerValidationError) ErrorName() string {
  2306. return "EnvoyMobileHttpConnectionManagerValidationError"
  2307. }
  2308. // Error satisfies the builtin error interface
  2309. func (e EnvoyMobileHttpConnectionManagerValidationError) Error() string {
  2310. cause := ""
  2311. if e.cause != nil {
  2312. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  2313. }
  2314. key := ""
  2315. if e.key {
  2316. key = "key for "
  2317. }
  2318. return fmt.Sprintf(
  2319. "invalid %sEnvoyMobileHttpConnectionManager.%s: %s%s",
  2320. key,
  2321. e.field,
  2322. e.reason,
  2323. cause)
  2324. }
  2325. var _ error = EnvoyMobileHttpConnectionManagerValidationError{}
  2326. var _ interface {
  2327. Field() string
  2328. Reason() string
  2329. Key() bool
  2330. Cause() error
  2331. ErrorName() string
  2332. } = EnvoyMobileHttpConnectionManagerValidationError{}
  2333. // Validate checks the field values on HttpConnectionManager_Tracing with the
  2334. // rules defined in the proto definition for this message. If any rules are
  2335. // violated, the first error encountered is returned, or nil if there are no violations.
  2336. func (m *HttpConnectionManager_Tracing) Validate() error {
  2337. return m.validate(false)
  2338. }
  2339. // ValidateAll checks the field values on HttpConnectionManager_Tracing with
  2340. // the rules defined in the proto definition for this message. If any rules
  2341. // are violated, the result is a list of violation errors wrapped in
  2342. // HttpConnectionManager_TracingMultiError, or nil if none found.
  2343. func (m *HttpConnectionManager_Tracing) ValidateAll() error {
  2344. return m.validate(true)
  2345. }
  2346. func (m *HttpConnectionManager_Tracing) validate(all bool) error {
  2347. if m == nil {
  2348. return nil
  2349. }
  2350. var errors []error
  2351. if all {
  2352. switch v := interface{}(m.GetClientSampling()).(type) {
  2353. case interface{ ValidateAll() error }:
  2354. if err := v.ValidateAll(); err != nil {
  2355. errors = append(errors, HttpConnectionManager_TracingValidationError{
  2356. field: "ClientSampling",
  2357. reason: "embedded message failed validation",
  2358. cause: err,
  2359. })
  2360. }
  2361. case interface{ Validate() error }:
  2362. if err := v.Validate(); err != nil {
  2363. errors = append(errors, HttpConnectionManager_TracingValidationError{
  2364. field: "ClientSampling",
  2365. reason: "embedded message failed validation",
  2366. cause: err,
  2367. })
  2368. }
  2369. }
  2370. } else if v, ok := interface{}(m.GetClientSampling()).(interface{ Validate() error }); ok {
  2371. if err := v.Validate(); err != nil {
  2372. return HttpConnectionManager_TracingValidationError{
  2373. field: "ClientSampling",
  2374. reason: "embedded message failed validation",
  2375. cause: err,
  2376. }
  2377. }
  2378. }
  2379. if all {
  2380. switch v := interface{}(m.GetRandomSampling()).(type) {
  2381. case interface{ ValidateAll() error }:
  2382. if err := v.ValidateAll(); err != nil {
  2383. errors = append(errors, HttpConnectionManager_TracingValidationError{
  2384. field: "RandomSampling",
  2385. reason: "embedded message failed validation",
  2386. cause: err,
  2387. })
  2388. }
  2389. case interface{ Validate() error }:
  2390. if err := v.Validate(); err != nil {
  2391. errors = append(errors, HttpConnectionManager_TracingValidationError{
  2392. field: "RandomSampling",
  2393. reason: "embedded message failed validation",
  2394. cause: err,
  2395. })
  2396. }
  2397. }
  2398. } else if v, ok := interface{}(m.GetRandomSampling()).(interface{ Validate() error }); ok {
  2399. if err := v.Validate(); err != nil {
  2400. return HttpConnectionManager_TracingValidationError{
  2401. field: "RandomSampling",
  2402. reason: "embedded message failed validation",
  2403. cause: err,
  2404. }
  2405. }
  2406. }
  2407. if all {
  2408. switch v := interface{}(m.GetOverallSampling()).(type) {
  2409. case interface{ ValidateAll() error }:
  2410. if err := v.ValidateAll(); err != nil {
  2411. errors = append(errors, HttpConnectionManager_TracingValidationError{
  2412. field: "OverallSampling",
  2413. reason: "embedded message failed validation",
  2414. cause: err,
  2415. })
  2416. }
  2417. case interface{ Validate() error }:
  2418. if err := v.Validate(); err != nil {
  2419. errors = append(errors, HttpConnectionManager_TracingValidationError{
  2420. field: "OverallSampling",
  2421. reason: "embedded message failed validation",
  2422. cause: err,
  2423. })
  2424. }
  2425. }
  2426. } else if v, ok := interface{}(m.GetOverallSampling()).(interface{ Validate() error }); ok {
  2427. if err := v.Validate(); err != nil {
  2428. return HttpConnectionManager_TracingValidationError{
  2429. field: "OverallSampling",
  2430. reason: "embedded message failed validation",
  2431. cause: err,
  2432. }
  2433. }
  2434. }
  2435. // no validation rules for Verbose
  2436. if all {
  2437. switch v := interface{}(m.GetMaxPathTagLength()).(type) {
  2438. case interface{ ValidateAll() error }:
  2439. if err := v.ValidateAll(); err != nil {
  2440. errors = append(errors, HttpConnectionManager_TracingValidationError{
  2441. field: "MaxPathTagLength",
  2442. reason: "embedded message failed validation",
  2443. cause: err,
  2444. })
  2445. }
  2446. case interface{ Validate() error }:
  2447. if err := v.Validate(); err != nil {
  2448. errors = append(errors, HttpConnectionManager_TracingValidationError{
  2449. field: "MaxPathTagLength",
  2450. reason: "embedded message failed validation",
  2451. cause: err,
  2452. })
  2453. }
  2454. }
  2455. } else if v, ok := interface{}(m.GetMaxPathTagLength()).(interface{ Validate() error }); ok {
  2456. if err := v.Validate(); err != nil {
  2457. return HttpConnectionManager_TracingValidationError{
  2458. field: "MaxPathTagLength",
  2459. reason: "embedded message failed validation",
  2460. cause: err,
  2461. }
  2462. }
  2463. }
  2464. for idx, item := range m.GetCustomTags() {
  2465. _, _ = idx, item
  2466. if all {
  2467. switch v := interface{}(item).(type) {
  2468. case interface{ ValidateAll() error }:
  2469. if err := v.ValidateAll(); err != nil {
  2470. errors = append(errors, HttpConnectionManager_TracingValidationError{
  2471. field: fmt.Sprintf("CustomTags[%v]", idx),
  2472. reason: "embedded message failed validation",
  2473. cause: err,
  2474. })
  2475. }
  2476. case interface{ Validate() error }:
  2477. if err := v.Validate(); err != nil {
  2478. errors = append(errors, HttpConnectionManager_TracingValidationError{
  2479. field: fmt.Sprintf("CustomTags[%v]", idx),
  2480. reason: "embedded message failed validation",
  2481. cause: err,
  2482. })
  2483. }
  2484. }
  2485. } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  2486. if err := v.Validate(); err != nil {
  2487. return HttpConnectionManager_TracingValidationError{
  2488. field: fmt.Sprintf("CustomTags[%v]", idx),
  2489. reason: "embedded message failed validation",
  2490. cause: err,
  2491. }
  2492. }
  2493. }
  2494. }
  2495. if all {
  2496. switch v := interface{}(m.GetProvider()).(type) {
  2497. case interface{ ValidateAll() error }:
  2498. if err := v.ValidateAll(); err != nil {
  2499. errors = append(errors, HttpConnectionManager_TracingValidationError{
  2500. field: "Provider",
  2501. reason: "embedded message failed validation",
  2502. cause: err,
  2503. })
  2504. }
  2505. case interface{ Validate() error }:
  2506. if err := v.Validate(); err != nil {
  2507. errors = append(errors, HttpConnectionManager_TracingValidationError{
  2508. field: "Provider",
  2509. reason: "embedded message failed validation",
  2510. cause: err,
  2511. })
  2512. }
  2513. }
  2514. } else if v, ok := interface{}(m.GetProvider()).(interface{ Validate() error }); ok {
  2515. if err := v.Validate(); err != nil {
  2516. return HttpConnectionManager_TracingValidationError{
  2517. field: "Provider",
  2518. reason: "embedded message failed validation",
  2519. cause: err,
  2520. }
  2521. }
  2522. }
  2523. if len(errors) > 0 {
  2524. return HttpConnectionManager_TracingMultiError(errors)
  2525. }
  2526. return nil
  2527. }
  2528. // HttpConnectionManager_TracingMultiError is an error wrapping multiple
  2529. // validation errors returned by HttpConnectionManager_Tracing.ValidateAll()
  2530. // if the designated constraints aren't met.
  2531. type HttpConnectionManager_TracingMultiError []error
  2532. // Error returns a concatenation of all the error messages it wraps.
  2533. func (m HttpConnectionManager_TracingMultiError) Error() string {
  2534. var msgs []string
  2535. for _, err := range m {
  2536. msgs = append(msgs, err.Error())
  2537. }
  2538. return strings.Join(msgs, "; ")
  2539. }
  2540. // AllErrors returns a list of validation violation errors.
  2541. func (m HttpConnectionManager_TracingMultiError) AllErrors() []error { return m }
  2542. // HttpConnectionManager_TracingValidationError is the validation error
  2543. // returned by HttpConnectionManager_Tracing.Validate if the designated
  2544. // constraints aren't met.
  2545. type HttpConnectionManager_TracingValidationError struct {
  2546. field string
  2547. reason string
  2548. cause error
  2549. key bool
  2550. }
  2551. // Field function returns field value.
  2552. func (e HttpConnectionManager_TracingValidationError) Field() string { return e.field }
  2553. // Reason function returns reason value.
  2554. func (e HttpConnectionManager_TracingValidationError) Reason() string { return e.reason }
  2555. // Cause function returns cause value.
  2556. func (e HttpConnectionManager_TracingValidationError) Cause() error { return e.cause }
  2557. // Key function returns key value.
  2558. func (e HttpConnectionManager_TracingValidationError) Key() bool { return e.key }
  2559. // ErrorName returns error name.
  2560. func (e HttpConnectionManager_TracingValidationError) ErrorName() string {
  2561. return "HttpConnectionManager_TracingValidationError"
  2562. }
  2563. // Error satisfies the builtin error interface
  2564. func (e HttpConnectionManager_TracingValidationError) Error() string {
  2565. cause := ""
  2566. if e.cause != nil {
  2567. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  2568. }
  2569. key := ""
  2570. if e.key {
  2571. key = "key for "
  2572. }
  2573. return fmt.Sprintf(
  2574. "invalid %sHttpConnectionManager_Tracing.%s: %s%s",
  2575. key,
  2576. e.field,
  2577. e.reason,
  2578. cause)
  2579. }
  2580. var _ error = HttpConnectionManager_TracingValidationError{}
  2581. var _ interface {
  2582. Field() string
  2583. Reason() string
  2584. Key() bool
  2585. Cause() error
  2586. ErrorName() string
  2587. } = HttpConnectionManager_TracingValidationError{}
  2588. // Validate checks the field values on
  2589. // HttpConnectionManager_InternalAddressConfig with the rules defined in the
  2590. // proto definition for this message. If any rules are violated, the first
  2591. // error encountered is returned, or nil if there are no violations.
  2592. func (m *HttpConnectionManager_InternalAddressConfig) Validate() error {
  2593. return m.validate(false)
  2594. }
  2595. // ValidateAll checks the field values on
  2596. // HttpConnectionManager_InternalAddressConfig with the rules defined in the
  2597. // proto definition for this message. If any rules are violated, the result is
  2598. // a list of violation errors wrapped in
  2599. // HttpConnectionManager_InternalAddressConfigMultiError, or nil if none found.
  2600. func (m *HttpConnectionManager_InternalAddressConfig) ValidateAll() error {
  2601. return m.validate(true)
  2602. }
  2603. func (m *HttpConnectionManager_InternalAddressConfig) validate(all bool) error {
  2604. if m == nil {
  2605. return nil
  2606. }
  2607. var errors []error
  2608. // no validation rules for UnixSockets
  2609. if len(errors) > 0 {
  2610. return HttpConnectionManager_InternalAddressConfigMultiError(errors)
  2611. }
  2612. return nil
  2613. }
  2614. // HttpConnectionManager_InternalAddressConfigMultiError is an error wrapping
  2615. // multiple validation errors returned by
  2616. // HttpConnectionManager_InternalAddressConfig.ValidateAll() if the designated
  2617. // constraints aren't met.
  2618. type HttpConnectionManager_InternalAddressConfigMultiError []error
  2619. // Error returns a concatenation of all the error messages it wraps.
  2620. func (m HttpConnectionManager_InternalAddressConfigMultiError) Error() string {
  2621. var msgs []string
  2622. for _, err := range m {
  2623. msgs = append(msgs, err.Error())
  2624. }
  2625. return strings.Join(msgs, "; ")
  2626. }
  2627. // AllErrors returns a list of validation violation errors.
  2628. func (m HttpConnectionManager_InternalAddressConfigMultiError) AllErrors() []error { return m }
  2629. // HttpConnectionManager_InternalAddressConfigValidationError is the validation
  2630. // error returned by HttpConnectionManager_InternalAddressConfig.Validate if
  2631. // the designated constraints aren't met.
  2632. type HttpConnectionManager_InternalAddressConfigValidationError struct {
  2633. field string
  2634. reason string
  2635. cause error
  2636. key bool
  2637. }
  2638. // Field function returns field value.
  2639. func (e HttpConnectionManager_InternalAddressConfigValidationError) Field() string { return e.field }
  2640. // Reason function returns reason value.
  2641. func (e HttpConnectionManager_InternalAddressConfigValidationError) Reason() string { return e.reason }
  2642. // Cause function returns cause value.
  2643. func (e HttpConnectionManager_InternalAddressConfigValidationError) Cause() error { return e.cause }
  2644. // Key function returns key value.
  2645. func (e HttpConnectionManager_InternalAddressConfigValidationError) Key() bool { return e.key }
  2646. // ErrorName returns error name.
  2647. func (e HttpConnectionManager_InternalAddressConfigValidationError) ErrorName() string {
  2648. return "HttpConnectionManager_InternalAddressConfigValidationError"
  2649. }
  2650. // Error satisfies the builtin error interface
  2651. func (e HttpConnectionManager_InternalAddressConfigValidationError) Error() string {
  2652. cause := ""
  2653. if e.cause != nil {
  2654. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  2655. }
  2656. key := ""
  2657. if e.key {
  2658. key = "key for "
  2659. }
  2660. return fmt.Sprintf(
  2661. "invalid %sHttpConnectionManager_InternalAddressConfig.%s: %s%s",
  2662. key,
  2663. e.field,
  2664. e.reason,
  2665. cause)
  2666. }
  2667. var _ error = HttpConnectionManager_InternalAddressConfigValidationError{}
  2668. var _ interface {
  2669. Field() string
  2670. Reason() string
  2671. Key() bool
  2672. Cause() error
  2673. ErrorName() string
  2674. } = HttpConnectionManager_InternalAddressConfigValidationError{}
  2675. // Validate checks the field values on
  2676. // HttpConnectionManager_SetCurrentClientCertDetails with the rules defined in
  2677. // the proto definition for this message. If any rules are violated, the first
  2678. // error encountered is returned, or nil if there are no violations.
  2679. func (m *HttpConnectionManager_SetCurrentClientCertDetails) Validate() error {
  2680. return m.validate(false)
  2681. }
  2682. // ValidateAll checks the field values on
  2683. // HttpConnectionManager_SetCurrentClientCertDetails with the rules defined in
  2684. // the proto definition for this message. If any rules are violated, the
  2685. // result is a list of violation errors wrapped in
  2686. // HttpConnectionManager_SetCurrentClientCertDetailsMultiError, or nil if none found.
  2687. func (m *HttpConnectionManager_SetCurrentClientCertDetails) ValidateAll() error {
  2688. return m.validate(true)
  2689. }
  2690. func (m *HttpConnectionManager_SetCurrentClientCertDetails) validate(all bool) error {
  2691. if m == nil {
  2692. return nil
  2693. }
  2694. var errors []error
  2695. if all {
  2696. switch v := interface{}(m.GetSubject()).(type) {
  2697. case interface{ ValidateAll() error }:
  2698. if err := v.ValidateAll(); err != nil {
  2699. errors = append(errors, HttpConnectionManager_SetCurrentClientCertDetailsValidationError{
  2700. field: "Subject",
  2701. reason: "embedded message failed validation",
  2702. cause: err,
  2703. })
  2704. }
  2705. case interface{ Validate() error }:
  2706. if err := v.Validate(); err != nil {
  2707. errors = append(errors, HttpConnectionManager_SetCurrentClientCertDetailsValidationError{
  2708. field: "Subject",
  2709. reason: "embedded message failed validation",
  2710. cause: err,
  2711. })
  2712. }
  2713. }
  2714. } else if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok {
  2715. if err := v.Validate(); err != nil {
  2716. return HttpConnectionManager_SetCurrentClientCertDetailsValidationError{
  2717. field: "Subject",
  2718. reason: "embedded message failed validation",
  2719. cause: err,
  2720. }
  2721. }
  2722. }
  2723. // no validation rules for Cert
  2724. // no validation rules for Chain
  2725. // no validation rules for Dns
  2726. // no validation rules for Uri
  2727. if len(errors) > 0 {
  2728. return HttpConnectionManager_SetCurrentClientCertDetailsMultiError(errors)
  2729. }
  2730. return nil
  2731. }
  2732. // HttpConnectionManager_SetCurrentClientCertDetailsMultiError is an error
  2733. // wrapping multiple validation errors returned by
  2734. // HttpConnectionManager_SetCurrentClientCertDetails.ValidateAll() if the
  2735. // designated constraints aren't met.
  2736. type HttpConnectionManager_SetCurrentClientCertDetailsMultiError []error
  2737. // Error returns a concatenation of all the error messages it wraps.
  2738. func (m HttpConnectionManager_SetCurrentClientCertDetailsMultiError) Error() string {
  2739. var msgs []string
  2740. for _, err := range m {
  2741. msgs = append(msgs, err.Error())
  2742. }
  2743. return strings.Join(msgs, "; ")
  2744. }
  2745. // AllErrors returns a list of validation violation errors.
  2746. func (m HttpConnectionManager_SetCurrentClientCertDetailsMultiError) AllErrors() []error { return m }
  2747. // HttpConnectionManager_SetCurrentClientCertDetailsValidationError is the
  2748. // validation error returned by
  2749. // HttpConnectionManager_SetCurrentClientCertDetails.Validate if the
  2750. // designated constraints aren't met.
  2751. type HttpConnectionManager_SetCurrentClientCertDetailsValidationError struct {
  2752. field string
  2753. reason string
  2754. cause error
  2755. key bool
  2756. }
  2757. // Field function returns field value.
  2758. func (e HttpConnectionManager_SetCurrentClientCertDetailsValidationError) Field() string {
  2759. return e.field
  2760. }
  2761. // Reason function returns reason value.
  2762. func (e HttpConnectionManager_SetCurrentClientCertDetailsValidationError) Reason() string {
  2763. return e.reason
  2764. }
  2765. // Cause function returns cause value.
  2766. func (e HttpConnectionManager_SetCurrentClientCertDetailsValidationError) Cause() error {
  2767. return e.cause
  2768. }
  2769. // Key function returns key value.
  2770. func (e HttpConnectionManager_SetCurrentClientCertDetailsValidationError) Key() bool { return e.key }
  2771. // ErrorName returns error name.
  2772. func (e HttpConnectionManager_SetCurrentClientCertDetailsValidationError) ErrorName() string {
  2773. return "HttpConnectionManager_SetCurrentClientCertDetailsValidationError"
  2774. }
  2775. // Error satisfies the builtin error interface
  2776. func (e HttpConnectionManager_SetCurrentClientCertDetailsValidationError) Error() string {
  2777. cause := ""
  2778. if e.cause != nil {
  2779. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  2780. }
  2781. key := ""
  2782. if e.key {
  2783. key = "key for "
  2784. }
  2785. return fmt.Sprintf(
  2786. "invalid %sHttpConnectionManager_SetCurrentClientCertDetails.%s: %s%s",
  2787. key,
  2788. e.field,
  2789. e.reason,
  2790. cause)
  2791. }
  2792. var _ error = HttpConnectionManager_SetCurrentClientCertDetailsValidationError{}
  2793. var _ interface {
  2794. Field() string
  2795. Reason() string
  2796. Key() bool
  2797. Cause() error
  2798. ErrorName() string
  2799. } = HttpConnectionManager_SetCurrentClientCertDetailsValidationError{}
  2800. // Validate checks the field values on HttpConnectionManager_UpgradeConfig with
  2801. // the rules defined in the proto definition for this message. If any rules
  2802. // are violated, the first error encountered is returned, or nil if there are
  2803. // no violations.
  2804. func (m *HttpConnectionManager_UpgradeConfig) Validate() error {
  2805. return m.validate(false)
  2806. }
  2807. // ValidateAll checks the field values on HttpConnectionManager_UpgradeConfig
  2808. // with the rules defined in the proto definition for this message. If any
  2809. // rules are violated, the result is a list of violation errors wrapped in
  2810. // HttpConnectionManager_UpgradeConfigMultiError, or nil if none found.
  2811. func (m *HttpConnectionManager_UpgradeConfig) ValidateAll() error {
  2812. return m.validate(true)
  2813. }
  2814. func (m *HttpConnectionManager_UpgradeConfig) validate(all bool) error {
  2815. if m == nil {
  2816. return nil
  2817. }
  2818. var errors []error
  2819. // no validation rules for UpgradeType
  2820. for idx, item := range m.GetFilters() {
  2821. _, _ = idx, item
  2822. if all {
  2823. switch v := interface{}(item).(type) {
  2824. case interface{ ValidateAll() error }:
  2825. if err := v.ValidateAll(); err != nil {
  2826. errors = append(errors, HttpConnectionManager_UpgradeConfigValidationError{
  2827. field: fmt.Sprintf("Filters[%v]", idx),
  2828. reason: "embedded message failed validation",
  2829. cause: err,
  2830. })
  2831. }
  2832. case interface{ Validate() error }:
  2833. if err := v.Validate(); err != nil {
  2834. errors = append(errors, HttpConnectionManager_UpgradeConfigValidationError{
  2835. field: fmt.Sprintf("Filters[%v]", idx),
  2836. reason: "embedded message failed validation",
  2837. cause: err,
  2838. })
  2839. }
  2840. }
  2841. } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  2842. if err := v.Validate(); err != nil {
  2843. return HttpConnectionManager_UpgradeConfigValidationError{
  2844. field: fmt.Sprintf("Filters[%v]", idx),
  2845. reason: "embedded message failed validation",
  2846. cause: err,
  2847. }
  2848. }
  2849. }
  2850. }
  2851. if all {
  2852. switch v := interface{}(m.GetEnabled()).(type) {
  2853. case interface{ ValidateAll() error }:
  2854. if err := v.ValidateAll(); err != nil {
  2855. errors = append(errors, HttpConnectionManager_UpgradeConfigValidationError{
  2856. field: "Enabled",
  2857. reason: "embedded message failed validation",
  2858. cause: err,
  2859. })
  2860. }
  2861. case interface{ Validate() error }:
  2862. if err := v.Validate(); err != nil {
  2863. errors = append(errors, HttpConnectionManager_UpgradeConfigValidationError{
  2864. field: "Enabled",
  2865. reason: "embedded message failed validation",
  2866. cause: err,
  2867. })
  2868. }
  2869. }
  2870. } else if v, ok := interface{}(m.GetEnabled()).(interface{ Validate() error }); ok {
  2871. if err := v.Validate(); err != nil {
  2872. return HttpConnectionManager_UpgradeConfigValidationError{
  2873. field: "Enabled",
  2874. reason: "embedded message failed validation",
  2875. cause: err,
  2876. }
  2877. }
  2878. }
  2879. if len(errors) > 0 {
  2880. return HttpConnectionManager_UpgradeConfigMultiError(errors)
  2881. }
  2882. return nil
  2883. }
  2884. // HttpConnectionManager_UpgradeConfigMultiError is an error wrapping multiple
  2885. // validation errors returned by
  2886. // HttpConnectionManager_UpgradeConfig.ValidateAll() if the designated
  2887. // constraints aren't met.
  2888. type HttpConnectionManager_UpgradeConfigMultiError []error
  2889. // Error returns a concatenation of all the error messages it wraps.
  2890. func (m HttpConnectionManager_UpgradeConfigMultiError) Error() string {
  2891. var msgs []string
  2892. for _, err := range m {
  2893. msgs = append(msgs, err.Error())
  2894. }
  2895. return strings.Join(msgs, "; ")
  2896. }
  2897. // AllErrors returns a list of validation violation errors.
  2898. func (m HttpConnectionManager_UpgradeConfigMultiError) AllErrors() []error { return m }
  2899. // HttpConnectionManager_UpgradeConfigValidationError is the validation error
  2900. // returned by HttpConnectionManager_UpgradeConfig.Validate if the designated
  2901. // constraints aren't met.
  2902. type HttpConnectionManager_UpgradeConfigValidationError struct {
  2903. field string
  2904. reason string
  2905. cause error
  2906. key bool
  2907. }
  2908. // Field function returns field value.
  2909. func (e HttpConnectionManager_UpgradeConfigValidationError) Field() string { return e.field }
  2910. // Reason function returns reason value.
  2911. func (e HttpConnectionManager_UpgradeConfigValidationError) Reason() string { return e.reason }
  2912. // Cause function returns cause value.
  2913. func (e HttpConnectionManager_UpgradeConfigValidationError) Cause() error { return e.cause }
  2914. // Key function returns key value.
  2915. func (e HttpConnectionManager_UpgradeConfigValidationError) Key() bool { return e.key }
  2916. // ErrorName returns error name.
  2917. func (e HttpConnectionManager_UpgradeConfigValidationError) ErrorName() string {
  2918. return "HttpConnectionManager_UpgradeConfigValidationError"
  2919. }
  2920. // Error satisfies the builtin error interface
  2921. func (e HttpConnectionManager_UpgradeConfigValidationError) Error() string {
  2922. cause := ""
  2923. if e.cause != nil {
  2924. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  2925. }
  2926. key := ""
  2927. if e.key {
  2928. key = "key for "
  2929. }
  2930. return fmt.Sprintf(
  2931. "invalid %sHttpConnectionManager_UpgradeConfig.%s: %s%s",
  2932. key,
  2933. e.field,
  2934. e.reason,
  2935. cause)
  2936. }
  2937. var _ error = HttpConnectionManager_UpgradeConfigValidationError{}
  2938. var _ interface {
  2939. Field() string
  2940. Reason() string
  2941. Key() bool
  2942. Cause() error
  2943. ErrorName() string
  2944. } = HttpConnectionManager_UpgradeConfigValidationError{}
  2945. // Validate checks the field values on
  2946. // HttpConnectionManager_PathNormalizationOptions with the rules defined in
  2947. // the proto definition for this message. If any rules are violated, the first
  2948. // error encountered is returned, or nil if there are no violations.
  2949. func (m *HttpConnectionManager_PathNormalizationOptions) Validate() error {
  2950. return m.validate(false)
  2951. }
  2952. // ValidateAll checks the field values on
  2953. // HttpConnectionManager_PathNormalizationOptions with the rules defined in
  2954. // the proto definition for this message. If any rules are violated, the
  2955. // result is a list of violation errors wrapped in
  2956. // HttpConnectionManager_PathNormalizationOptionsMultiError, or nil if none found.
  2957. func (m *HttpConnectionManager_PathNormalizationOptions) ValidateAll() error {
  2958. return m.validate(true)
  2959. }
  2960. func (m *HttpConnectionManager_PathNormalizationOptions) validate(all bool) error {
  2961. if m == nil {
  2962. return nil
  2963. }
  2964. var errors []error
  2965. if all {
  2966. switch v := interface{}(m.GetForwardingTransformation()).(type) {
  2967. case interface{ ValidateAll() error }:
  2968. if err := v.ValidateAll(); err != nil {
  2969. errors = append(errors, HttpConnectionManager_PathNormalizationOptionsValidationError{
  2970. field: "ForwardingTransformation",
  2971. reason: "embedded message failed validation",
  2972. cause: err,
  2973. })
  2974. }
  2975. case interface{ Validate() error }:
  2976. if err := v.Validate(); err != nil {
  2977. errors = append(errors, HttpConnectionManager_PathNormalizationOptionsValidationError{
  2978. field: "ForwardingTransformation",
  2979. reason: "embedded message failed validation",
  2980. cause: err,
  2981. })
  2982. }
  2983. }
  2984. } else if v, ok := interface{}(m.GetForwardingTransformation()).(interface{ Validate() error }); ok {
  2985. if err := v.Validate(); err != nil {
  2986. return HttpConnectionManager_PathNormalizationOptionsValidationError{
  2987. field: "ForwardingTransformation",
  2988. reason: "embedded message failed validation",
  2989. cause: err,
  2990. }
  2991. }
  2992. }
  2993. if all {
  2994. switch v := interface{}(m.GetHttpFilterTransformation()).(type) {
  2995. case interface{ ValidateAll() error }:
  2996. if err := v.ValidateAll(); err != nil {
  2997. errors = append(errors, HttpConnectionManager_PathNormalizationOptionsValidationError{
  2998. field: "HttpFilterTransformation",
  2999. reason: "embedded message failed validation",
  3000. cause: err,
  3001. })
  3002. }
  3003. case interface{ Validate() error }:
  3004. if err := v.Validate(); err != nil {
  3005. errors = append(errors, HttpConnectionManager_PathNormalizationOptionsValidationError{
  3006. field: "HttpFilterTransformation",
  3007. reason: "embedded message failed validation",
  3008. cause: err,
  3009. })
  3010. }
  3011. }
  3012. } else if v, ok := interface{}(m.GetHttpFilterTransformation()).(interface{ Validate() error }); ok {
  3013. if err := v.Validate(); err != nil {
  3014. return HttpConnectionManager_PathNormalizationOptionsValidationError{
  3015. field: "HttpFilterTransformation",
  3016. reason: "embedded message failed validation",
  3017. cause: err,
  3018. }
  3019. }
  3020. }
  3021. if len(errors) > 0 {
  3022. return HttpConnectionManager_PathNormalizationOptionsMultiError(errors)
  3023. }
  3024. return nil
  3025. }
  3026. // HttpConnectionManager_PathNormalizationOptionsMultiError is an error
  3027. // wrapping multiple validation errors returned by
  3028. // HttpConnectionManager_PathNormalizationOptions.ValidateAll() if the
  3029. // designated constraints aren't met.
  3030. type HttpConnectionManager_PathNormalizationOptionsMultiError []error
  3031. // Error returns a concatenation of all the error messages it wraps.
  3032. func (m HttpConnectionManager_PathNormalizationOptionsMultiError) Error() string {
  3033. var msgs []string
  3034. for _, err := range m {
  3035. msgs = append(msgs, err.Error())
  3036. }
  3037. return strings.Join(msgs, "; ")
  3038. }
  3039. // AllErrors returns a list of validation violation errors.
  3040. func (m HttpConnectionManager_PathNormalizationOptionsMultiError) AllErrors() []error { return m }
  3041. // HttpConnectionManager_PathNormalizationOptionsValidationError is the
  3042. // validation error returned by
  3043. // HttpConnectionManager_PathNormalizationOptions.Validate if the designated
  3044. // constraints aren't met.
  3045. type HttpConnectionManager_PathNormalizationOptionsValidationError struct {
  3046. field string
  3047. reason string
  3048. cause error
  3049. key bool
  3050. }
  3051. // Field function returns field value.
  3052. func (e HttpConnectionManager_PathNormalizationOptionsValidationError) Field() string { return e.field }
  3053. // Reason function returns reason value.
  3054. func (e HttpConnectionManager_PathNormalizationOptionsValidationError) Reason() string {
  3055. return e.reason
  3056. }
  3057. // Cause function returns cause value.
  3058. func (e HttpConnectionManager_PathNormalizationOptionsValidationError) Cause() error { return e.cause }
  3059. // Key function returns key value.
  3060. func (e HttpConnectionManager_PathNormalizationOptionsValidationError) Key() bool { return e.key }
  3061. // ErrorName returns error name.
  3062. func (e HttpConnectionManager_PathNormalizationOptionsValidationError) ErrorName() string {
  3063. return "HttpConnectionManager_PathNormalizationOptionsValidationError"
  3064. }
  3065. // Error satisfies the builtin error interface
  3066. func (e HttpConnectionManager_PathNormalizationOptionsValidationError) Error() string {
  3067. cause := ""
  3068. if e.cause != nil {
  3069. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  3070. }
  3071. key := ""
  3072. if e.key {
  3073. key = "key for "
  3074. }
  3075. return fmt.Sprintf(
  3076. "invalid %sHttpConnectionManager_PathNormalizationOptions.%s: %s%s",
  3077. key,
  3078. e.field,
  3079. e.reason,
  3080. cause)
  3081. }
  3082. var _ error = HttpConnectionManager_PathNormalizationOptionsValidationError{}
  3083. var _ interface {
  3084. Field() string
  3085. Reason() string
  3086. Key() bool
  3087. Cause() error
  3088. ErrorName() string
  3089. } = HttpConnectionManager_PathNormalizationOptionsValidationError{}
  3090. // Validate checks the field values on ScopedRoutes_ScopeKeyBuilder with the
  3091. // rules defined in the proto definition for this message. If any rules are
  3092. // violated, the first error encountered is returned, or nil if there are no violations.
  3093. func (m *ScopedRoutes_ScopeKeyBuilder) Validate() error {
  3094. return m.validate(false)
  3095. }
  3096. // ValidateAll checks the field values on ScopedRoutes_ScopeKeyBuilder with the
  3097. // rules defined in the proto definition for this message. If any rules are
  3098. // violated, the result is a list of violation errors wrapped in
  3099. // ScopedRoutes_ScopeKeyBuilderMultiError, or nil if none found.
  3100. func (m *ScopedRoutes_ScopeKeyBuilder) ValidateAll() error {
  3101. return m.validate(true)
  3102. }
  3103. func (m *ScopedRoutes_ScopeKeyBuilder) validate(all bool) error {
  3104. if m == nil {
  3105. return nil
  3106. }
  3107. var errors []error
  3108. if len(m.GetFragments()) < 1 {
  3109. err := ScopedRoutes_ScopeKeyBuilderValidationError{
  3110. field: "Fragments",
  3111. reason: "value must contain at least 1 item(s)",
  3112. }
  3113. if !all {
  3114. return err
  3115. }
  3116. errors = append(errors, err)
  3117. }
  3118. for idx, item := range m.GetFragments() {
  3119. _, _ = idx, item
  3120. if all {
  3121. switch v := interface{}(item).(type) {
  3122. case interface{ ValidateAll() error }:
  3123. if err := v.ValidateAll(); err != nil {
  3124. errors = append(errors, ScopedRoutes_ScopeKeyBuilderValidationError{
  3125. field: fmt.Sprintf("Fragments[%v]", idx),
  3126. reason: "embedded message failed validation",
  3127. cause: err,
  3128. })
  3129. }
  3130. case interface{ Validate() error }:
  3131. if err := v.Validate(); err != nil {
  3132. errors = append(errors, ScopedRoutes_ScopeKeyBuilderValidationError{
  3133. field: fmt.Sprintf("Fragments[%v]", idx),
  3134. reason: "embedded message failed validation",
  3135. cause: err,
  3136. })
  3137. }
  3138. }
  3139. } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  3140. if err := v.Validate(); err != nil {
  3141. return ScopedRoutes_ScopeKeyBuilderValidationError{
  3142. field: fmt.Sprintf("Fragments[%v]", idx),
  3143. reason: "embedded message failed validation",
  3144. cause: err,
  3145. }
  3146. }
  3147. }
  3148. }
  3149. if len(errors) > 0 {
  3150. return ScopedRoutes_ScopeKeyBuilderMultiError(errors)
  3151. }
  3152. return nil
  3153. }
  3154. // ScopedRoutes_ScopeKeyBuilderMultiError is an error wrapping multiple
  3155. // validation errors returned by ScopedRoutes_ScopeKeyBuilder.ValidateAll() if
  3156. // the designated constraints aren't met.
  3157. type ScopedRoutes_ScopeKeyBuilderMultiError []error
  3158. // Error returns a concatenation of all the error messages it wraps.
  3159. func (m ScopedRoutes_ScopeKeyBuilderMultiError) Error() string {
  3160. var msgs []string
  3161. for _, err := range m {
  3162. msgs = append(msgs, err.Error())
  3163. }
  3164. return strings.Join(msgs, "; ")
  3165. }
  3166. // AllErrors returns a list of validation violation errors.
  3167. func (m ScopedRoutes_ScopeKeyBuilderMultiError) AllErrors() []error { return m }
  3168. // ScopedRoutes_ScopeKeyBuilderValidationError is the validation error returned
  3169. // by ScopedRoutes_ScopeKeyBuilder.Validate if the designated constraints
  3170. // aren't met.
  3171. type ScopedRoutes_ScopeKeyBuilderValidationError struct {
  3172. field string
  3173. reason string
  3174. cause error
  3175. key bool
  3176. }
  3177. // Field function returns field value.
  3178. func (e ScopedRoutes_ScopeKeyBuilderValidationError) Field() string { return e.field }
  3179. // Reason function returns reason value.
  3180. func (e ScopedRoutes_ScopeKeyBuilderValidationError) Reason() string { return e.reason }
  3181. // Cause function returns cause value.
  3182. func (e ScopedRoutes_ScopeKeyBuilderValidationError) Cause() error { return e.cause }
  3183. // Key function returns key value.
  3184. func (e ScopedRoutes_ScopeKeyBuilderValidationError) Key() bool { return e.key }
  3185. // ErrorName returns error name.
  3186. func (e ScopedRoutes_ScopeKeyBuilderValidationError) ErrorName() string {
  3187. return "ScopedRoutes_ScopeKeyBuilderValidationError"
  3188. }
  3189. // Error satisfies the builtin error interface
  3190. func (e ScopedRoutes_ScopeKeyBuilderValidationError) Error() string {
  3191. cause := ""
  3192. if e.cause != nil {
  3193. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  3194. }
  3195. key := ""
  3196. if e.key {
  3197. key = "key for "
  3198. }
  3199. return fmt.Sprintf(
  3200. "invalid %sScopedRoutes_ScopeKeyBuilder.%s: %s%s",
  3201. key,
  3202. e.field,
  3203. e.reason,
  3204. cause)
  3205. }
  3206. var _ error = ScopedRoutes_ScopeKeyBuilderValidationError{}
  3207. var _ interface {
  3208. Field() string
  3209. Reason() string
  3210. Key() bool
  3211. Cause() error
  3212. ErrorName() string
  3213. } = ScopedRoutes_ScopeKeyBuilderValidationError{}
  3214. // Validate checks the field values on
  3215. // ScopedRoutes_ScopeKeyBuilder_FragmentBuilder with the rules defined in the
  3216. // proto definition for this message. If any rules are violated, the first
  3217. // error encountered is returned, or nil if there are no violations.
  3218. func (m *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder) Validate() error {
  3219. return m.validate(false)
  3220. }
  3221. // ValidateAll checks the field values on
  3222. // ScopedRoutes_ScopeKeyBuilder_FragmentBuilder with the rules defined in the
  3223. // proto definition for this message. If any rules are violated, the result is
  3224. // a list of violation errors wrapped in
  3225. // ScopedRoutes_ScopeKeyBuilder_FragmentBuilderMultiError, or nil if none found.
  3226. func (m *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder) ValidateAll() error {
  3227. return m.validate(true)
  3228. }
  3229. func (m *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder) validate(all bool) error {
  3230. if m == nil {
  3231. return nil
  3232. }
  3233. var errors []error
  3234. switch m.Type.(type) {
  3235. case *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_:
  3236. if all {
  3237. switch v := interface{}(m.GetHeaderValueExtractor()).(type) {
  3238. case interface{ ValidateAll() error }:
  3239. if err := v.ValidateAll(); err != nil {
  3240. errors = append(errors, ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError{
  3241. field: "HeaderValueExtractor",
  3242. reason: "embedded message failed validation",
  3243. cause: err,
  3244. })
  3245. }
  3246. case interface{ Validate() error }:
  3247. if err := v.Validate(); err != nil {
  3248. errors = append(errors, ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError{
  3249. field: "HeaderValueExtractor",
  3250. reason: "embedded message failed validation",
  3251. cause: err,
  3252. })
  3253. }
  3254. }
  3255. } else if v, ok := interface{}(m.GetHeaderValueExtractor()).(interface{ Validate() error }); ok {
  3256. if err := v.Validate(); err != nil {
  3257. return ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError{
  3258. field: "HeaderValueExtractor",
  3259. reason: "embedded message failed validation",
  3260. cause: err,
  3261. }
  3262. }
  3263. }
  3264. default:
  3265. err := ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError{
  3266. field: "Type",
  3267. reason: "value is required",
  3268. }
  3269. if !all {
  3270. return err
  3271. }
  3272. errors = append(errors, err)
  3273. }
  3274. if len(errors) > 0 {
  3275. return ScopedRoutes_ScopeKeyBuilder_FragmentBuilderMultiError(errors)
  3276. }
  3277. return nil
  3278. }
  3279. // ScopedRoutes_ScopeKeyBuilder_FragmentBuilderMultiError is an error wrapping
  3280. // multiple validation errors returned by
  3281. // ScopedRoutes_ScopeKeyBuilder_FragmentBuilder.ValidateAll() if the
  3282. // designated constraints aren't met.
  3283. type ScopedRoutes_ScopeKeyBuilder_FragmentBuilderMultiError []error
  3284. // Error returns a concatenation of all the error messages it wraps.
  3285. func (m ScopedRoutes_ScopeKeyBuilder_FragmentBuilderMultiError) Error() string {
  3286. var msgs []string
  3287. for _, err := range m {
  3288. msgs = append(msgs, err.Error())
  3289. }
  3290. return strings.Join(msgs, "; ")
  3291. }
  3292. // AllErrors returns a list of validation violation errors.
  3293. func (m ScopedRoutes_ScopeKeyBuilder_FragmentBuilderMultiError) AllErrors() []error { return m }
  3294. // ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError is the
  3295. // validation error returned by
  3296. // ScopedRoutes_ScopeKeyBuilder_FragmentBuilder.Validate if the designated
  3297. // constraints aren't met.
  3298. type ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError struct {
  3299. field string
  3300. reason string
  3301. cause error
  3302. key bool
  3303. }
  3304. // Field function returns field value.
  3305. func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError) Field() string { return e.field }
  3306. // Reason function returns reason value.
  3307. func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError) Reason() string { return e.reason }
  3308. // Cause function returns cause value.
  3309. func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError) Cause() error { return e.cause }
  3310. // Key function returns key value.
  3311. func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError) Key() bool { return e.key }
  3312. // ErrorName returns error name.
  3313. func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError) ErrorName() string {
  3314. return "ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError"
  3315. }
  3316. // Error satisfies the builtin error interface
  3317. func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError) Error() string {
  3318. cause := ""
  3319. if e.cause != nil {
  3320. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  3321. }
  3322. key := ""
  3323. if e.key {
  3324. key = "key for "
  3325. }
  3326. return fmt.Sprintf(
  3327. "invalid %sScopedRoutes_ScopeKeyBuilder_FragmentBuilder.%s: %s%s",
  3328. key,
  3329. e.field,
  3330. e.reason,
  3331. cause)
  3332. }
  3333. var _ error = ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError{}
  3334. var _ interface {
  3335. Field() string
  3336. Reason() string
  3337. Key() bool
  3338. Cause() error
  3339. ErrorName() string
  3340. } = ScopedRoutes_ScopeKeyBuilder_FragmentBuilderValidationError{}
  3341. // Validate checks the field values on
  3342. // ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor with the
  3343. // rules defined in the proto definition for this message. If any rules are
  3344. // violated, the first error encountered is returned, or nil if there are no violations.
  3345. func (m *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor) Validate() error {
  3346. return m.validate(false)
  3347. }
  3348. // ValidateAll checks the field values on
  3349. // ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor with the
  3350. // rules defined in the proto definition for this message. If any rules are
  3351. // violated, the result is a list of violation errors wrapped in
  3352. // ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorMultiError,
  3353. // or nil if none found.
  3354. func (m *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor) ValidateAll() error {
  3355. return m.validate(true)
  3356. }
  3357. func (m *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor) validate(all bool) error {
  3358. if m == nil {
  3359. return nil
  3360. }
  3361. var errors []error
  3362. if utf8.RuneCountInString(m.GetName()) < 1 {
  3363. err := ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError{
  3364. field: "Name",
  3365. reason: "value length must be at least 1 runes",
  3366. }
  3367. if !all {
  3368. return err
  3369. }
  3370. errors = append(errors, err)
  3371. }
  3372. // no validation rules for ElementSeparator
  3373. switch m.ExtractType.(type) {
  3374. case *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_Index:
  3375. // no validation rules for Index
  3376. case *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_Element:
  3377. if all {
  3378. switch v := interface{}(m.GetElement()).(type) {
  3379. case interface{ ValidateAll() error }:
  3380. if err := v.ValidateAll(); err != nil {
  3381. errors = append(errors, ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError{
  3382. field: "Element",
  3383. reason: "embedded message failed validation",
  3384. cause: err,
  3385. })
  3386. }
  3387. case interface{ Validate() error }:
  3388. if err := v.Validate(); err != nil {
  3389. errors = append(errors, ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError{
  3390. field: "Element",
  3391. reason: "embedded message failed validation",
  3392. cause: err,
  3393. })
  3394. }
  3395. }
  3396. } else if v, ok := interface{}(m.GetElement()).(interface{ Validate() error }); ok {
  3397. if err := v.Validate(); err != nil {
  3398. return ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError{
  3399. field: "Element",
  3400. reason: "embedded message failed validation",
  3401. cause: err,
  3402. }
  3403. }
  3404. }
  3405. }
  3406. if len(errors) > 0 {
  3407. return ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorMultiError(errors)
  3408. }
  3409. return nil
  3410. }
  3411. // ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorMultiError
  3412. // is an error wrapping multiple validation errors returned by
  3413. // ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor.ValidateAll()
  3414. // if the designated constraints aren't met.
  3415. type ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorMultiError []error
  3416. // Error returns a concatenation of all the error messages it wraps.
  3417. func (m ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorMultiError) Error() string {
  3418. var msgs []string
  3419. for _, err := range m {
  3420. msgs = append(msgs, err.Error())
  3421. }
  3422. return strings.Join(msgs, "; ")
  3423. }
  3424. // AllErrors returns a list of validation violation errors.
  3425. func (m ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorMultiError) AllErrors() []error {
  3426. return m
  3427. }
  3428. // ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError
  3429. // is the validation error returned by
  3430. // ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor.Validate
  3431. // if the designated constraints aren't met.
  3432. type ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError struct {
  3433. field string
  3434. reason string
  3435. cause error
  3436. key bool
  3437. }
  3438. // Field function returns field value.
  3439. func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError) Field() string {
  3440. return e.field
  3441. }
  3442. // Reason function returns reason value.
  3443. func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError) Reason() string {
  3444. return e.reason
  3445. }
  3446. // Cause function returns cause value.
  3447. func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError) Cause() error {
  3448. return e.cause
  3449. }
  3450. // Key function returns key value.
  3451. func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError) Key() bool {
  3452. return e.key
  3453. }
  3454. // ErrorName returns error name.
  3455. func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError) ErrorName() string {
  3456. return "ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError"
  3457. }
  3458. // Error satisfies the builtin error interface
  3459. func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError) Error() string {
  3460. cause := ""
  3461. if e.cause != nil {
  3462. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  3463. }
  3464. key := ""
  3465. if e.key {
  3466. key = "key for "
  3467. }
  3468. return fmt.Sprintf(
  3469. "invalid %sScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor.%s: %s%s",
  3470. key,
  3471. e.field,
  3472. e.reason,
  3473. cause)
  3474. }
  3475. var _ error = ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError{}
  3476. var _ interface {
  3477. Field() string
  3478. Reason() string
  3479. Key() bool
  3480. Cause() error
  3481. ErrorName() string
  3482. } = ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractorValidationError{}
  3483. // Validate checks the field values on
  3484. // ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement
  3485. // with the rules defined in the proto definition for this message. If any
  3486. // rules are violated, the first error encountered is returned, or nil if
  3487. // there are no violations.
  3488. func (m *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement) Validate() error {
  3489. return m.validate(false)
  3490. }
  3491. // ValidateAll checks the field values on
  3492. // ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement
  3493. // with the rules defined in the proto definition for this message. If any
  3494. // rules are violated, the result is a list of violation errors wrapped in
  3495. // ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementMultiError,
  3496. // or nil if none found.
  3497. func (m *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement) ValidateAll() error {
  3498. return m.validate(true)
  3499. }
  3500. func (m *ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement) validate(all bool) error {
  3501. if m == nil {
  3502. return nil
  3503. }
  3504. var errors []error
  3505. if utf8.RuneCountInString(m.GetSeparator()) < 1 {
  3506. err := ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError{
  3507. field: "Separator",
  3508. reason: "value length must be at least 1 runes",
  3509. }
  3510. if !all {
  3511. return err
  3512. }
  3513. errors = append(errors, err)
  3514. }
  3515. if utf8.RuneCountInString(m.GetKey()) < 1 {
  3516. err := ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError{
  3517. field: "Key",
  3518. reason: "value length must be at least 1 runes",
  3519. }
  3520. if !all {
  3521. return err
  3522. }
  3523. errors = append(errors, err)
  3524. }
  3525. if len(errors) > 0 {
  3526. return ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementMultiError(errors)
  3527. }
  3528. return nil
  3529. }
  3530. // ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementMultiError
  3531. // is an error wrapping multiple validation errors returned by
  3532. // ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement.ValidateAll()
  3533. // if the designated constraints aren't met.
  3534. type ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementMultiError []error
  3535. // Error returns a concatenation of all the error messages it wraps.
  3536. func (m ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementMultiError) Error() string {
  3537. var msgs []string
  3538. for _, err := range m {
  3539. msgs = append(msgs, err.Error())
  3540. }
  3541. return strings.Join(msgs, "; ")
  3542. }
  3543. // AllErrors returns a list of validation violation errors.
  3544. func (m ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementMultiError) AllErrors() []error {
  3545. return m
  3546. }
  3547. // ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError
  3548. // is the validation error returned by
  3549. // ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement.Validate
  3550. // if the designated constraints aren't met.
  3551. type ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError struct {
  3552. field string
  3553. reason string
  3554. cause error
  3555. key bool
  3556. }
  3557. // Field function returns field value.
  3558. func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError) Field() string {
  3559. return e.field
  3560. }
  3561. // Reason function returns reason value.
  3562. func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError) Reason() string {
  3563. return e.reason
  3564. }
  3565. // Cause function returns cause value.
  3566. func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError) Cause() error {
  3567. return e.cause
  3568. }
  3569. // Key function returns key value.
  3570. func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError) Key() bool {
  3571. return e.key
  3572. }
  3573. // ErrorName returns error name.
  3574. func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError) ErrorName() string {
  3575. return "ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError"
  3576. }
  3577. // Error satisfies the builtin error interface
  3578. func (e ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError) Error() string {
  3579. cause := ""
  3580. if e.cause != nil {
  3581. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  3582. }
  3583. key := ""
  3584. if e.key {
  3585. key = "key for "
  3586. }
  3587. return fmt.Sprintf(
  3588. "invalid %sScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement.%s: %s%s",
  3589. key,
  3590. e.field,
  3591. e.reason,
  3592. cause)
  3593. }
  3594. var _ error = ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError{}
  3595. var _ interface {
  3596. Field() string
  3597. Reason() string
  3598. Key() bool
  3599. Cause() error
  3600. ErrorName() string
  3601. } = ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElementValidationError{}