Passed
Push — master ( 496048...563bb3 )
by Tolga
01:01 queued 13s
created

basev1.PartialsValidationError.Error   A

Complexity

Conditions 3

Size

Total Lines 17
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 13
nop 0
dl 0
loc 17
rs 9.75
c 0
b 0
f 0
1
// Code generated by protoc-gen-validate. DO NOT EDIT.
2
// source: base/v1/base.proto
3
4
package basev1
5
6
import (
7
	"bytes"
8
	"errors"
9
	"fmt"
10
	"net"
11
	"net/mail"
12
	"net/url"
13
	"regexp"
14
	"sort"
15
	"strings"
16
	"time"
17
	"unicode/utf8"
18
19
	"google.golang.org/protobuf/types/known/anypb"
20
)
21
22
// ensure the imports are used
23
var (
24
	_ = bytes.MinRead
25
	_ = errors.New("")
26
	_ = fmt.Print
27
	_ = utf8.UTFMax
28
	_ = (*regexp.Regexp)(nil)
29
	_ = (*strings.Reader)(nil)
30
	_ = net.IPv4len
31
	_ = time.Duration(0)
32
	_ = (*url.URL)(nil)
33
	_ = (*mail.Address)(nil)
34
	_ = anypb.Any{}
35
	_ = sort.Sort
36
)
37
38
// Validate checks the field values on Context with the rules defined in the
39
// proto definition for this message. If any rules are violated, the first
40
// error encountered is returned, or nil if there are no violations.
41
func (m *Context) Validate() error {
42
	return m.validate(false)
43
}
44
45
// ValidateAll checks the field values on Context with the rules defined in the
46
// proto definition for this message. If any rules are violated, the result is
47
// a list of violation errors wrapped in ContextMultiError, or nil if none found.
48
func (m *Context) ValidateAll() error {
49
	return m.validate(true)
50
}
51
52
func (m *Context) validate(all bool) error {
53
	if m == nil {
54
		return nil
55
	}
56
57
	var errors []error
58
59
	for idx, item := range m.GetTuples() {
60
		_, _ = idx, item
61
62
		if all {
63
			switch v := interface{}(item).(type) {
64
			case interface{ ValidateAll() error }:
65
				if err := v.ValidateAll(); err != nil {
66
					errors = append(errors, ContextValidationError{
67
						field:  fmt.Sprintf("Tuples[%v]", idx),
68
						reason: "embedded message failed validation",
69
						cause:  err,
70
					})
71
				}
72
			case interface{ Validate() error }:
73
				if err := v.Validate(); err != nil {
74
					errors = append(errors, ContextValidationError{
75
						field:  fmt.Sprintf("Tuples[%v]", idx),
76
						reason: "embedded message failed validation",
77
						cause:  err,
78
					})
79
				}
80
			}
81
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
82
			if err := v.Validate(); err != nil {
83
				return ContextValidationError{
84
					field:  fmt.Sprintf("Tuples[%v]", idx),
85
					reason: "embedded message failed validation",
86
					cause:  err,
87
				}
88
			}
89
		}
90
91
	}
92
93
	for idx, item := range m.GetAttributes() {
94
		_, _ = idx, item
95
96
		if all {
97
			switch v := interface{}(item).(type) {
98
			case interface{ ValidateAll() error }:
99
				if err := v.ValidateAll(); err != nil {
100
					errors = append(errors, ContextValidationError{
101
						field:  fmt.Sprintf("Attributes[%v]", idx),
102
						reason: "embedded message failed validation",
103
						cause:  err,
104
					})
105
				}
106
			case interface{ Validate() error }:
107
				if err := v.Validate(); err != nil {
108
					errors = append(errors, ContextValidationError{
109
						field:  fmt.Sprintf("Attributes[%v]", idx),
110
						reason: "embedded message failed validation",
111
						cause:  err,
112
					})
113
				}
114
			}
115
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
116
			if err := v.Validate(); err != nil {
117
				return ContextValidationError{
118
					field:  fmt.Sprintf("Attributes[%v]", idx),
119
					reason: "embedded message failed validation",
120
					cause:  err,
121
				}
122
			}
123
		}
124
125
	}
126
127
	if all {
128
		switch v := interface{}(m.GetData()).(type) {
129
		case interface{ ValidateAll() error }:
130
			if err := v.ValidateAll(); err != nil {
131
				errors = append(errors, ContextValidationError{
132
					field:  "Data",
133
					reason: "embedded message failed validation",
134
					cause:  err,
135
				})
136
			}
137
		case interface{ Validate() error }:
138
			if err := v.Validate(); err != nil {
139
				errors = append(errors, ContextValidationError{
140
					field:  "Data",
141
					reason: "embedded message failed validation",
142
					cause:  err,
143
				})
144
			}
145
		}
146
	} else if v, ok := interface{}(m.GetData()).(interface{ Validate() error }); ok {
147
		if err := v.Validate(); err != nil {
148
			return ContextValidationError{
149
				field:  "Data",
150
				reason: "embedded message failed validation",
151
				cause:  err,
152
			}
153
		}
154
	}
155
156
	if len(errors) > 0 {
157
		return ContextMultiError(errors)
158
	}
159
160
	return nil
161
}
162
163
// ContextMultiError is an error wrapping multiple validation errors returned
164
// by Context.ValidateAll() if the designated constraints aren't met.
165
type ContextMultiError []error
166
167
// Error returns a concatenation of all the error messages it wraps.
168
func (m ContextMultiError) Error() string {
169
	var msgs []string
170
	for _, err := range m {
171
		msgs = append(msgs, err.Error())
172
	}
173
	return strings.Join(msgs, "; ")
174
}
175
176
// AllErrors returns a list of validation violation errors.
177
func (m ContextMultiError) AllErrors() []error { return m }
178
179
// ContextValidationError is the validation error returned by Context.Validate
180
// if the designated constraints aren't met.
181
type ContextValidationError struct {
182
	field  string
183
	reason string
184
	cause  error
185
	key    bool
186
}
187
188
// Field function returns field value.
189
func (e ContextValidationError) Field() string { return e.field }
190
191
// Reason function returns reason value.
192
func (e ContextValidationError) Reason() string { return e.reason }
193
194
// Cause function returns cause value.
195
func (e ContextValidationError) Cause() error { return e.cause }
196
197
// Key function returns key value.
198
func (e ContextValidationError) Key() bool { return e.key }
199
200
// ErrorName returns error name.
201
func (e ContextValidationError) ErrorName() string { return "ContextValidationError" }
202
203
// Error satisfies the builtin error interface
204
func (e ContextValidationError) Error() string {
205
	cause := ""
206
	if e.cause != nil {
207
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
208
	}
209
210
	key := ""
211
	if e.key {
212
		key = "key for "
213
	}
214
215
	return fmt.Sprintf(
216
		"invalid %sContext.%s: %s%s",
217
		key,
218
		e.field,
219
		e.reason,
220
		cause)
221
}
222
223
var _ error = ContextValidationError{}
224
225
var _ interface {
226
	Field() string
227
	Reason() string
228
	Key() bool
229
	Cause() error
230
	ErrorName() string
231
} = ContextValidationError{}
232
233
// Validate checks the field values on Child with the rules defined in the
234
// proto definition for this message. If any rules are violated, the first
235
// error encountered is returned, or nil if there are no violations.
236
func (m *Child) Validate() error {
237
	return m.validate(false)
238
}
239
240
// ValidateAll checks the field values on Child with the rules defined in the
241
// proto definition for this message. If any rules are violated, the result is
242
// a list of violation errors wrapped in ChildMultiError, or nil if none found.
243
func (m *Child) ValidateAll() error {
244
	return m.validate(true)
245
}
246
247
func (m *Child) validate(all bool) error {
248
	if m == nil {
249
		return nil
250
	}
251
252
	var errors []error
253
254
	oneofTypePresent := false
255
	switch v := m.Type.(type) {
256
	case *Child_Leaf:
257
		if v == nil {
258
			err := ChildValidationError{
259
				field:  "Type",
260
				reason: "oneof value cannot be a typed-nil",
261
			}
262
			if !all {
263
				return err
264
			}
265
			errors = append(errors, err)
266
		}
267
		oneofTypePresent = true
268
269
		if m.GetLeaf() == nil {
270
			err := ChildValidationError{
271
				field:  "Leaf",
272
				reason: "value is required",
273
			}
274
			if !all {
275
				return err
276
			}
277
			errors = append(errors, err)
278
		}
279
280
		if all {
281
			switch v := interface{}(m.GetLeaf()).(type) {
282
			case interface{ ValidateAll() error }:
283
				if err := v.ValidateAll(); err != nil {
284
					errors = append(errors, ChildValidationError{
285
						field:  "Leaf",
286
						reason: "embedded message failed validation",
287
						cause:  err,
288
					})
289
				}
290
			case interface{ Validate() error }:
291
				if err := v.Validate(); err != nil {
292
					errors = append(errors, ChildValidationError{
293
						field:  "Leaf",
294
						reason: "embedded message failed validation",
295
						cause:  err,
296
					})
297
				}
298
			}
299
		} else if v, ok := interface{}(m.GetLeaf()).(interface{ Validate() error }); ok {
300
			if err := v.Validate(); err != nil {
301
				return ChildValidationError{
302
					field:  "Leaf",
303
					reason: "embedded message failed validation",
304
					cause:  err,
305
				}
306
			}
307
		}
308
309
	case *Child_Rewrite:
310
		if v == nil {
311
			err := ChildValidationError{
312
				field:  "Type",
313
				reason: "oneof value cannot be a typed-nil",
314
			}
315
			if !all {
316
				return err
317
			}
318
			errors = append(errors, err)
319
		}
320
		oneofTypePresent = true
321
322
		if m.GetRewrite() == nil {
323
			err := ChildValidationError{
324
				field:  "Rewrite",
325
				reason: "value is required",
326
			}
327
			if !all {
328
				return err
329
			}
330
			errors = append(errors, err)
331
		}
332
333
		if all {
334
			switch v := interface{}(m.GetRewrite()).(type) {
335
			case interface{ ValidateAll() error }:
336
				if err := v.ValidateAll(); err != nil {
337
					errors = append(errors, ChildValidationError{
338
						field:  "Rewrite",
339
						reason: "embedded message failed validation",
340
						cause:  err,
341
					})
342
				}
343
			case interface{ Validate() error }:
344
				if err := v.Validate(); err != nil {
345
					errors = append(errors, ChildValidationError{
346
						field:  "Rewrite",
347
						reason: "embedded message failed validation",
348
						cause:  err,
349
					})
350
				}
351
			}
352
		} else if v, ok := interface{}(m.GetRewrite()).(interface{ Validate() error }); ok {
353
			if err := v.Validate(); err != nil {
354
				return ChildValidationError{
355
					field:  "Rewrite",
356
					reason: "embedded message failed validation",
357
					cause:  err,
358
				}
359
			}
360
		}
361
362
	default:
363
		_ = v // ensures v is used
364
	}
365
	if !oneofTypePresent {
366
		err := ChildValidationError{
367
			field:  "Type",
368
			reason: "value is required",
369
		}
370
		if !all {
371
			return err
372
		}
373
		errors = append(errors, err)
374
	}
375
376
	if len(errors) > 0 {
377
		return ChildMultiError(errors)
378
	}
379
380
	return nil
381
}
382
383
// ChildMultiError is an error wrapping multiple validation errors returned by
384
// Child.ValidateAll() if the designated constraints aren't met.
385
type ChildMultiError []error
386
387
// Error returns a concatenation of all the error messages it wraps.
388
func (m ChildMultiError) Error() string {
389
	var msgs []string
390
	for _, err := range m {
391
		msgs = append(msgs, err.Error())
392
	}
393
	return strings.Join(msgs, "; ")
394
}
395
396
// AllErrors returns a list of validation violation errors.
397
func (m ChildMultiError) AllErrors() []error { return m }
398
399
// ChildValidationError is the validation error returned by Child.Validate if
400
// the designated constraints aren't met.
401
type ChildValidationError struct {
402
	field  string
403
	reason string
404
	cause  error
405
	key    bool
406
}
407
408
// Field function returns field value.
409
func (e ChildValidationError) Field() string { return e.field }
410
411
// Reason function returns reason value.
412
func (e ChildValidationError) Reason() string { return e.reason }
413
414
// Cause function returns cause value.
415
func (e ChildValidationError) Cause() error { return e.cause }
416
417
// Key function returns key value.
418
func (e ChildValidationError) Key() bool { return e.key }
419
420
// ErrorName returns error name.
421
func (e ChildValidationError) ErrorName() string { return "ChildValidationError" }
422
423
// Error satisfies the builtin error interface
424
func (e ChildValidationError) Error() string {
425
	cause := ""
426
	if e.cause != nil {
427
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
428
	}
429
430
	key := ""
431
	if e.key {
432
		key = "key for "
433
	}
434
435
	return fmt.Sprintf(
436
		"invalid %sChild.%s: %s%s",
437
		key,
438
		e.field,
439
		e.reason,
440
		cause)
441
}
442
443
var _ error = ChildValidationError{}
444
445
var _ interface {
446
	Field() string
447
	Reason() string
448
	Key() bool
449
	Cause() error
450
	ErrorName() string
451
} = ChildValidationError{}
452
453
// Validate checks the field values on Leaf with the rules defined in the proto
454
// definition for this message. If any rules are violated, the first error
455
// encountered is returned, or nil if there are no violations.
456
func (m *Leaf) Validate() error {
457
	return m.validate(false)
458
}
459
460
// ValidateAll checks the field values on Leaf with the rules defined in the
461
// proto definition for this message. If any rules are violated, the result is
462
// a list of violation errors wrapped in LeafMultiError, or nil if none found.
463
func (m *Leaf) ValidateAll() error {
464
	return m.validate(true)
465
}
466
467
func (m *Leaf) validate(all bool) error {
468
	if m == nil {
469
		return nil
470
	}
471
472
	var errors []error
473
474
	oneofTypePresent := false
475
	switch v := m.Type.(type) {
476
	case *Leaf_ComputedUserSet:
477
		if v == nil {
478
			err := LeafValidationError{
479
				field:  "Type",
480
				reason: "oneof value cannot be a typed-nil",
481
			}
482
			if !all {
483
				return err
484
			}
485
			errors = append(errors, err)
486
		}
487
		oneofTypePresent = true
488
489
		if m.GetComputedUserSet() == nil {
490
			err := LeafValidationError{
491
				field:  "ComputedUserSet",
492
				reason: "value is required",
493
			}
494
			if !all {
495
				return err
496
			}
497
			errors = append(errors, err)
498
		}
499
500
		if all {
501
			switch v := interface{}(m.GetComputedUserSet()).(type) {
502
			case interface{ ValidateAll() error }:
503
				if err := v.ValidateAll(); err != nil {
504
					errors = append(errors, LeafValidationError{
505
						field:  "ComputedUserSet",
506
						reason: "embedded message failed validation",
507
						cause:  err,
508
					})
509
				}
510
			case interface{ Validate() error }:
511
				if err := v.Validate(); err != nil {
512
					errors = append(errors, LeafValidationError{
513
						field:  "ComputedUserSet",
514
						reason: "embedded message failed validation",
515
						cause:  err,
516
					})
517
				}
518
			}
519
		} else if v, ok := interface{}(m.GetComputedUserSet()).(interface{ Validate() error }); ok {
520
			if err := v.Validate(); err != nil {
521
				return LeafValidationError{
522
					field:  "ComputedUserSet",
523
					reason: "embedded message failed validation",
524
					cause:  err,
525
				}
526
			}
527
		}
528
529
	case *Leaf_TupleToUserSet:
530
		if v == nil {
531
			err := LeafValidationError{
532
				field:  "Type",
533
				reason: "oneof value cannot be a typed-nil",
534
			}
535
			if !all {
536
				return err
537
			}
538
			errors = append(errors, err)
539
		}
540
		oneofTypePresent = true
541
542
		if m.GetTupleToUserSet() == nil {
543
			err := LeafValidationError{
544
				field:  "TupleToUserSet",
545
				reason: "value is required",
546
			}
547
			if !all {
548
				return err
549
			}
550
			errors = append(errors, err)
551
		}
552
553
		if all {
554
			switch v := interface{}(m.GetTupleToUserSet()).(type) {
555
			case interface{ ValidateAll() error }:
556
				if err := v.ValidateAll(); err != nil {
557
					errors = append(errors, LeafValidationError{
558
						field:  "TupleToUserSet",
559
						reason: "embedded message failed validation",
560
						cause:  err,
561
					})
562
				}
563
			case interface{ Validate() error }:
564
				if err := v.Validate(); err != nil {
565
					errors = append(errors, LeafValidationError{
566
						field:  "TupleToUserSet",
567
						reason: "embedded message failed validation",
568
						cause:  err,
569
					})
570
				}
571
			}
572
		} else if v, ok := interface{}(m.GetTupleToUserSet()).(interface{ Validate() error }); ok {
573
			if err := v.Validate(); err != nil {
574
				return LeafValidationError{
575
					field:  "TupleToUserSet",
576
					reason: "embedded message failed validation",
577
					cause:  err,
578
				}
579
			}
580
		}
581
582
	case *Leaf_ComputedAttribute:
583
		if v == nil {
584
			err := LeafValidationError{
585
				field:  "Type",
586
				reason: "oneof value cannot be a typed-nil",
587
			}
588
			if !all {
589
				return err
590
			}
591
			errors = append(errors, err)
592
		}
593
		oneofTypePresent = true
594
595
		if m.GetComputedAttribute() == nil {
596
			err := LeafValidationError{
597
				field:  "ComputedAttribute",
598
				reason: "value is required",
599
			}
600
			if !all {
601
				return err
602
			}
603
			errors = append(errors, err)
604
		}
605
606
		if all {
607
			switch v := interface{}(m.GetComputedAttribute()).(type) {
608
			case interface{ ValidateAll() error }:
609
				if err := v.ValidateAll(); err != nil {
610
					errors = append(errors, LeafValidationError{
611
						field:  "ComputedAttribute",
612
						reason: "embedded message failed validation",
613
						cause:  err,
614
					})
615
				}
616
			case interface{ Validate() error }:
617
				if err := v.Validate(); err != nil {
618
					errors = append(errors, LeafValidationError{
619
						field:  "ComputedAttribute",
620
						reason: "embedded message failed validation",
621
						cause:  err,
622
					})
623
				}
624
			}
625
		} else if v, ok := interface{}(m.GetComputedAttribute()).(interface{ Validate() error }); ok {
626
			if err := v.Validate(); err != nil {
627
				return LeafValidationError{
628
					field:  "ComputedAttribute",
629
					reason: "embedded message failed validation",
630
					cause:  err,
631
				}
632
			}
633
		}
634
635
	case *Leaf_Call:
636
		if v == nil {
637
			err := LeafValidationError{
638
				field:  "Type",
639
				reason: "oneof value cannot be a typed-nil",
640
			}
641
			if !all {
642
				return err
643
			}
644
			errors = append(errors, err)
645
		}
646
		oneofTypePresent = true
647
648
		if m.GetCall() == nil {
649
			err := LeafValidationError{
650
				field:  "Call",
651
				reason: "value is required",
652
			}
653
			if !all {
654
				return err
655
			}
656
			errors = append(errors, err)
657
		}
658
659
		if all {
660
			switch v := interface{}(m.GetCall()).(type) {
661
			case interface{ ValidateAll() error }:
662
				if err := v.ValidateAll(); err != nil {
663
					errors = append(errors, LeafValidationError{
664
						field:  "Call",
665
						reason: "embedded message failed validation",
666
						cause:  err,
667
					})
668
				}
669
			case interface{ Validate() error }:
670
				if err := v.Validate(); err != nil {
671
					errors = append(errors, LeafValidationError{
672
						field:  "Call",
673
						reason: "embedded message failed validation",
674
						cause:  err,
675
					})
676
				}
677
			}
678
		} else if v, ok := interface{}(m.GetCall()).(interface{ Validate() error }); ok {
679
			if err := v.Validate(); err != nil {
680
				return LeafValidationError{
681
					field:  "Call",
682
					reason: "embedded message failed validation",
683
					cause:  err,
684
				}
685
			}
686
		}
687
688
	default:
689
		_ = v // ensures v is used
690
	}
691
	if !oneofTypePresent {
692
		err := LeafValidationError{
693
			field:  "Type",
694
			reason: "value is required",
695
		}
696
		if !all {
697
			return err
698
		}
699
		errors = append(errors, err)
700
	}
701
702
	if len(errors) > 0 {
703
		return LeafMultiError(errors)
704
	}
705
706
	return nil
707
}
708
709
// LeafMultiError is an error wrapping multiple validation errors returned by
710
// Leaf.ValidateAll() if the designated constraints aren't met.
711
type LeafMultiError []error
712
713
// Error returns a concatenation of all the error messages it wraps.
714
func (m LeafMultiError) Error() string {
715
	var msgs []string
716
	for _, err := range m {
717
		msgs = append(msgs, err.Error())
718
	}
719
	return strings.Join(msgs, "; ")
720
}
721
722
// AllErrors returns a list of validation violation errors.
723
func (m LeafMultiError) AllErrors() []error { return m }
724
725
// LeafValidationError is the validation error returned by Leaf.Validate if the
726
// designated constraints aren't met.
727
type LeafValidationError struct {
728
	field  string
729
	reason string
730
	cause  error
731
	key    bool
732
}
733
734
// Field function returns field value.
735
func (e LeafValidationError) Field() string { return e.field }
736
737
// Reason function returns reason value.
738
func (e LeafValidationError) Reason() string { return e.reason }
739
740
// Cause function returns cause value.
741
func (e LeafValidationError) Cause() error { return e.cause }
742
743
// Key function returns key value.
744
func (e LeafValidationError) Key() bool { return e.key }
745
746
// ErrorName returns error name.
747
func (e LeafValidationError) ErrorName() string { return "LeafValidationError" }
748
749
// Error satisfies the builtin error interface
750
func (e LeafValidationError) Error() string {
751
	cause := ""
752
	if e.cause != nil {
753
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
754
	}
755
756
	key := ""
757
	if e.key {
758
		key = "key for "
759
	}
760
761
	return fmt.Sprintf(
762
		"invalid %sLeaf.%s: %s%s",
763
		key,
764
		e.field,
765
		e.reason,
766
		cause)
767
}
768
769
var _ error = LeafValidationError{}
770
771
var _ interface {
772
	Field() string
773
	Reason() string
774
	Key() bool
775
	Cause() error
776
	ErrorName() string
777
} = LeafValidationError{}
778
779
// Validate checks the field values on Rewrite with the rules defined in the
780
// proto definition for this message. If any rules are violated, the first
781
// error encountered is returned, or nil if there are no violations.
782
func (m *Rewrite) Validate() error {
783
	return m.validate(false)
784
}
785
786
// ValidateAll checks the field values on Rewrite with the rules defined in the
787
// proto definition for this message. If any rules are violated, the result is
788
// a list of violation errors wrapped in RewriteMultiError, or nil if none found.
789
func (m *Rewrite) ValidateAll() error {
790
	return m.validate(true)
791
}
792
793
func (m *Rewrite) validate(all bool) error {
794
	if m == nil {
795
		return nil
796
	}
797
798
	var errors []error
799
800
	// no validation rules for RewriteOperation
801
802
	for idx, item := range m.GetChildren() {
803
		_, _ = idx, item
804
805
		if all {
806
			switch v := interface{}(item).(type) {
807
			case interface{ ValidateAll() error }:
808
				if err := v.ValidateAll(); err != nil {
809
					errors = append(errors, RewriteValidationError{
810
						field:  fmt.Sprintf("Children[%v]", idx),
811
						reason: "embedded message failed validation",
812
						cause:  err,
813
					})
814
				}
815
			case interface{ Validate() error }:
816
				if err := v.Validate(); err != nil {
817
					errors = append(errors, RewriteValidationError{
818
						field:  fmt.Sprintf("Children[%v]", idx),
819
						reason: "embedded message failed validation",
820
						cause:  err,
821
					})
822
				}
823
			}
824
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
825
			if err := v.Validate(); err != nil {
826
				return RewriteValidationError{
827
					field:  fmt.Sprintf("Children[%v]", idx),
828
					reason: "embedded message failed validation",
829
					cause:  err,
830
				}
831
			}
832
		}
833
834
	}
835
836
	if len(errors) > 0 {
837
		return RewriteMultiError(errors)
838
	}
839
840
	return nil
841
}
842
843
// RewriteMultiError is an error wrapping multiple validation errors returned
844
// by Rewrite.ValidateAll() if the designated constraints aren't met.
845
type RewriteMultiError []error
846
847
// Error returns a concatenation of all the error messages it wraps.
848
func (m RewriteMultiError) Error() string {
849
	var msgs []string
850
	for _, err := range m {
851
		msgs = append(msgs, err.Error())
852
	}
853
	return strings.Join(msgs, "; ")
854
}
855
856
// AllErrors returns a list of validation violation errors.
857
func (m RewriteMultiError) AllErrors() []error { return m }
858
859
// RewriteValidationError is the validation error returned by Rewrite.Validate
860
// if the designated constraints aren't met.
861
type RewriteValidationError struct {
862
	field  string
863
	reason string
864
	cause  error
865
	key    bool
866
}
867
868
// Field function returns field value.
869
func (e RewriteValidationError) Field() string { return e.field }
870
871
// Reason function returns reason value.
872
func (e RewriteValidationError) Reason() string { return e.reason }
873
874
// Cause function returns cause value.
875
func (e RewriteValidationError) Cause() error { return e.cause }
876
877
// Key function returns key value.
878
func (e RewriteValidationError) Key() bool { return e.key }
879
880
// ErrorName returns error name.
881
func (e RewriteValidationError) ErrorName() string { return "RewriteValidationError" }
882
883
// Error satisfies the builtin error interface
884
func (e RewriteValidationError) Error() string {
885
	cause := ""
886
	if e.cause != nil {
887
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
888
	}
889
890
	key := ""
891
	if e.key {
892
		key = "key for "
893
	}
894
895
	return fmt.Sprintf(
896
		"invalid %sRewrite.%s: %s%s",
897
		key,
898
		e.field,
899
		e.reason,
900
		cause)
901
}
902
903
var _ error = RewriteValidationError{}
904
905
var _ interface {
906
	Field() string
907
	Reason() string
908
	Key() bool
909
	Cause() error
910
	ErrorName() string
911
} = RewriteValidationError{}
912
913
// Validate checks the field values on SchemaDefinition with the rules defined
914
// in the proto definition for this message. If any rules are violated, the
915
// first error encountered is returned, or nil if there are no violations.
916
func (m *SchemaDefinition) Validate() error {
917
	return m.validate(false)
918
}
919
920
// ValidateAll checks the field values on SchemaDefinition with the rules
921
// defined in the proto definition for this message. If any rules are
922
// violated, the result is a list of violation errors wrapped in
923
// SchemaDefinitionMultiError, or nil if none found.
924
func (m *SchemaDefinition) ValidateAll() error {
925
	return m.validate(true)
926
}
927
928
func (m *SchemaDefinition) validate(all bool) error {
929
	if m == nil {
930
		return nil
931
	}
932
933
	var errors []error
934
935
	{
936
		sorted_keys := make([]string, len(m.GetEntityDefinitions()))
937
		i := 0
938
		for key := range m.GetEntityDefinitions() {
939
			sorted_keys[i] = key
940
			i++
941
		}
942
		sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] })
943
		for _, key := range sorted_keys {
944
			val := m.GetEntityDefinitions()[key]
945
			_ = val
946
947
			// no validation rules for EntityDefinitions[key]
948
949
			if all {
950
				switch v := interface{}(val).(type) {
951
				case interface{ ValidateAll() error }:
952
					if err := v.ValidateAll(); err != nil {
953
						errors = append(errors, SchemaDefinitionValidationError{
954
							field:  fmt.Sprintf("EntityDefinitions[%v]", key),
955
							reason: "embedded message failed validation",
956
							cause:  err,
957
						})
958
					}
959
				case interface{ Validate() error }:
960
					if err := v.Validate(); err != nil {
961
						errors = append(errors, SchemaDefinitionValidationError{
962
							field:  fmt.Sprintf("EntityDefinitions[%v]", key),
963
							reason: "embedded message failed validation",
964
							cause:  err,
965
						})
966
					}
967
				}
968
			} else if v, ok := interface{}(val).(interface{ Validate() error }); ok {
969
				if err := v.Validate(); err != nil {
970
					return SchemaDefinitionValidationError{
971
						field:  fmt.Sprintf("EntityDefinitions[%v]", key),
972
						reason: "embedded message failed validation",
973
						cause:  err,
974
					}
975
				}
976
			}
977
978
		}
