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