/vendor/github.com/envoyproxy/go-control-plane/envoy/config/core/v3/base.pb.validate.go

https://github.com/open-policy-agent/opa-istio-plugin · Go · 1822 lines · 1227 code · 357 blank · 238 comment · 206 complexity · 643eed0765a125356c4d58fead51c30a MD5 · raw file

  1. // Code generated by protoc-gen-validate. DO NOT EDIT.
  2. // source: envoy/config/core/v3/base.proto
  3. package envoy_config_core_v3
  4. import (
  5. "bytes"
  6. "errors"
  7. "fmt"
  8. "net"
  9. "net/mail"
  10. "net/url"
  11. "regexp"
  12. "strings"
  13. "time"
  14. "unicode/utf8"
  15. "github.com/golang/protobuf/ptypes"
  16. )
  17. // ensure the imports are used
  18. var (
  19. _ = bytes.MinRead
  20. _ = errors.New("")
  21. _ = fmt.Print
  22. _ = utf8.UTFMax
  23. _ = (*regexp.Regexp)(nil)
  24. _ = (*strings.Reader)(nil)
  25. _ = net.IPv4len
  26. _ = time.Duration(0)
  27. _ = (*url.URL)(nil)
  28. _ = (*mail.Address)(nil)
  29. _ = ptypes.DynamicAny{}
  30. )
  31. // Validate checks the field values on Locality with the rules defined in the
  32. // proto definition for this message. If any rules are violated, an error is returned.
  33. func (m *Locality) Validate() error {
  34. if m == nil {
  35. return nil
  36. }
  37. // no validation rules for Region
  38. // no validation rules for Zone
  39. // no validation rules for SubZone
  40. return nil
  41. }
  42. // LocalityValidationError is the validation error returned by
  43. // Locality.Validate if the designated constraints aren't met.
  44. type LocalityValidationError struct {
  45. field string
  46. reason string
  47. cause error
  48. key bool
  49. }
  50. // Field function returns field value.
  51. func (e LocalityValidationError) Field() string { return e.field }
  52. // Reason function returns reason value.
  53. func (e LocalityValidationError) Reason() string { return e.reason }
  54. // Cause function returns cause value.
  55. func (e LocalityValidationError) Cause() error { return e.cause }
  56. // Key function returns key value.
  57. func (e LocalityValidationError) Key() bool { return e.key }
  58. // ErrorName returns error name.
  59. func (e LocalityValidationError) ErrorName() string { return "LocalityValidationError" }
  60. // Error satisfies the builtin error interface
  61. func (e LocalityValidationError) Error() string {
  62. cause := ""
  63. if e.cause != nil {
  64. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  65. }
  66. key := ""
  67. if e.key {
  68. key = "key for "
  69. }
  70. return fmt.Sprintf(
  71. "invalid %sLocality.%s: %s%s",
  72. key,
  73. e.field,
  74. e.reason,
  75. cause)
  76. }
  77. var _ error = LocalityValidationError{}
  78. var _ interface {
  79. Field() string
  80. Reason() string
  81. Key() bool
  82. Cause() error
  83. ErrorName() string
  84. } = LocalityValidationError{}
  85. // Validate checks the field values on BuildVersion with the rules defined in
  86. // the proto definition for this message. If any rules are violated, an error
  87. // is returned.
  88. func (m *BuildVersion) Validate() error {
  89. if m == nil {
  90. return nil
  91. }
  92. if v, ok := interface{}(m.GetVersion()).(interface{ Validate() error }); ok {
  93. if err := v.Validate(); err != nil {
  94. return BuildVersionValidationError{
  95. field: "Version",
  96. reason: "embedded message failed validation",
  97. cause: err,
  98. }
  99. }
  100. }
  101. if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
  102. if err := v.Validate(); err != nil {
  103. return BuildVersionValidationError{
  104. field: "Metadata",
  105. reason: "embedded message failed validation",
  106. cause: err,
  107. }
  108. }
  109. }
  110. return nil
  111. }
  112. // BuildVersionValidationError is the validation error returned by
  113. // BuildVersion.Validate if the designated constraints aren't met.
  114. type BuildVersionValidationError struct {
  115. field string
  116. reason string
  117. cause error
  118. key bool
  119. }
  120. // Field function returns field value.
  121. func (e BuildVersionValidationError) Field() string { return e.field }
  122. // Reason function returns reason value.
  123. func (e BuildVersionValidationError) Reason() string { return e.reason }
  124. // Cause function returns cause value.
  125. func (e BuildVersionValidationError) Cause() error { return e.cause }
  126. // Key function returns key value.
  127. func (e BuildVersionValidationError) Key() bool { return e.key }
  128. // ErrorName returns error name.
  129. func (e BuildVersionValidationError) ErrorName() string { return "BuildVersionValidationError" }
  130. // Error satisfies the builtin error interface
  131. func (e BuildVersionValidationError) Error() string {
  132. cause := ""
  133. if e.cause != nil {
  134. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  135. }
  136. key := ""
  137. if e.key {
  138. key = "key for "
  139. }
  140. return fmt.Sprintf(
  141. "invalid %sBuildVersion.%s: %s%s",
  142. key,
  143. e.field,
  144. e.reason,
  145. cause)
  146. }
  147. var _ error = BuildVersionValidationError{}
  148. var _ interface {
  149. Field() string
  150. Reason() string
  151. Key() bool
  152. Cause() error
  153. ErrorName() string
  154. } = BuildVersionValidationError{}
  155. // Validate checks the field values on Extension with the rules defined in the
  156. // proto definition for this message. If any rules are violated, an error is returned.
  157. func (m *Extension) Validate() error {
  158. if m == nil {
  159. return nil
  160. }
  161. // no validation rules for Name
  162. // no validation rules for Category
  163. // no validation rules for TypeDescriptor
  164. if v, ok := interface{}(m.GetVersion()).(interface{ Validate() error }); ok {
  165. if err := v.Validate(); err != nil {
  166. return ExtensionValidationError{
  167. field: "Version",
  168. reason: "embedded message failed validation",
  169. cause: err,
  170. }
  171. }
  172. }
  173. // no validation rules for Disabled
  174. return nil
  175. }
  176. // ExtensionValidationError is the validation error returned by
  177. // Extension.Validate if the designated constraints aren't met.
  178. type ExtensionValidationError struct {
  179. field string
  180. reason string
  181. cause error
  182. key bool
  183. }
  184. // Field function returns field value.
  185. func (e ExtensionValidationError) Field() string { return e.field }
  186. // Reason function returns reason value.
  187. func (e ExtensionValidationError) Reason() string { return e.reason }
  188. // Cause function returns cause value.
  189. func (e ExtensionValidationError) Cause() error { return e.cause }
  190. // Key function returns key value.
  191. func (e ExtensionValidationError) Key() bool { return e.key }
  192. // ErrorName returns error name.
  193. func (e ExtensionValidationError) ErrorName() string { return "ExtensionValidationError" }
  194. // Error satisfies the builtin error interface
  195. func (e ExtensionValidationError) Error() string {
  196. cause := ""
  197. if e.cause != nil {
  198. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  199. }
  200. key := ""
  201. if e.key {
  202. key = "key for "
  203. }
  204. return fmt.Sprintf(
  205. "invalid %sExtension.%s: %s%s",
  206. key,
  207. e.field,
  208. e.reason,
  209. cause)
  210. }
  211. var _ error = ExtensionValidationError{}
  212. var _ interface {
  213. Field() string
  214. Reason() string
  215. Key() bool
  216. Cause() error
  217. ErrorName() string
  218. } = ExtensionValidationError{}
  219. // Validate checks the field values on Node with the rules defined in the proto
  220. // definition for this message. If any rules are violated, an error is returned.
  221. func (m *Node) Validate() error {
  222. if m == nil {
  223. return nil
  224. }
  225. // no validation rules for Id
  226. // no validation rules for Cluster
  227. if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
  228. if err := v.Validate(); err != nil {
  229. return NodeValidationError{
  230. field: "Metadata",
  231. reason: "embedded message failed validation",
  232. cause: err,
  233. }
  234. }
  235. }
  236. for key, val := range m.GetDynamicParameters() {
  237. _ = val
  238. // no validation rules for DynamicParameters[key]
  239. if v, ok := interface{}(val).(interface{ Validate() error }); ok {
  240. if err := v.Validate(); err != nil {
  241. return NodeValidationError{
  242. field: fmt.Sprintf("DynamicParameters[%v]", key),
  243. reason: "embedded message failed validation",
  244. cause: err,
  245. }
  246. }
  247. }
  248. }
  249. if v, ok := interface{}(m.GetLocality()).(interface{ Validate() error }); ok {
  250. if err := v.Validate(); err != nil {
  251. return NodeValidationError{
  252. field: "Locality",
  253. reason: "embedded message failed validation",
  254. cause: err,
  255. }
  256. }
  257. }
  258. // no validation rules for UserAgentName
  259. for idx, item := range m.GetExtensions() {
  260. _, _ = idx, item
  261. if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  262. if err := v.Validate(); err != nil {
  263. return NodeValidationError{
  264. field: fmt.Sprintf("Extensions[%v]", idx),
  265. reason: "embedded message failed validation",
  266. cause: err,
  267. }
  268. }
  269. }
  270. }
  271. for idx, item := range m.GetListeningAddresses() {
  272. _, _ = idx, item
  273. if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  274. if err := v.Validate(); err != nil {
  275. return NodeValidationError{
  276. field: fmt.Sprintf("ListeningAddresses[%v]", idx),
  277. reason: "embedded message failed validation",
  278. cause: err,
  279. }
  280. }
  281. }
  282. }
  283. // no validation rules for HiddenEnvoyDeprecatedBuildVersion
  284. switch m.UserAgentVersionType.(type) {
  285. case *Node_UserAgentVersion:
  286. // no validation rules for UserAgentVersion
  287. case *Node_UserAgentBuildVersion:
  288. if v, ok := interface{}(m.GetUserAgentBuildVersion()).(interface{ Validate() error }); ok {
  289. if err := v.Validate(); err != nil {
  290. return NodeValidationError{
  291. field: "UserAgentBuildVersion",
  292. reason: "embedded message failed validation",
  293. cause: err,
  294. }
  295. }
  296. }
  297. }
  298. return nil
  299. }
  300. // NodeValidationError is the validation error returned by Node.Validate if the
  301. // designated constraints aren't met.
  302. type NodeValidationError struct {
  303. field string
  304. reason string
  305. cause error
  306. key bool
  307. }
  308. // Field function returns field value.
  309. func (e NodeValidationError) Field() string { return e.field }
  310. // Reason function returns reason value.
  311. func (e NodeValidationError) Reason() string { return e.reason }
  312. // Cause function returns cause value.
  313. func (e NodeValidationError) Cause() error { return e.cause }
  314. // Key function returns key value.
  315. func (e NodeValidationError) Key() bool { return e.key }
  316. // ErrorName returns error name.
  317. func (e NodeValidationError) ErrorName() string { return "NodeValidationError" }
  318. // Error satisfies the builtin error interface
  319. func (e NodeValidationError) Error() string {
  320. cause := ""
  321. if e.cause != nil {
  322. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  323. }
  324. key := ""
  325. if e.key {
  326. key = "key for "
  327. }
  328. return fmt.Sprintf(
  329. "invalid %sNode.%s: %s%s",
  330. key,
  331. e.field,
  332. e.reason,
  333. cause)
  334. }
  335. var _ error = NodeValidationError{}
  336. var _ interface {
  337. Field() string
  338. Reason() string
  339. Key() bool
  340. Cause() error
  341. ErrorName() string
  342. } = NodeValidationError{}
  343. // Validate checks the field values on Metadata with the rules defined in the
  344. // proto definition for this message. If any rules are violated, an error is returned.
  345. func (m *Metadata) Validate() error {
  346. if m == nil {
  347. return nil
  348. }
  349. for key, val := range m.GetFilterMetadata() {
  350. _ = val
  351. // no validation rules for FilterMetadata[key]
  352. if v, ok := interface{}(val).(interface{ Validate() error }); ok {
  353. if err := v.Validate(); err != nil {
  354. return MetadataValidationError{
  355. field: fmt.Sprintf("FilterMetadata[%v]", key),
  356. reason: "embedded message failed validation",
  357. cause: err,
  358. }
  359. }
  360. }
  361. }
  362. for key, val := range m.GetTypedFilterMetadata() {
  363. _ = val
  364. // no validation rules for TypedFilterMetadata[key]
  365. if v, ok := interface{}(val).(interface{ Validate() error }); ok {
  366. if err := v.Validate(); err != nil {
  367. return MetadataValidationError{
  368. field: fmt.Sprintf("TypedFilterMetadata[%v]", key),
  369. reason: "embedded message failed validation",
  370. cause: err,
  371. }
  372. }
  373. }
  374. }
  375. return nil
  376. }
  377. // MetadataValidationError is the validation error returned by
  378. // Metadata.Validate if the designated constraints aren't met.
  379. type MetadataValidationError struct {
  380. field string
  381. reason string
  382. cause error
  383. key bool
  384. }
  385. // Field function returns field value.
  386. func (e MetadataValidationError) Field() string { return e.field }
  387. // Reason function returns reason value.
  388. func (e MetadataValidationError) Reason() string { return e.reason }
  389. // Cause function returns cause value.
  390. func (e MetadataValidationError) Cause() error { return e.cause }
  391. // Key function returns key value.
  392. func (e MetadataValidationError) Key() bool { return e.key }
  393. // ErrorName returns error name.
  394. func (e MetadataValidationError) ErrorName() string { return "MetadataValidationError" }
  395. // Error satisfies the builtin error interface
  396. func (e MetadataValidationError) Error() string {
  397. cause := ""
  398. if e.cause != nil {
  399. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  400. }
  401. key := ""
  402. if e.key {
  403. key = "key for "
  404. }
  405. return fmt.Sprintf(
  406. "invalid %sMetadata.%s: %s%s",
  407. key,
  408. e.field,
  409. e.reason,
  410. cause)
  411. }
  412. var _ error = MetadataValidationError{}
  413. var _ interface {
  414. Field() string
  415. Reason() string
  416. Key() bool
  417. Cause() error
  418. ErrorName() string
  419. } = MetadataValidationError{}
  420. // Validate checks the field values on RuntimeUInt32 with the rules defined in
  421. // the proto definition for this message. If any rules are violated, an error
  422. // is returned.
  423. func (m *RuntimeUInt32) Validate() error {
  424. if m == nil {
  425. return nil
  426. }
  427. // no validation rules for DefaultValue
  428. if utf8.RuneCountInString(m.GetRuntimeKey()) < 1 {
  429. return RuntimeUInt32ValidationError{
  430. field: "RuntimeKey",
  431. reason: "value length must be at least 1 runes",
  432. }
  433. }
  434. return nil
  435. }
  436. // RuntimeUInt32ValidationError is the validation error returned by
  437. // RuntimeUInt32.Validate if the designated constraints aren't met.
  438. type RuntimeUInt32ValidationError struct {
  439. field string
  440. reason string
  441. cause error
  442. key bool
  443. }
  444. // Field function returns field value.
  445. func (e RuntimeUInt32ValidationError) Field() string { return e.field }
  446. // Reason function returns reason value.
  447. func (e RuntimeUInt32ValidationError) Reason() string { return e.reason }
  448. // Cause function returns cause value.
  449. func (e RuntimeUInt32ValidationError) Cause() error { return e.cause }
  450. // Key function returns key value.
  451. func (e RuntimeUInt32ValidationError) Key() bool { return e.key }
  452. // ErrorName returns error name.
  453. func (e RuntimeUInt32ValidationError) ErrorName() string { return "RuntimeUInt32ValidationError" }
  454. // Error satisfies the builtin error interface
  455. func (e RuntimeUInt32ValidationError) Error() string {
  456. cause := ""
  457. if e.cause != nil {
  458. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  459. }
  460. key := ""
  461. if e.key {
  462. key = "key for "
  463. }
  464. return fmt.Sprintf(
  465. "invalid %sRuntimeUInt32.%s: %s%s",
  466. key,
  467. e.field,
  468. e.reason,
  469. cause)
  470. }
  471. var _ error = RuntimeUInt32ValidationError{}
  472. var _ interface {
  473. Field() string
  474. Reason() string
  475. Key() bool
  476. Cause() error
  477. ErrorName() string
  478. } = RuntimeUInt32ValidationError{}
  479. // Validate checks the field values on RuntimePercent with the rules defined in
  480. // the proto definition for this message. If any rules are violated, an error
  481. // is returned.
  482. func (m *RuntimePercent) Validate() error {
  483. if m == nil {
  484. return nil
  485. }
  486. if v, ok := interface{}(m.GetDefaultValue()).(interface{ Validate() error }); ok {
  487. if err := v.Validate(); err != nil {
  488. return RuntimePercentValidationError{
  489. field: "DefaultValue",
  490. reason: "embedded message failed validation",
  491. cause: err,
  492. }
  493. }
  494. }
  495. if utf8.RuneCountInString(m.GetRuntimeKey()) < 1 {
  496. return RuntimePercentValidationError{
  497. field: "RuntimeKey",
  498. reason: "value length must be at least 1 runes",
  499. }
  500. }
  501. return nil
  502. }
  503. // RuntimePercentValidationError is the validation error returned by
  504. // RuntimePercent.Validate if the designated constraints aren't met.
  505. type RuntimePercentValidationError struct {
  506. field string
  507. reason string
  508. cause error
  509. key bool
  510. }
  511. // Field function returns field value.
  512. func (e RuntimePercentValidationError) Field() string { return e.field }
  513. // Reason function returns reason value.
  514. func (e RuntimePercentValidationError) Reason() string { return e.reason }
  515. // Cause function returns cause value.
  516. func (e RuntimePercentValidationError) Cause() error { return e.cause }
  517. // Key function returns key value.
  518. func (e RuntimePercentValidationError) Key() bool { return e.key }
  519. // ErrorName returns error name.
  520. func (e RuntimePercentValidationError) ErrorName() string { return "RuntimePercentValidationError" }
  521. // Error satisfies the builtin error interface
  522. func (e RuntimePercentValidationError) Error() string {
  523. cause := ""
  524. if e.cause != nil {
  525. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  526. }
  527. key := ""
  528. if e.key {
  529. key = "key for "
  530. }
  531. return fmt.Sprintf(
  532. "invalid %sRuntimePercent.%s: %s%s",
  533. key,
  534. e.field,
  535. e.reason,
  536. cause)
  537. }
  538. var _ error = RuntimePercentValidationError{}
  539. var _ interface {
  540. Field() string
  541. Reason() string
  542. Key() bool
  543. Cause() error
  544. ErrorName() string
  545. } = RuntimePercentValidationError{}
  546. // Validate checks the field values on RuntimeDouble with the rules defined in
  547. // the proto definition for this message. If any rules are violated, an error
  548. // is returned.
  549. func (m *RuntimeDouble) Validate() error {
  550. if m == nil {
  551. return nil
  552. }
  553. // no validation rules for DefaultValue
  554. if utf8.RuneCountInString(m.GetRuntimeKey()) < 1 {
  555. return RuntimeDoubleValidationError{
  556. field: "RuntimeKey",
  557. reason: "value length must be at least 1 runes",
  558. }
  559. }
  560. return nil
  561. }
  562. // RuntimeDoubleValidationError is the validation error returned by
  563. // RuntimeDouble.Validate if the designated constraints aren't met.
  564. type RuntimeDoubleValidationError struct {
  565. field string
  566. reason string
  567. cause error
  568. key bool
  569. }
  570. // Field function returns field value.
  571. func (e RuntimeDoubleValidationError) Field() string { return e.field }
  572. // Reason function returns reason value.
  573. func (e RuntimeDoubleValidationError) Reason() string { return e.reason }
  574. // Cause function returns cause value.
  575. func (e RuntimeDoubleValidationError) Cause() error { return e.cause }
  576. // Key function returns key value.
  577. func (e RuntimeDoubleValidationError) Key() bool { return e.key }
  578. // ErrorName returns error name.
  579. func (e RuntimeDoubleValidationError) ErrorName() string { return "RuntimeDoubleValidationError" }
  580. // Error satisfies the builtin error interface
  581. func (e RuntimeDoubleValidationError) Error() string {
  582. cause := ""
  583. if e.cause != nil {
  584. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  585. }
  586. key := ""
  587. if e.key {
  588. key = "key for "
  589. }
  590. return fmt.Sprintf(
  591. "invalid %sRuntimeDouble.%s: %s%s",
  592. key,
  593. e.field,
  594. e.reason,
  595. cause)
  596. }
  597. var _ error = RuntimeDoubleValidationError{}
  598. var _ interface {
  599. Field() string
  600. Reason() string
  601. Key() bool
  602. Cause() error
  603. ErrorName() string
  604. } = RuntimeDoubleValidationError{}
  605. // Validate checks the field values on RuntimeFeatureFlag with the rules
  606. // defined in the proto definition for this message. If any rules are
  607. // violated, an error is returned.
  608. func (m *RuntimeFeatureFlag) Validate() error {
  609. if m == nil {
  610. return nil
  611. }
  612. if m.GetDefaultValue() == nil {
  613. return RuntimeFeatureFlagValidationError{
  614. field: "DefaultValue",
  615. reason: "value is required",
  616. }
  617. }
  618. if v, ok := interface{}(m.GetDefaultValue()).(interface{ Validate() error }); ok {
  619. if err := v.Validate(); err != nil {
  620. return RuntimeFeatureFlagValidationError{
  621. field: "DefaultValue",
  622. reason: "embedded message failed validation",
  623. cause: err,
  624. }
  625. }
  626. }
  627. if utf8.RuneCountInString(m.GetRuntimeKey()) < 1 {
  628. return RuntimeFeatureFlagValidationError{
  629. field: "RuntimeKey",
  630. reason: "value length must be at least 1 runes",
  631. }
  632. }
  633. return nil
  634. }
  635. // RuntimeFeatureFlagValidationError is the validation error returned by
  636. // RuntimeFeatureFlag.Validate if the designated constraints aren't met.
  637. type RuntimeFeatureFlagValidationError struct {
  638. field string
  639. reason string
  640. cause error
  641. key bool
  642. }
  643. // Field function returns field value.
  644. func (e RuntimeFeatureFlagValidationError) Field() string { return e.field }
  645. // Reason function returns reason value.
  646. func (e RuntimeFeatureFlagValidationError) Reason() string { return e.reason }
  647. // Cause function returns cause value.
  648. func (e RuntimeFeatureFlagValidationError) Cause() error { return e.cause }
  649. // Key function returns key value.
  650. func (e RuntimeFeatureFlagValidationError) Key() bool { return e.key }
  651. // ErrorName returns error name.
  652. func (e RuntimeFeatureFlagValidationError) ErrorName() string {
  653. return "RuntimeFeatureFlagValidationError"
  654. }
  655. // Error satisfies the builtin error interface
  656. func (e RuntimeFeatureFlagValidationError) Error() string {
  657. cause := ""
  658. if e.cause != nil {
  659. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  660. }
  661. key := ""
  662. if e.key {
  663. key = "key for "
  664. }
  665. return fmt.Sprintf(
  666. "invalid %sRuntimeFeatureFlag.%s: %s%s",
  667. key,
  668. e.field,
  669. e.reason,
  670. cause)
  671. }
  672. var _ error = RuntimeFeatureFlagValidationError{}
  673. var _ interface {
  674. Field() string
  675. Reason() string
  676. Key() bool
  677. Cause() error
  678. ErrorName() string
  679. } = RuntimeFeatureFlagValidationError{}
  680. // Validate checks the field values on HeaderValue with the rules defined in
  681. // the proto definition for this message. If any rules are violated, an error
  682. // is returned.
  683. func (m *HeaderValue) Validate() error {
  684. if m == nil {
  685. return nil
  686. }
  687. if utf8.RuneCountInString(m.GetKey()) < 1 {
  688. return HeaderValueValidationError{
  689. field: "Key",
  690. reason: "value length must be at least 1 runes",
  691. }
  692. }
  693. if len(m.GetKey()) > 16384 {
  694. return HeaderValueValidationError{
  695. field: "Key",
  696. reason: "value length must be at most 16384 bytes",
  697. }
  698. }
  699. if !_HeaderValue_Key_Pattern.MatchString(m.GetKey()) {
  700. return HeaderValueValidationError{
  701. field: "Key",
  702. reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
  703. }
  704. }
  705. if len(m.GetValue()) > 16384 {
  706. return HeaderValueValidationError{
  707. field: "Value",
  708. reason: "value length must be at most 16384 bytes",
  709. }
  710. }
  711. if !_HeaderValue_Value_Pattern.MatchString(m.GetValue()) {
  712. return HeaderValueValidationError{
  713. field: "Value",
  714. reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
  715. }
  716. }
  717. return nil
  718. }
  719. // HeaderValueValidationError is the validation error returned by
  720. // HeaderValue.Validate if the designated constraints aren't met.
  721. type HeaderValueValidationError struct {
  722. field string
  723. reason string
  724. cause error
  725. key bool
  726. }
  727. // Field function returns field value.
  728. func (e HeaderValueValidationError) Field() string { return e.field }
  729. // Reason function returns reason value.
  730. func (e HeaderValueValidationError) Reason() string { return e.reason }
  731. // Cause function returns cause value.
  732. func (e HeaderValueValidationError) Cause() error { return e.cause }
  733. // Key function returns key value.
  734. func (e HeaderValueValidationError) Key() bool { return e.key }
  735. // ErrorName returns error name.
  736. func (e HeaderValueValidationError) ErrorName() string { return "HeaderValueValidationError" }
  737. // Error satisfies the builtin error interface
  738. func (e HeaderValueValidationError) Error() string {
  739. cause := ""
  740. if e.cause != nil {
  741. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  742. }
  743. key := ""
  744. if e.key {
  745. key = "key for "
  746. }
  747. return fmt.Sprintf(
  748. "invalid %sHeaderValue.%s: %s%s",
  749. key,
  750. e.field,
  751. e.reason,
  752. cause)
  753. }
  754. var _ error = HeaderValueValidationError{}
  755. var _ interface {
  756. Field() string
  757. Reason() string
  758. Key() bool
  759. Cause() error
  760. ErrorName() string
  761. } = HeaderValueValidationError{}
  762. var _HeaderValue_Key_Pattern = regexp.MustCompile("^[^\x00\n\r]*$")
  763. var _HeaderValue_Value_Pattern = regexp.MustCompile("^[^\x00\n\r]*$")
  764. // Validate checks the field values on HeaderValueOption with the rules defined
  765. // in the proto definition for this message. If any rules are violated, an
  766. // error is returned.
  767. func (m *HeaderValueOption) Validate() error {
  768. if m == nil {
  769. return nil
  770. }
  771. if m.GetHeader() == nil {
  772. return HeaderValueOptionValidationError{
  773. field: "Header",
  774. reason: "value is required",
  775. }
  776. }
  777. if v, ok := interface{}(m.GetHeader()).(interface{ Validate() error }); ok {
  778. if err := v.Validate(); err != nil {
  779. return HeaderValueOptionValidationError{
  780. field: "Header",
  781. reason: "embedded message failed validation",
  782. cause: err,
  783. }
  784. }
  785. }
  786. if v, ok := interface{}(m.GetAppend()).(interface{ Validate() error }); ok {
  787. if err := v.Validate(); err != nil {
  788. return HeaderValueOptionValidationError{
  789. field: "Append",
  790. reason: "embedded message failed validation",
  791. cause: err,
  792. }
  793. }
  794. }
  795. return nil
  796. }
  797. // HeaderValueOptionValidationError is the validation error returned by
  798. // HeaderValueOption.Validate if the designated constraints aren't met.
  799. type HeaderValueOptionValidationError struct {
  800. field string
  801. reason string
  802. cause error
  803. key bool
  804. }
  805. // Field function returns field value.
  806. func (e HeaderValueOptionValidationError) Field() string { return e.field }
  807. // Reason function returns reason value.
  808. func (e HeaderValueOptionValidationError) Reason() string { return e.reason }
  809. // Cause function returns cause value.
  810. func (e HeaderValueOptionValidationError) Cause() error { return e.cause }
  811. // Key function returns key value.
  812. func (e HeaderValueOptionValidationError) Key() bool { return e.key }
  813. // ErrorName returns error name.
  814. func (e HeaderValueOptionValidationError) ErrorName() string {
  815. return "HeaderValueOptionValidationError"
  816. }
  817. // Error satisfies the builtin error interface
  818. func (e HeaderValueOptionValidationError) Error() string {
  819. cause := ""
  820. if e.cause != nil {
  821. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  822. }
  823. key := ""
  824. if e.key {
  825. key = "key for "
  826. }
  827. return fmt.Sprintf(
  828. "invalid %sHeaderValueOption.%s: %s%s",
  829. key,
  830. e.field,
  831. e.reason,
  832. cause)
  833. }
  834. var _ error = HeaderValueOptionValidationError{}
  835. var _ interface {
  836. Field() string
  837. Reason() string
  838. Key() bool
  839. Cause() error
  840. ErrorName() string
  841. } = HeaderValueOptionValidationError{}
  842. // Validate checks the field values on HeaderMap with the rules defined in the
  843. // proto definition for this message. If any rules are violated, an error is returned.
  844. func (m *HeaderMap) Validate() error {
  845. if m == nil {
  846. return nil
  847. }
  848. for idx, item := range m.GetHeaders() {
  849. _, _ = idx, item
  850. if v, ok := interface{}(item).(interface{ Validate() error }); ok {
  851. if err := v.Validate(); err != nil {
  852. return HeaderMapValidationError{
  853. field: fmt.Sprintf("Headers[%v]", idx),
  854. reason: "embedded message failed validation",
  855. cause: err,
  856. }
  857. }
  858. }
  859. }
  860. return nil
  861. }
  862. // HeaderMapValidationError is the validation error returned by
  863. // HeaderMap.Validate if the designated constraints aren't met.
  864. type HeaderMapValidationError struct {
  865. field string
  866. reason string
  867. cause error
  868. key bool
  869. }
  870. // Field function returns field value.
  871. func (e HeaderMapValidationError) Field() string { return e.field }
  872. // Reason function returns reason value.
  873. func (e HeaderMapValidationError) Reason() string { return e.reason }
  874. // Cause function returns cause value.
  875. func (e HeaderMapValidationError) Cause() error { return e.cause }
  876. // Key function returns key value.
  877. func (e HeaderMapValidationError) Key() bool { return e.key }
  878. // ErrorName returns error name.
  879. func (e HeaderMapValidationError) ErrorName() string { return "HeaderMapValidationError" }
  880. // Error satisfies the builtin error interface
  881. func (e HeaderMapValidationError) Error() string {
  882. cause := ""
  883. if e.cause != nil {
  884. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  885. }
  886. key := ""
  887. if e.key {
  888. key = "key for "
  889. }
  890. return fmt.Sprintf(
  891. "invalid %sHeaderMap.%s: %s%s",
  892. key,
  893. e.field,
  894. e.reason,
  895. cause)
  896. }
  897. var _ error = HeaderMapValidationError{}
  898. var _ interface {
  899. Field() string
  900. Reason() string
  901. Key() bool
  902. Cause() error
  903. ErrorName() string
  904. } = HeaderMapValidationError{}
  905. // Validate checks the field values on WatchedDirectory with the rules defined
  906. // in the proto definition for this message. If any rules are violated, an
  907. // error is returned.
  908. func (m *WatchedDirectory) Validate() error {
  909. if m == nil {
  910. return nil
  911. }
  912. if utf8.RuneCountInString(m.GetPath()) < 1 {
  913. return WatchedDirectoryValidationError{
  914. field: "Path",
  915. reason: "value length must be at least 1 runes",
  916. }
  917. }
  918. return nil
  919. }
  920. // WatchedDirectoryValidationError is the validation error returned by
  921. // WatchedDirectory.Validate if the designated constraints aren't met.
  922. type WatchedDirectoryValidationError struct {
  923. field string
  924. reason string
  925. cause error
  926. key bool
  927. }
  928. // Field function returns field value.
  929. func (e WatchedDirectoryValidationError) Field() string { return e.field }
  930. // Reason function returns reason value.
  931. func (e WatchedDirectoryValidationError) Reason() string { return e.reason }
  932. // Cause function returns cause value.
  933. func (e WatchedDirectoryValidationError) Cause() error { return e.cause }
  934. // Key function returns key value.
  935. func (e WatchedDirectoryValidationError) Key() bool { return e.key }
  936. // ErrorName returns error name.
  937. func (e WatchedDirectoryValidationError) ErrorName() string { return "WatchedDirectoryValidationError" }
  938. // Error satisfies the builtin error interface
  939. func (e WatchedDirectoryValidationError) Error() string {
  940. cause := ""
  941. if e.cause != nil {
  942. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  943. }
  944. key := ""
  945. if e.key {
  946. key = "key for "
  947. }
  948. return fmt.Sprintf(
  949. "invalid %sWatchedDirectory.%s: %s%s",
  950. key,
  951. e.field,
  952. e.reason,
  953. cause)
  954. }
  955. var _ error = WatchedDirectoryValidationError{}
  956. var _ interface {
  957. Field() string
  958. Reason() string
  959. Key() bool
  960. Cause() error
  961. ErrorName() string
  962. } = WatchedDirectoryValidationError{}
  963. // Validate checks the field values on DataSource with the rules defined in the
  964. // proto definition for this message. If any rules are violated, an error is returned.
  965. func (m *DataSource) Validate() error {
  966. if m == nil {
  967. return nil
  968. }
  969. switch m.Specifier.(type) {
  970. case *DataSource_Filename:
  971. if utf8.RuneCountInString(m.GetFilename()) < 1 {
  972. return DataSourceValidationError{
  973. field: "Filename",
  974. reason: "value length must be at least 1 runes",
  975. }
  976. }
  977. case *DataSource_InlineBytes:
  978. // no validation rules for InlineBytes
  979. case *DataSource_InlineString:
  980. // no validation rules for InlineString
  981. default:
  982. return DataSourceValidationError{
  983. field: "Specifier",
  984. reason: "value is required",
  985. }
  986. }
  987. return nil
  988. }
  989. // DataSourceValidationError is the validation error returned by
  990. // DataSource.Validate if the designated constraints aren't met.
  991. type DataSourceValidationError struct {
  992. field string
  993. reason string
  994. cause error
  995. key bool
  996. }
  997. // Field function returns field value.
  998. func (e DataSourceValidationError) Field() string { return e.field }
  999. // Reason function returns reason value.
  1000. func (e DataSourceValidationError) Reason() string { return e.reason }
  1001. // Cause function returns cause value.
  1002. func (e DataSourceValidationError) Cause() error { return e.cause }
  1003. // Key function returns key value.
  1004. func (e DataSourceValidationError) Key() bool { return e.key }
  1005. // ErrorName returns error name.
  1006. func (e DataSourceValidationError) ErrorName() string { return "DataSourceValidationError" }
  1007. // Error satisfies the builtin error interface
  1008. func (e DataSourceValidationError) Error() string {
  1009. cause := ""
  1010. if e.cause != nil {
  1011. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1012. }
  1013. key := ""
  1014. if e.key {
  1015. key = "key for "
  1016. }
  1017. return fmt.Sprintf(
  1018. "invalid %sDataSource.%s: %s%s",
  1019. key,
  1020. e.field,
  1021. e.reason,
  1022. cause)
  1023. }
  1024. var _ error = DataSourceValidationError{}
  1025. var _ interface {
  1026. Field() string
  1027. Reason() string
  1028. Key() bool
  1029. Cause() error
  1030. ErrorName() string
  1031. } = DataSourceValidationError{}
  1032. // Validate checks the field values on RetryPolicy with the rules defined in
  1033. // the proto definition for this message. If any rules are violated, an error
  1034. // is returned.
  1035. func (m *RetryPolicy) Validate() error {
  1036. if m == nil {
  1037. return nil
  1038. }
  1039. if v, ok := interface{}(m.GetRetryBackOff()).(interface{ Validate() error }); ok {
  1040. if err := v.Validate(); err != nil {
  1041. return RetryPolicyValidationError{
  1042. field: "RetryBackOff",
  1043. reason: "embedded message failed validation",
  1044. cause: err,
  1045. }
  1046. }
  1047. }
  1048. if v, ok := interface{}(m.GetNumRetries()).(interface{ Validate() error }); ok {
  1049. if err := v.Validate(); err != nil {
  1050. return RetryPolicyValidationError{
  1051. field: "NumRetries",
  1052. reason: "embedded message failed validation",
  1053. cause: err,
  1054. }
  1055. }
  1056. }
  1057. return nil
  1058. }
  1059. // RetryPolicyValidationError is the validation error returned by
  1060. // RetryPolicy.Validate if the designated constraints aren't met.
  1061. type RetryPolicyValidationError struct {
  1062. field string
  1063. reason string
  1064. cause error
  1065. key bool
  1066. }
  1067. // Field function returns field value.
  1068. func (e RetryPolicyValidationError) Field() string { return e.field }
  1069. // Reason function returns reason value.
  1070. func (e RetryPolicyValidationError) Reason() string { return e.reason }
  1071. // Cause function returns cause value.
  1072. func (e RetryPolicyValidationError) Cause() error { return e.cause }
  1073. // Key function returns key value.
  1074. func (e RetryPolicyValidationError) Key() bool { return e.key }
  1075. // ErrorName returns error name.
  1076. func (e RetryPolicyValidationError) ErrorName() string { return "RetryPolicyValidationError" }
  1077. // Error satisfies the builtin error interface
  1078. func (e RetryPolicyValidationError) Error() string {
  1079. cause := ""
  1080. if e.cause != nil {
  1081. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1082. }
  1083. key := ""
  1084. if e.key {
  1085. key = "key for "
  1086. }
  1087. return fmt.Sprintf(
  1088. "invalid %sRetryPolicy.%s: %s%s",
  1089. key,
  1090. e.field,
  1091. e.reason,
  1092. cause)
  1093. }
  1094. var _ error = RetryPolicyValidationError{}
  1095. var _ interface {
  1096. Field() string
  1097. Reason() string
  1098. Key() bool
  1099. Cause() error
  1100. ErrorName() string
  1101. } = RetryPolicyValidationError{}
  1102. // Validate checks the field values on RemoteDataSource with the rules defined
  1103. // in the proto definition for this message. If any rules are violated, an
  1104. // error is returned.
  1105. func (m *RemoteDataSource) Validate() error {
  1106. if m == nil {
  1107. return nil
  1108. }
  1109. if m.GetHttpUri() == nil {
  1110. return RemoteDataSourceValidationError{
  1111. field: "HttpUri",
  1112. reason: "value is required",
  1113. }
  1114. }
  1115. if v, ok := interface{}(m.GetHttpUri()).(interface{ Validate() error }); ok {
  1116. if err := v.Validate(); err != nil {
  1117. return RemoteDataSourceValidationError{
  1118. field: "HttpUri",
  1119. reason: "embedded message failed validation",
  1120. cause: err,
  1121. }
  1122. }
  1123. }
  1124. if utf8.RuneCountInString(m.GetSha256()) < 1 {
  1125. return RemoteDataSourceValidationError{
  1126. field: "Sha256",
  1127. reason: "value length must be at least 1 runes",
  1128. }
  1129. }
  1130. if v, ok := interface{}(m.GetRetryPolicy()).(interface{ Validate() error }); ok {
  1131. if err := v.Validate(); err != nil {
  1132. return RemoteDataSourceValidationError{
  1133. field: "RetryPolicy",
  1134. reason: "embedded message failed validation",
  1135. cause: err,
  1136. }
  1137. }
  1138. }
  1139. return nil
  1140. }
  1141. // RemoteDataSourceValidationError is the validation error returned by
  1142. // RemoteDataSource.Validate if the designated constraints aren't met.
  1143. type RemoteDataSourceValidationError struct {
  1144. field string
  1145. reason string
  1146. cause error
  1147. key bool
  1148. }
  1149. // Field function returns field value.
  1150. func (e RemoteDataSourceValidationError) Field() string { return e.field }
  1151. // Reason function returns reason value.
  1152. func (e RemoteDataSourceValidationError) Reason() string { return e.reason }
  1153. // Cause function returns cause value.
  1154. func (e RemoteDataSourceValidationError) Cause() error { return e.cause }
  1155. // Key function returns key value.
  1156. func (e RemoteDataSourceValidationError) Key() bool { return e.key }
  1157. // ErrorName returns error name.
  1158. func (e RemoteDataSourceValidationError) ErrorName() string { return "RemoteDataSourceValidationError" }
  1159. // Error satisfies the builtin error interface
  1160. func (e RemoteDataSourceValidationError) Error() string {
  1161. cause := ""
  1162. if e.cause != nil {
  1163. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1164. }
  1165. key := ""
  1166. if e.key {
  1167. key = "key for "
  1168. }
  1169. return fmt.Sprintf(
  1170. "invalid %sRemoteDataSource.%s: %s%s",
  1171. key,
  1172. e.field,
  1173. e.reason,
  1174. cause)
  1175. }
  1176. var _ error = RemoteDataSourceValidationError{}
  1177. var _ interface {
  1178. Field() string
  1179. Reason() string
  1180. Key() bool
  1181. Cause() error
  1182. ErrorName() string
  1183. } = RemoteDataSourceValidationError{}
  1184. // Validate checks the field values on AsyncDataSource with the rules defined
  1185. // in the proto definition for this message. If any rules are violated, an
  1186. // error is returned.
  1187. func (m *AsyncDataSource) Validate() error {
  1188. if m == nil {
  1189. return nil
  1190. }
  1191. switch m.Specifier.(type) {
  1192. case *AsyncDataSource_Local:
  1193. if v, ok := interface{}(m.GetLocal()).(interface{ Validate() error }); ok {
  1194. if err := v.Validate(); err != nil {
  1195. return AsyncDataSourceValidationError{
  1196. field: "Local",
  1197. reason: "embedded message failed validation",
  1198. cause: err,
  1199. }
  1200. }
  1201. }
  1202. case *AsyncDataSource_Remote:
  1203. if v, ok := interface{}(m.GetRemote()).(interface{ Validate() error }); ok {
  1204. if err := v.Validate(); err != nil {
  1205. return AsyncDataSourceValidationError{
  1206. field: "Remote",
  1207. reason: "embedded message failed validation",
  1208. cause: err,
  1209. }
  1210. }
  1211. }
  1212. default:
  1213. return AsyncDataSourceValidationError{
  1214. field: "Specifier",
  1215. reason: "value is required",
  1216. }
  1217. }
  1218. return nil
  1219. }
  1220. // AsyncDataSourceValidationError is the validation error returned by
  1221. // AsyncDataSource.Validate if the designated constraints aren't met.
  1222. type AsyncDataSourceValidationError struct {
  1223. field string
  1224. reason string
  1225. cause error
  1226. key bool
  1227. }
  1228. // Field function returns field value.
  1229. func (e AsyncDataSourceValidationError) Field() string { return e.field }
  1230. // Reason function returns reason value.
  1231. func (e AsyncDataSourceValidationError) Reason() string { return e.reason }
  1232. // Cause function returns cause value.
  1233. func (e AsyncDataSourceValidationError) Cause() error { return e.cause }
  1234. // Key function returns key value.
  1235. func (e AsyncDataSourceValidationError) Key() bool { return e.key }
  1236. // ErrorName returns error name.
  1237. func (e AsyncDataSourceValidationError) ErrorName() string { return "AsyncDataSourceValidationError" }
  1238. // Error satisfies the builtin error interface
  1239. func (e AsyncDataSourceValidationError) Error() string {
  1240. cause := ""
  1241. if e.cause != nil {
  1242. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1243. }
  1244. key := ""
  1245. if e.key {
  1246. key = "key for "
  1247. }
  1248. return fmt.Sprintf(
  1249. "invalid %sAsyncDataSource.%s: %s%s",
  1250. key,
  1251. e.field,
  1252. e.reason,
  1253. cause)
  1254. }
  1255. var _ error = AsyncDataSourceValidationError{}
  1256. var _ interface {
  1257. Field() string
  1258. Reason() string
  1259. Key() bool
  1260. Cause() error
  1261. ErrorName() string
  1262. } = AsyncDataSourceValidationError{}
  1263. // Validate checks the field values on TransportSocket with the rules defined
  1264. // in the proto definition for this message. If any rules are violated, an
  1265. // error is returned.
  1266. func (m *TransportSocket) Validate() error {
  1267. if m == nil {
  1268. return nil
  1269. }
  1270. if utf8.RuneCountInString(m.GetName()) < 1 {
  1271. return TransportSocketValidationError{
  1272. field: "Name",
  1273. reason: "value length must be at least 1 runes",
  1274. }
  1275. }
  1276. switch m.ConfigType.(type) {
  1277. case *TransportSocket_TypedConfig:
  1278. if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok {
  1279. if err := v.Validate(); err != nil {
  1280. return TransportSocketValidationError{
  1281. field: "TypedConfig",
  1282. reason: "embedded message failed validation",
  1283. cause: err,
  1284. }
  1285. }
  1286. }
  1287. case *TransportSocket_HiddenEnvoyDeprecatedConfig:
  1288. if v, ok := interface{}(m.GetHiddenEnvoyDeprecatedConfig()).(interface{ Validate() error }); ok {
  1289. if err := v.Validate(); err != nil {
  1290. return TransportSocketValidationError{
  1291. field: "HiddenEnvoyDeprecatedConfig",
  1292. reason: "embedded message failed validation",
  1293. cause: err,
  1294. }
  1295. }
  1296. }
  1297. }
  1298. return nil
  1299. }
  1300. // TransportSocketValidationError is the validation error returned by
  1301. // TransportSocket.Validate if the designated constraints aren't met.
  1302. type TransportSocketValidationError struct {
  1303. field string
  1304. reason string
  1305. cause error
  1306. key bool
  1307. }
  1308. // Field function returns field value.
  1309. func (e TransportSocketValidationError) Field() string { return e.field }
  1310. // Reason function returns reason value.
  1311. func (e TransportSocketValidationError) Reason() string { return e.reason }
  1312. // Cause function returns cause value.
  1313. func (e TransportSocketValidationError) Cause() error { return e.cause }
  1314. // Key function returns key value.
  1315. func (e TransportSocketValidationError) Key() bool { return e.key }
  1316. // ErrorName returns error name.
  1317. func (e TransportSocketValidationError) ErrorName() string { return "TransportSocketValidationError" }
  1318. // Error satisfies the builtin error interface
  1319. func (e TransportSocketValidationError) Error() string {
  1320. cause := ""
  1321. if e.cause != nil {
  1322. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1323. }
  1324. key := ""
  1325. if e.key {
  1326. key = "key for "
  1327. }
  1328. return fmt.Sprintf(
  1329. "invalid %sTransportSocket.%s: %s%s",
  1330. key,
  1331. e.field,
  1332. e.reason,
  1333. cause)
  1334. }
  1335. var _ error = TransportSocketValidationError{}
  1336. var _ interface {
  1337. Field() string
  1338. Reason() string
  1339. Key() bool
  1340. Cause() error
  1341. ErrorName() string
  1342. } = TransportSocketValidationError{}
  1343. // Validate checks the field values on RuntimeFractionalPercent with the rules
  1344. // defined in the proto definition for this message. If any rules are
  1345. // violated, an error is returned.
  1346. func (m *RuntimeFractionalPercent) Validate() error {
  1347. if m == nil {
  1348. return nil
  1349. }
  1350. if m.GetDefaultValue() == nil {
  1351. return RuntimeFractionalPercentValidationError{
  1352. field: "DefaultValue",
  1353. reason: "value is required",
  1354. }
  1355. }
  1356. if v, ok := interface{}(m.GetDefaultValue()).(interface{ Validate() error }); ok {
  1357. if err := v.Validate(); err != nil {
  1358. return RuntimeFractionalPercentValidationError{
  1359. field: "DefaultValue",
  1360. reason: "embedded message failed validation",
  1361. cause: err,
  1362. }
  1363. }
  1364. }
  1365. // no validation rules for RuntimeKey
  1366. return nil
  1367. }
  1368. // RuntimeFractionalPercentValidationError is the validation error returned by
  1369. // RuntimeFractionalPercent.Validate if the designated constraints aren't met.
  1370. type RuntimeFractionalPercentValidationError struct {
  1371. field string
  1372. reason string
  1373. cause error
  1374. key bool
  1375. }
  1376. // Field function returns field value.
  1377. func (e RuntimeFractionalPercentValidationError) Field() string { return e.field }
  1378. // Reason function returns reason value.
  1379. func (e RuntimeFractionalPercentValidationError) Reason() string { return e.reason }
  1380. // Cause function returns cause value.
  1381. func (e RuntimeFractionalPercentValidationError) Cause() error { return e.cause }
  1382. // Key function returns key value.
  1383. func (e RuntimeFractionalPercentValidationError) Key() bool { return e.key }
  1384. // ErrorName returns error name.
  1385. func (e RuntimeFractionalPercentValidationError) ErrorName() string {
  1386. return "RuntimeFractionalPercentValidationError"
  1387. }
  1388. // Error satisfies the builtin error interface
  1389. func (e RuntimeFractionalPercentValidationError) Error() string {
  1390. cause := ""
  1391. if e.cause != nil {
  1392. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1393. }
  1394. key := ""
  1395. if e.key {
  1396. key = "key for "
  1397. }
  1398. return fmt.Sprintf(
  1399. "invalid %sRuntimeFractionalPercent.%s: %s%s",
  1400. key,
  1401. e.field,
  1402. e.reason,
  1403. cause)
  1404. }
  1405. var _ error = RuntimeFractionalPercentValidationError{}
  1406. var _ interface {
  1407. Field() string
  1408. Reason() string
  1409. Key() bool
  1410. Cause() error
  1411. ErrorName() string
  1412. } = RuntimeFractionalPercentValidationError{}
  1413. // Validate checks the field values on ControlPlane with the rules defined in
  1414. // the proto definition for this message. If any rules are violated, an error
  1415. // is returned.
  1416. func (m *ControlPlane) Validate() error {
  1417. if m == nil {
  1418. return nil
  1419. }
  1420. // no validation rules for Identifier
  1421. return nil
  1422. }
  1423. // ControlPlaneValidationError is the validation error returned by
  1424. // ControlPlane.Validate if the designated constraints aren't met.
  1425. type ControlPlaneValidationError struct {
  1426. field string
  1427. reason string
  1428. cause error
  1429. key bool
  1430. }
  1431. // Field function returns field value.
  1432. func (e ControlPlaneValidationError) Field() string { return e.field }
  1433. // Reason function returns reason value.
  1434. func (e ControlPlaneValidationError) Reason() string { return e.reason }
  1435. // Cause function returns cause value.
  1436. func (e ControlPlaneValidationError) Cause() error { return e.cause }
  1437. // Key function returns key value.
  1438. func (e ControlPlaneValidationError) Key() bool { return e.key }
  1439. // ErrorName returns error name.
  1440. func (e ControlPlaneValidationError) ErrorName() string { return "ControlPlaneValidationError" }
  1441. // Error satisfies the builtin error interface
  1442. func (e ControlPlaneValidationError) Error() string {
  1443. cause := ""
  1444. if e.cause != nil {
  1445. cause = fmt.Sprintf(" | caused by: %v", e.cause)
  1446. }
  1447. key := ""
  1448. if e.key {
  1449. key = "key for "
  1450. }
  1451. return fmt.Sprintf(
  1452. "invalid %sControlPlane.%s: %s%s",
  1453. key,
  1454. e.field,
  1455. e.reason,
  1456. cause)
  1457. }
  1458. var _ error = ControlPlaneValidationError{}
  1459. var _ interface {
  1460. Field() string
  1461. Reason() string
  1462. Key() bool
  1463. Cause() error
  1464. ErrorName() string
  1465. } = ControlPlaneValidationError{}