Debian Codegraph @

envoy/config/bootstrap/v2/bootstrap.pb.validate.go

raw
1 //go:build !disable_pgv
2 // Code generated by protoc-gen-validate. DO NOT EDIT.
3 // source: envoy/config/bootstrap/v2/bootstrap.proto
4
5 package bootstrapv2
6
7 import (
8 "bytes"
9 "errors"
10 "fmt"
11 "net"
12 "net/mail"
13 "net/url"
14 "regexp"
15 "sort"
16 "strings"
17 "time"
18 "unicode/utf8"
19
20 "google.golang.org/protobuf/types/known/anypb"
21 )
22
23 // ensure the imports are used
24 var (
25 _ = bytes.MinRead
26 _ = errors.New("")
27 _ = fmt.Print
28 _ = utf8.UTFMax
29 _ = (*regexp.Regexp)(nil)
30 _ = (*strings.Reader)(nil)
31 _ = net.IPv4len
32 _ = time.Duration(0)
33 _ = (*url.URL)(nil)
34 _ = (*mail.Address)(nil)
35 _ = anypb.Any{}
36 _ = sort.Sort
37 )
38
39 // Validate checks the field values on Bootstrap with the rules defined in the
40 // proto definition for this message. If any rules are violated, the first
41 // error encountered is returned, or nil if there are no violations.
42 func (m *Bootstrap) Validate() error {
43 return m.validate(false)
44 }
45
46 // ValidateAll checks the field values on Bootstrap with the rules defined in
47 // the proto definition for this message. If any rules are violated, the
48 // result is a list of violation errors wrapped in BootstrapMultiError, or nil
49 // if none found.
50 func (m *Bootstrap) ValidateAll() error {
51 return m.validate(true)
52 }
53
54 func (m *Bootstrap) validate(all bool) error {
55 if m == nil {
56 return nil
57 }
58
59 var errors []error
60
61 if all {
62 switch v := interface{}(m.GetNode()).(type) {
63 case interface{ ValidateAll() error }:
64 if err := v.ValidateAll(); err != nil {
65 errors = append(errors, BootstrapValidationError{
66 field: "Node",
67 reason: "embedded message failed validation",
68 cause: err,
69 })
70 }
71 case interface{ Validate() error }:
72 if err := v.Validate(); err != nil {
73 errors = append(errors, BootstrapValidationError{
74 field: "Node",
75 reason: "embedded message failed validation",
76 cause: err,
77 })
78 }
79 }
80 } else if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok {
81 if err := v.Validate(); err != nil {
82 return BootstrapValidationError{
83 field: "Node",
84 reason: "embedded message failed validation",
85 cause: err,
86 }
87 }
88 }
89
90 if all {
91 switch v := interface{}(m.GetStaticResources()).(type) {
92 case interface{ ValidateAll() error }:
93 if err := v.ValidateAll(); err != nil {
94 errors = append(errors, BootstrapValidationError{
95 field: "StaticResources",
96 reason: "embedded message failed validation",
97 cause: err,
98 })
99 }
100 case interface{ Validate() error }:
101 if err := v.Validate(); err != nil {
102 errors = append(errors, BootstrapValidationError{
103 field: "StaticResources",
104 reason: "embedded message failed validation",
105 cause: err,
106 })
107 }
108 }
109 } else if v, ok := interface{}(m.GetStaticResources()).(interface{ Validate() error }); ok {
110 if err := v.Validate(); err != nil {
111 return BootstrapValidationError{
112 field: "StaticResources",
113 reason: "embedded message failed validation",
114 cause: err,
115 }
116 }
117 }
118
119 if all {
120 switch v := interface{}(m.GetDynamicResources()).(type) {
121 case interface{ ValidateAll() error }:
122 if err := v.ValidateAll(); err != nil {
123 errors = append(errors, BootstrapValidationError{
124 field: "DynamicResources",
125 reason: "embedded message failed validation",
126 cause: err,
127 })
128 }
129 case interface{ Validate() error }:
130 if err := v.Validate(); err != nil {
131 errors = append(errors, BootstrapValidationError{
132 field: "DynamicResources",
133 reason: "embedded message failed validation",
134 cause: err,
135 })
136 }
137 }
138 } else if v, ok := interface{}(m.GetDynamicResources()).(interface{ Validate() error }); ok {
139 if err := v.Validate(); err != nil {
140 return BootstrapValidationError{
141 field: "DynamicResources",
142 reason: "embedded message failed validation",
143 cause: err,
144 }
145 }
146 }
147
148 if all {
149 switch v := interface{}(m.GetClusterManager()).(type) {
150 case interface{ ValidateAll() error }:
151 if err := v.ValidateAll(); err != nil {
152 errors = append(errors, BootstrapValidationError{
153 field: "ClusterManager",
154 reason: "embedded message failed validation",
155 cause: err,
156 })
157 }
158 case interface{ Validate() error }:
159 if err := v.Validate(); err != nil {
160 errors = append(errors, BootstrapValidationError{
161 field: "ClusterManager",
162 reason: "embedded message failed validation",
163 cause: err,
164 })
165 }
166 }
167 } else if v, ok := interface{}(m.GetClusterManager()).(interface{ Validate() error }); ok {
168 if err := v.Validate(); err != nil {
169 return BootstrapValidationError{
170 field: "ClusterManager",
171 reason: "embedded message failed validation",
172 cause: err,
173 }
174 }
175 }
176
177 if all {
178 switch v := interface{}(m.GetHdsConfig()).(type) {
179 case interface{ ValidateAll() error }:
180 if err := v.ValidateAll(); err != nil {
181 errors = append(errors, BootstrapValidationError{
182 field: "HdsConfig",
183 reason: "embedded message failed validation",
184 cause: err,
185 })
186 }
187 case interface{ Validate() error }:
188 if err := v.Validate(); err != nil {
189 errors = append(errors, BootstrapValidationError{
190 field: "HdsConfig",
191 reason: "embedded message failed validation",
192 cause: err,
193 })
194 }
195 }
196 } else if v, ok := interface{}(m.GetHdsConfig()).(interface{ Validate() error }); ok {
197 if err := v.Validate(); err != nil {
198 return BootstrapValidationError{
199 field: "HdsConfig",
200 reason: "embedded message failed validation",
201 cause: err,
202 }
203 }
204 }
205
206 // no validation rules for FlagsPath
207
208 for idx, item := range m.GetStatsSinks() {
209 _, _ = idx, item
210
211 if all {
212 switch v := interface{}(item).(type) {
213 case interface{ ValidateAll() error }:
214 if err := v.ValidateAll(); err != nil {
215 errors = append(errors, BootstrapValidationError{
216 field: fmt.Sprintf("StatsSinks[%v]", idx),
217 reason: "embedded message failed validation",
218 cause: err,
219 })
220 }
221 case interface{ Validate() error }:
222 if err := v.Validate(); err != nil {
223 errors = append(errors, BootstrapValidationError{
224 field: fmt.Sprintf("StatsSinks[%v]", idx),
225 reason: "embedded message failed validation",
226 cause: err,
227 })
228 }
229 }
230 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
231 if err := v.Validate(); err != nil {
232 return BootstrapValidationError{
233 field: fmt.Sprintf("StatsSinks[%v]", idx),
234 reason: "embedded message failed validation",
235 cause: err,
236 }
237 }
238 }
239
240 }
241
242 if all {
243 switch v := interface{}(m.GetStatsConfig()).(type) {
244 case interface{ ValidateAll() error }:
245 if err := v.ValidateAll(); err != nil {
246 errors = append(errors, BootstrapValidationError{
247 field: "StatsConfig",
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, BootstrapValidationError{
255 field: "StatsConfig",
256 reason: "embedded message failed validation",
257 cause: err,
258 })
259 }
260 }
261 } else if v, ok := interface{}(m.GetStatsConfig()).(interface{ Validate() error }); ok {
262 if err := v.Validate(); err != nil {
263 return BootstrapValidationError{
264 field: "StatsConfig",
265 reason: "embedded message failed validation",
266 cause: err,
267 }
268 }
269 }
270
271 if d := m.GetStatsFlushInterval(); d != nil {
272 dur, err := d.AsDuration(), d.CheckValid()
273 if err != nil {
274 err = BootstrapValidationError{
275 field: "StatsFlushInterval",
276 reason: "value is not a valid duration",
277 cause: err,
278 }
279 if !all {
280 return err
281 }
282 errors = append(errors, err)
283 } else {
284
285 lt := time.Duration(300*time.Second + 0*time.Nanosecond)
286 gte := time.Duration(0*time.Second + 1000000*time.Nanosecond)
287
288 if dur < gte || dur >= lt {
289 err := BootstrapValidationError{
290 field: "StatsFlushInterval",
291 reason: "value must be inside range [1ms, 5m0s)",
292 }
293 if !all {
294 return err
295 }
296 errors = append(errors, err)
297 }
298
299 }
300 }
301
302 if all {
303 switch v := interface{}(m.GetWatchdog()).(type) {
304 case interface{ ValidateAll() error }:
305 if err := v.ValidateAll(); err != nil {
306 errors = append(errors, BootstrapValidationError{
307 field: "Watchdog",
308 reason: "embedded message failed validation",
309 cause: err,
310 })
311 }
312 case interface{ Validate() error }:
313 if err := v.Validate(); err != nil {
314 errors = append(errors, BootstrapValidationError{
315 field: "Watchdog",
316 reason: "embedded message failed validation",
317 cause: err,
318 })
319 }
320 }
321 } else if v, ok := interface{}(m.GetWatchdog()).(interface{ Validate() error }); ok {
322 if err := v.Validate(); err != nil {
323 return BootstrapValidationError{
324 field: "Watchdog",
325 reason: "embedded message failed validation",
326 cause: err,
327 }
328 }
329 }
330
331 if all {
332 switch v := interface{}(m.GetTracing()).(type) {
333 case interface{ ValidateAll() error }:
334 if err := v.ValidateAll(); err != nil {
335 errors = append(errors, BootstrapValidationError{
336 field: "Tracing",
337 reason: "embedded message failed validation",
338 cause: err,
339 })
340 }
341 case interface{ Validate() error }:
342 if err := v.Validate(); err != nil {
343 errors = append(errors, BootstrapValidationError{
344 field: "Tracing",
345 reason: "embedded message failed validation",
346 cause: err,
347 })
348 }
349 }
350 } else if v, ok := interface{}(m.GetTracing()).(interface{ Validate() error }); ok {
351 if err := v.Validate(); err != nil {
352 return BootstrapValidationError{
353 field: "Tracing",
354 reason: "embedded message failed validation",
355 cause: err,
356 }
357 }
358 }
359
360 if all {
361 switch v := interface{}(m.GetRuntime()).(type) {
362 case interface{ ValidateAll() error }:
363 if err := v.ValidateAll(); err != nil {
364 errors = append(errors, BootstrapValidationError{
365 field: "Runtime",
366 reason: "embedded message failed validation",
367 cause: err,
368 })
369 }
370 case interface{ Validate() error }:
371 if err := v.Validate(); err != nil {
372 errors = append(errors, BootstrapValidationError{
373 field: "Runtime",
374 reason: "embedded message failed validation",
375 cause: err,
376 })
377 }
378 }
379 } else if v, ok := interface{}(m.GetRuntime()).(interface{ Validate() error }); ok {
380 if err := v.Validate(); err != nil {
381 return BootstrapValidationError{
382 field: "Runtime",
383 reason: "embedded message failed validation",
384 cause: err,
385 }
386 }
387 }
388
389 if all {
390 switch v := interface{}(m.GetLayeredRuntime()).(type) {
391 case interface{ ValidateAll() error }:
392 if err := v.ValidateAll(); err != nil {
393 errors = append(errors, BootstrapValidationError{
394 field: "LayeredRuntime",
395 reason: "embedded message failed validation",
396 cause: err,
397 })
398 }
399 case interface{ Validate() error }:
400 if err := v.Validate(); err != nil {
401 errors = append(errors, BootstrapValidationError{
402 field: "LayeredRuntime",
403 reason: "embedded message failed validation",
404 cause: err,
405 })
406 }
407 }
408 } else if v, ok := interface{}(m.GetLayeredRuntime()).(interface{ Validate() error }); ok {
409 if err := v.Validate(); err != nil {
410 return BootstrapValidationError{
411 field: "LayeredRuntime",
412 reason: "embedded message failed validation",
413 cause: err,
414 }
415 }
416 }
417
418 if all {
419 switch v := interface{}(m.GetAdmin()).(type) {
420 case interface{ ValidateAll() error }:
421 if err := v.ValidateAll(); err != nil {
422 errors = append(errors, BootstrapValidationError{
423 field: "Admin",
424 reason: "embedded message failed validation",
425 cause: err,
426 })
427 }
428 case interface{ Validate() error }:
429 if err := v.Validate(); err != nil {
430 errors = append(errors, BootstrapValidationError{
431 field: "Admin",
432 reason: "embedded message failed validation",
433 cause: err,
434 })
435 }
436 }
437 } else if v, ok := interface{}(m.GetAdmin()).(interface{ Validate() error }); ok {
438 if err := v.Validate(); err != nil {
439 return BootstrapValidationError{
440 field: "Admin",
441 reason: "embedded message failed validation",
442 cause: err,
443 }
444 }
445 }
446
447 if all {
448 switch v := interface{}(m.GetOverloadManager()).(type) {
449 case interface{ ValidateAll() error }:
450 if err := v.ValidateAll(); err != nil {
451 errors = append(errors, BootstrapValidationError{
452 field: "OverloadManager",
453 reason: "embedded message failed validation",
454 cause: err,
455 })
456 }
457 case interface{ Validate() error }:
458 if err := v.Validate(); err != nil {
459 errors = append(errors, BootstrapValidationError{
460 field: "OverloadManager",
461 reason: "embedded message failed validation",
462 cause: err,
463 })
464 }
465 }
466 } else if v, ok := interface{}(m.GetOverloadManager()).(interface{ Validate() error }); ok {
467 if err := v.Validate(); err != nil {
468 return BootstrapValidationError{
469 field: "OverloadManager",
470 reason: "embedded message failed validation",
471 cause: err,
472 }
473 }
474 }
475
476 // no validation rules for EnableDispatcherStats
477
478 // no validation rules for HeaderPrefix
479
480 if all {
481 switch v := interface{}(m.GetStatsServerVersionOverride()).(type) {
482 case interface{ ValidateAll() error }:
483 if err := v.ValidateAll(); err != nil {
484 errors = append(errors, BootstrapValidationError{
485 field: "StatsServerVersionOverride",
486 reason: "embedded message failed validation",
487 cause: err,
488 })
489 }
490 case interface{ Validate() error }:
491 if err := v.Validate(); err != nil {
492 errors = append(errors, BootstrapValidationError{
493 field: "StatsServerVersionOverride",
494 reason: "embedded message failed validation",
495 cause: err,
496 })
497 }
498 }
499 } else if v, ok := interface{}(m.GetStatsServerVersionOverride()).(interface{ Validate() error }); ok {
500 if err := v.Validate(); err != nil {
501 return BootstrapValidationError{
502 field: "StatsServerVersionOverride",
503 reason: "embedded message failed validation",
504 cause: err,
505 }
506 }
507 }
508
509 // no validation rules for UseTcpForDnsLookups
510
511 if len(errors) > 0 {
512 return BootstrapMultiError(errors)
513 }
514
515 return nil
516 }
517
518 // BootstrapMultiError is an error wrapping multiple validation errors returned
519 // by Bootstrap.ValidateAll() if the designated constraints aren't met.
520 type BootstrapMultiError []error
521
522 // Error returns a concatenation of all the error messages it wraps.
523 func (m BootstrapMultiError) Error() string {
524 var msgs []string
525 for _, err := range m {
526 msgs = append(msgs, err.Error())
527 }
528 return strings.Join(msgs, "; ")
529 }
530
531 // AllErrors returns a list of validation violation errors.
532 func (m BootstrapMultiError) AllErrors() []error { return m }
533
534 // BootstrapValidationError is the validation error returned by
535 // Bootstrap.Validate if the designated constraints aren't met.
536 type BootstrapValidationError struct {
537 field string
538 reason string
539 cause error
540 key bool
541 }
542
543 // Field function returns field value.
544 func (e BootstrapValidationError) Field() string { return e.field }
545
546 // Reason function returns reason value.
547 func (e BootstrapValidationError) Reason() string { return e.reason }
548
549 // Cause function returns cause value.
550 func (e BootstrapValidationError) Cause() error { return e.cause }
551
552 // Key function returns key value.
553 func (e BootstrapValidationError) Key() bool { return e.key }
554
555 // ErrorName returns error name.
556 func (e BootstrapValidationError) ErrorName() string { return "BootstrapValidationError" }
557
558 // Error satisfies the builtin error interface
559 func (e BootstrapValidationError) Error() string {
560 cause := ""
561 if e.cause != nil {
562 cause = fmt.Sprintf(" | caused by: %v", e.cause)
563 }
564
565 key := ""
566 if e.key {
567 key = "key for "
568 }
569
570 return fmt.Sprintf(
571 "invalid %sBootstrap.%s: %s%s",
572 key,
573 e.field,
574 e.reason,
575 cause)
576 }
577
578 var _ error = BootstrapValidationError{}
579
580 var _ interface {
581 Field() string
582 Reason() string
583 Key() bool
584 Cause() error
585 ErrorName() string
586 } = BootstrapValidationError{}
587
588 // Validate checks the field values on Admin with the rules defined in the
589 // proto definition for this message. If any rules are violated, the first
590 // error encountered is returned, or nil if there are no violations.
591 func (m *Admin) Validate() error {
592 return m.validate(false)
593 }
594
595 // ValidateAll checks the field values on Admin with the rules defined in the
596 // proto definition for this message. If any rules are violated, the result is
597 // a list of violation errors wrapped in AdminMultiError, or nil if none found.
598 func (m *Admin) ValidateAll() error {
599 return m.validate(true)
600 }
601
602 func (m *Admin) validate(all bool) error {
603 if m == nil {
604 return nil
605 }
606
607 var errors []error
608
609 // no validation rules for AccessLogPath
610
611 // no validation rules for ProfilePath
612
613 if all {
614 switch v := interface{}(m.GetAddress()).(type) {
615 case interface{ ValidateAll() error }:
616 if err := v.ValidateAll(); err != nil {
617 errors = append(errors, AdminValidationError{
618 field: "Address",
619 reason: "embedded message failed validation",
620 cause: err,
621 })
622 }
623 case interface{ Validate() error }:
624 if err := v.Validate(); err != nil {
625 errors = append(errors, AdminValidationError{
626 field: "Address",
627 reason: "embedded message failed validation",
628 cause: err,
629 })
630 }
631 }
632 } else if v, ok := interface{}(m.GetAddress()).(interface{ Validate() error }); ok {
633 if err := v.Validate(); err != nil {
634 return AdminValidationError{
635 field: "Address",
636 reason: "embedded message failed validation",
637 cause: err,
638 }
639 }
640 }
641
642 for idx, item := range m.GetSocketOptions() {
643 _, _ = idx, item
644
645 if all {
646 switch v := interface{}(item).(type) {
647 case interface{ ValidateAll() error }:
648 if err := v.ValidateAll(); err != nil {
649 errors = append(errors, AdminValidationError{
650 field: fmt.Sprintf("SocketOptions[%v]", idx),
651 reason: "embedded message failed validation",
652 cause: err,
653 })
654 }
655 case interface{ Validate() error }:
656 if err := v.Validate(); err != nil {
657 errors = append(errors, AdminValidationError{
658 field: fmt.Sprintf("SocketOptions[%v]", idx),
659 reason: "embedded message failed validation",
660 cause: err,
661 })
662 }
663 }
664 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
665 if err := v.Validate(); err != nil {
666 return AdminValidationError{
667 field: fmt.Sprintf("SocketOptions[%v]", idx),
668 reason: "embedded message failed validation",
669 cause: err,
670 }
671 }
672 }
673
674 }
675
676 if len(errors) > 0 {
677 return AdminMultiError(errors)
678 }
679
680 return nil
681 }
682
683 // AdminMultiError is an error wrapping multiple validation errors returned by
684 // Admin.ValidateAll() if the designated constraints aren't met.
685 type AdminMultiError []error
686
687 // Error returns a concatenation of all the error messages it wraps.
688 func (m AdminMultiError) Error() string {
689 var msgs []string
690 for _, err := range m {
691 msgs = append(msgs, err.Error())
692 }
693 return strings.Join(msgs, "; ")
694 }
695
696 // AllErrors returns a list of validation violation errors.
697 func (m AdminMultiError) AllErrors() []error { return m }
698
699 // AdminValidationError is the validation error returned by Admin.Validate if
700 // the designated constraints aren't met.
701 type AdminValidationError struct {
702 field string
703 reason string
704 cause error
705 key bool
706 }
707
708 // Field function returns field value.
709 func (e AdminValidationError) Field() string { return e.field }
710
711 // Reason function returns reason value.
712 func (e AdminValidationError) Reason() string { return e.reason }
713
714 // Cause function returns cause value.
715 func (e AdminValidationError) Cause() error { return e.cause }
716
717 // Key function returns key value.
718 func (e AdminValidationError) Key() bool { return e.key }
719
720 // ErrorName returns error name.
721 func (e AdminValidationError) ErrorName() string { return "AdminValidationError" }
722
723 // Error satisfies the builtin error interface
724 func (e AdminValidationError) Error() string {
725 cause := ""
726 if e.cause != nil {
727 cause = fmt.Sprintf(" | caused by: %v", e.cause)
728 }
729
730 key := ""
731 if e.key {
732 key = "key for "
733 }
734
735 return fmt.Sprintf(
736 "invalid %sAdmin.%s: %s%s",
737 key,
738 e.field,
739 e.reason,
740 cause)
741 }
742
743 var _ error = AdminValidationError{}
744
745 var _ interface {
746 Field() string
747 Reason() string
748 Key() bool
749 Cause() error
750 ErrorName() string
751 } = AdminValidationError{}
752
753 // Validate checks the field values on ClusterManager with the rules defined in
754 // the proto definition for this message. If any rules are violated, the first
755 // error encountered is returned, or nil if there are no violations.
756 func (m *ClusterManager) Validate() error {
757 return m.validate(false)
758 }
759
760 // ValidateAll checks the field values on ClusterManager with the rules defined
761 // in the proto definition for this message. If any rules are violated, the
762 // result is a list of violation errors wrapped in ClusterManagerMultiError,
763 // or nil if none found.
764 func (m *ClusterManager) ValidateAll() error {
765 return m.validate(true)
766 }
767
768 func (m *ClusterManager) validate(all bool) error {
769 if m == nil {
770 return nil
771 }
772
773 var errors []error
774
775 // no validation rules for LocalClusterName
776
777 if all {
778 switch v := interface{}(m.GetOutlierDetection()).(type) {
779 case interface{ ValidateAll() error }:
780 if err := v.ValidateAll(); err != nil {
781 errors = append(errors, ClusterManagerValidationError{
782 field: "OutlierDetection",
783 reason: "embedded message failed validation",
784 cause: err,
785 })
786 }
787 case interface{ Validate() error }:
788 if err := v.Validate(); err != nil {
789 errors = append(errors, ClusterManagerValidationError{
790 field: "OutlierDetection",
791 reason: "embedded message failed validation",
792 cause: err,
793 })
794 }
795 }
796 } else if v, ok := interface{}(m.GetOutlierDetection()).(interface{ Validate() error }); ok {
797 if err := v.Validate(); err != nil {
798 return ClusterManagerValidationError{
799 field: "OutlierDetection",
800 reason: "embedded message failed validation",
801 cause: err,
802 }
803 }
804 }
805
806 if all {
807 switch v := interface{}(m.GetUpstreamBindConfig()).(type) {
808 case interface{ ValidateAll() error }:
809 if err := v.ValidateAll(); err != nil {
810 errors = append(errors, ClusterManagerValidationError{
811 field: "UpstreamBindConfig",
812 reason: "embedded message failed validation",
813 cause: err,
814 })
815 }
816 case interface{ Validate() error }:
817 if err := v.Validate(); err != nil {
818 errors = append(errors, ClusterManagerValidationError{
819 field: "UpstreamBindConfig",
820 reason: "embedded message failed validation",
821 cause: err,
822 })
823 }
824 }
825 } else if v, ok := interface{}(m.GetUpstreamBindConfig()).(interface{ Validate() error }); ok {
826 if err := v.Validate(); err != nil {
827 return ClusterManagerValidationError{
828 field: "UpstreamBindConfig",
829 reason: "embedded message failed validation",
830 cause: err,
831 }
832 }
833 }
834
835 if all {
836 switch v := interface{}(m.GetLoadStatsConfig()).(type) {
837 case interface{ ValidateAll() error }:
838 if err := v.ValidateAll(); err != nil {
839 errors = append(errors, ClusterManagerValidationError{
840 field: "LoadStatsConfig",
841 reason: "embedded message failed validation",
842 cause: err,
843 })
844 }
845 case interface{ Validate() error }:
846 if err := v.Validate(); err != nil {
847 errors = append(errors, ClusterManagerValidationError{
848 field: "LoadStatsConfig",
849 reason: "embedded message failed validation",
850 cause: err,
851 })
852 }
853 }
854 } else if v, ok := interface{}(m.GetLoadStatsConfig()).(interface{ Validate() error }); ok {
855 if err := v.Validate(); err != nil {
856 return ClusterManagerValidationError{
857 field: "LoadStatsConfig",
858 reason: "embedded message failed validation",
859 cause: err,
860 }
861 }
862 }
863
864 if len(errors) > 0 {
865 return ClusterManagerMultiError(errors)
866 }
867
868 return nil
869 }
870
871 // ClusterManagerMultiError is an error wrapping multiple validation errors
872 // returned by ClusterManager.ValidateAll() if the designated constraints
873 // aren't met.
874 type ClusterManagerMultiError []error
875
876 // Error returns a concatenation of all the error messages it wraps.
877 func (m ClusterManagerMultiError) Error() string {
878 var msgs []string
879 for _, err := range m {
880 msgs = append(msgs, err.Error())
881 }
882 return strings.Join(msgs, "; ")
883 }
884
885 // AllErrors returns a list of validation violation errors.
886 func (m ClusterManagerMultiError) AllErrors() []error { return m }
887
888 // ClusterManagerValidationError is the validation error returned by
889 // ClusterManager.Validate if the designated constraints aren't met.
890 type ClusterManagerValidationError struct {
891 field string
892 reason string
893 cause error
894 key bool
895 }
896
897 // Field function returns field value.
898 func (e ClusterManagerValidationError) Field() string { return e.field }
899
900 // Reason function returns reason value.
901 func (e ClusterManagerValidationError) Reason() string { return e.reason }
902
903 // Cause function returns cause value.
904 func (e ClusterManagerValidationError) Cause() error { return e.cause }
905
906 // Key function returns key value.
907 func (e ClusterManagerValidationError) Key() bool { return e.key }
908
909 // ErrorName returns error name.
910 func (e ClusterManagerValidationError) ErrorName() string { return "ClusterManagerValidationError" }
911
912 // Error satisfies the builtin error interface
913 func (e ClusterManagerValidationError) Error() string {
914 cause := ""
915 if e.cause != nil {
916 cause = fmt.Sprintf(" | caused by: %v", e.cause)
917 }
918
919 key := ""
920 if e.key {
921 key = "key for "
922 }
923
924 return fmt.Sprintf(
925 "invalid %sClusterManager.%s: %s%s",
926 key,
927 e.field,
928 e.reason,
929 cause)
930 }
931
932 var _ error = ClusterManagerValidationError{}
933
934 var _ interface {
935 Field() string
936 Reason() string
937 Key() bool
938 Cause() error
939 ErrorName() string
940 } = ClusterManagerValidationError{}
941
942 // Validate checks the field values on Watchdog with the rules defined in the
943 // proto definition for this message. If any rules are violated, the first
944 // error encountered is returned, or nil if there are no violations.
945 func (m *Watchdog) Validate() error {
946 return m.validate(false)
947 }
948
949 // ValidateAll checks the field values on Watchdog with the rules defined in
950 // the proto definition for this message. If any rules are violated, the
951 // result is a list of violation errors wrapped in WatchdogMultiError, or nil
952 // if none found.
953 func (m *Watchdog) ValidateAll() error {
954 return m.validate(true)
955 }
956
957 func (m *Watchdog) validate(all bool) error {
958 if m == nil {
959 return nil
960 }
961
962 var errors []error
963
964 if all {
965 switch v := interface{}(m.GetMissTimeout()).(type) {
966 case interface{ ValidateAll() error }:
967 if err := v.ValidateAll(); err != nil {
968 errors = append(errors, WatchdogValidationError{
969 field: "MissTimeout",
970 reason: "embedded message failed validation",
971 cause: err,
972 })
973 }
974 case interface{ Validate() error }:
975 if err := v.Validate(); err != nil {
976 errors = append(errors, WatchdogValidationError{
977 field: "MissTimeout",
978 reason: "embedded message failed validation",
979 cause: err,
980 })
981 }
982 }
983 } else if v, ok := interface{}(m.GetMissTimeout()).(interface{ Validate() error }); ok {
984 if err := v.Validate(); err != nil {
985 return WatchdogValidationError{
986 field: "MissTimeout",
987 reason: "embedded message failed validation",
988 cause: err,
989 }
990 }
991 }
992
993 if all {
994 switch v := interface{}(m.GetMegamissTimeout()).(type) {
995 case interface{ ValidateAll() error }:
996 if err := v.ValidateAll(); err != nil {
997 errors = append(errors, WatchdogValidationError{
998 field: "MegamissTimeout",
999 reason: "embedded message failed validation",
1000 cause: err,
1001 })
1002 }
1003 case interface{ Validate() error }:
1004 if err := v.Validate(); err != nil {
1005 errors = append(errors, WatchdogValidationError{
1006 field: "MegamissTimeout",
1007 reason: "embedded message failed validation",
1008 cause: err,
1009 })
1010 }
1011 }
1012 } else if v, ok := interface{}(m.GetMegamissTimeout()).(interface{ Validate() error }); ok {
1013 if err := v.Validate(); err != nil {
1014 return WatchdogValidationError{
1015 field: "MegamissTimeout",
1016 reason: "embedded message failed validation",
1017 cause: err,
1018 }
1019 }
1020 }
1021
1022 if all {
1023 switch v := interface{}(m.GetKillTimeout()).(type) {
1024 case interface{ ValidateAll() error }:
1025 if err := v.ValidateAll(); err != nil {
1026 errors = append(errors, WatchdogValidationError{
1027 field: "KillTimeout",
1028 reason: "embedded message failed validation",
1029 cause: err,
1030 })
1031 }
1032 case interface{ Validate() error }:
1033 if err := v.Validate(); err != nil {
1034 errors = append(errors, WatchdogValidationError{
1035 field: "KillTimeout",
1036 reason: "embedded message failed validation",
1037 cause: err,
1038 })
1039 }
1040 }
1041 } else if v, ok := interface{}(m.GetKillTimeout()).(interface{ Validate() error }); ok {
1042 if err := v.Validate(); err != nil {
1043 return WatchdogValidationError{
1044 field: "KillTimeout",
1045 reason: "embedded message failed validation",
1046 cause: err,
1047 }
1048 }
1049 }
1050
1051 if all {
1052 switch v := interface{}(m.GetMultikillTimeout()).(type) {
1053 case interface{ ValidateAll() error }:
1054 if err := v.ValidateAll(); err != nil {
1055 errors = append(errors, WatchdogValidationError{
1056 field: "MultikillTimeout",
1057 reason: "embedded message failed validation",
1058 cause: err,
1059 })
1060 }
1061 case interface{ Validate() error }:
1062 if err := v.Validate(); err != nil {
1063 errors = append(errors, WatchdogValidationError{
1064 field: "MultikillTimeout",
1065 reason: "embedded message failed validation",
1066 cause: err,
1067 })
1068 }
1069 }
1070 } else if v, ok := interface{}(m.GetMultikillTimeout()).(interface{ Validate() error }); ok {
1071 if err := v.Validate(); err != nil {
1072 return WatchdogValidationError{
1073 field: "MultikillTimeout",
1074 reason: "embedded message failed validation",
1075 cause: err,
1076 }
1077 }
1078 }
1079
1080 if len(errors) > 0 {
1081 return WatchdogMultiError(errors)
1082 }
1083
1084 return nil
1085 }
1086
1087 // WatchdogMultiError is an error wrapping multiple validation errors returned
1088 // by Watchdog.ValidateAll() if the designated constraints aren't met.
1089 type WatchdogMultiError []error
1090
1091 // Error returns a concatenation of all the error messages it wraps.
1092 func (m WatchdogMultiError) Error() string {
1093 var msgs []string
1094 for _, err := range m {
1095 msgs = append(msgs, err.Error())
1096 }
1097 return strings.Join(msgs, "; ")
1098 }
1099
1100 // AllErrors returns a list of validation violation errors.
1101 func (m WatchdogMultiError) AllErrors() []error { return m }
1102
1103 // WatchdogValidationError is the validation error returned by
1104 // Watchdog.Validate if the designated constraints aren't met.
1105 type WatchdogValidationError struct {
1106 field string
1107 reason string
1108 cause error
1109 key bool
1110 }
1111
1112 // Field function returns field value.
1113 func (e WatchdogValidationError) Field() string { return e.field }
1114
1115 // Reason function returns reason value.
1116 func (e WatchdogValidationError) Reason() string { return e.reason }
1117
1118 // Cause function returns cause value.
1119 func (e WatchdogValidationError) Cause() error { return e.cause }
1120
1121 // Key function returns key value.
1122 func (e WatchdogValidationError) Key() bool { return e.key }
1123
1124 // ErrorName returns error name.
1125 func (e WatchdogValidationError) ErrorName() string { return "WatchdogValidationError" }
1126
1127 // Error satisfies the builtin error interface
1128 func (e WatchdogValidationError) Error() string {
1129 cause := ""
1130 if e.cause != nil {
1131 cause = fmt.Sprintf(" | caused by: %v", e.cause)
1132 }
1133
1134 key := ""
1135 if e.key {
1136 key = "key for "
1137 }
1138
1139 return fmt.Sprintf(
1140 "invalid %sWatchdog.%s: %s%s",
1141 key,
1142 e.field,
1143 e.reason,
1144 cause)
1145 }
1146
1147 var _ error = WatchdogValidationError{}
1148
1149 var _ interface {
1150 Field() string
1151 Reason() string
1152 Key() bool
1153 Cause() error
1154 ErrorName() string
1155 } = WatchdogValidationError{}
1156
1157 // Validate checks the field values on Runtime with the rules defined in the
1158 // proto definition for this message. If any rules are violated, the first
1159 // error encountered is returned, or nil if there are no violations.
1160 func (m *Runtime) Validate() error {
1161 return m.validate(false)
1162 }
1163
1164 // ValidateAll checks the field values on Runtime with the rules defined in the
1165 // proto definition for this message. If any rules are violated, the result is
1166 // a list of violation errors wrapped in RuntimeMultiError, or nil if none found.
1167 func (m *Runtime) ValidateAll() error {
1168 return m.validate(true)
1169 }
1170
1171 func (m *Runtime) validate(all bool) error {
1172 if m == nil {
1173 return nil
1174 }
1175
1176 var errors []error
1177
1178 // no validation rules for SymlinkRoot
1179
1180 // no validation rules for Subdirectory
1181
1182 // no validation rules for OverrideSubdirectory
1183
1184 if all {
1185 switch v := interface{}(m.GetBase()).(type) {
1186 case interface{ ValidateAll() error }:
1187 if err := v.ValidateAll(); err != nil {
1188 errors = append(errors, RuntimeValidationError{
1189 field: "Base",
1190 reason: "embedded message failed validation",
1191 cause: err,
1192 })
1193 }
1194 case interface{ Validate() error }:
1195 if err := v.Validate(); err != nil {
1196 errors = append(errors, RuntimeValidationError{
1197 field: "Base",
1198 reason: "embedded message failed validation",
1199 cause: err,
1200 })
1201 }
1202 }
1203 } else if v, ok := interface{}(m.GetBase()).(interface{ Validate() error }); ok {
1204 if err := v.Validate(); err != nil {
1205 return RuntimeValidationError{
1206 field: "Base",
1207 reason: "embedded message failed validation",
1208 cause: err,
1209 }
1210 }
1211 }
1212
1213 if len(errors) > 0 {
1214 return RuntimeMultiError(errors)
1215 }
1216
1217 return nil
1218 }
1219
1220 // RuntimeMultiError is an error wrapping multiple validation errors returned
1221 // by Runtime.ValidateAll() if the designated constraints aren't met.
1222 type RuntimeMultiError []error
1223
1224 // Error returns a concatenation of all the error messages it wraps.
1225 func (m RuntimeMultiError) Error() string {
1226 var msgs []string
1227 for _, err := range m {
1228 msgs = append(msgs, err.Error())
1229 }
1230 return strings.Join(msgs, "; ")
1231 }
1232
1233 // AllErrors returns a list of validation violation errors.
1234 func (m RuntimeMultiError) AllErrors() []error { return m }
1235
1236 // RuntimeValidationError is the validation error returned by Runtime.Validate
1237 // if the designated constraints aren't met.
1238 type RuntimeValidationError struct {
1239 field string
1240 reason string
1241 cause error
1242 key bool
1243 }
1244
1245 // Field function returns field value.
1246 func (e RuntimeValidationError) Field() string { return e.field }
1247
1248 // Reason function returns reason value.
1249 func (e RuntimeValidationError) Reason() string { return e.reason }
1250
1251 // Cause function returns cause value.
1252 func (e RuntimeValidationError) Cause() error { return e.cause }
1253
1254 // Key function returns key value.
1255 func (e RuntimeValidationError) Key() bool { return e.key }
1256
1257 // ErrorName returns error name.
1258 func (e RuntimeValidationError) ErrorName() string { return "RuntimeValidationError" }
1259
1260 // Error satisfies the builtin error interface
1261 func (e RuntimeValidationError) Error() string {
1262 cause := ""
1263 if e.cause != nil {
1264 cause = fmt.Sprintf(" | caused by: %v", e.cause)
1265 }
1266
1267 key := ""
1268 if e.key {
1269 key = "key for "
1270 }
1271
1272 return fmt.Sprintf(
1273 "invalid %sRuntime.%s: %s%s",
1274 key,
1275 e.field,
1276 e.reason,
1277 cause)
1278 }
1279
1280 var _ error = RuntimeValidationError{}
1281
1282 var _ interface {
1283 Field() string
1284 Reason() string
1285 Key() bool
1286 Cause() error
1287 ErrorName() string
1288 } = RuntimeValidationError{}
1289
1290 // Validate checks the field values on RuntimeLayer with the rules defined in
1291 // the proto definition for this message. If any rules are violated, the first
1292 // error encountered is returned, or nil if there are no violations.
1293 func (m *RuntimeLayer) Validate() error {
1294 return m.validate(false)
1295 }
1296
1297 // ValidateAll checks the field values on RuntimeLayer with the rules defined
1298 // in the proto definition for this message. If any rules are violated, the
1299 // result is a list of violation errors wrapped in RuntimeLayerMultiError, or
1300 // nil if none found.
1301 func (m *RuntimeLayer) ValidateAll() error {
1302 return m.validate(true)
1303 }
1304
1305 func (m *RuntimeLayer) validate(all bool) error {
1306 if m == nil {
1307 return nil
1308 }
1309
1310 var errors []error
1311
1312 if len(m.GetName()) < 1 {
1313 err := RuntimeLayerValidationError{
1314 field: "Name",
1315 reason: "value length must be at least 1 bytes",
1316 }
1317 if !all {
1318 return err
1319 }
1320 errors = append(errors, err)
1321 }
1322
1323 oneofLayerSpecifierPresent := false
1324 switch v := m.LayerSpecifier.(type) {
1325 case *RuntimeLayer_StaticLayer:
1326 if v == nil {
1327 err := RuntimeLayerValidationError{
1328 field: "LayerSpecifier",
1329 reason: "oneof value cannot be a typed-nil",
1330 }
1331 if !all {
1332 return err
1333 }
1334 errors = append(errors, err)
1335 }
1336 oneofLayerSpecifierPresent = true
1337
1338 if all {
1339 switch v := interface{}(m.GetStaticLayer()).(type) {
1340 case interface{ ValidateAll() error }:
1341 if err := v.ValidateAll(); err != nil {
1342 errors = append(errors, RuntimeLayerValidationError{
1343 field: "StaticLayer",
1344 reason: "embedded message failed validation",
1345 cause: err,
1346 })
1347 }
1348 case interface{ Validate() error }:
1349 if err := v.Validate(); err != nil {
1350 errors = append(errors, RuntimeLayerValidationError{
1351 field: "StaticLayer",
1352 reason: "embedded message failed validation",
1353 cause: err,
1354 })
1355 }
1356 }
1357 } else if v, ok := interface{}(m.GetStaticLayer()).(interface{ Validate() error }); ok {
1358 if err := v.Validate(); err != nil {
1359 return RuntimeLayerValidationError{
1360 field: "StaticLayer",
1361 reason: "embedded message failed validation",
1362 cause: err,
1363 }
1364 }
1365 }
1366
1367 case *RuntimeLayer_DiskLayer_:
1368 if v == nil {
1369 err := RuntimeLayerValidationError{
1370 field: "LayerSpecifier",
1371 reason: "oneof value cannot be a typed-nil",
1372 }
1373 if !all {
1374 return err
1375 }
1376 errors = append(errors, err)
1377 }
1378 oneofLayerSpecifierPresent = true
1379
1380 if all {
1381 switch v := interface{}(m.GetDiskLayer()).(type) {
1382 case interface{ ValidateAll() error }:
1383 if err := v.ValidateAll(); err != nil {
1384 errors = append(errors, RuntimeLayerValidationError{
1385 field: "DiskLayer",
1386 reason: "embedded message failed validation",
1387 cause: err,
1388 })
1389 }
1390 case interface{ Validate() error }:
1391 if err := v.Validate(); err != nil {
1392 errors = append(errors, RuntimeLayerValidationError{
1393 field: "DiskLayer",
1394 reason: "embedded message failed validation",
1395 cause: err,
1396 })
1397 }
1398 }
1399 } else if v, ok := interface{}(m.GetDiskLayer()).(interface{ Validate() error }); ok {
1400 if err := v.Validate(); err != nil {
1401 return RuntimeLayerValidationError{
1402 field: "DiskLayer",
1403 reason: "embedded message failed validation",
1404 cause: err,
1405 }
1406 }
1407 }
1408
1409 case *RuntimeLayer_AdminLayer_:
1410 if v == nil {
1411 err := RuntimeLayerValidationError{
1412 field: "LayerSpecifier",
1413 reason: "oneof value cannot be a typed-nil",
1414 }
1415 if !all {
1416 return err
1417 }
1418 errors = append(errors, err)
1419 }
1420 oneofLayerSpecifierPresent = true
1421
1422 if all {
1423 switch v := interface{}(m.GetAdminLayer()).(type) {
1424 case interface{ ValidateAll() error }:
1425 if err := v.ValidateAll(); err != nil {
1426 errors = append(errors, RuntimeLayerValidationError{
1427 field: "AdminLayer",
1428 reason: "embedded message failed validation",
1429 cause: err,
1430 })
1431 }
1432 case interface{ Validate() error }:
1433 if err := v.Validate(); err != nil {
1434 errors = append(errors, RuntimeLayerValidationError{
1435 field: "AdminLayer",
1436 reason: "embedded message failed validation",
1437 cause: err,
1438 })
1439 }
1440 }
1441 } else if v, ok := interface{}(m.GetAdminLayer()).(interface{ Validate() error }); ok {
1442 if err := v.Validate(); err != nil {
1443 return RuntimeLayerValidationError{
1444 field: "AdminLayer",
1445 reason: "embedded message failed validation",
1446 cause: err,
1447 }
1448 }
1449 }
1450
1451 case *RuntimeLayer_RtdsLayer_:
1452 if v == nil {
1453 err := RuntimeLayerValidationError{
1454 field: "LayerSpecifier",
1455 reason: "oneof value cannot be a typed-nil",
1456 }
1457 if !all {
1458 return err
1459 }
1460 errors = append(errors, err)
1461 }
1462 oneofLayerSpecifierPresent = true
1463
1464 if all {
1465 switch v := interface{}(m.GetRtdsLayer()).(type) {
1466 case interface{ ValidateAll() error }:
1467 if err := v.ValidateAll(); err != nil {
1468 errors = append(errors, RuntimeLayerValidationError{
1469 field: "RtdsLayer",
1470 reason: "embedded message failed validation",
1471 cause: err,
1472 })
1473 }
1474 case interface{ Validate() error }:
1475 if err := v.Validate(); err != nil {
1476 errors = append(errors, RuntimeLayerValidationError{
1477 field: "RtdsLayer",
1478 reason: "embedded message failed validation",
1479 cause: err,
1480 })
1481 }
1482 }
1483 } else if v, ok := interface{}(m.GetRtdsLayer()).(interface{ Validate() error }); ok {
1484 if err := v.Validate(); err != nil {
1485 return RuntimeLayerValidationError{
1486 field: "RtdsLayer",
1487 reason: "embedded message failed validation",
1488 cause: err,
1489 }
1490 }
1491 }
1492
1493 default:
1494 _ = v // ensures v is used
1495 }
1496 if !oneofLayerSpecifierPresent {
1497 err := RuntimeLayerValidationError{
1498 field: "LayerSpecifier",
1499 reason: "value is required",
1500 }
1501 if !all {
1502 return err
1503 }
1504 errors = append(errors, err)
1505 }
1506
1507 if len(errors) > 0 {
1508 return RuntimeLayerMultiError(errors)
1509 }
1510
1511 return nil
1512 }
1513
1514 // RuntimeLayerMultiError is an error wrapping multiple validation errors
1515 // returned by RuntimeLayer.ValidateAll() if the designated constraints aren't met.
1516 type RuntimeLayerMultiError []error
1517
1518 // Error returns a concatenation of all the error messages it wraps.
1519 func (m RuntimeLayerMultiError) Error() string {
1520 var msgs []string
1521 for _, err := range m {
1522 msgs = append(msgs, err.Error())
1523 }
1524 return strings.Join(msgs, "; ")
1525 }
1526
1527 // AllErrors returns a list of validation violation errors.
1528 func (m RuntimeLayerMultiError) AllErrors() []error { return m }
1529
1530 // RuntimeLayerValidationError is the validation error returned by
1531 // RuntimeLayer.Validate if the designated constraints aren't met.
1532 type RuntimeLayerValidationError struct {
1533 field string
1534 reason string
1535 cause error
1536 key bool
1537 }
1538
1539 // Field function returns field value.
1540 func (e RuntimeLayerValidationError) Field() string { return e.field }
1541
1542 // Reason function returns reason value.
1543 func (e RuntimeLayerValidationError) Reason() string { return e.reason }
1544
1545 // Cause function returns cause value.
1546 func (e RuntimeLayerValidationError) Cause() error { return e.cause }
1547
1548 // Key function returns key value.
1549 func (e RuntimeLayerValidationError) Key() bool { return e.key }
1550
1551 // ErrorName returns error name.
1552 func (e RuntimeLayerValidationError) ErrorName() string { return "RuntimeLayerValidationError" }
1553
1554 // Error satisfies the builtin error interface
1555 func (e RuntimeLayerValidationError) Error() string {
1556 cause := ""
1557 if e.cause != nil {
1558 cause = fmt.Sprintf(" | caused by: %v", e.cause)
1559 }
1560
1561 key := ""
1562 if e.key {
1563 key = "key for "
1564 }
1565
1566 return fmt.Sprintf(
1567 "invalid %sRuntimeLayer.%s: %s%s",
1568 key,
1569 e.field,
1570 e.reason,
1571 cause)
1572 }
1573
1574 var _ error = RuntimeLayerValidationError{}
1575
1576 var _ interface {
1577 Field() string
1578 Reason() string
1579 Key() bool
1580 Cause() error
1581 ErrorName() string
1582 } = RuntimeLayerValidationError{}
1583
1584 // Validate checks the field values on LayeredRuntime with the rules defined in
1585 // the proto definition for this message. If any rules are violated, the first
1586 // error encountered is returned, or nil if there are no violations.
1587 func (m *LayeredRuntime) Validate() error {
1588 return m.validate(false)
1589 }
1590
1591 // ValidateAll checks the field values on LayeredRuntime with the rules defined
1592 // in the proto definition for this message. If any rules are violated, the
1593 // result is a list of violation errors wrapped in LayeredRuntimeMultiError,
1594 // or nil if none found.
1595 func (m *LayeredRuntime) ValidateAll() error {
1596 return m.validate(true)
1597 }
1598
1599 func (m *LayeredRuntime) validate(all bool) error {
1600 if m == nil {
1601 return nil
1602 }
1603
1604 var errors []error
1605
1606 for idx, item := range m.GetLayers() {
1607 _, _ = idx, item
1608
1609 if all {
1610 switch v := interface{}(item).(type) {
1611 case interface{ ValidateAll() error }:
1612 if err := v.ValidateAll(); err != nil {
1613 errors = append(errors, LayeredRuntimeValidationError{
1614 field: fmt.Sprintf("Layers[%v]", idx),
1615 reason: "embedded message failed validation",
1616 cause: err,
1617 })
1618 }
1619 case interface{ Validate() error }:
1620 if err := v.Validate(); err != nil {
1621 errors = append(errors, LayeredRuntimeValidationError{
1622 field: fmt.Sprintf("Layers[%v]", idx),
1623 reason: "embedded message failed validation",
1624 cause: err,
1625 })
1626 }
1627 }
1628 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
1629 if err := v.Validate(); err != nil {
1630 return LayeredRuntimeValidationError{
1631 field: fmt.Sprintf("Layers[%v]", idx),
1632 reason: "embedded message failed validation",
1633 cause: err,
1634 }
1635 }
1636 }
1637
1638 }
1639
1640 if len(errors) > 0 {
1641 return LayeredRuntimeMultiError(errors)
1642 }
1643
1644 return nil
1645 }
1646
1647 // LayeredRuntimeMultiError is an error wrapping multiple validation errors
1648 // returned by LayeredRuntime.ValidateAll() if the designated constraints
1649 // aren't met.
1650 type LayeredRuntimeMultiError []error
1651
1652 // Error returns a concatenation of all the error messages it wraps.
1653 func (m LayeredRuntimeMultiError) Error() string {
1654 var msgs []string
1655 for _, err := range m {
1656 msgs = append(msgs, err.Error())
1657 }
1658 return strings.Join(msgs, "; ")
1659 }
1660
1661 // AllErrors returns a list of validation violation errors.
1662 func (m LayeredRuntimeMultiError) AllErrors() []error { return m }
1663
1664 // LayeredRuntimeValidationError is the validation error returned by
1665 // LayeredRuntime.Validate if the designated constraints aren't met.
1666 type LayeredRuntimeValidationError struct {
1667 field string
1668 reason string
1669 cause error
1670 key bool
1671 }
1672
1673 // Field function returns field value.
1674 func (e LayeredRuntimeValidationError) Field() string { return e.field }
1675
1676 // Reason function returns reason value.
1677 func (e LayeredRuntimeValidationError) Reason() string { return e.reason }
1678
1679 // Cause function returns cause value.
1680 func (e LayeredRuntimeValidationError) Cause() error { return e.cause }
1681
1682 // Key function returns key value.
1683 func (e LayeredRuntimeValidationError) Key() bool { return e.key }
1684
1685 // ErrorName returns error name.
1686 func (e LayeredRuntimeValidationError) ErrorName() string { return "LayeredRuntimeValidationError" }
1687
1688 // Error satisfies the builtin error interface
1689 func (e LayeredRuntimeValidationError) Error() string {
1690 cause := ""
1691 if e.cause != nil {
1692 cause = fmt.Sprintf(" | caused by: %v", e.cause)
1693 }
1694
1695 key := ""
1696 if e.key {
1697 key = "key for "
1698 }
1699
1700 return fmt.Sprintf(
1701 "invalid %sLayeredRuntime.%s: %s%s",
1702 key,
1703 e.field,
1704 e.reason,
1705 cause)
1706 }
1707
1708 var _ error = LayeredRuntimeValidationError{}
1709
1710 var _ interface {
1711 Field() string
1712 Reason() string
1713 Key() bool
1714 Cause() error
1715 ErrorName() string
1716 } = LayeredRuntimeValidationError{}
1717
1718 // Validate checks the field values on Bootstrap_StaticResources with the rules
1719 // defined in the proto definition for this message. If any rules are
1720 // violated, the first error encountered is returned, or nil if there are no violations.
1721 func (m *Bootstrap_StaticResources) Validate() error {
1722 return m.validate(false)
1723 }
1724
1725 // ValidateAll checks the field values on Bootstrap_StaticResources with the
1726 // rules defined in the proto definition for this message. If any rules are
1727 // violated, the result is a list of violation errors wrapped in
1728 // Bootstrap_StaticResourcesMultiError, or nil if none found.
1729 func (m *Bootstrap_StaticResources) ValidateAll() error {
1730 return m.validate(true)
1731 }
1732
1733 func (m *Bootstrap_StaticResources) validate(all bool) error {
1734 if m == nil {
1735 return nil
1736 }
1737
1738 var errors []error
1739
1740 for idx, item := range m.GetListeners() {
1741 _, _ = idx, item
1742
1743 if all {
1744 switch v := interface{}(item).(type) {
1745 case interface{ ValidateAll() error }:
1746 if err := v.ValidateAll(); err != nil {
1747 errors = append(errors, Bootstrap_StaticResourcesValidationError{
1748 field: fmt.Sprintf("Listeners[%v]", idx),
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, Bootstrap_StaticResourcesValidationError{
1756 field: fmt.Sprintf("Listeners[%v]", idx),
1757 reason: "embedded message failed validation",
1758 cause: err,
1759 })
1760 }
1761 }
1762 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
1763 if err := v.Validate(); err != nil {
1764 return Bootstrap_StaticResourcesValidationError{
1765 field: fmt.Sprintf("Listeners[%v]", idx),
1766 reason: "embedded message failed validation",
1767 cause: err,
1768 }
1769 }
1770 }
1771
1772 }
1773
1774 for idx, item := range m.GetClusters() {
1775 _, _ = idx, item
1776
1777 if all {
1778 switch v := interface{}(item).(type) {
1779 case interface{ ValidateAll() error }:
1780 if err := v.ValidateAll(); err != nil {
1781 errors = append(errors, Bootstrap_StaticResourcesValidationError{
1782 field: fmt.Sprintf("Clusters[%v]", idx),
1783 reason: "embedded message failed validation",
1784 cause: err,
1785 })
1786 }
1787 case interface{ Validate() error }:
1788 if err := v.Validate(); err != nil {
1789 errors = append(errors, Bootstrap_StaticResourcesValidationError{
1790 field: fmt.Sprintf("Clusters[%v]", idx),
1791 reason: "embedded message failed validation",
1792 cause: err,
1793 })
1794 }
1795 }
1796 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
1797 if err := v.Validate(); err != nil {
1798 return Bootstrap_StaticResourcesValidationError{
1799 field: fmt.Sprintf("Clusters[%v]", idx),
1800 reason: "embedded message failed validation",
1801 cause: err,
1802 }
1803 }
1804 }
1805
1806 }
1807
1808 for idx, item := range m.GetSecrets() {
1809 _, _ = idx, item
1810
1811 if all {
1812 switch v := interface{}(item).(type) {
1813 case interface{ ValidateAll() error }:
1814 if err := v.ValidateAll(); err != nil {
1815 errors = append(errors, Bootstrap_StaticResourcesValidationError{
1816 field: fmt.Sprintf("Secrets[%v]", idx),
1817 reason: "embedded message failed validation",
1818 cause: err,
1819 })
1820 }
1821 case interface{ Validate() error }:
1822 if err := v.Validate(); err != nil {
1823 errors = append(errors, Bootstrap_StaticResourcesValidationError{
1824 field: fmt.Sprintf("Secrets[%v]", idx),
1825 reason: "embedded message failed validation",
1826 cause: err,
1827 })
1828 }
1829 }
1830 } else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
1831 if err := v.Validate(); err != nil {
1832 return Bootstrap_StaticResourcesValidationError{
1833 field: fmt.Sprintf("Secrets[%v]", idx),
1834 reason: "embedded message failed validation",
1835 cause: err,
1836 }
1837 }
1838 }
1839
1840 }
1841
1842 if len(errors) > 0 {
1843 return Bootstrap_StaticResourcesMultiError(errors)
1844 }
1845
1846 return nil
1847 }
1848
1849 // Bootstrap_StaticResourcesMultiError is an error wrapping multiple validation
1850 // errors returned by Bootstrap_StaticResources.ValidateAll() if the
1851 // designated constraints aren't met.
1852 type Bootstrap_StaticResourcesMultiError []error
1853
1854 // Error returns a concatenation of all the error messages it wraps.
1855 func (m Bootstrap_StaticResourcesMultiError) Error() string {
1856 var msgs []string
1857 for _, err := range m {
1858 msgs = append(msgs, err.Error())
1859 }
1860 return strings.Join(msgs, "; ")
1861 }
1862
1863 // AllErrors returns a list of validation violation errors.
1864 func (m Bootstrap_StaticResourcesMultiError) AllErrors() []error { return m }
1865
1866 // Bootstrap_StaticResourcesValidationError is the validation error returned by
1867 // Bootstrap_StaticResources.Validate if the designated constraints aren't met.
1868 type Bootstrap_StaticResourcesValidationError struct {
1869 field string
1870 reason string
1871 cause error
1872 key bool
1873 }
1874
1875 // Field function returns field value.
1876 func (e Bootstrap_StaticResourcesValidationError) Field() string { return e.field }
1877
1878 // Reason function returns reason value.
1879 func (e Bootstrap_StaticResourcesValidationError) Reason() string { return e.reason }
1880
1881 // Cause function returns cause value.
1882 func (e Bootstrap_StaticResourcesValidationError) Cause() error { return e.cause }
1883
1884 // Key function returns key value.
1885 func (e Bootstrap_StaticResourcesValidationError) Key() bool { return e.key }
1886
1887 // ErrorName returns error name.
1888 func (e Bootstrap_StaticResourcesValidationError) ErrorName() string {
1889 return "Bootstrap_StaticResourcesValidationError"
1890 }
1891
1892 // Error satisfies the builtin error interface
1893 func (e Bootstrap_StaticResourcesValidationError) Error() string {
1894 cause := ""
1895 if e.cause != nil {
1896 cause = fmt.Sprintf(" | caused by: %v", e.cause)
1897 }
1898
1899 key := ""
1900 if e.key {
1901 key = "key for "
1902 }
1903
1904 return fmt.Sprintf(
1905 "invalid %sBootstrap_StaticResources.%s: %s%s",
1906 key,
1907 e.field,
1908 e.reason,
1909 cause)
1910 }
1911
1912 var _ error = Bootstrap_StaticResourcesValidationError{}
1913
1914 var _ interface {
1915 Field() string
1916 Reason() string
1917 Key() bool
1918 Cause() error
1919 ErrorName() string
1920 } = Bootstrap_StaticResourcesValidationError{}
1921
1922 // Validate checks the field values on Bootstrap_DynamicResources with the
1923 // rules defined in the proto definition for this message. If any rules are
1924 // violated, the first error encountered is returned, or nil if there are no violations.
1925 func (m *Bootstrap_DynamicResources) Validate() error {
1926 return m.validate(false)
1927 }
1928
1929 // ValidateAll checks the field values on Bootstrap_DynamicResources with the
1930 // rules defined in the proto definition for this message. If any rules are
1931 // violated, the result is a list of violation errors wrapped in
1932 // Bootstrap_DynamicResourcesMultiError, or nil if none found.
1933 func (m *Bootstrap_DynamicResources) ValidateAll() error {
1934 return m.validate(true)
1935 }
1936
1937 func (m *Bootstrap_DynamicResources) validate(all bool) error {
1938 if m == nil {
1939 return nil
1940 }
1941
1942 var errors []error
1943
1944 if all {
1945 switch v := interface{}(m.GetLdsConfig()).(type) {
1946 case interface{ ValidateAll() error }:
1947 if err := v.ValidateAll(); err != nil {
1948 errors = append(errors, Bootstrap_DynamicResourcesValidationError{
1949 field: "LdsConfig",
1950 reason: "embedded message failed validation",
1951 cause: err,
1952 })
1953 }
1954 case interface{ Validate() error }:
1955 if err := v.Validate(); err != nil {
1956 errors = append(errors, Bootstrap_DynamicResourcesValidationError{
1957 field: "LdsConfig",
1958 reason: "embedded message failed validation",
1959 cause: err,
1960 })
1961 }
1962 }
1963 } else if v, ok := interface{}(m.GetLdsConfig()).(interface{ Validate() error }); ok {
1964 if err := v.Validate(); err != nil {
1965 return Bootstrap_DynamicResourcesValidationError{
1966 field: "LdsConfig",
1967 reason: "embedded message failed validation",
1968 cause: err,
1969 }
1970 }
1971 }
1972
1973 if all {
1974 switch v := interface{}(m.GetCdsConfig()).(type) {
1975 case interface{ ValidateAll() error }:
1976 if err := v.ValidateAll(); err != nil {
1977 errors = append(errors, Bootstrap_DynamicResourcesValidationError{
1978 field: "CdsConfig",
1979 reason: "embedded message failed validation",
1980 cause: err,
1981 })
1982 }
1983 case interface{ Validate() error }:
1984 if err := v.Validate(); err != nil {
1985 errors = append(errors, Bootstrap_DynamicResourcesValidationError{
1986 field: "CdsConfig",
1987 reason: "embedded message failed validation",
1988 cause: err,
1989 })
1990 }
1991 }
1992 } else if v, ok := interface{}(m.GetCdsConfig()).(interface{ Validate() error }); ok {
1993 if err := v.Validate(); err != nil {
1994 return Bootstrap_DynamicResourcesValidationError{
1995 field: "CdsConfig",
1996 reason: "embedded message failed validation",
1997 cause: err,
1998 }
1999 }
2000 }
2001
2002 if all {
2003 switch v := interface{}(m.GetAdsConfig()).(type) {
2004 case interface{ ValidateAll() error }:
2005 if err := v.ValidateAll(); err != nil {
2006 errors = append(errors, Bootstrap_DynamicResourcesValidationError{
2007 field: "AdsConfig",
2008 reason: "embedded message failed validation",
2009 cause: err,
2010 })
2011 }
2012 case interface{ Validate() error }:
2013 if err := v.Validate(); err != nil {
2014 errors = append(errors, Bootstrap_DynamicResourcesValidationError{
2015 field: "AdsConfig",
2016 reason: "embedded message failed validation",
2017 cause: err,
2018 })
2019 }
2020 }
2021 } else if v, ok := interface{}(m.GetAdsConfig()).(interface{ Validate() error }); ok {
2022 if err := v.Validate(); err != nil {
2023 return Bootstrap_DynamicResourcesValidationError{
2024 field: "AdsConfig",
2025 reason: "embedded message failed validation",
2026 cause: err,
2027 }
2028 }
2029 }
2030
2031 if len(errors) > 0 {
2032 return Bootstrap_DynamicResourcesMultiError(errors)
2033 }
2034
2035 return nil
2036 }
2037
2038 // Bootstrap_DynamicResourcesMultiError is an error wrapping multiple
2039 // validation errors returned by Bootstrap_DynamicResources.ValidateAll() if
2040 // the designated constraints aren't met.
2041 type Bootstrap_DynamicResourcesMultiError []error
2042
2043 // Error returns a concatenation of all the error messages it wraps.
2044 func (m Bootstrap_DynamicResourcesMultiError) Error() string {
2045 var msgs []string
2046 for _, err := range m {
2047 msgs = append(msgs, err.Error())
2048 }
2049 return strings.Join(msgs, "; ")
2050 }
2051
2052 // AllErrors returns a list of validation violation errors.
2053 func (m Bootstrap_DynamicResourcesMultiError) AllErrors() []error { return m }
2054
2055 // Bootstrap_DynamicResourcesValidationError is the validation error returned
2056 // by Bootstrap_DynamicResources.Validate if the designated constraints aren't met.
2057 type Bootstrap_DynamicResourcesValidationError struct {
2058 field string
2059 reason string
2060 cause error
2061 key bool
2062 }
2063
2064 // Field function returns field value.
2065 func (e Bootstrap_DynamicResourcesValidationError) Field() string { return e.field }
2066
2067 // Reason function returns reason value.
2068 func (e Bootstrap_DynamicResourcesValidationError) Reason() string { return e.reason }
2069
2070 // Cause function returns cause value.
2071 func (e Bootstrap_DynamicResourcesValidationError) Cause() error { return e.cause }
2072
2073 // Key function returns key value.
2074 func (e Bootstrap_DynamicResourcesValidationError) Key() bool { return e.key }
2075
2076 // ErrorName returns error name.
2077 func (e Bootstrap_DynamicResourcesValidationError) ErrorName() string {
2078 return "Bootstrap_DynamicResourcesValidationError"
2079 }
2080
2081 // Error satisfies the builtin error interface
2082 func (e Bootstrap_DynamicResourcesValidationError) Error() string {
2083 cause := ""
2084 if e.cause != nil {
2085 cause = fmt.Sprintf(" | caused by: %v", e.cause)
2086 }
2087
2088 key := ""
2089 if e.key {
2090 key = "key for "
2091 }
2092
2093 return fmt.Sprintf(
2094 "invalid %sBootstrap_DynamicResources.%s: %s%s",
2095 key,
2096 e.field,
2097 e.reason,
2098 cause)
2099 }
2100
2101 var _ error = Bootstrap_DynamicResourcesValidationError{}
2102
2103 var _ interface {
2104 Field() string
2105 Reason() string
2106 Key() bool
2107 Cause() error
2108 ErrorName() string
2109 } = Bootstrap_DynamicResourcesValidationError{}
2110
2111 // Validate checks the field values on ClusterManager_OutlierDetection with the
2112 // rules defined in the proto definition for this message. If any rules are
2113 // violated, the first error encountered is returned, or nil if there are no violations.
2114 func (m *ClusterManager_OutlierDetection) Validate() error {
2115 return m.validate(false)
2116 }
2117
2118 // ValidateAll checks the field values on ClusterManager_OutlierDetection with
2119 // the rules defined in the proto definition for this message. If any rules
2120 // are violated, the result is a list of violation errors wrapped in
2121 // ClusterManager_OutlierDetectionMultiError, or nil if none found.
2122 func (m *ClusterManager_OutlierDetection) ValidateAll() error {
2123 return m.validate(true)
2124 }
2125
2126 func (m *ClusterManager_OutlierDetection) validate(all bool) error {
2127 if m == nil {
2128 return nil
2129 }
2130
2131 var errors []error
2132
2133 // no validation rules for EventLogPath
2134
2135 if all {
2136 switch v := interface{}(m.GetEventService()).(type) {
2137 case interface{ ValidateAll() error }:
2138 if err := v.ValidateAll(); err != nil {
2139 errors = append(errors, ClusterManager_OutlierDetectionValidationError{
2140 field: "EventService",
2141 reason: "embedded message failed validation",
2142 cause: err,
2143 })
2144 }
2145 case interface{ Validate() error }:
2146 if err := v.Validate(); err != nil {
2147 errors = append(errors, ClusterManager_OutlierDetectionValidationError{
2148 field: "EventService",
2149 reason: "embedded message failed validation",
2150 cause: err,
2151 })
2152 }
2153 }
2154 } else if v, ok := interface{}(m.GetEventService()).(interface{ Validate() error }); ok {
2155 if err := v.Validate(); err != nil {
2156 return ClusterManager_OutlierDetectionValidationError{
2157 field: "EventService",
2158 reason: "embedded message failed validation",
2159 cause: err,
2160 }
2161 }
2162 }
2163
2164 if len(errors) > 0 {
2165 return ClusterManager_OutlierDetectionMultiError(errors)
2166 }
2167
2168 return nil
2169 }
2170
2171 // ClusterManager_OutlierDetectionMultiError is an error wrapping multiple
2172 // validation errors returned by ClusterManager_OutlierDetection.ValidateAll()
2173 // if the designated constraints aren't met.
2174 type ClusterManager_OutlierDetectionMultiError []error
2175
2176 // Error returns a concatenation of all the error messages it wraps.
2177 func (m ClusterManager_OutlierDetectionMultiError) Error() string {
2178 var msgs []string
2179 for _, err := range m {
2180 msgs = append(msgs, err.Error())
2181 }
2182 return strings.Join(msgs, "; ")
2183 }
2184
2185 // AllErrors returns a list of validation violation errors.
2186 func (m ClusterManager_OutlierDetectionMultiError) AllErrors() []error { return m }
2187
2188 // ClusterManager_OutlierDetectionValidationError is the validation error
2189 // returned by ClusterManager_OutlierDetection.Validate if the designated
2190 // constraints aren't met.
2191 type ClusterManager_OutlierDetectionValidationError struct {
2192 field string
2193 reason string
2194 cause error
2195 key bool
2196 }
2197
2198 // Field function returns field value.
2199 func (e ClusterManager_OutlierDetectionValidationError) Field() string { return e.field }
2200
2201 // Reason function returns reason value.
2202 func (e ClusterManager_OutlierDetectionValidationError) Reason() string { return e.reason }
2203
2204 // Cause function returns cause value.
2205 func (e ClusterManager_OutlierDetectionValidationError) Cause() error { return e.cause }
2206
2207 // Key function returns key value.
2208 func (e ClusterManager_OutlierDetectionValidationError) Key() bool { return e.key }
2209
2210 // ErrorName returns error name.
2211 func (e ClusterManager_OutlierDetectionValidationError) ErrorName() string {
2212 return "ClusterManager_OutlierDetectionValidationError"
2213 }
2214
2215 // Error satisfies the builtin error interface
2216 func (e ClusterManager_OutlierDetectionValidationError) Error() string {
2217 cause := ""
2218 if e.cause != nil {
2219 cause = fmt.Sprintf(" | caused by: %v", e.cause)
2220 }
2221
2222 key := ""
2223 if e.key {
2224 key = "key for "
2225 }
2226
2227 return fmt.Sprintf(
2228 "invalid %sClusterManager_OutlierDetection.%s: %s%s",
2229 key,
2230 e.field,
2231 e.reason,
2232 cause)
2233 }
2234
2235 var _ error = ClusterManager_OutlierDetectionValidationError{}
2236
2237 var _ interface {
2238 Field() string
2239 Reason() string
2240 Key() bool
2241 Cause() error
2242 ErrorName() string
2243 } = ClusterManager_OutlierDetectionValidationError{}
2244
2245 // Validate checks the field values on RuntimeLayer_DiskLayer with the rules
2246 // defined in the proto definition for this message. If any rules are
2247 // violated, the first error encountered is returned, or nil if there are no violations.
2248 func (m *RuntimeLayer_DiskLayer) Validate() error {
2249 return m.validate(false)
2250 }
2251
2252 // ValidateAll checks the field values on RuntimeLayer_DiskLayer with the rules
2253 // defined in the proto definition for this message. If any rules are
2254 // violated, the result is a list of violation errors wrapped in
2255 // RuntimeLayer_DiskLayerMultiError, or nil if none found.
2256 func (m *RuntimeLayer_DiskLayer) ValidateAll() error {
2257 return m.validate(true)
2258 }
2259
2260 func (m *RuntimeLayer_DiskLayer) validate(all bool) error {
2261 if m == nil {
2262 return nil
2263 }
2264
2265 var errors []error
2266
2267 // no validation rules for SymlinkRoot
2268
2269 // no validation rules for Subdirectory
2270
2271 // no validation rules for AppendServiceCluster
2272
2273 if len(errors) > 0 {
2274 return RuntimeLayer_DiskLayerMultiError(errors)
2275 }
2276
2277 return nil
2278 }
2279
2280 // RuntimeLayer_DiskLayerMultiError is an error wrapping multiple validation
2281 // errors returned by RuntimeLayer_DiskLayer.ValidateAll() if the designated
2282 // constraints aren't met.
2283 type RuntimeLayer_DiskLayerMultiError []error
2284
2285 // Error returns a concatenation of all the error messages it wraps.
2286 func (m RuntimeLayer_DiskLayerMultiError) Error() string {
2287 var msgs []string
2288 for _, err := range m {
2289 msgs = append(msgs, err.Error())
2290 }
2291 return strings.Join(msgs, "; ")
2292 }
2293
2294 // AllErrors returns a list of validation violation errors.
2295 func (m RuntimeLayer_DiskLayerMultiError) AllErrors() []error { return m }
2296
2297 // RuntimeLayer_DiskLayerValidationError is the validation error returned by
2298 // RuntimeLayer_DiskLayer.Validate if the designated constraints aren't met.
2299 type RuntimeLayer_DiskLayerValidationError struct {
2300 field string
2301 reason string
2302 cause error
2303 key bool
2304 }
2305
2306 // Field function returns field value.
2307 func (e RuntimeLayer_DiskLayerValidationError) Field() string { return e.field }
2308
2309 // Reason function returns reason value.
2310 func (e RuntimeLayer_DiskLayerValidationError) Reason() string { return e.reason }
2311
2312 // Cause function returns cause value.
2313 func (e RuntimeLayer_DiskLayerValidationError) Cause() error { return e.cause }
2314
2315 // Key function returns key value.
2316 func (e RuntimeLayer_DiskLayerValidationError) Key() bool { return e.key }
2317
2318 // ErrorName returns error name.
2319 func (e RuntimeLayer_DiskLayerValidationError) ErrorName() string {
2320 return "RuntimeLayer_DiskLayerValidationError"
2321 }
2322
2323 // Error satisfies the builtin error interface
2324 func (e RuntimeLayer_DiskLayerValidationError) Error() string {
2325 cause := ""
2326 if e.cause != nil {
2327 cause = fmt.Sprintf(" | caused by: %v", e.cause)
2328 }
2329
2330 key := ""
2331 if e.key {
2332 key = "key for "
2333 }
2334
2335 return fmt.Sprintf(
2336 "invalid %sRuntimeLayer_DiskLayer.%s: %s%s",
2337 key,
2338 e.field,
2339 e.reason,
2340 cause)
2341 }
2342
2343 var _ error = RuntimeLayer_DiskLayerValidationError{}
2344
2345 var _ interface {
2346 Field() string
2347 Reason() string
2348 Key() bool
2349 Cause() error
2350 ErrorName() string
2351 } = RuntimeLayer_DiskLayerValidationError{}
2352
2353 // Validate checks the field values on RuntimeLayer_AdminLayer with the rules
2354 // defined in the proto definition for this message. If any rules are
2355 // violated, the first error encountered is returned, or nil if there are no violations.
2356 func (m *RuntimeLayer_AdminLayer) Validate() error {
2357 return m.validate(false)
2358 }
2359
2360 // ValidateAll checks the field values on RuntimeLayer_AdminLayer with the
2361 // rules defined in the proto definition for this message. If any rules are
2362 // violated, the result is a list of violation errors wrapped in
2363 // RuntimeLayer_AdminLayerMultiError, or nil if none found.
2364 func (m *RuntimeLayer_AdminLayer) ValidateAll() error {
2365 return m.validate(true)
2366 }
2367
2368 func (m *RuntimeLayer_AdminLayer) validate(all bool) error {
2369 if m == nil {
2370 return nil
2371 }
2372
2373 var errors []error
2374
2375 if len(errors) > 0 {
2376 return RuntimeLayer_AdminLayerMultiError(errors)
2377 }
2378
2379 return nil
2380 }
2381
2382 // RuntimeLayer_AdminLayerMultiError is an error wrapping multiple validation
2383 // errors returned by RuntimeLayer_AdminLayer.ValidateAll() if the designated
2384 // constraints aren't met.
2385 type RuntimeLayer_AdminLayerMultiError []error
2386
2387 // Error returns a concatenation of all the error messages it wraps.
2388 func (m RuntimeLayer_AdminLayerMultiError) Error() string {
2389 var msgs []string
2390 for _, err := range m {
2391 msgs = append(msgs, err.Error())
2392 }
2393 return strings.Join(msgs, "; ")
2394 }
2395
2396 // AllErrors returns a list of validation violation errors.
2397 func (m RuntimeLayer_AdminLayerMultiError) AllErrors() []error { return m }
2398
2399 // RuntimeLayer_AdminLayerValidationError is the validation error returned by
2400 // RuntimeLayer_AdminLayer.Validate if the designated constraints aren't met.
2401 type RuntimeLayer_AdminLayerValidationError struct {
2402 field string
2403 reason string
2404 cause error
2405 key bool
2406 }
2407
2408 // Field function returns field value.
2409 func (e RuntimeLayer_AdminLayerValidationError) Field() string { return e.field }
2410
2411 // Reason function returns reason value.
2412 func (e RuntimeLayer_AdminLayerValidationError) Reason() string { return e.reason }
2413
2414 // Cause function returns cause value.
2415 func (e RuntimeLayer_AdminLayerValidationError) Cause() error { return e.cause }
2416
2417 // Key function returns key value.
2418 func (e RuntimeLayer_AdminLayerValidationError) Key() bool { return e.key }
2419
2420 // ErrorName returns error name.
2421 func (e RuntimeLayer_AdminLayerValidationError) ErrorName() string {
2422 return "RuntimeLayer_AdminLayerValidationError"
2423 }
2424
2425 // Error satisfies the builtin error interface
2426 func (e RuntimeLayer_AdminLayerValidationError) Error() string {
2427 cause := ""
2428 if e.cause != nil {
2429 cause = fmt.Sprintf(" | caused by: %v", e.cause)
2430 }
2431
2432 key := ""
2433 if e.key {
2434 key = "key for "
2435 }
2436
2437 return fmt.Sprintf(
2438 "invalid %sRuntimeLayer_AdminLayer.%s: %s%s",
2439 key,
2440 e.field,
2441 e.reason,
2442 cause)
2443 }
2444
2445 var _ error = RuntimeLayer_AdminLayerValidationError{}
2446
2447 var _ interface {
2448 Field() string
2449 Reason() string
2450 Key() bool
2451 Cause() error
2452 ErrorName() string
2453 } = RuntimeLayer_AdminLayerValidationError{}
2454
2455 // Validate checks the field values on RuntimeLayer_RtdsLayer with the rules
2456 // defined in the proto definition for this message. If any rules are
2457 // violated, the first error encountered is returned, or nil if there are no violations.
2458 func (m *RuntimeLayer_RtdsLayer) Validate() error {
2459 return m.validate(false)
2460 }
2461
2462 // ValidateAll checks the field values on RuntimeLayer_RtdsLayer with the rules
2463 // defined in the proto definition for this message. If any rules are
2464 // violated, the result is a list of violation errors wrapped in
2465 // RuntimeLayer_RtdsLayerMultiError, or nil if none found.
2466 func (m *RuntimeLayer_RtdsLayer) ValidateAll() error {
2467 return m.validate(true)
2468 }
2469
2470 func (m *RuntimeLayer_RtdsLayer) validate(all bool) error {
2471 if m == nil {
2472 return nil
2473 }
2474
2475 var errors []error
2476
2477 // no validation rules for Name
2478
2479 if all {
2480 switch v := interface{}(m.GetRtdsConfig()).(type) {
2481 case interface{ ValidateAll() error }:
2482 if err := v.ValidateAll(); err != nil {
2483 errors = append(errors, RuntimeLayer_RtdsLayerValidationError{
2484 field: "RtdsConfig",
2485 reason: "embedded message failed validation",
2486 cause: err,
2487 })
2488 }
2489 case interface{ Validate() error }:
2490 if err := v.Validate(); err != nil {
2491 errors = append(errors, RuntimeLayer_RtdsLayerValidationError{
2492 field: "RtdsConfig",
2493 reason: "embedded message failed validation",
2494 cause: err,
2495 })
2496 }
2497 }
2498 } else if v, ok := interface{}(m.GetRtdsConfig()).(interface{ Validate() error }); ok {
2499 if err := v.Validate(); err != nil {
2500 return RuntimeLayer_RtdsLayerValidationError{
2501 field: "RtdsConfig",
2502 reason: "embedded message failed validation",
2503 cause: err,
2504 }
2505 }
2506 }
2507
2508 if len(errors) > 0 {
2509 return RuntimeLayer_RtdsLayerMultiError(errors)
2510 }
2511
2512 return nil
2513 }
2514
2515 // RuntimeLayer_RtdsLayerMultiError is an error wrapping multiple validation
2516 // errors returned by RuntimeLayer_RtdsLayer.ValidateAll() if the designated
2517 // constraints aren't met.
2518 type RuntimeLayer_RtdsLayerMultiError []error
2519
2520 // Error returns a concatenation of all the error messages it wraps.
2521 func (m RuntimeLayer_RtdsLayerMultiError) Error() string {
2522 var msgs []string
2523 for _, err := range m {
2524 msgs = append(msgs, err.Error())
2525 }
2526 return strings.Join(msgs, "; ")
2527 }
2528
2529 // AllErrors returns a list of validation violation errors.
2530 func (m RuntimeLayer_RtdsLayerMultiError) AllErrors() []error { return m }
2531
2532 // RuntimeLayer_RtdsLayerValidationError is the validation error returned by
2533 // RuntimeLayer_RtdsLayer.Validate if the designated constraints aren't met.
2534 type RuntimeLayer_RtdsLayerValidationError struct {
2535 field string
2536 reason string
2537 cause error
2538 key bool
2539 }
2540
2541 // Field function returns field value.
2542 func (e RuntimeLayer_RtdsLayerValidationError) Field() string { return e.field }
2543
2544 // Reason function returns reason value.
2545 func (e RuntimeLayer_RtdsLayerValidationError) Reason() string { return e.reason }
2546
2547 // Cause function returns cause value.
2548 func (e RuntimeLayer_RtdsLayerValidationError) Cause() error { return e.cause }
2549
2550 // Key function returns key value.
2551 func (e RuntimeLayer_RtdsLayerValidationError) Key() bool { return e.key }
2552
2553 // ErrorName returns error name.
2554 func (e RuntimeLayer_RtdsLayerValidationError) ErrorName() string {
2555 return "RuntimeLayer_RtdsLayerValidationError"
2556 }
2557
2558 // Error satisfies the builtin error interface
2559 func (e RuntimeLayer_RtdsLayerValidationError) Error() string {
2560 cause := ""
2561 if e.cause != nil {
2562 cause = fmt.Sprintf(" | caused by: %v", e.cause)
2563 }
2564
2565 key := ""
2566 if e.key {
2567 key = "key for "
2568 }
2569
2570 return fmt.Sprintf(
2571 "invalid %sRuntimeLayer_RtdsLayer.%s: %s%s",
2572 key,
2573 e.field,
2574 e.reason,
2575 cause)
2576 }
2577
2578 var _ error = RuntimeLayer_RtdsLayerValidationError{}
2579
2580 var _ interface {
2581 Field() string
2582 Reason() string
2583 Key() bool
2584 Cause() error
2585 ErrorName() string
2586 } = RuntimeLayer_RtdsLayerValidationError{}