1
2
3
4 package envoy_data_accesslog_v3
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 v3 "github.com/datawire/ambassador/v2/pkg/api/envoy/config/core/v3"
21 )
22
23
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 _ = ptypes.DynamicAny{}
36
37 _ = v3.RequestMethod(0)
38 )
39
40
41
42
43 func (m *TCPAccessLogEntry) Validate() error {
44 if m == nil {
45 return nil
46 }
47
48 if v, ok := interface{}(m.GetCommonProperties()).(interface{ Validate() error }); ok {
49 if err := v.Validate(); err != nil {
50 return TCPAccessLogEntryValidationError{
51 field: "CommonProperties",
52 reason: "embedded message failed validation",
53 cause: err,
54 }
55 }
56 }
57
58 if v, ok := interface{}(m.GetConnectionProperties()).(interface{ Validate() error }); ok {
59 if err := v.Validate(); err != nil {
60 return TCPAccessLogEntryValidationError{
61 field: "ConnectionProperties",
62 reason: "embedded message failed validation",
63 cause: err,
64 }
65 }
66 }
67
68 return nil
69 }
70
71
72
73 type TCPAccessLogEntryValidationError struct {
74 field string
75 reason string
76 cause error
77 key bool
78 }
79
80
81 func (e TCPAccessLogEntryValidationError) Field() string { return e.field }
82
83
84 func (e TCPAccessLogEntryValidationError) Reason() string { return e.reason }
85
86
87 func (e TCPAccessLogEntryValidationError) Cause() error { return e.cause }
88
89
90 func (e TCPAccessLogEntryValidationError) Key() bool { return e.key }
91
92
93 func (e TCPAccessLogEntryValidationError) ErrorName() string {
94 return "TCPAccessLogEntryValidationError"
95 }
96
97
98 func (e TCPAccessLogEntryValidationError) Error() string {
99 cause := ""
100 if e.cause != nil {
101 cause = fmt.Sprintf(" | caused by: %v", e.cause)
102 }
103
104 key := ""
105 if e.key {
106 key = "key for "
107 }
108
109 return fmt.Sprintf(
110 "invalid %sTCPAccessLogEntry.%s: %s%s",
111 key,
112 e.field,
113 e.reason,
114 cause)
115 }
116
117 var _ error = TCPAccessLogEntryValidationError{}
118
119 var _ interface {
120 Field() string
121 Reason() string
122 Key() bool
123 Cause() error
124 ErrorName() string
125 } = TCPAccessLogEntryValidationError{}
126
127
128
129
130 func (m *HTTPAccessLogEntry) Validate() error {
131 if m == nil {
132 return nil
133 }
134
135 if v, ok := interface{}(m.GetCommonProperties()).(interface{ Validate() error }); ok {
136 if err := v.Validate(); err != nil {
137 return HTTPAccessLogEntryValidationError{
138 field: "CommonProperties",
139 reason: "embedded message failed validation",
140 cause: err,
141 }
142 }
143 }
144
145
146
147 if v, ok := interface{}(m.GetRequest()).(interface{ Validate() error }); ok {
148 if err := v.Validate(); err != nil {
149 return HTTPAccessLogEntryValidationError{
150 field: "Request",
151 reason: "embedded message failed validation",
152 cause: err,
153 }
154 }
155 }
156
157 if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok {
158 if err := v.Validate(); err != nil {
159 return HTTPAccessLogEntryValidationError{
160 field: "Response",
161 reason: "embedded message failed validation",
162 cause: err,
163 }
164 }
165 }
166
167 return nil
168 }
169
170
171
172 type HTTPAccessLogEntryValidationError struct {
173 field string
174 reason string
175 cause error
176 key bool
177 }
178
179
180 func (e HTTPAccessLogEntryValidationError) Field() string { return e.field }
181
182
183 func (e HTTPAccessLogEntryValidationError) Reason() string { return e.reason }
184
185
186 func (e HTTPAccessLogEntryValidationError) Cause() error { return e.cause }
187
188
189 func (e HTTPAccessLogEntryValidationError) Key() bool { return e.key }
190
191
192 func (e HTTPAccessLogEntryValidationError) ErrorName() string {
193 return "HTTPAccessLogEntryValidationError"
194 }
195
196
197 func (e HTTPAccessLogEntryValidationError) Error() string {
198 cause := ""
199 if e.cause != nil {
200 cause = fmt.Sprintf(" | caused by: %v", e.cause)
201 }
202
203 key := ""
204 if e.key {
205 key = "key for "
206 }
207
208 return fmt.Sprintf(
209 "invalid %sHTTPAccessLogEntry.%s: %s%s",
210 key,
211 e.field,
212 e.reason,
213 cause)
214 }
215
216 var _ error = HTTPAccessLogEntryValidationError{}
217
218 var _ interface {
219 Field() string
220 Reason() string
221 Key() bool
222 Cause() error
223 ErrorName() string
224 } = HTTPAccessLogEntryValidationError{}
225
226
227
228
229 func (m *ConnectionProperties) Validate() error {
230 if m == nil {
231 return nil
232 }
233
234
235
236
237
238 return nil
239 }
240
241
242
243 type ConnectionPropertiesValidationError struct {
244 field string
245 reason string
246 cause error
247 key bool
248 }
249
250
251 func (e ConnectionPropertiesValidationError) Field() string { return e.field }
252
253
254 func (e ConnectionPropertiesValidationError) Reason() string { return e.reason }
255
256
257 func (e ConnectionPropertiesValidationError) Cause() error { return e.cause }
258
259
260 func (e ConnectionPropertiesValidationError) Key() bool { return e.key }
261
262
263 func (e ConnectionPropertiesValidationError) ErrorName() string {
264 return "ConnectionPropertiesValidationError"
265 }
266
267
268 func (e ConnectionPropertiesValidationError) Error() string {
269 cause := ""
270 if e.cause != nil {
271 cause = fmt.Sprintf(" | caused by: %v", e.cause)
272 }
273
274 key := ""
275 if e.key {
276 key = "key for "
277 }
278
279 return fmt.Sprintf(
280 "invalid %sConnectionProperties.%s: %s%s",
281 key,
282 e.field,
283 e.reason,
284 cause)
285 }
286
287 var _ error = ConnectionPropertiesValidationError{}
288
289 var _ interface {
290 Field() string
291 Reason() string
292 Key() bool
293 Cause() error
294 ErrorName() string
295 } = ConnectionPropertiesValidationError{}
296
297
298
299
300 func (m *AccessLogCommon) Validate() error {
301 if m == nil {
302 return nil
303 }
304
305 if val := m.GetSampleRate(); val <= 0 || val > 1 {
306 return AccessLogCommonValidationError{
307 field: "SampleRate",
308 reason: "value must be inside range (0, 1]",
309 }
310 }
311
312 if v, ok := interface{}(m.GetDownstreamRemoteAddress()).(interface{ Validate() error }); ok {
313 if err := v.Validate(); err != nil {
314 return AccessLogCommonValidationError{
315 field: "DownstreamRemoteAddress",
316 reason: "embedded message failed validation",
317 cause: err,
318 }
319 }
320 }
321
322 if v, ok := interface{}(m.GetDownstreamLocalAddress()).(interface{ Validate() error }); ok {
323 if err := v.Validate(); err != nil {
324 return AccessLogCommonValidationError{
325 field: "DownstreamLocalAddress",
326 reason: "embedded message failed validation",
327 cause: err,
328 }
329 }
330 }
331
332 if v, ok := interface{}(m.GetTlsProperties()).(interface{ Validate() error }); ok {
333 if err := v.Validate(); err != nil {
334 return AccessLogCommonValidationError{
335 field: "TlsProperties",
336 reason: "embedded message failed validation",
337 cause: err,
338 }
339 }
340 }
341
342 if v, ok := interface{}(m.GetStartTime()).(interface{ Validate() error }); ok {
343 if err := v.Validate(); err != nil {
344 return AccessLogCommonValidationError{
345 field: "StartTime",
346 reason: "embedded message failed validation",
347 cause: err,
348 }
349 }
350 }
351
352 if v, ok := interface{}(m.GetTimeToLastRxByte()).(interface{ Validate() error }); ok {
353 if err := v.Validate(); err != nil {
354 return AccessLogCommonValidationError{
355 field: "TimeToLastRxByte",
356 reason: "embedded message failed validation",
357 cause: err,
358 }
359 }
360 }
361
362 if v, ok := interface{}(m.GetTimeToFirstUpstreamTxByte()).(interface{ Validate() error }); ok {
363 if err := v.Validate(); err != nil {
364 return AccessLogCommonValidationError{
365 field: "TimeToFirstUpstreamTxByte",
366 reason: "embedded message failed validation",
367 cause: err,
368 }
369 }
370 }
371
372 if v, ok := interface{}(m.GetTimeToLastUpstreamTxByte()).(interface{ Validate() error }); ok {
373 if err := v.Validate(); err != nil {
374 return AccessLogCommonValidationError{
375 field: "TimeToLastUpstreamTxByte",
376 reason: "embedded message failed validation",
377 cause: err,
378 }
379 }
380 }
381
382 if v, ok := interface{}(m.GetTimeToFirstUpstreamRxByte()).(interface{ Validate() error }); ok {
383 if err := v.Validate(); err != nil {
384 return AccessLogCommonValidationError{
385 field: "TimeToFirstUpstreamRxByte",
386 reason: "embedded message failed validation",
387 cause: err,
388 }
389 }
390 }
391
392 if v, ok := interface{}(m.GetTimeToLastUpstreamRxByte()).(interface{ Validate() error }); ok {
393 if err := v.Validate(); err != nil {
394 return AccessLogCommonValidationError{
395 field: "TimeToLastUpstreamRxByte",
396 reason: "embedded message failed validation",
397 cause: err,
398 }
399 }
400 }
401
402 if v, ok := interface{}(m.GetTimeToFirstDownstreamTxByte()).(interface{ Validate() error }); ok {
403 if err := v.Validate(); err != nil {
404 return AccessLogCommonValidationError{
405 field: "TimeToFirstDownstreamTxByte",
406 reason: "embedded message failed validation",
407 cause: err,
408 }
409 }
410 }
411
412 if v, ok := interface{}(m.GetTimeToLastDownstreamTxByte()).(interface{ Validate() error }); ok {
413 if err := v.Validate(); err != nil {
414 return AccessLogCommonValidationError{
415 field: "TimeToLastDownstreamTxByte",
416 reason: "embedded message failed validation",
417 cause: err,
418 }
419 }
420 }
421
422 if v, ok := interface{}(m.GetUpstreamRemoteAddress()).(interface{ Validate() error }); ok {
423 if err := v.Validate(); err != nil {
424 return AccessLogCommonValidationError{
425 field: "UpstreamRemoteAddress",
426 reason: "embedded message failed validation",
427 cause: err,
428 }
429 }
430 }
431
432 if v, ok := interface{}(m.GetUpstreamLocalAddress()).(interface{ Validate() error }); ok {
433 if err := v.Validate(); err != nil {
434 return AccessLogCommonValidationError{
435 field: "UpstreamLocalAddress",
436 reason: "embedded message failed validation",
437 cause: err,
438 }
439 }
440 }
441
442
443
444 if v, ok := interface{}(m.GetResponseFlags()).(interface{ Validate() error }); ok {
445 if err := v.Validate(); err != nil {
446 return AccessLogCommonValidationError{
447 field: "ResponseFlags",
448 reason: "embedded message failed validation",
449 cause: err,
450 }
451 }
452 }
453
454 if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
455 if err := v.Validate(); err != nil {
456 return AccessLogCommonValidationError{
457 field: "Metadata",
458 reason: "embedded message failed validation",
459 cause: err,
460 }
461 }
462 }
463
464
465
466
467
468 if v, ok := interface{}(m.GetDownstreamDirectRemoteAddress()).(interface{ Validate() error }); ok {
469 if err := v.Validate(); err != nil {
470 return AccessLogCommonValidationError{
471 field: "DownstreamDirectRemoteAddress",
472 reason: "embedded message failed validation",
473 cause: err,
474 }
475 }
476 }
477
478 for key, val := range m.GetFilterStateObjects() {
479 _ = val
480
481
482
483 if v, ok := interface{}(val).(interface{ Validate() error }); ok {
484 if err := v.Validate(); err != nil {
485 return AccessLogCommonValidationError{
486 field: fmt.Sprintf("FilterStateObjects[%v]", key),
487 reason: "embedded message failed validation",
488 cause: err,
489 }
490 }
491 }
492
493 }
494
495 return nil
496 }
497
498
499
500 type AccessLogCommonValidationError struct {
501 field string
502 reason string
503 cause error
504 key bool
505 }
506
507
508 func (e AccessLogCommonValidationError) Field() string { return e.field }
509
510
511 func (e AccessLogCommonValidationError) Reason() string { return e.reason }
512
513
514 func (e AccessLogCommonValidationError) Cause() error { return e.cause }
515
516
517 func (e AccessLogCommonValidationError) Key() bool { return e.key }
518
519
520 func (e AccessLogCommonValidationError) ErrorName() string { return "AccessLogCommonValidationError" }
521
522
523 func (e AccessLogCommonValidationError) Error() string {
524 cause := ""
525 if e.cause != nil {
526 cause = fmt.Sprintf(" | caused by: %v", e.cause)
527 }
528
529 key := ""
530 if e.key {
531 key = "key for "
532 }
533
534 return fmt.Sprintf(
535 "invalid %sAccessLogCommon.%s: %s%s",
536 key,
537 e.field,
538 e.reason,
539 cause)
540 }
541
542 var _ error = AccessLogCommonValidationError{}
543
544 var _ interface {
545 Field() string
546 Reason() string
547 Key() bool
548 Cause() error
549 ErrorName() string
550 } = AccessLogCommonValidationError{}
551
552
553
554
555 func (m *ResponseFlags) Validate() error {
556 if m == nil {
557 return nil
558 }
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584 if v, ok := interface{}(m.GetUnauthorizedDetails()).(interface{ Validate() error }); ok {
585 if err := v.Validate(); err != nil {
586 return ResponseFlagsValidationError{
587 field: "UnauthorizedDetails",
588 reason: "embedded message failed validation",
589 cause: err,
590 }
591 }
592 }
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614 return nil
615 }
616
617
618
619 type ResponseFlagsValidationError struct {
620 field string
621 reason string
622 cause error
623 key bool
624 }
625
626
627 func (e ResponseFlagsValidationError) Field() string { return e.field }
628
629
630 func (e ResponseFlagsValidationError) Reason() string { return e.reason }
631
632
633 func (e ResponseFlagsValidationError) Cause() error { return e.cause }
634
635
636 func (e ResponseFlagsValidationError) Key() bool { return e.key }
637
638
639 func (e ResponseFlagsValidationError) ErrorName() string { return "ResponseFlagsValidationError" }
640
641
642 func (e ResponseFlagsValidationError) Error() string {
643 cause := ""
644 if e.cause != nil {
645 cause = fmt.Sprintf(" | caused by: %v", e.cause)
646 }
647
648 key := ""
649 if e.key {
650 key = "key for "
651 }
652
653 return fmt.Sprintf(
654 "invalid %sResponseFlags.%s: %s%s",
655 key,
656 e.field,
657 e.reason,
658 cause)
659 }
660
661 var _ error = ResponseFlagsValidationError{}
662
663 var _ interface {
664 Field() string
665 Reason() string
666 Key() bool
667 Cause() error
668 ErrorName() string
669 } = ResponseFlagsValidationError{}
670
671
672
673
674 func (m *TLSProperties) Validate() error {
675 if m == nil {
676 return nil
677 }
678
679
680
681 if v, ok := interface{}(m.GetTlsCipherSuite()).(interface{ Validate() error }); ok {
682 if err := v.Validate(); err != nil {
683 return TLSPropertiesValidationError{
684 field: "TlsCipherSuite",
685 reason: "embedded message failed validation",
686 cause: err,
687 }
688 }
689 }
690
691
692
693 if v, ok := interface{}(m.GetLocalCertificateProperties()).(interface{ Validate() error }); ok {
694 if err := v.Validate(); err != nil {
695 return TLSPropertiesValidationError{
696 field: "LocalCertificateProperties",
697 reason: "embedded message failed validation",
698 cause: err,
699 }
700 }
701 }
702
703 if v, ok := interface{}(m.GetPeerCertificateProperties()).(interface{ Validate() error }); ok {
704 if err := v.Validate(); err != nil {
705 return TLSPropertiesValidationError{
706 field: "PeerCertificateProperties",
707 reason: "embedded message failed validation",
708 cause: err,
709 }
710 }
711 }
712
713
714
715 return nil
716 }
717
718
719
720 type TLSPropertiesValidationError struct {
721 field string
722 reason string
723 cause error
724 key bool
725 }
726
727
728 func (e TLSPropertiesValidationError) Field() string { return e.field }
729
730
731 func (e TLSPropertiesValidationError) Reason() string { return e.reason }
732
733
734 func (e TLSPropertiesValidationError) Cause() error { return e.cause }
735
736
737 func (e TLSPropertiesValidationError) Key() bool { return e.key }
738
739
740 func (e TLSPropertiesValidationError) ErrorName() string { return "TLSPropertiesValidationError" }
741
742
743 func (e TLSPropertiesValidationError) Error() string {
744 cause := ""
745 if e.cause != nil {
746 cause = fmt.Sprintf(" | caused by: %v", e.cause)
747 }
748
749 key := ""
750 if e.key {
751 key = "key for "
752 }
753
754 return fmt.Sprintf(
755 "invalid %sTLSProperties.%s: %s%s",
756 key,
757 e.field,
758 e.reason,
759 cause)
760 }
761
762 var _ error = TLSPropertiesValidationError{}
763
764 var _ interface {
765 Field() string
766 Reason() string
767 Key() bool
768 Cause() error
769 ErrorName() string
770 } = TLSPropertiesValidationError{}
771
772
773
774
775 func (m *HTTPRequestProperties) Validate() error {
776 if m == nil {
777 return nil
778 }
779
780 if _, ok := v3.RequestMethod_name[int32(m.GetRequestMethod())]; !ok {
781 return HTTPRequestPropertiesValidationError{
782 field: "RequestMethod",
783 reason: "value must be one of the defined enum values",
784 }
785 }
786
787
788
789
790
791 if v, ok := interface{}(m.GetPort()).(interface{ Validate() error }); ok {
792 if err := v.Validate(); err != nil {
793 return HTTPRequestPropertiesValidationError{
794 field: "Port",
795 reason: "embedded message failed validation",
796 cause: err,
797 }
798 }
799 }
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819 return nil
820 }
821
822
823
824 type HTTPRequestPropertiesValidationError struct {
825 field string
826 reason string
827 cause error
828 key bool
829 }
830
831
832 func (e HTTPRequestPropertiesValidationError) Field() string { return e.field }
833
834
835 func (e HTTPRequestPropertiesValidationError) Reason() string { return e.reason }
836
837
838 func (e HTTPRequestPropertiesValidationError) Cause() error { return e.cause }
839
840
841 func (e HTTPRequestPropertiesValidationError) Key() bool { return e.key }
842
843
844 func (e HTTPRequestPropertiesValidationError) ErrorName() string {
845 return "HTTPRequestPropertiesValidationError"
846 }
847
848
849 func (e HTTPRequestPropertiesValidationError) Error() string {
850 cause := ""
851 if e.cause != nil {
852 cause = fmt.Sprintf(" | caused by: %v", e.cause)
853 }
854
855 key := ""
856 if e.key {
857 key = "key for "
858 }
859
860 return fmt.Sprintf(
861 "invalid %sHTTPRequestProperties.%s: %s%s",
862 key,
863 e.field,
864 e.reason,
865 cause)
866 }
867
868 var _ error = HTTPRequestPropertiesValidationError{}
869
870 var _ interface {
871 Field() string
872 Reason() string
873 Key() bool
874 Cause() error
875 ErrorName() string
876 } = HTTPRequestPropertiesValidationError{}
877
878
879
880
881 func (m *HTTPResponseProperties) Validate() error {
882 if m == nil {
883 return nil
884 }
885
886 if v, ok := interface{}(m.GetResponseCode()).(interface{ Validate() error }); ok {
887 if err := v.Validate(); err != nil {
888 return HTTPResponsePropertiesValidationError{
889 field: "ResponseCode",
890 reason: "embedded message failed validation",
891 cause: err,
892 }
893 }
894 }
895
896
897
898
899
900
901
902
903
904
905
906 return nil
907 }
908
909
910
911 type HTTPResponsePropertiesValidationError struct {
912 field string
913 reason string
914 cause error
915 key bool
916 }
917
918
919 func (e HTTPResponsePropertiesValidationError) Field() string { return e.field }
920
921
922 func (e HTTPResponsePropertiesValidationError) Reason() string { return e.reason }
923
924
925 func (e HTTPResponsePropertiesValidationError) Cause() error { return e.cause }
926
927
928 func (e HTTPResponsePropertiesValidationError) Key() bool { return e.key }
929
930
931 func (e HTTPResponsePropertiesValidationError) ErrorName() string {
932 return "HTTPResponsePropertiesValidationError"
933 }
934
935
936 func (e HTTPResponsePropertiesValidationError) Error() string {
937 cause := ""
938 if e.cause != nil {
939 cause = fmt.Sprintf(" | caused by: %v", e.cause)
940 }
941
942 key := ""
943 if e.key {
944 key = "key for "
945 }
946
947 return fmt.Sprintf(
948 "invalid %sHTTPResponseProperties.%s: %s%s",
949 key,
950 e.field,
951 e.reason,
952 cause)
953 }
954
955 var _ error = HTTPResponsePropertiesValidationError{}
956
957 var _ interface {
958 Field() string
959 Reason() string
960 Key() bool
961 Cause() error
962 ErrorName() string
963 } = HTTPResponsePropertiesValidationError{}
964
965
966
967
968 func (m *ResponseFlags_Unauthorized) Validate() error {
969 if m == nil {
970 return nil
971 }
972
973
974
975 return nil
976 }
977
978
979
980 type ResponseFlags_UnauthorizedValidationError struct {
981 field string
982 reason string
983 cause error
984 key bool
985 }
986
987
988 func (e ResponseFlags_UnauthorizedValidationError) Field() string { return e.field }
989
990
991 func (e ResponseFlags_UnauthorizedValidationError) Reason() string { return e.reason }
992
993
994 func (e ResponseFlags_UnauthorizedValidationError) Cause() error { return e.cause }
995
996
997 func (e ResponseFlags_UnauthorizedValidationError) Key() bool { return e.key }
998
999
1000 func (e ResponseFlags_UnauthorizedValidationError) ErrorName() string {
1001 return "ResponseFlags_UnauthorizedValidationError"
1002 }
1003
1004
1005 func (e ResponseFlags_UnauthorizedValidationError) Error() string {
1006 cause := ""
1007 if e.cause != nil {
1008 cause = fmt.Sprintf(" | caused by: %v", e.cause)
1009 }
1010
1011 key := ""
1012 if e.key {
1013 key = "key for "
1014 }
1015
1016 return fmt.Sprintf(
1017 "invalid %sResponseFlags_Unauthorized.%s: %s%s",
1018 key,
1019 e.field,
1020 e.reason,
1021 cause)
1022 }
1023
1024 var _ error = ResponseFlags_UnauthorizedValidationError{}
1025
1026 var _ interface {
1027 Field() string
1028 Reason() string
1029 Key() bool
1030 Cause() error
1031 ErrorName() string
1032 } = ResponseFlags_UnauthorizedValidationError{}
1033
1034
1035
1036
1037 func (m *TLSProperties_CertificateProperties) Validate() error {
1038 if m == nil {
1039 return nil
1040 }
1041
1042 for idx, item := range m.GetSubjectAltName() {
1043 _, _ = idx, item
1044
1045 if v, ok := interface{}(item).(interface{ Validate() error }); ok {
1046 if err := v.Validate(); err != nil {
1047 return TLSProperties_CertificatePropertiesValidationError{
1048 field: fmt.Sprintf("SubjectAltName[%v]", idx),
1049 reason: "embedded message failed validation",
1050 cause: err,
1051 }
1052 }
1053 }
1054
1055 }
1056
1057
1058
1059 return nil
1060 }
1061
1062
1063
1064
1065 type TLSProperties_CertificatePropertiesValidationError struct {
1066 field string
1067 reason string
1068 cause error
1069 key bool
1070 }
1071
1072
1073 func (e TLSProperties_CertificatePropertiesValidationError) Field() string { return e.field }
1074
1075
1076 func (e TLSProperties_CertificatePropertiesValidationError) Reason() string { return e.reason }
1077
1078
1079 func (e TLSProperties_CertificatePropertiesValidationError) Cause() error { return e.cause }
1080
1081
1082 func (e TLSProperties_CertificatePropertiesValidationError) Key() bool { return e.key }
1083
1084
1085 func (e TLSProperties_CertificatePropertiesValidationError) ErrorName() string {
1086 return "TLSProperties_CertificatePropertiesValidationError"
1087 }
1088
1089
1090 func (e TLSProperties_CertificatePropertiesValidationError) Error() string {
1091 cause := ""
1092 if e.cause != nil {
1093 cause = fmt.Sprintf(" | caused by: %v", e.cause)
1094 }
1095
1096 key := ""
1097 if e.key {
1098 key = "key for "
1099 }
1100
1101 return fmt.Sprintf(
1102 "invalid %sTLSProperties_CertificateProperties.%s: %s%s",
1103 key,
1104 e.field,
1105 e.reason,
1106 cause)
1107 }
1108
1109 var _ error = TLSProperties_CertificatePropertiesValidationError{}
1110
1111 var _ interface {
1112 Field() string
1113 Reason() string
1114 Key() bool
1115 Cause() error
1116 ErrorName() string
1117 } = TLSProperties_CertificatePropertiesValidationError{}
1118
1119
1120
1121
1122
1123 func (m *TLSProperties_CertificateProperties_SubjectAltName) Validate() error {
1124 if m == nil {
1125 return nil
1126 }
1127
1128 switch m.San.(type) {
1129
1130 case *TLSProperties_CertificateProperties_SubjectAltName_Uri:
1131
1132
1133 case *TLSProperties_CertificateProperties_SubjectAltName_Dns:
1134
1135
1136 }
1137
1138 return nil
1139 }
1140
1141
1142
1143
1144
1145 type TLSProperties_CertificateProperties_SubjectAltNameValidationError struct {
1146 field string
1147 reason string
1148 cause error
1149 key bool
1150 }
1151
1152
1153 func (e TLSProperties_CertificateProperties_SubjectAltNameValidationError) Field() string {
1154 return e.field
1155 }
1156
1157
1158 func (e TLSProperties_CertificateProperties_SubjectAltNameValidationError) Reason() string {
1159 return e.reason
1160 }
1161
1162
1163 func (e TLSProperties_CertificateProperties_SubjectAltNameValidationError) Cause() error {
1164 return e.cause
1165 }
1166
1167
1168 func (e TLSProperties_CertificateProperties_SubjectAltNameValidationError) Key() bool { return e.key }
1169
1170
1171 func (e TLSProperties_CertificateProperties_SubjectAltNameValidationError) ErrorName() string {
1172 return "TLSProperties_CertificateProperties_SubjectAltNameValidationError"
1173 }
1174
1175
1176 func (e TLSProperties_CertificateProperties_SubjectAltNameValidationError) Error() string {
1177 cause := ""
1178 if e.cause != nil {
1179 cause = fmt.Sprintf(" | caused by: %v", e.cause)
1180 }
1181
1182 key := ""
1183 if e.key {
1184 key = "key for "
1185 }
1186
1187 return fmt.Sprintf(
1188 "invalid %sTLSProperties_CertificateProperties_SubjectAltName.%s: %s%s",
1189 key,
1190 e.field,
1191 e.reason,
1192 cause)
1193 }
1194
1195 var _ error = TLSProperties_CertificateProperties_SubjectAltNameValidationError{}
1196
1197 var _ interface {
1198 Field() string
1199 Reason() string
1200 Key() bool
1201 Cause() error
1202 ErrorName() string
1203 } = TLSProperties_CertificateProperties_SubjectAltNameValidationError{}
1204
View as plain text