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