1// Code generated by protoc-gen-validate. DO NOT EDIT.
2// source: envoy/config/cluster/v3/cluster.proto
3
4package envoy_config_cluster_v3
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// define the regex for a UUID once up-front
37var _cluster_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
38
39// Validate checks the field values on Cluster with the rules defined in the
40// proto definition for this message. If any rules are violated, an error is returned.
41func (m *Cluster) Validate() error {
42	if m == nil {
43		return nil
44	}
45
46	for idx, item := range m.GetTransportSocketMatches() {
47		_, _ = idx, item
48
49		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
50			if err := v.Validate(); err != nil {
51				return ClusterValidationError{
52					field:  fmt.Sprintf("TransportSocketMatches[%v]", idx),
53					reason: "embedded message failed validation",
54					cause:  err,
55				}
56			}
57		}
58
59	}
60
61	if len(m.GetName()) < 1 {
62		return ClusterValidationError{
63			field:  "Name",
64			reason: "value length must be at least 1 bytes",
65		}
66	}
67
68	// no validation rules for AltStatName
69
70	if v, ok := interface{}(m.GetEdsClusterConfig()).(interface{ Validate() error }); ok {
71		if err := v.Validate(); err != nil {
72			return ClusterValidationError{
73				field:  "EdsClusterConfig",
74				reason: "embedded message failed validation",
75				cause:  err,
76			}
77		}
78	}
79
80	if d := m.GetConnectTimeout(); d != nil {
81		dur, err := ptypes.Duration(d)
82		if err != nil {
83			return ClusterValidationError{
84				field:  "ConnectTimeout",
85				reason: "value is not a valid duration",
86				cause:  err,
87			}
88		}
89
90		gt := time.Duration(0*time.Second + 0*time.Nanosecond)
91
92		if dur <= gt {
93			return ClusterValidationError{
94				field:  "ConnectTimeout",
95				reason: "value must be greater than 0s",
96			}
97		}
98
99	}
100
101	if v, ok := interface{}(m.GetPerConnectionBufferLimitBytes()).(interface{ Validate() error }); ok {
102		if err := v.Validate(); err != nil {
103			return ClusterValidationError{
104				field:  "PerConnectionBufferLimitBytes",
105				reason: "embedded message failed validation",
106				cause:  err,
107			}
108		}
109	}
110
111	if _, ok := Cluster_LbPolicy_name[int32(m.GetLbPolicy())]; !ok {
112		return ClusterValidationError{
113			field:  "LbPolicy",
114			reason: "value must be one of the defined enum values",
115		}
116	}
117
118	for idx, item := range m.GetHiddenEnvoyDeprecatedHosts() {
119		_, _ = idx, item
120
121		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
122			if err := v.Validate(); err != nil {
123				return ClusterValidationError{
124					field:  fmt.Sprintf("HiddenEnvoyDeprecatedHosts[%v]", idx),
125					reason: "embedded message failed validation",
126					cause:  err,
127				}
128			}
129		}
130
131	}
132
133	if v, ok := interface{}(m.GetLoadAssignment()).(interface{ Validate() error }); ok {
134		if err := v.Validate(); err != nil {
135			return ClusterValidationError{
136				field:  "LoadAssignment",
137				reason: "embedded message failed validation",
138				cause:  err,
139			}
140		}
141	}
142
143	for idx, item := range m.GetHealthChecks() {
144		_, _ = idx, item
145
146		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
147			if err := v.Validate(); err != nil {
148				return ClusterValidationError{
149					field:  fmt.Sprintf("HealthChecks[%v]", idx),
150					reason: "embedded message failed validation",
151					cause:  err,
152				}
153			}
154		}
155
156	}
157
158	if v, ok := interface{}(m.GetMaxRequestsPerConnection()).(interface{ Validate() error }); ok {
159		if err := v.Validate(); err != nil {
160			return ClusterValidationError{
161				field:  "MaxRequestsPerConnection",
162				reason: "embedded message failed validation",
163				cause:  err,
164			}
165		}
166	}
167
168	if v, ok := interface{}(m.GetCircuitBreakers()).(interface{ Validate() error }); ok {
169		if err := v.Validate(); err != nil {
170			return ClusterValidationError{
171				field:  "CircuitBreakers",
172				reason: "embedded message failed validation",
173				cause:  err,
174			}
175		}
176	}
177
178	if v, ok := interface{}(m.GetHiddenEnvoyDeprecatedTlsContext()).(interface{ Validate() error }); ok {
179		if err := v.Validate(); err != nil {
180			return ClusterValidationError{
181				field:  "HiddenEnvoyDeprecatedTlsContext",
182				reason: "embedded message failed validation",
183				cause:  err,
184			}
185		}
186	}
187
188	if v, ok := interface{}(m.GetUpstreamHttpProtocolOptions()).(interface{ Validate() error }); ok {
189		if err := v.Validate(); err != nil {
190			return ClusterValidationError{
191				field:  "UpstreamHttpProtocolOptions",
192				reason: "embedded message failed validation",
193				cause:  err,
194			}
195		}
196	}
197
198	if v, ok := interface{}(m.GetCommonHttpProtocolOptions()).(interface{ Validate() error }); ok {
199		if err := v.Validate(); err != nil {
200			return ClusterValidationError{
201				field:  "CommonHttpProtocolOptions",
202				reason: "embedded message failed validation",
203				cause:  err,
204			}
205		}
206	}
207
208	if v, ok := interface{}(m.GetHttpProtocolOptions()).(interface{ Validate() error }); ok {
209		if err := v.Validate(); err != nil {
210			return ClusterValidationError{
211				field:  "HttpProtocolOptions",
212				reason: "embedded message failed validation",
213				cause:  err,
214			}
215		}
216	}
217
218	if v, ok := interface{}(m.GetHttp2ProtocolOptions()).(interface{ Validate() error }); ok {
219		if err := v.Validate(); err != nil {
220			return ClusterValidationError{
221				field:  "Http2ProtocolOptions",
222				reason: "embedded message failed validation",
223				cause:  err,
224			}
225		}
226	}
227
228	for key, val := range m.GetHiddenEnvoyDeprecatedExtensionProtocolOptions() {
229		_ = val
230
231		// no validation rules for HiddenEnvoyDeprecatedExtensionProtocolOptions[key]
232
233		if v, ok := interface{}(val).(interface{ Validate() error }); ok {
234			if err := v.Validate(); err != nil {
235				return ClusterValidationError{
236					field:  fmt.Sprintf("HiddenEnvoyDeprecatedExtensionProtocolOptions[%v]", key),
237					reason: "embedded message failed validation",
238					cause:  err,
239				}
240			}
241		}
242
243	}
244
245	for key, val := range m.GetTypedExtensionProtocolOptions() {
246		_ = val
247
248		// no validation rules for TypedExtensionProtocolOptions[key]
249
250		if v, ok := interface{}(val).(interface{ Validate() error }); ok {
251			if err := v.Validate(); err != nil {
252				return ClusterValidationError{
253					field:  fmt.Sprintf("TypedExtensionProtocolOptions[%v]", key),
254					reason: "embedded message failed validation",
255					cause:  err,
256				}
257			}
258		}
259
260	}
261
262	if d := m.GetDnsRefreshRate(); d != nil {
263		dur, err := ptypes.Duration(d)
264		if err != nil {
265			return ClusterValidationError{
266				field:  "DnsRefreshRate",
267				reason: "value is not a valid duration",
268				cause:  err,
269			}
270		}
271
272		gt := time.Duration(0*time.Second + 1000000*time.Nanosecond)
273
274		if dur <= gt {
275			return ClusterValidationError{
276				field:  "DnsRefreshRate",
277				reason: "value must be greater than 1ms",
278			}
279		}
280
281	}
282
283	if v, ok := interface{}(m.GetDnsFailureRefreshRate()).(interface{ Validate() error }); ok {
284		if err := v.Validate(); err != nil {
285			return ClusterValidationError{
286				field:  "DnsFailureRefreshRate",
287				reason: "embedded message failed validation",
288				cause:  err,
289			}
290		}
291	}
292
293	// no validation rules for RespectDnsTtl
294
295	if _, ok := Cluster_DnsLookupFamily_name[int32(m.GetDnsLookupFamily())]; !ok {
296		return ClusterValidationError{
297			field:  "DnsLookupFamily",
298			reason: "value must be one of the defined enum values",
299		}
300	}
301
302	for idx, item := range m.GetDnsResolvers() {
303		_, _ = idx, item
304
305		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
306			if err := v.Validate(); err != nil {
307				return ClusterValidationError{
308					field:  fmt.Sprintf("DnsResolvers[%v]", idx),
309					reason: "embedded message failed validation",
310					cause:  err,
311				}
312			}
313		}
314
315	}
316
317	// no validation rules for UseTcpForDnsLookups
318
319	if v, ok := interface{}(m.GetOutlierDetection()).(interface{ Validate() error }); ok {
320		if err := v.Validate(); err != nil {
321			return ClusterValidationError{
322				field:  "OutlierDetection",
323				reason: "embedded message failed validation",
324				cause:  err,
325			}
326		}
327	}
328
329	if d := m.GetCleanupInterval(); d != nil {
330		dur, err := ptypes.Duration(d)
331		if err != nil {
332			return ClusterValidationError{
333				field:  "CleanupInterval",
334				reason: "value is not a valid duration",
335				cause:  err,
336			}
337		}
338
339		gt := time.Duration(0*time.Second + 0*time.Nanosecond)
340
341		if dur <= gt {
342			return ClusterValidationError{
343				field:  "CleanupInterval",
344				reason: "value must be greater than 0s",
345			}
346		}
347
348	}
349
350	if v, ok := interface{}(m.GetUpstreamBindConfig()).(interface{ Validate() error }); ok {
351		if err := v.Validate(); err != nil {
352			return ClusterValidationError{
353				field:  "UpstreamBindConfig",
354				reason: "embedded message failed validation",
355				cause:  err,
356			}
357		}
358	}
359
360	if v, ok := interface{}(m.GetLbSubsetConfig()).(interface{ Validate() error }); ok {
361		if err := v.Validate(); err != nil {
362			return ClusterValidationError{
363				field:  "LbSubsetConfig",
364				reason: "embedded message failed validation",
365				cause:  err,
366			}
367		}
368	}
369
370	if v, ok := interface{}(m.GetCommonLbConfig()).(interface{ Validate() error }); ok {
371		if err := v.Validate(); err != nil {
372			return ClusterValidationError{
373				field:  "CommonLbConfig",
374				reason: "embedded message failed validation",
375				cause:  err,
376			}
377		}
378	}
379
380	if v, ok := interface{}(m.GetTransportSocket()).(interface{ Validate() error }); ok {
381		if err := v.Validate(); err != nil {
382			return ClusterValidationError{
383				field:  "TransportSocket",
384				reason: "embedded message failed validation",
385				cause:  err,
386			}
387		}
388	}
389
390	if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
391		if err := v.Validate(); err != nil {
392			return ClusterValidationError{
393				field:  "Metadata",
394				reason: "embedded message failed validation",
395				cause:  err,
396			}
397		}
398	}
399
400	// no validation rules for ProtocolSelection
401
402	if v, ok := interface{}(m.GetUpstreamConnectionOptions()).(interface{ Validate() error }); ok {
403		if err := v.Validate(); err != nil {
404			return ClusterValidationError{
405				field:  "UpstreamConnectionOptions",
406				reason: "embedded message failed validation",
407				cause:  err,
408			}
409		}
410	}
411
412	// no validation rules for CloseConnectionsOnHostHealthFailure
413
414	// no validation rules for IgnoreHealthOnHostRemoval
415
416	for idx, item := range m.GetFilters() {
417		_, _ = idx, item
418
419		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
420			if err := v.Validate(); err != nil {
421				return ClusterValidationError{
422					field:  fmt.Sprintf("Filters[%v]", idx),
423					reason: "embedded message failed validation",
424					cause:  err,
425				}
426			}
427		}
428
429	}
430
431	if v, ok := interface{}(m.GetLoadBalancingPolicy()).(interface{ Validate() error }); ok {
432		if err := v.Validate(); err != nil {
433			return ClusterValidationError{
434				field:  "LoadBalancingPolicy",
435				reason: "embedded message failed validation",
436				cause:  err,
437			}
438		}
439	}
440
441	if v, ok := interface{}(m.GetLrsServer()).(interface{ Validate() error }); ok {
442		if err := v.Validate(); err != nil {
443			return ClusterValidationError{
444				field:  "LrsServer",
445				reason: "embedded message failed validation",
446				cause:  err,
447			}
448		}
449	}
450
451	// no validation rules for TrackTimeoutBudgets
452
453	switch m.ClusterDiscoveryType.(type) {
454
455	case *Cluster_Type:
456
457		if _, ok := Cluster_DiscoveryType_name[int32(m.GetType())]; !ok {
458			return ClusterValidationError{
459				field:  "Type",
460				reason: "value must be one of the defined enum values",
461			}
462		}
463
464	case *Cluster_ClusterType:
465
466		if v, ok := interface{}(m.GetClusterType()).(interface{ Validate() error }); ok {
467			if err := v.Validate(); err != nil {
468				return ClusterValidationError{
469					field:  "ClusterType",
470					reason: "embedded message failed validation",
471					cause:  err,
472				}
473			}
474		}
475
476	}
477
478	switch m.LbConfig.(type) {
479
480	case *Cluster_RingHashLbConfig_:
481
482		if v, ok := interface{}(m.GetRingHashLbConfig()).(interface{ Validate() error }); ok {
483			if err := v.Validate(); err != nil {
484				return ClusterValidationError{
485					field:  "RingHashLbConfig",
486					reason: "embedded message failed validation",
487					cause:  err,
488				}
489			}
490		}
491
492	case *Cluster_OriginalDstLbConfig_:
493
494		if v, ok := interface{}(m.GetOriginalDstLbConfig()).(interface{ Validate() error }); ok {
495			if err := v.Validate(); err != nil {
496				return ClusterValidationError{
497					field:  "OriginalDstLbConfig",
498					reason: "embedded message failed validation",
499					cause:  err,
500				}
501			}
502		}
503
504	case *Cluster_LeastRequestLbConfig_:
505
506		if v, ok := interface{}(m.GetLeastRequestLbConfig()).(interface{ Validate() error }); ok {
507			if err := v.Validate(); err != nil {
508				return ClusterValidationError{
509					field:  "LeastRequestLbConfig",
510					reason: "embedded message failed validation",
511					cause:  err,
512				}
513			}
514		}
515
516	}
517
518	return nil
519}
520
521// ClusterValidationError is the validation error returned by Cluster.Validate
522// if the designated constraints aren't met.
523type ClusterValidationError struct {
524	field  string
525	reason string
526	cause  error
527	key    bool
528}
529
530// Field function returns field value.
531func (e ClusterValidationError) Field() string { return e.field }
532
533// Reason function returns reason value.
534func (e ClusterValidationError) Reason() string { return e.reason }
535
536// Cause function returns cause value.
537func (e ClusterValidationError) Cause() error { return e.cause }
538
539// Key function returns key value.
540func (e ClusterValidationError) Key() bool { return e.key }
541
542// ErrorName returns error name.
543func (e ClusterValidationError) ErrorName() string { return "ClusterValidationError" }
544
545// Error satisfies the builtin error interface
546func (e ClusterValidationError) Error() string {
547	cause := ""
548	if e.cause != nil {
549		cause = fmt.Sprintf(" | caused by: %v", e.cause)
550	}
551
552	key := ""
553	if e.key {
554		key = "key for "
555	}
556
557	return fmt.Sprintf(
558		"invalid %sCluster.%s: %s%s",
559		key,
560		e.field,
561		e.reason,
562		cause)
563}
564
565var _ error = ClusterValidationError{}
566
567var _ interface {
568	Field() string
569	Reason() string
570	Key() bool
571	Cause() error
572	ErrorName() string
573} = ClusterValidationError{}
574
575// Validate checks the field values on LoadBalancingPolicy with the rules
576// defined in the proto definition for this message. If any rules are
577// violated, an error is returned.
578func (m *LoadBalancingPolicy) Validate() error {
579	if m == nil {
580		return nil
581	}
582
583	for idx, item := range m.GetPolicies() {
584		_, _ = idx, item
585
586		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
587			if err := v.Validate(); err != nil {
588				return LoadBalancingPolicyValidationError{
589					field:  fmt.Sprintf("Policies[%v]", idx),
590					reason: "embedded message failed validation",
591					cause:  err,
592				}
593			}
594		}
595
596	}
597
598	return nil
599}
600
601// LoadBalancingPolicyValidationError is the validation error returned by
602// LoadBalancingPolicy.Validate if the designated constraints aren't met.
603type LoadBalancingPolicyValidationError struct {
604	field  string
605	reason string
606	cause  error
607	key    bool
608}
609
610// Field function returns field value.
611func (e LoadBalancingPolicyValidationError) Field() string { return e.field }
612
613// Reason function returns reason value.
614func (e LoadBalancingPolicyValidationError) Reason() string { return e.reason }
615
616// Cause function returns cause value.
617func (e LoadBalancingPolicyValidationError) Cause() error { return e.cause }
618
619// Key function returns key value.
620func (e LoadBalancingPolicyValidationError) Key() bool { return e.key }
621
622// ErrorName returns error name.
623func (e LoadBalancingPolicyValidationError) ErrorName() string {
624	return "LoadBalancingPolicyValidationError"
625}
626
627// Error satisfies the builtin error interface
628func (e LoadBalancingPolicyValidationError) Error() string {
629	cause := ""
630	if e.cause != nil {
631		cause = fmt.Sprintf(" | caused by: %v", e.cause)
632	}
633
634	key := ""
635	if e.key {
636		key = "key for "
637	}
638
639	return fmt.Sprintf(
640		"invalid %sLoadBalancingPolicy.%s: %s%s",
641		key,
642		e.field,
643		e.reason,
644		cause)
645}
646
647var _ error = LoadBalancingPolicyValidationError{}
648
649var _ interface {
650	Field() string
651	Reason() string
652	Key() bool
653	Cause() error
654	ErrorName() string
655} = LoadBalancingPolicyValidationError{}
656
657// Validate checks the field values on UpstreamBindConfig with the rules
658// defined in the proto definition for this message. If any rules are
659// violated, an error is returned.
660func (m *UpstreamBindConfig) Validate() error {
661	if m == nil {
662		return nil
663	}
664
665	if v, ok := interface{}(m.GetSourceAddress()).(interface{ Validate() error }); ok {
666		if err := v.Validate(); err != nil {
667			return UpstreamBindConfigValidationError{
668				field:  "SourceAddress",
669				reason: "embedded message failed validation",
670				cause:  err,
671			}
672		}
673	}
674
675	return nil
676}
677
678// UpstreamBindConfigValidationError is the validation error returned by
679// UpstreamBindConfig.Validate if the designated constraints aren't met.
680type UpstreamBindConfigValidationError struct {
681	field  string
682	reason string
683	cause  error
684	key    bool
685}
686
687// Field function returns field value.
688func (e UpstreamBindConfigValidationError) Field() string { return e.field }
689
690// Reason function returns reason value.
691func (e UpstreamBindConfigValidationError) Reason() string { return e.reason }
692
693// Cause function returns cause value.
694func (e UpstreamBindConfigValidationError) Cause() error { return e.cause }
695
696// Key function returns key value.
697func (e UpstreamBindConfigValidationError) Key() bool { return e.key }
698
699// ErrorName returns error name.
700func (e UpstreamBindConfigValidationError) ErrorName() string {
701	return "UpstreamBindConfigValidationError"
702}
703
704// Error satisfies the builtin error interface
705func (e UpstreamBindConfigValidationError) 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 %sUpstreamBindConfig.%s: %s%s",
718		key,
719		e.field,
720		e.reason,
721		cause)
722}
723
724var _ error = UpstreamBindConfigValidationError{}
725
726var _ interface {
727	Field() string
728	Reason() string
729	Key() bool
730	Cause() error
731	ErrorName() string
732} = UpstreamBindConfigValidationError{}
733
734// Validate checks the field values on UpstreamConnectionOptions with the rules
735// defined in the proto definition for this message. If any rules are
736// violated, an error is returned.
737func (m *UpstreamConnectionOptions) Validate() error {
738	if m == nil {
739		return nil
740	}
741
742	if v, ok := interface{}(m.GetTcpKeepalive()).(interface{ Validate() error }); ok {
743		if err := v.Validate(); err != nil {
744			return UpstreamConnectionOptionsValidationError{
745				field:  "TcpKeepalive",
746				reason: "embedded message failed validation",
747				cause:  err,
748			}
749		}
750	}
751
752	return nil
753}
754
755// UpstreamConnectionOptionsValidationError is the validation error returned by
756// UpstreamConnectionOptions.Validate if the designated constraints aren't met.
757type UpstreamConnectionOptionsValidationError struct {
758	field  string
759	reason string
760	cause  error
761	key    bool
762}
763
764// Field function returns field value.
765func (e UpstreamConnectionOptionsValidationError) Field() string { return e.field }
766
767// Reason function returns reason value.
768func (e UpstreamConnectionOptionsValidationError) Reason() string { return e.reason }
769
770// Cause function returns cause value.
771func (e UpstreamConnectionOptionsValidationError) Cause() error { return e.cause }
772
773// Key function returns key value.
774func (e UpstreamConnectionOptionsValidationError) Key() bool { return e.key }
775
776// ErrorName returns error name.
777func (e UpstreamConnectionOptionsValidationError) ErrorName() string {
778	return "UpstreamConnectionOptionsValidationError"
779}
780
781// Error satisfies the builtin error interface
782func (e UpstreamConnectionOptionsValidationError) Error() string {
783	cause := ""
784	if e.cause != nil {
785		cause = fmt.Sprintf(" | caused by: %v", e.cause)
786	}
787
788	key := ""
789	if e.key {
790		key = "key for "
791	}
792
793	return fmt.Sprintf(
794		"invalid %sUpstreamConnectionOptions.%s: %s%s",
795		key,
796		e.field,
797		e.reason,
798		cause)
799}
800
801var _ error = UpstreamConnectionOptionsValidationError{}
802
803var _ interface {
804	Field() string
805	Reason() string
806	Key() bool
807	Cause() error
808	ErrorName() string
809} = UpstreamConnectionOptionsValidationError{}
810
811// Validate checks the field values on Cluster_TransportSocketMatch with the
812// rules defined in the proto definition for this message. If any rules are
813// violated, an error is returned.
814func (m *Cluster_TransportSocketMatch) Validate() error {
815	if m == nil {
816		return nil
817	}
818
819	if utf8.RuneCountInString(m.GetName()) < 1 {
820		return Cluster_TransportSocketMatchValidationError{
821			field:  "Name",
822			reason: "value length must be at least 1 runes",
823		}
824	}
825
826	if v, ok := interface{}(m.GetMatch()).(interface{ Validate() error }); ok {
827		if err := v.Validate(); err != nil {
828			return Cluster_TransportSocketMatchValidationError{
829				field:  "Match",
830				reason: "embedded message failed validation",
831				cause:  err,
832			}
833		}
834	}
835
836	if v, ok := interface{}(m.GetTransportSocket()).(interface{ Validate() error }); ok {
837		if err := v.Validate(); err != nil {
838			return Cluster_TransportSocketMatchValidationError{
839				field:  "TransportSocket",
840				reason: "embedded message failed validation",
841				cause:  err,
842			}
843		}
844	}
845
846	return nil
847}
848
849// Cluster_TransportSocketMatchValidationError is the validation error returned
850// by Cluster_TransportSocketMatch.Validate if the designated constraints
851// aren't met.
852type Cluster_TransportSocketMatchValidationError struct {
853	field  string
854	reason string
855	cause  error
856	key    bool
857}
858
859// Field function returns field value.
860func (e Cluster_TransportSocketMatchValidationError) Field() string { return e.field }
861
862// Reason function returns reason value.
863func (e Cluster_TransportSocketMatchValidationError) Reason() string { return e.reason }
864
865// Cause function returns cause value.
866func (e Cluster_TransportSocketMatchValidationError) Cause() error { return e.cause }
867
868// Key function returns key value.
869func (e Cluster_TransportSocketMatchValidationError) Key() bool { return e.key }
870
871// ErrorName returns error name.
872func (e Cluster_TransportSocketMatchValidationError) ErrorName() string {
873	return "Cluster_TransportSocketMatchValidationError"
874}
875
876// Error satisfies the builtin error interface
877func (e Cluster_TransportSocketMatchValidationError) Error() string {
878	cause := ""
879	if e.cause != nil {
880		cause = fmt.Sprintf(" | caused by: %v", e.cause)
881	}
882
883	key := ""
884	if e.key {
885		key = "key for "
886	}
887
888	return fmt.Sprintf(
889		"invalid %sCluster_TransportSocketMatch.%s: %s%s",
890		key,
891		e.field,
892		e.reason,
893		cause)
894}
895
896var _ error = Cluster_TransportSocketMatchValidationError{}
897
898var _ interface {
899	Field() string
900	Reason() string
901	Key() bool
902	Cause() error
903	ErrorName() string
904} = Cluster_TransportSocketMatchValidationError{}
905
906// Validate checks the field values on Cluster_CustomClusterType with the rules
907// defined in the proto definition for this message. If any rules are
908// violated, an error is returned.
909func (m *Cluster_CustomClusterType) Validate() error {
910	if m == nil {
911		return nil
912	}
913
914	if len(m.GetName()) < 1 {
915		return Cluster_CustomClusterTypeValidationError{
916			field:  "Name",
917			reason: "value length must be at least 1 bytes",
918		}
919	}
920
921	if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok {
922		if err := v.Validate(); err != nil {
923			return Cluster_CustomClusterTypeValidationError{
924				field:  "TypedConfig",
925				reason: "embedded message failed validation",
926				cause:  err,
927			}
928		}
929	}
930
931	return nil
932}
933
934// Cluster_CustomClusterTypeValidationError is the validation error returned by
935// Cluster_CustomClusterType.Validate if the designated constraints aren't met.
936type Cluster_CustomClusterTypeValidationError struct {
937	field  string
938	reason string
939	cause  error
940	key    bool
941}
942
943// Field function returns field value.
944func (e Cluster_CustomClusterTypeValidationError) Field() string { return e.field }
945
946// Reason function returns reason value.
947func (e Cluster_CustomClusterTypeValidationError) Reason() string { return e.reason }
948
949// Cause function returns cause value.
950func (e Cluster_CustomClusterTypeValidationError) Cause() error { return e.cause }
951
952// Key function returns key value.
953func (e Cluster_CustomClusterTypeValidationError) Key() bool { return e.key }
954
955// ErrorName returns error name.
956func (e Cluster_CustomClusterTypeValidationError) ErrorName() string {
957	return "Cluster_CustomClusterTypeValidationError"
958}
959
960// Error satisfies the builtin error interface
961func (e Cluster_CustomClusterTypeValidationError) Error() string {
962	cause := ""
963	if e.cause != nil {
964		cause = fmt.Sprintf(" | caused by: %v", e.cause)
965	}
966
967	key := ""
968	if e.key {
969		key = "key for "
970	}
971
972	return fmt.Sprintf(
973		"invalid %sCluster_CustomClusterType.%s: %s%s",
974		key,
975		e.field,
976		e.reason,
977		cause)
978}
979
980var _ error = Cluster_CustomClusterTypeValidationError{}
981
982var _ interface {
983	Field() string
984	Reason() string
985	Key() bool
986	Cause() error
987	ErrorName() string
988} = Cluster_CustomClusterTypeValidationError{}
989
990// Validate checks the field values on Cluster_EdsClusterConfig with the rules
991// defined in the proto definition for this message. If any rules are
992// violated, an error is returned.
993func (m *Cluster_EdsClusterConfig) Validate() error {
994	if m == nil {
995		return nil
996	}
997
998	if v, ok := interface{}(m.GetEdsConfig()).(interface{ Validate() error }); ok {
999		if err := v.Validate(); err != nil {
1000			return Cluster_EdsClusterConfigValidationError{
1001				field:  "EdsConfig",
1002				reason: "embedded message failed validation",
1003				cause:  err,
1004			}
1005		}
1006	}
1007
1008	// no validation rules for ServiceName
1009
1010	return nil
1011}
1012
1013// Cluster_EdsClusterConfigValidationError is the validation error returned by
1014// Cluster_EdsClusterConfig.Validate if the designated constraints aren't met.
1015type Cluster_EdsClusterConfigValidationError struct {
1016	field  string
1017	reason string
1018	cause  error
1019	key    bool
1020}
1021
1022// Field function returns field value.
1023func (e Cluster_EdsClusterConfigValidationError) Field() string { return e.field }
1024
1025// Reason function returns reason value.
1026func (e Cluster_EdsClusterConfigValidationError) Reason() string { return e.reason }
1027
1028// Cause function returns cause value.
1029func (e Cluster_EdsClusterConfigValidationError) Cause() error { return e.cause }
1030
1031// Key function returns key value.
1032func (e Cluster_EdsClusterConfigValidationError) Key() bool { return e.key }
1033
1034// ErrorName returns error name.
1035func (e Cluster_EdsClusterConfigValidationError) ErrorName() string {
1036	return "Cluster_EdsClusterConfigValidationError"
1037}
1038
1039// Error satisfies the builtin error interface
1040func (e Cluster_EdsClusterConfigValidationError) Error() string {
1041	cause := ""
1042	if e.cause != nil {
1043		cause = fmt.Sprintf(" | caused by: %v", e.cause)
1044	}
1045
1046	key := ""
1047	if e.key {
1048		key = "key for "
1049	}
1050
1051	return fmt.Sprintf(
1052		"invalid %sCluster_EdsClusterConfig.%s: %s%s",
1053		key,
1054		e.field,
1055		e.reason,
1056		cause)
1057}
1058
1059var _ error = Cluster_EdsClusterConfigValidationError{}
1060
1061var _ interface {
1062	Field() string
1063	Reason() string
1064	Key() bool
1065	Cause() error
1066	ErrorName() string
1067} = Cluster_EdsClusterConfigValidationError{}
1068
1069// Validate checks the field values on Cluster_LbSubsetConfig with the rules
1070// defined in the proto definition for this message. If any rules are
1071// violated, an error is returned.
1072func (m *Cluster_LbSubsetConfig) Validate() error {
1073	if m == nil {
1074		return nil
1075	}
1076
1077	if _, ok := Cluster_LbSubsetConfig_LbSubsetFallbackPolicy_name[int32(m.GetFallbackPolicy())]; !ok {
1078		return Cluster_LbSubsetConfigValidationError{
1079			field:  "FallbackPolicy",
1080			reason: "value must be one of the defined enum values",
1081		}
1082	}
1083
1084	if v, ok := interface{}(m.GetDefaultSubset()).(interface{ Validate() error }); ok {
1085		if err := v.Validate(); err != nil {
1086			return Cluster_LbSubsetConfigValidationError{
1087				field:  "DefaultSubset",
1088				reason: "embedded message failed validation",
1089				cause:  err,
1090			}
1091		}
1092	}
1093
1094	for idx, item := range m.GetSubsetSelectors() {
1095		_, _ = idx, item
1096
1097		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
1098			if err := v.Validate(); err != nil {
1099				return Cluster_LbSubsetConfigValidationError{
1100					field:  fmt.Sprintf("SubsetSelectors[%v]", idx),
1101					reason: "embedded message failed validation",
1102					cause:  err,
1103				}
1104			}
1105		}
1106
1107	}
1108
1109	// no validation rules for LocalityWeightAware
1110
1111	// no validation rules for ScaleLocalityWeight
1112
1113	// no validation rules for PanicModeAny
1114
1115	// no validation rules for ListAsAny
1116
1117	return nil
1118}
1119
1120// Cluster_LbSubsetConfigValidationError is the validation error returned by
1121// Cluster_LbSubsetConfig.Validate if the designated constraints aren't met.
1122type Cluster_LbSubsetConfigValidationError struct {
1123	field  string
1124	reason string
1125	cause  error
1126	key    bool
1127}
1128
1129// Field function returns field value.
1130func (e Cluster_LbSubsetConfigValidationError) Field() string { return e.field }
1131
1132// Reason function returns reason value.
1133func (e Cluster_LbSubsetConfigValidationError) Reason() string { return e.reason }
1134
1135// Cause function returns cause value.
1136func (e Cluster_LbSubsetConfigValidationError) Cause() error { return e.cause }
1137
1138// Key function returns key value.
1139func (e Cluster_LbSubsetConfigValidationError) Key() bool { return e.key }
1140
1141// ErrorName returns error name.
1142func (e Cluster_LbSubsetConfigValidationError) ErrorName() string {
1143	return "Cluster_LbSubsetConfigValidationError"
1144}
1145
1146// Error satisfies the builtin error interface
1147func (e Cluster_LbSubsetConfigValidationError) Error() string {
1148	cause := ""
1149	if e.cause != nil {
1150		cause = fmt.Sprintf(" | caused by: %v", e.cause)
1151	}
1152
1153	key := ""
1154	if e.key {
1155		key = "key for "
1156	}
1157
1158	return fmt.Sprintf(
1159		"invalid %sCluster_LbSubsetConfig.%s: %s%s",
1160		key,
1161		e.field,
1162		e.reason,
1163		cause)
1164}
1165
1166var _ error = Cluster_LbSubsetConfigValidationError{}
1167
1168var _ interface {
1169	Field() string
1170	Reason() string
1171	Key() bool
1172	Cause() error
1173	ErrorName() string
1174} = Cluster_LbSubsetConfigValidationError{}
1175
1176// Validate checks the field values on Cluster_LeastRequestLbConfig with the
1177// rules defined in the proto definition for this message. If any rules are
1178// violated, an error is returned.
1179func (m *Cluster_LeastRequestLbConfig) Validate() error {
1180	if m == nil {
1181		return nil
1182	}
1183
1184	if wrapper := m.GetChoiceCount(); wrapper != nil {
1185
1186		if wrapper.GetValue() < 2 {
1187			return Cluster_LeastRequestLbConfigValidationError{
1188				field:  "ChoiceCount",
1189				reason: "value must be greater than or equal to 2",
1190			}
1191		}
1192
1193	}
1194
1195	return nil
1196}
1197
1198// Cluster_LeastRequestLbConfigValidationError is the validation error returned
1199// by Cluster_LeastRequestLbConfig.Validate if the designated constraints
1200// aren't met.
1201type Cluster_LeastRequestLbConfigValidationError struct {
1202	field  string
1203	reason string
1204	cause  error
1205	key    bool
1206}
1207
1208// Field function returns field value.
1209func (e Cluster_LeastRequestLbConfigValidationError) Field() string { return e.field }
1210
1211// Reason function returns reason value.
1212func (e Cluster_LeastRequestLbConfigValidationError) Reason() string { return e.reason }
1213
1214// Cause function returns cause value.
1215func (e Cluster_LeastRequestLbConfigValidationError) Cause() error { return e.cause }
1216
1217// Key function returns key value.
1218func (e Cluster_LeastRequestLbConfigValidationError) Key() bool { return e.key }
1219
1220// ErrorName returns error name.
1221func (e Cluster_LeastRequestLbConfigValidationError) ErrorName() string {
1222	return "Cluster_LeastRequestLbConfigValidationError"
1223}
1224
1225// Error satisfies the builtin error interface
1226func (e Cluster_LeastRequestLbConfigValidationError) Error() string {
1227	cause := ""
1228	if e.cause != nil {
1229		cause = fmt.Sprintf(" | caused by: %v", e.cause)
1230	}
1231
1232	key := ""
1233	if e.key {
1234		key = "key for "
1235	}
1236
1237	return fmt.Sprintf(
1238		"invalid %sCluster_LeastRequestLbConfig.%s: %s%s",
1239		key,
1240		e.field,
1241		e.reason,
1242		cause)
1243}
1244
1245var _ error = Cluster_LeastRequestLbConfigValidationError{}
1246
1247var _ interface {
1248	Field() string
1249	Reason() string
1250	Key() bool
1251	Cause() error
1252	ErrorName() string
1253} = Cluster_LeastRequestLbConfigValidationError{}
1254
1255// Validate checks the field values on Cluster_RingHashLbConfig with the rules
1256// defined in the proto definition for this message. If any rules are
1257// violated, an error is returned.
1258func (m *Cluster_RingHashLbConfig) Validate() error {
1259	if m == nil {
1260		return nil
1261	}
1262
1263	if wrapper := m.GetMinimumRingSize(); wrapper != nil {
1264
1265		if wrapper.GetValue() > 8388608 {
1266			return Cluster_RingHashLbConfigValidationError{
1267				field:  "MinimumRingSize",
1268				reason: "value must be less than or equal to 8388608",
1269			}
1270		}
1271
1272	}
1273
1274	if _, ok := Cluster_RingHashLbConfig_HashFunction_name[int32(m.GetHashFunction())]; !ok {
1275		return Cluster_RingHashLbConfigValidationError{
1276			field:  "HashFunction",
1277			reason: "value must be one of the defined enum values",
1278		}
1279	}
1280
1281	if wrapper := m.GetMaximumRingSize(); wrapper != nil {
1282
1283		if wrapper.GetValue() > 8388608 {
1284			return Cluster_RingHashLbConfigValidationError{
1285				field:  "MaximumRingSize",
1286				reason: "value must be less than or equal to 8388608",
1287			}
1288		}
1289
1290	}
1291
1292	return nil
1293}
1294
1295// Cluster_RingHashLbConfigValidationError is the validation error returned by
1296// Cluster_RingHashLbConfig.Validate if the designated constraints aren't met.
1297type Cluster_RingHashLbConfigValidationError struct {
1298	field  string
1299	reason string
1300	cause  error
1301	key    bool
1302}
1303
1304// Field function returns field value.
1305func (e Cluster_RingHashLbConfigValidationError) Field() string { return e.field }
1306
1307// Reason function returns reason value.
1308func (e Cluster_RingHashLbConfigValidationError) Reason() string { return e.reason }
1309
1310// Cause function returns cause value.
1311func (e Cluster_RingHashLbConfigValidationError) Cause() error { return e.cause }
1312
1313// Key function returns key value.
1314func (e Cluster_RingHashLbConfigValidationError) Key() bool { return e.key }
1315
1316// ErrorName returns error name.
1317func (e Cluster_RingHashLbConfigValidationError) ErrorName() string {
1318	return "Cluster_RingHashLbConfigValidationError"
1319}
1320
1321// Error satisfies the builtin error interface
1322func (e Cluster_RingHashLbConfigValidationError) Error() string {
1323	cause := ""
1324	if e.cause != nil {
1325		cause = fmt.Sprintf(" | caused by: %v", e.cause)
1326	}
1327
1328	key := ""
1329	if e.key {
1330		key = "key for "
1331	}
1332
1333	return fmt.Sprintf(
1334		"invalid %sCluster_RingHashLbConfig.%s: %s%s",
1335		key,
1336		e.field,
1337		e.reason,
1338		cause)
1339}
1340
1341var _ error = Cluster_RingHashLbConfigValidationError{}
1342
1343var _ interface {
1344	Field() string
1345	Reason() string
1346	Key() bool
1347	Cause() error
1348	ErrorName() string
1349} = Cluster_RingHashLbConfigValidationError{}
1350
1351// Validate checks the field values on Cluster_OriginalDstLbConfig with the
1352// rules defined in the proto definition for this message. If any rules are
1353// violated, an error is returned.
1354func (m *Cluster_OriginalDstLbConfig) Validate() error {
1355	if m == nil {
1356		return nil
1357	}
1358
1359	// no validation rules for UseHttpHeader
1360
1361	return nil
1362}
1363
1364// Cluster_OriginalDstLbConfigValidationError is the validation error returned
1365// by Cluster_OriginalDstLbConfig.Validate if the designated constraints
1366// aren't met.
1367type Cluster_OriginalDstLbConfigValidationError struct {
1368	field  string
1369	reason string
1370	cause  error
1371	key    bool
1372}
1373
1374// Field function returns field value.
1375func (e Cluster_OriginalDstLbConfigValidationError) Field() string { return e.field }
1376
1377// Reason function returns reason value.
1378func (e Cluster_OriginalDstLbConfigValidationError) Reason() string { return e.reason }
1379
1380// Cause function returns cause value.
1381func (e Cluster_OriginalDstLbConfigValidationError) Cause() error { return e.cause }
1382
1383// Key function returns key value.
1384func (e Cluster_OriginalDstLbConfigValidationError) Key() bool { return e.key }
1385
1386// ErrorName returns error name.
1387func (e Cluster_OriginalDstLbConfigValidationError) ErrorName() string {
1388	return "Cluster_OriginalDstLbConfigValidationError"
1389}
1390
1391// Error satisfies the builtin error interface
1392func (e Cluster_OriginalDstLbConfigValidationError) Error() string {
1393	cause := ""
1394	if e.cause != nil {
1395		cause = fmt.Sprintf(" | caused by: %v", e.cause)
1396	}
1397
1398	key := ""
1399	if e.key {
1400		key = "key for "
1401	}
1402
1403	return fmt.Sprintf(
1404		"invalid %sCluster_OriginalDstLbConfig.%s: %s%s",
1405		key,
1406		e.field,
1407		e.reason,
1408		cause)
1409}
1410
1411var _ error = Cluster_OriginalDstLbConfigValidationError{}
1412
1413var _ interface {
1414	Field() string
1415	Reason() string
1416	Key() bool
1417	Cause() error
1418	ErrorName() string
1419} = Cluster_OriginalDstLbConfigValidationError{}
1420
1421// Validate checks the field values on Cluster_CommonLbConfig with the rules
1422// defined in the proto definition for this message. If any rules are
1423// violated, an error is returned.
1424func (m *Cluster_CommonLbConfig) Validate() error {
1425	if m == nil {
1426		return nil
1427	}
1428
1429	if v, ok := interface{}(m.GetHealthyPanicThreshold()).(interface{ Validate() error }); ok {
1430		if err := v.Validate(); err != nil {
1431			return Cluster_CommonLbConfigValidationError{
1432				field:  "HealthyPanicThreshold",
1433				reason: "embedded message failed validation",
1434				cause:  err,
1435			}
1436		}
1437	}
1438
1439	if v, ok := interface{}(m.GetUpdateMergeWindow()).(interface{ Validate() error }); ok {
1440		if err := v.Validate(); err != nil {
1441			return Cluster_CommonLbConfigValidationError{
1442				field:  "UpdateMergeWindow",
1443				reason: "embedded message failed validation",
1444				cause:  err,
1445			}
1446		}
1447	}
1448
1449	// no validation rules for IgnoreNewHostsUntilFirstHc
1450
1451	// no validation rules for CloseConnectionsOnHostSetChange
1452
1453	switch m.LocalityConfigSpecifier.(type) {
1454
1455	case *Cluster_CommonLbConfig_ZoneAwareLbConfig_:
1456
1457		if v, ok := interface{}(m.GetZoneAwareLbConfig()).(interface{ Validate() error }); ok {
1458			if err := v.Validate(); err != nil {
1459				return Cluster_CommonLbConfigValidationError{
1460					field:  "ZoneAwareLbConfig",
1461					reason: "embedded message failed validation",
1462					cause:  err,
1463				}
1464			}
1465		}
1466
1467	case *Cluster_CommonLbConfig_LocalityWeightedLbConfig_:
1468
1469		if v, ok := interface{}(m.GetLocalityWeightedLbConfig()).(interface{ Validate() error }); ok {
1470			if err := v.Validate(); err != nil {
1471				return Cluster_CommonLbConfigValidationError{
1472					field:  "LocalityWeightedLbConfig",
1473					reason: "embedded message failed validation",
1474					cause:  err,
1475				}
1476			}
1477		}
1478
1479	}
1480
1481	return nil
1482}
1483
1484// Cluster_CommonLbConfigValidationError is the validation error returned by
1485// Cluster_CommonLbConfig.Validate if the designated constraints aren't met.
1486type Cluster_CommonLbConfigValidationError struct {
1487	field  string
1488	reason string
1489	cause  error
1490	key    bool
1491}
1492
1493// Field function returns field value.
1494func (e Cluster_CommonLbConfigValidationError) Field() string { return e.field }
1495
1496// Reason function returns reason value.
1497func (e Cluster_CommonLbConfigValidationError) Reason() string { return e.reason }
1498
1499// Cause function returns cause value.
1500func (e Cluster_CommonLbConfigValidationError) Cause() error { return e.cause }
1501
1502// Key function returns key value.
1503func (e Cluster_CommonLbConfigValidationError) Key() bool { return e.key }
1504
1505// ErrorName returns error name.
1506func (e Cluster_CommonLbConfigValidationError) ErrorName() string {
1507	return "Cluster_CommonLbConfigValidationError"
1508}
1509
1510// Error satisfies the builtin error interface
1511func (e Cluster_CommonLbConfigValidationError) Error() string {
1512	cause := ""
1513	if e.cause != nil {
1514		cause = fmt.Sprintf(" | caused by: %v", e.cause)
1515	}
1516
1517	key := ""
1518	if e.key {
1519		key = "key for "
1520	}
1521
1522	return fmt.Sprintf(
1523		"invalid %sCluster_CommonLbConfig.%s: %s%s",
1524		key,
1525		e.field,
1526		e.reason,
1527		cause)
1528}
1529
1530var _ error = Cluster_CommonLbConfigValidationError{}
1531
1532var _ interface {
1533	Field() string
1534	Reason() string
1535	Key() bool
1536	Cause() error
1537	ErrorName() string
1538} = Cluster_CommonLbConfigValidationError{}
1539
1540// Validate checks the field values on Cluster_RefreshRate with the rules
1541// defined in the proto definition for this message. If any rules are
1542// violated, an error is returned.
1543func (m *Cluster_RefreshRate) Validate() error {
1544	if m == nil {
1545		return nil
1546	}
1547
1548	if m.GetBaseInterval() == nil {
1549		return Cluster_RefreshRateValidationError{
1550			field:  "BaseInterval",
1551			reason: "value is required",
1552		}
1553	}
1554
1555	if d := m.GetBaseInterval(); d != nil {
1556		dur, err := ptypes.Duration(d)
1557		if err != nil {
1558			return Cluster_RefreshRateValidationError{
1559				field:  "BaseInterval",
1560				reason: "value is not a valid duration",
1561				cause:  err,
1562			}
1563		}
1564
1565		gt := time.Duration(0*time.Second + 1000000*time.Nanosecond)
1566
1567		if dur <= gt {
1568			return Cluster_RefreshRateValidationError{
1569				field:  "BaseInterval",
1570				reason: "value must be greater than 1ms",
1571			}
1572		}
1573
1574	}
1575
1576	if d := m.GetMaxInterval(); d != nil {
1577		dur, err := ptypes.Duration(d)
1578		if err != nil {
1579			return Cluster_RefreshRateValidationError{
1580				field:  "MaxInterval",
1581				reason: "value is not a valid duration",
1582				cause:  err,
1583			}
1584		}
1585
1586		gt := time.Duration(0*time.Second + 1000000*time.Nanosecond)
1587
1588		if dur <= gt {
1589			return Cluster_RefreshRateValidationError{
1590				field:  "MaxInterval",
1591				reason: "value must be greater than 1ms",
1592			}
1593		}
1594
1595	}
1596
1597	return nil
1598}
1599
1600// Cluster_RefreshRateValidationError is the validation error returned by
1601// Cluster_RefreshRate.Validate if the designated constraints aren't met.
1602type Cluster_RefreshRateValidationError struct {
1603	field  string
1604	reason string
1605	cause  error
1606	key    bool
1607}
1608
1609// Field function returns field value.
1610func (e Cluster_RefreshRateValidationError) Field() string { return e.field }
1611
1612// Reason function returns reason value.
1613func (e Cluster_RefreshRateValidationError) Reason() string { return e.reason }
1614
1615// Cause function returns cause value.
1616func (e Cluster_RefreshRateValidationError) Cause() error { return e.cause }
1617
1618// Key function returns key value.
1619func (e Cluster_RefreshRateValidationError) Key() bool { return e.key }
1620
1621// ErrorName returns error name.
1622func (e Cluster_RefreshRateValidationError) ErrorName() string {
1623	return "Cluster_RefreshRateValidationError"
1624}
1625
1626// Error satisfies the builtin error interface
1627func (e Cluster_RefreshRateValidationError) Error() string {
1628	cause := ""
1629	if e.cause != nil {
1630		cause = fmt.Sprintf(" | caused by: %v", e.cause)
1631	}
1632
1633	key := ""
1634	if e.key {
1635		key = "key for "
1636	}
1637
1638	return fmt.Sprintf(
1639		"invalid %sCluster_RefreshRate.%s: %s%s",
1640		key,
1641		e.field,
1642		e.reason,
1643		cause)
1644}
1645
1646var _ error = Cluster_RefreshRateValidationError{}
1647
1648var _ interface {
1649	Field() string
1650	Reason() string
1651	Key() bool
1652	Cause() error
1653	ErrorName() string
1654} = Cluster_RefreshRateValidationError{}
1655
1656// Validate checks the field values on Cluster_LbSubsetConfig_LbSubsetSelector
1657// with the rules defined in the proto definition for this message. If any
1658// rules are violated, an error is returned.
1659func (m *Cluster_LbSubsetConfig_LbSubsetSelector) Validate() error {
1660	if m == nil {
1661		return nil
1662	}
1663
1664	if _, ok := Cluster_LbSubsetConfig_LbSubsetSelector_LbSubsetSelectorFallbackPolicy_name[int32(m.GetFallbackPolicy())]; !ok {
1665		return Cluster_LbSubsetConfig_LbSubsetSelectorValidationError{
1666			field:  "FallbackPolicy",
1667			reason: "value must be one of the defined enum values",
1668		}
1669	}
1670
1671	return nil
1672}
1673
1674// Cluster_LbSubsetConfig_LbSubsetSelectorValidationError is the validation
1675// error returned by Cluster_LbSubsetConfig_LbSubsetSelector.Validate if the
1676// designated constraints aren't met.
1677type Cluster_LbSubsetConfig_LbSubsetSelectorValidationError struct {
1678	field  string
1679	reason string
1680	cause  error
1681	key    bool
1682}
1683
1684// Field function returns field value.
1685func (e Cluster_LbSubsetConfig_LbSubsetSelectorValidationError) Field() string { return e.field }
1686
1687// Reason function returns reason value.
1688func (e Cluster_LbSubsetConfig_LbSubsetSelectorValidationError) Reason() string { return e.reason }
1689
1690// Cause function returns cause value.
1691func (e Cluster_LbSubsetConfig_LbSubsetSelectorValidationError) Cause() error { return e.cause }
1692
1693// Key function returns key value.
1694func (e Cluster_LbSubsetConfig_LbSubsetSelectorValidationError) Key() bool { return e.key }
1695
1696// ErrorName returns error name.
1697func (e Cluster_LbSubsetConfig_LbSubsetSelectorValidationError) ErrorName() string {
1698	return "Cluster_LbSubsetConfig_LbSubsetSelectorValidationError"
1699}
1700
1701// Error satisfies the builtin error interface
1702func (e Cluster_LbSubsetConfig_LbSubsetSelectorValidationError) Error() string {
1703	cause := ""
1704	if e.cause != nil {
1705		cause = fmt.Sprintf(" | caused by: %v", e.cause)
1706	}
1707
1708	key := ""
1709	if e.key {
1710		key = "key for "
1711	}
1712
1713	return fmt.Sprintf(
1714		"invalid %sCluster_LbSubsetConfig_LbSubsetSelector.%s: %s%s",
1715		key,
1716		e.field,
1717		e.reason,
1718		cause)
1719}
1720
1721var _ error = Cluster_LbSubsetConfig_LbSubsetSelectorValidationError{}
1722
1723var _ interface {
1724	Field() string
1725	Reason() string
1726	Key() bool
1727	Cause() error
1728	ErrorName() string
1729} = Cluster_LbSubsetConfig_LbSubsetSelectorValidationError{}
1730
1731// Validate checks the field values on Cluster_CommonLbConfig_ZoneAwareLbConfig
1732// with the rules defined in the proto definition for this message. If any
1733// rules are violated, an error is returned.
1734func (m *Cluster_CommonLbConfig_ZoneAwareLbConfig) Validate() error {
1735	if m == nil {
1736		return nil
1737	}
1738
1739	if v, ok := interface{}(m.GetRoutingEnabled()).(interface{ Validate() error }); ok {
1740		if err := v.Validate(); err != nil {
1741			return Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError{
1742				field:  "RoutingEnabled",
1743				reason: "embedded message failed validation",
1744				cause:  err,
1745			}
1746		}
1747	}
1748
1749	if v, ok := interface{}(m.GetMinClusterSize()).(interface{ Validate() error }); ok {
1750		if err := v.Validate(); err != nil {
1751			return Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError{
1752				field:  "MinClusterSize",
1753				reason: "embedded message failed validation",
1754				cause:  err,
1755			}
1756		}
1757	}
1758
1759	// no validation rules for FailTrafficOnPanic
1760
1761	return nil
1762}
1763
1764// Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError is the validation
1765// error returned by Cluster_CommonLbConfig_ZoneAwareLbConfig.Validate if the
1766// designated constraints aren't met.
1767type Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError struct {
1768	field  string
1769	reason string
1770	cause  error
1771	key    bool
1772}
1773
1774// Field function returns field value.
1775func (e Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError) Field() string { return e.field }
1776
1777// Reason function returns reason value.
1778func (e Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError) Reason() string { return e.reason }
1779
1780// Cause function returns cause value.
1781func (e Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError) Cause() error { return e.cause }
1782
1783// Key function returns key value.
1784func (e Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError) Key() bool { return e.key }
1785
1786// ErrorName returns error name.
1787func (e Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError) ErrorName() string {
1788	return "Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError"
1789}
1790
1791// Error satisfies the builtin error interface
1792func (e Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError) Error() string {
1793	cause := ""
1794	if e.cause != nil {
1795		cause = fmt.Sprintf(" | caused by: %v", e.cause)
1796	}
1797
1798	key := ""
1799	if e.key {
1800		key = "key for "
1801	}
1802
1803	return fmt.Sprintf(
1804		"invalid %sCluster_CommonLbConfig_ZoneAwareLbConfig.%s: %s%s",
1805		key,
1806		e.field,
1807		e.reason,
1808		cause)
1809}
1810
1811var _ error = Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError{}
1812
1813var _ interface {
1814	Field() string
1815	Reason() string
1816	Key() bool
1817	Cause() error
1818	ErrorName() string
1819} = Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError{}
1820
1821// Validate checks the field values on
1822// Cluster_CommonLbConfig_LocalityWeightedLbConfig with the rules defined in
1823// the proto definition for this message. If any rules are violated, an error
1824// is returned.
1825func (m *Cluster_CommonLbConfig_LocalityWeightedLbConfig) Validate() error {
1826	if m == nil {
1827		return nil
1828	}
1829
1830	return nil
1831}
1832
1833// Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError is the
1834// validation error returned by
1835// Cluster_CommonLbConfig_LocalityWeightedLbConfig.Validate if the designated
1836// constraints aren't met.
1837type Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError struct {
1838	field  string
1839	reason string
1840	cause  error
1841	key    bool
1842}
1843
1844// Field function returns field value.
1845func (e Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError) Field() string { return e.field }
1846
1847// Reason function returns reason value.
1848func (e Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError) Reason() string {
1849	return e.reason
1850}
1851
1852// Cause function returns cause value.
1853func (e Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError) Cause() error { return e.cause }
1854
1855// Key function returns key value.
1856func (e Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError) Key() bool { return e.key }
1857
1858// ErrorName returns error name.
1859func (e Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError) ErrorName() string {
1860	return "Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError"
1861}
1862
1863// Error satisfies the builtin error interface
1864func (e Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError) Error() string {
1865	cause := ""
1866	if e.cause != nil {
1867		cause = fmt.Sprintf(" | caused by: %v", e.cause)
1868	}
1869
1870	key := ""
1871	if e.key {
1872		key = "key for "
1873	}
1874
1875	return fmt.Sprintf(
1876		"invalid %sCluster_CommonLbConfig_LocalityWeightedLbConfig.%s: %s%s",
1877		key,
1878		e.field,
1879		e.reason,
1880		cause)
1881}
1882
1883var _ error = Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError{}
1884
1885var _ interface {
1886	Field() string
1887	Reason() string
1888	Key() bool
1889	Cause() error
1890	ErrorName() string
1891} = Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError{}
1892
1893// Validate checks the field values on LoadBalancingPolicy_Policy with the
1894// rules defined in the proto definition for this message. If any rules are
1895// violated, an error is returned.
1896func (m *LoadBalancingPolicy_Policy) Validate() error {
1897	if m == nil {
1898		return nil
1899	}
1900
1901	// no validation rules for Name
1902
1903	if v, ok := interface{}(m.GetHiddenEnvoyDeprecatedConfig()).(interface{ Validate() error }); ok {
1904		if err := v.Validate(); err != nil {
1905			return LoadBalancingPolicy_PolicyValidationError{
1906				field:  "HiddenEnvoyDeprecatedConfig",
1907				reason: "embedded message failed validation",
1908				cause:  err,
1909			}
1910		}
1911	}
1912
1913	if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok {
1914		if err := v.Validate(); err != nil {
1915			return LoadBalancingPolicy_PolicyValidationError{
1916				field:  "TypedConfig",
1917				reason: "embedded message failed validation",
1918				cause:  err,
1919			}
1920		}
1921	}
1922
1923	return nil
1924}
1925
1926// LoadBalancingPolicy_PolicyValidationError is the validation error returned
1927// by LoadBalancingPolicy_Policy.Validate if the designated constraints aren't met.
1928type LoadBalancingPolicy_PolicyValidationError struct {
1929	field  string
1930	reason string
1931	cause  error
1932	key    bool
1933}
1934
1935// Field function returns field value.
1936func (e LoadBalancingPolicy_PolicyValidationError) Field() string { return e.field }
1937
1938// Reason function returns reason value.
1939func (e LoadBalancingPolicy_PolicyValidationError) Reason() string { return e.reason }
1940
1941// Cause function returns cause value.
1942func (e LoadBalancingPolicy_PolicyValidationError) Cause() error { return e.cause }
1943
1944// Key function returns key value.
1945func (e LoadBalancingPolicy_PolicyValidationError) Key() bool { return e.key }
1946
1947// ErrorName returns error name.
1948func (e LoadBalancingPolicy_PolicyValidationError) ErrorName() string {
1949	return "LoadBalancingPolicy_PolicyValidationError"
1950}
1951
1952// Error satisfies the builtin error interface
1953func (e LoadBalancingPolicy_PolicyValidationError) Error() string {
1954	cause := ""
1955	if e.cause != nil {
1956		cause = fmt.Sprintf(" | caused by: %v", e.cause)
1957	}
1958
1959	key := ""
1960	if e.key {
1961		key = "key for "
1962	}
1963
1964	return fmt.Sprintf(
1965		"invalid %sLoadBalancingPolicy_Policy.%s: %s%s",
1966		key,
1967		e.field,
1968		e.reason,
1969		cause)
1970}
1971
1972var _ error = LoadBalancingPolicy_PolicyValidationError{}
1973
1974var _ interface {
1975	Field() string
1976	Reason() string
1977	Key() bool
1978	Cause() error
1979	ErrorName() string
1980} = LoadBalancingPolicy_PolicyValidationError{}
1981