979
	}
980
981
	{
982
		sorted_keys := make([]string, len(m.GetRuleDefinitions()))
983
		i := 0
984
		for key := range m.GetRuleDefinitions() {
985
			sorted_keys[i] = key
986
			i++
987
		}
988
		sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] })
989
		for _, key := range sorted_keys {
990
			val := m.GetRuleDefinitions()[key]
991
			_ = val
992
993
			// no validation rules for RuleDefinitions[key]
994
995
			if all {
996
				switch v := interface{}(val).(type) {
997
				case interface{ ValidateAll() error }:
998
					if err := v.ValidateAll(); err != nil {
999
						errors = append(errors, SchemaDefinitionValidationError{
1000
							field:  fmt.Sprintf("RuleDefinitions[%v]", key),
1001
							reason: "embedded message failed validation",
1002
							cause:  err,
1003
						})
1004
					}
1005
				case interface{ Validate() error }:
1006
					if err := v.Validate(); err != nil {
1007
						errors = append(errors, SchemaDefinitionValidationError{
1008
							field:  fmt.Sprintf("RuleDefinitions[%v]", key),
1009
							reason: "embedded message failed validation",
1010
							cause:  err,
1011
						})
1012
					}
1013
				}
1014
			} else if v, ok := interface{}(val).(interface{ Validate() error }); ok {
1015
				if err := v.Validate(); err != nil {
1016
					return SchemaDefinitionValidationError{
1017
						field:  fmt.Sprintf("RuleDefinitions[%v]", key),
1018
						reason: "embedded message failed validation",
1019
						cause:  err,
1020
					}
1021
				}
1022
			}
1023
1024
		}
1025
	}
1026
1027
	// no validation rules for References
1028
1029
	if len(errors) > 0 {
1030
		return SchemaDefinitionMultiError(errors)
1031
	}
1032
1033
	return nil
1034
}
1035
1036
// SchemaDefinitionMultiError is an error wrapping multiple validation errors
1037
// returned by SchemaDefinition.ValidateAll() if the designated constraints
1038
// aren't met.
1039
type SchemaDefinitionMultiError []error
1040
1041
// Error returns a concatenation of all the error messages it wraps.
1042
func (m SchemaDefinitionMultiError) Error() string {
1043
	var msgs []string
1044
	for _, err := range m {
1045
		msgs = append(msgs, err.Error())
1046
	}
1047
	return strings.Join(msgs, "; ")
1048
}
1049
1050
// AllErrors returns a list of validation violation errors.
1051
func (m SchemaDefinitionMultiError) AllErrors() []error { return m }
1052
1053
// SchemaDefinitionValidationError is the validation error returned by
1054
// SchemaDefinition.Validate if the designated constraints aren't met.
1055
type SchemaDefinitionValidationError struct {
1056
	field  string
1057
	reason string
1058
	cause  error
1059
	key    bool
1060
}
1061
1062
// Field function returns field value.
1063
func (e SchemaDefinitionValidationError) Field() string { return e.field }
1064
1065
// Reason function returns reason value.
1066
func (e SchemaDefinitionValidationError) Reason() string { return e.reason }
1067
1068
// Cause function returns cause value.
1069
func (e SchemaDefinitionValidationError) Cause() error { return e.cause }
1070
1071
// Key function returns key value.
1072
func (e SchemaDefinitionValidationError) Key() bool { return e.key }
1073
1074
// ErrorName returns error name.
1075
func (e SchemaDefinitionValidationError) ErrorName() string { return "SchemaDefinitionValidationError" }
1076
1077
// Error satisfies the builtin error interface
1078
func (e SchemaDefinitionValidationError) Error() string {
1079
	cause := ""
1080
	if e.cause != nil {
1081
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
1082
	}
1083
1084
	key := ""
1085
	if e.key {
1086
		key = "key for "
1087
	}
1088
1089
	return fmt.Sprintf(
1090
		"invalid %sSchemaDefinition.%s: %s%s",
1091
		key,
1092
		e.field,
1093
		e.reason,
1094
		cause)
1095
}
1096
1097
var _ error = SchemaDefinitionValidationError{}
1098
1099
var _ interface {
1100
	Field() string
1101
	Reason() string
1102
	Key() bool
1103
	Cause() error
1104
	ErrorName() string
1105
} = SchemaDefinitionValidationError{}
1106
1107
// Validate checks the field values on EntityDefinition with the rules defined
1108
// in the proto definition for this message. If any rules are violated, the
1109
// first error encountered is returned, or nil if there are no violations.
1110
func (m *EntityDefinition) Validate() error {
1111
	return m.validate(false)
1112
}
1113
1114
// ValidateAll checks the field values on EntityDefinition with the rules
1115
// defined in the proto definition for this message. If any rules are
1116
// violated, the result is a list of violation errors wrapped in
1117
// EntityDefinitionMultiError, or nil if none found.
1118
func (m *EntityDefinition) ValidateAll() error {
1119
	return m.validate(true)
1120
}
1121
1122
func (m *EntityDefinition) validate(all bool) error {
1123
	if m == nil {
1124
		return nil
1125
	}
1126
1127
	var errors []error
1128
1129
	if len(m.GetName()) > 64 {
1130
		err := EntityDefinitionValidationError{
1131
			field:  "Name",
1132
			reason: "value length must be at most 64 bytes",
1133
		}
1134
		if !all {
1135
			return err
1136
		}
1137
		errors = append(errors, err)
1138
	}
1139
1140
	if !_EntityDefinition_Name_Pattern.MatchString(m.GetName()) {
1141
		err := EntityDefinitionValidationError{
1142
			field:  "Name",
1143
			reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"",
1144
		}
1145
		if !all {
1146
			return err
1147
		}
1148
		errors = append(errors, err)
1149
	}
1150
1151
	{
1152
		sorted_keys := make([]string, len(m.GetRelations()))
1153
		i := 0
1154
		for key := range m.GetRelations() {
1155
			sorted_keys[i] = key
1156
			i++
1157
		}
1158
		sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] })
1159
		for _, key := range sorted_keys {
1160
			val := m.GetRelations()[key]
1161
			_ = val
1162
1163
			// no validation rules for Relations[key]
1164
1165
			if all {
1166
				switch v := interface{}(val).(type) {
1167
				case interface{ ValidateAll() error }:
1168
					if err := v.ValidateAll(); err != nil {
1169
						errors = append(errors, EntityDefinitionValidationError{
1170
							field:  fmt.Sprintf("Relations[%v]", key),
1171
							reason: "embedded message failed validation",
1172
							cause:  err,
1173
						})
1174
					}
1175
				case interface{ Validate() error }:
1176
					if err := v.Validate(); err != nil {
1177
						errors = append(errors, EntityDefinitionValidationError{
1178
							field:  fmt.Sprintf("Relations[%v]", key),
1179
							reason: "embedded message failed validation",
1180
							cause:  err,
1181
						})
1182
					}
1183
				}
1184
			} else if v, ok := interface{}(val).(interface{ Validate() error }); ok {
1185
				if err := v.Validate(); err != nil {
1186
					return EntityDefinitionValidationError{
1187
						field:  fmt.Sprintf("Relations[%v]", key),
1188
						reason: "embedded message failed validation",
1189
						cause:  err,
1190
					}
1191
				}
1192
			}
1193
1194
		}
1195
	}
1196
1197
	{
1198
		sorted_keys := make([]string, len(m.GetPermissions()))
1199
		i := 0
1200
		for key := range m.GetPermissions() {
1201
			sorted_keys[i] = key
1202
			i++
1203
		}
1204
		sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] })
1205
		for _, key := range sorted_keys {
1206
			val := m.GetPermissions()[key]
1207
			_ = val
1208
1209
			// no validation rules for Permissions[key]
1210
1211
			if all {
1212
				switch v := interface{}(val).(type) {
1213
				case interface{ ValidateAll() error }:
1214
					if err := v.ValidateAll(); err != nil {
1215
						errors = append(errors, EntityDefinitionValidationError{
1216
							field:  fmt.Sprintf("Permissions[%v]", key),
1217
							reason: "embedded message failed validation",
1218
							cause:  err,
1219
						})
1220
					}
1221
				case interface{ Validate() error }:
1222
					if err := v.Validate(); err != nil {
1223
						errors = append(errors, EntityDefinitionValidationError{
1224
							field:  fmt.Sprintf("Permissions[%v]", key),
1225
							reason: "embedded message failed validation",
1226
							cause:  err,
1227
						})
1228
					}
1229
				}
1230
			} else if v, ok := interface{}(val).(interface{ Validate() error }); ok {
1231
				if err := v.Validate(); err != nil {
1232
					return EntityDefinitionValidationError{
1233
						field:  fmt.Sprintf("Permissions[%v]", key),
1234
						reason: "embedded message failed validation",
1235
						cause:  err,
1236
					}
1237
				}
1238
			}
1239
1240
		}
1241
	}
1242
1243
	{
1244
		sorted_keys := make([]string, len(m.GetAttributes()))
1245
		i := 0
1246
		for key := range m.GetAttributes() {
1247
			sorted_keys[i] = key
1248
			i++
1249
		}
1250
		sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] })
1251
		for _, key := range sorted_keys {
1252
			val := m.GetAttributes()[key]
1253
			_ = val
1254
1255
			// no validation rules for Attributes[key]
1256
1257
			if all {
1258
				switch v := interface{}(val).(type) {
1259
				case interface{ ValidateAll() error }:
1260
					if err := v.ValidateAll(); err != nil {
1261
						errors = append(errors, EntityDefinitionValidationError{
1262
							field:  fmt.Sprintf("Attributes[%v]", key),
1263
							reason: "embedded message failed validation",
1264
							cause:  err,
1265
						})
1266
					}
1267
				case interface{ Validate() error }:
1268
					if err := v.Validate(); err != nil {
1269
						errors = append(errors, EntityDefinitionValidationError{
1270
							field:  fmt.Sprintf("Attributes[%v]", key),
1271
							reason: "embedded message failed validation",
1272
							cause:  err,
1273
						})
1274
					}
1275
				}
1276
			} else if v, ok := interface{}(val).(interface{ Validate() error }); ok {
1277
				if err := v.Validate(); err != nil {
1278
					return EntityDefinitionValidationError{
1279
						field:  fmt.Sprintf("Attributes[%v]", key),
1280
						reason: "embedded message failed validation",
1281
						cause:  err,
1282
					}
1283
				}
1284
			}
1285
1286
		}
1287
	}
1288
1289
	// no validation rules for References
1290
1291
	if len(errors) > 0 {
1292
		return EntityDefinitionMultiError(errors)
1293
	}
1294
1295
	return nil
