Debian Codegraph @

envoy/config/tap/v3/common.pb.validate.go

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