1296
}
1297
1298
// EntityDefinitionMultiError is an error wrapping multiple validation errors
1299
// returned by EntityDefinition.ValidateAll() if the designated constraints
1300
// aren't met.
1301
type EntityDefinitionMultiError []error
1302
1303
// Error returns a concatenation of all the error messages it wraps.
1304
func (m EntityDefinitionMultiError) Error() string {
1305
	var msgs []string
1306
	for _, err := range m {
1307
		msgs = append(msgs, err.Error())
1308
	}
1309
	return strings.Join(msgs, "; ")
1310
}
1311
1312
// AllErrors returns a list of validation violation errors.
1313
func (m EntityDefinitionMultiError) AllErrors() []error { return m }
1314
1315
// EntityDefinitionValidationError is the validation error returned by
1316
// EntityDefinition.Validate if the designated constraints aren't met.
1317
type EntityDefinitionValidationError struct {
1318
	field  string
1319
	reason string
1320
	cause  error
1321
	key    bool
1322
}
1323
1324
// Field function returns field value.
1325
func (e EntityDefinitionValidationError) Field() string { return e.field }
1326
1327
// Reason function returns reason value.
1328
func (e EntityDefinitionValidationError) Reason() string { return e.reason }
1329
1330
// Cause function returns cause value.
1331
func (e EntityDefinitionValidationError) Cause() error { return e.cause }
1332
1333
// Key function returns key value.
1334
func (e EntityDefinitionValidationError) Key() bool { return e.key }
1335
1336
// ErrorName returns error name.
1337
func (e EntityDefinitionValidationError) ErrorName() string { return "EntityDefinitionValidationError" }
1338
1339
// Error satisfies the builtin error interface
1340
func (e EntityDefinitionValidationError) Error() string {
1341
	cause := ""
1342
	if e.cause != nil {
1343
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
1344
	}
1345
1346
	key := ""
1347
	if e.key {
1348
		key = "key for "
1349
	}
1350
1351
	return fmt.Sprintf(
1352
		"invalid %sEntityDefinition.%s: %s%s",
1353
		key,
1354
		e.field,
1355
		e.reason,
1356
		cause)
1357
}
1358
1359
var _ error = EntityDefinitionValidationError{}
1360
1361
var _ interface {
1362
	Field() string
1363
	Reason() string
1364
	Key() bool
1365
	Cause() error
1366
	ErrorName() string
1367
} = EntityDefinitionValidationError{}
1368
1369
var _EntityDefinition_Name_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$")
1370
1371
// Validate checks the field values on RuleDefinition with the rules defined in
1372
// the proto definition for this message. If any rules are violated, the first
1373
// error encountered is returned, or nil if there are no violations.
1374
func (m *RuleDefinition) Validate() error {
1375
	return m.validate(false)
1376
}
1377
1378
// ValidateAll checks the field values on RuleDefinition with the rules defined
1379
// in the proto definition for this message. If any rules are violated, the
1380
// result is a list of violation errors wrapped in RuleDefinitionMultiError,
1381
// or nil if none found.
1382
func (m *RuleDefinition) ValidateAll() error {
1383
	return m.validate(true)
1384
}
1385
1386
func (m *RuleDefinition) validate(all bool) error {
1387
	if m == nil {
1388
		return nil
1389
	}
1390
1391
	var errors []error
1392
1393
	if len(m.GetName()) > 64 {
1394
		err := RuleDefinitionValidationError{
1395
			field:  "Name",
1396
			reason: "value length must be at most 64 bytes",
1397
		}
1398
		if !all {
1399
			return err
1400
		}
1401
		errors = append(errors, err)
1402
	}
1403
1404
	if !_RuleDefinition_Name_Pattern.MatchString(m.GetName()) {
1405
		err := RuleDefinitionValidationError{
1406
			field:  "Name",
1407
			reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"",
1408
		}
1409
		if !all {
1410
			return err
1411
		}
1412
		errors = append(errors, err)
1413
	}
1414
1415
	// no validation rules for Arguments
1416
1417
	if all {
1418
		switch v := interface{}(m.GetExpression()).(type) {
1419
		case interface{ ValidateAll() error }:
1420
			if err := v.ValidateAll(); err != nil {
1421
				errors = append(errors, RuleDefinitionValidationError{
1422
					field:  "Expression",
1423
					reason: "embedded message failed validation",
1424
					cause:  err,
1425
				})
1426
			}
1427
		case interface{ Validate() error }:
1428
			if err := v.Validate(); err != nil {
1429
				errors = append(errors, RuleDefinitionValidationError{
1430
					field:  "Expression",
1431
					reason: "embedded message failed validation",
1432
					cause:  err,
1433
				})
1434
			}
1435
		}
1436
	} else if v, ok := interface{}(m.GetExpression()).(interface{ Validate() error }); ok {
1437
		if err := v.Validate(); err != nil {
1438
			return RuleDefinitionValidationError{
1439
				field:  "Expression",
1440
				reason: "embedded message failed validation",
1441
				cause:  err,
1442
			}
1443
		}
1444
	}
1445
1446
	if len(errors) > 0 {
1447
		return RuleDefinitionMultiError(errors)
1448
	}
1449
1450
	return nil
1451
}
1452
1453
// RuleDefinitionMultiError is an error wrapping multiple validation errors
1454
// returned by RuleDefinition.ValidateAll() if the designated constraints
1455
// aren't met.
1456
type RuleDefinitionMultiError []error
1457
1458
// Error returns a concatenation of all the error messages it wraps.
1459
func (m RuleDefinitionMultiError) Error() string {
1460
	var msgs []string
1461
	for _, err := range m {
1462
		msgs = append(msgs, err.Error())
1463
	}
1464
	return strings.Join(msgs, "; ")
1465
}
1466
1467
// AllErrors returns a list of validation violation errors.
1468
func (m RuleDefinitionMultiError) AllErrors() []error { return m }
1469
1470
// RuleDefinitionValidationError is the validation error returned by
1471
// RuleDefinition.Validate if the designated constraints aren't met.
1472
type RuleDefinitionValidationError struct {
1473
	field  string
1474
	reason string
1475
	cause  error
1476
	key    bool
1477
}
1478
1479
// Field function returns field value.
1480
func (e RuleDefinitionValidationError) Field() string { return e.field }
1481
1482
// Reason function returns reason value.
1483
func (e RuleDefinitionValidationError) Reason() string { return e.reason }
1484
1485
// Cause function returns cause value.
1486
func (e RuleDefinitionValidationError) Cause() error { return e.cause }
1487
1488
// Key function returns key value.
1489
func (e RuleDefinitionValidationError) Key() bool { return e.key }
1490
1491
// ErrorName returns error name.
1492
func (e RuleDefinitionValidationError) ErrorName() string { return "RuleDefinitionValidationError" }
1493
1494
// Error satisfies the builtin error interface
1495
func (e RuleDefinitionValidationError) Error() string {
1496
	cause := ""
1497
	if e.cause != nil {
1498
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
1499
	}
1500
1501
	key := ""
1502
	if e.key {
1503
		key = "key for "
1504
	}
1505
1506
	return fmt.Sprintf(
1507
		"invalid %sRuleDefinition.%s: %s%s",
1508
		key,
1509
		e.field,
1510
		e.reason,
1511
		cause)
1512
}
1513
1514
var _ error = RuleDefinitionValidationError{}
1515
1516
var _ interface {
1517
	Field() string
1518
	Reason() string
1519
	Key() bool
1520
	Cause() error
1521
	ErrorName() string
1522
} = RuleDefinitionValidationError{}
1523
1524
var _RuleDefinition_Name_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$")
1525
1526
// Validate checks the field values on AttributeDefinition with the rules
1527
// defined in the proto definition for this message. If any rules are
1528
// violated, the first error encountered is returned, or nil if there are no violations.
1529
func (m *AttributeDefinition) Validate() error {
1530
	return m.validate(false)
1531
}
1532
1533
// ValidateAll checks the field values on AttributeDefinition with the rules
1534
// defined in the proto definition for this message. If any rules are
1535
// violated, the result is a list of violation errors wrapped in
1536
// AttributeDefinitionMultiError, or nil if none found.
1537
func (m *AttributeDefinition) ValidateAll() error {
1538
	return m.validate(true)
1539
}
1540
1541
func (m *AttributeDefinition) validate(all bool) error {
1542
	if m == nil {
1543
		return nil
1544
	}
1545
1546
	var errors []error
1547
1548
	if len(m.GetName()) > 64 {
1549
		err := AttributeDefinitionValidationError{
1550
			field:  "Name",
1551
			reason: "value length must be at most 64 bytes",
1552
		}
1553
		if !all {
1554
			return err
1555
		}
1556
		errors = append(errors, err)
1557
	}
1558
1559
	if !_AttributeDefinition_Name_Pattern.MatchString(m.GetName()) {
1560
		err := AttributeDefinitionValidationError{
1561
			field:  "Name",
1562
			reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"",
1563
		}
1564
		if !all {
1565
			return err
1566
		}
1567
		errors = append(errors, err)
1568
	}
1569
1570
	// no validation rules for Type
1571
1572
	if len(errors) > 0 {
1573
		return AttributeDefinitionMultiError(errors)
1574
	}
1575
1576
	return nil
1577
}
1578
1579
// AttributeDefinitionMultiError is an error wrapping multiple validation
1580
// errors returned by AttributeDefinition.ValidateAll() if the designated
1581
// constraints aren't met.
1582
type AttributeDefinitionMultiError []error
1583
1584
// Error returns a concatenation of all the error messages it wraps.
1585
func (m AttributeDefinitionMultiError) Error() string {
1586
	var msgs []string
1587
	for _, err := range m {
1588
		msgs = append(msgs, err.Error())
1589
	}
1590
	return strings.Join(msgs, "; ")
1591
}
1592
1593
// AllErrors returns a list of validation violation errors.
1594
func (m AttributeDefinitionMultiError) AllErrors() []error { return m }
1595
1596
// AttributeDefinitionValidationError is the validation error returned by
1597
// AttributeDefinition.Validate if the designated constraints aren't met.
1598
type AttributeDefinitionValidationError struct {
1599
	field  string
1600
	reason string
1601
	cause  error
1602
	key    bool
1603
}
1604
1605
// Field function returns field value.
1606
func (e AttributeDefinitionValidationError) Field() string { return e.field }
1607
1608
// Reason function returns reason value.
1609
func (e AttributeDefinitionValidationError) Reason() string { return e.reason }
1610
1611
// Cause function returns cause value.
1612
func (e AttributeDefinitionValidationError) Cause() error { return e.cause }
1613
1614
// Key function returns key value.
1615
func (e AttributeDefinitionValidationError) Key() bool { return e.key }
1616
1617
// ErrorName returns error name.
1618
func (e AttributeDefinitionValidationError) ErrorName() string {
1619
	return "AttributeDefinitionValidationError"
1620
}
1621
1622
// Error satisfies the builtin error interface
1623
func (e AttributeDefinitionValidationError) Error() string {
1624
	cause := ""
1625
	if e.cause != nil {
1626
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
1627
	}
1628
1629
	key := ""
1630
	if e.key {
1631
		key = "key for "
1632
	}
1633
1634
	return fmt.Sprintf(
1635
		"invalid %sAttributeDefinition.%s: %s%s",
1636
		key,
1637
		e.field,
1638
		e.reason,
1639
		cause)
1640
}
1641
1642
var _ error = AttributeDefinitionValidationError{}
1643
1644
var _ interface {
1645
	Field() string
1646
	Reason() string
1647
	Key() bool
1648
	Cause() error
1649
	ErrorName() string
1650
} = AttributeDefinitionValidationError{}
1651
1652
var _AttributeDefinition_Name_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$")
1653
1654
// Validate checks the field values on RelationDefinition with the rules
1655
// defined in the proto definition for this message. If any rules are
1656
// violated, the first error encountered is returned, or nil if there are no violations.
1657
func (m *RelationDefinition) Validate() error {
1658
	return m.validate(false)
1659
}
1660
1661
// ValidateAll checks the field values on RelationDefinition with the rules
1662
// defined in the proto definition for this message. If any rules are
1663
// violated, the result is a list of violation errors wrapped in
1664
// RelationDefinitionMultiError, or nil if none found.
1665
func (m *RelationDefinition) ValidateAll() error {
1666
	return m.validate(true)
1667
}
1668
1669
func (m *RelationDefinition) validate(all bool) error {
1670
	if m == nil {
1671
		return nil
1672
	}
1673
1674
	var errors []error
1675
1676
	if len(m.GetName()) > 64 {
1677
		err := RelationDefinitionValidationError{
1678
			field:  "Name",
1679
			reason: "value length must be at most 64 bytes",
1680
		}
1681
		if !all {
1682
			return err
1683
		}
1684
		errors = append(errors, err)
1685
	}
1686
1687
	if !_RelationDefinition_Name_Pattern.MatchString(m.GetName()) {
1688
		err := RelationDefinitionValidationError{
1689
			field:  "Name",
1690
			reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"",
1691
		}
1692
		if !all {
1693
			return err
1694
		}
1695
		errors = append(errors, err)
1696
	}
1697
1698
	for idx, item := range m.GetRelationReferences() {
1699
		_, _ = idx, item
1700
1701
		if all {
1702
			switch v := interface{}(item).(type) {
1703
			case interface{ ValidateAll() error }:
1704
				if err := v.ValidateAll(); err != nil {
1705
					errors = append(errors, RelationDefinitionValidationError{
1706
						field:  fmt.Sprintf("RelationReferences[%v]", idx),
1707
						reason: "embedded message failed validation",
1708
						cause:  err,
1709
					})
1710
				}
1711
			case interface{ Validate() error }:
1712
				if err := v.Validate(); err != nil {
1713
					errors = append(errors, RelationDefinitionValidationError{
1714
						field:  fmt.Sprintf("RelationReferences[%v]", idx),
1715
						reason: "embedded message failed validation",
1716
						cause:  err,
1717
					})
1718
				}
1719
			}
1720
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
1721
			if err := v.Validate(); err != nil {
1722
				return RelationDefinitionValidationError{
1723
					field:  fmt.Sprintf("RelationReferences[%v]", idx),
1724
					reason: "embedded message failed validation",
1725
					cause:  err,
1726
				}
1727
			}
1728
		}
1729
1730
	}
1731
1732
	if len(errors) > 0 {
1733
		return RelationDefinitionMultiError(errors)
1734
	}
1735
1736
	return nil
1737
}
1738
1739
// RelationDefinitionMultiError is an error wrapping multiple validation errors
1740
// returned by RelationDefinition.ValidateAll() if the designated constraints
1741
// aren't met.
1742
type RelationDefinitionMultiError []error
1743
1744
// Error returns a concatenation of all the error messages it wraps.
1745
func (m RelationDefinitionMultiError) Error() string {
1746
	var msgs []string
1747
	for _, err := range m {
1748
		msgs = append(msgs, err.Error())
1749
	}
1750
	return strings.Join(msgs, "; ")
1751
}
1752
1753
// AllErrors returns a list of validation violation errors.
1754
func (m RelationDefinitionMultiError) AllErrors() []error { return m }
1755
1756
// RelationDefinitionValidationError is the validation error returned by
1757
// RelationDefinition.Validate if the designated constraints aren't met.
1758
type RelationDefinitionValidationError struct {
1759
	field  string
1760
	reason string
1761
	cause  error
1762
	key    bool
1763
}
1764
1765
// Field function returns field value.
1766
func (e RelationDefinitionValidationError) Field() string { return e.field }
1767
1768
// Reason function returns reason value.
1769
func (e RelationDefinitionValidationError) Reason() string { return e.reason }
1770
1771
// Cause function returns cause value.
1772
func (e RelationDefinitionValidationError) Cause() error { return e.cause }
1773
1774
// Key function returns key value.
1775
func (e RelationDefinitionValidationError) Key() bool { return e.key }
1776
1777
// ErrorName returns error name.
1778
func (e RelationDefinitionValidationError) ErrorName() string {
1779
	return "RelationDefinitionValidationError"
1780
}
1781
1782
// Error satisfies the builtin error interface
1783
func (e RelationDefinitionValidationError) Error() string {
1784
	cause := ""
1785
	if e.cause != nil {
1786
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
1787
	}
1788
1789
	key := ""
1790
	if e.key {
1791
		key = "key for "
1792
	}
1793
1794
	return fmt.Sprintf(
1795
		"invalid %sRelationDefinition.%s: %s%s",
1796
		key,
1797
		e.field,
1798
		e.reason,
1799
		cause)
1800
}
1801
1802
var _ error = RelationDefinitionValidationError{}
1803
1804
var _ interface {
1805
	Field() string
1806
	Reason() string
1807
	Key() bool
1808
	Cause() error
1809
	ErrorName() string
1810
} = RelationDefinitionValidationError{}
1811
1812
var _RelationDefinition_Name_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$")
1813
1814
// Validate checks the field values on PermissionDefinition with the rules
1815
// defined in the proto definition for this message. If any rules are
1816
// violated, the first error encountered is returned, or nil if there are no violations.
1817
func (m *PermissionDefinition) Validate() error {
1818
	return m.validate(false)
1819
}
1820
1821
// ValidateAll checks the field values on PermissionDefinition with the rules
1822
// defined in the proto definition for this message. If any rules are
1823
// violated, the result is a list of violation errors wrapped in
1824
// PermissionDefinitionMultiError, or nil if none found.
1825
func (m *PermissionDefinition) ValidateAll() error {
1826
	return m.validate(true)
1827
}
1828
1829
func (m *PermissionDefinition) validate(all bool) error {
1830
	if m == nil {
1831
		return nil
1832
	}
1833
1834
	var errors []error
1835
1836
	if len(m.GetName()) > 64 {
1837
		err := PermissionDefinitionValidationError{
1838
			field:  "Name",
1839
			reason: "value length must be at most 64 bytes",
1840
		}
1841
		if !all {
1842
			return err
1843
		}
1844
		errors = append(errors, err)
1845
	}
1846
1847
	if !_PermissionDefinition_Name_Pattern.MatchString(m.GetName()) {
1848
		err := PermissionDefinitionValidationError{
1849
			field:  "Name",
1850
			reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"",
1851
		}
1852
		if !all {
1853
			return err
1854
		}
1855
		errors = append(errors, err)
1856
	}
1857
1858
	if all {
1859
		switch v := interface{}(m.GetChild()).(type) {
1860
		case interface{ ValidateAll() error }:
1861
			if err := v.ValidateAll(); err != nil {
1862
				errors = append(errors, PermissionDefinitionValidationError{
1863
					field:  "Child",
1864
					reason: "embedded message failed validation",
1865
					cause:  err,
1866
				})
1867
			}
1868
		case interface{ Validate() error }:
1869
			if err := v.Validate(); err != nil {
1870
				errors = append(errors, PermissionDefinitionValidationError{
1871
					field:  "Child",
1872
					reason: "embedded message failed validation",
1873
					cause:  err,
1874
				})
1875
			}
1876
		}
1877
	} else if v, ok := interface{}(m.GetChild()).(interface{ Validate() error }); ok {
1878
		if err := v.Validate(); err != nil {
1879
			return PermissionDefinitionValidationError{
1880
				field:  "Child",
1881
				reason: "embedded message failed validation",
1882
				cause:  err,
1883
			}
1884
		}
1885
	}
1886
1887
	if len(errors) > 0 {
1888
		return PermissionDefinitionMultiError(errors)
1889
	}
1890
1891
	return nil
1892
}
1893
1894
// PermissionDefinitionMultiError is an error wrapping multiple validation
1895
// errors returned by PermissionDefinition.ValidateAll() if the designated
1896
// constraints aren't met.
1897
type PermissionDefinitionMultiError []error
1898
1899
// Error returns a concatenation of all the error messages it wraps.
1900
func (m PermissionDefinitionMultiError) Error() string {
1901
	var msgs []string
1902
	for _, err := range m {
1903
		msgs = append(msgs, err.Error())
1904
	}
1905
	return strings.Join(msgs, "; ")
1906
}
1907
1908
// AllErrors returns a list of validation violation errors.
1909
func (m PermissionDefinitionMultiError) AllErrors() []error { return m }
1910
1911
// PermissionDefinitionValidationError is the validation error returned by
1912
// PermissionDefinition.Validate if the designated constraints aren't met.
1913
type PermissionDefinitionValidationError struct {
1914
	field  string
1915
	reason string
1916
	cause  error
1917
	key    bool
1918
}
1919
1920
// Field function returns field value.
1921
func (e PermissionDefinitionValidationError) Field() string { return e.field }
1922
1923
// Reason function returns reason value.
1924
func (e PermissionDefinitionValidationError) Reason() string { return e.reason }
1925
1926
// Cause function returns cause value.
1927
func (e PermissionDefinitionValidationError) Cause() error { return e.cause }
1928
1929
// Key function returns key value.
1930
func (e PermissionDefinitionValidationError) Key() bool { return e.key }
1931
1932
// ErrorName returns error name.
1933
func (e PermissionDefinitionValidationError) ErrorName() string {
1934
	return "PermissionDefinitionValidationError"
1935
}
1936
1937
// Error satisfies the builtin error interface
1938
func (e PermissionDefinitionValidationError) Error() string {
1939
	cause := ""
1940
	if e.cause != nil {
1941
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
1942
	}
1943
1944
	key := ""
1945
	if e.key {
1946
		key = "key for "
1947
	}
1948
1949
	return fmt.Sprintf(
1950
		"invalid %sPermissionDefinition.%s: %s%s",
1951
		key,
1952
		e.field,
1953
		e.reason,
1954
		cause)
1955
}
1956
1957
var _ error = PermissionDefinitionValidationError{}
1958
1959
var _ interface {
1960
	Field() string
1961
	Reason() string
1962
	Key() bool
1963
	Cause() error
1964
	ErrorName() string
1965
} = PermissionDefinitionValidationError{}
1966
1967
var _PermissionDefinition_Name_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$")
1968
1969
// Validate checks the field values on RelationReference with the rules defined
1970
// in the proto definition for this message. If any rules are violated, the
1971
// first error encountered is returned, or nil if there are no violations.
1972
func (m *RelationReference) Validate() error {
1973
	return m.validate(false)
1974
}
1975
1976
// ValidateAll checks the field values on RelationReference with the rules
1977
// defined in the proto definition for this message. If any rules are
1978
// violated, the result is a list of violation errors wrapped in
1979
// RelationReferenceMultiError, or nil if none found.
1980
func (m *RelationReference) ValidateAll() error {
1981
	return m.validate(true)
1982
}
1983
1984
func (m *RelationReference) validate(all bool) error {
1985
	if m == nil {
1986
		return nil
1987
	}
1988
1989
	var errors []error
1990
1991
	if len(m.GetType()) > 64 {
1992
		err := RelationReferenceValidationError{
1993
			field:  "Type",
1994
			reason: "value length must be at most 64 bytes",
1995
		}
1996
		if !all {
1997
			return err
1998
		}
1999
		errors = append(errors, err)
2000
	}
2001
2002
	if !_RelationReference_Type_Pattern.MatchString(m.GetType()) {
2003
		err := RelationReferenceValidationError{
2004
			field:  "Type",
2005
			reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"",
2006
		}
2007
		if !all {
2008
			return err
2009
		}
2010
		errors = append(errors, err)
2011
	}
2012
2013
	if m.GetRelation() != "" {
2014
2015
		if len(m.GetRelation()) > 64 {
2016
			err := RelationReferenceValidationError{
2017
				field:  "Relation",
2018
				reason: "value length must be at most 64 bytes",
2019
			}
2020
			if !all {
2021
				return err
2022
			}
2023
			errors = append(errors, err)
2024
		}
2025
2026
		if !_RelationReference_Relation_Pattern.MatchString(m.GetRelation()) {
2027
			err := RelationReferenceValidationError{
2028
				field:  "Relation",
2029
				reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"",
2030
			}
2031
			if !all {
2032
				return err
2033
			}
2034
			errors = append(errors, err)
2035
		}
2036
2037
	}
2038
2039
	if len(errors) > 0 {
2040
		return RelationReferenceMultiError(errors)
2041
	}
2042
2043
	return nil
2044
}
2045
2046
// RelationReferenceMultiError is an error wrapping multiple validation errors
2047
// returned by RelationReference.ValidateAll() if the designated constraints
2048
// aren't met.
2049
type RelationReferenceMultiError []error
2050
2051
// Error returns a concatenation of all the error messages it wraps.
2052
func (m RelationReferenceMultiError) Error() string {
2053
	var msgs []string
2054
	for _, err := range m {
2055
		msgs = append(msgs, err.Error())
2056
	}
2057
	return strings.Join(msgs, "; ")
2058
}
2059
2060
// AllErrors returns a list of validation violation errors.
2061
func (m RelationReferenceMultiError) AllErrors() []error { return m }
2062
2063
// RelationReferenceValidationError is the validation error returned by
2064
// RelationReference.Validate if the designated constraints aren't met.
2065
type RelationReferenceValidationError struct {
2066
	field  string
2067
	reason string
2068
	cause  error
2069
	key    bool
2070
}
2071
2072
// Field function returns field value.
2073
func (e RelationReferenceValidationError) Field() string { return e.field }
2074
2075
// Reason function returns reason value.
2076
func (e RelationReferenceValidationError) Reason() string { return e.reason }
2077
2078
// Cause function returns cause value.
2079
func (e RelationReferenceValidationError) Cause() error { return e.cause }
2080
2081
// Key function returns key value.
2082
func (e RelationReferenceValidationError) Key() bool { return e.key }
2083
2084
// ErrorName returns error name.
2085
func (e RelationReferenceValidationError) ErrorName() string {
2086
	return "RelationReferenceValidationError"
2087
}
2088
2089
// Error satisfies the builtin error interface
2090
func (e RelationReferenceValidationError) Error() string {
2091
	cause := ""
2092
	if e.cause != nil {
2093
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
2094
	}
2095
2096
	key := ""
2097
	if e.key {
2098
		key = "key for "
2099
	}
2100
2101
	return fmt.Sprintf(
2102
		"invalid %sRelationReference.%s: %s%s",
2103
		key,
2104
		e.field,
2105
		e.reason,
2106
		cause)
2107
}
2108
2109
var _ error = RelationReferenceValidationError{}
2110
2111
var _ interface {
2112
	Field() string
2113
	Reason() string
2114
	Key() bool
2115
	Cause() error
2116
	ErrorName() string
2117
} = RelationReferenceValidationError{}
2118
2119
var _RelationReference_Type_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$")
2120
2121
var _RelationReference_Relation_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$")
2122
2123
// Validate checks the field values on Argument with the rules defined in the
2124
// proto definition for this message. If any rules are violated, the first
2125
// error encountered is returned, or nil if there are no violations.
2126
func (m *Argument) Validate() error {
2127
	return m.validate(false)
2128
}
2129
2130
// ValidateAll checks the field values on Argument with the rules defined in
2131
// the proto definition for this message. If any rules are violated, the
2132
// result is a list of violation errors wrapped in ArgumentMultiError, or nil
2133
// if none found.
2134
func (m *Argument) ValidateAll() error {
2135
	return m.validate(true)
2136
}
2137
2138
func (m *Argument) validate(all bool) error {
2139
	if m == nil {
2140
		return nil
2141
	}
2142
2143
	var errors []error
2144
2145
	switch v := m.Type.(type) {
2146
	case *Argument_ComputedAttribute:
2147
		if v == nil {
2148
			err := ArgumentValidationError{
2149
				field:  "Type",
2150
				reason: "oneof value cannot be a typed-nil",
2151
			}
2152
			if !all {
2153
				return err
2154
			}
2155
			errors = append(errors, err)
2156
		}
2157
2158
		if all {
2159
			switch v := interface{}(m.GetComputedAttribute()).(type) {
2160
			case interface{ ValidateAll() error }:
2161
				if err := v.ValidateAll(); err != nil {
2162
					errors = append(errors, ArgumentValidationError{
2163
						field:  "ComputedAttribute",
2164
						reason: "embedded message failed validation",
2165
						cause:  err,
2166
					})
2167
				}
2168
			case interface{ Validate() error }:
2169
				if err := v.Validate(); err != nil {
2170
					errors = append(errors, ArgumentValidationError{
2171
						field:  "ComputedAttribute",
2172
						reason: "embedded message failed validation",
2173
						cause:  err,
2174
					})
2175
				}
2176
			}
2177
		} else if v, ok := interface{}(m.GetComputedAttribute()).(interface{ Validate() error }); ok {
2178
			if err := v.Validate(); err != nil {
2179
				return ArgumentValidationError{
2180
					field:  "ComputedAttribute",
2181
					reason: "embedded message failed validation",
2182
					cause:  err,
2183
				}
2184
			}
2185
		}
2186
2187
	case *Argument_ContextAttribute:
2188
		if v == nil {
2189
			err := ArgumentValidationError{
2190
				field:  "Type",
2191
				reason: "oneof value cannot be a typed-nil",
2192
			}
2193
			if !all {
2194
				return err
2195
			}
2196
			errors = append(errors, err)
2197
		}
2198
2199
		if all {
2200
			switch v := interface{}(m.GetContextAttribute()).(type) {
2201
			case interface{ ValidateAll() error }:
2202
				if err := v.ValidateAll(); err != nil {
2203
					errors = append(errors, ArgumentValidationError{
2204
						field:  "ContextAttribute",
2205
						reason: "embedded message failed validation",
2206
						cause:  err,
2207
					})
2208
				}
2209
			case interface{ Validate() error }:
2210
				if err := v.Validate(); err != nil {
2211
					errors = append(errors, ArgumentValidationError{
2212
						field:  "ContextAttribute",
2213
						reason: "embedded message failed validation",
2214
						cause:  err,
2215
					})
2216
				}
2217
			}
2218
		} else if v, ok := interface{}(m.GetContextAttribute()).(interface{ Validate() error }); ok {
2219
			if err := v.Validate(); err != nil {
2220
				return ArgumentValidationError{
2221
					field:  "ContextAttribute",
2222
					reason: "embedded message failed validation",
2223
					cause:  err,
2224
				}
2225
			}
2226
		}
2227
2228
	default:
2229
		_ = v // ensures v is used
2230
	}
2231
2232
	if len(errors) > 0 {
2233
		return ArgumentMultiError(errors)
2234
	}
2235
2236
	return nil
2237
}
2238
2239
// ArgumentMultiError is an error wrapping multiple validation errors returned
2240
// by Argument.ValidateAll() if the designated constraints aren't met.
2241
type ArgumentMultiError []error
2242
2243
// Error returns a concatenation of all the error messages it wraps.
2244
func (m ArgumentMultiError) Error() string {
2245
	var msgs []string
2246
	for _, err := range m {
2247
		msgs = append(msgs, err.Error())
2248
	}
2249
	return strings.Join(msgs, "; ")
2250
}
2251
2252
// AllErrors returns a list of validation violation errors.
2253
func (m ArgumentMultiError) AllErrors() []error { return m }
2254
2255
// ArgumentValidationError is the validation error returned by
2256
// Argument.Validate if the designated constraints aren't met.
2257
type ArgumentValidationError struct {
2258
	field  string
2259
	reason string
2260
	cause  error
2261
	key    bool
2262
}
2263
2264
// Field function returns field value.
2265
func (e ArgumentValidationError) Field() string { return e.field }
2266
2267
// Reason function returns reason value.
2268
func (e ArgumentValidationError) Reason() string { return e.reason }
2269
2270
// Cause function returns cause value.
2271
func (e ArgumentValidationError) Cause() error { return e.cause }
2272
2273
// Key function returns key value.
2274
func (e ArgumentValidationError) Key() bool { return e.key }
2275
2276
// ErrorName returns error name.
2277
func (e ArgumentValidationError) ErrorName() string { return "ArgumentValidationError" }
2278
2279
// Error satisfies the builtin error interface
2280
func (e ArgumentValidationError) Error() string {
2281
	cause := ""
2282
	if e.cause != nil {
2283
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
2284
	}
2285
2286
	key := ""
2287
	if e.key {
2288
		key = "key for "
2289
	}
2290
2291
	return fmt.Sprintf(
2292
		"invalid %sArgument.%s: %s%s",
2293
		key,
2294
		e.field,
2295
		e.reason,
2296
		cause)
2297
}
2298
2299
var _ error = ArgumentValidationError{}
2300
2301
var _ interface {
2302
	Field() string
2303
	Reason() string
2304
	Key() bool
2305
	Cause() error
2306
	ErrorName() string
2307
} = ArgumentValidationError{}
2308
2309
// Validate checks the field values on Call with the rules defined in the proto
2310
// definition for this message. If any rules are violated, the first error
2311
// encountered is returned, or nil if there are no violations.
2312
func (m *Call) Validate() error {
2313
	return m.validate(false)
2314
}
2315
2316
// ValidateAll checks the field values on Call with the rules defined in the
2317
// proto definition for this message. If any rules are violated, the result is
2318
// a list of violation errors wrapped in CallMultiError, or nil if none found.
2319
func (m *Call) ValidateAll() error {
2320
	return m.validate(true)
2321
}
2322
2323
func (m *Call) validate(all bool) error {
2324
	if m == nil {
2325
		return nil
2326
	}
2327
2328
	var errors []error
2329
2330
	// no validation rules for RuleName
2331
2332
	for idx, item := range m.GetArguments() {
2333
		_, _ = idx, item
2334
2335
		if all {
2336
			switch v := interface{}(item).(type) {
2337
			case interface{ ValidateAll() error }:
2338
				if err := v.ValidateAll(); err != nil {
2339
					errors = append(errors, CallValidationError{
2340
						field:  fmt.Sprintf("Arguments[%v]", idx),
2341
						reason: "embedded message failed validation",
2342
						cause:  err,
2343
					})
2344
				}
2345
			case interface{ Validate() error }:
2346
				if err := v.Validate(); err != nil {
2347
					errors = append(errors, CallValidationError{
2348
						field:  fmt.Sprintf("Arguments[%v]", idx),
2349
						reason: "embedded message failed validation",
2350
						cause:  err,
2351
					})
2352
				}
2353
			}
2354
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
2355
			if err := v.Validate(); err != nil {
2356
				return CallValidationError{
2357
					field:  fmt.Sprintf("Arguments[%v]", idx),
2358
					reason: "embedded message failed validation",
2359
					cause:  err,
2360
				}
2361
			}
2362
		}
2363
2364
	}
2365
2366
	if len(errors) > 0 {
2367
		return CallMultiError(errors)
2368
	}
2369
2370
	return nil
2371
}
2372
2373
// CallMultiError is an error wrapping multiple validation errors returned by
2374
// Call.ValidateAll() if the designated constraints aren't met.
2375
type CallMultiError []error
2376
2377
// Error returns a concatenation of all the error messages it wraps.
2378
func (m CallMultiError) Error() string {
2379
	var msgs []string
2380
	for _, err := range m {
2381
		msgs = append(msgs, err.Error())
2382
	}
2383
	return strings.Join(msgs, "; ")
2384
}
2385
2386
// AllErrors returns a list of validation violation errors.
2387
func (m CallMultiError) AllErrors() []error { return m }
2388
2389
// CallValidationError is the validation error returned by Call.Validate if the
2390
// designated constraints aren't met.
2391
type CallValidationError struct {
2392
	field  string
2393
	reason string
2394
	cause  error
2395
	key    bool
2396
}
2397
2398
// Field function returns field value.
2399
func (e CallValidationError) Field() string { return e.field }
2400
2401
// Reason function returns reason value.
2402
func (e CallValidationError) Reason() string { return e.reason }
2403
2404
// Cause function returns cause value.
2405
func (e CallValidationError) Cause() error { return e.cause }
2406
2407
// Key function returns key value.
2408
func (e CallValidationError) Key() bool { return e.key }
2409
2410
// ErrorName returns error name.
2411
func (e CallValidationError) ErrorName() string { return "CallValidationError" }
2412
2413
// Error satisfies the builtin error interface
2414
func (e CallValidationError) Error() string {
2415
	cause := ""
2416
	if e.cause != nil {
2417
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
2418
	}
2419
2420
	key := ""
2421
	if e.key {
2422
		key = "key for "
2423
	}
2424
2425
	return fmt.Sprintf(
2426
		"invalid %sCall.%s: %s%s",
2427
		key,
2428
		e.field,
2429
		e.reason,
2430
		cause)
2431
}
2432
2433
var _ error = CallValidationError{}
2434
2435
var _ interface {
2436
	Field() string
2437
	Reason() string
2438
	Key() bool
2439
	Cause() error
2440
	ErrorName() string
2441
} = CallValidationError{}
2442
2443
// Validate checks the field values on ComputedAttribute with the rules defined
2444
// in the proto definition for this message. If any rules are violated, the
2445
// first error encountered is returned, or nil if there are no violations.
2446
func (m *ComputedAttribute) Validate() error {
2447
	return m.validate(false)
2448
}
2449
2450
// ValidateAll checks the field values on ComputedAttribute with the rules
2451
// defined in the proto definition for this message. If any rules are
2452
// violated, the result is a list of violation errors wrapped in
2453
// ComputedAttributeMultiError, or nil if none found.
2454
func (m *ComputedAttribute) ValidateAll() error {
2455
	return m.validate(true)
2456
}
2457
2458
func (m *ComputedAttribute) validate(all bool) error {
2459
	if m == nil {
2460
		return nil
2461
	}
2462
2463
	var errors []error
2464
2465
	if len(m.GetName()) > 64 {
2466
		err := ComputedAttributeValidationError{
2467
			field:  "Name",
2468
			reason: "value length must be at most 64 bytes",
2469
		}
2470
		if !all {
2471
			return err
2472
		}
2473
		errors = append(errors, err)
2474
	}
2475
2476
	if !_ComputedAttribute_Name_Pattern.MatchString(m.GetName()) {
2477
		err := ComputedAttributeValidationError{
2478
			field:  "Name",
2479
			reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"",
2480
		}
2481
		if !all {
2482
			return err
2483
		}
2484
		errors = append(errors, err)
2485
	}
2486
2487
	if len(errors) > 0 {
2488
		return ComputedAttributeMultiError(errors)
2489
	}
2490
2491
	return nil
2492
}
2493
2494
// ComputedAttributeMultiError is an error wrapping multiple validation errors
2495
// returned by ComputedAttribute.ValidateAll() if the designated constraints
2496
// aren't met.
2497
type ComputedAttributeMultiError []error
2498
2499
// Error returns a concatenation of all the error messages it wraps.
2500
func (m ComputedAttributeMultiError) Error() string {
2501
	var msgs []string
2502
	for _, err := range m {
2503
		msgs = append(msgs, err.Error())
2504
	}
2505
	return strings.Join(msgs, "; ")
2506
}
2507
2508
// AllErrors returns a list of validation violation errors.
2509
func (m ComputedAttributeMultiError) AllErrors() []error { return m }
2510
2511
// ComputedAttributeValidationError is the validation error returned by
2512
// ComputedAttribute.Validate if the designated constraints aren't met.
2513
type ComputedAttributeValidationError struct {
2514
	field  string
2515
	reason string
2516
	cause  error
2517
	key    bool
2518
}
2519
2520
// Field function returns field value.
2521
func (e ComputedAttributeValidationError) Field() string { return e.field }
2522
2523
// Reason function returns reason value.
2524
func (e ComputedAttributeValidationError) Reason() string { return e.reason }
2525
2526
// Cause function returns cause value.
2527
func (e ComputedAttributeValidationError) Cause() error { return e.cause }
2528
2529
// Key function returns key value.
2530
func (e ComputedAttributeValidationError) Key() bool { return e.key }
2531
2532
// ErrorName returns error name.
2533
func (e ComputedAttributeValidationError) ErrorName() string {
2534
	return "ComputedAttributeValidationError"
2535
}
2536
2537
// Error satisfies the builtin error interface
2538
func (e ComputedAttributeValidationError) Error() string {
2539
	cause := ""
2540
	if e.cause != nil {
2541
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
2542
	}
2543
2544
	key := ""
2545
	if e.key {
2546
		key = "key for "
2547
	}
2548
2549
	return fmt.Sprintf(
2550
		"invalid %sComputedAttribute.%s: %s%s",
2551
		key,
2552
		e.field,
2553
		e.reason,
2554
		cause)
2555
}
2556
2557
var _ error = ComputedAttributeValidationError{}
2558
2559
var _ interface {
2560
	Field() string
2561
	Reason() string
2562
	Key() bool
2563
	Cause() error
2564
	ErrorName() string
2565
} = ComputedAttributeValidationError{}
2566
2567
var _ComputedAttribute_Name_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$")
2568
2569
// Validate checks the field values on ContextAttribute with the rules defined
2570
// in the proto definition for this message. If any rules are violated, the
2571
// first error encountered is returned, or nil if there are no violations.
2572
func (m *ContextAttribute) Validate() error {
2573
	return m.validate(false)
2574
}
2575
2576
// ValidateAll checks the field values on ContextAttribute with the rules
2577
// defined in the proto definition for this message. If any rules are
2578
// violated, the result is a list of violation errors wrapped in
2579
// ContextAttributeMultiError, or nil if none found.
2580
func (m *ContextAttribute) ValidateAll() error {
2581
	return m.validate(true)
2582
}
2583
2584
func (m *ContextAttribute) validate(all bool) error {
2585
	if m == nil {
2586
		return nil
2587
	}
2588
2589
	var errors []error
2590
2591
	if len(m.GetName()) > 64 {
2592
		err := ContextAttributeValidationError{
2593
			field:  "Name",
2594
			reason: "value length must be at most 64 bytes",
2595
		}
2596
		if !all {
2597
			return err
2598
		}
2599
		errors = append(errors, err)
2600
	}
2601
2602
	if !_ContextAttribute_Name_Pattern.MatchString(m.GetName()) {
2603
		err := ContextAttributeValidationError{
2604
			field:  "Name",
2605
			reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"",
2606
		}
2607
		if !all {
2608
			return err
2609
		}
2610
		errors = append(errors, err)
2611
	}
2612
2613
	if len(errors) > 0 {
2614
		return ContextAttributeMultiError(errors)
2615
	}
2616
2617
	return nil
2618
}
2619
2620
// ContextAttributeMultiError is an error wrapping multiple validation errors
2621
// returned by ContextAttribute.ValidateAll() if the designated constraints
2622
// aren't met.
2623
type ContextAttributeMultiError []error
2624
2625
// Error returns a concatenation of all the error messages it wraps.
2626
func (m ContextAttributeMultiError) Error() string {
2627
	var msgs []string
2628
	for _, err := range m {
2629
		msgs = append(msgs, err.Error())
2630
	}
2631
	return strings.Join(msgs, "; ")
2632
}
2633
2634
// AllErrors returns a list of validation violation errors.
2635
func (m ContextAttributeMultiError) AllErrors() []error { return m }
2636
2637
// ContextAttributeValidationError is the validation error returned by
2638
// ContextAttribute.Validate if the designated constraints aren't met.
2639
type ContextAttributeValidationError struct {
2640
	field  string
2641
	reason string
2642
	cause  error
2643
	key    bool
2644
}
2645
2646
// Field function returns field value.
2647
func (e ContextAttributeValidationError) Field() string { return e.field }
2648
2649
// Reason function returns reason value.
2650
func (e ContextAttributeValidationError) Reason() string { return e.reason }
2651
2652
// Cause function returns cause value.
2653
func (e ContextAttributeValidationError) Cause() error { return e.cause }
2654
2655
// Key function returns key value.
2656
func (e ContextAttributeValidationError) Key() bool { return e.key }
2657
2658
// ErrorName returns error name.
2659
func (e ContextAttributeValidationError) ErrorName() string { return "ContextAttributeValidationError" }
2660
2661
// Error satisfies the builtin error interface
2662
func (e ContextAttributeValidationError) Error() string {
2663
	cause := ""
2664
	if e.cause != nil {
2665
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
2666
	}
2667
2668
	key := ""
2669
	if e.key {
2670
		key = "key for "
2671
	}
2672
2673
	return fmt.Sprintf(
2674
		"invalid %sContextAttribute.%s: %s%s",
2675
		key,
2676
		e.field,
2677
		e.reason,
2678
		cause)
2679
}
2680
2681
var _ error = ContextAttributeValidationError{}
2682
2683
var _ interface {
2684
	Field() string
2685
	Reason() string
2686
	Key() bool
2687
	Cause() error
2688
	ErrorName() string
2689
} = ContextAttributeValidationError{}
2690
2691
var _ContextAttribute_Name_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$")
2692
2693
// Validate checks the field values on ComputedUserSet with the rules defined
2694
// in the proto definition for this message. If any rules are violated, the
2695
// first error encountered is returned, or nil if there are no violations.
2696
func (m *ComputedUserSet) Validate() error {
2697
	return m.validate(false)
2698
}
2699
2700
// ValidateAll checks the field values on ComputedUserSet with the rules
2701
// defined in the proto definition for this message. If any rules are
2702
// violated, the result is a list of violation errors wrapped in
2703
// ComputedUserSetMultiError, or nil if none found.
2704
func (m *ComputedUserSet) ValidateAll() error {
2705
	return m.validate(true)
2706
}
2707
2708
func (m *ComputedUserSet) validate(all bool) error {
2709
	if m == nil {
2710
		return nil
2711
	}
2712
2713
	var errors []error
2714
2715
	if len(m.GetRelation()) > 64 {
2716
		err := ComputedUserSetValidationError{
2717
			field:  "Relation",
2718
			reason: "value length must be at most 64 bytes",
2719
		}
2720
		if !all {
2721
			return err
2722
		}
2723
		errors = append(errors, err)
2724
	}
2725
2726
	if !_ComputedUserSet_Relation_Pattern.MatchString(m.GetRelation()) {
2727
		err := ComputedUserSetValidationError{
2728
			field:  "Relation",
2729
			reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"",
2730
		}
2731
		if !all {
2732
			return err
2733
		}
2734
		errors = append(errors, err)
2735
	}
2736
2737
	if len(errors) > 0 {
2738
		return ComputedUserSetMultiError(errors)
2739
	}
2740
2741
	return nil
2742
}
2743
2744
// ComputedUserSetMultiError is an error wrapping multiple validation errors
2745
// returned by ComputedUserSet.ValidateAll() if the designated constraints
2746
// aren't met.
2747
type ComputedUserSetMultiError []error
2748
2749
// Error returns a concatenation of all the error messages it wraps.
2750
func (m ComputedUserSetMultiError) Error() string {
2751
	var msgs []string
2752
	for _, err := range m {
2753
		msgs = append(msgs, err.Error())
2754
	}
2755
	return strings.Join(msgs, "; ")
2756
}
2757
2758
// AllErrors returns a list of validation violation errors.
2759
func (m ComputedUserSetMultiError) AllErrors() []error { return m }
2760
2761
// ComputedUserSetValidationError is the validation error returned by
2762
// ComputedUserSet.Validate if the designated constraints aren't met.
2763
type ComputedUserSetValidationError struct {
2764
	field  string
2765
	reason string
2766
	cause  error
2767
	key    bool
2768
}
2769
2770
// Field function returns field value.
2771
func (e ComputedUserSetValidationError) Field() string { return e.field }
2772
2773
// Reason function returns reason value.
2774
func (e ComputedUserSetValidationError) Reason() string { return e.reason }
2775
2776
// Cause function returns cause value.
2777
func (e ComputedUserSetValidationError) Cause() error { return e.cause }
2778
2779
// Key function returns key value.
2780
func (e ComputedUserSetValidationError) Key() bool { return e.key }
2781
2782
// ErrorName returns error name.
2783
func (e ComputedUserSetValidationError) ErrorName() string { return "ComputedUserSetValidationError" }
2784
2785
// Error satisfies the builtin error interface
2786
func (e ComputedUserSetValidationError) Error() string {
2787
	cause := ""
2788
	if e.cause != nil {
2789
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
2790
	}
2791
2792
	key := ""
2793
	if e.key {
2794
		key = "key for "
2795
	}
2796
2797
	return fmt.Sprintf(
2798
		"invalid %sComputedUserSet.%s: %s%s",
2799
		key,
2800
		e.field,
2801
		e.reason,
2802
		cause)
2803
}
2804
2805
var _ error = ComputedUserSetValidationError{}
2806
2807
var _ interface {
2808
	Field() string
2809
	Reason() string
2810
	Key() bool
2811
	Cause() error
2812
	ErrorName() string
2813
} = ComputedUserSetValidationError{}
2814
2815
var _ComputedUserSet_Relation_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$")
2816
2817
// Validate checks the field values on TupleToUserSet with the rules defined in
2818
// the proto definition for this message. If any rules are violated, the first
2819
// error encountered is returned, or nil if there are no violations.
2820
func (m *TupleToUserSet) Validate() error {
2821
	return m.validate(false)
2822
}
2823
2824
// ValidateAll checks the field values on TupleToUserSet with the rules defined
2825
// in the proto definition for this message. If any rules are violated, the
2826
// result is a list of violation errors wrapped in TupleToUserSetMultiError,
2827
// or nil if none found.
2828
func (m *TupleToUserSet) ValidateAll() error {
2829
	return m.validate(true)
2830
}
2831
2832
func (m *TupleToUserSet) validate(all bool) error {
2833
	if m == nil {
2834
		return nil
2835
	}
2836
2837
	var errors []error
2838
2839
	if all {
2840
		switch v := interface{}(m.GetTupleSet()).(type) {
2841
		case interface{ ValidateAll() error }:
2842
			if err := v.ValidateAll(); err != nil {
2843
				errors = append(errors, TupleToUserSetValidationError{
2844
					field:  "TupleSet",
2845
					reason: "embedded message failed validation",
2846
					cause:  err,
2847
				})
2848
			}
2849
		case interface{ Validate() error }:
2850
			if err := v.Validate(); err != nil {
2851
				errors = append(errors, TupleToUserSetValidationError{
2852
					field:  "TupleSet",
2853
					reason: "embedded message failed validation",
2854
					cause:  err,
2855
				})
2856
			}
2857
		}
2858
	} else if v, ok := interface{}(m.GetTupleSet()).(interface{ Validate() error }); ok {
2859
		if err := v.Validate(); err != nil {
2860
			return TupleToUserSetValidationError{
2861
				field:  "TupleSet",
2862
				reason: "embedded message failed validation",
2863
				cause:  err,
2864
			}
2865
		}
2866
	}
2867
2868
	if all {
2869
		switch v := interface{}(m.GetComputed()).(type) {
2870
		case interface{ ValidateAll() error }:
2871
			if err := v.ValidateAll(); err != nil {
2872
				errors = append(errors, TupleToUserSetValidationError{
2873
					field:  "Computed",
2874
					reason: "embedded message failed validation",
2875
					cause:  err,
2876
				})
2877
			}
2878
		case interface{ Validate() error }:
2879
			if err := v.Validate(); err != nil {
2880
				errors = append(errors, TupleToUserSetValidationError{
2881
					field:  "Computed",
2882
					reason: "embedded message failed validation",
2883
					cause:  err,
2884
				})
2885
			}
2886
		}
2887
	} else if v, ok := interface{}(m.GetComputed()).(interface{ Validate() error }); ok {
2888
		if err := v.Validate(); err != nil {
2889
			return TupleToUserSetValidationError{
2890
				field:  "Computed",
2891
				reason: "embedded message failed validation",
2892
				cause:  err,
2893
			}
2894
		}
2895
	}
2896
2897
	if len(errors) > 0 {
2898
		return TupleToUserSetMultiError(errors)
2899
	}
2900
2901
	return nil
2902
}
2903
2904
// TupleToUserSetMultiError is an error wrapping multiple validation errors
2905
// returned by TupleToUserSet.ValidateAll() if the designated constraints
2906
// aren't met.
2907
type TupleToUserSetMultiError []error
2908
2909
// Error returns a concatenation of all the error messages it wraps.
2910
func (m TupleToUserSetMultiError) Error() string {
2911
	var msgs []string
2912
	for _, err := range m {
2913
		msgs = append(msgs, err.Error())
2914
	}
2915
	return strings.Join(msgs, "; ")
2916
}
2917
2918
// AllErrors returns a list of validation violation errors.
2919
func (m TupleToUserSetMultiError) AllErrors() []error { return m }
2920
2921
// TupleToUserSetValidationError is the validation error returned by
2922
// TupleToUserSet.Validate if the designated constraints aren't met.
2923
type TupleToUserSetValidationError struct {
2924
	field  string
2925
	reason string
2926
	cause  error
2927
	key    bool
2928
}
2929
2930
// Field function returns field value.
2931
func (e TupleToUserSetValidationError) Field() string { return e.field }
2932
2933
// Reason function returns reason value.
2934
func (e TupleToUserSetValidationError) Reason() string { return e.reason }
2935
2936
// Cause function returns cause value.
2937
func (e TupleToUserSetValidationError) Cause() error { return e.cause }
2938
2939
// Key function returns key value.
2940
func (e TupleToUserSetValidationError) Key() bool { return e.key }
2941
2942
// ErrorName returns error name.
2943
func (e TupleToUserSetValidationError) ErrorName() string { return "TupleToUserSetValidationError" }
2944
2945
// Error satisfies the builtin error interface
2946
func (e TupleToUserSetValidationError) Error() string {
2947
	cause := ""
2948
	if e.cause != nil {
2949
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
2950
	}
2951
2952
	key := ""
2953
	if e.key {
2954
		key = "key for "
2955
	}
2956
2957
	return fmt.Sprintf(
2958
		"invalid %sTupleToUserSet.%s: %s%s",
2959
		key,
2960
		e.field,
2961
		e.reason,
2962
		cause)
2963
}
2964
2965
var _ error = TupleToUserSetValidationError{}
2966
2967
var _ interface {
2968
	Field() string
2969
	Reason() string
2970
	Key() bool
2971
	Cause() error
2972
	ErrorName() string
2973
} = TupleToUserSetValidationError{}
2974
2975
// Validate checks the field values on TupleSet with the rules defined in the
2976
// proto definition for this message. If any rules are violated, the first
2977
// error encountered is returned, or nil if there are no violations.
2978
func (m *TupleSet) Validate() error {
2979
	return m.validate(false)
2980
}
2981
2982
// ValidateAll checks the field values on TupleSet with the rules defined in
2983
// the proto definition for this message. If any rules are violated, the
2984
// result is a list of violation errors wrapped in TupleSetMultiError, or nil
2985
// if none found.
2986
func (m *TupleSet) ValidateAll() error {
2987
	return m.validate(true)
2988
}
2989
2990
func (m *TupleSet) validate(all bool) error {
2991
	if m == nil {
2992
		return nil
2993
	}
2994
2995
	var errors []error
2996
2997
	if len(m.GetRelation()) > 64 {
2998
		err := TupleSetValidationError{
2999
			field:  "Relation",
3000
			reason: "value length must be at most 64 bytes",
3001
		}
3002
		if !all {
3003
			return err
3004
		}
3005
		errors = append(errors, err)
3006
	}
3007
3008
	if !_TupleSet_Relation_Pattern.MatchString(m.GetRelation()) {
3009
		err := TupleSetValidationError{
3010
			field:  "Relation",
3011
			reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"",
3012
		}
3013
		if !all {
3014
			return err
3015
		}
3016
		errors = append(errors, err)
3017
	}
3018
3019
	if len(errors) > 0 {
3020
		return TupleSetMultiError(errors)
3021
	}
3022
3023
	return nil
3024
}
3025
3026
// TupleSetMultiError is an error wrapping multiple validation errors returned
3027
// by TupleSet.ValidateAll() if the designated constraints aren't met.
3028
type TupleSetMultiError []error
3029
3030
// Error returns a concatenation of all the error messages it wraps.
3031
func (m TupleSetMultiError) Error() string {
3032
	var msgs []string
3033
	for _, err := range m {
3034
		msgs = append(msgs, err.Error())
3035
	}
3036
	return strings.Join(msgs, "; ")
3037
}
3038
3039
// AllErrors returns a list of validation violation errors.
3040
func (m TupleSetMultiError) AllErrors() []error { return m }
3041
3042
// TupleSetValidationError is the validation error returned by
3043
// TupleSet.Validate if the designated constraints aren't met.
3044
type TupleSetValidationError struct {
3045
	field  string
3046
	reason string
3047
	cause  error
3048
	key    bool
3049
}
3050
3051
// Field function returns field value.
3052
func (e TupleSetValidationError) Field() string { return e.field }
3053
3054
// Reason function returns reason value.
3055
func (e TupleSetValidationError) Reason() string { return e.reason }
3056
3057
// Cause function returns cause value.
3058
func (e TupleSetValidationError) Cause() error { return e.cause }
3059
3060
// Key function returns key value.
3061
func (e TupleSetValidationError) Key() bool { return e.key }
3062
3063
// ErrorName returns error name.
3064
func (e TupleSetValidationError) ErrorName() string { return "TupleSetValidationError" }
3065
3066
// Error satisfies the builtin error interface
3067
func (e TupleSetValidationError) Error() string {
3068
	cause := ""
3069
	if e.cause != nil {
3070
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
3071
	}
3072
3073
	key := ""
3074
	if e.key {
3075
		key = "key for "
3076
	}
3077
3078
	return fmt.Sprintf(
3079
		"invalid %sTupleSet.%s: %s%s",
3080
		key,
3081
		e.field,
3082
		e.reason,
3083
		cause)
3084
}
3085
3086
var _ error = TupleSetValidationError{}
3087
3088
var _ interface {
3089
	Field() string
3090
	Reason() string
3091
	Key() bool
3092
	Cause() error
3093
	ErrorName() string
3094
} = TupleSetValidationError{}
3095
3096
var _TupleSet_Relation_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$")
3097
3098
// Validate checks the field values on Tuple with the rules defined in the
3099
// proto definition for this message. If any rules are violated, the first
3100
// error encountered is returned, or nil if there are no violations.
3101
func (m *Tuple) Validate() error {
3102
	return m.validate(false)
3103
}
3104
3105
// ValidateAll checks the field values on Tuple with the rules defined in the
3106
// proto definition for this message. If any rules are violated, the result is
3107
// a list of violation errors wrapped in TupleMultiError, or nil if none found.
3108
func (m *Tuple) ValidateAll() error {
3109
	return m.validate(true)
3110
}
3111
3112
func (m *Tuple) validate(all bool) error {
3113
	if m == nil {
3114
		return nil
3115
	}
3116
3117
	var errors []error
3118
3119
	if m.GetEntity() == nil {
3120
		err := TupleValidationError{
3121
			field:  "Entity",
3122
			reason: "value is required",
3123
		}
3124
		if !all {
3125
			return err
3126
		}
3127
		errors = append(errors, err)
3128
	}
3129
3130
	if all {
3131
		switch v := interface{}(m.GetEntity()).(type) {
3132
		case interface{ ValidateAll() error }:
3133
			if err := v.ValidateAll(); err != nil {
3134
				errors = append(errors, TupleValidationError{
3135
					field:  "Entity",
3136
					reason: "embedded message failed validation",
3137
					cause:  err,
3138
				})
3139
			}
3140
		case interface{ Validate() error }:
3141
			if err := v.Validate(); err != nil {
3142
				errors = append(errors, TupleValidationError{
3143
					field:  "Entity",
3144
					reason: "embedded message failed validation",
3145
					cause:  err,
3146
				})
3147
			}
3148
		}
3149
	} else if v, ok := interface{}(m.GetEntity()).(interface{ Validate() error }); ok {
3150
		if err := v.Validate(); err != nil {
3151
			return TupleValidationError{
3152
				field:  "Entity",
3153
				reason: "embedded message failed validation",
3154
				cause:  err,
3155
			}
3156
		}
3157
	}
3158
3159
	if len(m.GetRelation()) > 64 {
3160
		err := TupleValidationError{
3161
			field:  "Relation",
3162
			reason: "value length must be at most 64 bytes",
3163
		}
3164
		if !all {
3165
			return err
3166
		}
3167
		errors = append(errors, err)
3168
	}
3169
3170
	if !_Tuple_Relation_Pattern.MatchString(m.GetRelation()) {
3171
		err := TupleValidationError{
3172
			field:  "Relation",
3173
			reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"",
3174
		}
3175
		if !all {
3176
			return err
3177
		}
3178
		errors = append(errors, err)
3179
	}
3180
3181
	if m.GetSubject() == nil {
3182
		err := TupleValidationError{
3183
			field:  "Subject",
3184
			reason: "value is required",
3185
		}
3186
		if !all {
3187
			return err
3188
		}
3189
		errors = append(errors, err)
3190
	}
3191
3192
	if all {
3193
		switch v := interface{}(m.GetSubject()).(type) {
3194
		case interface{ ValidateAll() error }:
3195
			if err := v.ValidateAll(); err != nil {
3196
				errors = append(errors, TupleValidationError{
3197
					field:  "Subject",
3198
					reason: "embedded message failed validation",
3199
					cause:  err,
3200
				})
3201
			}
3202
		case interface{ Validate() error }:
3203
			if err := v.Validate(); err != nil {
3204
				errors = append(errors, TupleValidationError{
3205
					field:  "Subject",
3206
					reason: "embedded message failed validation",
3207
					cause:  err,
3208
				})
3209
			}
3210
		}
3211
	} else if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok {
3212
		if err := v.Validate(); err != nil {
3213
			return TupleValidationError{
3214
				field:  "Subject",
3215
				reason: "embedded message failed validation",
3216
				cause:  err,
3217
			}
3218
		}
3219
	}
3220
3221
	if len(errors) > 0 {
3222
		return TupleMultiError(errors)
3223
	}
3224
3225
	return nil
3226
}
3227
3228
// TupleMultiError is an error wrapping multiple validation errors returned by
3229
// Tuple.ValidateAll() if the designated constraints aren't met.
3230
type TupleMultiError []error
3231
3232
// Error returns a concatenation of all the error messages it wraps.
3233
func (m TupleMultiError) Error() string {
3234
	var msgs []string
3235
	for _, err := range m {
3236
		msgs = append(msgs, err.Error())
3237
	}
3238
	return strings.Join(msgs, "; ")
3239
}
3240
3241
// AllErrors returns a list of validation violation errors.
3242
func (m TupleMultiError) AllErrors() []error { return m }
3243
3244
// TupleValidationError is the validation error returned by Tuple.Validate if
3245
// the designated constraints aren't met.
3246
type TupleValidationError struct {
3247
	field  string
3248
	reason string
3249
	cause  error
3250
	key    bool
3251
}
3252
3253
// Field function returns field value.
3254
func (e TupleValidationError) Field() string { return e.field }
3255
3256
// Reason function returns reason value.
3257
func (e TupleValidationError) Reason() string { return e.reason }
3258
3259
// Cause function returns cause value.
3260
func (e TupleValidationError) Cause() error { return e.cause }
3261
3262
// Key function returns key value.
3263
func (e TupleValidationError) Key() bool { return e.key }
3264
3265
// ErrorName returns error name.
3266
func (e TupleValidationError) ErrorName() string { return "TupleValidationError" }
3267
3268
// Error satisfies the builtin error interface
3269
func (e TupleValidationError) Error() string {
3270
	cause := ""
3271
	if e.cause != nil {
3272
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
3273
	}
3274
3275
	key := ""
3276
	if e.key {
3277
		key = "key for "
3278
	}
3279
3280
	return fmt.Sprintf(
3281
		"invalid %sTuple.%s: %s%s",
3282
		key,
3283
		e.field,
3284
		e.reason,
3285
		cause)
3286
}
3287
3288
var _ error = TupleValidationError{}
3289
3290
var _ interface {
3291
	Field() string
3292
	Reason() string
3293
	Key() bool
3294
	Cause() error
3295
	ErrorName() string
3296
} = TupleValidationError{}
3297
3298
var _Tuple_Relation_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$")
3299
3300
// Validate checks the field values on Attribute with the rules defined in the
3301
// proto definition for this message. If any rules are violated, the first
3302
// error encountered is returned, or nil if there are no violations.
3303
func (m *Attribute) Validate() error {
3304
	return m.validate(false)
3305
}
3306
3307
// ValidateAll checks the field values on Attribute with the rules defined in
3308
// the proto definition for this message. If any rules are violated, the
3309
// result is a list of violation errors wrapped in AttributeMultiError, or nil
3310
// if none found.
3311
func (m *Attribute) ValidateAll() error {
3312
	return m.validate(true)
3313
}
3314
3315
func (m *Attribute) validate(all bool) error {
3316
	if m == nil {
3317
		return nil
3318
	}
3319
3320
	var errors []error
3321
3322
	if m.GetEntity() == nil {
3323
		err := AttributeValidationError{
3324
			field:  "Entity",
3325
			reason: "value is required",
3326
		}
3327
		if !all {
3328
			return err
3329
		}
3330
		errors = append(errors, err)
3331
	}
3332
3333
	if all {
3334
		switch v := interface{}(m.GetEntity()).(type) {
3335
		case interface{ ValidateAll() error }:
3336
			if err := v.ValidateAll(); err != nil {
3337
				errors = append(errors, AttributeValidationError{
3338
					field:  "Entity",
3339
					reason: "embedded message failed validation",
3340
					cause:  err,
3341
				})
3342
			}
3343
		case interface{ Validate() error }:
3344
			if err := v.Validate(); err != nil {
3345
				errors = append(errors, AttributeValidationError{
3346
					field:  "Entity",
3347
					reason: "embedded message failed validation",
3348
					cause:  err,
3349
				})
3350
			}
3351
		}
3352
	} else if v, ok := interface{}(m.GetEntity()).(interface{ Validate() error }); ok {
3353
		if err := v.Validate(); err != nil {
3354
			return AttributeValidationError{
3355
				field:  "Entity",
3356
				reason: "embedded message failed validation",
3357
				cause:  err,
3358
			}
3359
		}
3360
	}
3361
3362
	// no validation rules for Attribute
3363
3364
	if all {
3365
		switch v := interface{}(m.GetValue()).(type) {
3366
		case interface{ ValidateAll() error }:
3367
			if err := v.ValidateAll(); err != nil {
3368
				errors = append(errors, AttributeValidationError{
3369
					field:  "Value",
3370
					reason: "embedded message failed validation",
3371
					cause:  err,
3372
				})
3373
			}
3374
		case interface{ Validate() error }:
3375
			if err := v.Validate(); err != nil {
3376
				errors = append(errors, AttributeValidationError{
3377
					field:  "Value",
3378
					reason: "embedded message failed validation",
3379
					cause:  err,
3380
				})
3381
			}
3382
		}
3383
	} else if v, ok := interface{}(m.GetValue()).(interface{ Validate() error }); ok {
3384
		if err := v.Validate(); err != nil {
3385
			return AttributeValidationError{
3386
				field:  "Value",
3387
				reason: "embedded message failed validation",
3388
				cause:  err,
3389
			}
3390
		}
3391
	}
3392
3393
	if len(errors) > 0 {
3394
		return AttributeMultiError(errors)
3395
	}
3396
3397
	return nil
3398
}
3399
3400
// AttributeMultiError is an error wrapping multiple validation errors returned
3401
// by Attribute.ValidateAll() if the designated constraints aren't met.
3402
type AttributeMultiError []error
3403
3404
// Error returns a concatenation of all the error messages it wraps.
3405
func (m AttributeMultiError) Error() string {
3406
	var msgs []string
3407
	for _, err := range m {
3408
		msgs = append(msgs, err.Error())
3409
	}
3410
	return strings.Join(msgs, "; ")
3411
}
3412
3413
// AllErrors returns a list of validation violation errors.
3414
func (m AttributeMultiError) AllErrors() []error { return m }
3415
3416
// AttributeValidationError is the validation error returned by
3417
// Attribute.Validate if the designated constraints aren't met.
3418
type AttributeValidationError struct {
3419
	field  string
3420
	reason string
3421
	cause  error
3422
	key    bool
3423
}
3424
3425
// Field function returns field value.
3426
func (e AttributeValidationError) Field() string { return e.field }
3427
3428
// Reason function returns reason value.
3429
func (e AttributeValidationError) Reason() string { return e.reason }
3430
3431
// Cause function returns cause value.
3432
func (e AttributeValidationError) Cause() error { return e.cause }
3433
3434
// Key function returns key value.
3435
func (e AttributeValidationError) Key() bool { return e.key }
3436
3437
// ErrorName returns error name.
3438
func (e AttributeValidationError) ErrorName() string { return "AttributeValidationError" }
3439
3440
// Error satisfies the builtin error interface
3441
func (e AttributeValidationError) Error() string {
3442
	cause := ""
3443
	if e.cause != nil {
3444
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
3445
	}
3446
3447
	key := ""
3448
	if e.key {
3449
		key = "key for "
3450
	}
3451
3452
	return fmt.Sprintf(
3453
		"invalid %sAttribute.%s: %s%s",
3454
		key,
3455
		e.field,
3456
		e.reason,
3457
		cause)
3458
}
3459
3460
var _ error = AttributeValidationError{}
3461
3462
var _ interface {
3463
	Field() string
3464
	Reason() string
3465
	Key() bool
3466
	Cause() error
3467
	ErrorName() string
3468
} = AttributeValidationError{}
3469
3470
// Validate checks the field values on Tuples with the rules defined in the
3471
// proto definition for this message. If any rules are violated, the first
3472
// error encountered is returned, or nil if there are no violations.
3473
func (m *Tuples) Validate() error {
3474
	return m.validate(false)
3475
}
3476
3477
// ValidateAll checks the field values on Tuples with the rules defined in the
3478
// proto definition for this message. If any rules are violated, the result is
3479
// a list of violation errors wrapped in TuplesMultiError, or nil if none found.
3480
func (m *Tuples) ValidateAll() error {
3481
	return m.validate(true)
3482
}
3483
3484
func (m *Tuples) validate(all bool) error {
3485
	if m == nil {
3486
		return nil
3487
	}
3488
3489
	var errors []error
3490
3491
	for idx, item := range m.GetTuples() {
3492
		_, _ = idx, item
3493
3494
		if all {
3495
			switch v := interface{}(item).(type) {
3496
			case interface{ ValidateAll() error }:
3497
				if err := v.ValidateAll(); err != nil {
3498
					errors = append(errors, TuplesValidationError{
3499
						field:  fmt.Sprintf("Tuples[%v]", idx),
3500
						reason: "embedded message failed validation",
3501
						cause:  err,
3502
					})
3503
				}
3504
			case interface{ Validate() error }:
3505
				if err := v.Validate(); err != nil {
3506
					errors = append(errors, TuplesValidationError{
3507
						field:  fmt.Sprintf("Tuples[%v]", idx),
3508
						reason: "embedded message failed validation",
3509
						cause:  err,
3510
					})
3511
				}
3512
			}
3513
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
3514
			if err := v.Validate(); err != nil {
3515
				return TuplesValidationError{
3516
					field:  fmt.Sprintf("Tuples[%v]", idx),
3517
					reason: "embedded message failed validation",
3518
					cause:  err,
3519
				}
3520
			}
3521
		}
3522
3523
	}
3524
3525
	if len(errors) > 0 {
3526
		return TuplesMultiError(errors)
3527
	}
3528
3529
	return nil
3530
}
3531
3532
// TuplesMultiError is an error wrapping multiple validation errors returned by
3533
// Tuples.ValidateAll() if the designated constraints aren't met.
3534
type TuplesMultiError []error
3535
3536
// Error returns a concatenation of all the error messages it wraps.
3537
func (m TuplesMultiError) Error() string {
3538
	var msgs []string
3539
	for _, err := range m {
3540
		msgs = append(msgs, err.Error())
3541
	}
3542
	return strings.Join(msgs, "; ")
3543
}
3544
3545
// AllErrors returns a list of validation violation errors.
3546
func (m TuplesMultiError) AllErrors() []error { return m }
3547
3548
// TuplesValidationError is the validation error returned by Tuples.Validate if
3549
// the designated constraints aren't met.
3550
type TuplesValidationError struct {
3551
	field  string
3552
	reason string
3553
	cause  error
3554
	key    bool
3555
}
3556
3557
// Field function returns field value.
3558
func (e TuplesValidationError) Field() string { return e.field }
3559
3560
// Reason function returns reason value.
3561
func (e TuplesValidationError) Reason() string { return e.reason }
3562
3563
// Cause function returns cause value.
3564
func (e TuplesValidationError) Cause() error { return e.cause }
3565
3566
// Key function returns key value.
3567
func (e TuplesValidationError) Key() bool { return e.key }
3568
3569
// ErrorName returns error name.
3570
func (e TuplesValidationError) ErrorName() string { return "TuplesValidationError" }
3571
3572
// Error satisfies the builtin error interface
3573
func (e TuplesValidationError) Error() string {
3574
	cause := ""
3575
	if e.cause != nil {
3576
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
3577
	}
3578
3579
	key := ""
3580
	if e.key {
3581
		key = "key for "
3582
	}
3583
3584
	return fmt.Sprintf(
3585
		"invalid %sTuples.%s: %s%s",
3586
		key,
3587
		e.field,
3588
		e.reason,
3589
		cause)
3590
}
3591
3592
var _ error = TuplesValidationError{}
3593
3594
var _ interface {
3595
	Field() string
3596
	Reason() string
3597
	Key() bool
3598
	Cause() error
3599
	ErrorName() string
3600
} = TuplesValidationError{}
3601
3602
// Validate checks the field values on Attributes with the rules defined in the
3603
// proto definition for this message. If any rules are violated, the first
3604
// error encountered is returned, or nil if there are no violations.
3605
func (m *Attributes) Validate() error {
3606
	return m.validate(false)
3607
}
3608
3609
// ValidateAll checks the field values on Attributes with the rules defined in
3610
// the proto definition for this message. If any rules are violated, the
3611
// result is a list of violation errors wrapped in AttributesMultiError, or
3612
// nil if none found.
3613
func (m *Attributes) ValidateAll() error {
3614
	return m.validate(true)
3615
}
3616
3617
func (m *Attributes) validate(all bool) error {
3618
	if m == nil {
3619
		return nil
3620
	}
3621
3622
	var errors []error
3623
3624
	for idx, item := range m.GetAttributes() {
3625
		_, _ = idx, item
3626
3627
		if all {
3628
			switch v := interface{}(item).(type) {
3629
			case interface{ ValidateAll() error }:
3630
				if err := v.ValidateAll(); err != nil {
3631
					errors = append(errors, AttributesValidationError{
3632
						field:  fmt.Sprintf("Attributes[%v]", idx),
3633
						reason: "embedded message failed validation",
3634
						cause:  err,
3635
					})
3636
				}
3637
			case interface{ Validate() error }:
3638
				if err := v.Validate(); err != nil {
3639
					errors = append(errors, AttributesValidationError{
3640
						field:  fmt.Sprintf("Attributes[%v]", idx),
3641
						reason: "embedded message failed validation",
3642
						cause:  err,
3643
					})
3644
				}
3645
			}
3646
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
3647
			if err := v.Validate(); err != nil {
3648
				return AttributesValidationError{
3649
					field:  fmt.Sprintf("Attributes[%v]", idx),
3650
					reason: "embedded message failed validation",
3651
					cause:  err,
3652
				}
3653
			}
3654
		}
3655
3656
	}
3657
3658
	if len(errors) > 0 {
3659
		return AttributesMultiError(errors)
3660
	}
3661
3662
	return nil
3663
}
3664
3665
// AttributesMultiError is an error wrapping multiple validation errors
3666
// returned by Attributes.ValidateAll() if the designated constraints aren't met.
3667
type AttributesMultiError []error
3668
3669
// Error returns a concatenation of all the error messages it wraps.
3670
func (m AttributesMultiError) Error() string {
3671
	var msgs []string
3672
	for _, err := range m {
3673
		msgs = append(msgs, err.Error())
3674
	}
3675
	return strings.Join(msgs, "; ")
3676
}
3677
3678
// AllErrors returns a list of validation violation errors.
3679
func (m AttributesMultiError) AllErrors() []error { return m }
3680
3681
// AttributesValidationError is the validation error returned by
3682
// Attributes.Validate if the designated constraints aren't met.
3683
type AttributesValidationError struct {
3684
	field  string
3685
	reason string
3686
	cause  error
3687
	key    bool
3688
}
3689
3690
// Field function returns field value.
3691
func (e AttributesValidationError) Field() string { return e.field }
3692
3693
// Reason function returns reason value.
3694
func (e AttributesValidationError) Reason() string { return e.reason }
3695
3696
// Cause function returns cause value.
3697
func (e AttributesValidationError) Cause() error { return e.cause }
3698
3699
// Key function returns key value.
3700
func (e AttributesValidationError) Key() bool { return e.key }
3701
3702
// ErrorName returns error name.
3703
func (e AttributesValidationError) ErrorName() string { return "AttributesValidationError" }
3704
3705
// Error satisfies the builtin error interface
3706
func (e AttributesValidationError) Error() string {
3707
	cause := ""
3708
	if e.cause != nil {
3709
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
3710
	}
3711
3712
	key := ""
3713
	if e.key {
3714
		key = "key for "
3715
	}
3716
3717
	return fmt.Sprintf(
3718
		"invalid %sAttributes.%s: %s%s",
3719
		key,
3720
		e.field,
3721
		e.reason,
3722
		cause)
3723
}
3724
3725
var _ error = AttributesValidationError{}
3726
3727
var _ interface {
3728
	Field() string
3729
	Reason() string
3730
	Key() bool
3731
	Cause() error
3732
	ErrorName() string
3733
} = AttributesValidationError{}
3734
3735
// Validate checks the field values on Entity with the rules defined in the
3736
// proto definition for this message. If any rules are violated, the first
3737
// error encountered is returned, or nil if there are no violations.
3738
func (m *Entity) Validate() error {
3739
	return m.validate(false)
3740
}
3741
3742
// ValidateAll checks the field values on Entity with the rules defined in the
3743
// proto definition for this message. If any rules are violated, the result is
3744
// a list of violation errors wrapped in EntityMultiError, or nil if none found.
3745
func (m *Entity) ValidateAll() error {
3746
	return m.validate(true)
3747
}
3748
3749
func (m *Entity) validate(all bool) error {
3750
	if m == nil {
3751
		return nil
3752
	}
3753
3754
	var errors []error
3755
3756
	if len(m.GetType()) > 64 {
3757
		err := EntityValidationError{
3758
			field:  "Type",
3759
			reason: "value length must be at most 64 bytes",
3760
		}
3761
		if !all {
3762
			return err
3763
		}
3764
		errors = append(errors, err)
3765
	}
3766
3767
	if !_Entity_Type_Pattern.MatchString(m.GetType()) {
3768
		err := EntityValidationError{
3769
			field:  "Type",
3770
			reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"",
3771
		}
3772
		if !all {
3773
			return err
3774
		}
3775
		errors = append(errors, err)
3776
	}
3777
3778
	if len(m.GetId()) > 128 {
3779
		err := EntityValidationError{
3780
			field:  "Id",
3781
			reason: "value length must be at most 128 bytes",
3782
		}
3783
		if !all {
3784
			return err
3785
		}
3786
		errors = append(errors, err)
3787
	}
3788
3789
	if !_Entity_Id_Pattern.MatchString(m.GetId()) {
3790
		err := EntityValidationError{
3791
			field:  "Id",
3792
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
3793
		}
3794
		if !all {
3795
			return err
3796
		}
3797
		errors = append(errors, err)
3798
	}
3799
3800
	if len(errors) > 0 {
3801
		return EntityMultiError(errors)
3802
	}
3803
3804
	return nil
3805
}
3806
3807
// EntityMultiError is an error wrapping multiple validation errors returned by
3808
// Entity.ValidateAll() if the designated constraints aren't met.
3809
type EntityMultiError []error
3810
3811
// Error returns a concatenation of all the error messages it wraps.
3812
func (m EntityMultiError) Error() string {
3813
	var msgs []string
3814
	for _, err := range m {
3815
		msgs = append(msgs, err.Error())
3816
	}
3817
	return strings.Join(msgs, "; ")
3818
}
3819
3820
// AllErrors returns a list of validation violation errors.
3821
func (m EntityMultiError) AllErrors() []error { return m }
3822
3823
// EntityValidationError is the validation error returned by Entity.Validate if
3824
// the designated constraints aren't met.
3825
type EntityValidationError struct {
3826
	field  string
3827
	reason string
3828
	cause  error
3829
	key    bool
3830
}
3831
3832
// Field function returns field value.
3833
func (e EntityValidationError) Field() string { return e.field }
3834
3835
// Reason function returns reason value.
3836
func (e EntityValidationError) Reason() string { return e.reason }
3837
3838
// Cause function returns cause value.
3839
func (e EntityValidationError) Cause() error { return e.cause }
3840
3841
// Key function returns key value.
3842
func (e EntityValidationError) Key() bool { return e.key }
3843
3844
// ErrorName returns error name.
3845
func (e EntityValidationError) ErrorName() string { return "EntityValidationError" }
3846
3847
// Error satisfies the builtin error interface
3848
func (e EntityValidationError) Error() string {
3849
	cause := ""
3850
	if e.cause != nil {
3851
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
3852
	}
3853
3854
	key := ""
3855
	if e.key {
3856
		key = "key for "
3857
	}
3858
3859
	return fmt.Sprintf(
3860
		"invalid %sEntity.%s: %s%s",
3861
		key,
3862
		e.field,
3863
		e.reason,
3864
		cause)
3865
}
3866
3867
var _ error = EntityValidationError{}
3868
3869
var _ interface {
3870
	Field() string
3871
	Reason() string
3872
	Key() bool
3873
	Cause() error
3874
	ErrorName() string
3875
} = EntityValidationError{}
3876
3877
var _Entity_Type_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$")
3878
3879
var _Entity_Id_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
3880
3881
// Validate checks the field values on EntityAndRelation with the rules defined
3882
// in the proto definition for this message. If any rules are violated, the
3883
// first error encountered is returned, or nil if there are no violations.
3884
func (m *EntityAndRelation) Validate() error {
3885
	return m.validate(false)
3886
}
3887
3888
// ValidateAll checks the field values on EntityAndRelation with the rules
3889
// defined in the proto definition for this message. If any rules are
3890
// violated, the result is a list of violation errors wrapped in
3891
// EntityAndRelationMultiError, or nil if none found.
3892
func (m *EntityAndRelation) ValidateAll() error {
3893
	return m.validate(true)
3894
}
3895
3896
func (m *EntityAndRelation) validate(all bool) error {
3897
	if m == nil {
3898
		return nil
3899
	}
3900
3901
	var errors []error
3902
3903
	if m.GetEntity() == nil {
3904
		err := EntityAndRelationValidationError{
3905
			field:  "Entity",
3906
			reason: "value is required",
3907
		}
3908
		if !all {
3909
			return err
3910
		}
3911
		errors = append(errors, err)
3912
	}
3913
3914
	if all {
3915
		switch v := interface{}(m.GetEntity()).(type) {
3916
		case interface{ ValidateAll() error }:
3917
			if err := v.ValidateAll(); err != nil {
3918
				errors = append(errors, EntityAndRelationValidationError{
3919
					field:  "Entity",
3920
					reason: "embedded message failed validation",
3921
					cause:  err,
3922
				})
3923
			}
3924
		case interface{ Validate() error }:
3925
			if err := v.Validate(); err != nil {
3926
				errors = append(errors, EntityAndRelationValidationError{
3927
					field:  "Entity",
3928
					reason: "embedded message failed validation",
3929
					cause:  err,
3930
				})
3931
			}
3932
		}
3933
	} else if v, ok := interface{}(m.GetEntity()).(interface{ Validate() error }); ok {
3934
		if err := v.Validate(); err != nil {
3935
			return EntityAndRelationValidationError{
3936
				field:  "Entity",
3937
				reason: "embedded message failed validation",
3938
				cause:  err,
3939
			}
3940
		}
3941
	}
3942
3943
	if len(m.GetRelation()) > 64 {
3944
		err := EntityAndRelationValidationError{
3945
			field:  "Relation",
3946
			reason: "value length must be at most 64 bytes",
3947
		}
3948
		if !all {
3949
			return err
3950
		}
3951
		errors = append(errors, err)
3952
	}
3953
3954
	if !_EntityAndRelation_Relation_Pattern.MatchString(m.GetRelation()) {
3955
		err := EntityAndRelationValidationError{
3956
			field:  "Relation",
3957
			reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"",
3958
		}
3959
		if !all {
3960
			return err
3961
		}
3962
		errors = append(errors, err)
3963
	}
3964
3965
	if len(errors) > 0 {
3966
		return EntityAndRelationMultiError(errors)
3967
	}
3968
3969
	return nil
3970
}
3971
3972
// EntityAndRelationMultiError is an error wrapping multiple validation errors
3973
// returned by EntityAndRelation.ValidateAll() if the designated constraints
3974
// aren't met.
3975
type EntityAndRelationMultiError []error
3976
3977
// Error returns a concatenation of all the error messages it wraps.
3978
func (m EntityAndRelationMultiError) Error() string {
3979
	var msgs []string
3980
	for _, err := range m {
3981
		msgs = append(msgs, err.Error())
3982
	}
3983
	return strings.Join(msgs, "; ")
3984
}
3985
3986
// AllErrors returns a list of validation violation errors.
3987
func (m EntityAndRelationMultiError) AllErrors() []error { return m }
3988
3989
// EntityAndRelationValidationError is the validation error returned by
3990
// EntityAndRelation.Validate if the designated constraints aren't met.
3991
type EntityAndRelationValidationError struct {
3992
	field  string
3993
	reason string
3994
	cause  error
3995
	key    bool
3996
}
3997
3998
// Field function returns field value.
3999
func (e EntityAndRelationValidationError) Field() string { return e.field }
4000
4001
// Reason function returns reason value.
4002
func (e EntityAndRelationValidationError) Reason() string { return e.reason }
4003
4004
// Cause function returns cause value.
4005
func (e EntityAndRelationValidationError) Cause() error { return e.cause }
4006
4007
// Key function returns key value.
4008
func (e EntityAndRelationValidationError) Key() bool { return e.key }
4009
4010
// ErrorName returns error name.
4011
func (e EntityAndRelationValidationError) ErrorName() string {
4012
	return "EntityAndRelationValidationError"
4013
}
4014
4015
// Error satisfies the builtin error interface
4016
func (e EntityAndRelationValidationError) Error() string {
4017
	cause := ""
4018
	if e.cause != nil {
4019
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
4020
	}
4021
4022
	key := ""
4023
	if e.key {
4024
		key = "key for "
4025
	}
4026
4027
	return fmt.Sprintf(
4028
		"invalid %sEntityAndRelation.%s: %s%s",
4029
		key,
4030
		e.field,
4031
		e.reason,
4032
		cause)
4033
}
4034
4035
var _ error = EntityAndRelationValidationError{}
4036
4037
var _ interface {
4038
	Field() string
4039
	Reason() string
4040
	Key() bool
4041
	Cause() error
4042
	ErrorName() string
4043
} = EntityAndRelationValidationError{}
4044
4045
var _EntityAndRelation_Relation_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$")
4046
4047
// Validate checks the field values on Subject with the rules defined in the
4048
// proto definition for this message. If any rules are violated, the first
4049
// error encountered is returned, or nil if there are no violations.
4050
func (m *Subject) Validate() error {
4051
	return m.validate(false)
4052
}
4053
4054
// ValidateAll checks the field values on Subject with the rules defined in the
4055
// proto definition for this message. If any rules are violated, the result is
4056
// a list of violation errors wrapped in SubjectMultiError, or nil if none found.
4057
func (m *Subject) ValidateAll() error {
4058
	return m.validate(true)
4059
}
4060
4061
func (m *Subject) validate(all bool) error {
4062
	if m == nil {
4063
		return nil
4064
	}
4065
4066
	var errors []error
4067
4068
	if len(m.GetType()) > 64 {
4069
		err := SubjectValidationError{
4070
			field:  "Type",
4071
			reason: "value length must be at most 64 bytes",
4072
		}
4073
		if !all {
4074
			return err
4075
		}
4076
		errors = append(errors, err)
4077
	}
4078
4079
	if !_Subject_Type_Pattern.MatchString(m.GetType()) {
4080
		err := SubjectValidationError{
4081
			field:  "Type",
4082
			reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"",
4083
		}
4084
		if !all {
4085
			return err
4086
		}
4087
		errors = append(errors, err)
4088
	}
4089
4090
	if len(m.GetId()) > 128 {
4091
		err := SubjectValidationError{
4092
			field:  "Id",
4093
			reason: "value length must be at most 128 bytes",
4094
		}
4095
		if !all {
4096
			return err
4097
		}
4098
		errors = append(errors, err)
4099
	}
4100
4101
	if !_Subject_Id_Pattern.MatchString(m.GetId()) {
4102
		err := SubjectValidationError{
4103
			field:  "Id",
4104
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
4105
		}
4106
		if !all {
4107
			return err
4108
		}
4109
		errors = append(errors, err)
4110
	}
4111
4112
	if m.GetRelation() != "" {
4113
4114
		if len(m.GetRelation()) > 64 {
4115
			err := SubjectValidationError{
4116
				field:  "Relation",
4117
				reason: "value length must be at most 64 bytes",
4118
			}
4119
			if !all {
4120
				return err
4121
			}
4122
			errors = append(errors, err)
4123
		}
4124
4125
		if !_Subject_Relation_Pattern.MatchString(m.GetRelation()) {
4126
			err := SubjectValidationError{
4127
				field:  "Relation",
4128
				reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"",
4129
			}
4130
			if !all {
4131
				return err
4132
			}
4133
			errors = append(errors, err)
4134
		}
4135
4136
	}
4137
4138
	if len(errors) > 0 {
4139
		return SubjectMultiError(errors)
4140
	}
4141
4142
	return nil
4143
}
4144
4145
// SubjectMultiError is an error wrapping multiple validation errors returned
4146
// by Subject.ValidateAll() if the designated constraints aren't met.
4147
type SubjectMultiError []error
4148
4149
// Error returns a concatenation of all the error messages it wraps.
4150
func (m SubjectMultiError) Error() string {
4151
	var msgs []string
4152
	for _, err := range m {
4153
		msgs = append(msgs, err.Error())
4154
	}
4155
	return strings.Join(msgs, "; ")
4156
}
4157
4158
// AllErrors returns a list of validation violation errors.
4159
func (m SubjectMultiError) AllErrors() []error { return m }
4160
4161
// SubjectValidationError is the validation error returned by Subject.Validate
4162
// if the designated constraints aren't met.
4163
type SubjectValidationError struct {
4164
	field  string
4165
	reason string
4166
	cause  error
4167
	key    bool
4168
}
4169
4170
// Field function returns field value.
4171
func (e SubjectValidationError) Field() string { return e.field }
4172
4173
// Reason function returns reason value.
4174
func (e SubjectValidationError) Reason() string { return e.reason }
4175
4176
// Cause function returns cause value.
4177
func (e SubjectValidationError) Cause() error { return e.cause }
4178
4179
// Key function returns key value.
4180
func (e SubjectValidationError) Key() bool { return e.key }
4181
4182
// ErrorName returns error name.
4183
func (e SubjectValidationError) ErrorName() string { return "SubjectValidationError" }
4184
4185
// Error satisfies the builtin error interface
4186
func (e SubjectValidationError) Error() string {
4187
	cause := ""
4188
	if e.cause != nil {
4189
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
4190
	}
4191
4192
	key := ""
4193
	if e.key {
4194
		key = "key for "
4195
	}
4196
4197
	return fmt.Sprintf(
4198
		"invalid %sSubject.%s: %s%s",
4199
		key,
4200
		e.field,
4201
		e.reason,
4202
		cause)
4203
}
4204
4205
var _ error = SubjectValidationError{}
4206
4207
var _ interface {
4208
	Field() string
4209
	Reason() string
4210
	Key() bool
4211
	Cause() error
4212
	ErrorName() string
4213
} = SubjectValidationError{}
4214
4215
var _Subject_Type_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$")
4216
4217
var _Subject_Id_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
4218
4219
var _Subject_Relation_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$")
4220
4221
// Validate checks the field values on AttributeFilter with the rules defined
4222
// in the proto definition for this message. If any rules are violated, the
4223
// first error encountered is returned, or nil if there are no violations.
4224
func (m *AttributeFilter) Validate() error {
4225
	return m.validate(false)
4226
}
4227
4228
// ValidateAll checks the field values on AttributeFilter with the rules
4229
// defined in the proto definition for this message. If any rules are
4230
// violated, the result is a list of violation errors wrapped in
4231
// AttributeFilterMultiError, or nil if none found.
4232
func (m *AttributeFilter) ValidateAll() error {
4233
	return m.validate(true)
4234
}
4235
4236
func (m *AttributeFilter) validate(all bool) error {
4237
	if m == nil {
4238
		return nil
4239
	}
4240
4241
	var errors []error
4242
4243
	if all {
4244
		switch v := interface{}(m.GetEntity()).(type) {
4245
		case interface{ ValidateAll() error }:
4246
			if err := v.ValidateAll(); err != nil {
4247
				errors = append(errors, AttributeFilterValidationError{
4248
					field:  "Entity",
4249
					reason: "embedded message failed validation",
4250
					cause:  err,
4251
				})
4252
			}
4253
		case interface{ Validate() error }:
4254
			if err := v.Validate(); err != nil {
4255
				errors = append(errors, AttributeFilterValidationError{
4256
					field:  "Entity",
4257
					reason: "embedded message failed validation",
4258
					cause:  err,
4259
				})
4260
			}
4261
		}
4262
	} else if v, ok := interface{}(m.GetEntity()).(interface{ Validate() error }); ok {
4263
		if err := v.Validate(); err != nil {
4264
			return AttributeFilterValidationError{
4265
				field:  "Entity",
4266
				reason: "embedded message failed validation",
4267
				cause:  err,
4268
			}
4269
		}
4270
	}
4271
4272
	if len(errors) > 0 {
4273
		return AttributeFilterMultiError(errors)
4274
	}
4275
4276
	return nil
4277
}
4278
4279
// AttributeFilterMultiError is an error wrapping multiple validation errors
4280
// returned by AttributeFilter.ValidateAll() if the designated constraints
4281
// aren't met.
4282
type AttributeFilterMultiError []error
4283
4284
// Error returns a concatenation of all the error messages it wraps.
4285
func (m AttributeFilterMultiError) Error() string {
4286
	var msgs []string
4287
	for _, err := range m {
4288
		msgs = append(msgs, err.Error())
4289
	}
4290
	return strings.Join(msgs, "; ")
4291
}
4292
4293
// AllErrors returns a list of validation violation errors.
4294
func (m AttributeFilterMultiError) AllErrors() []error { return m }
4295
4296
// AttributeFilterValidationError is the validation error returned by
4297
// AttributeFilter.Validate if the designated constraints aren't met.
4298
type AttributeFilterValidationError struct {
4299
	field  string
4300
	reason string
4301
	cause  error
4302
	key    bool
4303
}
4304
4305
// Field function returns field value.
4306
func (e AttributeFilterValidationError) Field() string { return e.field }
4307
4308
// Reason function returns reason value.
4309
func (e AttributeFilterValidationError) Reason() string { return e.reason }
4310
4311
// Cause function returns cause value.
4312
func (e AttributeFilterValidationError) Cause() error { return e.cause }
4313
4314
// Key function returns key value.
4315
func (e AttributeFilterValidationError) Key() bool { return e.key }
4316
4317
// ErrorName returns error name.
4318
func (e AttributeFilterValidationError) ErrorName() string { return "AttributeFilterValidationError" }
4319
4320
// Error satisfies the builtin error interface
4321
func (e AttributeFilterValidationError) Error() string {
4322
	cause := ""
4323
	if e.cause != nil {
4324
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
4325
	}
4326
4327
	key := ""
4328
	if e.key {
4329
		key = "key for "
4330
	}
4331
4332
	return fmt.Sprintf(
4333
		"invalid %sAttributeFilter.%s: %s%s",
4334
		key,
4335
		e.field,
4336
		e.reason,
4337
		cause)
4338
}
4339
4340
var _ error = AttributeFilterValidationError{}
4341
4342
var _ interface {
4343
	Field() string
4344
	Reason() string
4345
	Key() bool
4346
	Cause() error
4347
	ErrorName() string
4348
} = AttributeFilterValidationError{}
4349
4350
// Validate checks the field values on TupleFilter with the rules defined in
4351
// the proto definition for this message. If any rules are violated, the first
4352
// error encountered is returned, or nil if there are no violations.
4353
func (m *TupleFilter) Validate() error {
4354
	return m.validate(false)
4355
}
4356
4357
// ValidateAll checks the field values on TupleFilter with the rules defined in
4358
// the proto definition for this message. If any rules are violated, the
4359
// result is a list of violation errors wrapped in TupleFilterMultiError, or
4360
// nil if none found.
4361
func (m *TupleFilter) ValidateAll() error {
4362
	return m.validate(true)
4363
}
4364
4365
func (m *TupleFilter) validate(all bool) error {
4366
	if m == nil {
4367
		return nil
4368
	}
4369
4370
	var errors []error
4371
4372
	if all {
4373
		switch v := interface{}(m.GetEntity()).(type) {
4374
		case interface{ ValidateAll() error }:
4375
			if err := v.ValidateAll(); err != nil {
4376
				errors = append(errors, TupleFilterValidationError{
4377
					field:  "Entity",
4378
					reason: "embedded message failed validation",
4379
					cause:  err,
4380
				})
4381
			}
4382
		case interface{ Validate() error }:
4383
			if err := v.Validate(); err != nil {
4384
				errors = append(errors, TupleFilterValidationError{
4385
					field:  "Entity",
4386
					reason: "embedded message failed validation",
4387
					cause:  err,
4388
				})
4389
			}
4390
		}
4391
	} else if v, ok := interface{}(m.GetEntity()).(interface{ Validate() error }); ok {
4392
		if err := v.Validate(); err != nil {
4393
			return TupleFilterValidationError{
4394
				field:  "Entity",
4395
				reason: "embedded message failed validation",
4396
				cause:  err,
4397
			}
4398
		}
4399
	}
4400
4401
	if m.GetRelation() != "" {
4402
4403
		if len(m.GetRelation()) > 64 {
4404
			err := TupleFilterValidationError{
4405
				field:  "Relation",
4406
				reason: "value length must be at most 64 bytes",
4407
			}
4408
			if !all {
4409
				return err
4410
			}
4411
			errors = append(errors, err)
4412
		}
4413
4414
		if !_TupleFilter_Relation_Pattern.MatchString(m.GetRelation()) {
4415
			err := TupleFilterValidationError{
4416
				field:  "Relation",
4417
				reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"",
4418
			}
4419
			if !all {
4420
				return err
4421
			}
4422
			errors = append(errors, err)
4423
		}
4424
4425
	}
4426
4427
	if all {
4428
		switch v := interface{}(m.GetSubject()).(type) {
4429
		case interface{ ValidateAll() error }:
4430
			if err := v.ValidateAll(); err != nil {
4431
				errors = append(errors, TupleFilterValidationError{
4432
					field:  "Subject",
4433
					reason: "embedded message failed validation",
4434
					cause:  err,
4435
				})
4436
			}
4437
		case interface{ Validate() error }:
4438
			if err := v.Validate(); err != nil {
4439
				errors = append(errors, TupleFilterValidationError{
4440
					field:  "Subject",
4441
					reason: "embedded message failed validation",
4442
					cause:  err,
4443
				})
4444
			}
4445
		}
4446
	} else if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok {
4447
		if err := v.Validate(); err != nil {
4448
			return TupleFilterValidationError{
4449
				field:  "Subject",
4450
				reason: "embedded message failed validation",
4451
				cause:  err,
4452
			}
4453
		}
4454
	}
4455
4456
	if len(errors) > 0 {
4457
		return TupleFilterMultiError(errors)
4458
	}
4459
4460
	return nil
4461
}
4462
4463
// TupleFilterMultiError is an error wrapping multiple validation errors
4464
// returned by TupleFilter.ValidateAll() if the designated constraints aren't met.
4465
type TupleFilterMultiError []error
4466
4467
// Error returns a concatenation of all the error messages it wraps.
4468
func (m TupleFilterMultiError) Error() string {
4469
	var msgs []string
4470
	for _, err := range m {
4471
		msgs = append(msgs, err.Error())
4472
	}
4473
	return strings.Join(msgs, "; ")
4474
}
4475
4476
// AllErrors returns a list of validation violation errors.
4477
func (m TupleFilterMultiError) AllErrors() []error { return m }
4478
4479
// TupleFilterValidationError is the validation error returned by
4480
// TupleFilter.Validate if the designated constraints aren't met.
4481
type TupleFilterValidationError struct {
4482
	field  string
4483
	reason string
4484
	cause  error
4485
	key    bool
4486
}
4487
4488
// Field function returns field value.
4489
func (e TupleFilterValidationError) Field() string { return e.field }
4490
4491
// Reason function returns reason value.
4492
func (e TupleFilterValidationError) Reason() string { return e.reason }
4493
4494
// Cause function returns cause value.
4495
func (e TupleFilterValidationError) Cause() error { return e.cause }
4496
4497
// Key function returns key value.
4498
func (e TupleFilterValidationError) Key() bool { return e.key }
4499
4500
// ErrorName returns error name.
4501
func (e TupleFilterValidationError) ErrorName() string { return "TupleFilterValidationError" }
4502
4503
// Error satisfies the builtin error interface
4504
func (e TupleFilterValidationError) Error() string {
4505
	cause := ""
4506
	if e.cause != nil {
4507
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
4508
	}
4509
4510
	key := ""
4511
	if e.key {
4512
		key = "key for "
4513
	}
4514
4515
	return fmt.Sprintf(
4516
		"invalid %sTupleFilter.%s: %s%s",
4517
		key,
4518
		e.field,
4519
		e.reason,
4520
		cause)
4521
}
4522
4523
var _ error = TupleFilterValidationError{}
4524
4525
var _ interface {
4526
	Field() string
4527
	Reason() string
4528
	Key() bool
4529
	Cause() error
4530
	ErrorName() string
4531
} = TupleFilterValidationError{}
4532
4533
var _TupleFilter_Relation_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$")
4534
4535
// Validate checks the field values on EntityFilter with the rules defined in
4536
// the proto definition for this message. If any rules are violated, the first
4537
// error encountered is returned, or nil if there are no violations.
4538
func (m *EntityFilter) Validate() error {
4539
	return m.validate(false)
4540
}
4541
4542
// ValidateAll checks the field values on EntityFilter with the rules defined
4543
// in the proto definition for this message. If any rules are violated, the
4544
// result is a list of violation errors wrapped in EntityFilterMultiError, or
4545
// nil if none found.
4546
func (m *EntityFilter) ValidateAll() error {
4547
	return m.validate(true)
4548
}
4549
4550
func (m *EntityFilter) validate(all bool) error {
4551
	if m == nil {
4552
		return nil
4553
	}
4554
4555
	var errors []error
4556
4557
	// no validation rules for Type
4558
4559
	if len(errors) > 0 {
4560
		return EntityFilterMultiError(errors)
4561
	}
4562
4563
	return nil
4564
}
4565
4566
// EntityFilterMultiError is an error wrapping multiple validation errors
4567
// returned by EntityFilter.ValidateAll() if the designated constraints aren't met.
4568
type EntityFilterMultiError []error
4569
4570
// Error returns a concatenation of all the error messages it wraps.
4571
func (m EntityFilterMultiError) Error() string {
4572
	var msgs []string
4573
	for _, err := range m {
4574
		msgs = append(msgs, err.Error())
4575
	}
4576
	return strings.Join(msgs, "; ")
4577
}
4578
4579
// AllErrors returns a list of validation violation errors.
4580
func (m EntityFilterMultiError) AllErrors() []error { return m }
4581
4582
// EntityFilterValidationError is the validation error returned by
4583
// EntityFilter.Validate if the designated constraints aren't met.
4584
type EntityFilterValidationError struct {
4585
	field  string
4586
	reason string
4587
	cause  error
4588
	key    bool
4589
}
4590
4591
// Field function returns field value.
4592
func (e EntityFilterValidationError) Field() string { return e.field }
4593
4594
// Reason function returns reason value.
4595
func (e EntityFilterValidationError) Reason() string { return e.reason }
4596
4597
// Cause function returns cause value.
4598
func (e EntityFilterValidationError) Cause() error { return e.cause }
4599
4600
// Key function returns key value.
4601
func (e EntityFilterValidationError) Key() bool { return e.key }
4602
4603
// ErrorName returns error name.
4604
func (e EntityFilterValidationError) ErrorName() string { return "EntityFilterValidationError" }
4605
4606
// Error satisfies the builtin error interface
4607
func (e EntityFilterValidationError) Error() string {
4608
	cause := ""
4609
	if e.cause != nil {
4610
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
4611
	}
4612
4613
	key := ""
4614
	if e.key {
4615
		key = "key for "
4616
	}
4617
4618
	return fmt.Sprintf(
4619
		"invalid %sEntityFilter.%s: %s%s",
4620
		key,
4621
		e.field,
4622
		e.reason,
4623
		cause)
4624
}
4625
4626
var _ error = EntityFilterValidationError{}
4627
4628
var _ interface {
4629
	Field() string
4630
	Reason() string
4631
	Key() bool
4632
	Cause() error
4633
	ErrorName() string
4634
} = EntityFilterValidationError{}
4635
4636
// Validate checks the field values on SubjectFilter with the rules defined in
4637
// the proto definition for this message. If any rules are violated, the first
4638
// error encountered is returned, or nil if there are no violations.
4639
func (m *SubjectFilter) Validate() error {
4640
	return m.validate(false)
4641
}
4642
4643
// ValidateAll checks the field values on SubjectFilter with the rules defined
4644
// in the proto definition for this message. If any rules are violated, the
4645
// result is a list of violation errors wrapped in SubjectFilterMultiError, or
4646
// nil if none found.
4647
func (m *SubjectFilter) ValidateAll() error {
4648
	return m.validate(true)
4649
}
4650
4651
func (m *SubjectFilter) validate(all bool) error {
4652
	if m == nil {
4653
		return nil
4654
	}
4655
4656
	var errors []error
4657
4658
	// no validation rules for Type
4659
4660
	if m.GetRelation() != "" {
4661
4662
		if len(m.GetRelation()) > 64 {
4663
			err := SubjectFilterValidationError{
4664
				field:  "Relation",
4665
				reason: "value length must be at most 64 bytes",
4666
			}
4667
			if !all {
4668
				return err
4669
			}
4670
			errors = append(errors, err)
4671
		}
4672
4673
		if !_SubjectFilter_Relation_Pattern.MatchString(m.GetRelation()) {
4674
			err := SubjectFilterValidationError{
4675
				field:  "Relation",
4676
				reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"",
4677
			}
4678
			if !all {
4679
				return err
4680
			}
4681
			errors = append(errors, err)
4682
		}
4683
4684
	}
4685
4686
	if len(errors) > 0 {
4687
		return SubjectFilterMultiError(errors)
4688
	}
4689
4690
	return nil
4691
}
4692
4693
// SubjectFilterMultiError is an error wrapping multiple validation errors
4694
// returned by SubjectFilter.ValidateAll() if the designated constraints
4695
// aren't met.
4696
type SubjectFilterMultiError []error
4697
4698
// Error returns a concatenation of all the error messages it wraps.
4699
func (m SubjectFilterMultiError) Error() string {
4700
	var msgs []string
4701
	for _, err := range m {
4702
		msgs = append(msgs, err.Error())
4703
	}
4704
	return strings.Join(msgs, "; ")
4705
}
4706
4707
// AllErrors returns a list of validation violation errors.
4708
func (m SubjectFilterMultiError) AllErrors() []error { return m }
4709
4710
// SubjectFilterValidationError is the validation error returned by
4711
// SubjectFilter.Validate if the designated constraints aren't met.
4712
type SubjectFilterValidationError struct {
4713
	field  string
4714
	reason string
4715
	cause  error
4716
	key    bool
4717
}
4718
4719
// Field function returns field value.
4720
func (e SubjectFilterValidationError) Field() string { return e.field }
4721
4722
// Reason function returns reason value.
4723
func (e SubjectFilterValidationError) Reason() string { return e.reason }
4724
4725
// Cause function returns cause value.
4726
func (e SubjectFilterValidationError) Cause() error { return e.cause }
4727
4728
// Key function returns key value.
4729
func (e SubjectFilterValidationError) Key() bool { return e.key }
4730
4731
// ErrorName returns error name.
4732
func (e SubjectFilterValidationError) ErrorName() string { return "SubjectFilterValidationError" }
4733
4734
// Error satisfies the builtin error interface
4735
func (e SubjectFilterValidationError) Error() string {
4736
	cause := ""
4737
	if e.cause != nil {
4738
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
4739
	}
4740
4741
	key := ""
4742
	if e.key {
4743
		key = "key for "
4744
	}
4745
4746
	return fmt.Sprintf(
4747
		"invalid %sSubjectFilter.%s: %s%s",
4748
		key,
4749
		e.field,
4750
		e.reason,
4751
		cause)
4752
}
4753
4754
var _ error = SubjectFilterValidationError{}
4755
4756
var _ interface {
4757
	Field() string
4758
	Reason() string
4759
	Key() bool
4760
	Cause() error
4761
	ErrorName() string
4762
} = SubjectFilterValidationError{}
4763
4764
var _SubjectFilter_Relation_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$")
4765
4766
// Validate checks the field values on ExpandTreeNode with the rules defined in
4767
// the proto definition for this message. If any rules are violated, the first
4768
// error encountered is returned, or nil if there are no violations.
4769
func (m *ExpandTreeNode) Validate() error {
4770
	return m.validate(false)
4771
}
4772
4773
// ValidateAll checks the field values on ExpandTreeNode with the rules defined
4774
// in the proto definition for this message. If any rules are violated, the
4775
// result is a list of violation errors wrapped in ExpandTreeNodeMultiError,
4776
// or nil if none found.
4777
func (m *ExpandTreeNode) ValidateAll() error {
4778
	return m.validate(true)
4779
}
4780
4781
func (m *ExpandTreeNode) validate(all bool) error {
4782
	if m == nil {
4783
		return nil
4784
	}
4785
4786
	var errors []error
4787
4788
	// no validation rules for Operation
4789
4790
	for idx, item := range m.GetChildren() {
4791
		_, _ = idx, item
4792
4793
		if all {
4794
			switch v := interface{}(item).(type) {
4795
			case interface{ ValidateAll() error }:
4796
				if err := v.ValidateAll(); err != nil {
4797
					errors = append(errors, ExpandTreeNodeValidationError{
4798
						field:  fmt.Sprintf("Children[%v]", idx),
4799
						reason: "embedded message failed validation",
4800
						cause:  err,
4801
					})
4802
				}
4803
			case interface{ Validate() error }:
4804
				if err := v.Validate(); err != nil {
4805
					errors = append(errors, ExpandTreeNodeValidationError{
4806
						field:  fmt.Sprintf("Children[%v]", idx),
4807
						reason: "embedded message failed validation",
4808
						cause:  err,
4809
					})
4810
				}
4811
			}
4812
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
4813
			if err := v.Validate(); err != nil {
4814
				return ExpandTreeNodeValidationError{
4815
					field:  fmt.Sprintf("Children[%v]", idx),
4816
					reason: "embedded message failed validation",
4817
					cause:  err,
4818
				}
4819
			}
4820
		}
4821
4822
	}
4823
4824
	if len(errors) > 0 {
4825
		return ExpandTreeNodeMultiError(errors)
4826
	}
4827
4828
	return nil
4829
}
4830
4831
// ExpandTreeNodeMultiError is an error wrapping multiple validation errors
4832
// returned by ExpandTreeNode.ValidateAll() if the designated constraints
4833
// aren't met.
4834
type ExpandTreeNodeMultiError []error
4835
4836
// Error returns a concatenation of all the error messages it wraps.
4837
func (m ExpandTreeNodeMultiError) Error() string {
4838
	var msgs []string
4839
	for _, err := range m {
4840
		msgs = append(msgs, err.Error())
4841
	}
4842
	return strings.Join(msgs, "; ")
4843
}
4844
4845
// AllErrors returns a list of validation violation errors.
4846
func (m ExpandTreeNodeMultiError) AllErrors() []error { return m }
4847
4848
// ExpandTreeNodeValidationError is the validation error returned by
4849
// ExpandTreeNode.Validate if the designated constraints aren't met.
4850
type ExpandTreeNodeValidationError struct {
4851
	field  string
4852
	reason string
4853
	cause  error
4854
	key    bool
4855
}
4856
4857
// Field function returns field value.
4858
func (e ExpandTreeNodeValidationError) Field() string { return e.field }
4859
4860
// Reason function returns reason value.
4861
func (e ExpandTreeNodeValidationError) Reason() string { return e.reason }
4862
4863
// Cause function returns cause value.
4864
func (e ExpandTreeNodeValidationError) Cause() error { return e.cause }
4865
4866
// Key function returns key value.
4867
func (e ExpandTreeNodeValidationError) Key() bool { return e.key }
4868
4869
// ErrorName returns error name.
4870
func (e ExpandTreeNodeValidationError) ErrorName() string { return "ExpandTreeNodeValidationError" }
4871
4872
// Error satisfies the builtin error interface
4873
func (e ExpandTreeNodeValidationError) Error() string {
4874
	cause := ""
4875
	if e.cause != nil {
4876
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
4877
	}
4878
4879
	key := ""
4880
	if e.key {
4881
		key = "key for "
4882
	}
4883
4884
	return fmt.Sprintf(
4885
		"invalid %sExpandTreeNode.%s: %s%s",
4886
		key,
4887
		e.field,
4888
		e.reason,
4889
		cause)
4890
}
4891
4892
var _ error = ExpandTreeNodeValidationError{}
4893
4894
var _ interface {
4895
	Field() string
4896
	Reason() string
4897
	Key() bool
4898
	Cause() error
4899
	ErrorName() string
4900
} = ExpandTreeNodeValidationError{}
4901
4902
// Validate checks the field values on Expand with the rules defined in the
4903
// proto definition for this message. If any rules are violated, the first
4904
// error encountered is returned, or nil if there are no violations.
4905
func (m *Expand) Validate() error {
4906
	return m.validate(false)
4907
}
4908
4909
// ValidateAll checks the field values on Expand with the rules defined in the
4910
// proto definition for this message. If any rules are violated, the result is
4911
// a list of violation errors wrapped in ExpandMultiError, or nil if none found.
4912
func (m *Expand) ValidateAll() error {
4913
	return m.validate(true)
4914
}
4915
4916
func (m *Expand) validate(all bool) error {
4917
	if m == nil {
4918
		return nil
4919
	}
4920
4921
	var errors []error
4922
4923
	if all {
4924
		switch v := interface{}(m.GetEntity()).(type) {
4925
		case interface{ ValidateAll() error }:
4926
			if err := v.ValidateAll(); err != nil {
4927
				errors = append(errors, ExpandValidationError{
4928
					field:  "Entity",
4929
					reason: "embedded message failed validation",
4930
					cause:  err,
4931
				})
4932
			}
4933
		case interface{ Validate() error }:
4934
			if err := v.Validate(); err != nil {
4935
				errors = append(errors, ExpandValidationError{
4936
					field:  "Entity",
4937
					reason: "embedded message failed validation",
4938
					cause:  err,
4939
				})
4940
			}
4941
		}
4942
	} else if v, ok := interface{}(m.GetEntity()).(interface{ Validate() error }); ok {
4943
		if err := v.Validate(); err != nil {
4944
			return ExpandValidationError{
4945
				field:  "Entity",
4946
				reason: "embedded message failed validation",
4947
				cause:  err,
4948
			}
4949
		}
4950
	}
4951
4952
	// no validation rules for Permission
4953
4954
	for idx, item := range m.GetArguments() {
4955
		_, _ = idx, item
4956
4957
		if all {
4958
			switch v := interface{}(item).(type) {
4959
			case interface{ ValidateAll() error }:
4960
				if err := v.ValidateAll(); err != nil {
4961
					errors = append(errors, ExpandValidationError{
4962
						field:  fmt.Sprintf("Arguments[%v]", idx),
4963
						reason: "embedded message failed validation",
4964
						cause:  err,
4965
					})
4966
				}
4967
			case interface{ Validate() error }:
4968
				if err := v.Validate(); err != nil {
4969
					errors = append(errors, ExpandValidationError{
4970
						field:  fmt.Sprintf("Arguments[%v]", idx),
4971
						reason: "embedded message failed validation",
4972
						cause:  err,
4973
					})
4974
				}
4975
			}
4976
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
4977
			if err := v.Validate(); err != nil {
4978
				return ExpandValidationError{
4979
					field:  fmt.Sprintf("Arguments[%v]", idx),
4980
					reason: "embedded message failed validation",
4981
					cause:  err,
4982
				}
4983
			}
4984
		}
4985
4986
	}
4987
4988
	switch v := m.Node.(type) {
4989
	case *Expand_Expand:
4990
		if v == nil {
4991
			err := ExpandValidationError{
4992
				field:  "Node",
4993
				reason: "oneof value cannot be a typed-nil",
4994
			}
4995
			if !all {
4996
				return err
4997
			}
4998
			errors = append(errors, err)
4999
		}
5000
5001
		if all {
5002
			switch v := interface{}(m.GetExpand()).(type) {
5003
			case interface{ ValidateAll() error }:
5004
				if err := v.ValidateAll(); err != nil {
5005
					errors = append(errors, ExpandValidationError{
5006
						field:  "Expand",
5007
						reason: "embedded message failed validation",
5008
						cause:  err,
5009
					})
5010
				}
5011
			case interface{ Validate() error }:
5012
				if err := v.Validate(); err != nil {
5013
					errors = append(errors, ExpandValidationError{
5014
						field:  "Expand",
5015
						reason: "embedded message failed validation",
5016
						cause:  err,
5017
					})
5018
				}
5019
			}
5020
		} else if v, ok := interface{}(m.GetExpand()).(interface{ Validate() error }); ok {
5021
			if err := v.Validate(); err != nil {
5022
				return ExpandValidationError{
5023
					field:  "Expand",
5024
					reason: "embedded message failed validation",
5025
					cause:  err,
5026
				}
5027
			}
5028
		}
5029
5030
	case *Expand_Leaf:
5031
		if v == nil {
5032
			err := ExpandValidationError{
5033
				field:  "Node",
5034
				reason: "oneof value cannot be a typed-nil",
5035
			}
5036
			if !all {
5037
				return err
5038
			}
5039
			errors = append(errors, err)
5040
		}
5041
5042
		if all {
5043
			switch v := interface{}(m.GetLeaf()).(type) {
5044
			case interface{ ValidateAll() error }:
5045
				if err := v.ValidateAll(); err != nil {
5046
					errors = append(errors, ExpandValidationError{
5047
						field:  "Leaf",
5048
						reason: "embedded message failed validation",
5049
						cause:  err,
5050
					})
5051
				}
5052
			case interface{ Validate() error }:
5053
				if err := v.Validate(); err != nil {
5054
					errors = append(errors, ExpandValidationError{
5055
						field:  "Leaf",
5056
						reason: "embedded message failed validation",
5057
						cause:  err,
5058
					})
5059
				}
5060
			}
5061
		} else if v, ok := interface{}(m.GetLeaf()).(interface{ Validate() error }); ok {
5062
			if err := v.Validate(); err != nil {
5063
				return ExpandValidationError{
5064
					field:  "Leaf",
5065
					reason: "embedded message failed validation",
5066
					cause:  err,
5067
				}
5068
			}
5069
		}
5070
5071
	default:
5072
		_ = v // ensures v is used
5073
	}
5074
5075
	if len(errors) > 0 {
5076
		return ExpandMultiError(errors)
5077
	}
5078
5079
	return nil
5080
}
5081
5082
// ExpandMultiError is an error wrapping multiple validation errors returned by
5083
// Expand.ValidateAll() if the designated constraints aren't met.
5084
type ExpandMultiError []error
5085
5086
// Error returns a concatenation of all the error messages it wraps.
5087
func (m ExpandMultiError) Error() string {
5088
	var msgs []string
5089
	for _, err := range m {
5090
		msgs = append(msgs, err.Error())
5091
	}
5092
	return strings.Join(msgs, "; ")
5093
}
5094
5095
// AllErrors returns a list of validation violation errors.
5096
func (m ExpandMultiError) AllErrors() []error { return m }
5097
5098
// ExpandValidationError is the validation error returned by Expand.Validate if
5099
// the designated constraints aren't met.
5100
type ExpandValidationError struct {
5101
	field  string
5102
	reason string
5103
	cause  error
5104
	key    bool
5105
}
5106
5107
// Field function returns field value.
5108
func (e ExpandValidationError) Field() string { return e.field }
5109
5110
// Reason function returns reason value.
5111
func (e ExpandValidationError) Reason() string { return e.reason }
5112
5113
// Cause function returns cause value.
5114
func (e ExpandValidationError) Cause() error { return e.cause }
5115
5116
// Key function returns key value.
5117
func (e ExpandValidationError) Key() bool { return e.key }
5118
5119
// ErrorName returns error name.
5120
func (e ExpandValidationError) ErrorName() string { return "ExpandValidationError" }
5121
5122
// Error satisfies the builtin error interface
5123
func (e ExpandValidationError) Error() string {
5124
	cause := ""
5125
	if e.cause != nil {
5126
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
5127
	}
5128
5129
	key := ""
5130
	if e.key {
5131
		key = "key for "
5132
	}
5133
5134
	return fmt.Sprintf(
5135
		"invalid %sExpand.%s: %s%s",
5136
		key,
5137
		e.field,
5138
		e.reason,
5139
		cause)
5140
}
5141
5142
var _ error = ExpandValidationError{}
5143
5144
var _ interface {
5145
	Field() string
5146
	Reason() string
5147
	Key() bool
5148
	Cause() error
5149
	ErrorName() string
5150
} = ExpandValidationError{}
5151
5152
// Validate checks the field values on ExpandLeaf with the rules defined in the
5153
// proto definition for this message. If any rules are violated, the first
5154
// error encountered is returned, or nil if there are no violations.
5155
func (m *ExpandLeaf) Validate() error {
5156
	return m.validate(false)
5157
}
5158
5159
// ValidateAll checks the field values on ExpandLeaf with the rules defined in
5160
// the proto definition for this message. If any rules are violated, the
5161
// result is a list of violation errors wrapped in ExpandLeafMultiError, or
5162
// nil if none found.
5163
func (m *ExpandLeaf) ValidateAll() error {
5164
	return m.validate(true)
5165
}
5166
5167
func (m *ExpandLeaf) validate(all bool) error {
5168
	if m == nil {
5169
		return nil
5170
	}
5171
5172
	var errors []error
5173
5174
	oneofTypePresent := false
5175
	switch v := m.Type.(type) {
5176
	case *ExpandLeaf_Subjects:
5177
		if v == nil {
5178
			err := ExpandLeafValidationError{
5179
				field:  "Type",
5180
				reason: "oneof value cannot be a typed-nil",
5181
			}
5182
			if !all {
5183
				return err
5184
			}
5185
			errors = append(errors, err)
5186
		}
5187
		oneofTypePresent = true
5188
5189
		if all {
5190
			switch v := interface{}(m.GetSubjects()).(type) {
5191
			case interface{ ValidateAll() error }:
5192
				if err := v.ValidateAll(); err != nil {
5193
					errors = append(errors, ExpandLeafValidationError{
5194
						field:  "Subjects",
5195
						reason: "embedded message failed validation",
5196
						cause:  err,
5197
					})
5198
				}
5199
			case interface{ Validate() error }:
5200
				if err := v.Validate(); err != nil {
5201
					errors = append(errors, ExpandLeafValidationError{
5202
						field:  "Subjects",
5203
						reason: "embedded message failed validation",
5204
						cause:  err,
5205
					})
5206
				}
5207
			}
5208
		} else if v, ok := interface{}(m.GetSubjects()).(interface{ Validate() error }); ok {
5209
			if err := v.Validate(); err != nil {
5210
				return ExpandLeafValidationError{
5211
					field:  "Subjects",
5212
					reason: "embedded message failed validation",
5213
					cause:  err,
5214
				}
5215
			}
5216
		}
5217
5218
	case *ExpandLeaf_Values:
5219
		if v == nil {
5220
			err := ExpandLeafValidationError{
5221
				field:  "Type",
5222
				reason: "oneof value cannot be a typed-nil",
5223
			}
5224
			if !all {
5225
				return err
5226
			}
5227
			errors = append(errors, err)
5228
		}
5229
		oneofTypePresent = true
5230
5231
		if all {
5232
			switch v := interface{}(m.GetValues()).(type) {
5233
			case interface{ ValidateAll() error }:
5234
				if err := v.ValidateAll(); err != nil {
5235
					errors = append(errors, ExpandLeafValidationError{
5236
						field:  "Values",
5237
						reason: "embedded message failed validation",
5238
						cause:  err,
5239
					})
5240
				}
5241
			case interface{ Validate() error }:
5242
				if err := v.Validate(); err != nil {
5243
					errors = append(errors, ExpandLeafValidationError{
5244
						field:  "Values",
5245
						reason: "embedded message failed validation",
5246
						cause:  err,
5247
					})
5248
				}
5249
			}
5250
		} else if v, ok := interface{}(m.GetValues()).(interface{ Validate() error }); ok {
5251
			if err := v.Validate(); err != nil {
5252
				return ExpandLeafValidationError{
5253
					field:  "Values",
5254
					reason: "embedded message failed validation",
5255
					cause:  err,
5256
				}
5257
			}
5258
		}
5259
5260
	case *ExpandLeaf_Value:
5261
		if v == nil {
5262
			err := ExpandLeafValidationError{
5263
				field:  "Type",
5264
				reason: "oneof value cannot be a typed-nil",
5265
			}
5266
			if !all {
5267
				return err
5268
			}
5269
			errors = append(errors, err)
5270
		}
5271
		oneofTypePresent = true
5272
5273
		if all {
5274
			switch v := interface{}(m.GetValue()).(type) {
5275
			case interface{ ValidateAll() error }:
5276
				if err := v.ValidateAll(); err != nil {
5277
					errors = append(errors, ExpandLeafValidationError{
5278
						field:  "Value",
5279
						reason: "embedded message failed validation",
5280
						cause:  err,
5281
					})
5282
				}
5283
			case interface{ Validate() error }:
5284
				if err := v.Validate(); err != nil {
5285
					errors = append(errors, ExpandLeafValidationError{
5286
						field:  "Value",
5287
						reason: "embedded message failed validation",
5288
						cause:  err,
5289
					})
5290
				}
5291
			}
5292
		} else if v, ok := interface{}(m.GetValue()).(interface{ Validate() error }); ok {
5293
			if err := v.Validate(); err != nil {
5294
				return ExpandLeafValidationError{
5295
					field:  "Value",
5296
					reason: "embedded message failed validation",
5297
					cause:  err,
5298
				}
5299
			}
5300
		}
5301
5302
	default:
5303
		_ = v // ensures v is used
5304
	}
5305
	if !oneofTypePresent {
5306
		err := ExpandLeafValidationError{
5307
			field:  "Type",
5308
			reason: "value is required",
5309
		}
5310
		if !all {
5311
			return err
5312
		}
5313
		errors = append(errors, err)
5314
	}
5315
5316
	if len(errors) > 0 {
5317
		return ExpandLeafMultiError(errors)
5318
	}
5319
5320
	return nil
5321
}
5322
5323
// ExpandLeafMultiError is an error wrapping multiple validation errors
5324
// returned by ExpandLeaf.ValidateAll() if the designated constraints aren't met.
5325
type ExpandLeafMultiError []error
5326
5327
// Error returns a concatenation of all the error messages it wraps.
5328
func (m ExpandLeafMultiError) Error() string {
5329
	var msgs []string
5330
	for _, err := range m {
5331
		msgs = append(msgs, err.Error())
5332
	}
5333
	return strings.Join(msgs, "; ")
5334
}
5335
5336
// AllErrors returns a list of validation violation errors.
5337
func (m ExpandLeafMultiError) AllErrors() []error { return m }
5338
5339
// ExpandLeafValidationError is the validation error returned by
5340
// ExpandLeaf.Validate if the designated constraints aren't met.
5341
type ExpandLeafValidationError struct {
5342
	field  string
5343
	reason string
5344
	cause  error
5345
	key    bool
5346
}
5347
5348
// Field function returns field value.
5349
func (e ExpandLeafValidationError) Field() string { return e.field }
5350
5351
// Reason function returns reason value.
5352
func (e ExpandLeafValidationError) Reason() string { return e.reason }
5353
5354
// Cause function returns cause value.
5355
func (e ExpandLeafValidationError) Cause() error { return e.cause }
5356
5357
// Key function returns key value.
5358
func (e ExpandLeafValidationError) Key() bool { return e.key }
5359
5360
// ErrorName returns error name.
5361
func (e ExpandLeafValidationError) ErrorName() string { return "ExpandLeafValidationError" }
5362
5363
// Error satisfies the builtin error interface
5364
func (e ExpandLeafValidationError) Error() string {
5365
	cause := ""
5366
	if e.cause != nil {
5367
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
5368
	}
5369
5370
	key := ""
5371
	if e.key {
5372
		key = "key for "
5373
	}
5374
5375
	return fmt.Sprintf(
5376
		"invalid %sExpandLeaf.%s: %s%s",
5377
		key,
5378
		e.field,
5379
		e.reason,
5380
		cause)
5381
}
5382
5383
var _ error = ExpandLeafValidationError{}
5384
5385
var _ interface {
5386
	Field() string
5387
	Reason() string
5388
	Key() bool
5389
	Cause() error
5390
	ErrorName() string
5391
} = ExpandLeafValidationError{}
5392
5393
// Validate checks the field values on Values with the rules defined in the
5394
// proto definition for this message. If any rules are violated, the first
5395
// error encountered is returned, or nil if there are no violations.
5396
func (m *Values) Validate() error {
5397
	return m.validate(false)
5398
}
5399
5400
// ValidateAll checks the field values on Values with the rules defined in the
5401
// proto definition for this message. If any rules are violated, the result is
5402
// a list of violation errors wrapped in ValuesMultiError, or nil if none found.
5403
func (m *Values) ValidateAll() error {
5404
	return m.validate(true)
5405
}
5406
5407
func (m *Values) validate(all bool) error {
5408
	if m == nil {
5409
		return nil
5410
	}
5411
5412
	var errors []error
5413
5414
	{
5415
		sorted_keys := make([]string, len(m.GetValues()))
5416
		i := 0
5417
		for key := range m.GetValues() {
5418
			sorted_keys[i] = key
5419
			i++
5420
		}
5421
		sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] })
5422
		for _, key := range sorted_keys {
5423
			val := m.GetValues()[key]
5424
			_ = val
5425
5426
			// no validation rules for Values[key]
5427
5428
			if all {
5429
				switch v := interface{}(val).(type) {
5430
				case interface{ ValidateAll() error }:
5431
					if err := v.ValidateAll(); err != nil {
5432
						errors = append(errors, ValuesValidationError{
5433
							field:  fmt.Sprintf("Values[%v]", key),
5434
							reason: "embedded message failed validation",
5435
							cause:  err,
5436
						})
5437
					}
5438
				case interface{ Validate() error }:
5439
					if err := v.Validate(); err != nil {
5440
						errors = append(errors, ValuesValidationError{
5441
							field:  fmt.Sprintf("Values[%v]", key),
5442
							reason: "embedded message failed validation",
5443
							cause:  err,
5444
						})
5445
					}
5446
				}
5447
			} else if v, ok := interface{}(val).(interface{ Validate() error }); ok {
5448
				if err := v.Validate(); err != nil {
5449
					return ValuesValidationError{
5450
						field:  fmt.Sprintf("Values[%v]", key),
5451
						reason: "embedded message failed validation",
5452
						cause:  err,
5453
					}
5454
				}
5455
			}
5456
5457
		}
5458
	}
5459
5460
	if len(errors) > 0 {
5461
		return ValuesMultiError(errors)
5462
	}
5463
5464
	return nil
5465
}
5466
5467
// ValuesMultiError is an error wrapping multiple validation errors returned by
5468
// Values.ValidateAll() if the designated constraints aren't met.
5469
type ValuesMultiError []error
5470
5471
// Error returns a concatenation of all the error messages it wraps.
5472
func (m ValuesMultiError) Error() string {
5473
	var msgs []string
5474
	for _, err := range m {
5475
		msgs = append(msgs, err.Error())
5476
	}
5477
	return strings.Join(msgs, "; ")
5478
}
5479
5480
// AllErrors returns a list of validation violation errors.
5481
func (m ValuesMultiError) AllErrors() []error { return m }
5482
5483
// ValuesValidationError is the validation error returned by Values.Validate if
5484
// the designated constraints aren't met.
5485
type ValuesValidationError struct {
5486
	field  string
5487
	reason string
5488
	cause  error
5489
	key    bool
5490
}
5491
5492
// Field function returns field value.
5493
func (e ValuesValidationError) Field() string { return e.field }
5494
5495
// Reason function returns reason value.
5496
func (e ValuesValidationError) Reason() string { return e.reason }
5497
5498
// Cause function returns cause value.
5499
func (e ValuesValidationError) Cause() error { return e.cause }
5500
5501
// Key function returns key value.
5502
func (e ValuesValidationError) Key() bool { return e.key }
5503
5504
// ErrorName returns error name.
5505
func (e ValuesValidationError) ErrorName() string { return "ValuesValidationError" }
5506
5507
// Error satisfies the builtin error interface
5508
func (e ValuesValidationError) Error() string {
5509
	cause := ""
5510
	if e.cause != nil {
5511
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
5512
	}
5513
5514
	key := ""
5515
	if e.key {
5516
		key = "key for "
5517
	}
5518
5519
	return fmt.Sprintf(
5520
		"invalid %sValues.%s: %s%s",
5521
		key,
5522
		e.field,
5523
		e.reason,
5524
		cause)
5525
}
5526
5527
var _ error = ValuesValidationError{}
5528
5529
var _ interface {
5530
	Field() string
5531
	Reason() string
5532
	Key() bool
5533
	Cause() error
5534
	ErrorName() string
5535
} = ValuesValidationError{}
5536
5537
// Validate checks the field values on Subjects with the rules defined in the
5538
// proto definition for this message. If any rules are violated, the first
5539
// error encountered is returned, or nil if there are no violations.
5540
func (m *Subjects) Validate() error {
5541
	return m.validate(false)
5542
}
5543
5544
// ValidateAll checks the field values on Subjects with the rules defined in
5545
// the proto definition for this message. If any rules are violated, the
5546
// result is a list of violation errors wrapped in SubjectsMultiError, or nil
5547
// if none found.
5548
func (m *Subjects) ValidateAll() error {
5549
	return m.validate(true)
5550
}
5551
5552
func (m *Subjects) validate(all bool) error {
5553
	if m == nil {
5554
		return nil
5555
	}
5556
5557
	var errors []error
5558
5559
	for idx, item := range m.GetSubjects() {
5560
		_, _ = idx, item
5561
5562
		if all {
5563
			switch v := interface{}(item).(type) {
5564
			case interface{ ValidateAll() error }:
5565
				if err := v.ValidateAll(); err != nil {
5566
					errors = append(errors, SubjectsValidationError{
5567
						field:  fmt.Sprintf("Subjects[%v]", idx),
5568
						reason: "embedded message failed validation",
5569
						cause:  err,
5570
					})
5571
				}
5572
			case interface{ Validate() error }:
5573
				if err := v.Validate(); err != nil {
5574
					errors = append(errors, SubjectsValidationError{
5575
						field:  fmt.Sprintf("Subjects[%v]", idx),
5576
						reason: "embedded message failed validation",
5577
						cause:  err,
5578
					})
5579
				}
5580
			}
5581
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
5582
			if err := v.Validate(); err != nil {
5583
				return SubjectsValidationError{
5584
					field:  fmt.Sprintf("Subjects[%v]", idx),
5585
					reason: "embedded message failed validation",
5586
					cause:  err,
5587
				}
5588
			}
5589
		}
5590
5591
	}
5592
5593
	if len(errors) > 0 {
5594
		return SubjectsMultiError(errors)
5595
	}
5596
5597
	return nil
5598
}
5599
5600
// SubjectsMultiError is an error wrapping multiple validation errors returned
5601
// by Subjects.ValidateAll() if the designated constraints aren't met.
5602
type SubjectsMultiError []error
5603
5604
// Error returns a concatenation of all the error messages it wraps.
5605
func (m SubjectsMultiError) Error() string {
5606
	var msgs []string
5607
	for _, err := range m {
5608
		msgs = append(msgs, err.Error())
5609
	}
5610
	return strings.Join(msgs, "; ")
5611
}
5612
5613
// AllErrors returns a list of validation violation errors.
5614
func (m SubjectsMultiError) AllErrors() []error { return m }
5615
5616
// SubjectsValidationError is the validation error returned by
5617
// Subjects.Validate if the designated constraints aren't met.
5618
type SubjectsValidationError struct {
5619
	field  string
5620
	reason string
5621
	cause  error
5622
	key    bool
5623
}
5624
5625
// Field function returns field value.
5626
func (e SubjectsValidationError) Field() string { return e.field }
5627
5628
// Reason function returns reason value.
5629
func (e SubjectsValidationError) Reason() string { return e.reason }
5630
5631
// Cause function returns cause value.
5632
func (e SubjectsValidationError) Cause() error { return e.cause }
5633
5634
// Key function returns key value.
5635
func (e SubjectsValidationError) Key() bool { return e.key }
5636
5637
// ErrorName returns error name.
5638
func (e SubjectsValidationError) ErrorName() string { return "SubjectsValidationError" }
5639
5640
// Error satisfies the builtin error interface
5641
func (e SubjectsValidationError) Error() string {
5642
	cause := ""
5643
	if e.cause != nil {
5644
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
5645
	}
5646
5647
	key := ""
5648
	if e.key {
5649
		key = "key for "
5650
	}
5651
5652
	return fmt.Sprintf(
5653
		"invalid %sSubjects.%s: %s%s",
5654
		key,
5655
		e.field,
5656
		e.reason,
5657
		cause)
5658
}
5659
5660
var _ error = SubjectsValidationError{}
5661
5662
var _ interface {
5663
	Field() string
5664
	Reason() string
5665
	Key() bool
5666
	Cause() error
5667
	ErrorName() string
5668
} = SubjectsValidationError{}
5669
5670
// Validate checks the field values on Tenant with the rules defined in the
5671
// proto definition for this message. If any rules are violated, the first
5672
// error encountered is returned, or nil if there are no violations.
5673
func (m *Tenant) Validate() error {
5674
	return m.validate(false)
5675
}
5676
5677
// ValidateAll checks the field values on Tenant with the rules defined in the
5678
// proto definition for this message. If any rules are violated, the result is
5679
// a list of violation errors wrapped in TenantMultiError, or nil if none found.
5680
func (m *Tenant) ValidateAll() error {
5681
	return m.validate(true)
5682
}
5683
5684
func (m *Tenant) validate(all bool) error {
5685
	if m == nil {
5686
		return nil
5687
	}
5688
5689
	var errors []error
5690
5691
	// no validation rules for Id
5692
5693
	// no validation rules for Name
5694
5695
	if all {
5696
		switch v := interface{}(m.GetCreatedAt()).(type) {
5697
		case interface{ ValidateAll() error }:
5698
			if err := v.ValidateAll(); err != nil {
5699
				errors = append(errors, TenantValidationError{
5700
					field:  "CreatedAt",
5701
					reason: "embedded message failed validation",
5702
					cause:  err,
5703
				})
5704
			}
5705
		case interface{ Validate() error }:
5706
			if err := v.Validate(); err != nil {
5707
				errors = append(errors, TenantValidationError{
5708
					field:  "CreatedAt",
5709
					reason: "embedded message failed validation",
5710
					cause:  err,
5711
				})
5712
			}
5713
		}
5714
	} else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok {
5715
		if err := v.Validate(); err != nil {
5716
			return TenantValidationError{
5717
				field:  "CreatedAt",
5718
				reason: "embedded message failed validation",
5719
				cause:  err,
5720
			}
5721
		}
5722
	}
5723
5724
	if len(errors) > 0 {
5725
		return TenantMultiError(errors)
5726
	}
5727
5728
	return nil
5729
}
5730
5731
// TenantMultiError is an error wrapping multiple validation errors returned by
5732
// Tenant.ValidateAll() if the designated constraints aren't met.
5733
type TenantMultiError []error
5734
5735
// Error returns a concatenation of all the error messages it wraps.
5736
func (m TenantMultiError) Error() string {
5737
	var msgs []string
5738
	for _, err := range m {
5739
		msgs = append(msgs, err.Error())
5740
	}
5741
	return strings.Join(msgs, "; ")
5742
}
5743
5744
// AllErrors returns a list of validation violation errors.
5745
func (m TenantMultiError) AllErrors() []error { return m }
5746
5747
// TenantValidationError is the validation error returned by Tenant.Validate if
5748
// the designated constraints aren't met.
5749
type TenantValidationError struct {
5750
	field  string
5751
	reason string
5752
	cause  error
5753
	key    bool
5754
}
5755
5756
// Field function returns field value.
5757
func (e TenantValidationError) Field() string { return e.field }
5758
5759
// Reason function returns reason value.
5760
func (e TenantValidationError) Reason() string { return e.reason }
5761
5762
// Cause function returns cause value.
5763
func (e TenantValidationError) Cause() error { return e.cause }
5764
5765
// Key function returns key value.
5766
func (e TenantValidationError) Key() bool { return e.key }
5767
5768
// ErrorName returns error name.
5769
func (e TenantValidationError) ErrorName() string { return "TenantValidationError" }
5770
5771
// Error satisfies the builtin error interface
5772
func (e TenantValidationError) Error() string {
5773
	cause := ""
5774
	if e.cause != nil {
5775
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
5776
	}
5777
5778
	key := ""
5779
	if e.key {
5780
		key = "key for "
5781
	}
5782
5783
	return fmt.Sprintf(
5784
		"invalid %sTenant.%s: %s%s",
5785
		key,
5786
		e.field,
5787
		e.reason,
5788
		cause)
5789
}
5790
5791
var _ error = TenantValidationError{}
5792
5793
var _ interface {
5794
	Field() string
5795
	Reason() string
5796
	Key() bool
5797
	Cause() error
5798
	ErrorName() string
5799
} = TenantValidationError{}
5800
5801
// Validate checks the field values on DataChanges with the rules defined in
5802
// the proto definition for this message. If any rules are violated, the first
5803
// error encountered is returned, or nil if there are no violations.
5804
func (m *DataChanges) Validate() error {
5805
	return m.validate(false)
5806
}
5807
5808
// ValidateAll checks the field values on DataChanges with the rules defined in
5809
// the proto definition for this message. If any rules are violated, the
5810
// result is a list of violation errors wrapped in DataChangesMultiError, or
5811
// nil if none found.
5812
func (m *DataChanges) ValidateAll() error {
5813
	return m.validate(true)
5814
}
5815
5816
func (m *DataChanges) validate(all bool) error {
5817
	if m == nil {
5818
		return nil
5819
	}
5820
5821
	var errors []error
5822
5823
	// no validation rules for SnapToken
5824
5825
	for idx, item := range m.GetDataChanges() {
5826
		_, _ = idx, item
5827
5828
		if all {
5829
			switch v := interface{}(item).(type) {
5830
			case interface{ ValidateAll() error }:
5831
				if err := v.ValidateAll(); err != nil {
5832
					errors = append(errors, DataChangesValidationError{
5833
						field:  fmt.Sprintf("DataChanges[%v]", idx),
5834
						reason: "embedded message failed validation",
5835
						cause:  err,
5836
					})
5837
				}
5838
			case interface{ Validate() error }:
5839
				if err := v.Validate(); err != nil {
5840
					errors = append(errors, DataChangesValidationError{
5841
						field:  fmt.Sprintf("DataChanges[%v]", idx),
5842
						reason: "embedded message failed validation",
5843
						cause:  err,
5844
					})
5845
				}
5846
			}
5847
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
5848
			if err := v.Validate(); err != nil {
5849
				return DataChangesValidationError{
5850
					field:  fmt.Sprintf("DataChanges[%v]", idx),
5851
					reason: "embedded message failed validation",
5852
					cause:  err,
5853
				}
5854
			}
5855
		}
5856
5857
	}
5858
5859
	if len(errors) > 0 {
5860
		return DataChangesMultiError(errors)
5861
	}
5862
5863
	return nil
5864
}
5865
5866
// DataChangesMultiError is an error wrapping multiple validation errors
5867
// returned by DataChanges.ValidateAll() if the designated constraints aren't met.
5868
type DataChangesMultiError []error
5869
5870
// Error returns a concatenation of all the error messages it wraps.
5871
func (m DataChangesMultiError) Error() string {
5872
	var msgs []string
5873
	for _, err := range m {
5874
		msgs = append(msgs, err.Error())
5875
	}
5876
	return strings.Join(msgs, "; ")
5877
}
5878
5879
// AllErrors returns a list of validation violation errors.
5880
func (m DataChangesMultiError) AllErrors() []error { return m }
5881
5882
// DataChangesValidationError is the validation error returned by
5883
// DataChanges.Validate if the designated constraints aren't met.
5884
type DataChangesValidationError struct {
5885
	field  string
5886
	reason string
5887
	cause  error
5888
	key    bool
5889
}
5890
5891
// Field function returns field value.
5892
func (e DataChangesValidationError) Field() string { return e.field }
5893
5894
// Reason function returns reason value.
5895
func (e DataChangesValidationError) Reason() string { return e.reason }
5896
5897
// Cause function returns cause value.
5898
func (e DataChangesValidationError) Cause() error { return e.cause }
5899
5900
// Key function returns key value.
5901
func (e DataChangesValidationError) Key() bool { return e.key }
5902
5903
// ErrorName returns error name.
5904
func (e DataChangesValidationError) ErrorName() string { return "DataChangesValidationError" }
5905
5906
// Error satisfies the builtin error interface
5907
func (e DataChangesValidationError) Error() string {
5908
	cause := ""
5909
	if e.cause != nil {
5910
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
5911
	}
5912
5913
	key := ""
5914
	if e.key {
5915
		key = "key for "
5916
	}
5917
5918
	return fmt.Sprintf(
5919
		"invalid %sDataChanges.%s: %s%s",
5920
		key,
5921
		e.field,
5922
		e.reason,
5923
		cause)
5924
}
5925
5926
var _ error = DataChangesValidationError{}
5927
5928
var _ interface {
5929
	Field() string
5930
	Reason() string
5931
	Key() bool
5932
	Cause() error
5933
	ErrorName() string
5934
} = DataChangesValidationError{}
5935
5936
// Validate checks the field values on DataChange with the rules defined in the
5937
// proto definition for this message. If any rules are violated, the first
5938
// error encountered is returned, or nil if there are no violations.
5939
func (m *DataChange) Validate() error {
5940
	return m.validate(false)
5941
}
5942
5943
// ValidateAll checks the field values on DataChange with the rules defined in
5944
// the proto definition for this message. If any rules are violated, the
5945
// result is a list of violation errors wrapped in DataChangeMultiError, or
5946
// nil if none found.
5947
func (m *DataChange) ValidateAll() error {
5948
	return m.validate(true)
5949
}
5950
5951
func (m *DataChange) validate(all bool) error {
5952
	if m == nil {
5953
		return nil
5954
	}
5955
5956
	var errors []error
5957
5958
	// no validation rules for Operation
5959
5960
	oneofTypePresent := false
5961
	switch v := m.Type.(type) {
5962
	case *DataChange_Tuple:
5963
		if v == nil {
5964
			err := DataChangeValidationError{
5965
				field:  "Type",
5966
				reason: "oneof value cannot be a typed-nil",
5967
			}
5968
			if !all {
5969
				return err
5970
			}
5971
			errors = append(errors, err)
5972
		}
5973
		oneofTypePresent = true
5974
5975
		if all {
5976
			switch v := interface{}(m.GetTuple()).(type) {
5977
			case interface{ ValidateAll() error }:
5978
				if err := v.ValidateAll(); err != nil {
5979
					errors = append(errors, DataChangeValidationError{
5980
						field:  "Tuple",
5981
						reason: "embedded message failed validation",
5982
						cause:  err,
5983
					})
5984
				}
5985
			case interface{ Validate() error }:
5986
				if err := v.Validate(); err != nil {
5987
					errors = append(errors, DataChangeValidationError{
5988
						field:  "Tuple",
5989
						reason: "embedded message failed validation",
5990
						cause:  err,
5991
					})
5992
				}
5993
			}
5994
		} else if v, ok := interface{}(m.GetTuple()).(interface{ Validate() error }); ok {
5995
			if err := v.Validate(); err != nil {
5996
				return DataChangeValidationError{
5997
					field:  "Tuple",
5998
					reason: "embedded message failed validation",
5999
					cause:  err,
6000
				}
6001
			}
6002
		}
6003
6004
	case *DataChange_Attribute:
6005
		if v == nil {
6006
			err := DataChangeValidationError{
6007
				field:  "Type",
6008
				reason: "oneof value cannot be a typed-nil",
6009
			}
6010
			if !all {
6011
				return err
6012
			}
6013
			errors = append(errors, err)
6014
		}
6015
		oneofTypePresent = true
6016
6017
		if all {
6018
			switch v := interface{}(m.GetAttribute()).(type) {
6019
			case interface{ ValidateAll() error }:
6020
				if err := v.ValidateAll(); err != nil {
6021
					errors = append(errors, DataChangeValidationError{
6022
						field:  "Attribute",
6023
						reason: "embedded message failed validation",
6024
						cause:  err,
6025
					})
6026
				}
6027
			case interface{ Validate() error }:
6028
				if err := v.Validate(); err != nil {
6029
					errors = append(errors, DataChangeValidationError{
6030
						field:  "Attribute",
6031
						reason: "embedded message failed validation",
6032
						cause:  err,
6033
					})
6034
				}
6035
			}
6036
		} else if v, ok := interface{}(m.GetAttribute()).(interface{ Validate() error }); ok {
6037
			if err := v.Validate(); err != nil {
6038
				return DataChangeValidationError{
6039
					field:  "Attribute",
6040
					reason: "embedded message failed validation",
6041
					cause:  err,
6042
				}
6043
			}
6044
		}
6045
6046
	default:
6047
		_ = v // ensures v is used
6048
	}
6049
	if !oneofTypePresent {
6050
		err := DataChangeValidationError{
6051
			field:  "Type",
6052
			reason: "value is required",
6053
		}
6054
		if !all {
6055
			return err
6056
		}
6057
		errors = append(errors, err)
6058
	}
6059
6060
	if len(errors) > 0 {
6061
		return DataChangeMultiError(errors)
6062
	}
6063
6064
	return nil
6065
}
6066
6067
// DataChangeMultiError is an error wrapping multiple validation errors
6068
// returned by DataChange.ValidateAll() if the designated constraints aren't met.
6069
type DataChangeMultiError []error
6070
6071
// Error returns a concatenation of all the error messages it wraps.
6072
func (m DataChangeMultiError) Error() string {
6073
	var msgs []string
6074
	for _, err := range m {
6075
		msgs = append(msgs, err.Error())
6076
	}
6077
	return strings.Join(msgs, "; ")
6078
}
6079
6080
// AllErrors returns a list of validation violation errors.
6081
func (m DataChangeMultiError) AllErrors() []error { return m }
6082
6083
// DataChangeValidationError is the validation error returned by
6084
// DataChange.Validate if the designated constraints aren't met.
6085
type DataChangeValidationError struct {
6086
	field  string
6087
	reason string
6088
	cause  error
6089
	key    bool
6090
}
6091
6092
// Field function returns field value.
6093
func (e DataChangeValidationError) Field() string { return e.field }
6094
6095
// Reason function returns reason value.
6096
func (e DataChangeValidationError) Reason() string { return e.reason }
6097
6098
// Cause function returns cause value.
6099
func (e DataChangeValidationError) Cause() error { return e.cause }
6100
6101
// Key function returns key value.
6102
func (e DataChangeValidationError) Key() bool { return e.key }
6103
6104
// ErrorName returns error name.
6105
func (e DataChangeValidationError) ErrorName() string { return "DataChangeValidationError" }
6106
6107
// Error satisfies the builtin error interface
6108
func (e DataChangeValidationError) Error() string {
6109
	cause := ""
6110
	if e.cause != nil {
6111
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
6112
	}
6113
6114
	key := ""
6115
	if e.key {
6116
		key = "key for "
6117
	}
6118
6119
	return fmt.Sprintf(
6120
		"invalid %sDataChange.%s: %s%s",
6121
		key,
6122
		e.field,
6123
		e.reason,
6124
		cause)
6125
}
6126
6127
var _ error = DataChangeValidationError{}
6128
6129
var _ interface {
6130
	Field() string
6131
	Reason() string
6132
	Key() bool
6133
	Cause() error
6134
	ErrorName() string
6135
} = DataChangeValidationError{}
6136
6137
// Validate checks the field values on StringValue with the rules defined in
6138
// the proto definition for this message. If any rules are violated, the first
6139
// error encountered is returned, or nil if there are no violations.
6140
func (m *StringValue) Validate() error {
6141
	return m.validate(false)
6142
}
6143
6144
// ValidateAll checks the field values on StringValue with the rules defined in
6145
// the proto definition for this message. If any rules are violated, the
6146
// result is a list of violation errors wrapped in StringValueMultiError, or
6147
// nil if none found.
6148
func (m *StringValue) ValidateAll() error {
6149
	return m.validate(true)
6150
}
6151
6152
func (m *StringValue) validate(all bool) error {
6153
	if m == nil {
6154
		return nil
6155
	}
6156
6157
	var errors []error
6158
6159
	// no validation rules for Data
6160
6161
	if len(errors) > 0 {
6162
		return StringValueMultiError(errors)
6163
	}
6164
6165
	return nil
6166
}
6167
6168
// StringValueMultiError is an error wrapping multiple validation errors
6169
// returned by StringValue.ValidateAll() if the designated constraints aren't met.
6170
type StringValueMultiError []error
6171
6172
// Error returns a concatenation of all the error messages it wraps.
6173
func (m StringValueMultiError) Error() string {
6174
	var msgs []string
6175
	for _, err := range m {
6176
		msgs = append(msgs, err.Error())
6177
	}
6178
	return strings.Join(msgs, "; ")
6179
}
6180
6181
// AllErrors returns a list of validation violation errors.
6182
func (m StringValueMultiError) AllErrors() []error { return m }
6183
6184
// StringValueValidationError is the validation error returned by
6185
// StringValue.Validate if the designated constraints aren't met.
6186
type StringValueValidationError struct {
6187
	field  string
6188
	reason string
6189
	cause  error
6190
	key    bool
6191
}
6192
6193
// Field function returns field value.
6194
func (e StringValueValidationError) Field() string { return e.field }
6195
6196
// Reason function returns reason value.
6197
func (e StringValueValidationError) Reason() string { return e.reason }
6198
6199
// Cause function returns cause value.
6200
func (e StringValueValidationError) Cause() error { return e.cause }
6201
6202
// Key function returns key value.
6203
func (e StringValueValidationError) Key() bool { return e.key }
6204
6205
// ErrorName returns error name.
6206
func (e StringValueValidationError) ErrorName() string { return "StringValueValidationError" }
6207
6208
// Error satisfies the builtin error interface
6209
func (e StringValueValidationError) Error() string {
6210
	cause := ""
6211
	if e.cause != nil {
6212
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
6213
	}
6214
6215
	key := ""
6216
	if e.key {
6217
		key = "key for "
6218
	}
6219
6220
	return fmt.Sprintf(
6221
		"invalid %sStringValue.%s: %s%s",
6222
		key,
6223
		e.field,
6224
		e.reason,
6225
		cause)
6226
}
6227
6228
var _ error = StringValueValidationError{}
6229
6230
var _ interface {
6231
	Field() string
6232
	Reason() string
6233
	Key() bool
6234
	Cause() error
6235
	ErrorName() string
6236
} = StringValueValidationError{}
6237
6238
// Validate checks the field values on IntegerValue with the rules defined in
6239
// the proto definition for this message. If any rules are violated, the first
6240
// error encountered is returned, or nil if there are no violations.
6241
func (m *IntegerValue) Validate() error {
6242
	return m.validate(false)
6243
}
6244
6245
// ValidateAll checks the field values on IntegerValue with the rules defined
6246
// in the proto definition for this message. If any rules are violated, the
6247
// result is a list of violation errors wrapped in IntegerValueMultiError, or
6248
// nil if none found.
6249
func (m *IntegerValue) ValidateAll() error {
6250
	return m.validate(true)
6251
}
6252
6253
func (m *IntegerValue) validate(all bool) error {
6254
	if m == nil {
6255
		return nil
6256
	}
6257
6258
	var errors []error
6259
6260
	// no validation rules for Data
6261
6262
	if len(errors) > 0 {
6263
		return IntegerValueMultiError(errors)
6264
	}
6265
6266
	return nil
6267
}
6268
6269
// IntegerValueMultiError is an error wrapping multiple validation errors
6270
// returned by IntegerValue.ValidateAll() if the designated constraints aren't met.
6271
type IntegerValueMultiError []error
6272
6273
// Error returns a concatenation of all the error messages it wraps.
6274
func (m IntegerValueMultiError) Error() string {
6275
	var msgs []string
6276
	for _, err := range m {
6277
		msgs = append(msgs, err.Error())
6278
	}
6279
	return strings.Join(msgs, "; ")
6280
}
6281
6282
// AllErrors returns a list of validation violation errors.
6283
func (m IntegerValueMultiError) AllErrors() []error { return m }
6284
6285
// IntegerValueValidationError is the validation error returned by
6286
// IntegerValue.Validate if the designated constraints aren't met.
6287
type IntegerValueValidationError struct {
6288
	field  string
6289
	reason string
6290
	cause  error
6291
	key    bool
6292
}
6293
6294
// Field function returns field value.
6295
func (e IntegerValueValidationError) Field() string { return e.field }
6296
6297
// Reason function returns reason value.
6298
func (e IntegerValueValidationError) Reason() string { return e.reason }
6299
6300
// Cause function returns cause value.
6301
func (e IntegerValueValidationError) Cause() error { return e.cause }
6302
6303
// Key function returns key value.
6304
func (e IntegerValueValidationError) Key() bool { return e.key }
6305
6306
// ErrorName returns error name.
6307
func (e IntegerValueValidationError) ErrorName() string { return "IntegerValueValidationError" }
6308
6309
// Error satisfies the builtin error interface
6310
func (e IntegerValueValidationError) Error() string {
6311
	cause := ""
6312
	if e.cause != nil {
6313
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
6314
	}
6315
6316
	key := ""
6317
	if e.key {
6318
		key = "key for "
6319
	}
6320
6321
	return fmt.Sprintf(
6322
		"invalid %sIntegerValue.%s: %s%s",
6323
		key,
6324
		e.field,
6325
		e.reason,
6326
		cause)
6327
}
6328
6329
var _ error = IntegerValueValidationError{}
6330
6331
var _ interface {
6332
	Field() string
6333
	Reason() string
6334
	Key() bool
6335
	Cause() error
6336
	ErrorName() string
6337
} = IntegerValueValidationError{}
6338
6339
// Validate checks the field values on DoubleValue with the rules defined in
6340
// the proto definition for this message. If any rules are violated, the first
6341
// error encountered is returned, or nil if there are no violations.
6342
func (m *DoubleValue) Validate() error {
6343
	return m.validate(false)
6344
}
6345
6346
// ValidateAll checks the field values on DoubleValue with the rules defined in
6347
// the proto definition for this message. If any rules are violated, the
6348
// result is a list of violation errors wrapped in DoubleValueMultiError, or
6349
// nil if none found.
6350
func (m *DoubleValue) ValidateAll() error {
6351
	return m.validate(true)
6352
}
6353
6354
func (m *DoubleValue) validate(all bool) error {
6355
	if m == nil {
6356
		return nil
6357
	}
6358
6359
	var errors []error
6360
6361
	// no validation rules for Data
6362
6363
	if len(errors) > 0 {
6364
		return DoubleValueMultiError(errors)
6365
	}
6366
6367
	return nil
6368
}
6369
6370
// DoubleValueMultiError is an error wrapping multiple validation errors
6371
// returned by DoubleValue.ValidateAll() if the designated constraints aren't met.
6372
type DoubleValueMultiError []error
6373
6374
// Error returns a concatenation of all the error messages it wraps.
6375
func (m DoubleValueMultiError) Error() string {
6376
	var msgs []string
6377
	for _, err := range m {
6378
		msgs = append(msgs, err.Error())
6379
	}
6380
	return strings.Join(msgs, "; ")
6381
}
6382
6383
// AllErrors returns a list of validation violation errors.
6384
func (m DoubleValueMultiError) AllErrors() []error { return m }
6385
6386
// DoubleValueValidationError is the validation error returned by
6387
// DoubleValue.Validate if the designated constraints aren't met.
6388
type DoubleValueValidationError struct {
6389
	field  string
6390
	reason string
6391
	cause  error
6392
	key    bool
6393
}
6394
6395
// Field function returns field value.
6396
func (e DoubleValueValidationError) Field() string { return e.field }
6397
6398
// Reason function returns reason value.
6399
func (e DoubleValueValidationError) Reason() string { return e.reason }
6400
6401
// Cause function returns cause value.
6402
func (e DoubleValueValidationError) Cause() error { return e.cause }
6403
6404
// Key function returns key value.
6405
func (e DoubleValueValidationError) Key() bool { return e.key }
6406
6407
// ErrorName returns error name.
6408
func (e DoubleValueValidationError) ErrorName() string { return "DoubleValueValidationError" }
6409
6410
// Error satisfies the builtin error interface
6411
func (e DoubleValueValidationError) Error() string {
6412
	cause := ""
6413
	if e.cause != nil {
6414
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
6415
	}
6416
6417
	key := ""
6418
	if e.key {
6419
		key = "key for "
6420
	}
6421
6422
	return fmt.Sprintf(
6423
		"invalid %sDoubleValue.%s: %s%s",
6424
		key,
6425
		e.field,
6426
		e.reason,
6427
		cause)
6428
}
6429
6430
var _ error = DoubleValueValidationError{}
6431
6432
var _ interface {
6433
	Field() string
6434
	Reason() string
6435
	Key() bool
6436
	Cause() error
6437
	ErrorName() string
6438
} = DoubleValueValidationError{}
6439
6440
// Validate checks the field values on BooleanValue with the rules defined in
6441
// the proto definition for this message. If any rules are violated, the first
6442
// error encountered is returned, or nil if there are no violations.
6443
func (m *BooleanValue) Validate() error {
6444
	return m.validate(false)
6445
}
6446
6447
// ValidateAll checks the field values on BooleanValue with the rules defined
6448
// in the proto definition for this message. If any rules are violated, the
6449
// result is a list of violation errors wrapped in BooleanValueMultiError, or
6450
// nil if none found.
6451
func (m *BooleanValue) ValidateAll() error {
6452
	return m.validate(true)
6453
}
6454
6455
func (m *BooleanValue) validate(all bool) error {
6456
	if m == nil {
6457
		return nil
6458
	}
6459
6460
	var errors []error
6461
6462
	// no validation rules for Data
6463
6464
	if len(errors) > 0 {
6465
		return BooleanValueMultiError(errors)
6466
	}
6467
6468
	return nil
6469
}
6470
6471
// BooleanValueMultiError is an error wrapping multiple validation errors
6472
// returned by BooleanValue.ValidateAll() if the designated constraints aren't met.
6473
type BooleanValueMultiError []error
6474
6475
// Error returns a concatenation of all the error messages it wraps.
6476
func (m BooleanValueMultiError) Error() string {
6477
	var msgs []string
6478
	for _, err := range m {
6479
		msgs = append(msgs, err.Error())
6480
	}
6481
	return strings.Join(msgs, "; ")
6482
}
6483
6484
// AllErrors returns a list of validation violation errors.
6485
func (m BooleanValueMultiError) AllErrors() []error { return m }
6486
6487
// BooleanValueValidationError is the validation error returned by
6488
// BooleanValue.Validate if the designated constraints aren't met.
6489
type BooleanValueValidationError struct {
6490
	field  string
6491
	reason string
6492
	cause  error
6493
	key    bool
6494
}
6495
6496
// Field function returns field value.
6497
func (e BooleanValueValidationError) Field() string { return e.field }
6498
6499
// Reason function returns reason value.
6500
func (e BooleanValueValidationError) Reason() string { return e.reason }
6501
6502
// Cause function returns cause value.
6503
func (e BooleanValueValidationError) Cause() error { return e.cause }
6504
6505
// Key function returns key value.
6506
func (e BooleanValueValidationError) Key() bool { return e.key }
6507
6508
// ErrorName returns error name.
6509
func (e BooleanValueValidationError) ErrorName() string { return "BooleanValueValidationError" }
6510
6511
// Error satisfies the builtin error interface
6512
func (e BooleanValueValidationError) Error() string {
6513
	cause := ""
6514
	if e.cause != nil {
6515
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
6516
	}
6517
6518
	key := ""
6519
	if e.key {
6520
		key = "key for "
6521
	}
6522
6523
	return fmt.Sprintf(
6524
		"invalid %sBooleanValue.%s: %s%s",
6525
		key,
6526
		e.field,
6527
		e.reason,
6528
		cause)
6529
}
6530
6531
var _ error = BooleanValueValidationError{}
6532
6533
var _ interface {
6534
	Field() string
6535
	Reason() string
6536
	Key() bool
6537
	Cause() error
6538
	ErrorName() string
6539
} = BooleanValueValidationError{}
6540
6541
// Validate checks the field values on StringArrayValue with the rules defined
6542
// in the proto definition for this message. If any rules are violated, the
6543
// first error encountered is returned, or nil if there are no violations.
6544
func (m *StringArrayValue) Validate() error {
6545
	return m.validate(false)
6546
}
6547
6548
// ValidateAll checks the field values on StringArrayValue with the rules
6549
// defined in the proto definition for this message. If any rules are
6550
// violated, the result is a list of violation errors wrapped in
6551
// StringArrayValueMultiError, or nil if none found.
6552
func (m *StringArrayValue) ValidateAll() error {
6553
	return m.validate(true)
6554
}
6555
6556
func (m *StringArrayValue) validate(all bool) error {
6557
	if m == nil {
6558
		return nil
6559
	}
6560
6561
	var errors []error
6562
6563
	if len(errors) > 0 {
6564
		return StringArrayValueMultiError(errors)
6565
	}
6566
6567
	return nil
6568
}
6569
6570
// StringArrayValueMultiError is an error wrapping multiple validation errors
6571
// returned by StringArrayValue.ValidateAll() if the designated constraints
6572
// aren't met.
6573
type StringArrayValueMultiError []error
6574
6575
// Error returns a concatenation of all the error messages it wraps.
6576
func (m StringArrayValueMultiError) Error() string {
6577
	var msgs []string
6578
	for _, err := range m {
6579
		msgs = append(msgs, err.Error())
6580
	}
6581
	return strings.Join(msgs, "; ")
6582
}
6583
6584
// AllErrors returns a list of validation violation errors.
6585
func (m StringArrayValueMultiError) AllErrors() []error { return m }
6586
6587
// StringArrayValueValidationError is the validation error returned by
6588
// StringArrayValue.Validate if the designated constraints aren't met.
6589
type StringArrayValueValidationError struct {
6590
	field  string
6591
	reason string
6592
	cause  error
6593
	key    bool
6594
}
6595
6596
// Field function returns field value.
6597
func (e StringArrayValueValidationError) Field() string { return e.field }
6598
6599
// Reason function returns reason value.
6600
func (e StringArrayValueValidationError) Reason() string { return e.reason }
6601
6602
// Cause function returns cause value.
6603
func (e StringArrayValueValidationError) Cause() error { return e.cause }
6604
6605
// Key function returns key value.
6606
func (e StringArrayValueValidationError) Key() bool { return e.key }
6607
6608
// ErrorName returns error name.
6609
func (e StringArrayValueValidationError) ErrorName() string { return "StringArrayValueValidationError" }
6610
6611
// Error satisfies the builtin error interface
6612
func (e StringArrayValueValidationError) Error() string {
6613
	cause := ""
6614
	if e.cause != nil {
6615
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
6616
	}
6617
6618
	key := ""
6619
	if e.key {
6620
		key = "key for "
6621
	}
6622
6623
	return fmt.Sprintf(
6624
		"invalid %sStringArrayValue.%s: %s%s",
6625
		key,
6626
		e.field,
6627
		e.reason,
6628
		cause)
6629
}
6630
6631
var _ error = StringArrayValueValidationError{}
6632
6633
var _ interface {
6634
	Field() string
6635
	Reason() string
6636
	Key() bool
6637
	Cause() error
6638
	ErrorName() string
6639
} = StringArrayValueValidationError{}
6640
6641
// Validate checks the field values on IntegerArrayValue with the rules defined
6642
// in the proto definition for this message. If any rules are violated, the
6643
// first error encountered is returned, or nil if there are no violations.
6644
func (m *IntegerArrayValue) Validate() error {
6645
	return m.validate(false)
6646
}
6647
6648
// ValidateAll checks the field values on IntegerArrayValue with the rules
6649
// defined in the proto definition for this message. If any rules are
6650
// violated, the result is a list of violation errors wrapped in
6651
// IntegerArrayValueMultiError, or nil if none found.
6652
func (m *IntegerArrayValue) ValidateAll() error {
6653
	return m.validate(true)
6654
}
6655
6656
func (m *IntegerArrayValue) validate(all bool) error {
6657
	if m == nil {
6658
		return nil
6659
	}
6660
6661
	var errors []error
6662
6663
	if len(errors) > 0 {
6664
		return IntegerArrayValueMultiError(errors)
6665
	}
6666
6667
	return nil
6668
}
6669
6670
// IntegerArrayValueMultiError is an error wrapping multiple validation errors
6671
// returned by IntegerArrayValue.ValidateAll() if the designated constraints
6672
// aren't met.
6673
type IntegerArrayValueMultiError []error
6674
6675
// Error returns a concatenation of all the error messages it wraps.
6676
func (m IntegerArrayValueMultiError) Error() string {
6677
	var msgs []string
6678
	for _, err := range m {
6679
		msgs = append(msgs, err.Error())
6680
	}
6681
	return strings.Join(msgs, "; ")
6682
}
6683
6684
// AllErrors returns a list of validation violation errors.
6685
func (m IntegerArrayValueMultiError) AllErrors() []error { return m }
6686
6687
// IntegerArrayValueValidationError is the validation error returned by
6688
// IntegerArrayValue.Validate if the designated constraints aren't met.
6689
type IntegerArrayValueValidationError struct {
6690
	field  string
6691
	reason string
6692
	cause  error
6693
	key    bool
6694
}
6695
6696
// Field function returns field value.
6697
func (e IntegerArrayValueValidationError) Field() string { return e.field }
6698
6699
// Reason function returns reason value.
6700
func (e IntegerArrayValueValidationError) Reason() string { return e.reason }
6701
6702
// Cause function returns cause value.
6703
func (e IntegerArrayValueValidationError) Cause() error { return e.cause }
6704
6705
// Key function returns key value.
6706
func (e IntegerArrayValueValidationError) Key() bool { return e.key }
6707
6708
// ErrorName returns error name.
6709
func (e IntegerArrayValueValidationError) ErrorName() string {
6710
	return "IntegerArrayValueValidationError"
6711
}
6712
6713
// Error satisfies the builtin error interface
6714
func (e IntegerArrayValueValidationError) Error() string {
6715
	cause := ""
6716
	if e.cause != nil {
6717
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
6718
	}
6719
6720
	key := ""
6721
	if e.key {
6722
		key = "key for "
6723
	}
6724
6725
	return fmt.Sprintf(
6726
		"invalid %sIntegerArrayValue.%s: %s%s",
6727
		key,
6728
		e.field,
6729
		e.reason,
6730
		cause)
6731
}
6732
6733
var _ error = IntegerArrayValueValidationError{}
6734
6735
var _ interface {
6736
	Field() string
6737
	Reason() string
6738
	Key() bool
6739
	Cause() error
6740
	ErrorName() string
6741
} = IntegerArrayValueValidationError{}
6742
6743
// Validate checks the field values on DoubleArrayValue with the rules defined
6744
// in the proto definition for this message. If any rules are violated, the
6745
// first error encountered is returned, or nil if there are no violations.
6746
func (m *DoubleArrayValue) Validate() error {
6747
	return m.validate(false)
6748
}
6749
6750
// ValidateAll checks the field values on DoubleArrayValue with the rules
6751
// defined in the proto definition for this message. If any rules are
6752
// violated, the result is a list of violation errors wrapped in
6753
// DoubleArrayValueMultiError, or nil if none found.
6754
func (m *DoubleArrayValue) ValidateAll() error {
6755
	return m.validate(true)
6756
}
6757
6758
func (m *DoubleArrayValue) validate(all bool) error {
6759
	if m == nil {
6760
		return nil
6761
	}
6762
6763
	var errors []error
6764
6765
	if len(errors) > 0 {
6766
		return DoubleArrayValueMultiError(errors)
6767
	}
6768
6769
	return nil
6770
}
6771
6772
// DoubleArrayValueMultiError is an error wrapping multiple validation errors
6773
// returned by DoubleArrayValue.ValidateAll() if the designated constraints
6774
// aren't met.
6775
type DoubleArrayValueMultiError []error
6776
6777
// Error returns a concatenation of all the error messages it wraps.
6778
func (m DoubleArrayValueMultiError) Error() string {
6779
	var msgs []string
6780
	for _, err := range m {
6781
		msgs = append(msgs, err.Error())
6782
	}
6783
	return strings.Join(msgs, "; ")
6784
}
6785
6786
// AllErrors returns a list of validation violation errors.
6787
func (m DoubleArrayValueMultiError) AllErrors() []error { return m }
6788
6789
// DoubleArrayValueValidationError is the validation error returned by
6790
// DoubleArrayValue.Validate if the designated constraints aren't met.
6791
type DoubleArrayValueValidationError struct {
6792
	field  string
6793
	reason string
6794
	cause  error
6795
	key    bool
6796
}
6797
6798
// Field function returns field value.
6799
func (e DoubleArrayValueValidationError) Field() string { return e.field }
6800
6801
// Reason function returns reason value.
6802
func (e DoubleArrayValueValidationError) Reason() string { return e.reason }
6803
6804
// Cause function returns cause value.
6805
func (e DoubleArrayValueValidationError) Cause() error { return e.cause }
6806
6807
// Key function returns key value.
6808
func (e DoubleArrayValueValidationError) Key() bool { return e.key }
6809
6810
// ErrorName returns error name.
6811
func (e DoubleArrayValueValidationError) ErrorName() string { return "DoubleArrayValueValidationError" }
6812
6813
// Error satisfies the builtin error interface
6814
func (e DoubleArrayValueValidationError) Error() string {
6815
	cause := ""
6816
	if e.cause != nil {
6817
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
6818
	}
6819
6820
	key := ""
6821
	if e.key {
6822
		key = "key for "
6823
	}
6824
6825
	return fmt.Sprintf(
6826
		"invalid %sDoubleArrayValue.%s: %s%s",
6827
		key,
6828
		e.field,
6829
		e.reason,
6830
		cause)
6831
}
6832
6833
var _ error = DoubleArrayValueValidationError{}
6834
6835
var _ interface {
6836
	Field() string
6837
	Reason() string
6838
	Key() bool
6839
	Cause() error
6840
	ErrorName() string
6841
} = DoubleArrayValueValidationError{}
6842
6843
// Validate checks the field values on BooleanArrayValue with the rules defined
6844
// in the proto definition for this message. If any rules are violated, the
6845
// first error encountered is returned, or nil if there are no violations.
6846
func (m *BooleanArrayValue) Validate() error {
6847
	return m.validate(false)
6848
}
6849
6850
// ValidateAll checks the field values on BooleanArrayValue with the rules
6851
// defined in the proto definition for this message. If any rules are
6852
// violated, the result is a list of violation errors wrapped in
6853
// BooleanArrayValueMultiError, or nil if none found.
6854
func (m *BooleanArrayValue) ValidateAll() error {
6855
	return m.validate(true)
6856
}
6857
6858
func (m *BooleanArrayValue) validate(all bool) error {
6859
	if m == nil {
6860
		return nil
6861
	}
6862
6863
	var errors []error
6864
6865
	if len(errors) > 0 {
6866
		return BooleanArrayValueMultiError(errors)
6867
	}
6868
6869
	return nil
6870
}
6871
6872
// BooleanArrayValueMultiError is an error wrapping multiple validation errors
6873
// returned by BooleanArrayValue.ValidateAll() if the designated constraints
6874
// aren't met.
6875
type BooleanArrayValueMultiError []error
6876
6877
// Error returns a concatenation of all the error messages it wraps.
6878
func (m BooleanArrayValueMultiError) Error() string {
6879
	var msgs []string
6880
	for _, err := range m {
6881
		msgs = append(msgs, err.Error())
6882
	}
6883
	return strings.Join(msgs, "; ")
6884
}
6885
6886
// AllErrors returns a list of validation violation errors.
6887
func (m BooleanArrayValueMultiError) AllErrors() []error { return m }
6888
6889
// BooleanArrayValueValidationError is the validation error returned by
6890
// BooleanArrayValue.Validate if the designated constraints aren't met.
6891
type BooleanArrayValueValidationError struct {
6892
	field  string
6893
	reason string
6894
	cause  error
6895
	key    bool
6896
}
6897
6898
// Field function returns field value.
6899
func (e BooleanArrayValueValidationError) Field() string { return e.field }
6900
6901
// Reason function returns reason value.
6902
func (e BooleanArrayValueValidationError) Reason() string { return e.reason }
6903
6904
// Cause function returns cause value.
6905
func (e BooleanArrayValueValidationError) Cause() error { return e.cause }
6906
6907
// Key function returns key value.
6908
func (e BooleanArrayValueValidationError) Key() bool { return e.key }
6909
6910
// ErrorName returns error name.
6911
func (e BooleanArrayValueValidationError) ErrorName() string {
6912
	return "BooleanArrayValueValidationError"
6913
}
6914
6915
// Error satisfies the builtin error interface
6916
func (e BooleanArrayValueValidationError) Error() string {
6917
	cause := ""
6918
	if e.cause != nil {
6919
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
6920
	}
6921
6922
	key := ""
6923
	if e.key {
6924
		key = "key for "
6925
	}
6926
6927
	return fmt.Sprintf(
6928
		"invalid %sBooleanArrayValue.%s: %s%s",
6929
		key,
6930
		e.field,
6931
		e.reason,
6932
		cause)
6933
}
6934
6935
var _ error = BooleanArrayValueValidationError{}
6936
6937
var _ interface {
6938
	Field() string
6939
	Reason() string
6940
	Key() bool
6941
	Cause() error
6942
	ErrorName() string
6943
} = BooleanArrayValueValidationError{}
6944
6945
// Validate checks the field values on DataBundle with the rules defined in the
6946
// proto definition for this message. If any rules are violated, the first
6947
// error encountered is returned, or nil if there are no violations.
6948
func (m *DataBundle) Validate() error {
6949
	return m.validate(false)
6950
}
6951
6952
// ValidateAll checks the field values on DataBundle with the rules defined in
6953
// the proto definition for this message. If any rules are violated, the
6954
// result is a list of violation errors wrapped in DataBundleMultiError, or
6955
// nil if none found.
6956
func (m *DataBundle) ValidateAll() error {
6957
	return m.validate(true)
6958
}
6959
6960
func (m *DataBundle) validate(all bool) error {
6961
	if m == nil {
6962
		return nil
6963
	}
6964
6965
	var errors []error
6966
6967
	// no validation rules for Name
6968
6969
	for idx, item := range m.GetOperations() {
6970
		_, _ = idx, item
6971
6972
		if all {
6973
			switch v := interface{}(item).(type) {
6974
			case interface{ ValidateAll() error }:
6975
				if err := v.ValidateAll(); err != nil {
6976
					errors = append(errors, DataBundleValidationError{
6977
						field:  fmt.Sprintf("Operations[%v]", idx),
6978
						reason: "embedded message failed validation",
6979
						cause:  err,
6980
					})
6981
				}
6982
			case interface{ Validate() error }:
6983
				if err := v.Validate(); err != nil {
6984
					errors = append(errors, DataBundleValidationError{
6985
						field:  fmt.Sprintf("Operations[%v]", idx),
6986
						reason: "embedded message failed validation",
6987
						cause:  err,
6988
					})
6989
				}
6990
			}
6991
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
6992
			if err := v.Validate(); err != nil {
6993
				return DataBundleValidationError{
6994
					field:  fmt.Sprintf("Operations[%v]", idx),
6995
					reason: "embedded message failed validation",
6996
					cause:  err,
6997
				}
6998
			}
6999
		}
7000
7001
	}
7002
7003
	if len(errors) > 0 {
7004
		return DataBundleMultiError(errors)
7005
	}
7006
7007
	return nil
7008
}
7009
7010
// DataBundleMultiError is an error wrapping multiple validation errors
7011
// returned by DataBundle.ValidateAll() if the designated constraints aren't met.
7012
type DataBundleMultiError []error
7013
7014
// Error returns a concatenation of all the error messages it wraps.
7015
func (m DataBundleMultiError) Error() string {
7016
	var msgs []string
7017
	for _, err := range m {
7018
		msgs = append(msgs, err.Error())
7019
	}
7020
	return strings.Join(msgs, "; ")
7021
}
7022
7023
// AllErrors returns a list of validation violation errors.
7024
func (m DataBundleMultiError) AllErrors() []error { return m }
7025
7026
// DataBundleValidationError is the validation error returned by
7027
// DataBundle.Validate if the designated constraints aren't met.
7028
type DataBundleValidationError struct {
7029
	field  string
7030
	reason string
7031
	cause  error
7032
	key    bool
7033
}
7034
7035
// Field function returns field value.
7036
func (e DataBundleValidationError) Field() string { return e.field }
7037
7038
// Reason function returns reason value.
7039
func (e DataBundleValidationError) Reason() string { return e.reason }
7040
7041
// Cause function returns cause value.
7042
func (e DataBundleValidationError) Cause() error { return e.cause }
7043
7044
// Key function returns key value.
7045
func (e DataBundleValidationError) Key() bool { return e.key }
7046
7047
// ErrorName returns error name.
7048
func (e DataBundleValidationError) ErrorName() string { return "DataBundleValidationError" }
7049
7050
// Error satisfies the builtin error interface
7051
func (e DataBundleValidationError) Error() string {
7052
	cause := ""
7053
	if e.cause != nil {
7054
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
7055
	}
7056
7057
	key := ""
7058
	if e.key {
7059
		key = "key for "
7060
	}
7061
7062
	return fmt.Sprintf(
7063
		"invalid %sDataBundle.%s: %s%s",
7064
		key,
7065
		e.field,
7066
		e.reason,
7067
		cause)
7068
}
7069
7070
var _ error = DataBundleValidationError{}
7071
7072
var _ interface {
7073
	Field() string
7074
	Reason() string
7075
	Key() bool
7076
	Cause() error
7077
	ErrorName() string
7078
} = DataBundleValidationError{}
7079
7080
// Validate checks the field values on Operation with the rules defined in the
7081
// proto definition for this message. If any rules are violated, the first
7082
// error encountered is returned, or nil if there are no violations.
7083
func (m *Operation) Validate() error {
7084
	return m.validate(false)
7085
}
7086
7087
// ValidateAll checks the field values on Operation with the rules defined in
7088
// the proto definition for this message. If any rules are violated, the
7089
// result is a list of violation errors wrapped in OperationMultiError, or nil
7090
// if none found.
7091
func (m *Operation) ValidateAll() error {
7092
	return m.validate(true)
7093
}
7094
7095
func (m *Operation) validate(all bool) error {
7096
	if m == nil {
7097
		return nil
7098
	}
7099
7100
	var errors []error
7101
7102
	if len(errors) > 0 {
7103
		return OperationMultiError(errors)
7104
	}
7105
7106
	return nil
7107
}
7108
7109
// OperationMultiError is an error wrapping multiple validation errors returned
7110
// by Operation.ValidateAll() if the designated constraints aren't met.
7111
type OperationMultiError []error
7112
7113
// Error returns a concatenation of all the error messages it wraps.
7114
func (m OperationMultiError) Error() string {
7115
	var msgs []string
7116
	for _, err := range m {
7117
		msgs = append(msgs, err.Error())
7118
	}
7119
	return strings.Join(msgs, "; ")
7120
}
7121
7122
// AllErrors returns a list of validation violation errors.
7123
func (m OperationMultiError) AllErrors() []error { return m }
7124
7125
// OperationValidationError is the validation error returned by
7126
// Operation.Validate if the designated constraints aren't met.
7127
type OperationValidationError struct {
7128
	field  string
7129
	reason string
7130
	cause  error
7131
	key    bool
7132
}
7133
7134
// Field function returns field value.
7135
func (e OperationValidationError) Field() string { return e.field }
7136
7137
// Reason function returns reason value.
7138
func (e OperationValidationError) Reason() string { return e.reason }
7139
7140
// Cause function returns cause value.
7141
func (e OperationValidationError) Cause() error { return e.cause }
7142
7143
// Key function returns key value.
7144
func (e OperationValidationError) Key() bool { return e.key }
7145
7146
// ErrorName returns error name.
7147
func (e OperationValidationError) ErrorName() string { return "OperationValidationError" }
7148
7149
// Error satisfies the builtin error interface
7150
func (e OperationValidationError) Error() string {
7151
	cause := ""
7152
	if e.cause != nil {
7153
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
7154
	}
7155
7156
	key := ""
7157
	if e.key {
7158
		key = "key for "
7159
	}
7160
7161
	return fmt.Sprintf(
7162
		"invalid %sOperation.%s: %s%s",
7163
		key,
7164
		e.field,
7165
		e.reason,
7166
		cause)
7167
}
7168
7169
var _ error = OperationValidationError{}
7170
7171
var _ interface {
7172
	Field() string
7173
	Reason() string
7174
	Key() bool
7175
	Cause() error
7176
	ErrorName() string
7177
} = OperationValidationError{}
7178
7179
// Validate checks the field values on Partials with the rules defined in the
7180
// proto definition for this message. If any rules are violated, the first
7181
// error encountered is returned, or nil if there are no violations.
7182
func (m *Partials) Validate() error {
7183
	return m.validate(false)
7184
}
7185
7186
// ValidateAll checks the field values on Partials with the rules defined in
7187
// the proto definition for this message. If any rules are violated, the
7188
// result is a list of violation errors wrapped in PartialsMultiError, or nil
7189
// if none found.
7190
func (m *Partials) ValidateAll() error {
7191
	return m.validate(true)
7192
}
7193
7194
func (m *Partials) validate(all bool) error {
7195
	if m == nil {
7196
		return nil
7197
	}
7198
7199
	var errors []error
7200
7201
	if len(errors) > 0 {
7202
		return PartialsMultiError(errors)
7203
	}
7204
7205
	return nil
7206
}
7207
7208
// PartialsMultiError is an error wrapping multiple validation errors returned
7209
// by Partials.ValidateAll() if the designated constraints aren't met.
7210
type PartialsMultiError []error
7211
7212
// Error returns a concatenation of all the error messages it wraps.
7213
func (m PartialsMultiError) Error() string {
7214
	var msgs []string
7215
	for _, err := range m {
7216
		msgs = append(msgs, err.Error())
7217
	}
7218
	return strings.Join(msgs, "; ")
7219
}
7220
7221
// AllErrors returns a list of validation violation errors.
7222
func (m PartialsMultiError) AllErrors() []error { return m }
7223
7224
// PartialsValidationError is the validation error returned by
7225
// Partials.Validate if the designated constraints aren't met.
7226
type PartialsValidationError struct {
7227
	field  string
7228
	reason string
7229
	cause  error
7230
	key    bool
7231
}
7232
7233
// Field function returns field value.
7234
func (e PartialsValidationError) Field() string { return e.field }
7235
7236
// Reason function returns reason value.
7237
func (e PartialsValidationError) Reason() string { return e.reason }
7238
7239
// Cause function returns cause value.
7240
func (e PartialsValidationError) Cause() error { return e.cause }
7241
7242
// Key function returns key value.
7243
func (e PartialsValidationError) Key() bool { return e.key }
7244
7245
// ErrorName returns error name.
7246
func (e PartialsValidationError) ErrorName() string { return "PartialsValidationError" }
7247
7248
// Error satisfies the builtin error interface
7249
func (e PartialsValidationError) Error() string {
7250
	cause := ""
7251
	if e.cause != nil {
7252
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
7253
	}
7254
7255
	key := ""
7256
	if e.key {
7257
		key = "key for "
7258
	}
7259
7260
	return fmt.Sprintf(
7261
		"invalid %sPartials.%s: %s%s",
7262
		key,
7263
		e.field,
7264
		e.reason,
7265
		cause)
7266
}
7267
7268
var _ error = PartialsValidationError{}
7269
7270
var _ interface {
7271
	Field() string
7272
	Reason() string
7273
	Key() bool
7274
	Cause() error
7275
	ErrorName() string
7276
} = PartialsValidationError{}
7277