Passed
Pull Request — master (#2657)
by
unknown
03:44
created

aValidationError.Reason   A

Complexity

Conditions 1

Size

Total Lines 1
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nop 0
dl 0
loc 1
rs 10
c 0
b 0
f 0
1
// Code generated by protoc-gen-validate. DO NOT EDIT.
2
// source: base/v1/service.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 PermissionCheckRequest with the rules
39
// defined in the proto definition for this message. If any rules are
40
// violated, the first error encountered is returned, or nil if there are no violations.
41
func (m *PermissionCheckRequest) Validate() error {
42
	return m.validate(false)
43
}
44
45
// ValidateAll checks the field values on PermissionCheckRequest with the rules
46
// defined in the proto definition for this message. If any rules are
47
// violated, the result is a list of violation errors wrapped in
48
// PermissionCheckRequestMultiError, or nil if none found.
49
func (m *PermissionCheckRequest) ValidateAll() error {
50
	return m.validate(true)
51
}
52
53
func (m *PermissionCheckRequest) validate(all bool) error {
54
	if m == nil {
55
		return nil
56
	}
57
58
	var errors []error
59
60
	if len(m.GetTenantId()) > 128 {
61
		err := PermissionCheckRequestValidationError{
62
			field:  "TenantId",
63
			reason: "value length must be at most 128 bytes",
64
		}
65
		if !all {
66
			return err
67
		}
68
		errors = append(errors, err)
69
	}
70
71
	if !_PermissionCheckRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
72
		err := PermissionCheckRequestValidationError{
73
			field:  "TenantId",
74
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
75
		}
76
		if !all {
77
			return err
78
		}
79
		errors = append(errors, err)
80
	}
81
82
	if m.GetMetadata() == nil {
83
		err := PermissionCheckRequestValidationError{
84
			field:  "Metadata",
85
			reason: "value is required",
86
		}
87
		if !all {
88
			return err
89
		}
90
		errors = append(errors, err)
91
	}
92
93
	if all {
94
		switch v := interface{}(m.GetMetadata()).(type) {
95
		case interface{ ValidateAll() error }:
96
			if err := v.ValidateAll(); err != nil {
97
				errors = append(errors, PermissionCheckRequestValidationError{
98
					field:  "Metadata",
99
					reason: "embedded message failed validation",
100
					cause:  err,
101
				})
102
			}
103
		case interface{ Validate() error }:
104
			if err := v.Validate(); err != nil {
105
				errors = append(errors, PermissionCheckRequestValidationError{
106
					field:  "Metadata",
107
					reason: "embedded message failed validation",
108
					cause:  err,
109
				})
110
			}
111
		}
112
	} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
113
		if err := v.Validate(); err != nil {
114
			return PermissionCheckRequestValidationError{
115
				field:  "Metadata",
116
				reason: "embedded message failed validation",
117
				cause:  err,
118
			}
119
		}
120
	}
121
122
	if m.GetEntity() == nil {
123
		err := PermissionCheckRequestValidationError{
124
			field:  "Entity",
125
			reason: "value is required",
126
		}
127
		if !all {
128
			return err
129
		}
130
		errors = append(errors, err)
131
	}
132
133
	if all {
134
		switch v := interface{}(m.GetEntity()).(type) {
135
		case interface{ ValidateAll() error }:
136
			if err := v.ValidateAll(); err != nil {
137
				errors = append(errors, PermissionCheckRequestValidationError{
138
					field:  "Entity",
139
					reason: "embedded message failed validation",
140
					cause:  err,
141
				})
142
			}
143
		case interface{ Validate() error }:
144
			if err := v.Validate(); err != nil {
145
				errors = append(errors, PermissionCheckRequestValidationError{
146
					field:  "Entity",
147
					reason: "embedded message failed validation",
148
					cause:  err,
149
				})
150
			}
151
		}
152
	} else if v, ok := interface{}(m.GetEntity()).(interface{ Validate() error }); ok {
153
		if err := v.Validate(); err != nil {
154
			return PermissionCheckRequestValidationError{
155
				field:  "Entity",
156
				reason: "embedded message failed validation",
157
				cause:  err,
158
			}
159
		}
160
	}
161
162
	if len(m.GetPermission()) > 64 {
163
		err := PermissionCheckRequestValidationError{
164
			field:  "Permission",
165
			reason: "value length must be at most 64 bytes",
166
		}
167
		if !all {
168
			return err
169
		}
170
		errors = append(errors, err)
171
	}
172
173
	if !_PermissionCheckRequest_Permission_Pattern.MatchString(m.GetPermission()) {
174
		err := PermissionCheckRequestValidationError{
175
			field:  "Permission",
176
			reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"",
177
		}
178
		if !all {
179
			return err
180
		}
181
		errors = append(errors, err)
182
	}
183
184
	if m.GetSubject() == nil {
185
		err := PermissionCheckRequestValidationError{
186
			field:  "Subject",
187
			reason: "value is required",
188
		}
189
		if !all {
190
			return err
191
		}
192
		errors = append(errors, err)
193
	}
194
195
	if all {
196
		switch v := interface{}(m.GetSubject()).(type) {
197
		case interface{ ValidateAll() error }:
198
			if err := v.ValidateAll(); err != nil {
199
				errors = append(errors, PermissionCheckRequestValidationError{
200
					field:  "Subject",
201
					reason: "embedded message failed validation",
202
					cause:  err,
203
				})
204
			}
205
		case interface{ Validate() error }:
206
			if err := v.Validate(); err != nil {
207
				errors = append(errors, PermissionCheckRequestValidationError{
208
					field:  "Subject",
209
					reason: "embedded message failed validation",
210
					cause:  err,
211
				})
212
			}
213
		}
214
	} else if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok {
215
		if err := v.Validate(); err != nil {
216
			return PermissionCheckRequestValidationError{
217
				field:  "Subject",
218
				reason: "embedded message failed validation",
219
				cause:  err,
220
			}
221
		}
222
	}
223
224
	if all {
225
		switch v := interface{}(m.GetContext()).(type) {
226
		case interface{ ValidateAll() error }:
227
			if err := v.ValidateAll(); err != nil {
228
				errors = append(errors, PermissionCheckRequestValidationError{
229
					field:  "Context",
230
					reason: "embedded message failed validation",
231
					cause:  err,
232
				})
233
			}
234
		case interface{ Validate() error }:
235
			if err := v.Validate(); err != nil {
236
				errors = append(errors, PermissionCheckRequestValidationError{
237
					field:  "Context",
238
					reason: "embedded message failed validation",
239
					cause:  err,
240
				})
241
			}
242
		}
243
	} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok {
244
		if err := v.Validate(); err != nil {
245
			return PermissionCheckRequestValidationError{
246
				field:  "Context",
247
				reason: "embedded message failed validation",
248
				cause:  err,
249
			}
250
		}
251
	}
252
253
	for idx, item := range m.GetArguments() {
254
		_, _ = idx, item
255
256
		if all {
257
			switch v := interface{}(item).(type) {
258
			case interface{ ValidateAll() error }:
259
				if err := v.ValidateAll(); err != nil {
260
					errors = append(errors, PermissionCheckRequestValidationError{
261
						field:  fmt.Sprintf("Arguments[%v]", idx),
262
						reason: "embedded message failed validation",
263
						cause:  err,
264
					})
265
				}
266
			case interface{ Validate() error }:
267
				if err := v.Validate(); err != nil {
268
					errors = append(errors, PermissionCheckRequestValidationError{
269
						field:  fmt.Sprintf("Arguments[%v]", idx),
270
						reason: "embedded message failed validation",
271
						cause:  err,
272
					})
273
				}
274
			}
275
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
276
			if err := v.Validate(); err != nil {
277
				return PermissionCheckRequestValidationError{
278
					field:  fmt.Sprintf("Arguments[%v]", idx),
279
					reason: "embedded message failed validation",
280
					cause:  err,
281
				}
282
			}
283
		}
284
285
	}
286
287
	if len(errors) > 0 {
288
		return PermissionCheckRequestMultiError(errors)
289
	}
290
291
	return nil
292
}
293
294
// PermissionCheckRequestMultiError is an error wrapping multiple validation
295
// errors returned by PermissionCheckRequest.ValidateAll() if the designated
296
// constraints aren't met.
297
type PermissionCheckRequestMultiError []error
298
299
// Error returns a concatenation of all the error messages it wraps.
300
func (m PermissionCheckRequestMultiError) Error() string {
301
	msgs := make([]string, 0, len(m))
302
	for _, err := range m {
303
		msgs = append(msgs, err.Error())
304
	}
305
	return strings.Join(msgs, "; ")
306
}
307
308
// AllErrors returns a list of validation violation errors.
309
func (m PermissionCheckRequestMultiError) AllErrors() []error { return m }
310
311
// PermissionCheckRequestValidationError is the validation error returned by
312
// PermissionCheckRequest.Validate if the designated constraints aren't met.
313
type PermissionCheckRequestValidationError struct {
314
	field  string
315
	reason string
316
	cause  error
317
	key    bool
318
}
319
320
// Field function returns field value.
321
func (e PermissionCheckRequestValidationError) Field() string { return e.field }
322
323
// Reason function returns reason value.
324
func (e PermissionCheckRequestValidationError) Reason() string { return e.reason }
325
326
// Cause function returns cause value.
327
func (e PermissionCheckRequestValidationError) Cause() error { return e.cause }
328
329
// Key function returns key value.
330
func (e PermissionCheckRequestValidationError) Key() bool { return e.key }
331
332
// ErrorName returns error name.
333
func (e PermissionCheckRequestValidationError) ErrorName() string {
334
	return "PermissionCheckRequestValidationError"
335
}
336
337
// Error satisfies the builtin error interface
338
func (e PermissionCheckRequestValidationError) Error() string {
339
	cause := ""
340
	if e.cause != nil {
341
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
342
	}
343
344
	key := ""
345
	if e.key {
346
		key = "key for "
347
	}
348
349
	return fmt.Sprintf(
350
		"invalid %sPermissionCheckRequest.%s: %s%s",
351
		key,
352
		e.field,
353
		e.reason,
354
		cause)
355
}
356
357
var _ error = PermissionCheckRequestValidationError{}
358
359
var _ interface {
360
	Field() string
361
	Reason() string
362
	Key() bool
363
	Cause() error
364
	ErrorName() string
365
} = PermissionCheckRequestValidationError{}
366
367
var _PermissionCheckRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
368
369
var _PermissionCheckRequest_Permission_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$")
370
371
// Validate checks the field values on PermissionCheckRequestMetadata with the
372
// rules defined in the proto definition for this message. If any rules are
373
// violated, the first error encountered is returned, or nil if there are no violations.
374
func (m *PermissionCheckRequestMetadata) Validate() error {
375
	return m.validate(false)
376
}
377
378
// ValidateAll checks the field values on PermissionCheckRequestMetadata with
379
// the rules defined in the proto definition for this message. If any rules
380
// are violated, the result is a list of violation errors wrapped in
381
// PermissionCheckRequestMetadataMultiError, or nil if none found.
382
func (m *PermissionCheckRequestMetadata) ValidateAll() error {
383
	return m.validate(true)
384
}
385
386
func (m *PermissionCheckRequestMetadata) validate(all bool) error {
387
	if m == nil {
388
		return nil
389
	}
390
391
	var errors []error
392
393
	// no validation rules for SchemaVersion
394
395
	// no validation rules for SnapToken
396
397
	if m.GetDepth() < 3 {
398
		err := PermissionCheckRequestMetadataValidationError{
399
			field:  "Depth",
400
			reason: "value must be greater than or equal to 3",
401
		}
402
		if !all {
403
			return err
404
		}
405
		errors = append(errors, err)
406
	}
407
408
	if len(errors) > 0 {
409
		return PermissionCheckRequestMetadataMultiError(errors)
410
	}
411
412
	return nil
413
}
414
415
// PermissionCheckRequestMetadataMultiError is an error wrapping multiple
416
// validation errors returned by PermissionCheckRequestMetadata.ValidateAll()
417
// if the designated constraints aren't met.
418
type PermissionCheckRequestMetadataMultiError []error
419
420
// Error returns a concatenation of all the error messages it wraps.
421
func (m PermissionCheckRequestMetadataMultiError) Error() string {
422
	msgs := make([]string, 0, len(m))
423
	for _, err := range m {
424
		msgs = append(msgs, err.Error())
425
	}
426
	return strings.Join(msgs, "; ")
427
}
428
429
// AllErrors returns a list of validation violation errors.
430
func (m PermissionCheckRequestMetadataMultiError) AllErrors() []error { return m }
431
432
// PermissionCheckRequestMetadataValidationError is the validation error
433
// returned by PermissionCheckRequestMetadata.Validate if the designated
434
// constraints aren't met.
435
type PermissionCheckRequestMetadataValidationError struct {
436
	field  string
437
	reason string
438
	cause  error
439
	key    bool
440
}
441
442
// Field function returns field value.
443
func (e PermissionCheckRequestMetadataValidationError) Field() string { return e.field }
444
445
// Reason function returns reason value.
446
func (e PermissionCheckRequestMetadataValidationError) Reason() string { return e.reason }
447
448
// Cause function returns cause value.
449
func (e PermissionCheckRequestMetadataValidationError) Cause() error { return e.cause }
450
451
// Key function returns key value.
452
func (e PermissionCheckRequestMetadataValidationError) Key() bool { return e.key }
453
454
// ErrorName returns error name.
455
func (e PermissionCheckRequestMetadataValidationError) ErrorName() string {
456
	return "PermissionCheckRequestMetadataValidationError"
457
}
458
459
// Error satisfies the builtin error interface
460
func (e PermissionCheckRequestMetadataValidationError) Error() string {
461
	cause := ""
462
	if e.cause != nil {
463
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
464
	}
465
466
	key := ""
467
	if e.key {
468
		key = "key for "
469
	}
470
471
	return fmt.Sprintf(
472
		"invalid %sPermissionCheckRequestMetadata.%s: %s%s",
473
		key,
474
		e.field,
475
		e.reason,
476
		cause)
477
}
478
479
var _ error = PermissionCheckRequestMetadataValidationError{}
480
481
var _ interface {
482
	Field() string
483
	Reason() string
484
	Key() bool
485
	Cause() error
486
	ErrorName() string
487
} = PermissionCheckRequestMetadataValidationError{}
488
489
// Validate checks the field values on PermissionCheckResponse with the rules
490
// defined in the proto definition for this message. If any rules are
491
// violated, the first error encountered is returned, or nil if there are no violations.
492
func (m *PermissionCheckResponse) Validate() error {
493
	return m.validate(false)
494
}
495
496
// ValidateAll checks the field values on PermissionCheckResponse with the
497
// rules defined in the proto definition for this message. If any rules are
498
// violated, the result is a list of violation errors wrapped in
499
// PermissionCheckResponseMultiError, or nil if none found.
500
func (m *PermissionCheckResponse) ValidateAll() error {
501
	return m.validate(true)
502
}
503
504
func (m *PermissionCheckResponse) validate(all bool) error {
505
	if m == nil {
506
		return nil
507
	}
508
509
	var errors []error
510
511
	// no validation rules for Can
512
513
	if all {
514
		switch v := interface{}(m.GetMetadata()).(type) {
515
		case interface{ ValidateAll() error }:
516
			if err := v.ValidateAll(); err != nil {
517
				errors = append(errors, PermissionCheckResponseValidationError{
518
					field:  "Metadata",
519
					reason: "embedded message failed validation",
520
					cause:  err,
521
				})
522
			}
523
		case interface{ Validate() error }:
524
			if err := v.Validate(); err != nil {
525
				errors = append(errors, PermissionCheckResponseValidationError{
526
					field:  "Metadata",
527
					reason: "embedded message failed validation",
528
					cause:  err,
529
				})
530
			}
531
		}
532
	} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
533
		if err := v.Validate(); err != nil {
534
			return PermissionCheckResponseValidationError{
535
				field:  "Metadata",
536
				reason: "embedded message failed validation",
537
				cause:  err,
538
			}
539
		}
540
	}
541
542
	if len(errors) > 0 {
543
		return PermissionCheckResponseMultiError(errors)
544
	}
545
546
	return nil
547
}
548
549
// PermissionCheckResponseMultiError is an error wrapping multiple validation
550
// errors returned by PermissionCheckResponse.ValidateAll() if the designated
551
// constraints aren't met.
552
type PermissionCheckResponseMultiError []error
553
554
// Error returns a concatenation of all the error messages it wraps.
555
func (m PermissionCheckResponseMultiError) Error() string {
556
	msgs := make([]string, 0, len(m))
557
	for _, err := range m {
558
		msgs = append(msgs, err.Error())
559
	}
560
	return strings.Join(msgs, "; ")
561
}
562
563
// AllErrors returns a list of validation violation errors.
564
func (m PermissionCheckResponseMultiError) AllErrors() []error { return m }
565
566
// PermissionCheckResponseValidationError is the validation error returned by
567
// PermissionCheckResponse.Validate if the designated constraints aren't met.
568
type PermissionCheckResponseValidationError struct {
569
	field  string
570
	reason string
571
	cause  error
572
	key    bool
573
}
574
575
// Field function returns field value.
576
func (e PermissionCheckResponseValidationError) Field() string { return e.field }
577
578
// Reason function returns reason value.
579
func (e PermissionCheckResponseValidationError) Reason() string { return e.reason }
580
581
// Cause function returns cause value.
582
func (e PermissionCheckResponseValidationError) Cause() error { return e.cause }
583
584
// Key function returns key value.
585
func (e PermissionCheckResponseValidationError) Key() bool { return e.key }
586
587
// ErrorName returns error name.
588
func (e PermissionCheckResponseValidationError) ErrorName() string {
589
	return "PermissionCheckResponseValidationError"
590
}
591
592
// Error satisfies the builtin error interface
593
func (e PermissionCheckResponseValidationError) Error() string {
594
	cause := ""
595
	if e.cause != nil {
596
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
597
	}
598
599
	key := ""
600
	if e.key {
601
		key = "key for "
602
	}
603
604
	return fmt.Sprintf(
605
		"invalid %sPermissionCheckResponse.%s: %s%s",
606
		key,
607
		e.field,
608
		e.reason,
609
		cause)
610
}
611
612
var _ error = PermissionCheckResponseValidationError{}
613
614
var _ interface {
615
	Field() string
616
	Reason() string
617
	Key() bool
618
	Cause() error
619
	ErrorName() string
620
} = PermissionCheckResponseValidationError{}
621
622
// Validate checks the field values on PermissionCheckResponseMetadata with the
623
// rules defined in the proto definition for this message. If any rules are
624
// violated, the first error encountered is returned, or nil if there are no violations.
625
func (m *PermissionCheckResponseMetadata) Validate() error {
626
	return m.validate(false)
627
}
628
629
// ValidateAll checks the field values on PermissionCheckResponseMetadata with
630
// the rules defined in the proto definition for this message. If any rules
631
// are violated, the result is a list of violation errors wrapped in
632
// PermissionCheckResponseMetadataMultiError, or nil if none found.
633
func (m *PermissionCheckResponseMetadata) ValidateAll() error {
634
	return m.validate(true)
635
}
636
637
func (m *PermissionCheckResponseMetadata) validate(all bool) error {
638
	if m == nil {
639
		return nil
640
	}
641
642
	var errors []error
643
644
	// no validation rules for CheckCount
645
646
	if len(errors) > 0 {
647
		return PermissionCheckResponseMetadataMultiError(errors)
648
	}
649
650
	return nil
651
}
652
653
// PermissionCheckResponseMetadataMultiError is an error wrapping multiple
654
// validation errors returned by PermissionCheckResponseMetadata.ValidateAll()
655
// if the designated constraints aren't met.
656
type PermissionCheckResponseMetadataMultiError []error
657
658
// Error returns a concatenation of all the error messages it wraps.
659
func (m PermissionCheckResponseMetadataMultiError) Error() string {
660
	msgs := make([]string, 0, len(m))
661
	for _, err := range m {
662
		msgs = append(msgs, err.Error())
663
	}
664
	return strings.Join(msgs, "; ")
665
}
666
667
// AllErrors returns a list of validation violation errors.
668
func (m PermissionCheckResponseMetadataMultiError) AllErrors() []error { return m }
669
670
// PermissionCheckResponseMetadataValidationError is the validation error
671
// returned by PermissionCheckResponseMetadata.Validate if the designated
672
// constraints aren't met.
673
type PermissionCheckResponseMetadataValidationError struct {
674
	field  string
675
	reason string
676
	cause  error
677
	key    bool
678
}
679
680
// Field function returns field value.
681
func (e PermissionCheckResponseMetadataValidationError) Field() string { return e.field }
682
683
// Reason function returns reason value.
684
func (e PermissionCheckResponseMetadataValidationError) Reason() string { return e.reason }
685
686
// Cause function returns cause value.
687
func (e PermissionCheckResponseMetadataValidationError) Cause() error { return e.cause }
688
689
// Key function returns key value.
690
func (e PermissionCheckResponseMetadataValidationError) Key() bool { return e.key }
691
692
// ErrorName returns error name.
693
func (e PermissionCheckResponseMetadataValidationError) ErrorName() string {
694
	return "PermissionCheckResponseMetadataValidationError"
695
}
696
697
// Error satisfies the builtin error interface
698
func (e PermissionCheckResponseMetadataValidationError) Error() string {
699
	cause := ""
700
	if e.cause != nil {
701
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
702
	}
703
704
	key := ""
705
	if e.key {
706
		key = "key for "
707
	}
708
709
	return fmt.Sprintf(
710
		"invalid %sPermissionCheckResponseMetadata.%s: %s%s",
711
		key,
712
		e.field,
713
		e.reason,
714
		cause)
715
}
716
717
var _ error = PermissionCheckResponseMetadataValidationError{}
718
719
var _ interface {
720
	Field() string
721
	Reason() string
722
	Key() bool
723
	Cause() error
724
	ErrorName() string
725
} = PermissionCheckResponseMetadataValidationError{}
726
727
// Validate checks the field values on PermissionBulkCheckRequestItem with the
728
// rules defined in the proto definition for this message. If any rules are
729
// violated, the first error encountered is returned, or nil if there are no violations.
730
func (m *PermissionBulkCheckRequestItem) Validate() error {
731
	return m.validate(false)
732
}
733
734
// ValidateAll checks the field values on PermissionBulkCheckRequestItem with
735
// the rules defined in the proto definition for this message. If any rules
736
// are violated, the result is a list of violation errors wrapped in
737
// PermissionBulkCheckRequestItemMultiError, or nil if none found.
738
func (m *PermissionBulkCheckRequestItem) ValidateAll() error {
739
	return m.validate(true)
740
}
741
742
func (m *PermissionBulkCheckRequestItem) validate(all bool) error {
743
	if m == nil {
744
		return nil
745
	}
746
747
	var errors []error
748
749
	if m.GetEntity() == nil {
750
		err := PermissionBulkCheckRequestItemValidationError{
751
			field:  "Entity",
752
			reason: "value is required",
753
		}
754
		if !all {
755
			return err
756
		}
757
		errors = append(errors, err)
758
	}
759
760
	if all {
761
		switch v := interface{}(m.GetEntity()).(type) {
762
		case interface{ ValidateAll() error }:
763
			if err := v.ValidateAll(); err != nil {
764
				errors = append(errors, PermissionBulkCheckRequestItemValidationError{
765
					field:  "Entity",
766
					reason: "embedded message failed validation",
767
					cause:  err,
768
				})
769
			}
770
		case interface{ Validate() error }:
771
			if err := v.Validate(); err != nil {
772
				errors = append(errors, PermissionBulkCheckRequestItemValidationError{
773
					field:  "Entity",
774
					reason: "embedded message failed validation",
775
					cause:  err,
776
				})
777
			}
778
		}
779
	} else if v, ok := interface{}(m.GetEntity()).(interface{ Validate() error }); ok {
780
		if err := v.Validate(); err != nil {
781
			return PermissionBulkCheckRequestItemValidationError{
782
				field:  "Entity",
783
				reason: "embedded message failed validation",
784
				cause:  err,
785
			}
786
		}
787
	}
788
789
	if len(m.GetPermission()) > 64 {
790
		err := PermissionBulkCheckRequestItemValidationError{
791
			field:  "Permission",
792
			reason: "value length must be at most 64 bytes",
793
		}
794
		if !all {
795
			return err
796
		}
797
		errors = append(errors, err)
798
	}
799
800
	if !_PermissionBulkCheckRequestItem_Permission_Pattern.MatchString(m.GetPermission()) {
801
		err := PermissionBulkCheckRequestItemValidationError{
802
			field:  "Permission",
803
			reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"",
804
		}
805
		if !all {
806
			return err
807
		}
808
		errors = append(errors, err)
809
	}
810
811
	if m.GetSubject() == nil {
812
		err := PermissionBulkCheckRequestItemValidationError{
813
			field:  "Subject",
814
			reason: "value is required",
815
		}
816
		if !all {
817
			return err
818
		}
819
		errors = append(errors, err)
820
	}
821
822
	if all {
823
		switch v := interface{}(m.GetSubject()).(type) {
824
		case interface{ ValidateAll() error }:
825
			if err := v.ValidateAll(); err != nil {
826
				errors = append(errors, PermissionBulkCheckRequestItemValidationError{
827
					field:  "Subject",
828
					reason: "embedded message failed validation",
829
					cause:  err,
830
				})
831
			}
832
		case interface{ Validate() error }:
833
			if err := v.Validate(); err != nil {
834
				errors = append(errors, PermissionBulkCheckRequestItemValidationError{
835
					field:  "Subject",
836
					reason: "embedded message failed validation",
837
					cause:  err,
838
				})
839
			}
840
		}
841
	} else if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok {
842
		if err := v.Validate(); err != nil {
843
			return PermissionBulkCheckRequestItemValidationError{
844
				field:  "Subject",
845
				reason: "embedded message failed validation",
846
				cause:  err,
847
			}
848
		}
849
	}
850
851
	if len(errors) > 0 {
852
		return PermissionBulkCheckRequestItemMultiError(errors)
853
	}
854
855
	return nil
856
}
857
858
// PermissionBulkCheckRequestItemMultiError is an error wrapping multiple
859
// validation errors returned by PermissionBulkCheckRequestItem.ValidateAll()
860
// if the designated constraints aren't met.
861
type PermissionBulkCheckRequestItemMultiError []error
862
863
// Error returns a concatenation of all the error messages it wraps.
864
func (m PermissionBulkCheckRequestItemMultiError) Error() string {
865
	msgs := make([]string, 0, len(m))
866
	for _, err := range m {
867
		msgs = append(msgs, err.Error())
868
	}
869
	return strings.Join(msgs, "; ")
870
}
871
872
// AllErrors returns a list of validation violation errors.
873
func (m PermissionBulkCheckRequestItemMultiError) AllErrors() []error { return m }
874
875
// PermissionBulkCheckRequestItemValidationError is the validation error
876
// returned by PermissionBulkCheckRequestItem.Validate if the designated
877
// constraints aren't met.
878
type PermissionBulkCheckRequestItemValidationError struct {
879
	field  string
880
	reason string
881
	cause  error
882
	key    bool
883
}
884
885
// Field function returns field value.
886
func (e PermissionBulkCheckRequestItemValidationError) Field() string { return e.field }
887
888
// Reason function returns reason value.
889
func (e PermissionBulkCheckRequestItemValidationError) Reason() string { return e.reason }
890
891
// Cause function returns cause value.
892
func (e PermissionBulkCheckRequestItemValidationError) Cause() error { return e.cause }
893
894
// Key function returns key value.
895
func (e PermissionBulkCheckRequestItemValidationError) Key() bool { return e.key }
896
897
// ErrorName returns error name.
898
func (e PermissionBulkCheckRequestItemValidationError) ErrorName() string {
899
	return "PermissionBulkCheckRequestItemValidationError"
900
}
901
902
// Error satisfies the builtin error interface
903
func (e PermissionBulkCheckRequestItemValidationError) Error() string {
904
	cause := ""
905
	if e.cause != nil {
906
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
907
	}
908
909
	key := ""
910
	if e.key {
911
		key = "key for "
912
	}
913
914
	return fmt.Sprintf(
915
		"invalid %sPermissionBulkCheckRequestItem.%s: %s%s",
916
		key,
917
		e.field,
918
		e.reason,
919
		cause)
920
}
921
922
var _ error = PermissionBulkCheckRequestItemValidationError{}
923
924
var _ interface {
925
	Field() string
926
	Reason() string
927
	Key() bool
928
	Cause() error
929
	ErrorName() string
930
} = PermissionBulkCheckRequestItemValidationError{}
931
932
var _PermissionBulkCheckRequestItem_Permission_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$")
933
934
// Validate checks the field values on PermissionBulkCheckRequest with the
935
// rules defined in the proto definition for this message. If any rules are
936
// violated, the first error encountered is returned, or nil if there are no violations.
937
func (m *PermissionBulkCheckRequest) Validate() error {
938
	return m.validate(false)
939
}
940
941
// ValidateAll checks the field values on PermissionBulkCheckRequest with the
942
// rules defined in the proto definition for this message. If any rules are
943
// violated, the result is a list of violation errors wrapped in
944
// PermissionBulkCheckRequestMultiError, or nil if none found.
945
func (m *PermissionBulkCheckRequest) ValidateAll() error {
946
	return m.validate(true)
947
}
948
949
func (m *PermissionBulkCheckRequest) validate(all bool) error {
950
	if m == nil {
951
		return nil
952
	}
953
954
	var errors []error
955
956
	if len(m.GetTenantId()) > 128 {
957
		err := PermissionBulkCheckRequestValidationError{
958
			field:  "TenantId",
959
			reason: "value length must be at most 128 bytes",
960
		}
961
		if !all {
962
			return err
963
		}
964
		errors = append(errors, err)
965
	}
966
967
	if !_PermissionBulkCheckRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
968
		err := PermissionBulkCheckRequestValidationError{
969
			field:  "TenantId",
970
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
971
		}
972
		if !all {
973
			return err
974
		}
975
		errors = append(errors, err)
976
	}
977
978
	if m.GetMetadata() == nil {
979
		err := PermissionBulkCheckRequestValidationError{
980
			field:  "Metadata",
981
			reason: "value is required",
982
		}
983
		if !all {
984
			return err
985
		}
986
		errors = append(errors, err)
987
	}
988
989
	if all {
990
		switch v := interface{}(m.GetMetadata()).(type) {
991
		case interface{ ValidateAll() error }:
992
			if err := v.ValidateAll(); err != nil {
993
				errors = append(errors, PermissionBulkCheckRequestValidationError{
994
					field:  "Metadata",
995
					reason: "embedded message failed validation",
996
					cause:  err,
997
				})
998
			}
999
		case interface{ Validate() error }:
1000
			if err := v.Validate(); err != nil {
1001
				errors = append(errors, PermissionBulkCheckRequestValidationError{
1002
					field:  "Metadata",
1003
					reason: "embedded message failed validation",
1004
					cause:  err,
1005
				})
1006
			}
1007
		}
1008
	} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
1009
		if err := v.Validate(); err != nil {
1010
			return PermissionBulkCheckRequestValidationError{
1011
				field:  "Metadata",
1012
				reason: "embedded message failed validation",
1013
				cause:  err,
1014
			}
1015
		}
1016
	}
1017
1018
	if l := len(m.GetItems()); l < 1 || l > 100 {
1019
		err := PermissionBulkCheckRequestValidationError{
1020
			field:  "Items",
1021
			reason: "value must contain between 1 and 100 items, inclusive",
1022
		}
1023
		if !all {
1024
			return err
1025
		}
1026
		errors = append(errors, err)
1027
	}
1028
1029
	for idx, item := range m.GetItems() {
1030
		_, _ = idx, item
1031
1032
		if all {
1033
			switch v := interface{}(item).(type) {
1034
			case interface{ ValidateAll() error }:
1035
				if err := v.ValidateAll(); err != nil {
1036
					errors = append(errors, PermissionBulkCheckRequestValidationError{
1037
						field:  fmt.Sprintf("Items[%v]", idx),
1038
						reason: "embedded message failed validation",
1039
						cause:  err,
1040
					})
1041
				}
1042
			case interface{ Validate() error }:
1043
				if err := v.Validate(); err != nil {
1044
					errors = append(errors, PermissionBulkCheckRequestValidationError{
1045
						field:  fmt.Sprintf("Items[%v]", idx),
1046
						reason: "embedded message failed validation",
1047
						cause:  err,
1048
					})
1049
				}
1050
			}
1051
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
1052
			if err := v.Validate(); err != nil {
1053
				return PermissionBulkCheckRequestValidationError{
1054
					field:  fmt.Sprintf("Items[%v]", idx),
1055
					reason: "embedded message failed validation",
1056
					cause:  err,
1057
				}
1058
			}
1059
		}
1060
1061
	}
1062
1063
	if all {
1064
		switch v := interface{}(m.GetContext()).(type) {
1065
		case interface{ ValidateAll() error }:
1066
			if err := v.ValidateAll(); err != nil {
1067
				errors = append(errors, PermissionBulkCheckRequestValidationError{
1068
					field:  "Context",
1069
					reason: "embedded message failed validation",
1070
					cause:  err,
1071
				})
1072
			}
1073
		case interface{ Validate() error }:
1074
			if err := v.Validate(); err != nil {
1075
				errors = append(errors, PermissionBulkCheckRequestValidationError{
1076
					field:  "Context",
1077
					reason: "embedded message failed validation",
1078
					cause:  err,
1079
				})
1080
			}
1081
		}
1082
	} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok {
1083
		if err := v.Validate(); err != nil {
1084
			return PermissionBulkCheckRequestValidationError{
1085
				field:  "Context",
1086
				reason: "embedded message failed validation",
1087
				cause:  err,
1088
			}
1089
		}
1090
	}
1091
1092
	for idx, item := range m.GetArguments() {
1093
		_, _ = idx, item
1094
1095
		if all {
1096
			switch v := interface{}(item).(type) {
1097
			case interface{ ValidateAll() error }:
1098
				if err := v.ValidateAll(); err != nil {
1099
					errors = append(errors, PermissionBulkCheckRequestValidationError{
1100
						field:  fmt.Sprintf("Arguments[%v]", idx),
1101
						reason: "embedded message failed validation",
1102
						cause:  err,
1103
					})
1104
				}
1105
			case interface{ Validate() error }:
1106
				if err := v.Validate(); err != nil {
1107
					errors = append(errors, PermissionBulkCheckRequestValidationError{
1108
						field:  fmt.Sprintf("Arguments[%v]", idx),
1109
						reason: "embedded message failed validation",
1110
						cause:  err,
1111
					})
1112
				}
1113
			}
1114
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
1115
			if err := v.Validate(); err != nil {
1116
				return PermissionBulkCheckRequestValidationError{
1117
					field:  fmt.Sprintf("Arguments[%v]", idx),
1118
					reason: "embedded message failed validation",
1119
					cause:  err,
1120
				}
1121
			}
1122
		}
1123
1124
	}
1125
1126
	if len(errors) > 0 {
1127
		return PermissionBulkCheckRequestMultiError(errors)
1128
	}
1129
1130
	return nil
1131
}
1132
1133
// PermissionBulkCheckRequestMultiError is an error wrapping multiple
1134
// validation errors returned by PermissionBulkCheckRequest.ValidateAll() if
1135
// the designated constraints aren't met.
1136
type PermissionBulkCheckRequestMultiError []error
1137
1138
// Error returns a concatenation of all the error messages it wraps.
1139
func (m PermissionBulkCheckRequestMultiError) Error() string {
1140
	msgs := make([]string, 0, len(m))
1141
	for _, err := range m {
1142
		msgs = append(msgs, err.Error())
1143
	}
1144
	return strings.Join(msgs, "; ")
1145
}
1146
1147
// AllErrors returns a list of validation violation errors.
1148
func (m PermissionBulkCheckRequestMultiError) AllErrors() []error { return m }
1149
1150
// PermissionBulkCheckRequestValidationError is the validation error returned
1151
// by PermissionBulkCheckRequest.Validate if the designated constraints aren't met.
1152
type PermissionBulkCheckRequestValidationError struct {
1153
	field  string
1154
	reason string
1155
	cause  error
1156
	key    bool
1157
}
1158
1159
// Field function returns field value.
1160
func (e PermissionBulkCheckRequestValidationError) Field() string { return e.field }
1161
1162
// Reason function returns reason value.
1163
func (e PermissionBulkCheckRequestValidationError) Reason() string { return e.reason }
1164
1165
// Cause function returns cause value.
1166
func (e PermissionBulkCheckRequestValidationError) Cause() error { return e.cause }
1167
1168
// Key function returns key value.
1169
func (e PermissionBulkCheckRequestValidationError) Key() bool { return e.key }
1170
1171
// ErrorName returns error name.
1172
func (e PermissionBulkCheckRequestValidationError) ErrorName() string {
1173
	return "PermissionBulkCheckRequestValidationError"
1174
}
1175
1176
// Error satisfies the builtin error interface
1177
func (e PermissionBulkCheckRequestValidationError) Error() string {
1178
	cause := ""
1179
	if e.cause != nil {
1180
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
1181
	}
1182
1183
	key := ""
1184
	if e.key {
1185
		key = "key for "
1186
	}
1187
1188
	return fmt.Sprintf(
1189
		"invalid %sPermissionBulkCheckRequest.%s: %s%s",
1190
		key,
1191
		e.field,
1192
		e.reason,
1193
		cause)
1194
}
1195
1196
var _ error = PermissionBulkCheckRequestValidationError{}
1197
1198
var _ interface {
1199
	Field() string
1200
	Reason() string
1201
	Key() bool
1202
	Cause() error
1203
	ErrorName() string
1204
} = PermissionBulkCheckRequestValidationError{}
1205
1206
var _PermissionBulkCheckRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
1207
1208
// Validate checks the field values on PermissionBulkCheckResponse with the
1209
// rules defined in the proto definition for this message. If any rules are
1210
// violated, the first error encountered is returned, or nil if there are no violations.
1211
func (m *PermissionBulkCheckResponse) Validate() error {
1212
	return m.validate(false)
1213
}
1214
1215
// ValidateAll checks the field values on PermissionBulkCheckResponse with the
1216
// rules defined in the proto definition for this message. If any rules are
1217
// violated, the result is a list of violation errors wrapped in
1218
// PermissionBulkCheckResponseMultiError, or nil if none found.
1219
func (m *PermissionBulkCheckResponse) ValidateAll() error {
1220
	return m.validate(true)
1221
}
1222
1223
func (m *PermissionBulkCheckResponse) validate(all bool) error {
1224
	if m == nil {
1225
		return nil
1226
	}
1227
1228
	var errors []error
1229
1230
	for idx, item := range m.GetResults() {
1231
		_, _ = idx, item
1232
1233
		if all {
1234
			switch v := interface{}(item).(type) {
1235
			case interface{ ValidateAll() error }:
1236
				if err := v.ValidateAll(); err != nil {
1237
					errors = append(errors, PermissionBulkCheckResponseValidationError{
1238
						field:  fmt.Sprintf("Results[%v]", idx),
1239
						reason: "embedded message failed validation",
1240
						cause:  err,
1241
					})
1242
				}
1243
			case interface{ Validate() error }:
1244
				if err := v.Validate(); err != nil {
1245
					errors = append(errors, PermissionBulkCheckResponseValidationError{
1246
						field:  fmt.Sprintf("Results[%v]", idx),
1247
						reason: "embedded message failed validation",
1248
						cause:  err,
1249
					})
1250
				}
1251
			}
1252
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
1253
			if err := v.Validate(); err != nil {
1254
				return PermissionBulkCheckResponseValidationError{
1255
					field:  fmt.Sprintf("Results[%v]", idx),
1256
					reason: "embedded message failed validation",
1257
					cause:  err,
1258
				}
1259
			}
1260
		}
1261
1262
	}
1263
1264
	if len(errors) > 0 {
1265
		return PermissionBulkCheckResponseMultiError(errors)
1266
	}
1267
1268
	return nil
1269
}
1270
1271
// PermissionBulkCheckResponseMultiError is an error wrapping multiple
1272
// validation errors returned by PermissionBulkCheckResponse.ValidateAll() if
1273
// the designated constraints aren't met.
1274
type PermissionBulkCheckResponseMultiError []error
1275
1276
// Error returns a concatenation of all the error messages it wraps.
1277
func (m PermissionBulkCheckResponseMultiError) Error() string {
1278
	msgs := make([]string, 0, len(m))
1279
	for _, err := range m {
1280
		msgs = append(msgs, err.Error())
1281
	}
1282
	return strings.Join(msgs, "; ")
1283
}
1284
1285
// AllErrors returns a list of validation violation errors.
1286
func (m PermissionBulkCheckResponseMultiError) AllErrors() []error { return m }
1287
1288
// PermissionBulkCheckResponseValidationError is the validation error returned
1289
// by PermissionBulkCheckResponse.Validate if the designated constraints
1290
// aren't met.
1291
type PermissionBulkCheckResponseValidationError struct {
1292
	field  string
1293
	reason string
1294
	cause  error
1295
	key    bool
1296
}
1297
1298
// Field function returns field value.
1299
func (e PermissionBulkCheckResponseValidationError) Field() string { return e.field }
1300
1301
// Reason function returns reason value.
1302
func (e PermissionBulkCheckResponseValidationError) Reason() string { return e.reason }
1303
1304
// Cause function returns cause value.
1305
func (e PermissionBulkCheckResponseValidationError) Cause() error { return e.cause }
1306
1307
// Key function returns key value.
1308
func (e PermissionBulkCheckResponseValidationError) Key() bool { return e.key }
1309
1310
// ErrorName returns error name.
1311
func (e PermissionBulkCheckResponseValidationError) ErrorName() string {
1312
	return "PermissionBulkCheckResponseValidationError"
1313
}
1314
1315
// Error satisfies the builtin error interface
1316
func (e PermissionBulkCheckResponseValidationError) Error() string {
1317
	cause := ""
1318
	if e.cause != nil {
1319
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
1320
	}
1321
1322
	key := ""
1323
	if e.key {
1324
		key = "key for "
1325
	}
1326
1327
	return fmt.Sprintf(
1328
		"invalid %sPermissionBulkCheckResponse.%s: %s%s",
1329
		key,
1330
		e.field,
1331
		e.reason,
1332
		cause)
1333
}
1334
1335
var _ error = PermissionBulkCheckResponseValidationError{}
1336
1337
var _ interface {
1338
	Field() string
1339
	Reason() string
1340
	Key() bool
1341
	Cause() error
1342
	ErrorName() string
1343
} = PermissionBulkCheckResponseValidationError{}
1344
1345
// Validate checks the field values on PermissionExpandRequest with the rules
1346
// defined in the proto definition for this message. If any rules are
1347
// violated, the first error encountered is returned, or nil if there are no violations.
1348
func (m *PermissionExpandRequest) Validate() error {
1349
	return m.validate(false)
1350
}
1351
1352
// ValidateAll checks the field values on PermissionExpandRequest with the
1353
// rules defined in the proto definition for this message. If any rules are
1354
// violated, the result is a list of violation errors wrapped in
1355
// PermissionExpandRequestMultiError, or nil if none found.
1356
func (m *PermissionExpandRequest) ValidateAll() error {
1357
	return m.validate(true)
1358
}
1359
1360
func (m *PermissionExpandRequest) validate(all bool) error {
1361
	if m == nil {
1362
		return nil
1363
	}
1364
1365
	var errors []error
1366
1367
	if len(m.GetTenantId()) > 128 {
1368
		err := PermissionExpandRequestValidationError{
1369
			field:  "TenantId",
1370
			reason: "value length must be at most 128 bytes",
1371
		}
1372
		if !all {
1373
			return err
1374
		}
1375
		errors = append(errors, err)
1376
	}
1377
1378
	if !_PermissionExpandRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
1379
		err := PermissionExpandRequestValidationError{
1380
			field:  "TenantId",
1381
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
1382
		}
1383
		if !all {
1384
			return err
1385
		}
1386
		errors = append(errors, err)
1387
	}
1388
1389
	if m.GetMetadata() == nil {
1390
		err := PermissionExpandRequestValidationError{
1391
			field:  "Metadata",
1392
			reason: "value is required",
1393
		}
1394
		if !all {
1395
			return err
1396
		}
1397
		errors = append(errors, err)
1398
	}
1399
1400
	if all {
1401
		switch v := interface{}(m.GetMetadata()).(type) {
1402
		case interface{ ValidateAll() error }:
1403
			if err := v.ValidateAll(); err != nil {
1404
				errors = append(errors, PermissionExpandRequestValidationError{
1405
					field:  "Metadata",
1406
					reason: "embedded message failed validation",
1407
					cause:  err,
1408
				})
1409
			}
1410
		case interface{ Validate() error }:
1411
			if err := v.Validate(); err != nil {
1412
				errors = append(errors, PermissionExpandRequestValidationError{
1413
					field:  "Metadata",
1414
					reason: "embedded message failed validation",
1415
					cause:  err,
1416
				})
1417
			}
1418
		}
1419
	} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
1420
		if err := v.Validate(); err != nil {
1421
			return PermissionExpandRequestValidationError{
1422
				field:  "Metadata",
1423
				reason: "embedded message failed validation",
1424
				cause:  err,
1425
			}
1426
		}
1427
	}
1428
1429
	if m.GetEntity() == nil {
1430
		err := PermissionExpandRequestValidationError{
1431
			field:  "Entity",
1432
			reason: "value is required",
1433
		}
1434
		if !all {
1435
			return err
1436
		}
1437
		errors = append(errors, err)
1438
	}
1439
1440
	if all {
1441
		switch v := interface{}(m.GetEntity()).(type) {
1442
		case interface{ ValidateAll() error }:
1443
			if err := v.ValidateAll(); err != nil {
1444
				errors = append(errors, PermissionExpandRequestValidationError{
1445
					field:  "Entity",
1446
					reason: "embedded message failed validation",
1447
					cause:  err,
1448
				})
1449
			}
1450
		case interface{ Validate() error }:
1451
			if err := v.Validate(); err != nil {
1452
				errors = append(errors, PermissionExpandRequestValidationError{
1453
					field:  "Entity",
1454
					reason: "embedded message failed validation",
1455
					cause:  err,
1456
				})
1457
			}
1458
		}
1459
	} else if v, ok := interface{}(m.GetEntity()).(interface{ Validate() error }); ok {
1460
		if err := v.Validate(); err != nil {
1461
			return PermissionExpandRequestValidationError{
1462
				field:  "Entity",
1463
				reason: "embedded message failed validation",
1464
				cause:  err,
1465
			}
1466
		}
1467
	}
1468
1469
	if m.GetPermission() != "" {
1470
1471
		if len(m.GetPermission()) > 64 {
1472
			err := PermissionExpandRequestValidationError{
1473
				field:  "Permission",
1474
				reason: "value length must be at most 64 bytes",
1475
			}
1476
			if !all {
1477
				return err
1478
			}
1479
			errors = append(errors, err)
1480
		}
1481
1482
		if !_PermissionExpandRequest_Permission_Pattern.MatchString(m.GetPermission()) {
1483
			err := PermissionExpandRequestValidationError{
1484
				field:  "Permission",
1485
				reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"",
1486
			}
1487
			if !all {
1488
				return err
1489
			}
1490
			errors = append(errors, err)
1491
		}
1492
1493
	}
1494
1495
	if all {
1496
		switch v := interface{}(m.GetContext()).(type) {
1497
		case interface{ ValidateAll() error }:
1498
			if err := v.ValidateAll(); err != nil {
1499
				errors = append(errors, PermissionExpandRequestValidationError{
1500
					field:  "Context",
1501
					reason: "embedded message failed validation",
1502
					cause:  err,
1503
				})
1504
			}
1505
		case interface{ Validate() error }:
1506
			if err := v.Validate(); err != nil {
1507
				errors = append(errors, PermissionExpandRequestValidationError{
1508
					field:  "Context",
1509
					reason: "embedded message failed validation",
1510
					cause:  err,
1511
				})
1512
			}
1513
		}
1514
	} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok {
1515
		if err := v.Validate(); err != nil {
1516
			return PermissionExpandRequestValidationError{
1517
				field:  "Context",
1518
				reason: "embedded message failed validation",
1519
				cause:  err,
1520
			}
1521
		}
1522
	}
1523
1524
	for idx, item := range m.GetArguments() {
1525
		_, _ = idx, item
1526
1527
		if all {
1528
			switch v := interface{}(item).(type) {
1529
			case interface{ ValidateAll() error }:
1530
				if err := v.ValidateAll(); err != nil {
1531
					errors = append(errors, PermissionExpandRequestValidationError{
1532
						field:  fmt.Sprintf("Arguments[%v]", idx),
1533
						reason: "embedded message failed validation",
1534
						cause:  err,
1535
					})
1536
				}
1537
			case interface{ Validate() error }:
1538
				if err := v.Validate(); err != nil {
1539
					errors = append(errors, PermissionExpandRequestValidationError{
1540
						field:  fmt.Sprintf("Arguments[%v]", idx),
1541
						reason: "embedded message failed validation",
1542
						cause:  err,
1543
					})
1544
				}
1545
			}
1546
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
1547
			if err := v.Validate(); err != nil {
1548
				return PermissionExpandRequestValidationError{
1549
					field:  fmt.Sprintf("Arguments[%v]", idx),
1550
					reason: "embedded message failed validation",
1551
					cause:  err,
1552
				}
1553
			}
1554
		}
1555
1556
	}
1557
1558
	if len(errors) > 0 {
1559
		return PermissionExpandRequestMultiError(errors)
1560
	}
1561
1562
	return nil
1563
}
1564
1565
// PermissionExpandRequestMultiError is an error wrapping multiple validation
1566
// errors returned by PermissionExpandRequest.ValidateAll() if the designated
1567
// constraints aren't met.
1568
type PermissionExpandRequestMultiError []error
1569
1570
// Error returns a concatenation of all the error messages it wraps.
1571
func (m PermissionExpandRequestMultiError) Error() string {
1572
	msgs := make([]string, 0, len(m))
1573
	for _, err := range m {
1574
		msgs = append(msgs, err.Error())
1575
	}
1576
	return strings.Join(msgs, "; ")
1577
}
1578
1579
// AllErrors returns a list of validation violation errors.
1580
func (m PermissionExpandRequestMultiError) AllErrors() []error { return m }
1581
1582
// PermissionExpandRequestValidationError is the validation error returned by
1583
// PermissionExpandRequest.Validate if the designated constraints aren't met.
1584
type PermissionExpandRequestValidationError struct {
1585
	field  string
1586
	reason string
1587
	cause  error
1588
	key    bool
1589
}
1590
1591
// Field function returns field value.
1592
func (e PermissionExpandRequestValidationError) Field() string { return e.field }
1593
1594
// Reason function returns reason value.
1595
func (e PermissionExpandRequestValidationError) Reason() string { return e.reason }
1596
1597
// Cause function returns cause value.
1598
func (e PermissionExpandRequestValidationError) Cause() error { return e.cause }
1599
1600
// Key function returns key value.
1601
func (e PermissionExpandRequestValidationError) Key() bool { return e.key }
1602
1603
// ErrorName returns error name.
1604
func (e PermissionExpandRequestValidationError) ErrorName() string {
1605
	return "PermissionExpandRequestValidationError"
1606
}
1607
1608
// Error satisfies the builtin error interface
1609
func (e PermissionExpandRequestValidationError) Error() string {
1610
	cause := ""
1611
	if e.cause != nil {
1612
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
1613
	}
1614
1615
	key := ""
1616
	if e.key {
1617
		key = "key for "
1618
	}
1619
1620
	return fmt.Sprintf(
1621
		"invalid %sPermissionExpandRequest.%s: %s%s",
1622
		key,
1623
		e.field,
1624
		e.reason,
1625
		cause)
1626
}
1627
1628
var _ error = PermissionExpandRequestValidationError{}
1629
1630
var _ interface {
1631
	Field() string
1632
	Reason() string
1633
	Key() bool
1634
	Cause() error
1635
	ErrorName() string
1636
} = PermissionExpandRequestValidationError{}
1637
1638
var _PermissionExpandRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
1639
1640
var _PermissionExpandRequest_Permission_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$")
1641
1642
// Validate checks the field values on PermissionExpandRequestMetadata with the
1643
// rules defined in the proto definition for this message. If any rules are
1644
// violated, the first error encountered is returned, or nil if there are no violations.
1645
func (m *PermissionExpandRequestMetadata) Validate() error {
1646
	return m.validate(false)
1647
}
1648
1649
// ValidateAll checks the field values on PermissionExpandRequestMetadata with
1650
// the rules defined in the proto definition for this message. If any rules
1651
// are violated, the result is a list of violation errors wrapped in
1652
// PermissionExpandRequestMetadataMultiError, or nil if none found.
1653
func (m *PermissionExpandRequestMetadata) ValidateAll() error {
1654
	return m.validate(true)
1655
}
1656
1657
func (m *PermissionExpandRequestMetadata) validate(all bool) error {
1658
	if m == nil {
1659
		return nil
1660
	}
1661
1662
	var errors []error
1663
1664
	// no validation rules for SchemaVersion
1665
1666
	// no validation rules for SnapToken
1667
1668
	if len(errors) > 0 {
1669
		return PermissionExpandRequestMetadataMultiError(errors)
1670
	}
1671
1672
	return nil
1673
}
1674
1675
// PermissionExpandRequestMetadataMultiError is an error wrapping multiple
1676
// validation errors returned by PermissionExpandRequestMetadata.ValidateAll()
1677
// if the designated constraints aren't met.
1678
type PermissionExpandRequestMetadataMultiError []error
1679
1680
// Error returns a concatenation of all the error messages it wraps.
1681
func (m PermissionExpandRequestMetadataMultiError) Error() string {
1682
	msgs := make([]string, 0, len(m))
1683
	for _, err := range m {
1684
		msgs = append(msgs, err.Error())
1685
	}
1686
	return strings.Join(msgs, "; ")
1687
}
1688
1689
// AllErrors returns a list of validation violation errors.
1690
func (m PermissionExpandRequestMetadataMultiError) AllErrors() []error { return m }
1691
1692
// PermissionExpandRequestMetadataValidationError is the validation error
1693
// returned by PermissionExpandRequestMetadata.Validate if the designated
1694
// constraints aren't met.
1695
type PermissionExpandRequestMetadataValidationError struct {
1696
	field  string
1697
	reason string
1698
	cause  error
1699
	key    bool
1700
}
1701
1702
// Field function returns field value.
1703
func (e PermissionExpandRequestMetadataValidationError) Field() string { return e.field }
1704
1705
// Reason function returns reason value.
1706
func (e PermissionExpandRequestMetadataValidationError) Reason() string { return e.reason }
1707
1708
// Cause function returns cause value.
1709
func (e PermissionExpandRequestMetadataValidationError) Cause() error { return e.cause }
1710
1711
// Key function returns key value.
1712
func (e PermissionExpandRequestMetadataValidationError) Key() bool { return e.key }
1713
1714
// ErrorName returns error name.
1715
func (e PermissionExpandRequestMetadataValidationError) ErrorName() string {
1716
	return "PermissionExpandRequestMetadataValidationError"
1717
}
1718
1719
// Error satisfies the builtin error interface
1720
func (e PermissionExpandRequestMetadataValidationError) Error() string {
1721
	cause := ""
1722
	if e.cause != nil {
1723
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
1724
	}
1725
1726
	key := ""
1727
	if e.key {
1728
		key = "key for "
1729
	}
1730
1731
	return fmt.Sprintf(
1732
		"invalid %sPermissionExpandRequestMetadata.%s: %s%s",
1733
		key,
1734
		e.field,
1735
		e.reason,
1736
		cause)
1737
}
1738
1739
var _ error = PermissionExpandRequestMetadataValidationError{}
1740
1741
var _ interface {
1742
	Field() string
1743
	Reason() string
1744
	Key() bool
1745
	Cause() error
1746
	ErrorName() string
1747
} = PermissionExpandRequestMetadataValidationError{}
1748
1749
// Validate checks the field values on PermissionExpandResponse with the rules
1750
// defined in the proto definition for this message. If any rules are
1751
// violated, the first error encountered is returned, or nil if there are no violations.
1752
func (m *PermissionExpandResponse) Validate() error {
1753
	return m.validate(false)
1754
}
1755
1756
// ValidateAll checks the field values on PermissionExpandResponse with the
1757
// rules defined in the proto definition for this message. If any rules are
1758
// violated, the result is a list of violation errors wrapped in
1759
// PermissionExpandResponseMultiError, or nil if none found.
1760
func (m *PermissionExpandResponse) ValidateAll() error {
1761
	return m.validate(true)
1762
}
1763
1764
func (m *PermissionExpandResponse) validate(all bool) error {
1765
	if m == nil {
1766
		return nil
1767
	}
1768
1769
	var errors []error
1770
1771
	if all {
1772
		switch v := interface{}(m.GetTree()).(type) {
1773
		case interface{ ValidateAll() error }:
1774
			if err := v.ValidateAll(); err != nil {
1775
				errors = append(errors, PermissionExpandResponseValidationError{
1776
					field:  "Tree",
1777
					reason: "embedded message failed validation",
1778
					cause:  err,
1779
				})
1780
			}
1781
		case interface{ Validate() error }:
1782
			if err := v.Validate(); err != nil {
1783
				errors = append(errors, PermissionExpandResponseValidationError{
1784
					field:  "Tree",
1785
					reason: "embedded message failed validation",
1786
					cause:  err,
1787
				})
1788
			}
1789
		}
1790
	} else if v, ok := interface{}(m.GetTree()).(interface{ Validate() error }); ok {
1791
		if err := v.Validate(); err != nil {
1792
			return PermissionExpandResponseValidationError{
1793
				field:  "Tree",
1794
				reason: "embedded message failed validation",
1795
				cause:  err,
1796
			}
1797
		}
1798
	}
1799
1800
	if len(errors) > 0 {
1801
		return PermissionExpandResponseMultiError(errors)
1802
	}
1803
1804
	return nil
1805
}
1806
1807
// PermissionExpandResponseMultiError is an error wrapping multiple validation
1808
// errors returned by PermissionExpandResponse.ValidateAll() if the designated
1809
// constraints aren't met.
1810
type PermissionExpandResponseMultiError []error
1811
1812
// Error returns a concatenation of all the error messages it wraps.
1813
func (m PermissionExpandResponseMultiError) Error() string {
1814
	msgs := make([]string, 0, len(m))
1815
	for _, err := range m {
1816
		msgs = append(msgs, err.Error())
1817
	}
1818
	return strings.Join(msgs, "; ")
1819
}
1820
1821
// AllErrors returns a list of validation violation errors.
1822
func (m PermissionExpandResponseMultiError) AllErrors() []error { return m }
1823
1824
// PermissionExpandResponseValidationError is the validation error returned by
1825
// PermissionExpandResponse.Validate if the designated constraints aren't met.
1826
type PermissionExpandResponseValidationError struct {
1827
	field  string
1828
	reason string
1829
	cause  error
1830
	key    bool
1831
}
1832
1833
// Field function returns field value.
1834
func (e PermissionExpandResponseValidationError) Field() string { return e.field }
1835
1836
// Reason function returns reason value.
1837
func (e PermissionExpandResponseValidationError) Reason() string { return e.reason }
1838
1839
// Cause function returns cause value.
1840
func (e PermissionExpandResponseValidationError) Cause() error { return e.cause }
1841
1842
// Key function returns key value.
1843
func (e PermissionExpandResponseValidationError) Key() bool { return e.key }
1844
1845
// ErrorName returns error name.
1846
func (e PermissionExpandResponseValidationError) ErrorName() string {
1847
	return "PermissionExpandResponseValidationError"
1848
}
1849
1850
// Error satisfies the builtin error interface
1851
func (e PermissionExpandResponseValidationError) Error() string {
1852
	cause := ""
1853
	if e.cause != nil {
1854
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
1855
	}
1856
1857
	key := ""
1858
	if e.key {
1859
		key = "key for "
1860
	}
1861
1862
	return fmt.Sprintf(
1863
		"invalid %sPermissionExpandResponse.%s: %s%s",
1864
		key,
1865
		e.field,
1866
		e.reason,
1867
		cause)
1868
}
1869
1870
var _ error = PermissionExpandResponseValidationError{}
1871
1872
var _ interface {
1873
	Field() string
1874
	Reason() string
1875
	Key() bool
1876
	Cause() error
1877
	ErrorName() string
1878
} = PermissionExpandResponseValidationError{}
1879
1880
// Validate checks the field values on PermissionLookupEntityRequest with the
1881
// rules defined in the proto definition for this message. If any rules are
1882
// violated, the first error encountered is returned, or nil if there are no violations.
1883
func (m *PermissionLookupEntityRequest) Validate() error {
1884
	return m.validate(false)
1885
}
1886
1887
// ValidateAll checks the field values on PermissionLookupEntityRequest with
1888
// the rules defined in the proto definition for this message. If any rules
1889
// are violated, the result is a list of violation errors wrapped in
1890
// PermissionLookupEntityRequestMultiError, or nil if none found.
1891
func (m *PermissionLookupEntityRequest) ValidateAll() error {
1892
	return m.validate(true)
1893
}
1894
1895
func (m *PermissionLookupEntityRequest) validate(all bool) error {
1896
	if m == nil {
1897
		return nil
1898
	}
1899
1900
	var errors []error
1901
1902
	if len(m.GetTenantId()) > 128 {
1903
		err := PermissionLookupEntityRequestValidationError{
1904
			field:  "TenantId",
1905
			reason: "value length must be at most 128 bytes",
1906
		}
1907
		if !all {
1908
			return err
1909
		}
1910
		errors = append(errors, err)
1911
	}
1912
1913
	if !_PermissionLookupEntityRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
1914
		err := PermissionLookupEntityRequestValidationError{
1915
			field:  "TenantId",
1916
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
1917
		}
1918
		if !all {
1919
			return err
1920
		}
1921
		errors = append(errors, err)
1922
	}
1923
1924
	if m.GetMetadata() == nil {
1925
		err := PermissionLookupEntityRequestValidationError{
1926
			field:  "Metadata",
1927
			reason: "value is required",
1928
		}
1929
		if !all {
1930
			return err
1931
		}
1932
		errors = append(errors, err)
1933
	}
1934
1935
	if all {
1936
		switch v := interface{}(m.GetMetadata()).(type) {
1937
		case interface{ ValidateAll() error }:
1938
			if err := v.ValidateAll(); err != nil {
1939
				errors = append(errors, PermissionLookupEntityRequestValidationError{
1940
					field:  "Metadata",
1941
					reason: "embedded message failed validation",
1942
					cause:  err,
1943
				})
1944
			}
1945
		case interface{ Validate() error }:
1946
			if err := v.Validate(); err != nil {
1947
				errors = append(errors, PermissionLookupEntityRequestValidationError{
1948
					field:  "Metadata",
1949
					reason: "embedded message failed validation",
1950
					cause:  err,
1951
				})
1952
			}
1953
		}
1954
	} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
1955
		if err := v.Validate(); err != nil {
1956
			return PermissionLookupEntityRequestValidationError{
1957
				field:  "Metadata",
1958
				reason: "embedded message failed validation",
1959
				cause:  err,
1960
			}
1961
		}
1962
	}
1963
1964
	if len(m.GetEntityType()) > 64 {
1965
		err := PermissionLookupEntityRequestValidationError{
1966
			field:  "EntityType",
1967
			reason: "value length must be at most 64 bytes",
1968
		}
1969
		if !all {
1970
			return err
1971
		}
1972
		errors = append(errors, err)
1973
	}
1974
1975
	if !_PermissionLookupEntityRequest_EntityType_Pattern.MatchString(m.GetEntityType()) {
1976
		err := PermissionLookupEntityRequestValidationError{
1977
			field:  "EntityType",
1978
			reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"",
1979
		}
1980
		if !all {
1981
			return err
1982
		}
1983
		errors = append(errors, err)
1984
	}
1985
1986
	if len(m.GetPermission()) > 64 {
1987
		err := PermissionLookupEntityRequestValidationError{
1988
			field:  "Permission",
1989
			reason: "value length must be at most 64 bytes",
1990
		}
1991
		if !all {
1992
			return err
1993
		}
1994
		errors = append(errors, err)
1995
	}
1996
1997
	if !_PermissionLookupEntityRequest_Permission_Pattern.MatchString(m.GetPermission()) {
1998
		err := PermissionLookupEntityRequestValidationError{
1999
			field:  "Permission",
2000
			reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"",
2001
		}
2002
		if !all {
2003
			return err
2004
		}
2005
		errors = append(errors, err)
2006
	}
2007
2008
	if m.GetSubject() == nil {
2009
		err := PermissionLookupEntityRequestValidationError{
2010
			field:  "Subject",
2011
			reason: "value is required",
2012
		}
2013
		if !all {
2014
			return err
2015
		}
2016
		errors = append(errors, err)
2017
	}
2018
2019
	if all {
2020
		switch v := interface{}(m.GetSubject()).(type) {
2021
		case interface{ ValidateAll() error }:
2022
			if err := v.ValidateAll(); err != nil {
2023
				errors = append(errors, PermissionLookupEntityRequestValidationError{
2024
					field:  "Subject",
2025
					reason: "embedded message failed validation",
2026
					cause:  err,
2027
				})
2028
			}
2029
		case interface{ Validate() error }:
2030
			if err := v.Validate(); err != nil {
2031
				errors = append(errors, PermissionLookupEntityRequestValidationError{
2032
					field:  "Subject",
2033
					reason: "embedded message failed validation",
2034
					cause:  err,
2035
				})
2036
			}
2037
		}
2038
	} else if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok {
2039
		if err := v.Validate(); err != nil {
2040
			return PermissionLookupEntityRequestValidationError{
2041
				field:  "Subject",
2042
				reason: "embedded message failed validation",
2043
				cause:  err,
2044
			}
2045
		}
2046
	}
2047
2048
	if all {
2049
		switch v := interface{}(m.GetContext()).(type) {
2050
		case interface{ ValidateAll() error }:
2051
			if err := v.ValidateAll(); err != nil {
2052
				errors = append(errors, PermissionLookupEntityRequestValidationError{
2053
					field:  "Context",
2054
					reason: "embedded message failed validation",
2055
					cause:  err,
2056
				})
2057
			}
2058
		case interface{ Validate() error }:
2059
			if err := v.Validate(); err != nil {
2060
				errors = append(errors, PermissionLookupEntityRequestValidationError{
2061
					field:  "Context",
2062
					reason: "embedded message failed validation",
2063
					cause:  err,
2064
				})
2065
			}
2066
		}
2067
	} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok {
2068
		if err := v.Validate(); err != nil {
2069
			return PermissionLookupEntityRequestValidationError{
2070
				field:  "Context",
2071
				reason: "embedded message failed validation",
2072
				cause:  err,
2073
			}
2074
		}
2075
	}
2076
2077
	{
2078
		sorted_keys := make([]string, len(m.GetScope()))
2079
		i := 0
2080
		for key := range m.GetScope() {
2081
			sorted_keys[i] = key
2082
			i++
2083
		}
2084
		sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] })
2085
		for _, key := range sorted_keys {
2086
			val := m.GetScope()[key]
2087
			_ = val
2088
2089
			// no validation rules for Scope[key]
2090
2091
			if all {
2092
				switch v := interface{}(val).(type) {
2093
				case interface{ ValidateAll() error }:
2094
					if err := v.ValidateAll(); err != nil {
2095
						errors = append(errors, PermissionLookupEntityRequestValidationError{
2096
							field:  fmt.Sprintf("Scope[%v]", key),
2097
							reason: "embedded message failed validation",
2098
							cause:  err,
2099
						})
2100
					}
2101
				case interface{ Validate() error }:
2102
					if err := v.Validate(); err != nil {
2103
						errors = append(errors, PermissionLookupEntityRequestValidationError{
2104
							field:  fmt.Sprintf("Scope[%v]", key),
2105
							reason: "embedded message failed validation",
2106
							cause:  err,
2107
						})
2108
					}
2109
				}
2110
			} else if v, ok := interface{}(val).(interface{ Validate() error }); ok {
2111
				if err := v.Validate(); err != nil {
2112
					return PermissionLookupEntityRequestValidationError{
2113
						field:  fmt.Sprintf("Scope[%v]", key),
2114
						reason: "embedded message failed validation",
2115
						cause:  err,
2116
					}
2117
				}
2118
			}
2119
2120
		}
2121
	}
2122
2123
	if m.GetPageSize() != 0 {
2124
2125
		if m.GetPageSize() < 1 {
2126
			err := PermissionLookupEntityRequestValidationError{
2127
				field:  "PageSize",
2128
				reason: "value must be greater than or equal to 1",
2129
			}
2130
			if !all {
2131
				return err
2132
			}
2133
			errors = append(errors, err)
2134
		}
2135
2136
	}
2137
2138
	if m.GetContinuousToken() != "" {
2139
2140
	}
2141
2142
	if len(errors) > 0 {
2143
		return PermissionLookupEntityRequestMultiError(errors)
2144
	}
2145
2146
	return nil
2147
}
2148
2149
// PermissionLookupEntityRequestMultiError is an error wrapping multiple
2150
// validation errors returned by PermissionLookupEntityRequest.ValidateAll()
2151
// if the designated constraints aren't met.
2152
type PermissionLookupEntityRequestMultiError []error
2153
2154
// Error returns a concatenation of all the error messages it wraps.
2155
func (m PermissionLookupEntityRequestMultiError) Error() string {
2156
	msgs := make([]string, 0, len(m))
2157
	for _, err := range m {
2158
		msgs = append(msgs, err.Error())
2159
	}
2160
	return strings.Join(msgs, "; ")
2161
}
2162
2163
// AllErrors returns a list of validation violation errors.
2164
func (m PermissionLookupEntityRequestMultiError) AllErrors() []error { return m }
2165
2166
// PermissionLookupEntityRequestValidationError is the validation error
2167
// returned by PermissionLookupEntityRequest.Validate if the designated
2168
// constraints aren't met.
2169
type PermissionLookupEntityRequestValidationError struct {
2170
	field  string
2171
	reason string
2172
	cause  error
2173
	key    bool
2174
}
2175
2176
// Field function returns field value.
2177
func (e PermissionLookupEntityRequestValidationError) Field() string { return e.field }
2178
2179
// Reason function returns reason value.
2180
func (e PermissionLookupEntityRequestValidationError) Reason() string { return e.reason }
2181
2182
// Cause function returns cause value.
2183
func (e PermissionLookupEntityRequestValidationError) Cause() error { return e.cause }
2184
2185
// Key function returns key value.
2186
func (e PermissionLookupEntityRequestValidationError) Key() bool { return e.key }
2187
2188
// ErrorName returns error name.
2189
func (e PermissionLookupEntityRequestValidationError) ErrorName() string {
2190
	return "PermissionLookupEntityRequestValidationError"
2191
}
2192
2193
// Error satisfies the builtin error interface
2194
func (e PermissionLookupEntityRequestValidationError) Error() string {
2195
	cause := ""
2196
	if e.cause != nil {
2197
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
2198
	}
2199
2200
	key := ""
2201
	if e.key {
2202
		key = "key for "
2203
	}
2204
2205
	return fmt.Sprintf(
2206
		"invalid %sPermissionLookupEntityRequest.%s: %s%s",
2207
		key,
2208
		e.field,
2209
		e.reason,
2210
		cause)
2211
}
2212
2213
var _ error = PermissionLookupEntityRequestValidationError{}
2214
2215
var _ interface {
2216
	Field() string
2217
	Reason() string
2218
	Key() bool
2219
	Cause() error
2220
	ErrorName() string
2221
} = PermissionLookupEntityRequestValidationError{}
2222
2223
var _PermissionLookupEntityRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
2224
2225
var _PermissionLookupEntityRequest_EntityType_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$")
2226
2227
var _PermissionLookupEntityRequest_Permission_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$")
2228
2229
// Validate checks the field values on PermissionLookupEntityRequestMetadata
2230
// with the rules defined in the proto definition for this message. If any
2231
// rules are violated, the first error encountered is returned, or nil if
2232
// there are no violations.
2233
func (m *PermissionLookupEntityRequestMetadata) Validate() error {
2234
	return m.validate(false)
2235
}
2236
2237
// ValidateAll checks the field values on PermissionLookupEntityRequestMetadata
2238
// with the rules defined in the proto definition for this message. If any
2239
// rules are violated, the result is a list of violation errors wrapped in
2240
// PermissionLookupEntityRequestMetadataMultiError, or nil if none found.
2241
func (m *PermissionLookupEntityRequestMetadata) ValidateAll() error {
2242
	return m.validate(true)
2243
}
2244
2245
func (m *PermissionLookupEntityRequestMetadata) validate(all bool) error {
2246
	if m == nil {
2247
		return nil
2248
	}
2249
2250
	var errors []error
2251
2252
	// no validation rules for SchemaVersion
2253
2254
	// no validation rules for SnapToken
2255
2256
	if m.GetDepth() < 3 {
2257
		err := PermissionLookupEntityRequestMetadataValidationError{
2258
			field:  "Depth",
2259
			reason: "value must be greater than or equal to 3",
2260
		}
2261
		if !all {
2262
			return err
2263
		}
2264
		errors = append(errors, err)
2265
	}
2266
2267
	if len(errors) > 0 {
2268
		return PermissionLookupEntityRequestMetadataMultiError(errors)
2269
	}
2270
2271
	return nil
2272
}
2273
2274
// PermissionLookupEntityRequestMetadataMultiError is an error wrapping
2275
// multiple validation errors returned by
2276
// PermissionLookupEntityRequestMetadata.ValidateAll() if the designated
2277
// constraints aren't met.
2278
type PermissionLookupEntityRequestMetadataMultiError []error
2279
2280
// Error returns a concatenation of all the error messages it wraps.
2281
func (m PermissionLookupEntityRequestMetadataMultiError) Error() string {
2282
	msgs := make([]string, 0, len(m))
2283
	for _, err := range m {
2284
		msgs = append(msgs, err.Error())
2285
	}
2286
	return strings.Join(msgs, "; ")
2287
}
2288
2289
// AllErrors returns a list of validation violation errors.
2290
func (m PermissionLookupEntityRequestMetadataMultiError) AllErrors() []error { return m }
2291
2292
// PermissionLookupEntityRequestMetadataValidationError is the validation error
2293
// returned by PermissionLookupEntityRequestMetadata.Validate if the
2294
// designated constraints aren't met.
2295
type PermissionLookupEntityRequestMetadataValidationError struct {
2296
	field  string
2297
	reason string
2298
	cause  error
2299
	key    bool
2300
}
2301
2302
// Field function returns field value.
2303
func (e PermissionLookupEntityRequestMetadataValidationError) Field() string { return e.field }
2304
2305
// Reason function returns reason value.
2306
func (e PermissionLookupEntityRequestMetadataValidationError) Reason() string { return e.reason }
2307
2308
// Cause function returns cause value.
2309
func (e PermissionLookupEntityRequestMetadataValidationError) Cause() error { return e.cause }
2310
2311
// Key function returns key value.
2312
func (e PermissionLookupEntityRequestMetadataValidationError) Key() bool { return e.key }
2313
2314
// ErrorName returns error name.
2315
func (e PermissionLookupEntityRequestMetadataValidationError) ErrorName() string {
2316
	return "PermissionLookupEntityRequestMetadataValidationError"
2317
}
2318
2319
// Error satisfies the builtin error interface
2320
func (e PermissionLookupEntityRequestMetadataValidationError) Error() string {
2321
	cause := ""
2322
	if e.cause != nil {
2323
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
2324
	}
2325
2326
	key := ""
2327
	if e.key {
2328
		key = "key for "
2329
	}
2330
2331
	return fmt.Sprintf(
2332
		"invalid %sPermissionLookupEntityRequestMetadata.%s: %s%s",
2333
		key,
2334
		e.field,
2335
		e.reason,
2336
		cause)
2337
}
2338
2339
var _ error = PermissionLookupEntityRequestMetadataValidationError{}
2340
2341
var _ interface {
2342
	Field() string
2343
	Reason() string
2344
	Key() bool
2345
	Cause() error
2346
	ErrorName() string
2347
} = PermissionLookupEntityRequestMetadataValidationError{}
2348
2349
// Validate checks the field values on PermissionLookupEntityResponse with the
2350
// rules defined in the proto definition for this message. If any rules are
2351
// violated, the first error encountered is returned, or nil if there are no violations.
2352
func (m *PermissionLookupEntityResponse) Validate() error {
2353
	return m.validate(false)
2354
}
2355
2356
// ValidateAll checks the field values on PermissionLookupEntityResponse with
2357
// the rules defined in the proto definition for this message. If any rules
2358
// are violated, the result is a list of violation errors wrapped in
2359
// PermissionLookupEntityResponseMultiError, or nil if none found.
2360
func (m *PermissionLookupEntityResponse) ValidateAll() error {
2361
	return m.validate(true)
2362
}
2363
2364
func (m *PermissionLookupEntityResponse) validate(all bool) error {
2365
	if m == nil {
2366
		return nil
2367
	}
2368
2369
	var errors []error
2370
2371
	// no validation rules for ContinuousToken
2372
2373
	if len(errors) > 0 {
2374
		return PermissionLookupEntityResponseMultiError(errors)
2375
	}
2376
2377
	return nil
2378
}
2379
2380
// PermissionLookupEntityResponseMultiError is an error wrapping multiple
2381
// validation errors returned by PermissionLookupEntityResponse.ValidateAll()
2382
// if the designated constraints aren't met.
2383
type PermissionLookupEntityResponseMultiError []error
2384
2385
// Error returns a concatenation of all the error messages it wraps.
2386
func (m PermissionLookupEntityResponseMultiError) Error() string {
2387
	msgs := make([]string, 0, len(m))
2388
	for _, err := range m {
2389
		msgs = append(msgs, err.Error())
2390
	}
2391
	return strings.Join(msgs, "; ")
2392
}
2393
2394
// AllErrors returns a list of validation violation errors.
2395
func (m PermissionLookupEntityResponseMultiError) AllErrors() []error { return m }
2396
2397
// PermissionLookupEntityResponseValidationError is the validation error
2398
// returned by PermissionLookupEntityResponse.Validate if the designated
2399
// constraints aren't met.
2400
type PermissionLookupEntityResponseValidationError struct {
2401
	field  string
2402
	reason string
2403
	cause  error
2404
	key    bool
2405
}
2406
2407
// Field function returns field value.
2408
func (e PermissionLookupEntityResponseValidationError) Field() string { return e.field }
2409
2410
// Reason function returns reason value.
2411
func (e PermissionLookupEntityResponseValidationError) Reason() string { return e.reason }
2412
2413
// Cause function returns cause value.
2414
func (e PermissionLookupEntityResponseValidationError) Cause() error { return e.cause }
2415
2416
// Key function returns key value.
2417
func (e PermissionLookupEntityResponseValidationError) Key() bool { return e.key }
2418
2419
// ErrorName returns error name.
2420
func (e PermissionLookupEntityResponseValidationError) ErrorName() string {
2421
	return "PermissionLookupEntityResponseValidationError"
2422
}
2423
2424
// Error satisfies the builtin error interface
2425
func (e PermissionLookupEntityResponseValidationError) Error() string {
2426
	cause := ""
2427
	if e.cause != nil {
2428
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
2429
	}
2430
2431
	key := ""
2432
	if e.key {
2433
		key = "key for "
2434
	}
2435
2436
	return fmt.Sprintf(
2437
		"invalid %sPermissionLookupEntityResponse.%s: %s%s",
2438
		key,
2439
		e.field,
2440
		e.reason,
2441
		cause)
2442
}
2443
2444
var _ error = PermissionLookupEntityResponseValidationError{}
2445
2446
var _ interface {
2447
	Field() string
2448
	Reason() string
2449
	Key() bool
2450
	Cause() error
2451
	ErrorName() string
2452
} = PermissionLookupEntityResponseValidationError{}
2453
2454
// Validate checks the field values on PermissionLookupEntityStreamResponse
2455
// with the rules defined in the proto definition for this message. If any
2456
// rules are violated, the first error encountered is returned, or nil if
2457
// there are no violations.
2458
func (m *PermissionLookupEntityStreamResponse) Validate() error {
2459
	return m.validate(false)
2460
}
2461
2462
// ValidateAll checks the field values on PermissionLookupEntityStreamResponse
2463
// with the rules defined in the proto definition for this message. If any
2464
// rules are violated, the result is a list of violation errors wrapped in
2465
// PermissionLookupEntityStreamResponseMultiError, or nil if none found.
2466
func (m *PermissionLookupEntityStreamResponse) ValidateAll() error {
2467
	return m.validate(true)
2468
}
2469
2470
func (m *PermissionLookupEntityStreamResponse) validate(all bool) error {
2471
	if m == nil {
2472
		return nil
2473
	}
2474
2475
	var errors []error
2476
2477
	// no validation rules for EntityId
2478
2479
	// no validation rules for ContinuousToken
2480
2481
	if len(errors) > 0 {
2482
		return PermissionLookupEntityStreamResponseMultiError(errors)
2483
	}
2484
2485
	return nil
2486
}
2487
2488
// PermissionLookupEntityStreamResponseMultiError is an error wrapping multiple
2489
// validation errors returned by
2490
// PermissionLookupEntityStreamResponse.ValidateAll() if the designated
2491
// constraints aren't met.
2492
type PermissionLookupEntityStreamResponseMultiError []error
2493
2494
// Error returns a concatenation of all the error messages it wraps.
2495
func (m PermissionLookupEntityStreamResponseMultiError) Error() string {
2496
	msgs := make([]string, 0, len(m))
2497
	for _, err := range m {
2498
		msgs = append(msgs, err.Error())
2499
	}
2500
	return strings.Join(msgs, "; ")
2501
}
2502
2503
// AllErrors returns a list of validation violation errors.
2504
func (m PermissionLookupEntityStreamResponseMultiError) AllErrors() []error { return m }
2505
2506
// PermissionLookupEntityStreamResponseValidationError is the validation error
2507
// returned by PermissionLookupEntityStreamResponse.Validate if the designated
2508
// constraints aren't met.
2509
type PermissionLookupEntityStreamResponseValidationError struct {
2510
	field  string
2511
	reason string
2512
	cause  error
2513
	key    bool
2514
}
2515
2516
// Field function returns field value.
2517
func (e PermissionLookupEntityStreamResponseValidationError) Field() string { return e.field }
2518
2519
// Reason function returns reason value.
2520
func (e PermissionLookupEntityStreamResponseValidationError) Reason() string { return e.reason }
2521
2522
// Cause function returns cause value.
2523
func (e PermissionLookupEntityStreamResponseValidationError) Cause() error { return e.cause }
2524
2525
// Key function returns key value.
2526
func (e PermissionLookupEntityStreamResponseValidationError) Key() bool { return e.key }
2527
2528
// ErrorName returns error name.
2529
func (e PermissionLookupEntityStreamResponseValidationError) ErrorName() string {
2530
	return "PermissionLookupEntityStreamResponseValidationError"
2531
}
2532
2533
// Error satisfies the builtin error interface
2534
func (e PermissionLookupEntityStreamResponseValidationError) Error() string {
2535
	cause := ""
2536
	if e.cause != nil {
2537
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
2538
	}
2539
2540
	key := ""
2541
	if e.key {
2542
		key = "key for "
2543
	}
2544
2545
	return fmt.Sprintf(
2546
		"invalid %sPermissionLookupEntityStreamResponse.%s: %s%s",
2547
		key,
2548
		e.field,
2549
		e.reason,
2550
		cause)
2551
}
2552
2553
var _ error = PermissionLookupEntityStreamResponseValidationError{}
2554
2555
var _ interface {
2556
	Field() string
2557
	Reason() string
2558
	Key() bool
2559
	Cause() error
2560
	ErrorName() string
2561
} = PermissionLookupEntityStreamResponseValidationError{}
2562
2563
// Validate checks the field values on PermissionEntityFilterRequest with the
2564
// rules defined in the proto definition for this message. If any rules are
2565
// violated, the first error encountered is returned, or nil if there are no violations.
2566
func (m *PermissionEntityFilterRequest) Validate() error {
2567
	return m.validate(false)
2568
}
2569
2570
// ValidateAll checks the field values on PermissionEntityFilterRequest with
2571
// the rules defined in the proto definition for this message. If any rules
2572
// are violated, the result is a list of violation errors wrapped in
2573
// PermissionEntityFilterRequestMultiError, or nil if none found.
2574
func (m *PermissionEntityFilterRequest) ValidateAll() error {
2575
	return m.validate(true)
2576
}
2577
2578
func (m *PermissionEntityFilterRequest) validate(all bool) error {
2579
	if m == nil {
2580
		return nil
2581
	}
2582
2583
	var errors []error
2584
2585
	if len(m.GetTenantId()) > 128 {
2586
		err := PermissionEntityFilterRequestValidationError{
2587
			field:  "TenantId",
2588
			reason: "value length must be at most 128 bytes",
2589
		}
2590
		if !all {
2591
			return err
2592
		}
2593
		errors = append(errors, err)
2594
	}
2595
2596
	if !_PermissionEntityFilterRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
2597
		err := PermissionEntityFilterRequestValidationError{
2598
			field:  "TenantId",
2599
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
2600
		}
2601
		if !all {
2602
			return err
2603
		}
2604
		errors = append(errors, err)
2605
	}
2606
2607
	if m.GetMetadata() == nil {
2608
		err := PermissionEntityFilterRequestValidationError{
2609
			field:  "Metadata",
2610
			reason: "value is required",
2611
		}
2612
		if !all {
2613
			return err
2614
		}
2615
		errors = append(errors, err)
2616
	}
2617
2618
	if all {
2619
		switch v := interface{}(m.GetMetadata()).(type) {
2620
		case interface{ ValidateAll() error }:
2621
			if err := v.ValidateAll(); err != nil {
2622
				errors = append(errors, PermissionEntityFilterRequestValidationError{
2623
					field:  "Metadata",
2624
					reason: "embedded message failed validation",
2625
					cause:  err,
2626
				})
2627
			}
2628
		case interface{ Validate() error }:
2629
			if err := v.Validate(); err != nil {
2630
				errors = append(errors, PermissionEntityFilterRequestValidationError{
2631
					field:  "Metadata",
2632
					reason: "embedded message failed validation",
2633
					cause:  err,
2634
				})
2635
			}
2636
		}
2637
	} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
2638
		if err := v.Validate(); err != nil {
2639
			return PermissionEntityFilterRequestValidationError{
2640
				field:  "Metadata",
2641
				reason: "embedded message failed validation",
2642
				cause:  err,
2643
			}
2644
		}
2645
	}
2646
2647
	if all {
2648
		switch v := interface{}(m.GetEntrance()).(type) {
2649
		case interface{ ValidateAll() error }:
2650
			if err := v.ValidateAll(); err != nil {
2651
				errors = append(errors, PermissionEntityFilterRequestValidationError{
2652
					field:  "Entrance",
2653
					reason: "embedded message failed validation",
2654
					cause:  err,
2655
				})
2656
			}
2657
		case interface{ Validate() error }:
2658
			if err := v.Validate(); err != nil {
2659
				errors = append(errors, PermissionEntityFilterRequestValidationError{
2660
					field:  "Entrance",
2661
					reason: "embedded message failed validation",
2662
					cause:  err,
2663
				})
2664
			}
2665
		}
2666
	} else if v, ok := interface{}(m.GetEntrance()).(interface{ Validate() error }); ok {
2667
		if err := v.Validate(); err != nil {
2668
			return PermissionEntityFilterRequestValidationError{
2669
				field:  "Entrance",
2670
				reason: "embedded message failed validation",
2671
				cause:  err,
2672
			}
2673
		}
2674
	}
2675
2676
	if all {
2677
		switch v := interface{}(m.GetSubject()).(type) {
2678
		case interface{ ValidateAll() error }:
2679
			if err := v.ValidateAll(); err != nil {
2680
				errors = append(errors, PermissionEntityFilterRequestValidationError{
2681
					field:  "Subject",
2682
					reason: "embedded message failed validation",
2683
					cause:  err,
2684
				})
2685
			}
2686
		case interface{ Validate() error }:
2687
			if err := v.Validate(); err != nil {
2688
				errors = append(errors, PermissionEntityFilterRequestValidationError{
2689
					field:  "Subject",
2690
					reason: "embedded message failed validation",
2691
					cause:  err,
2692
				})
2693
			}
2694
		}
2695
	} else if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok {
2696
		if err := v.Validate(); err != nil {
2697
			return PermissionEntityFilterRequestValidationError{
2698
				field:  "Subject",
2699
				reason: "embedded message failed validation",
2700
				cause:  err,
2701
			}
2702
		}
2703
	}
2704
2705
	if all {
2706
		switch v := interface{}(m.GetContext()).(type) {
2707
		case interface{ ValidateAll() error }:
2708
			if err := v.ValidateAll(); err != nil {
2709
				errors = append(errors, PermissionEntityFilterRequestValidationError{
2710
					field:  "Context",
2711
					reason: "embedded message failed validation",
2712
					cause:  err,
2713
				})
2714
			}
2715
		case interface{ Validate() error }:
2716
			if err := v.Validate(); err != nil {
2717
				errors = append(errors, PermissionEntityFilterRequestValidationError{
2718
					field:  "Context",
2719
					reason: "embedded message failed validation",
2720
					cause:  err,
2721
				})
2722
			}
2723
		}
2724
	} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok {
2725
		if err := v.Validate(); err != nil {
2726
			return PermissionEntityFilterRequestValidationError{
2727
				field:  "Context",
2728
				reason: "embedded message failed validation",
2729
				cause:  err,
2730
			}
2731
		}
2732
	}
2733
2734
	{
2735
		sorted_keys := make([]string, len(m.GetScope()))
2736
		i := 0
2737
		for key := range m.GetScope() {
2738
			sorted_keys[i] = key
2739
			i++
2740
		}
2741
		sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] })
2742
		for _, key := range sorted_keys {
2743
			val := m.GetScope()[key]
2744
			_ = val
2745
2746
			// no validation rules for Scope[key]
2747
2748
			if all {
2749
				switch v := interface{}(val).(type) {
2750
				case interface{ ValidateAll() error }:
2751
					if err := v.ValidateAll(); err != nil {
2752
						errors = append(errors, PermissionEntityFilterRequestValidationError{
2753
							field:  fmt.Sprintf("Scope[%v]", key),
2754
							reason: "embedded message failed validation",
2755
							cause:  err,
2756
						})
2757
					}
2758
				case interface{ Validate() error }:
2759
					if err := v.Validate(); err != nil {
2760
						errors = append(errors, PermissionEntityFilterRequestValidationError{
2761
							field:  fmt.Sprintf("Scope[%v]", key),
2762
							reason: "embedded message failed validation",
2763
							cause:  err,
2764
						})
2765
					}
2766
				}
2767
			} else if v, ok := interface{}(val).(interface{ Validate() error }); ok {
2768
				if err := v.Validate(); err != nil {
2769
					return PermissionEntityFilterRequestValidationError{
2770
						field:  fmt.Sprintf("Scope[%v]", key),
2771
						reason: "embedded message failed validation",
2772
						cause:  err,
2773
					}
2774
				}
2775
			}
2776
2777
		}
2778
	}
2779
2780
	if m.GetCursor() != "" {
2781
2782
	}
2783
2784
	if len(errors) > 0 {
2785
		return PermissionEntityFilterRequestMultiError(errors)
2786
	}
2787
2788
	return nil
2789
}
2790
2791
// PermissionEntityFilterRequestMultiError is an error wrapping multiple
2792
// validation errors returned by PermissionEntityFilterRequest.ValidateAll()
2793
// if the designated constraints aren't met.
2794
type PermissionEntityFilterRequestMultiError []error
2795
2796
// Error returns a concatenation of all the error messages it wraps.
2797
func (m PermissionEntityFilterRequestMultiError) Error() string {
2798
	msgs := make([]string, 0, len(m))
2799
	for _, err := range m {
2800
		msgs = append(msgs, err.Error())
2801
	}
2802
	return strings.Join(msgs, "; ")
2803
}
2804
2805
// AllErrors returns a list of validation violation errors.
2806
func (m PermissionEntityFilterRequestMultiError) AllErrors() []error { return m }
2807
2808
// PermissionEntityFilterRequestValidationError is the validation error
2809
// returned by PermissionEntityFilterRequest.Validate if the designated
2810
// constraints aren't met.
2811
type PermissionEntityFilterRequestValidationError struct {
2812
	field  string
2813
	reason string
2814
	cause  error
2815
	key    bool
2816
}
2817
2818
// Field function returns field value.
2819
func (e PermissionEntityFilterRequestValidationError) Field() string { return e.field }
2820
2821
// Reason function returns reason value.
2822
func (e PermissionEntityFilterRequestValidationError) Reason() string { return e.reason }
2823
2824
// Cause function returns cause value.
2825
func (e PermissionEntityFilterRequestValidationError) Cause() error { return e.cause }
2826
2827
// Key function returns key value.
2828
func (e PermissionEntityFilterRequestValidationError) Key() bool { return e.key }
2829
2830
// ErrorName returns error name.
2831
func (e PermissionEntityFilterRequestValidationError) ErrorName() string {
2832
	return "PermissionEntityFilterRequestValidationError"
2833
}
2834
2835
// Error satisfies the builtin error interface
2836
func (e PermissionEntityFilterRequestValidationError) Error() string {
2837
	cause := ""
2838
	if e.cause != nil {
2839
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
2840
	}
2841
2842
	key := ""
2843
	if e.key {
2844
		key = "key for "
2845
	}
2846
2847
	return fmt.Sprintf(
2848
		"invalid %sPermissionEntityFilterRequest.%s: %s%s",
2849
		key,
2850
		e.field,
2851
		e.reason,
2852
		cause)
2853
}
2854
2855
var _ error = PermissionEntityFilterRequestValidationError{}
2856
2857
var _ interface {
2858
	Field() string
2859
	Reason() string
2860
	Key() bool
2861
	Cause() error
2862
	ErrorName() string
2863
} = PermissionEntityFilterRequestValidationError{}
2864
2865
var _PermissionEntityFilterRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
2866
2867
// Validate checks the field values on PermissionEntityFilterRequestMetadata
2868
// with the rules defined in the proto definition for this message. If any
2869
// rules are violated, the first error encountered is returned, or nil if
2870
// there are no violations.
2871
func (m *PermissionEntityFilterRequestMetadata) Validate() error {
2872
	return m.validate(false)
2873
}
2874
2875
// ValidateAll checks the field values on PermissionEntityFilterRequestMetadata
2876
// with the rules defined in the proto definition for this message. If any
2877
// rules are violated, the result is a list of violation errors wrapped in
2878
// PermissionEntityFilterRequestMetadataMultiError, or nil if none found.
2879
func (m *PermissionEntityFilterRequestMetadata) ValidateAll() error {
2880
	return m.validate(true)
2881
}
2882
2883
func (m *PermissionEntityFilterRequestMetadata) validate(all bool) error {
2884
	if m == nil {
2885
		return nil
2886
	}
2887
2888
	var errors []error
2889
2890
	// no validation rules for SchemaVersion
2891
2892
	// no validation rules for SnapToken
2893
2894
	if m.GetDepth() < 3 {
2895
		err := PermissionEntityFilterRequestMetadataValidationError{
2896
			field:  "Depth",
2897
			reason: "value must be greater than or equal to 3",
2898
		}
2899
		if !all {
2900
			return err
2901
		}
2902
		errors = append(errors, err)
2903
	}
2904
2905
	if len(errors) > 0 {
2906
		return PermissionEntityFilterRequestMetadataMultiError(errors)
2907
	}
2908
2909
	return nil
2910
}
2911
2912
// PermissionEntityFilterRequestMetadataMultiError is an error wrapping
2913
// multiple validation errors returned by
2914
// PermissionEntityFilterRequestMetadata.ValidateAll() if the designated
2915
// constraints aren't met.
2916
type PermissionEntityFilterRequestMetadataMultiError []error
2917
2918
// Error returns a concatenation of all the error messages it wraps.
2919
func (m PermissionEntityFilterRequestMetadataMultiError) Error() string {
2920
	msgs := make([]string, 0, len(m))
2921
	for _, err := range m {
2922
		msgs = append(msgs, err.Error())
2923
	}
2924
	return strings.Join(msgs, "; ")
2925
}
2926
2927
// AllErrors returns a list of validation violation errors.
2928
func (m PermissionEntityFilterRequestMetadataMultiError) AllErrors() []error { return m }
2929
2930
// PermissionEntityFilterRequestMetadataValidationError is the validation error
2931
// returned by PermissionEntityFilterRequestMetadata.Validate if the
2932
// designated constraints aren't met.
2933
type PermissionEntityFilterRequestMetadataValidationError struct {
2934
	field  string
2935
	reason string
2936
	cause  error
2937
	key    bool
2938
}
2939
2940
// Field function returns field value.
2941
func (e PermissionEntityFilterRequestMetadataValidationError) Field() string { return e.field }
2942
2943
// Reason function returns reason value.
2944
func (e PermissionEntityFilterRequestMetadataValidationError) Reason() string { return e.reason }
2945
2946
// Cause function returns cause value.
2947
func (e PermissionEntityFilterRequestMetadataValidationError) Cause() error { return e.cause }
2948
2949
// Key function returns key value.
2950
func (e PermissionEntityFilterRequestMetadataValidationError) Key() bool { return e.key }
2951
2952
// ErrorName returns error name.
2953
func (e PermissionEntityFilterRequestMetadataValidationError) ErrorName() string {
2954
	return "PermissionEntityFilterRequestMetadataValidationError"
2955
}
2956
2957
// Error satisfies the builtin error interface
2958
func (e PermissionEntityFilterRequestMetadataValidationError) Error() string {
2959
	cause := ""
2960
	if e.cause != nil {
2961
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
2962
	}
2963
2964
	key := ""
2965
	if e.key {
2966
		key = "key for "
2967
	}
2968
2969
	return fmt.Sprintf(
2970
		"invalid %sPermissionEntityFilterRequestMetadata.%s: %s%s",
2971
		key,
2972
		e.field,
2973
		e.reason,
2974
		cause)
2975
}
2976
2977
var _ error = PermissionEntityFilterRequestMetadataValidationError{}
2978
2979
var _ interface {
2980
	Field() string
2981
	Reason() string
2982
	Key() bool
2983
	Cause() error
2984
	ErrorName() string
2985
} = PermissionEntityFilterRequestMetadataValidationError{}
2986
2987
// Validate checks the field values on PermissionLookupSubjectRequest with the
2988
// rules defined in the proto definition for this message. If any rules are
2989
// violated, the first error encountered is returned, or nil if there are no violations.
2990
func (m *PermissionLookupSubjectRequest) Validate() error {
2991
	return m.validate(false)
2992
}
2993
2994
// ValidateAll checks the field values on PermissionLookupSubjectRequest with
2995
// the rules defined in the proto definition for this message. If any rules
2996
// are violated, the result is a list of violation errors wrapped in
2997
// PermissionLookupSubjectRequestMultiError, or nil if none found.
2998
func (m *PermissionLookupSubjectRequest) ValidateAll() error {
2999
	return m.validate(true)
3000
}
3001
3002
func (m *PermissionLookupSubjectRequest) validate(all bool) error {
3003
	if m == nil {
3004
		return nil
3005
	}
3006
3007
	var errors []error
3008
3009
	if len(m.GetTenantId()) > 128 {
3010
		err := PermissionLookupSubjectRequestValidationError{
3011
			field:  "TenantId",
3012
			reason: "value length must be at most 128 bytes",
3013
		}
3014
		if !all {
3015
			return err
3016
		}
3017
		errors = append(errors, err)
3018
	}
3019
3020
	if !_PermissionLookupSubjectRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
3021
		err := PermissionLookupSubjectRequestValidationError{
3022
			field:  "TenantId",
3023
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
3024
		}
3025
		if !all {
3026
			return err
3027
		}
3028
		errors = append(errors, err)
3029
	}
3030
3031
	if m.GetMetadata() == nil {
3032
		err := PermissionLookupSubjectRequestValidationError{
3033
			field:  "Metadata",
3034
			reason: "value is required",
3035
		}
3036
		if !all {
3037
			return err
3038
		}
3039
		errors = append(errors, err)
3040
	}
3041
3042
	if all {
3043
		switch v := interface{}(m.GetMetadata()).(type) {
3044
		case interface{ ValidateAll() error }:
3045
			if err := v.ValidateAll(); err != nil {
3046
				errors = append(errors, PermissionLookupSubjectRequestValidationError{
3047
					field:  "Metadata",
3048
					reason: "embedded message failed validation",
3049
					cause:  err,
3050
				})
3051
			}
3052
		case interface{ Validate() error }:
3053
			if err := v.Validate(); err != nil {
3054
				errors = append(errors, PermissionLookupSubjectRequestValidationError{
3055
					field:  "Metadata",
3056
					reason: "embedded message failed validation",
3057
					cause:  err,
3058
				})
3059
			}
3060
		}
3061
	} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
3062
		if err := v.Validate(); err != nil {
3063
			return PermissionLookupSubjectRequestValidationError{
3064
				field:  "Metadata",
3065
				reason: "embedded message failed validation",
3066
				cause:  err,
3067
			}
3068
		}
3069
	}
3070
3071
	if m.GetEntity() == nil {
3072
		err := PermissionLookupSubjectRequestValidationError{
3073
			field:  "Entity",
3074
			reason: "value is required",
3075
		}
3076
		if !all {
3077
			return err
3078
		}
3079
		errors = append(errors, err)
3080
	}
3081
3082
	if all {
3083
		switch v := interface{}(m.GetEntity()).(type) {
3084
		case interface{ ValidateAll() error }:
3085
			if err := v.ValidateAll(); err != nil {
3086
				errors = append(errors, PermissionLookupSubjectRequestValidationError{
3087
					field:  "Entity",
3088
					reason: "embedded message failed validation",
3089
					cause:  err,
3090
				})
3091
			}
3092
		case interface{ Validate() error }:
3093
			if err := v.Validate(); err != nil {
3094
				errors = append(errors, PermissionLookupSubjectRequestValidationError{
3095
					field:  "Entity",
3096
					reason: "embedded message failed validation",
3097
					cause:  err,
3098
				})
3099
			}
3100
		}
3101
	} else if v, ok := interface{}(m.GetEntity()).(interface{ Validate() error }); ok {
3102
		if err := v.Validate(); err != nil {
3103
			return PermissionLookupSubjectRequestValidationError{
3104
				field:  "Entity",
3105
				reason: "embedded message failed validation",
3106
				cause:  err,
3107
			}
3108
		}
3109
	}
3110
3111
	if len(m.GetPermission()) > 64 {
3112
		err := PermissionLookupSubjectRequestValidationError{
3113
			field:  "Permission",
3114
			reason: "value length must be at most 64 bytes",
3115
		}
3116
		if !all {
3117
			return err
3118
		}
3119
		errors = append(errors, err)
3120
	}
3121
3122
	if !_PermissionLookupSubjectRequest_Permission_Pattern.MatchString(m.GetPermission()) {
3123
		err := PermissionLookupSubjectRequestValidationError{
3124
			field:  "Permission",
3125
			reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"",
3126
		}
3127
		if !all {
3128
			return err
3129
		}
3130
		errors = append(errors, err)
3131
	}
3132
3133
	if m.GetSubjectReference() == nil {
3134
		err := PermissionLookupSubjectRequestValidationError{
3135
			field:  "SubjectReference",
3136
			reason: "value is required",
3137
		}
3138
		if !all {
3139
			return err
3140
		}
3141
		errors = append(errors, err)
3142
	}
3143
3144
	if all {
3145
		switch v := interface{}(m.GetSubjectReference()).(type) {
3146
		case interface{ ValidateAll() error }:
3147
			if err := v.ValidateAll(); err != nil {
3148
				errors = append(errors, PermissionLookupSubjectRequestValidationError{
3149
					field:  "SubjectReference",
3150
					reason: "embedded message failed validation",
3151
					cause:  err,
3152
				})
3153
			}
3154
		case interface{ Validate() error }:
3155
			if err := v.Validate(); err != nil {
3156
				errors = append(errors, PermissionLookupSubjectRequestValidationError{
3157
					field:  "SubjectReference",
3158
					reason: "embedded message failed validation",
3159
					cause:  err,
3160
				})
3161
			}
3162
		}
3163
	} else if v, ok := interface{}(m.GetSubjectReference()).(interface{ Validate() error }); ok {
3164
		if err := v.Validate(); err != nil {
3165
			return PermissionLookupSubjectRequestValidationError{
3166
				field:  "SubjectReference",
3167
				reason: "embedded message failed validation",
3168
				cause:  err,
3169
			}
3170
		}
3171
	}
3172
3173
	if all {
3174
		switch v := interface{}(m.GetContext()).(type) {
3175
		case interface{ ValidateAll() error }:
3176
			if err := v.ValidateAll(); err != nil {
3177
				errors = append(errors, PermissionLookupSubjectRequestValidationError{
3178
					field:  "Context",
3179
					reason: "embedded message failed validation",
3180
					cause:  err,
3181
				})
3182
			}
3183
		case interface{ Validate() error }:
3184
			if err := v.Validate(); err != nil {
3185
				errors = append(errors, PermissionLookupSubjectRequestValidationError{
3186
					field:  "Context",
3187
					reason: "embedded message failed validation",
3188
					cause:  err,
3189
				})
3190
			}
3191
		}
3192
	} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok {
3193
		if err := v.Validate(); err != nil {
3194
			return PermissionLookupSubjectRequestValidationError{
3195
				field:  "Context",
3196
				reason: "embedded message failed validation",
3197
				cause:  err,
3198
			}
3199
		}
3200
	}
3201
3202
	for idx, item := range m.GetArguments() {
3203
		_, _ = idx, item
3204
3205
		if all {
3206
			switch v := interface{}(item).(type) {
3207
			case interface{ ValidateAll() error }:
3208
				if err := v.ValidateAll(); err != nil {
3209
					errors = append(errors, PermissionLookupSubjectRequestValidationError{
3210
						field:  fmt.Sprintf("Arguments[%v]", idx),
3211
						reason: "embedded message failed validation",
3212
						cause:  err,
3213
					})
3214
				}
3215
			case interface{ Validate() error }:
3216
				if err := v.Validate(); err != nil {
3217
					errors = append(errors, PermissionLookupSubjectRequestValidationError{
3218
						field:  fmt.Sprintf("Arguments[%v]", idx),
3219
						reason: "embedded message failed validation",
3220
						cause:  err,
3221
					})
3222
				}
3223
			}
3224
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
3225
			if err := v.Validate(); err != nil {
3226
				return PermissionLookupSubjectRequestValidationError{
3227
					field:  fmt.Sprintf("Arguments[%v]", idx),
3228
					reason: "embedded message failed validation",
3229
					cause:  err,
3230
				}
3231
			}
3232
		}
3233
3234
	}
3235
3236
	if m.GetPageSize() != 0 {
3237
3238
		if m.GetPageSize() < 1 {
3239
			err := PermissionLookupSubjectRequestValidationError{
3240
				field:  "PageSize",
3241
				reason: "value must be greater than or equal to 1",
3242
			}
3243
			if !all {
3244
				return err
3245
			}
3246
			errors = append(errors, err)
3247
		}
3248
3249
	}
3250
3251
	if m.GetContinuousToken() != "" {
3252
3253
	}
3254
3255
	if len(errors) > 0 {
3256
		return PermissionLookupSubjectRequestMultiError(errors)
3257
	}
3258
3259
	return nil
3260
}
3261
3262
// PermissionLookupSubjectRequestMultiError is an error wrapping multiple
3263
// validation errors returned by PermissionLookupSubjectRequest.ValidateAll()
3264
// if the designated constraints aren't met.
3265
type PermissionLookupSubjectRequestMultiError []error
3266
3267
// Error returns a concatenation of all the error messages it wraps.
3268
func (m PermissionLookupSubjectRequestMultiError) Error() string {
3269
	msgs := make([]string, 0, len(m))
3270
	for _, err := range m {
3271
		msgs = append(msgs, err.Error())
3272
	}
3273
	return strings.Join(msgs, "; ")
3274
}
3275
3276
// AllErrors returns a list of validation violation errors.
3277
func (m PermissionLookupSubjectRequestMultiError) AllErrors() []error { return m }
3278
3279
// PermissionLookupSubjectRequestValidationError is the validation error
3280
// returned by PermissionLookupSubjectRequest.Validate if the designated
3281
// constraints aren't met.
3282
type PermissionLookupSubjectRequestValidationError struct {
3283
	field  string
3284
	reason string
3285
	cause  error
3286
	key    bool
3287
}
3288
3289
// Field function returns field value.
3290
func (e PermissionLookupSubjectRequestValidationError) Field() string { return e.field }
3291
3292
// Reason function returns reason value.
3293
func (e PermissionLookupSubjectRequestValidationError) Reason() string { return e.reason }
3294
3295
// Cause function returns cause value.
3296
func (e PermissionLookupSubjectRequestValidationError) Cause() error { return e.cause }
3297
3298
// Key function returns key value.
3299
func (e PermissionLookupSubjectRequestValidationError) Key() bool { return e.key }
3300
3301
// ErrorName returns error name.
3302
func (e PermissionLookupSubjectRequestValidationError) ErrorName() string {
3303
	return "PermissionLookupSubjectRequestValidationError"
3304
}
3305
3306
// Error satisfies the builtin error interface
3307
func (e PermissionLookupSubjectRequestValidationError) Error() string {
3308
	cause := ""
3309
	if e.cause != nil {
3310
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
3311
	}
3312
3313
	key := ""
3314
	if e.key {
3315
		key = "key for "
3316
	}
3317
3318
	return fmt.Sprintf(
3319
		"invalid %sPermissionLookupSubjectRequest.%s: %s%s",
3320
		key,
3321
		e.field,
3322
		e.reason,
3323
		cause)
3324
}
3325
3326
var _ error = PermissionLookupSubjectRequestValidationError{}
3327
3328
var _ interface {
3329
	Field() string
3330
	Reason() string
3331
	Key() bool
3332
	Cause() error
3333
	ErrorName() string
3334
} = PermissionLookupSubjectRequestValidationError{}
3335
3336
var _PermissionLookupSubjectRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
3337
3338
var _PermissionLookupSubjectRequest_Permission_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$")
3339
3340
// Validate checks the field values on PermissionLookupSubjectRequestMetadata
3341
// with the rules defined in the proto definition for this message. If any
3342
// rules are violated, the first error encountered is returned, or nil if
3343
// there are no violations.
3344
func (m *PermissionLookupSubjectRequestMetadata) Validate() error {
3345
	return m.validate(false)
3346
}
3347
3348
// ValidateAll checks the field values on
3349
// PermissionLookupSubjectRequestMetadata with the rules defined in the proto
3350
// definition for this message. If any rules are violated, the result is a
3351
// list of violation errors wrapped in
3352
// PermissionLookupSubjectRequestMetadataMultiError, or nil if none found.
3353
func (m *PermissionLookupSubjectRequestMetadata) ValidateAll() error {
3354
	return m.validate(true)
3355
}
3356
3357
func (m *PermissionLookupSubjectRequestMetadata) validate(all bool) error {
3358
	if m == nil {
3359
		return nil
3360
	}
3361
3362
	var errors []error
3363
3364
	// no validation rules for SchemaVersion
3365
3366
	// no validation rules for SnapToken
3367
3368
	if m.GetDepth() < 3 {
3369
		err := PermissionLookupSubjectRequestMetadataValidationError{
3370
			field:  "Depth",
3371
			reason: "value must be greater than or equal to 3",
3372
		}
3373
		if !all {
3374
			return err
3375
		}
3376
		errors = append(errors, err)
3377
	}
3378
3379
	if len(errors) > 0 {
3380
		return PermissionLookupSubjectRequestMetadataMultiError(errors)
3381
	}
3382
3383
	return nil
3384
}
3385
3386
// PermissionLookupSubjectRequestMetadataMultiError is an error wrapping
3387
// multiple validation errors returned by
3388
// PermissionLookupSubjectRequestMetadata.ValidateAll() if the designated
3389
// constraints aren't met.
3390
type PermissionLookupSubjectRequestMetadataMultiError []error
3391
3392
// Error returns a concatenation of all the error messages it wraps.
3393
func (m PermissionLookupSubjectRequestMetadataMultiError) Error() string {
3394
	msgs := make([]string, 0, len(m))
3395
	for _, err := range m {
3396
		msgs = append(msgs, err.Error())
3397
	}
3398
	return strings.Join(msgs, "; ")
3399
}
3400
3401
// AllErrors returns a list of validation violation errors.
3402
func (m PermissionLookupSubjectRequestMetadataMultiError) AllErrors() []error { return m }
3403
3404
// PermissionLookupSubjectRequestMetadataValidationError is the validation
3405
// error returned by PermissionLookupSubjectRequestMetadata.Validate if the
3406
// designated constraints aren't met.
3407
type PermissionLookupSubjectRequestMetadataValidationError struct {
3408
	field  string
3409
	reason string
3410
	cause  error
3411
	key    bool
3412
}
3413
3414
// Field function returns field value.
3415
func (e PermissionLookupSubjectRequestMetadataValidationError) Field() string { return e.field }
3416
3417
// Reason function returns reason value.
3418
func (e PermissionLookupSubjectRequestMetadataValidationError) Reason() string { return e.reason }
3419
3420
// Cause function returns cause value.
3421
func (e PermissionLookupSubjectRequestMetadataValidationError) Cause() error { return e.cause }
3422
3423
// Key function returns key value.
3424
func (e PermissionLookupSubjectRequestMetadataValidationError) Key() bool { return e.key }
3425
3426
// ErrorName returns error name.
3427
func (e PermissionLookupSubjectRequestMetadataValidationError) ErrorName() string {
3428
	return "PermissionLookupSubjectRequestMetadataValidationError"
3429
}
3430
3431
// Error satisfies the builtin error interface
3432
func (e PermissionLookupSubjectRequestMetadataValidationError) Error() string {
3433
	cause := ""
3434
	if e.cause != nil {
3435
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
3436
	}
3437
3438
	key := ""
3439
	if e.key {
3440
		key = "key for "
3441
	}
3442
3443
	return fmt.Sprintf(
3444
		"invalid %sPermissionLookupSubjectRequestMetadata.%s: %s%s",
3445
		key,
3446
		e.field,
3447
		e.reason,
3448
		cause)
3449
}
3450
3451
var _ error = PermissionLookupSubjectRequestMetadataValidationError{}
3452
3453
var _ interface {
3454
	Field() string
3455
	Reason() string
3456
	Key() bool
3457
	Cause() error
3458
	ErrorName() string
3459
} = PermissionLookupSubjectRequestMetadataValidationError{}
3460
3461
// Validate checks the field values on PermissionLookupSubjectResponse with the
3462
// rules defined in the proto definition for this message. If any rules are
3463
// violated, the first error encountered is returned, or nil if there are no violations.
3464
func (m *PermissionLookupSubjectResponse) Validate() error {
3465
	return m.validate(false)
3466
}
3467
3468
// ValidateAll checks the field values on PermissionLookupSubjectResponse with
3469
// the rules defined in the proto definition for this message. If any rules
3470
// are violated, the result is a list of violation errors wrapped in
3471
// PermissionLookupSubjectResponseMultiError, or nil if none found.
3472
func (m *PermissionLookupSubjectResponse) ValidateAll() error {
3473
	return m.validate(true)
3474
}
3475
3476
func (m *PermissionLookupSubjectResponse) validate(all bool) error {
3477
	if m == nil {
3478
		return nil
3479
	}
3480
3481
	var errors []error
3482
3483
	// no validation rules for ContinuousToken
3484
3485
	if len(errors) > 0 {
3486
		return PermissionLookupSubjectResponseMultiError(errors)
3487
	}
3488
3489
	return nil
3490
}
3491
3492
// PermissionLookupSubjectResponseMultiError is an error wrapping multiple
3493
// validation errors returned by PermissionLookupSubjectResponse.ValidateAll()
3494
// if the designated constraints aren't met.
3495
type PermissionLookupSubjectResponseMultiError []error
3496
3497
// Error returns a concatenation of all the error messages it wraps.
3498
func (m PermissionLookupSubjectResponseMultiError) Error() string {
3499
	msgs := make([]string, 0, len(m))
3500
	for _, err := range m {
3501
		msgs = append(msgs, err.Error())
3502
	}
3503
	return strings.Join(msgs, "; ")
3504
}
3505
3506
// AllErrors returns a list of validation violation errors.
3507
func (m PermissionLookupSubjectResponseMultiError) AllErrors() []error { return m }
3508
3509
// PermissionLookupSubjectResponseValidationError is the validation error
3510
// returned by PermissionLookupSubjectResponse.Validate if the designated
3511
// constraints aren't met.
3512
type PermissionLookupSubjectResponseValidationError struct {
3513
	field  string
3514
	reason string
3515
	cause  error
3516
	key    bool
3517
}
3518
3519
// Field function returns field value.
3520
func (e PermissionLookupSubjectResponseValidationError) Field() string { return e.field }
3521
3522
// Reason function returns reason value.
3523
func (e PermissionLookupSubjectResponseValidationError) Reason() string { return e.reason }
3524
3525
// Cause function returns cause value.
3526
func (e PermissionLookupSubjectResponseValidationError) Cause() error { return e.cause }
3527
3528
// Key function returns key value.
3529
func (e PermissionLookupSubjectResponseValidationError) Key() bool { return e.key }
3530
3531
// ErrorName returns error name.
3532
func (e PermissionLookupSubjectResponseValidationError) ErrorName() string {
3533
	return "PermissionLookupSubjectResponseValidationError"
3534
}
3535
3536
// Error satisfies the builtin error interface
3537
func (e PermissionLookupSubjectResponseValidationError) Error() string {
3538
	cause := ""
3539
	if e.cause != nil {
3540
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
3541
	}
3542
3543
	key := ""
3544
	if e.key {
3545
		key = "key for "
3546
	}
3547
3548
	return fmt.Sprintf(
3549
		"invalid %sPermissionLookupSubjectResponse.%s: %s%s",
3550
		key,
3551
		e.field,
3552
		e.reason,
3553
		cause)
3554
}
3555
3556
var _ error = PermissionLookupSubjectResponseValidationError{}
3557
3558
var _ interface {
3559
	Field() string
3560
	Reason() string
3561
	Key() bool
3562
	Cause() error
3563
	ErrorName() string
3564
} = PermissionLookupSubjectResponseValidationError{}
3565
3566
// Validate checks the field values on PermissionSubjectPermissionRequest with
3567
// the rules defined in the proto definition for this message. If any rules
3568
// are violated, the first error encountered is returned, or nil if there are
3569
// no violations.
3570
func (m *PermissionSubjectPermissionRequest) Validate() error {
3571
	return m.validate(false)
3572
}
3573
3574
// ValidateAll checks the field values on PermissionSubjectPermissionRequest
3575
// with the rules defined in the proto definition for this message. If any
3576
// rules are violated, the result is a list of violation errors wrapped in
3577
// PermissionSubjectPermissionRequestMultiError, or nil if none found.
3578
func (m *PermissionSubjectPermissionRequest) ValidateAll() error {
3579
	return m.validate(true)
3580
}
3581
3582
func (m *PermissionSubjectPermissionRequest) validate(all bool) error {
3583
	if m == nil {
3584
		return nil
3585
	}
3586
3587
	var errors []error
3588
3589
	if len(m.GetTenantId()) > 128 {
3590
		err := PermissionSubjectPermissionRequestValidationError{
3591
			field:  "TenantId",
3592
			reason: "value length must be at most 128 bytes",
3593
		}
3594
		if !all {
3595
			return err
3596
		}
3597
		errors = append(errors, err)
3598
	}
3599
3600
	if !_PermissionSubjectPermissionRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
3601
		err := PermissionSubjectPermissionRequestValidationError{
3602
			field:  "TenantId",
3603
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
3604
		}
3605
		if !all {
3606
			return err
3607
		}
3608
		errors = append(errors, err)
3609
	}
3610
3611
	if m.GetMetadata() == nil {
3612
		err := PermissionSubjectPermissionRequestValidationError{
3613
			field:  "Metadata",
3614
			reason: "value is required",
3615
		}
3616
		if !all {
3617
			return err
3618
		}
3619
		errors = append(errors, err)
3620
	}
3621
3622
	if all {
3623
		switch v := interface{}(m.GetMetadata()).(type) {
3624
		case interface{ ValidateAll() error }:
3625
			if err := v.ValidateAll(); err != nil {
3626
				errors = append(errors, PermissionSubjectPermissionRequestValidationError{
3627
					field:  "Metadata",
3628
					reason: "embedded message failed validation",
3629
					cause:  err,
3630
				})
3631
			}
3632
		case interface{ Validate() error }:
3633
			if err := v.Validate(); err != nil {
3634
				errors = append(errors, PermissionSubjectPermissionRequestValidationError{
3635
					field:  "Metadata",
3636
					reason: "embedded message failed validation",
3637
					cause:  err,
3638
				})
3639
			}
3640
		}
3641
	} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
3642
		if err := v.Validate(); err != nil {
3643
			return PermissionSubjectPermissionRequestValidationError{
3644
				field:  "Metadata",
3645
				reason: "embedded message failed validation",
3646
				cause:  err,
3647
			}
3648
		}
3649
	}
3650
3651
	if m.GetEntity() == nil {
3652
		err := PermissionSubjectPermissionRequestValidationError{
3653
			field:  "Entity",
3654
			reason: "value is required",
3655
		}
3656
		if !all {
3657
			return err
3658
		}
3659
		errors = append(errors, err)
3660
	}
3661
3662
	if all {
3663
		switch v := interface{}(m.GetEntity()).(type) {
3664
		case interface{ ValidateAll() error }:
3665
			if err := v.ValidateAll(); err != nil {
3666
				errors = append(errors, PermissionSubjectPermissionRequestValidationError{
3667
					field:  "Entity",
3668
					reason: "embedded message failed validation",
3669
					cause:  err,
3670
				})
3671
			}
3672
		case interface{ Validate() error }:
3673
			if err := v.Validate(); err != nil {
3674
				errors = append(errors, PermissionSubjectPermissionRequestValidationError{
3675
					field:  "Entity",
3676
					reason: "embedded message failed validation",
3677
					cause:  err,
3678
				})
3679
			}
3680
		}
3681
	} else if v, ok := interface{}(m.GetEntity()).(interface{ Validate() error }); ok {
3682
		if err := v.Validate(); err != nil {
3683
			return PermissionSubjectPermissionRequestValidationError{
3684
				field:  "Entity",
3685
				reason: "embedded message failed validation",
3686
				cause:  err,
3687
			}
3688
		}
3689
	}
3690
3691
	if m.GetSubject() == nil {
3692
		err := PermissionSubjectPermissionRequestValidationError{
3693
			field:  "Subject",
3694
			reason: "value is required",
3695
		}
3696
		if !all {
3697
			return err
3698
		}
3699
		errors = append(errors, err)
3700
	}
3701
3702
	if all {
3703
		switch v := interface{}(m.GetSubject()).(type) {
3704
		case interface{ ValidateAll() error }:
3705
			if err := v.ValidateAll(); err != nil {
3706
				errors = append(errors, PermissionSubjectPermissionRequestValidationError{
3707
					field:  "Subject",
3708
					reason: "embedded message failed validation",
3709
					cause:  err,
3710
				})
3711
			}
3712
		case interface{ Validate() error }:
3713
			if err := v.Validate(); err != nil {
3714
				errors = append(errors, PermissionSubjectPermissionRequestValidationError{
3715
					field:  "Subject",
3716
					reason: "embedded message failed validation",
3717
					cause:  err,
3718
				})
3719
			}
3720
		}
3721
	} else if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok {
3722
		if err := v.Validate(); err != nil {
3723
			return PermissionSubjectPermissionRequestValidationError{
3724
				field:  "Subject",
3725
				reason: "embedded message failed validation",
3726
				cause:  err,
3727
			}
3728
		}
3729
	}
3730
3731
	if all {
3732
		switch v := interface{}(m.GetContext()).(type) {
3733
		case interface{ ValidateAll() error }:
3734
			if err := v.ValidateAll(); err != nil {
3735
				errors = append(errors, PermissionSubjectPermissionRequestValidationError{
3736
					field:  "Context",
3737
					reason: "embedded message failed validation",
3738
					cause:  err,
3739
				})
3740
			}
3741
		case interface{ Validate() error }:
3742
			if err := v.Validate(); err != nil {
3743
				errors = append(errors, PermissionSubjectPermissionRequestValidationError{
3744
					field:  "Context",
3745
					reason: "embedded message failed validation",
3746
					cause:  err,
3747
				})
3748
			}
3749
		}
3750
	} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok {
3751
		if err := v.Validate(); err != nil {
3752
			return PermissionSubjectPermissionRequestValidationError{
3753
				field:  "Context",
3754
				reason: "embedded message failed validation",
3755
				cause:  err,
3756
			}
3757
		}
3758
	}
3759
3760
	if len(errors) > 0 {
3761
		return PermissionSubjectPermissionRequestMultiError(errors)
3762
	}
3763
3764
	return nil
3765
}
3766
3767
// PermissionSubjectPermissionRequestMultiError is an error wrapping multiple
3768
// validation errors returned by
3769
// PermissionSubjectPermissionRequest.ValidateAll() if the designated
3770
// constraints aren't met.
3771
type PermissionSubjectPermissionRequestMultiError []error
3772
3773
// Error returns a concatenation of all the error messages it wraps.
3774
func (m PermissionSubjectPermissionRequestMultiError) Error() string {
3775
	msgs := make([]string, 0, len(m))
3776
	for _, err := range m {
3777
		msgs = append(msgs, err.Error())
3778
	}
3779
	return strings.Join(msgs, "; ")
3780
}
3781
3782
// AllErrors returns a list of validation violation errors.
3783
func (m PermissionSubjectPermissionRequestMultiError) AllErrors() []error { return m }
3784
3785
// PermissionSubjectPermissionRequestValidationError is the validation error
3786
// returned by PermissionSubjectPermissionRequest.Validate if the designated
3787
// constraints aren't met.
3788
type PermissionSubjectPermissionRequestValidationError struct {
3789
	field  string
3790
	reason string
3791
	cause  error
3792
	key    bool
3793
}
3794
3795
// Field function returns field value.
3796
func (e PermissionSubjectPermissionRequestValidationError) Field() string { return e.field }
3797
3798
// Reason function returns reason value.
3799
func (e PermissionSubjectPermissionRequestValidationError) Reason() string { return e.reason }
3800
3801
// Cause function returns cause value.
3802
func (e PermissionSubjectPermissionRequestValidationError) Cause() error { return e.cause }
3803
3804
// Key function returns key value.
3805
func (e PermissionSubjectPermissionRequestValidationError) Key() bool { return e.key }
3806
3807
// ErrorName returns error name.
3808
func (e PermissionSubjectPermissionRequestValidationError) ErrorName() string {
3809
	return "PermissionSubjectPermissionRequestValidationError"
3810
}
3811
3812
// Error satisfies the builtin error interface
3813
func (e PermissionSubjectPermissionRequestValidationError) Error() string {
3814
	cause := ""
3815
	if e.cause != nil {
3816
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
3817
	}
3818
3819
	key := ""
3820
	if e.key {
3821
		key = "key for "
3822
	}
3823
3824
	return fmt.Sprintf(
3825
		"invalid %sPermissionSubjectPermissionRequest.%s: %s%s",
3826
		key,
3827
		e.field,
3828
		e.reason,
3829
		cause)
3830
}
3831
3832
var _ error = PermissionSubjectPermissionRequestValidationError{}
3833
3834
var _ interface {
3835
	Field() string
3836
	Reason() string
3837
	Key() bool
3838
	Cause() error
3839
	ErrorName() string
3840
} = PermissionSubjectPermissionRequestValidationError{}
3841
3842
var _PermissionSubjectPermissionRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
3843
3844
// Validate checks the field values on
3845
// PermissionSubjectPermissionRequestMetadata with the rules defined in the
3846
// proto definition for this message. If any rules are violated, the first
3847
// error encountered is returned, or nil if there are no violations.
3848
func (m *PermissionSubjectPermissionRequestMetadata) Validate() error {
3849
	return m.validate(false)
3850
}
3851
3852
// ValidateAll checks the field values on
3853
// PermissionSubjectPermissionRequestMetadata with the rules defined in the
3854
// proto definition for this message. If any rules are violated, the result is
3855
// a list of violation errors wrapped in
3856
// PermissionSubjectPermissionRequestMetadataMultiError, or nil if none found.
3857
func (m *PermissionSubjectPermissionRequestMetadata) ValidateAll() error {
3858
	return m.validate(true)
3859
}
3860
3861
func (m *PermissionSubjectPermissionRequestMetadata) validate(all bool) error {
3862
	if m == nil {
3863
		return nil
3864
	}
3865
3866
	var errors []error
3867
3868
	// no validation rules for SchemaVersion
3869
3870
	// no validation rules for SnapToken
3871
3872
	// no validation rules for OnlyPermission
3873
3874
	if m.GetDepth() < 3 {
3875
		err := PermissionSubjectPermissionRequestMetadataValidationError{
3876
			field:  "Depth",
3877
			reason: "value must be greater than or equal to 3",
3878
		}
3879
		if !all {
3880
			return err
3881
		}
3882
		errors = append(errors, err)
3883
	}
3884
3885
	if len(errors) > 0 {
3886
		return PermissionSubjectPermissionRequestMetadataMultiError(errors)
3887
	}
3888
3889
	return nil
3890
}
3891
3892
// PermissionSubjectPermissionRequestMetadataMultiError is an error wrapping
3893
// multiple validation errors returned by
3894
// PermissionSubjectPermissionRequestMetadata.ValidateAll() if the designated
3895
// constraints aren't met.
3896
type PermissionSubjectPermissionRequestMetadataMultiError []error
3897
3898
// Error returns a concatenation of all the error messages it wraps.
3899
func (m PermissionSubjectPermissionRequestMetadataMultiError) Error() string {
3900
	msgs := make([]string, 0, len(m))
3901
	for _, err := range m {
3902
		msgs = append(msgs, err.Error())
3903
	}
3904
	return strings.Join(msgs, "; ")
3905
}
3906
3907
// AllErrors returns a list of validation violation errors.
3908
func (m PermissionSubjectPermissionRequestMetadataMultiError) AllErrors() []error { return m }
3909
3910
// PermissionSubjectPermissionRequestMetadataValidationError is the validation
3911
// error returned by PermissionSubjectPermissionRequestMetadata.Validate if
3912
// the designated constraints aren't met.
3913
type PermissionSubjectPermissionRequestMetadataValidationError struct {
3914
	field  string
3915
	reason string
3916
	cause  error
3917
	key    bool
3918
}
3919
3920
// Field function returns field value.
3921
func (e PermissionSubjectPermissionRequestMetadataValidationError) Field() string { return e.field }
3922
3923
// Reason function returns reason value.
3924
func (e PermissionSubjectPermissionRequestMetadataValidationError) Reason() string { return e.reason }
3925
3926
// Cause function returns cause value.
3927
func (e PermissionSubjectPermissionRequestMetadataValidationError) Cause() error { return e.cause }
3928
3929
// Key function returns key value.
3930
func (e PermissionSubjectPermissionRequestMetadataValidationError) Key() bool { return e.key }
3931
3932
// ErrorName returns error name.
3933
func (e PermissionSubjectPermissionRequestMetadataValidationError) ErrorName() string {
3934
	return "PermissionSubjectPermissionRequestMetadataValidationError"
3935
}
3936
3937
// Error satisfies the builtin error interface
3938
func (e PermissionSubjectPermissionRequestMetadataValidationError) Error() string {
3939
	cause := ""
3940
	if e.cause != nil {
3941
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
3942
	}
3943
3944
	key := ""
3945
	if e.key {
3946
		key = "key for "
3947
	}
3948
3949
	return fmt.Sprintf(
3950
		"invalid %sPermissionSubjectPermissionRequestMetadata.%s: %s%s",
3951
		key,
3952
		e.field,
3953
		e.reason,
3954
		cause)
3955
}
3956
3957
var _ error = PermissionSubjectPermissionRequestMetadataValidationError{}
3958
3959
var _ interface {
3960
	Field() string
3961
	Reason() string
3962
	Key() bool
3963
	Cause() error
3964
	ErrorName() string
3965
} = PermissionSubjectPermissionRequestMetadataValidationError{}
3966
3967
// Validate checks the field values on PermissionSubjectPermissionResponse with
3968
// the rules defined in the proto definition for this message. If any rules
3969
// are violated, the first error encountered is returned, or nil if there are
3970
// no violations.
3971
func (m *PermissionSubjectPermissionResponse) Validate() error {
3972
	return m.validate(false)
3973
}
3974
3975
// ValidateAll checks the field values on PermissionSubjectPermissionResponse
3976
// with the rules defined in the proto definition for this message. If any
3977
// rules are violated, the result is a list of violation errors wrapped in
3978
// PermissionSubjectPermissionResponseMultiError, or nil if none found.
3979
func (m *PermissionSubjectPermissionResponse) ValidateAll() error {
3980
	return m.validate(true)
3981
}
3982
3983
func (m *PermissionSubjectPermissionResponse) validate(all bool) error {
3984
	if m == nil {
3985
		return nil
3986
	}
3987
3988
	var errors []error
3989
3990
	// no validation rules for Results
3991
3992
	if len(errors) > 0 {
3993
		return PermissionSubjectPermissionResponseMultiError(errors)
3994
	}
3995
3996
	return nil
3997
}
3998
3999
// PermissionSubjectPermissionResponseMultiError is an error wrapping multiple
4000
// validation errors returned by
4001
// PermissionSubjectPermissionResponse.ValidateAll() if the designated
4002
// constraints aren't met.
4003
type PermissionSubjectPermissionResponseMultiError []error
4004
4005
// Error returns a concatenation of all the error messages it wraps.
4006
func (m PermissionSubjectPermissionResponseMultiError) Error() string {
4007
	msgs := make([]string, 0, len(m))
4008
	for _, err := range m {
4009
		msgs = append(msgs, err.Error())
4010
	}
4011
	return strings.Join(msgs, "; ")
4012
}
4013
4014
// AllErrors returns a list of validation violation errors.
4015
func (m PermissionSubjectPermissionResponseMultiError) AllErrors() []error { return m }
4016
4017
// PermissionSubjectPermissionResponseValidationError is the validation error
4018
// returned by PermissionSubjectPermissionResponse.Validate if the designated
4019
// constraints aren't met.
4020
type PermissionSubjectPermissionResponseValidationError struct {
4021
	field  string
4022
	reason string
4023
	cause  error
4024
	key    bool
4025
}
4026
4027
// Field function returns field value.
4028
func (e PermissionSubjectPermissionResponseValidationError) Field() string { return e.field }
4029
4030
// Reason function returns reason value.
4031
func (e PermissionSubjectPermissionResponseValidationError) Reason() string { return e.reason }
4032
4033
// Cause function returns cause value.
4034
func (e PermissionSubjectPermissionResponseValidationError) Cause() error { return e.cause }
4035
4036
// Key function returns key value.
4037
func (e PermissionSubjectPermissionResponseValidationError) Key() bool { return e.key }
4038
4039
// ErrorName returns error name.
4040
func (e PermissionSubjectPermissionResponseValidationError) ErrorName() string {
4041
	return "PermissionSubjectPermissionResponseValidationError"
4042
}
4043
4044
// Error satisfies the builtin error interface
4045
func (e PermissionSubjectPermissionResponseValidationError) Error() string {
4046
	cause := ""
4047
	if e.cause != nil {
4048
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
4049
	}
4050
4051
	key := ""
4052
	if e.key {
4053
		key = "key for "
4054
	}
4055
4056
	return fmt.Sprintf(
4057
		"invalid %sPermissionSubjectPermissionResponse.%s: %s%s",
4058
		key,
4059
		e.field,
4060
		e.reason,
4061
		cause)
4062
}
4063
4064
var _ error = PermissionSubjectPermissionResponseValidationError{}
4065
4066
var _ interface {
4067
	Field() string
4068
	Reason() string
4069
	Key() bool
4070
	Cause() error
4071
	ErrorName() string
4072
} = PermissionSubjectPermissionResponseValidationError{}
4073
4074
// Validate checks the field values on WatchRequest with the rules defined in
4075
// the proto definition for this message. If any rules are violated, the first
4076
// error encountered is returned, or nil if there are no violations.
4077
func (m *WatchRequest) Validate() error {
4078
	return m.validate(false)
4079
}
4080
4081
// ValidateAll checks the field values on WatchRequest with the rules defined
4082
// in the proto definition for this message. If any rules are violated, the
4083
// result is a list of violation errors wrapped in WatchRequestMultiError, or
4084
// nil if none found.
4085
func (m *WatchRequest) ValidateAll() error {
4086
	return m.validate(true)
4087
}
4088
4089
func (m *WatchRequest) validate(all bool) error {
4090
	if m == nil {
4091
		return nil
4092
	}
4093
4094
	var errors []error
4095
4096
	if len(m.GetTenantId()) > 128 {
4097
		err := WatchRequestValidationError{
4098
			field:  "TenantId",
4099
			reason: "value length must be at most 128 bytes",
4100
		}
4101
		if !all {
4102
			return err
4103
		}
4104
		errors = append(errors, err)
4105
	}
4106
4107
	if !_WatchRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
4108
		err := WatchRequestValidationError{
4109
			field:  "TenantId",
4110
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
4111
		}
4112
		if !all {
4113
			return err
4114
		}
4115
		errors = append(errors, err)
4116
	}
4117
4118
	// no validation rules for SnapToken
4119
4120
	if len(errors) > 0 {
4121
		return WatchRequestMultiError(errors)
4122
	}
4123
4124
	return nil
4125
}
4126
4127
// WatchRequestMultiError is an error wrapping multiple validation errors
4128
// returned by WatchRequest.ValidateAll() if the designated constraints aren't met.
4129
type WatchRequestMultiError []error
4130
4131
// Error returns a concatenation of all the error messages it wraps.
4132
func (m WatchRequestMultiError) Error() string {
4133
	msgs := make([]string, 0, len(m))
4134
	for _, err := range m {
4135
		msgs = append(msgs, err.Error())
4136
	}
4137
	return strings.Join(msgs, "; ")
4138
}
4139
4140
// AllErrors returns a list of validation violation errors.
4141
func (m WatchRequestMultiError) AllErrors() []error { return m }
4142
4143
// WatchRequestValidationError is the validation error returned by
4144
// WatchRequest.Validate if the designated constraints aren't met.
4145
type WatchRequestValidationError struct {
4146
	field  string
4147
	reason string
4148
	cause  error
4149
	key    bool
4150
}
4151
4152
// Field function returns field value.
4153
func (e WatchRequestValidationError) Field() string { return e.field }
4154
4155
// Reason function returns reason value.
4156
func (e WatchRequestValidationError) Reason() string { return e.reason }
4157
4158
// Cause function returns cause value.
4159
func (e WatchRequestValidationError) Cause() error { return e.cause }
4160
4161
// Key function returns key value.
4162
func (e WatchRequestValidationError) Key() bool { return e.key }
4163
4164
// ErrorName returns error name.
4165
func (e WatchRequestValidationError) ErrorName() string { return "WatchRequestValidationError" }
4166
4167
// Error satisfies the builtin error interface
4168
func (e WatchRequestValidationError) Error() string {
4169
	cause := ""
4170
	if e.cause != nil {
4171
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
4172
	}
4173
4174
	key := ""
4175
	if e.key {
4176
		key = "key for "
4177
	}
4178
4179
	return fmt.Sprintf(
4180
		"invalid %sWatchRequest.%s: %s%s",
4181
		key,
4182
		e.field,
4183
		e.reason,
4184
		cause)
4185
}
4186
4187
var _ error = WatchRequestValidationError{}
4188
4189
var _ interface {
4190
	Field() string
4191
	Reason() string
4192
	Key() bool
4193
	Cause() error
4194
	ErrorName() string
4195
} = WatchRequestValidationError{}
4196
4197
var _WatchRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
4198
4199
// Validate checks the field values on WatchResponse with the rules defined in
4200
// the proto definition for this message. If any rules are violated, the first
4201
// error encountered is returned, or nil if there are no violations.
4202
func (m *WatchResponse) Validate() error {
4203
	return m.validate(false)
4204
}
4205
4206
// ValidateAll checks the field values on WatchResponse with the rules defined
4207
// in the proto definition for this message. If any rules are violated, the
4208
// result is a list of violation errors wrapped in WatchResponseMultiError, or
4209
// nil if none found.
4210
func (m *WatchResponse) ValidateAll() error {
4211
	return m.validate(true)
4212
}
4213
4214
func (m *WatchResponse) validate(all bool) error {
4215
	if m == nil {
4216
		return nil
4217
	}
4218
4219
	var errors []error
4220
4221
	if all {
4222
		switch v := interface{}(m.GetChanges()).(type) {
4223
		case interface{ ValidateAll() error }:
4224
			if err := v.ValidateAll(); err != nil {
4225
				errors = append(errors, WatchResponseValidationError{
4226
					field:  "Changes",
4227
					reason: "embedded message failed validation",
4228
					cause:  err,
4229
				})
4230
			}
4231
		case interface{ Validate() error }:
4232
			if err := v.Validate(); err != nil {
4233
				errors = append(errors, WatchResponseValidationError{
4234
					field:  "Changes",
4235
					reason: "embedded message failed validation",
4236
					cause:  err,
4237
				})
4238
			}
4239
		}
4240
	} else if v, ok := interface{}(m.GetChanges()).(interface{ Validate() error }); ok {
4241
		if err := v.Validate(); err != nil {
4242
			return WatchResponseValidationError{
4243
				field:  "Changes",
4244
				reason: "embedded message failed validation",
4245
				cause:  err,
4246
			}
4247
		}
4248
	}
4249
4250
	if len(errors) > 0 {
4251
		return WatchResponseMultiError(errors)
4252
	}
4253
4254
	return nil
4255
}
4256
4257
// WatchResponseMultiError is an error wrapping multiple validation errors
4258
// returned by WatchResponse.ValidateAll() if the designated constraints
4259
// aren't met.
4260
type WatchResponseMultiError []error
4261
4262
// Error returns a concatenation of all the error messages it wraps.
4263
func (m WatchResponseMultiError) Error() string {
4264
	msgs := make([]string, 0, len(m))
4265
	for _, err := range m {
4266
		msgs = append(msgs, err.Error())
4267
	}
4268
	return strings.Join(msgs, "; ")
4269
}
4270
4271
// AllErrors returns a list of validation violation errors.
4272
func (m WatchResponseMultiError) AllErrors() []error { return m }
4273
4274
// WatchResponseValidationError is the validation error returned by
4275
// WatchResponse.Validate if the designated constraints aren't met.
4276
type WatchResponseValidationError struct {
4277
	field  string
4278
	reason string
4279
	cause  error
4280
	key    bool
4281
}
4282
4283
// Field function returns field value.
4284
func (e WatchResponseValidationError) Field() string { return e.field }
4285
4286
// Reason function returns reason value.
4287
func (e WatchResponseValidationError) Reason() string { return e.reason }
4288
4289
// Cause function returns cause value.
4290
func (e WatchResponseValidationError) Cause() error { return e.cause }
4291
4292
// Key function returns key value.
4293
func (e WatchResponseValidationError) Key() bool { return e.key }
4294
4295
// ErrorName returns error name.
4296
func (e WatchResponseValidationError) ErrorName() string { return "WatchResponseValidationError" }
4297
4298
// Error satisfies the builtin error interface
4299
func (e WatchResponseValidationError) Error() string {
4300
	cause := ""
4301
	if e.cause != nil {
4302
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
4303
	}
4304
4305
	key := ""
4306
	if e.key {
4307
		key = "key for "
4308
	}
4309
4310
	return fmt.Sprintf(
4311
		"invalid %sWatchResponse.%s: %s%s",
4312
		key,
4313
		e.field,
4314
		e.reason,
4315
		cause)
4316
}
4317
4318
var _ error = WatchResponseValidationError{}
4319
4320
var _ interface {
4321
	Field() string
4322
	Reason() string
4323
	Key() bool
4324
	Cause() error
4325
	ErrorName() string
4326
} = WatchResponseValidationError{}
4327
4328
// Validate checks the field values on SchemaWriteRequest with the rules
4329
// defined in the proto definition for this message. If any rules are
4330
// violated, the first error encountered is returned, or nil if there are no violations.
4331
func (m *SchemaWriteRequest) Validate() error {
4332
	return m.validate(false)
4333
}
4334
4335
// ValidateAll checks the field values on SchemaWriteRequest with the rules
4336
// defined in the proto definition for this message. If any rules are
4337
// violated, the result is a list of violation errors wrapped in
4338
// SchemaWriteRequestMultiError, or nil if none found.
4339
func (m *SchemaWriteRequest) ValidateAll() error {
4340
	return m.validate(true)
4341
}
4342
4343
func (m *SchemaWriteRequest) validate(all bool) error {
4344
	if m == nil {
4345
		return nil
4346
	}
4347
4348
	var errors []error
4349
4350
	if len(m.GetTenantId()) > 128 {
4351
		err := SchemaWriteRequestValidationError{
4352
			field:  "TenantId",
4353
			reason: "value length must be at most 128 bytes",
4354
		}
4355
		if !all {
4356
			return err
4357
		}
4358
		errors = append(errors, err)
4359
	}
4360
4361
	if !_SchemaWriteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
4362
		err := SchemaWriteRequestValidationError{
4363
			field:  "TenantId",
4364
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
4365
		}
4366
		if !all {
4367
			return err
4368
		}
4369
		errors = append(errors, err)
4370
	}
4371
4372
	// no validation rules for Schema
4373
4374
	if len(errors) > 0 {
4375
		return SchemaWriteRequestMultiError(errors)
4376
	}
4377
4378
	return nil
4379
}
4380
4381
// SchemaWriteRequestMultiError is an error wrapping multiple validation errors
4382
// returned by SchemaWriteRequest.ValidateAll() if the designated constraints
4383
// aren't met.
4384
type SchemaWriteRequestMultiError []error
4385
4386
// Error returns a concatenation of all the error messages it wraps.
4387
func (m SchemaWriteRequestMultiError) Error() string {
4388
	msgs := make([]string, 0, len(m))
4389
	for _, err := range m {
4390
		msgs = append(msgs, err.Error())
4391
	}
4392
	return strings.Join(msgs, "; ")
4393
}
4394
4395
// AllErrors returns a list of validation violation errors.
4396
func (m SchemaWriteRequestMultiError) AllErrors() []error { return m }
4397
4398
// SchemaWriteRequestValidationError is the validation error returned by
4399
// SchemaWriteRequest.Validate if the designated constraints aren't met.
4400
type SchemaWriteRequestValidationError struct {
4401
	field  string
4402
	reason string
4403
	cause  error
4404
	key    bool
4405
}
4406
4407
// Field function returns field value.
4408
func (e SchemaWriteRequestValidationError) Field() string { return e.field }
4409
4410
// Reason function returns reason value.
4411
func (e SchemaWriteRequestValidationError) Reason() string { return e.reason }
4412
4413
// Cause function returns cause value.
4414
func (e SchemaWriteRequestValidationError) Cause() error { return e.cause }
4415
4416
// Key function returns key value.
4417
func (e SchemaWriteRequestValidationError) Key() bool { return e.key }
4418
4419
// ErrorName returns error name.
4420
func (e SchemaWriteRequestValidationError) ErrorName() string {
4421
	return "SchemaWriteRequestValidationError"
4422
}
4423
4424
// Error satisfies the builtin error interface
4425
func (e SchemaWriteRequestValidationError) Error() string {
4426
	cause := ""
4427
	if e.cause != nil {
4428
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
4429
	}
4430
4431
	key := ""
4432
	if e.key {
4433
		key = "key for "
4434
	}
4435
4436
	return fmt.Sprintf(
4437
		"invalid %sSchemaWriteRequest.%s: %s%s",
4438
		key,
4439
		e.field,
4440
		e.reason,
4441
		cause)
4442
}
4443
4444
var _ error = SchemaWriteRequestValidationError{}
4445
4446
var _ interface {
4447
	Field() string
4448
	Reason() string
4449
	Key() bool
4450
	Cause() error
4451
	ErrorName() string
4452
} = SchemaWriteRequestValidationError{}
4453
4454
var _SchemaWriteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
4455
4456
// Validate checks the field values on SchemaWriteResponse with the rules
4457
// defined in the proto definition for this message. If any rules are
4458
// violated, the first error encountered is returned, or nil if there are no violations.
4459
func (m *SchemaWriteResponse) Validate() error {
4460
	return m.validate(false)
4461
}
4462
4463
// ValidateAll checks the field values on SchemaWriteResponse with the rules
4464
// defined in the proto definition for this message. If any rules are
4465
// violated, the result is a list of violation errors wrapped in
4466
// SchemaWriteResponseMultiError, or nil if none found.
4467
func (m *SchemaWriteResponse) ValidateAll() error {
4468
	return m.validate(true)
4469
}
4470
4471
func (m *SchemaWriteResponse) validate(all bool) error {
4472
	if m == nil {
4473
		return nil
4474
	}
4475
4476
	var errors []error
4477
4478
	// no validation rules for SchemaVersion
4479
4480
	if len(errors) > 0 {
4481
		return SchemaWriteResponseMultiError(errors)
4482
	}
4483
4484
	return nil
4485
}
4486
4487
// SchemaWriteResponseMultiError is an error wrapping multiple validation
4488
// errors returned by SchemaWriteResponse.ValidateAll() if the designated
4489
// constraints aren't met.
4490
type SchemaWriteResponseMultiError []error
4491
4492
// Error returns a concatenation of all the error messages it wraps.
4493
func (m SchemaWriteResponseMultiError) Error() string {
4494
	msgs := make([]string, 0, len(m))
4495
	for _, err := range m {
4496
		msgs = append(msgs, err.Error())
4497
	}
4498
	return strings.Join(msgs, "; ")
4499
}
4500
4501
// AllErrors returns a list of validation violation errors.
4502
func (m SchemaWriteResponseMultiError) AllErrors() []error { return m }
4503
4504
// SchemaWriteResponseValidationError is the validation error returned by
4505
// SchemaWriteResponse.Validate if the designated constraints aren't met.
4506
type SchemaWriteResponseValidationError struct {
4507
	field  string
4508
	reason string
4509
	cause  error
4510
	key    bool
4511
}
4512
4513
// Field function returns field value.
4514
func (e SchemaWriteResponseValidationError) Field() string { return e.field }
4515
4516
// Reason function returns reason value.
4517
func (e SchemaWriteResponseValidationError) Reason() string { return e.reason }
4518
4519
// Cause function returns cause value.
4520
func (e SchemaWriteResponseValidationError) Cause() error { return e.cause }
4521
4522
// Key function returns key value.
4523
func (e SchemaWriteResponseValidationError) Key() bool { return e.key }
4524
4525
// ErrorName returns error name.
4526
func (e SchemaWriteResponseValidationError) ErrorName() string {
4527
	return "SchemaWriteResponseValidationError"
4528
}
4529
4530
// Error satisfies the builtin error interface
4531
func (e SchemaWriteResponseValidationError) Error() string {
4532
	cause := ""
4533
	if e.cause != nil {
4534
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
4535
	}
4536
4537
	key := ""
4538
	if e.key {
4539
		key = "key for "
4540
	}
4541
4542
	return fmt.Sprintf(
4543
		"invalid %sSchemaWriteResponse.%s: %s%s",
4544
		key,
4545
		e.field,
4546
		e.reason,
4547
		cause)
4548
}
4549
4550
var _ error = SchemaWriteResponseValidationError{}
4551
4552
var _ interface {
4553
	Field() string
4554
	Reason() string
4555
	Key() bool
4556
	Cause() error
4557
	ErrorName() string
4558
} = SchemaWriteResponseValidationError{}
4559
4560
// Validate checks the field values on SchemaPartialWriteRequest with the rules
4561
// defined in the proto definition for this message. If any rules are
4562
// violated, the first error encountered is returned, or nil if there are no violations.
4563
func (m *SchemaPartialWriteRequest) Validate() error {
4564
	return m.validate(false)
4565
}
4566
4567
// ValidateAll checks the field values on SchemaPartialWriteRequest with the
4568
// rules defined in the proto definition for this message. If any rules are
4569
// violated, the result is a list of violation errors wrapped in
4570
// SchemaPartialWriteRequestMultiError, or nil if none found.
4571
func (m *SchemaPartialWriteRequest) ValidateAll() error {
4572
	return m.validate(true)
4573
}
4574
4575
func (m *SchemaPartialWriteRequest) validate(all bool) error {
4576
	if m == nil {
4577
		return nil
4578
	}
4579
4580
	var errors []error
4581
4582
	if len(m.GetTenantId()) > 128 {
4583
		err := SchemaPartialWriteRequestValidationError{
4584
			field:  "TenantId",
4585
			reason: "value length must be at most 128 bytes",
4586
		}
4587
		if !all {
4588
			return err
4589
		}
4590
		errors = append(errors, err)
4591
	}
4592
4593
	if !_SchemaPartialWriteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
4594
		err := SchemaPartialWriteRequestValidationError{
4595
			field:  "TenantId",
4596
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
4597
		}
4598
		if !all {
4599
			return err
4600
		}
4601
		errors = append(errors, err)
4602
	}
4603
4604
	if m.GetMetadata() == nil {
4605
		err := SchemaPartialWriteRequestValidationError{
4606
			field:  "Metadata",
4607
			reason: "value is required",
4608
		}
4609
		if !all {
4610
			return err
4611
		}
4612
		errors = append(errors, err)
4613
	}
4614
4615
	if all {
4616
		switch v := interface{}(m.GetMetadata()).(type) {
4617
		case interface{ ValidateAll() error }:
4618
			if err := v.ValidateAll(); err != nil {
4619
				errors = append(errors, SchemaPartialWriteRequestValidationError{
4620
					field:  "Metadata",
4621
					reason: "embedded message failed validation",
4622
					cause:  err,
4623
				})
4624
			}
4625
		case interface{ Validate() error }:
4626
			if err := v.Validate(); err != nil {
4627
				errors = append(errors, SchemaPartialWriteRequestValidationError{
4628
					field:  "Metadata",
4629
					reason: "embedded message failed validation",
4630
					cause:  err,
4631
				})
4632
			}
4633
		}
4634
	} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
4635
		if err := v.Validate(); err != nil {
4636
			return SchemaPartialWriteRequestValidationError{
4637
				field:  "Metadata",
4638
				reason: "embedded message failed validation",
4639
				cause:  err,
4640
			}
4641
		}
4642
	}
4643
4644
	{
4645
		sorted_keys := make([]string, len(m.GetPartials()))
4646
		i := 0
4647
		for key := range m.GetPartials() {
4648
			sorted_keys[i] = key
4649
			i++
4650
		}
4651
		sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] })
4652
		for _, key := range sorted_keys {
4653
			val := m.GetPartials()[key]
4654
			_ = val
4655
4656
			// no validation rules for Partials[key]
4657
4658
			if all {
4659
				switch v := interface{}(val).(type) {
4660
				case interface{ ValidateAll() error }:
4661
					if err := v.ValidateAll(); err != nil {
4662
						errors = append(errors, SchemaPartialWriteRequestValidationError{
4663
							field:  fmt.Sprintf("Partials[%v]", key),
4664
							reason: "embedded message failed validation",
4665
							cause:  err,
4666
						})
4667
					}
4668
				case interface{ Validate() error }:
4669
					if err := v.Validate(); err != nil {
4670
						errors = append(errors, SchemaPartialWriteRequestValidationError{
4671
							field:  fmt.Sprintf("Partials[%v]", key),
4672
							reason: "embedded message failed validation",
4673
							cause:  err,
4674
						})
4675
					}
4676
				}
4677
			} else if v, ok := interface{}(val).(interface{ Validate() error }); ok {
4678
				if err := v.Validate(); err != nil {
4679
					return SchemaPartialWriteRequestValidationError{
4680
						field:  fmt.Sprintf("Partials[%v]", key),
4681
						reason: "embedded message failed validation",
4682
						cause:  err,
4683
					}
4684
				}
4685
			}
4686
4687
		}
4688
	}
4689
4690
	if len(errors) > 0 {
4691
		return SchemaPartialWriteRequestMultiError(errors)
4692
	}
4693
4694
	return nil
4695
}
4696
4697
// SchemaPartialWriteRequestMultiError is an error wrapping multiple validation
4698
// errors returned by SchemaPartialWriteRequest.ValidateAll() if the
4699
// designated constraints aren't met.
4700
type SchemaPartialWriteRequestMultiError []error
4701
4702
// Error returns a concatenation of all the error messages it wraps.
4703
func (m SchemaPartialWriteRequestMultiError) Error() string {
4704
	msgs := make([]string, 0, len(m))
4705
	for _, err := range m {
4706
		msgs = append(msgs, err.Error())
4707
	}
4708
	return strings.Join(msgs, "; ")
4709
}
4710
4711
// AllErrors returns a list of validation violation errors.
4712
func (m SchemaPartialWriteRequestMultiError) AllErrors() []error { return m }
4713
4714
// SchemaPartialWriteRequestValidationError is the validation error returned by
4715
// SchemaPartialWriteRequest.Validate if the designated constraints aren't met.
4716
type SchemaPartialWriteRequestValidationError struct {
4717
	field  string
4718
	reason string
4719
	cause  error
4720
	key    bool
4721
}
4722
4723
// Field function returns field value.
4724
func (e SchemaPartialWriteRequestValidationError) Field() string { return e.field }
4725
4726
// Reason function returns reason value.
4727
func (e SchemaPartialWriteRequestValidationError) Reason() string { return e.reason }
4728
4729
// Cause function returns cause value.
4730
func (e SchemaPartialWriteRequestValidationError) Cause() error { return e.cause }
4731
4732
// Key function returns key value.
4733
func (e SchemaPartialWriteRequestValidationError) Key() bool { return e.key }
4734
4735
// ErrorName returns error name.
4736
func (e SchemaPartialWriteRequestValidationError) ErrorName() string {
4737
	return "SchemaPartialWriteRequestValidationError"
4738
}
4739
4740
// Error satisfies the builtin error interface
4741
func (e SchemaPartialWriteRequestValidationError) Error() string {
4742
	cause := ""
4743
	if e.cause != nil {
4744
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
4745
	}
4746
4747
	key := ""
4748
	if e.key {
4749
		key = "key for "
4750
	}
4751
4752
	return fmt.Sprintf(
4753
		"invalid %sSchemaPartialWriteRequest.%s: %s%s",
4754
		key,
4755
		e.field,
4756
		e.reason,
4757
		cause)
4758
}
4759
4760
var _ error = SchemaPartialWriteRequestValidationError{}
4761
4762
var _ interface {
4763
	Field() string
4764
	Reason() string
4765
	Key() bool
4766
	Cause() error
4767
	ErrorName() string
4768
} = SchemaPartialWriteRequestValidationError{}
4769
4770
var _SchemaPartialWriteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
4771
4772
// Validate checks the field values on SchemaPartialWriteRequestMetadata with
4773
// the rules defined in the proto definition for this message. If any rules
4774
// are violated, the first error encountered is returned, or nil if there are
4775
// no violations.
4776
func (m *SchemaPartialWriteRequestMetadata) Validate() error {
4777
	return m.validate(false)
4778
}
4779
4780
// ValidateAll checks the field values on SchemaPartialWriteRequestMetadata
4781
// with the rules defined in the proto definition for this message. If any
4782
// rules are violated, the result is a list of violation errors wrapped in
4783
// SchemaPartialWriteRequestMetadataMultiError, or nil if none found.
4784
func (m *SchemaPartialWriteRequestMetadata) ValidateAll() error {
4785
	return m.validate(true)
4786
}
4787
4788
func (m *SchemaPartialWriteRequestMetadata) validate(all bool) error {
4789
	if m == nil {
4790
		return nil
4791
	}
4792
4793
	var errors []error
4794
4795
	// no validation rules for SchemaVersion
4796
4797
	if len(errors) > 0 {
4798
		return SchemaPartialWriteRequestMetadataMultiError(errors)
4799
	}
4800
4801
	return nil
4802
}
4803
4804
// SchemaPartialWriteRequestMetadataMultiError is an error wrapping multiple
4805
// validation errors returned by
4806
// SchemaPartialWriteRequestMetadata.ValidateAll() if the designated
4807
// constraints aren't met.
4808
type SchemaPartialWriteRequestMetadataMultiError []error
4809
4810
// Error returns a concatenation of all the error messages it wraps.
4811
func (m SchemaPartialWriteRequestMetadataMultiError) Error() string {
4812
	msgs := make([]string, 0, len(m))
4813
	for _, err := range m {
4814
		msgs = append(msgs, err.Error())
4815
	}
4816
	return strings.Join(msgs, "; ")
4817
}
4818
4819
// AllErrors returns a list of validation violation errors.
4820
func (m SchemaPartialWriteRequestMetadataMultiError) AllErrors() []error { return m }
4821
4822
// SchemaPartialWriteRequestMetadataValidationError is the validation error
4823
// returned by SchemaPartialWriteRequestMetadata.Validate if the designated
4824
// constraints aren't met.
4825
type SchemaPartialWriteRequestMetadataValidationError struct {
4826
	field  string
4827
	reason string
4828
	cause  error
4829
	key    bool
4830
}
4831
4832
// Field function returns field value.
4833
func (e SchemaPartialWriteRequestMetadataValidationError) Field() string { return e.field }
4834
4835
// Reason function returns reason value.
4836
func (e SchemaPartialWriteRequestMetadataValidationError) Reason() string { return e.reason }
4837
4838
// Cause function returns cause value.
4839
func (e SchemaPartialWriteRequestMetadataValidationError) Cause() error { return e.cause }
4840
4841
// Key function returns key value.
4842
func (e SchemaPartialWriteRequestMetadataValidationError) Key() bool { return e.key }
4843
4844
// ErrorName returns error name.
4845
func (e SchemaPartialWriteRequestMetadataValidationError) ErrorName() string {
4846
	return "SchemaPartialWriteRequestMetadataValidationError"
4847
}
4848
4849
// Error satisfies the builtin error interface
4850
func (e SchemaPartialWriteRequestMetadataValidationError) Error() string {
4851
	cause := ""
4852
	if e.cause != nil {
4853
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
4854
	}
4855
4856
	key := ""
4857
	if e.key {
4858
		key = "key for "
4859
	}
4860
4861
	return fmt.Sprintf(
4862
		"invalid %sSchemaPartialWriteRequestMetadata.%s: %s%s",
4863
		key,
4864
		e.field,
4865
		e.reason,
4866
		cause)
4867
}
4868
4869
var _ error = SchemaPartialWriteRequestMetadataValidationError{}
4870
4871
var _ interface {
4872
	Field() string
4873
	Reason() string
4874
	Key() bool
4875
	Cause() error
4876
	ErrorName() string
4877
} = SchemaPartialWriteRequestMetadataValidationError{}
4878
4879
// Validate checks the field values on SchemaPartialWriteResponse with the
4880
// rules defined in the proto definition for this message. If any rules are
4881
// violated, the first error encountered is returned, or nil if there are no violations.
4882
func (m *SchemaPartialWriteResponse) Validate() error {
4883
	return m.validate(false)
4884
}
4885
4886
// ValidateAll checks the field values on SchemaPartialWriteResponse with the
4887
// rules defined in the proto definition for this message. If any rules are
4888
// violated, the result is a list of violation errors wrapped in
4889
// SchemaPartialWriteResponseMultiError, or nil if none found.
4890
func (m *SchemaPartialWriteResponse) ValidateAll() error {
4891
	return m.validate(true)
4892
}
4893
4894
func (m *SchemaPartialWriteResponse) validate(all bool) error {
4895
	if m == nil {
4896
		return nil
4897
	}
4898
4899
	var errors []error
4900
4901
	// no validation rules for SchemaVersion
4902
4903
	if len(errors) > 0 {
4904
		return SchemaPartialWriteResponseMultiError(errors)
4905
	}
4906
4907
	return nil
4908
}
4909
4910
// SchemaPartialWriteResponseMultiError is an error wrapping multiple
4911
// validation errors returned by SchemaPartialWriteResponse.ValidateAll() if
4912
// the designated constraints aren't met.
4913
type SchemaPartialWriteResponseMultiError []error
4914
4915
// Error returns a concatenation of all the error messages it wraps.
4916
func (m SchemaPartialWriteResponseMultiError) Error() string {
4917
	msgs := make([]string, 0, len(m))
4918
	for _, err := range m {
4919
		msgs = append(msgs, err.Error())
4920
	}
4921
	return strings.Join(msgs, "; ")
4922
}
4923
4924
// AllErrors returns a list of validation violation errors.
4925
func (m SchemaPartialWriteResponseMultiError) AllErrors() []error { return m }
4926
4927
// SchemaPartialWriteResponseValidationError is the validation error returned
4928
// by SchemaPartialWriteResponse.Validate if the designated constraints aren't met.
4929
type SchemaPartialWriteResponseValidationError struct {
4930
	field  string
4931
	reason string
4932
	cause  error
4933
	key    bool
4934
}
4935
4936
// Field function returns field value.
4937
func (e SchemaPartialWriteResponseValidationError) Field() string { return e.field }
4938
4939
// Reason function returns reason value.
4940
func (e SchemaPartialWriteResponseValidationError) Reason() string { return e.reason }
4941
4942
// Cause function returns cause value.
4943
func (e SchemaPartialWriteResponseValidationError) Cause() error { return e.cause }
4944
4945
// Key function returns key value.
4946
func (e SchemaPartialWriteResponseValidationError) Key() bool { return e.key }
4947
4948
// ErrorName returns error name.
4949
func (e SchemaPartialWriteResponseValidationError) ErrorName() string {
4950
	return "SchemaPartialWriteResponseValidationError"
4951
}
4952
4953
// Error satisfies the builtin error interface
4954
func (e SchemaPartialWriteResponseValidationError) Error() string {
4955
	cause := ""
4956
	if e.cause != nil {
4957
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
4958
	}
4959
4960
	key := ""
4961
	if e.key {
4962
		key = "key for "
4963
	}
4964
4965
	return fmt.Sprintf(
4966
		"invalid %sSchemaPartialWriteResponse.%s: %s%s",
4967
		key,
4968
		e.field,
4969
		e.reason,
4970
		cause)
4971
}
4972
4973
var _ error = SchemaPartialWriteResponseValidationError{}
4974
4975
var _ interface {
4976
	Field() string
4977
	Reason() string
4978
	Key() bool
4979
	Cause() error
4980
	ErrorName() string
4981
} = SchemaPartialWriteResponseValidationError{}
4982
4983
// Validate checks the field values on SchemaReadRequest with the rules defined
4984
// in the proto definition for this message. If any rules are violated, the
4985
// first error encountered is returned, or nil if there are no violations.
4986
func (m *SchemaReadRequest) Validate() error {
4987
	return m.validate(false)
4988
}
4989
4990
// ValidateAll checks the field values on SchemaReadRequest with the rules
4991
// defined in the proto definition for this message. If any rules are
4992
// violated, the result is a list of violation errors wrapped in
4993
// SchemaReadRequestMultiError, or nil if none found.
4994
func (m *SchemaReadRequest) ValidateAll() error {
4995
	return m.validate(true)
4996
}
4997
4998
func (m *SchemaReadRequest) validate(all bool) error {
4999
	if m == nil {
5000
		return nil
5001
	}
5002
5003
	var errors []error
5004
5005
	if len(m.GetTenantId()) > 128 {
5006
		err := SchemaReadRequestValidationError{
5007
			field:  "TenantId",
5008
			reason: "value length must be at most 128 bytes",
5009
		}
5010
		if !all {
5011
			return err
5012
		}
5013
		errors = append(errors, err)
5014
	}
5015
5016
	if !_SchemaReadRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
5017
		err := SchemaReadRequestValidationError{
5018
			field:  "TenantId",
5019
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
5020
		}
5021
		if !all {
5022
			return err
5023
		}
5024
		errors = append(errors, err)
5025
	}
5026
5027
	if m.GetMetadata() == nil {
5028
		err := SchemaReadRequestValidationError{
5029
			field:  "Metadata",
5030
			reason: "value is required",
5031
		}
5032
		if !all {
5033
			return err
5034
		}
5035
		errors = append(errors, err)
5036
	}
5037
5038
	if all {
5039
		switch v := interface{}(m.GetMetadata()).(type) {
5040
		case interface{ ValidateAll() error }:
5041
			if err := v.ValidateAll(); err != nil {
5042
				errors = append(errors, SchemaReadRequestValidationError{
5043
					field:  "Metadata",
5044
					reason: "embedded message failed validation",
5045
					cause:  err,
5046
				})
5047
			}
5048
		case interface{ Validate() error }:
5049
			if err := v.Validate(); err != nil {
5050
				errors = append(errors, SchemaReadRequestValidationError{
5051
					field:  "Metadata",
5052
					reason: "embedded message failed validation",
5053
					cause:  err,
5054
				})
5055
			}
5056
		}
5057
	} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
5058
		if err := v.Validate(); err != nil {
5059
			return SchemaReadRequestValidationError{
5060
				field:  "Metadata",
5061
				reason: "embedded message failed validation",
5062
				cause:  err,
5063
			}
5064
		}
5065
	}
5066
5067
	if len(errors) > 0 {
5068
		return SchemaReadRequestMultiError(errors)
5069
	}
5070
5071
	return nil
5072
}
5073
5074
// SchemaReadRequestMultiError is an error wrapping multiple validation errors
5075
// returned by SchemaReadRequest.ValidateAll() if the designated constraints
5076
// aren't met.
5077
type SchemaReadRequestMultiError []error
5078
5079
// Error returns a concatenation of all the error messages it wraps.
5080
func (m SchemaReadRequestMultiError) Error() string {
5081
	msgs := make([]string, 0, len(m))
5082
	for _, err := range m {
5083
		msgs = append(msgs, err.Error())
5084
	}
5085
	return strings.Join(msgs, "; ")
5086
}
5087
5088
// AllErrors returns a list of validation violation errors.
5089
func (m SchemaReadRequestMultiError) AllErrors() []error { return m }
5090
5091
// SchemaReadRequestValidationError is the validation error returned by
5092
// SchemaReadRequest.Validate if the designated constraints aren't met.
5093
type SchemaReadRequestValidationError struct {
5094
	field  string
5095
	reason string
5096
	cause  error
5097
	key    bool
5098
}
5099
5100
// Field function returns field value.
5101
func (e SchemaReadRequestValidationError) Field() string { return e.field }
5102
5103
// Reason function returns reason value.
5104
func (e SchemaReadRequestValidationError) Reason() string { return e.reason }
5105
5106
// Cause function returns cause value.
5107
func (e SchemaReadRequestValidationError) Cause() error { return e.cause }
5108
5109
// Key function returns key value.
5110
func (e SchemaReadRequestValidationError) Key() bool { return e.key }
5111
5112
// ErrorName returns error name.
5113
func (e SchemaReadRequestValidationError) ErrorName() string {
5114
	return "SchemaReadRequestValidationError"
5115
}
5116
5117
// Error satisfies the builtin error interface
5118
func (e SchemaReadRequestValidationError) Error() string {
5119
	cause := ""
5120
	if e.cause != nil {
5121
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
5122
	}
5123
5124
	key := ""
5125
	if e.key {
5126
		key = "key for "
5127
	}
5128
5129
	return fmt.Sprintf(
5130
		"invalid %sSchemaReadRequest.%s: %s%s",
5131
		key,
5132
		e.field,
5133
		e.reason,
5134
		cause)
5135
}
5136
5137
var _ error = SchemaReadRequestValidationError{}
5138
5139
var _ interface {
5140
	Field() string
5141
	Reason() string
5142
	Key() bool
5143
	Cause() error
5144
	ErrorName() string
5145
} = SchemaReadRequestValidationError{}
5146
5147
var _SchemaReadRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
5148
5149
// Validate checks the field values on SchemaReadRequestMetadata with the rules
5150
// defined in the proto definition for this message. If any rules are
5151
// violated, the first error encountered is returned, or nil if there are no violations.
5152
func (m *SchemaReadRequestMetadata) Validate() error {
5153
	return m.validate(false)
5154
}
5155
5156
// ValidateAll checks the field values on SchemaReadRequestMetadata with the
5157
// rules defined in the proto definition for this message. If any rules are
5158
// violated, the result is a list of violation errors wrapped in
5159
// SchemaReadRequestMetadataMultiError, or nil if none found.
5160
func (m *SchemaReadRequestMetadata) ValidateAll() error {
5161
	return m.validate(true)
5162
}
5163
5164
func (m *SchemaReadRequestMetadata) validate(all bool) error {
5165
	if m == nil {
5166
		return nil
5167
	}
5168
5169
	var errors []error
5170
5171
	// no validation rules for SchemaVersion
5172
5173
	if len(errors) > 0 {
5174
		return SchemaReadRequestMetadataMultiError(errors)
5175
	}
5176
5177
	return nil
5178
}
5179
5180
// SchemaReadRequestMetadataMultiError is an error wrapping multiple validation
5181
// errors returned by SchemaReadRequestMetadata.ValidateAll() if the
5182
// designated constraints aren't met.
5183
type SchemaReadRequestMetadataMultiError []error
5184
5185
// Error returns a concatenation of all the error messages it wraps.
5186
func (m SchemaReadRequestMetadataMultiError) Error() string {
5187
	msgs := make([]string, 0, len(m))
5188
	for _, err := range m {
5189
		msgs = append(msgs, err.Error())
5190
	}
5191
	return strings.Join(msgs, "; ")
5192
}
5193
5194
// AllErrors returns a list of validation violation errors.
5195
func (m SchemaReadRequestMetadataMultiError) AllErrors() []error { return m }
5196
5197
// SchemaReadRequestMetadataValidationError is the validation error returned by
5198
// SchemaReadRequestMetadata.Validate if the designated constraints aren't met.
5199
type SchemaReadRequestMetadataValidationError struct {
5200
	field  string
5201
	reason string
5202
	cause  error
5203
	key    bool
5204
}
5205
5206
// Field function returns field value.
5207
func (e SchemaReadRequestMetadataValidationError) Field() string { return e.field }
5208
5209
// Reason function returns reason value.
5210
func (e SchemaReadRequestMetadataValidationError) Reason() string { return e.reason }
5211
5212
// Cause function returns cause value.
5213
func (e SchemaReadRequestMetadataValidationError) Cause() error { return e.cause }
5214
5215
// Key function returns key value.
5216
func (e SchemaReadRequestMetadataValidationError) Key() bool { return e.key }
5217
5218
// ErrorName returns error name.
5219
func (e SchemaReadRequestMetadataValidationError) ErrorName() string {
5220
	return "SchemaReadRequestMetadataValidationError"
5221
}
5222
5223
// Error satisfies the builtin error interface
5224
func (e SchemaReadRequestMetadataValidationError) Error() string {
5225
	cause := ""
5226
	if e.cause != nil {
5227
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
5228
	}
5229
5230
	key := ""
5231
	if e.key {
5232
		key = "key for "
5233
	}
5234
5235
	return fmt.Sprintf(
5236
		"invalid %sSchemaReadRequestMetadata.%s: %s%s",
5237
		key,
5238
		e.field,
5239
		e.reason,
5240
		cause)
5241
}
5242
5243
var _ error = SchemaReadRequestMetadataValidationError{}
5244
5245
var _ interface {
5246
	Field() string
5247
	Reason() string
5248
	Key() bool
5249
	Cause() error
5250
	ErrorName() string
5251
} = SchemaReadRequestMetadataValidationError{}
5252
5253
// Validate checks the field values on SchemaReadResponse with the rules
5254
// defined in the proto definition for this message. If any rules are
5255
// violated, the first error encountered is returned, or nil if there are no violations.
5256
func (m *SchemaReadResponse) Validate() error {
5257
	return m.validate(false)
5258
}
5259
5260
// ValidateAll checks the field values on SchemaReadResponse with the rules
5261
// defined in the proto definition for this message. If any rules are
5262
// violated, the result is a list of violation errors wrapped in
5263
// SchemaReadResponseMultiError, or nil if none found.
5264
func (m *SchemaReadResponse) ValidateAll() error {
5265
	return m.validate(true)
5266
}
5267
5268
func (m *SchemaReadResponse) validate(all bool) error {
5269
	if m == nil {
5270
		return nil
5271
	}
5272
5273
	var errors []error
5274
5275
	if all {
5276
		switch v := interface{}(m.GetSchema()).(type) {
5277
		case interface{ ValidateAll() error }:
5278
			if err := v.ValidateAll(); err != nil {
5279
				errors = append(errors, SchemaReadResponseValidationError{
5280
					field:  "Schema",
5281
					reason: "embedded message failed validation",
5282
					cause:  err,
5283
				})
5284
			}
5285
		case interface{ Validate() error }:
5286
			if err := v.Validate(); err != nil {
5287
				errors = append(errors, SchemaReadResponseValidationError{
5288
					field:  "Schema",
5289
					reason: "embedded message failed validation",
5290
					cause:  err,
5291
				})
5292
			}
5293
		}
5294
	} else if v, ok := interface{}(m.GetSchema()).(interface{ Validate() error }); ok {
5295
		if err := v.Validate(); err != nil {
5296
			return SchemaReadResponseValidationError{
5297
				field:  "Schema",
5298
				reason: "embedded message failed validation",
5299
				cause:  err,
5300
			}
5301
		}
5302
	}
5303
5304
	if len(errors) > 0 {
5305
		return SchemaReadResponseMultiError(errors)
5306
	}
5307
5308
	return nil
5309
}
5310
5311
// SchemaReadResponseMultiError is an error wrapping multiple validation errors
5312
// returned by SchemaReadResponse.ValidateAll() if the designated constraints
5313
// aren't met.
5314
type SchemaReadResponseMultiError []error
5315
5316
// Error returns a concatenation of all the error messages it wraps.
5317
func (m SchemaReadResponseMultiError) Error() string {
5318
	msgs := make([]string, 0, len(m))
5319
	for _, err := range m {
5320
		msgs = append(msgs, err.Error())
5321
	}
5322
	return strings.Join(msgs, "; ")
5323
}
5324
5325
// AllErrors returns a list of validation violation errors.
5326
func (m SchemaReadResponseMultiError) AllErrors() []error { return m }
5327
5328
// SchemaReadResponseValidationError is the validation error returned by
5329
// SchemaReadResponse.Validate if the designated constraints aren't met.
5330
type SchemaReadResponseValidationError struct {
5331
	field  string
5332
	reason string
5333
	cause  error
5334
	key    bool
5335
}
5336
5337
// Field function returns field value.
5338
func (e SchemaReadResponseValidationError) Field() string { return e.field }
5339
5340
// Reason function returns reason value.
5341
func (e SchemaReadResponseValidationError) Reason() string { return e.reason }
5342
5343
// Cause function returns cause value.
5344
func (e SchemaReadResponseValidationError) Cause() error { return e.cause }
5345
5346
// Key function returns key value.
5347
func (e SchemaReadResponseValidationError) Key() bool { return e.key }
5348
5349
// ErrorName returns error name.
5350
func (e SchemaReadResponseValidationError) ErrorName() string {
5351
	return "SchemaReadResponseValidationError"
5352
}
5353
5354
// Error satisfies the builtin error interface
5355
func (e SchemaReadResponseValidationError) Error() string {
5356
	cause := ""
5357
	if e.cause != nil {
5358
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
5359
	}
5360
5361
	key := ""
5362
	if e.key {
5363
		key = "key for "
5364
	}
5365
5366
	return fmt.Sprintf(
5367
		"invalid %sSchemaReadResponse.%s: %s%s",
5368
		key,
5369
		e.field,
5370
		e.reason,
5371
		cause)
5372
}
5373
5374
var _ error = SchemaReadResponseValidationError{}
5375
5376
var _ interface {
5377
	Field() string
5378
	Reason() string
5379
	Key() bool
5380
	Cause() error
5381
	ErrorName() string
5382
} = SchemaReadResponseValidationError{}
5383
5384
// Validate checks the field values on SchemaListRequest with the rules defined
5385
// in the proto definition for this message. If any rules are violated, the
5386
// first error encountered is returned, or nil if there are no violations.
5387
func (m *SchemaListRequest) Validate() error {
5388
	return m.validate(false)
5389
}
5390
5391
// ValidateAll checks the field values on SchemaListRequest with the rules
5392
// defined in the proto definition for this message. If any rules are
5393
// violated, the result is a list of violation errors wrapped in
5394
// SchemaListRequestMultiError, or nil if none found.
5395
func (m *SchemaListRequest) ValidateAll() error {
5396
	return m.validate(true)
5397
}
5398
5399
func (m *SchemaListRequest) validate(all bool) error {
5400
	if m == nil {
5401
		return nil
5402
	}
5403
5404
	var errors []error
5405
5406
	if len(m.GetTenantId()) > 128 {
5407
		err := SchemaListRequestValidationError{
5408
			field:  "TenantId",
5409
			reason: "value length must be at most 128 bytes",
5410
		}
5411
		if !all {
5412
			return err
5413
		}
5414
		errors = append(errors, err)
5415
	}
5416
5417
	if !_SchemaListRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
5418
		err := SchemaListRequestValidationError{
5419
			field:  "TenantId",
5420
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
5421
		}
5422
		if !all {
5423
			return err
5424
		}
5425
		errors = append(errors, err)
5426
	}
5427
5428
	if m.GetPageSize() != 0 {
5429
5430
		if m.GetPageSize() < 1 {
5431
			err := SchemaListRequestValidationError{
5432
				field:  "PageSize",
5433
				reason: "value must be greater than or equal to 1",
5434
			}
5435
			if !all {
5436
				return err
5437
			}
5438
			errors = append(errors, err)
5439
		}
5440
5441
	}
5442
5443
	if m.GetContinuousToken() != "" {
5444
5445
	}
5446
5447
	if len(errors) > 0 {
5448
		return SchemaListRequestMultiError(errors)
5449
	}
5450
5451
	return nil
5452
}
5453
5454
// SchemaListRequestMultiError is an error wrapping multiple validation errors
5455
// returned by SchemaListRequest.ValidateAll() if the designated constraints
5456
// aren't met.
5457
type SchemaListRequestMultiError []error
5458
5459
// Error returns a concatenation of all the error messages it wraps.
5460
func (m SchemaListRequestMultiError) Error() string {
5461
	msgs := make([]string, 0, len(m))
5462
	for _, err := range m {
5463
		msgs = append(msgs, err.Error())
5464
	}
5465
	return strings.Join(msgs, "; ")
5466
}
5467
5468
// AllErrors returns a list of validation violation errors.
5469
func (m SchemaListRequestMultiError) AllErrors() []error { return m }
5470
5471
// SchemaListRequestValidationError is the validation error returned by
5472
// SchemaListRequest.Validate if the designated constraints aren't met.
5473
type SchemaListRequestValidationError struct {
5474
	field  string
5475
	reason string
5476
	cause  error
5477
	key    bool
5478
}
5479
5480
// Field function returns field value.
5481
func (e SchemaListRequestValidationError) Field() string { return e.field }
5482
5483
// Reason function returns reason value.
5484
func (e SchemaListRequestValidationError) Reason() string { return e.reason }
5485
5486
// Cause function returns cause value.
5487
func (e SchemaListRequestValidationError) Cause() error { return e.cause }
5488
5489
// Key function returns key value.
5490
func (e SchemaListRequestValidationError) Key() bool { return e.key }
5491
5492
// ErrorName returns error name.
5493
func (e SchemaListRequestValidationError) ErrorName() string {
5494
	return "SchemaListRequestValidationError"
5495
}
5496
5497
// Error satisfies the builtin error interface
5498
func (e SchemaListRequestValidationError) Error() string {
5499
	cause := ""
5500
	if e.cause != nil {
5501
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
5502
	}
5503
5504
	key := ""
5505
	if e.key {
5506
		key = "key for "
5507
	}
5508
5509
	return fmt.Sprintf(
5510
		"invalid %sSchemaListRequest.%s: %s%s",
5511
		key,
5512
		e.field,
5513
		e.reason,
5514
		cause)
5515
}
5516
5517
var _ error = SchemaListRequestValidationError{}
5518
5519
var _ interface {
5520
	Field() string
5521
	Reason() string
5522
	Key() bool
5523
	Cause() error
5524
	ErrorName() string
5525
} = SchemaListRequestValidationError{}
5526
5527
var _SchemaListRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
5528
5529
// Validate checks the field values on SchemaListResponse with the rules
5530
// defined in the proto definition for this message. If any rules are
5531
// violated, the first error encountered is returned, or nil if there are no violations.
5532
func (m *SchemaListResponse) Validate() error {
5533
	return m.validate(false)
5534
}
5535
5536
// ValidateAll checks the field values on SchemaListResponse with the rules
5537
// defined in the proto definition for this message. If any rules are
5538
// violated, the result is a list of violation errors wrapped in
5539
// SchemaListResponseMultiError, or nil if none found.
5540
func (m *SchemaListResponse) ValidateAll() error {
5541
	return m.validate(true)
5542
}
5543
5544
func (m *SchemaListResponse) validate(all bool) error {
5545
	if m == nil {
5546
		return nil
5547
	}
5548
5549
	var errors []error
5550
5551
	// no validation rules for Head
5552
5553
	for idx, item := range m.GetSchemas() {
5554
		_, _ = idx, item
5555
5556
		if all {
5557
			switch v := interface{}(item).(type) {
5558
			case interface{ ValidateAll() error }:
5559
				if err := v.ValidateAll(); err != nil {
5560
					errors = append(errors, SchemaListResponseValidationError{
5561
						field:  fmt.Sprintf("Schemas[%v]", idx),
5562
						reason: "embedded message failed validation",
5563
						cause:  err,
5564
					})
5565
				}
5566
			case interface{ Validate() error }:
5567
				if err := v.Validate(); err != nil {
5568
					errors = append(errors, SchemaListResponseValidationError{
5569
						field:  fmt.Sprintf("Schemas[%v]", idx),
5570
						reason: "embedded message failed validation",
5571
						cause:  err,
5572
					})
5573
				}
5574
			}
5575
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
5576
			if err := v.Validate(); err != nil {
5577
				return SchemaListResponseValidationError{
5578
					field:  fmt.Sprintf("Schemas[%v]", idx),
5579
					reason: "embedded message failed validation",
5580
					cause:  err,
5581
				}
5582
			}
5583
		}
5584
5585
	}
5586
5587
	// no validation rules for ContinuousToken
5588
5589
	if len(errors) > 0 {
5590
		return SchemaListResponseMultiError(errors)
5591
	}
5592
5593
	return nil
5594
}
5595
5596
// SchemaListResponseMultiError is an error wrapping multiple validation errors
5597
// returned by SchemaListResponse.ValidateAll() if the designated constraints
5598
// aren't met.
5599
type SchemaListResponseMultiError []error
5600
5601
// Error returns a concatenation of all the error messages it wraps.
5602
func (m SchemaListResponseMultiError) Error() string {
5603
	msgs := make([]string, 0, len(m))
5604
	for _, err := range m {
5605
		msgs = append(msgs, err.Error())
5606
	}
5607
	return strings.Join(msgs, "; ")
5608
}
5609
5610
// AllErrors returns a list of validation violation errors.
5611
func (m SchemaListResponseMultiError) AllErrors() []error { return m }
5612
5613
// SchemaListResponseValidationError is the validation error returned by
5614
// SchemaListResponse.Validate if the designated constraints aren't met.
5615
type SchemaListResponseValidationError struct {
5616
	field  string
5617
	reason string
5618
	cause  error
5619
	key    bool
5620
}
5621
5622
// Field function returns field value.
5623
func (e SchemaListResponseValidationError) Field() string { return e.field }
5624
5625
// Reason function returns reason value.
5626
func (e SchemaListResponseValidationError) Reason() string { return e.reason }
5627
5628
// Cause function returns cause value.
5629
func (e SchemaListResponseValidationError) Cause() error { return e.cause }
5630
5631
// Key function returns key value.
5632
func (e SchemaListResponseValidationError) Key() bool { return e.key }
5633
5634
// ErrorName returns error name.
5635
func (e SchemaListResponseValidationError) ErrorName() string {
5636
	return "SchemaListResponseValidationError"
5637
}
5638
5639
// Error satisfies the builtin error interface
5640
func (e SchemaListResponseValidationError) Error() string {
5641
	cause := ""
5642
	if e.cause != nil {
5643
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
5644
	}
5645
5646
	key := ""
5647
	if e.key {
5648
		key = "key for "
5649
	}
5650
5651
	return fmt.Sprintf(
5652
		"invalid %sSchemaListResponse.%s: %s%s",
5653
		key,
5654
		e.field,
5655
		e.reason,
5656
		cause)
5657
}
5658
5659
var _ error = SchemaListResponseValidationError{}
5660
5661
var _ interface {
5662
	Field() string
5663
	Reason() string
5664
	Key() bool
5665
	Cause() error
5666
	ErrorName() string
5667
} = SchemaListResponseValidationError{}
5668
5669
// Validate checks the field values on SchemaList with the rules defined in the
5670
// proto definition for this message. If any rules are violated, the first
5671
// error encountered is returned, or nil if there are no violations.
5672
func (m *SchemaList) Validate() error {
5673
	return m.validate(false)
5674
}
5675
5676
// ValidateAll checks the field values on SchemaList with the rules defined in
5677
// the proto definition for this message. If any rules are violated, the
5678
// result is a list of violation errors wrapped in SchemaListMultiError, or
5679
// nil if none found.
5680
func (m *SchemaList) ValidateAll() error {
5681
	return m.validate(true)
5682
}
5683
5684
func (m *SchemaList) validate(all bool) error {
5685
	if m == nil {
5686
		return nil
5687
	}
5688
5689
	var errors []error
5690
5691
	// no validation rules for Version
5692
5693
	// no validation rules for CreatedAt
5694
5695
	if len(errors) > 0 {
5696
		return SchemaListMultiError(errors)
5697
	}
5698
5699
	return nil
5700
}
5701
5702
// SchemaListMultiError is an error wrapping multiple validation errors
5703
// returned by SchemaList.ValidateAll() if the designated constraints aren't met.
5704
type SchemaListMultiError []error
5705
5706
// Error returns a concatenation of all the error messages it wraps.
5707
func (m SchemaListMultiError) Error() string {
5708
	msgs := make([]string, 0, len(m))
5709
	for _, err := range m {
5710
		msgs = append(msgs, err.Error())
5711
	}
5712
	return strings.Join(msgs, "; ")
5713
}
5714
5715
// AllErrors returns a list of validation violation errors.
5716
func (m SchemaListMultiError) AllErrors() []error { return m }
5717
5718
// SchemaListValidationError is the validation error returned by
5719
// SchemaList.Validate if the designated constraints aren't met.
5720
type SchemaListValidationError struct {
5721
	field  string
5722
	reason string
5723
	cause  error
5724
	key    bool
5725
}
5726
5727
// Field function returns field value.
5728
func (e SchemaListValidationError) Field() string { return e.field }
5729
5730
// Reason function returns reason value.
5731
func (e SchemaListValidationError) Reason() string { return e.reason }
5732
5733
// Cause function returns cause value.
5734
func (e SchemaListValidationError) Cause() error { return e.cause }
5735
5736
// Key function returns key value.
5737
func (e SchemaListValidationError) Key() bool { return e.key }
5738
5739
// ErrorName returns error name.
5740
func (e SchemaListValidationError) ErrorName() string { return "SchemaListValidationError" }
5741
5742
// Error satisfies the builtin error interface
5743
func (e SchemaListValidationError) Error() string {
5744
	cause := ""
5745
	if e.cause != nil {
5746
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
5747
	}
5748
5749
	key := ""
5750
	if e.key {
5751
		key = "key for "
5752
	}
5753
5754
	return fmt.Sprintf(
5755
		"invalid %sSchemaList.%s: %s%s",
5756
		key,
5757
		e.field,
5758
		e.reason,
5759
		cause)
5760
}
5761
5762
var _ error = SchemaListValidationError{}
5763
5764
var _ interface {
5765
	Field() string
5766
	Reason() string
5767
	Key() bool
5768
	Cause() error
5769
	ErrorName() string
5770
} = SchemaListValidationError{}
5771
5772
// Validate checks the field values on DataWriteRequest with the rules defined
5773
// in the proto definition for this message. If any rules are violated, the
5774
// first error encountered is returned, or nil if there are no violations.
5775
func (m *DataWriteRequest) Validate() error {
5776
	return m.validate(false)
5777
}
5778
5779
// ValidateAll checks the field values on DataWriteRequest with the rules
5780
// defined in the proto definition for this message. If any rules are
5781
// violated, the result is a list of violation errors wrapped in
5782
// DataWriteRequestMultiError, or nil if none found.
5783
func (m *DataWriteRequest) ValidateAll() error {
5784
	return m.validate(true)
5785
}
5786
5787
func (m *DataWriteRequest) validate(all bool) error {
5788
	if m == nil {
5789
		return nil
5790
	}
5791
5792
	var errors []error
5793
5794
	if len(m.GetTenantId()) > 128 {
5795
		err := DataWriteRequestValidationError{
5796
			field:  "TenantId",
5797
			reason: "value length must be at most 128 bytes",
5798
		}
5799
		if !all {
5800
			return err
5801
		}
5802
		errors = append(errors, err)
5803
	}
5804
5805
	if !_DataWriteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
5806
		err := DataWriteRequestValidationError{
5807
			field:  "TenantId",
5808
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
5809
		}
5810
		if !all {
5811
			return err
5812
		}
5813
		errors = append(errors, err)
5814
	}
5815
5816
	if m.GetMetadata() == nil {
5817
		err := DataWriteRequestValidationError{
5818
			field:  "Metadata",
5819
			reason: "value is required",
5820
		}
5821
		if !all {
5822
			return err
5823
		}
5824
		errors = append(errors, err)
5825
	}
5826
5827
	if all {
5828
		switch v := interface{}(m.GetMetadata()).(type) {
5829
		case interface{ ValidateAll() error }:
5830
			if err := v.ValidateAll(); err != nil {
5831
				errors = append(errors, DataWriteRequestValidationError{
5832
					field:  "Metadata",
5833
					reason: "embedded message failed validation",
5834
					cause:  err,
5835
				})
5836
			}
5837
		case interface{ Validate() error }:
5838
			if err := v.Validate(); err != nil {
5839
				errors = append(errors, DataWriteRequestValidationError{
5840
					field:  "Metadata",
5841
					reason: "embedded message failed validation",
5842
					cause:  err,
5843
				})
5844
			}
5845
		}
5846
	} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
5847
		if err := v.Validate(); err != nil {
5848
			return DataWriteRequestValidationError{
5849
				field:  "Metadata",
5850
				reason: "embedded message failed validation",
5851
				cause:  err,
5852
			}
5853
		}
5854
	}
5855
5856
	for idx, item := range m.GetTuples() {
5857
		_, _ = idx, item
5858
5859
		if item == nil {
5860
			err := DataWriteRequestValidationError{
5861
				field:  fmt.Sprintf("Tuples[%v]", idx),
5862
				reason: "value is required",
5863
			}
5864
			if !all {
5865
				return err
5866
			}
5867
			errors = append(errors, err)
5868
		}
5869
5870
		if all {
5871
			switch v := interface{}(item).(type) {
5872
			case interface{ ValidateAll() error }:
5873
				if err := v.ValidateAll(); err != nil {
5874
					errors = append(errors, DataWriteRequestValidationError{
5875
						field:  fmt.Sprintf("Tuples[%v]", idx),
5876
						reason: "embedded message failed validation",
5877
						cause:  err,
5878
					})
5879
				}
5880
			case interface{ Validate() error }:
5881
				if err := v.Validate(); err != nil {
5882
					errors = append(errors, DataWriteRequestValidationError{
5883
						field:  fmt.Sprintf("Tuples[%v]", idx),
5884
						reason: "embedded message failed validation",
5885
						cause:  err,
5886
					})
5887
				}
5888
			}
5889
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
5890
			if err := v.Validate(); err != nil {
5891
				return DataWriteRequestValidationError{
5892
					field:  fmt.Sprintf("Tuples[%v]", idx),
5893
					reason: "embedded message failed validation",
5894
					cause:  err,
5895
				}
5896
			}
5897
		}
5898
5899
	}
5900
5901
	for idx, item := range m.GetAttributes() {
5902
		_, _ = idx, item
5903
5904
		if item == nil {
5905
			err := DataWriteRequestValidationError{
5906
				field:  fmt.Sprintf("Attributes[%v]", idx),
5907
				reason: "value is required",
5908
			}
5909
			if !all {
5910
				return err
5911
			}
5912
			errors = append(errors, err)
5913
		}
5914
5915
		if all {
5916
			switch v := interface{}(item).(type) {
5917
			case interface{ ValidateAll() error }:
5918
				if err := v.ValidateAll(); err != nil {
5919
					errors = append(errors, DataWriteRequestValidationError{
5920
						field:  fmt.Sprintf("Attributes[%v]", idx),
5921
						reason: "embedded message failed validation",
5922
						cause:  err,
5923
					})
5924
				}
5925
			case interface{ Validate() error }:
5926
				if err := v.Validate(); err != nil {
5927
					errors = append(errors, DataWriteRequestValidationError{
5928
						field:  fmt.Sprintf("Attributes[%v]", idx),
5929
						reason: "embedded message failed validation",
5930
						cause:  err,
5931
					})
5932
				}
5933
			}
5934
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
5935
			if err := v.Validate(); err != nil {
5936
				return DataWriteRequestValidationError{
5937
					field:  fmt.Sprintf("Attributes[%v]", idx),
5938
					reason: "embedded message failed validation",
5939
					cause:  err,
5940
				}
5941
			}
5942
		}
5943
5944
	}
5945
5946
	if len(errors) > 0 {
5947
		return DataWriteRequestMultiError(errors)
5948
	}
5949
5950
	return nil
5951
}
5952
5953
// DataWriteRequestMultiError is an error wrapping multiple validation errors
5954
// returned by DataWriteRequest.ValidateAll() if the designated constraints
5955
// aren't met.
5956
type DataWriteRequestMultiError []error
5957
5958
// Error returns a concatenation of all the error messages it wraps.
5959
func (m DataWriteRequestMultiError) Error() string {
5960
	msgs := make([]string, 0, len(m))
5961
	for _, err := range m {
5962
		msgs = append(msgs, err.Error())
5963
	}
5964
	return strings.Join(msgs, "; ")
5965
}
5966
5967
// AllErrors returns a list of validation violation errors.
5968
func (m DataWriteRequestMultiError) AllErrors() []error { return m }
5969
5970
// DataWriteRequestValidationError is the validation error returned by
5971
// DataWriteRequest.Validate if the designated constraints aren't met.
5972
type DataWriteRequestValidationError struct {
5973
	field  string
5974
	reason string
5975
	cause  error
5976
	key    bool
5977
}
5978
5979
// Field function returns field value.
5980
func (e DataWriteRequestValidationError) Field() string { return e.field }
5981
5982
// Reason function returns reason value.
5983
func (e DataWriteRequestValidationError) Reason() string { return e.reason }
5984
5985
// Cause function returns cause value.
5986
func (e DataWriteRequestValidationError) Cause() error { return e.cause }
5987
5988
// Key function returns key value.
5989
func (e DataWriteRequestValidationError) Key() bool { return e.key }
5990
5991
// ErrorName returns error name.
5992
func (e DataWriteRequestValidationError) ErrorName() string { return "DataWriteRequestValidationError" }
5993
5994
// Error satisfies the builtin error interface
5995
func (e DataWriteRequestValidationError) Error() string {
5996
	cause := ""
5997
	if e.cause != nil {
5998
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
5999
	}
6000
6001
	key := ""
6002
	if e.key {
6003
		key = "key for "
6004
	}
6005
6006
	return fmt.Sprintf(
6007
		"invalid %sDataWriteRequest.%s: %s%s",
6008
		key,
6009
		e.field,
6010
		e.reason,
6011
		cause)
6012
}
6013
6014
var _ error = DataWriteRequestValidationError{}
6015
6016
var _ interface {
6017
	Field() string
6018
	Reason() string
6019
	Key() bool
6020
	Cause() error
6021
	ErrorName() string
6022
} = DataWriteRequestValidationError{}
6023
6024
var _DataWriteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
6025
6026
// Validate checks the field values on DataWriteRequestMetadata with the rules
6027
// defined in the proto definition for this message. If any rules are
6028
// violated, the first error encountered is returned, or nil if there are no violations.
6029
func (m *DataWriteRequestMetadata) Validate() error {
6030
	return m.validate(false)
6031
}
6032
6033
// ValidateAll checks the field values on DataWriteRequestMetadata with the
6034
// rules defined in the proto definition for this message. If any rules are
6035
// violated, the result is a list of violation errors wrapped in
6036
// DataWriteRequestMetadataMultiError, or nil if none found.
6037
func (m *DataWriteRequestMetadata) ValidateAll() error {
6038
	return m.validate(true)
6039
}
6040
6041
func (m *DataWriteRequestMetadata) validate(all bool) error {
6042
	if m == nil {
6043
		return nil
6044
	}
6045
6046
	var errors []error
6047
6048
	// no validation rules for SchemaVersion
6049
6050
	if len(errors) > 0 {
6051
		return DataWriteRequestMetadataMultiError(errors)
6052
	}
6053
6054
	return nil
6055
}
6056
6057
// DataWriteRequestMetadataMultiError is an error wrapping multiple validation
6058
// errors returned by DataWriteRequestMetadata.ValidateAll() if the designated
6059
// constraints aren't met.
6060
type DataWriteRequestMetadataMultiError []error
6061
6062
// Error returns a concatenation of all the error messages it wraps.
6063
func (m DataWriteRequestMetadataMultiError) Error() string {
6064
	msgs := make([]string, 0, len(m))
6065
	for _, err := range m {
6066
		msgs = append(msgs, err.Error())
6067
	}
6068
	return strings.Join(msgs, "; ")
6069
}
6070
6071
// AllErrors returns a list of validation violation errors.
6072
func (m DataWriteRequestMetadataMultiError) AllErrors() []error { return m }
6073
6074
// DataWriteRequestMetadataValidationError is the validation error returned by
6075
// DataWriteRequestMetadata.Validate if the designated constraints aren't met.
6076
type DataWriteRequestMetadataValidationError struct {
6077
	field  string
6078
	reason string
6079
	cause  error
6080
	key    bool
6081
}
6082
6083
// Field function returns field value.
6084
func (e DataWriteRequestMetadataValidationError) Field() string { return e.field }
6085
6086
// Reason function returns reason value.
6087
func (e DataWriteRequestMetadataValidationError) Reason() string { return e.reason }
6088
6089
// Cause function returns cause value.
6090
func (e DataWriteRequestMetadataValidationError) Cause() error { return e.cause }
6091
6092
// Key function returns key value.
6093
func (e DataWriteRequestMetadataValidationError) Key() bool { return e.key }
6094
6095
// ErrorName returns error name.
6096
func (e DataWriteRequestMetadataValidationError) ErrorName() string {
6097
	return "DataWriteRequestMetadataValidationError"
6098
}
6099
6100
// Error satisfies the builtin error interface
6101
func (e DataWriteRequestMetadataValidationError) Error() string {
6102
	cause := ""
6103
	if e.cause != nil {
6104
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
6105
	}
6106
6107
	key := ""
6108
	if e.key {
6109
		key = "key for "
6110
	}
6111
6112
	return fmt.Sprintf(
6113
		"invalid %sDataWriteRequestMetadata.%s: %s%s",
6114
		key,
6115
		e.field,
6116
		e.reason,
6117
		cause)
6118
}
6119
6120
var _ error = DataWriteRequestMetadataValidationError{}
6121
6122
var _ interface {
6123
	Field() string
6124
	Reason() string
6125
	Key() bool
6126
	Cause() error
6127
	ErrorName() string
6128
} = DataWriteRequestMetadataValidationError{}
6129
6130
// Validate checks the field values on DataWriteResponse with the rules defined
6131
// in the proto definition for this message. If any rules are violated, the
6132
// first error encountered is returned, or nil if there are no violations.
6133
func (m *DataWriteResponse) Validate() error {
6134
	return m.validate(false)
6135
}
6136
6137
// ValidateAll checks the field values on DataWriteResponse with the rules
6138
// defined in the proto definition for this message. If any rules are
6139
// violated, the result is a list of violation errors wrapped in
6140
// DataWriteResponseMultiError, or nil if none found.
6141
func (m *DataWriteResponse) ValidateAll() error {
6142
	return m.validate(true)
6143
}
6144
6145
func (m *DataWriteResponse) validate(all bool) error {
6146
	if m == nil {
6147
		return nil
6148
	}
6149
6150
	var errors []error
6151
6152
	// no validation rules for SnapToken
6153
6154
	if len(errors) > 0 {
6155
		return DataWriteResponseMultiError(errors)
6156
	}
6157
6158
	return nil
6159
}
6160
6161
// DataWriteResponseMultiError is an error wrapping multiple validation errors
6162
// returned by DataWriteResponse.ValidateAll() if the designated constraints
6163
// aren't met.
6164
type DataWriteResponseMultiError []error
6165
6166
// Error returns a concatenation of all the error messages it wraps.
6167
func (m DataWriteResponseMultiError) Error() string {
6168
	msgs := make([]string, 0, len(m))
6169
	for _, err := range m {
6170
		msgs = append(msgs, err.Error())
6171
	}
6172
	return strings.Join(msgs, "; ")
6173
}
6174
6175
// AllErrors returns a list of validation violation errors.
6176
func (m DataWriteResponseMultiError) AllErrors() []error { return m }
6177
6178
// DataWriteResponseValidationError is the validation error returned by
6179
// DataWriteResponse.Validate if the designated constraints aren't met.
6180
type DataWriteResponseValidationError struct {
6181
	field  string
6182
	reason string
6183
	cause  error
6184
	key    bool
6185
}
6186
6187
// Field function returns field value.
6188
func (e DataWriteResponseValidationError) Field() string { return e.field }
6189
6190
// Reason function returns reason value.
6191
func (e DataWriteResponseValidationError) Reason() string { return e.reason }
6192
6193
// Cause function returns cause value.
6194
func (e DataWriteResponseValidationError) Cause() error { return e.cause }
6195
6196
// Key function returns key value.
6197
func (e DataWriteResponseValidationError) Key() bool { return e.key }
6198
6199
// ErrorName returns error name.
6200
func (e DataWriteResponseValidationError) ErrorName() string {
6201
	return "DataWriteResponseValidationError"
6202
}
6203
6204
// Error satisfies the builtin error interface
6205
func (e DataWriteResponseValidationError) Error() string {
6206
	cause := ""
6207
	if e.cause != nil {
6208
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
6209
	}
6210
6211
	key := ""
6212
	if e.key {
6213
		key = "key for "
6214
	}
6215
6216
	return fmt.Sprintf(
6217
		"invalid %sDataWriteResponse.%s: %s%s",
6218
		key,
6219
		e.field,
6220
		e.reason,
6221
		cause)
6222
}
6223
6224
var _ error = DataWriteResponseValidationError{}
6225
6226
var _ interface {
6227
	Field() string
6228
	Reason() string
6229
	Key() bool
6230
	Cause() error
6231
	ErrorName() string
6232
} = DataWriteResponseValidationError{}
6233
6234
// Validate checks the field values on RelationshipWriteRequest with the rules
6235
// defined in the proto definition for this message. If any rules are
6236
// violated, the first error encountered is returned, or nil if there are no violations.
6237
func (m *RelationshipWriteRequest) Validate() error {
6238
	return m.validate(false)
6239
}
6240
6241
// ValidateAll checks the field values on RelationshipWriteRequest with the
6242
// rules defined in the proto definition for this message. If any rules are
6243
// violated, the result is a list of violation errors wrapped in
6244
// RelationshipWriteRequestMultiError, or nil if none found.
6245
func (m *RelationshipWriteRequest) ValidateAll() error {
6246
	return m.validate(true)
6247
}
6248
6249
func (m *RelationshipWriteRequest) validate(all bool) error {
6250
	if m == nil {
6251
		return nil
6252
	}
6253
6254
	var errors []error
6255
6256
	if len(m.GetTenantId()) > 128 {
6257
		err := RelationshipWriteRequestValidationError{
6258
			field:  "TenantId",
6259
			reason: "value length must be at most 128 bytes",
6260
		}
6261
		if !all {
6262
			return err
6263
		}
6264
		errors = append(errors, err)
6265
	}
6266
6267
	if !_RelationshipWriteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
6268
		err := RelationshipWriteRequestValidationError{
6269
			field:  "TenantId",
6270
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
6271
		}
6272
		if !all {
6273
			return err
6274
		}
6275
		errors = append(errors, err)
6276
	}
6277
6278
	if m.GetMetadata() == nil {
6279
		err := RelationshipWriteRequestValidationError{
6280
			field:  "Metadata",
6281
			reason: "value is required",
6282
		}
6283
		if !all {
6284
			return err
6285
		}
6286
		errors = append(errors, err)
6287
	}
6288
6289
	if all {
6290
		switch v := interface{}(m.GetMetadata()).(type) {
6291
		case interface{ ValidateAll() error }:
6292
			if err := v.ValidateAll(); err != nil {
6293
				errors = append(errors, RelationshipWriteRequestValidationError{
6294
					field:  "Metadata",
6295
					reason: "embedded message failed validation",
6296
					cause:  err,
6297
				})
6298
			}
6299
		case interface{ Validate() error }:
6300
			if err := v.Validate(); err != nil {
6301
				errors = append(errors, RelationshipWriteRequestValidationError{
6302
					field:  "Metadata",
6303
					reason: "embedded message failed validation",
6304
					cause:  err,
6305
				})
6306
			}
6307
		}
6308
	} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
6309
		if err := v.Validate(); err != nil {
6310
			return RelationshipWriteRequestValidationError{
6311
				field:  "Metadata",
6312
				reason: "embedded message failed validation",
6313
				cause:  err,
6314
			}
6315
		}
6316
	}
6317
6318
	if len(m.GetTuples()) < 1 {
6319
		err := RelationshipWriteRequestValidationError{
6320
			field:  "Tuples",
6321
			reason: "value must contain at least 1 item(s)",
6322
		}
6323
		if !all {
6324
			return err
6325
		}
6326
		errors = append(errors, err)
6327
	}
6328
6329
	for idx, item := range m.GetTuples() {
6330
		_, _ = idx, item
6331
6332
		if item == nil {
6333
			err := RelationshipWriteRequestValidationError{
6334
				field:  fmt.Sprintf("Tuples[%v]", idx),
6335
				reason: "value is required",
6336
			}
6337
			if !all {
6338
				return err
6339
			}
6340
			errors = append(errors, err)
6341
		}
6342
6343
		if all {
6344
			switch v := interface{}(item).(type) {
6345
			case interface{ ValidateAll() error }:
6346
				if err := v.ValidateAll(); err != nil {
6347
					errors = append(errors, RelationshipWriteRequestValidationError{
6348
						field:  fmt.Sprintf("Tuples[%v]", idx),
6349
						reason: "embedded message failed validation",
6350
						cause:  err,
6351
					})
6352
				}
6353
			case interface{ Validate() error }:
6354
				if err := v.Validate(); err != nil {
6355
					errors = append(errors, RelationshipWriteRequestValidationError{
6356
						field:  fmt.Sprintf("Tuples[%v]", idx),
6357
						reason: "embedded message failed validation",
6358
						cause:  err,
6359
					})
6360
				}
6361
			}
6362
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
6363
			if err := v.Validate(); err != nil {
6364
				return RelationshipWriteRequestValidationError{
6365
					field:  fmt.Sprintf("Tuples[%v]", idx),
6366
					reason: "embedded message failed validation",
6367
					cause:  err,
6368
				}
6369
			}
6370
		}
6371
6372
	}
6373
6374
	if len(errors) > 0 {
6375
		return RelationshipWriteRequestMultiError(errors)
6376
	}
6377
6378
	return nil
6379
}
6380
6381
// RelationshipWriteRequestMultiError is an error wrapping multiple validation
6382
// errors returned by RelationshipWriteRequest.ValidateAll() if the designated
6383
// constraints aren't met.
6384
type RelationshipWriteRequestMultiError []error
6385
6386
// Error returns a concatenation of all the error messages it wraps.
6387
func (m RelationshipWriteRequestMultiError) Error() string {
6388
	msgs := make([]string, 0, len(m))
6389
	for _, err := range m {
6390
		msgs = append(msgs, err.Error())
6391
	}
6392
	return strings.Join(msgs, "; ")
6393
}
6394
6395
// AllErrors returns a list of validation violation errors.
6396
func (m RelationshipWriteRequestMultiError) AllErrors() []error { return m }
6397
6398
// RelationshipWriteRequestValidationError is the validation error returned by
6399
// RelationshipWriteRequest.Validate if the designated constraints aren't met.
6400
type RelationshipWriteRequestValidationError struct {
6401
	field  string
6402
	reason string
6403
	cause  error
6404
	key    bool
6405
}
6406
6407
// Field function returns field value.
6408
func (e RelationshipWriteRequestValidationError) Field() string { return e.field }
6409
6410
// Reason function returns reason value.
6411
func (e RelationshipWriteRequestValidationError) Reason() string { return e.reason }
6412
6413
// Cause function returns cause value.
6414
func (e RelationshipWriteRequestValidationError) Cause() error { return e.cause }
6415
6416
// Key function returns key value.
6417
func (e RelationshipWriteRequestValidationError) Key() bool { return e.key }
6418
6419
// ErrorName returns error name.
6420
func (e RelationshipWriteRequestValidationError) ErrorName() string {
6421
	return "RelationshipWriteRequestValidationError"
6422
}
6423
6424
// Error satisfies the builtin error interface
6425
func (e RelationshipWriteRequestValidationError) Error() string {
6426
	cause := ""
6427
	if e.cause != nil {
6428
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
6429
	}
6430
6431
	key := ""
6432
	if e.key {
6433
		key = "key for "
6434
	}
6435
6436
	return fmt.Sprintf(
6437
		"invalid %sRelationshipWriteRequest.%s: %s%s",
6438
		key,
6439
		e.field,
6440
		e.reason,
6441
		cause)
6442
}
6443
6444
var _ error = RelationshipWriteRequestValidationError{}
6445
6446
var _ interface {
6447
	Field() string
6448
	Reason() string
6449
	Key() bool
6450
	Cause() error
6451
	ErrorName() string
6452
} = RelationshipWriteRequestValidationError{}
6453
6454
var _RelationshipWriteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
6455
6456
// Validate checks the field values on RelationshipWriteRequestMetadata with
6457
// the rules defined in the proto definition for this message. If any rules
6458
// are violated, the first error encountered is returned, or nil if there are
6459
// no violations.
6460
func (m *RelationshipWriteRequestMetadata) Validate() error {
6461
	return m.validate(false)
6462
}
6463
6464
// ValidateAll checks the field values on RelationshipWriteRequestMetadata with
6465
// the rules defined in the proto definition for this message. If any rules
6466
// are violated, the result is a list of violation errors wrapped in
6467
// RelationshipWriteRequestMetadataMultiError, or nil if none found.
6468
func (m *RelationshipWriteRequestMetadata) ValidateAll() error {
6469
	return m.validate(true)
6470
}
6471
6472
func (m *RelationshipWriteRequestMetadata) validate(all bool) error {
6473
	if m == nil {
6474
		return nil
6475
	}
6476
6477
	var errors []error
6478
6479
	// no validation rules for SchemaVersion
6480
6481
	if len(errors) > 0 {
6482
		return RelationshipWriteRequestMetadataMultiError(errors)
6483
	}
6484
6485
	return nil
6486
}
6487
6488
// RelationshipWriteRequestMetadataMultiError is an error wrapping multiple
6489
// validation errors returned by
6490
// RelationshipWriteRequestMetadata.ValidateAll() if the designated
6491
// constraints aren't met.
6492
type RelationshipWriteRequestMetadataMultiError []error
6493
6494
// Error returns a concatenation of all the error messages it wraps.
6495
func (m RelationshipWriteRequestMetadataMultiError) Error() string {
6496
	msgs := make([]string, 0, len(m))
6497
	for _, err := range m {
6498
		msgs = append(msgs, err.Error())
6499
	}
6500
	return strings.Join(msgs, "; ")
6501
}
6502
6503
// AllErrors returns a list of validation violation errors.
6504
func (m RelationshipWriteRequestMetadataMultiError) AllErrors() []error { return m }
6505
6506
// RelationshipWriteRequestMetadataValidationError is the validation error
6507
// returned by RelationshipWriteRequestMetadata.Validate if the designated
6508
// constraints aren't met.
6509
type RelationshipWriteRequestMetadataValidationError struct {
6510
	field  string
6511
	reason string
6512
	cause  error
6513
	key    bool
6514
}
6515
6516
// Field function returns field value.
6517
func (e RelationshipWriteRequestMetadataValidationError) Field() string { return e.field }
6518
6519
// Reason function returns reason value.
6520
func (e RelationshipWriteRequestMetadataValidationError) Reason() string { return e.reason }
6521
6522
// Cause function returns cause value.
6523
func (e RelationshipWriteRequestMetadataValidationError) Cause() error { return e.cause }
6524
6525
// Key function returns key value.
6526
func (e RelationshipWriteRequestMetadataValidationError) Key() bool { return e.key }
6527
6528
// ErrorName returns error name.
6529
func (e RelationshipWriteRequestMetadataValidationError) ErrorName() string {
6530
	return "RelationshipWriteRequestMetadataValidationError"
6531
}
6532
6533
// Error satisfies the builtin error interface
6534
func (e RelationshipWriteRequestMetadataValidationError) Error() string {
6535
	cause := ""
6536
	if e.cause != nil {
6537
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
6538
	}
6539
6540
	key := ""
6541
	if e.key {
6542
		key = "key for "
6543
	}
6544
6545
	return fmt.Sprintf(
6546
		"invalid %sRelationshipWriteRequestMetadata.%s: %s%s",
6547
		key,
6548
		e.field,
6549
		e.reason,
6550
		cause)
6551
}
6552
6553
var _ error = RelationshipWriteRequestMetadataValidationError{}
6554
6555
var _ interface {
6556
	Field() string
6557
	Reason() string
6558
	Key() bool
6559
	Cause() error
6560
	ErrorName() string
6561
} = RelationshipWriteRequestMetadataValidationError{}
6562
6563
// Validate checks the field values on RelationshipWriteResponse with the rules
6564
// defined in the proto definition for this message. If any rules are
6565
// violated, the first error encountered is returned, or nil if there are no violations.
6566
func (m *RelationshipWriteResponse) Validate() error {
6567
	return m.validate(false)
6568
}
6569
6570
// ValidateAll checks the field values on RelationshipWriteResponse with the
6571
// rules defined in the proto definition for this message. If any rules are
6572
// violated, the result is a list of violation errors wrapped in
6573
// RelationshipWriteResponseMultiError, or nil if none found.
6574
func (m *RelationshipWriteResponse) ValidateAll() error {
6575
	return m.validate(true)
6576
}
6577
6578
func (m *RelationshipWriteResponse) validate(all bool) error {
6579
	if m == nil {
6580
		return nil
6581
	}
6582
6583
	var errors []error
6584
6585
	// no validation rules for SnapToken
6586
6587
	if len(errors) > 0 {
6588
		return RelationshipWriteResponseMultiError(errors)
6589
	}
6590
6591
	return nil
6592
}
6593
6594
// RelationshipWriteResponseMultiError is an error wrapping multiple validation
6595
// errors returned by RelationshipWriteResponse.ValidateAll() if the
6596
// designated constraints aren't met.
6597
type RelationshipWriteResponseMultiError []error
6598
6599
// Error returns a concatenation of all the error messages it wraps.
6600
func (m RelationshipWriteResponseMultiError) Error() string {
6601
	msgs := make([]string, 0, len(m))
6602
	for _, err := range m {
6603
		msgs = append(msgs, err.Error())
6604
	}
6605
	return strings.Join(msgs, "; ")
6606
}
6607
6608
// AllErrors returns a list of validation violation errors.
6609
func (m RelationshipWriteResponseMultiError) AllErrors() []error { return m }
6610
6611
// RelationshipWriteResponseValidationError is the validation error returned by
6612
// RelationshipWriteResponse.Validate if the designated constraints aren't met.
6613
type RelationshipWriteResponseValidationError struct {
6614
	field  string
6615
	reason string
6616
	cause  error
6617
	key    bool
6618
}
6619
6620
// Field function returns field value.
6621
func (e RelationshipWriteResponseValidationError) Field() string { return e.field }
6622
6623
// Reason function returns reason value.
6624
func (e RelationshipWriteResponseValidationError) Reason() string { return e.reason }
6625
6626
// Cause function returns cause value.
6627
func (e RelationshipWriteResponseValidationError) Cause() error { return e.cause }
6628
6629
// Key function returns key value.
6630
func (e RelationshipWriteResponseValidationError) Key() bool { return e.key }
6631
6632
// ErrorName returns error name.
6633
func (e RelationshipWriteResponseValidationError) ErrorName() string {
6634
	return "RelationshipWriteResponseValidationError"
6635
}
6636
6637
// Error satisfies the builtin error interface
6638
func (e RelationshipWriteResponseValidationError) Error() string {
6639
	cause := ""
6640
	if e.cause != nil {
6641
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
6642
	}
6643
6644
	key := ""
6645
	if e.key {
6646
		key = "key for "
6647
	}
6648
6649
	return fmt.Sprintf(
6650
		"invalid %sRelationshipWriteResponse.%s: %s%s",
6651
		key,
6652
		e.field,
6653
		e.reason,
6654
		cause)
6655
}
6656
6657
var _ error = RelationshipWriteResponseValidationError{}
6658
6659
var _ interface {
6660
	Field() string
6661
	Reason() string
6662
	Key() bool
6663
	Cause() error
6664
	ErrorName() string
6665
} = RelationshipWriteResponseValidationError{}
6666
6667
// Validate checks the field values on RelationshipReadRequest with the rules
6668
// defined in the proto definition for this message. If any rules are
6669
// violated, the first error encountered is returned, or nil if there are no violations.
6670
func (m *RelationshipReadRequest) Validate() error {
6671
	return m.validate(false)
6672
}
6673
6674
// ValidateAll checks the field values on RelationshipReadRequest with the
6675
// rules defined in the proto definition for this message. If any rules are
6676
// violated, the result is a list of violation errors wrapped in
6677
// RelationshipReadRequestMultiError, or nil if none found.
6678
func (m *RelationshipReadRequest) ValidateAll() error {
6679
	return m.validate(true)
6680
}
6681
6682
func (m *RelationshipReadRequest) validate(all bool) error {
6683
	if m == nil {
6684
		return nil
6685
	}
6686
6687
	var errors []error
6688
6689
	if len(m.GetTenantId()) > 128 {
6690
		err := RelationshipReadRequestValidationError{
6691
			field:  "TenantId",
6692
			reason: "value length must be at most 128 bytes",
6693
		}
6694
		if !all {
6695
			return err
6696
		}
6697
		errors = append(errors, err)
6698
	}
6699
6700
	if !_RelationshipReadRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
6701
		err := RelationshipReadRequestValidationError{
6702
			field:  "TenantId",
6703
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
6704
		}
6705
		if !all {
6706
			return err
6707
		}
6708
		errors = append(errors, err)
6709
	}
6710
6711
	if m.GetMetadata() == nil {
6712
		err := RelationshipReadRequestValidationError{
6713
			field:  "Metadata",
6714
			reason: "value is required",
6715
		}
6716
		if !all {
6717
			return err
6718
		}
6719
		errors = append(errors, err)
6720
	}
6721
6722
	if all {
6723
		switch v := interface{}(m.GetMetadata()).(type) {
6724
		case interface{ ValidateAll() error }:
6725
			if err := v.ValidateAll(); err != nil {
6726
				errors = append(errors, RelationshipReadRequestValidationError{
6727
					field:  "Metadata",
6728
					reason: "embedded message failed validation",
6729
					cause:  err,
6730
				})
6731
			}
6732
		case interface{ Validate() error }:
6733
			if err := v.Validate(); err != nil {
6734
				errors = append(errors, RelationshipReadRequestValidationError{
6735
					field:  "Metadata",
6736
					reason: "embedded message failed validation",
6737
					cause:  err,
6738
				})
6739
			}
6740
		}
6741
	} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
6742
		if err := v.Validate(); err != nil {
6743
			return RelationshipReadRequestValidationError{
6744
				field:  "Metadata",
6745
				reason: "embedded message failed validation",
6746
				cause:  err,
6747
			}
6748
		}
6749
	}
6750
6751
	if m.GetFilter() == nil {
6752
		err := RelationshipReadRequestValidationError{
6753
			field:  "Filter",
6754
			reason: "value is required",
6755
		}
6756
		if !all {
6757
			return err
6758
		}
6759
		errors = append(errors, err)
6760
	}
6761
6762
	if all {
6763
		switch v := interface{}(m.GetFilter()).(type) {
6764
		case interface{ ValidateAll() error }:
6765
			if err := v.ValidateAll(); err != nil {
6766
				errors = append(errors, RelationshipReadRequestValidationError{
6767
					field:  "Filter",
6768
					reason: "embedded message failed validation",
6769
					cause:  err,
6770
				})
6771
			}
6772
		case interface{ Validate() error }:
6773
			if err := v.Validate(); err != nil {
6774
				errors = append(errors, RelationshipReadRequestValidationError{
6775
					field:  "Filter",
6776
					reason: "embedded message failed validation",
6777
					cause:  err,
6778
				})
6779
			}
6780
		}
6781
	} else if v, ok := interface{}(m.GetFilter()).(interface{ Validate() error }); ok {
6782
		if err := v.Validate(); err != nil {
6783
			return RelationshipReadRequestValidationError{
6784
				field:  "Filter",
6785
				reason: "embedded message failed validation",
6786
				cause:  err,
6787
			}
6788
		}
6789
	}
6790
6791
	if m.GetPageSize() != 0 {
6792
6793
		if m.GetPageSize() < 1 {
6794
			err := RelationshipReadRequestValidationError{
6795
				field:  "PageSize",
6796
				reason: "value must be greater than or equal to 1",
6797
			}
6798
			if !all {
6799
				return err
6800
			}
6801
			errors = append(errors, err)
6802
		}
6803
6804
	}
6805
6806
	if m.GetContinuousToken() != "" {
6807
6808
	}
6809
6810
	if len(errors) > 0 {
6811
		return RelationshipReadRequestMultiError(errors)
6812
	}
6813
6814
	return nil
6815
}
6816
6817
// RelationshipReadRequestMultiError is an error wrapping multiple validation
6818
// errors returned by RelationshipReadRequest.ValidateAll() if the designated
6819
// constraints aren't met.
6820
type RelationshipReadRequestMultiError []error
6821
6822
// Error returns a concatenation of all the error messages it wraps.
6823
func (m RelationshipReadRequestMultiError) Error() string {
6824
	msgs := make([]string, 0, len(m))
6825
	for _, err := range m {
6826
		msgs = append(msgs, err.Error())
6827
	}
6828
	return strings.Join(msgs, "; ")
6829
}
6830
6831
// AllErrors returns a list of validation violation errors.
6832
func (m RelationshipReadRequestMultiError) AllErrors() []error { return m }
6833
6834
// RelationshipReadRequestValidationError is the validation error returned by
6835
// RelationshipReadRequest.Validate if the designated constraints aren't met.
6836
type RelationshipReadRequestValidationError struct {
6837
	field  string
6838
	reason string
6839
	cause  error
6840
	key    bool
6841
}
6842
6843
// Field function returns field value.
6844
func (e RelationshipReadRequestValidationError) Field() string { return e.field }
6845
6846
// Reason function returns reason value.
6847
func (e RelationshipReadRequestValidationError) Reason() string { return e.reason }
6848
6849
// Cause function returns cause value.
6850
func (e RelationshipReadRequestValidationError) Cause() error { return e.cause }
6851
6852
// Key function returns key value.
6853
func (e RelationshipReadRequestValidationError) Key() bool { return e.key }
6854
6855
// ErrorName returns error name.
6856
func (e RelationshipReadRequestValidationError) ErrorName() string {
6857
	return "RelationshipReadRequestValidationError"
6858
}
6859
6860
// Error satisfies the builtin error interface
6861
func (e RelationshipReadRequestValidationError) Error() string {
6862
	cause := ""
6863
	if e.cause != nil {
6864
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
6865
	}
6866
6867
	key := ""
6868
	if e.key {
6869
		key = "key for "
6870
	}
6871
6872
	return fmt.Sprintf(
6873
		"invalid %sRelationshipReadRequest.%s: %s%s",
6874
		key,
6875
		e.field,
6876
		e.reason,
6877
		cause)
6878
}
6879
6880
var _ error = RelationshipReadRequestValidationError{}
6881
6882
var _ interface {
6883
	Field() string
6884
	Reason() string
6885
	Key() bool
6886
	Cause() error
6887
	ErrorName() string
6888
} = RelationshipReadRequestValidationError{}
6889
6890
var _RelationshipReadRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
6891
6892
// Validate checks the field values on RelationshipReadRequestMetadata with the
6893
// rules defined in the proto definition for this message. If any rules are
6894
// violated, the first error encountered is returned, or nil if there are no violations.
6895
func (m *RelationshipReadRequestMetadata) Validate() error {
6896
	return m.validate(false)
6897
}
6898
6899
// ValidateAll checks the field values on RelationshipReadRequestMetadata with
6900
// the rules defined in the proto definition for this message. If any rules
6901
// are violated, the result is a list of violation errors wrapped in
6902
// RelationshipReadRequestMetadataMultiError, or nil if none found.
6903
func (m *RelationshipReadRequestMetadata) ValidateAll() error {
6904
	return m.validate(true)
6905
}
6906
6907
func (m *RelationshipReadRequestMetadata) validate(all bool) error {
6908
	if m == nil {
6909
		return nil
6910
	}
6911
6912
	var errors []error
6913
6914
	// no validation rules for SnapToken
6915
6916
	if len(errors) > 0 {
6917
		return RelationshipReadRequestMetadataMultiError(errors)
6918
	}
6919
6920
	return nil
6921
}
6922
6923
// RelationshipReadRequestMetadataMultiError is an error wrapping multiple
6924
// validation errors returned by RelationshipReadRequestMetadata.ValidateAll()
6925
// if the designated constraints aren't met.
6926
type RelationshipReadRequestMetadataMultiError []error
6927
6928
// Error returns a concatenation of all the error messages it wraps.
6929
func (m RelationshipReadRequestMetadataMultiError) Error() string {
6930
	msgs := make([]string, 0, len(m))
6931
	for _, err := range m {
6932
		msgs = append(msgs, err.Error())
6933
	}
6934
	return strings.Join(msgs, "; ")
6935
}
6936
6937
// AllErrors returns a list of validation violation errors.
6938
func (m RelationshipReadRequestMetadataMultiError) AllErrors() []error { return m }
6939
6940
// RelationshipReadRequestMetadataValidationError is the validation error
6941
// returned by RelationshipReadRequestMetadata.Validate if the designated
6942
// constraints aren't met.
6943
type RelationshipReadRequestMetadataValidationError struct {
6944
	field  string
6945
	reason string
6946
	cause  error
6947
	key    bool
6948
}
6949
6950
// Field function returns field value.
6951
func (e RelationshipReadRequestMetadataValidationError) Field() string { return e.field }
6952
6953
// Reason function returns reason value.
6954
func (e RelationshipReadRequestMetadataValidationError) Reason() string { return e.reason }
6955
6956
// Cause function returns cause value.
6957
func (e RelationshipReadRequestMetadataValidationError) Cause() error { return e.cause }
6958
6959
// Key function returns key value.
6960
func (e RelationshipReadRequestMetadataValidationError) Key() bool { return e.key }
6961
6962
// ErrorName returns error name.
6963
func (e RelationshipReadRequestMetadataValidationError) ErrorName() string {
6964
	return "RelationshipReadRequestMetadataValidationError"
6965
}
6966
6967
// Error satisfies the builtin error interface
6968
func (e RelationshipReadRequestMetadataValidationError) Error() string {
6969
	cause := ""
6970
	if e.cause != nil {
6971
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
6972
	}
6973
6974
	key := ""
6975
	if e.key {
6976
		key = "key for "
6977
	}
6978
6979
	return fmt.Sprintf(
6980
		"invalid %sRelationshipReadRequestMetadata.%s: %s%s",
6981
		key,
6982
		e.field,
6983
		e.reason,
6984
		cause)
6985
}
6986
6987
var _ error = RelationshipReadRequestMetadataValidationError{}
6988
6989
var _ interface {
6990
	Field() string
6991
	Reason() string
6992
	Key() bool
6993
	Cause() error
6994
	ErrorName() string
6995
} = RelationshipReadRequestMetadataValidationError{}
6996
6997
// Validate checks the field values on RelationshipReadResponse with the rules
6998
// defined in the proto definition for this message. If any rules are
6999
// violated, the first error encountered is returned, or nil if there are no violations.
7000
func (m *RelationshipReadResponse) Validate() error {
7001
	return m.validate(false)
7002
}
7003
7004
// ValidateAll checks the field values on RelationshipReadResponse with the
7005
// rules defined in the proto definition for this message. If any rules are
7006
// violated, the result is a list of violation errors wrapped in
7007
// RelationshipReadResponseMultiError, or nil if none found.
7008
func (m *RelationshipReadResponse) ValidateAll() error {
7009
	return m.validate(true)
7010
}
7011
7012
func (m *RelationshipReadResponse) validate(all bool) error {
7013
	if m == nil {
7014
		return nil
7015
	}
7016
7017
	var errors []error
7018
7019
	for idx, item := range m.GetTuples() {
7020
		_, _ = idx, item
7021
7022
		if all {
7023
			switch v := interface{}(item).(type) {
7024
			case interface{ ValidateAll() error }:
7025
				if err := v.ValidateAll(); err != nil {
7026
					errors = append(errors, RelationshipReadResponseValidationError{
7027
						field:  fmt.Sprintf("Tuples[%v]", idx),
7028
						reason: "embedded message failed validation",
7029
						cause:  err,
7030
					})
7031
				}
7032
			case interface{ Validate() error }:
7033
				if err := v.Validate(); err != nil {
7034
					errors = append(errors, RelationshipReadResponseValidationError{
7035
						field:  fmt.Sprintf("Tuples[%v]", idx),
7036
						reason: "embedded message failed validation",
7037
						cause:  err,
7038
					})
7039
				}
7040
			}
7041
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
7042
			if err := v.Validate(); err != nil {
7043
				return RelationshipReadResponseValidationError{
7044
					field:  fmt.Sprintf("Tuples[%v]", idx),
7045
					reason: "embedded message failed validation",
7046
					cause:  err,
7047
				}
7048
			}
7049
		}
7050
7051
	}
7052
7053
	// no validation rules for ContinuousToken
7054
7055
	if len(errors) > 0 {
7056
		return RelationshipReadResponseMultiError(errors)
7057
	}
7058
7059
	return nil
7060
}
7061
7062
// RelationshipReadResponseMultiError is an error wrapping multiple validation
7063
// errors returned by RelationshipReadResponse.ValidateAll() if the designated
7064
// constraints aren't met.
7065
type RelationshipReadResponseMultiError []error
7066
7067
// Error returns a concatenation of all the error messages it wraps.
7068
func (m RelationshipReadResponseMultiError) Error() string {
7069
	msgs := make([]string, 0, len(m))
7070
	for _, err := range m {
7071
		msgs = append(msgs, err.Error())
7072
	}
7073
	return strings.Join(msgs, "; ")
7074
}
7075
7076
// AllErrors returns a list of validation violation errors.
7077
func (m RelationshipReadResponseMultiError) AllErrors() []error { return m }
7078
7079
// RelationshipReadResponseValidationError is the validation error returned by
7080
// RelationshipReadResponse.Validate if the designated constraints aren't met.
7081
type RelationshipReadResponseValidationError struct {
7082
	field  string
7083
	reason string
7084
	cause  error
7085
	key    bool
7086
}
7087
7088
// Field function returns field value.
7089
func (e RelationshipReadResponseValidationError) Field() string { return e.field }
7090
7091
// Reason function returns reason value.
7092
func (e RelationshipReadResponseValidationError) Reason() string { return e.reason }
7093
7094
// Cause function returns cause value.
7095
func (e RelationshipReadResponseValidationError) Cause() error { return e.cause }
7096
7097
// Key function returns key value.
7098
func (e RelationshipReadResponseValidationError) Key() bool { return e.key }
7099
7100
// ErrorName returns error name.
7101
func (e RelationshipReadResponseValidationError) ErrorName() string {
7102
	return "RelationshipReadResponseValidationError"
7103
}
7104
7105
// Error satisfies the builtin error interface
7106
func (e RelationshipReadResponseValidationError) Error() string {
7107
	cause := ""
7108
	if e.cause != nil {
7109
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
7110
	}
7111
7112
	key := ""
7113
	if e.key {
7114
		key = "key for "
7115
	}
7116
7117
	return fmt.Sprintf(
7118
		"invalid %sRelationshipReadResponse.%s: %s%s",
7119
		key,
7120
		e.field,
7121
		e.reason,
7122
		cause)
7123
}
7124
7125
var _ error = RelationshipReadResponseValidationError{}
7126
7127
var _ interface {
7128
	Field() string
7129
	Reason() string
7130
	Key() bool
7131
	Cause() error
7132
	ErrorName() string
7133
} = RelationshipReadResponseValidationError{}
7134
7135
// Validate checks the field values on AttributeReadRequest with the rules
7136
// defined in the proto definition for this message. If any rules are
7137
// violated, the first error encountered is returned, or nil if there are no violations.
7138
func (m *AttributeReadRequest) Validate() error {
7139
	return m.validate(false)
7140
}
7141
7142
// ValidateAll checks the field values on AttributeReadRequest with the rules
7143
// defined in the proto definition for this message. If any rules are
7144
// violated, the result is a list of violation errors wrapped in
7145
// AttributeReadRequestMultiError, or nil if none found.
7146
func (m *AttributeReadRequest) ValidateAll() error {
7147
	return m.validate(true)
7148
}
7149
7150
func (m *AttributeReadRequest) validate(all bool) error {
7151
	if m == nil {
7152
		return nil
7153
	}
7154
7155
	var errors []error
7156
7157
	if len(m.GetTenantId()) > 128 {
7158
		err := AttributeReadRequestValidationError{
7159
			field:  "TenantId",
7160
			reason: "value length must be at most 128 bytes",
7161
		}
7162
		if !all {
7163
			return err
7164
		}
7165
		errors = append(errors, err)
7166
	}
7167
7168
	if !_AttributeReadRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
7169
		err := AttributeReadRequestValidationError{
7170
			field:  "TenantId",
7171
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
7172
		}
7173
		if !all {
7174
			return err
7175
		}
7176
		errors = append(errors, err)
7177
	}
7178
7179
	if m.GetMetadata() == nil {
7180
		err := AttributeReadRequestValidationError{
7181
			field:  "Metadata",
7182
			reason: "value is required",
7183
		}
7184
		if !all {
7185
			return err
7186
		}
7187
		errors = append(errors, err)
7188
	}
7189
7190
	if all {
7191
		switch v := interface{}(m.GetMetadata()).(type) {
7192
		case interface{ ValidateAll() error }:
7193
			if err := v.ValidateAll(); err != nil {
7194
				errors = append(errors, AttributeReadRequestValidationError{
7195
					field:  "Metadata",
7196
					reason: "embedded message failed validation",
7197
					cause:  err,
7198
				})
7199
			}
7200
		case interface{ Validate() error }:
7201
			if err := v.Validate(); err != nil {
7202
				errors = append(errors, AttributeReadRequestValidationError{
7203
					field:  "Metadata",
7204
					reason: "embedded message failed validation",
7205
					cause:  err,
7206
				})
7207
			}
7208
		}
7209
	} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
7210
		if err := v.Validate(); err != nil {
7211
			return AttributeReadRequestValidationError{
7212
				field:  "Metadata",
7213
				reason: "embedded message failed validation",
7214
				cause:  err,
7215
			}
7216
		}
7217
	}
7218
7219
	if m.GetFilter() == nil {
7220
		err := AttributeReadRequestValidationError{
7221
			field:  "Filter",
7222
			reason: "value is required",
7223
		}
7224
		if !all {
7225
			return err
7226
		}
7227
		errors = append(errors, err)
7228
	}
7229
7230
	if all {
7231
		switch v := interface{}(m.GetFilter()).(type) {
7232
		case interface{ ValidateAll() error }:
7233
			if err := v.ValidateAll(); err != nil {
7234
				errors = append(errors, AttributeReadRequestValidationError{
7235
					field:  "Filter",
7236
					reason: "embedded message failed validation",
7237
					cause:  err,
7238
				})
7239
			}
7240
		case interface{ Validate() error }:
7241
			if err := v.Validate(); err != nil {
7242
				errors = append(errors, AttributeReadRequestValidationError{
7243
					field:  "Filter",
7244
					reason: "embedded message failed validation",
7245
					cause:  err,
7246
				})
7247
			}
7248
		}
7249
	} else if v, ok := interface{}(m.GetFilter()).(interface{ Validate() error }); ok {
7250
		if err := v.Validate(); err != nil {
7251
			return AttributeReadRequestValidationError{
7252
				field:  "Filter",
7253
				reason: "embedded message failed validation",
7254
				cause:  err,
7255
			}
7256
		}
7257
	}
7258
7259
	if m.GetPageSize() != 0 {
7260
7261
		if m.GetPageSize() < 1 {
7262
			err := AttributeReadRequestValidationError{
7263
				field:  "PageSize",
7264
				reason: "value must be greater than or equal to 1",
7265
			}
7266
			if !all {
7267
				return err
7268
			}
7269
			errors = append(errors, err)
7270
		}
7271
7272
	}
7273
7274
	if m.GetContinuousToken() != "" {
7275
7276
	}
7277
7278
	if len(errors) > 0 {
7279
		return AttributeReadRequestMultiError(errors)
7280
	}
7281
7282
	return nil
7283
}
7284
7285
// AttributeReadRequestMultiError is an error wrapping multiple validation
7286
// errors returned by AttributeReadRequest.ValidateAll() if the designated
7287
// constraints aren't met.
7288
type AttributeReadRequestMultiError []error
7289
7290
// Error returns a concatenation of all the error messages it wraps.
7291
func (m AttributeReadRequestMultiError) Error() string {
7292
	msgs := make([]string, 0, len(m))
7293
	for _, err := range m {
7294
		msgs = append(msgs, err.Error())
7295
	}
7296
	return strings.Join(msgs, "; ")
7297
}
7298
7299
// AllErrors returns a list of validation violation errors.
7300
func (m AttributeReadRequestMultiError) AllErrors() []error { return m }
7301
7302
// AttributeReadRequestValidationError is the validation error returned by
7303
// AttributeReadRequest.Validate if the designated constraints aren't met.
7304
type AttributeReadRequestValidationError struct {
7305
	field  string
7306
	reason string
7307
	cause  error
7308
	key    bool
7309
}
7310
7311
// Field function returns field value.
7312
func (e AttributeReadRequestValidationError) Field() string { return e.field }
7313
7314
// Reason function returns reason value.
7315
func (e AttributeReadRequestValidationError) Reason() string { return e.reason }
7316
7317
// Cause function returns cause value.
7318
func (e AttributeReadRequestValidationError) Cause() error { return e.cause }
7319
7320
// Key function returns key value.
7321
func (e AttributeReadRequestValidationError) Key() bool { return e.key }
7322
7323
// ErrorName returns error name.
7324
func (e AttributeReadRequestValidationError) ErrorName() string {
7325
	return "AttributeReadRequestValidationError"
7326
}
7327
7328
// Error satisfies the builtin error interface
7329
func (e AttributeReadRequestValidationError) Error() string {
7330
	cause := ""
7331
	if e.cause != nil {
7332
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
7333
	}
7334
7335
	key := ""
7336
	if e.key {
7337
		key = "key for "
7338
	}
7339
7340
	return fmt.Sprintf(
7341
		"invalid %sAttributeReadRequest.%s: %s%s",
7342
		key,
7343
		e.field,
7344
		e.reason,
7345
		cause)
7346
}
7347
7348
var _ error = AttributeReadRequestValidationError{}
7349
7350
var _ interface {
7351
	Field() string
7352
	Reason() string
7353
	Key() bool
7354
	Cause() error
7355
	ErrorName() string
7356
} = AttributeReadRequestValidationError{}
7357
7358
var _AttributeReadRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
7359
7360
// Validate checks the field values on AttributeReadRequestMetadata with the
7361
// rules defined in the proto definition for this message. If any rules are
7362
// violated, the first error encountered is returned, or nil if there are no violations.
7363
func (m *AttributeReadRequestMetadata) Validate() error {
7364
	return m.validate(false)
7365
}
7366
7367
// ValidateAll checks the field values on AttributeReadRequestMetadata with the
7368
// rules defined in the proto definition for this message. If any rules are
7369
// violated, the result is a list of violation errors wrapped in
7370
// AttributeReadRequestMetadataMultiError, or nil if none found.
7371
func (m *AttributeReadRequestMetadata) ValidateAll() error {
7372
	return m.validate(true)
7373
}
7374
7375
func (m *AttributeReadRequestMetadata) validate(all bool) error {
7376
	if m == nil {
7377
		return nil
7378
	}
7379
7380
	var errors []error
7381
7382
	// no validation rules for SnapToken
7383
7384
	if len(errors) > 0 {
7385
		return AttributeReadRequestMetadataMultiError(errors)
7386
	}
7387
7388
	return nil
7389
}
7390
7391
// AttributeReadRequestMetadataMultiError is an error wrapping multiple
7392
// validation errors returned by AttributeReadRequestMetadata.ValidateAll() if
7393
// the designated constraints aren't met.
7394
type AttributeReadRequestMetadataMultiError []error
7395
7396
// Error returns a concatenation of all the error messages it wraps.
7397
func (m AttributeReadRequestMetadataMultiError) Error() string {
7398
	msgs := make([]string, 0, len(m))
7399
	for _, err := range m {
7400
		msgs = append(msgs, err.Error())
7401
	}
7402
	return strings.Join(msgs, "; ")
7403
}
7404
7405
// AllErrors returns a list of validation violation errors.
7406
func (m AttributeReadRequestMetadataMultiError) AllErrors() []error { return m }
7407
7408
// AttributeReadRequestMetadataValidationError is the validation error returned
7409
// by AttributeReadRequestMetadata.Validate if the designated constraints
7410
// aren't met.
7411
type AttributeReadRequestMetadataValidationError struct {
7412
	field  string
7413
	reason string
7414
	cause  error
7415
	key    bool
7416
}
7417
7418
// Field function returns field value.
7419
func (e AttributeReadRequestMetadataValidationError) Field() string { return e.field }
7420
7421
// Reason function returns reason value.
7422
func (e AttributeReadRequestMetadataValidationError) Reason() string { return e.reason }
7423
7424
// Cause function returns cause value.
7425
func (e AttributeReadRequestMetadataValidationError) Cause() error { return e.cause }
7426
7427
// Key function returns key value.
7428
func (e AttributeReadRequestMetadataValidationError) Key() bool { return e.key }
7429
7430
// ErrorName returns error name.
7431
func (e AttributeReadRequestMetadataValidationError) ErrorName() string {
7432
	return "AttributeReadRequestMetadataValidationError"
7433
}
7434
7435
// Error satisfies the builtin error interface
7436
func (e AttributeReadRequestMetadataValidationError) Error() string {
7437
	cause := ""
7438
	if e.cause != nil {
7439
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
7440
	}
7441
7442
	key := ""
7443
	if e.key {
7444
		key = "key for "
7445
	}
7446
7447
	return fmt.Sprintf(
7448
		"invalid %sAttributeReadRequestMetadata.%s: %s%s",
7449
		key,
7450
		e.field,
7451
		e.reason,
7452
		cause)
7453
}
7454
7455
var _ error = AttributeReadRequestMetadataValidationError{}
7456
7457
var _ interface {
7458
	Field() string
7459
	Reason() string
7460
	Key() bool
7461
	Cause() error
7462
	ErrorName() string
7463
} = AttributeReadRequestMetadataValidationError{}
7464
7465
// Validate checks the field values on AttributeReadResponse with the rules
7466
// defined in the proto definition for this message. If any rules are
7467
// violated, the first error encountered is returned, or nil if there are no violations.
7468
func (m *AttributeReadResponse) Validate() error {
7469
	return m.validate(false)
7470
}
7471
7472
// ValidateAll checks the field values on AttributeReadResponse with the rules
7473
// defined in the proto definition for this message. If any rules are
7474
// violated, the result is a list of violation errors wrapped in
7475
// AttributeReadResponseMultiError, or nil if none found.
7476
func (m *AttributeReadResponse) ValidateAll() error {
7477
	return m.validate(true)
7478
}
7479
7480
func (m *AttributeReadResponse) validate(all bool) error {
7481
	if m == nil {
7482
		return nil
7483
	}
7484
7485
	var errors []error
7486
7487
	for idx, item := range m.GetAttributes() {
7488
		_, _ = idx, item
7489
7490
		if all {
7491
			switch v := interface{}(item).(type) {
7492
			case interface{ ValidateAll() error }:
7493
				if err := v.ValidateAll(); err != nil {
7494
					errors = append(errors, AttributeReadResponseValidationError{
7495
						field:  fmt.Sprintf("Attributes[%v]", idx),
7496
						reason: "embedded message failed validation",
7497
						cause:  err,
7498
					})
7499
				}
7500
			case interface{ Validate() error }:
7501
				if err := v.Validate(); err != nil {
7502
					errors = append(errors, AttributeReadResponseValidationError{
7503
						field:  fmt.Sprintf("Attributes[%v]", idx),
7504
						reason: "embedded message failed validation",
7505
						cause:  err,
7506
					})
7507
				}
7508
			}
7509
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
7510
			if err := v.Validate(); err != nil {
7511
				return AttributeReadResponseValidationError{
7512
					field:  fmt.Sprintf("Attributes[%v]", idx),
7513
					reason: "embedded message failed validation",
7514
					cause:  err,
7515
				}
7516
			}
7517
		}
7518
7519
	}
7520
7521
	// no validation rules for ContinuousToken
7522
7523
	if len(errors) > 0 {
7524
		return AttributeReadResponseMultiError(errors)
7525
	}
7526
7527
	return nil
7528
}
7529
7530
// AttributeReadResponseMultiError is an error wrapping multiple validation
7531
// errors returned by AttributeReadResponse.ValidateAll() if the designated
7532
// constraints aren't met.
7533
type AttributeReadResponseMultiError []error
7534
7535
// Error returns a concatenation of all the error messages it wraps.
7536
func (m AttributeReadResponseMultiError) Error() string {
7537
	msgs := make([]string, 0, len(m))
7538
	for _, err := range m {
7539
		msgs = append(msgs, err.Error())
7540
	}
7541
	return strings.Join(msgs, "; ")
7542
}
7543
7544
// AllErrors returns a list of validation violation errors.
7545
func (m AttributeReadResponseMultiError) AllErrors() []error { return m }
7546
7547
// AttributeReadResponseValidationError is the validation error returned by
7548
// AttributeReadResponse.Validate if the designated constraints aren't met.
7549
type AttributeReadResponseValidationError struct {
7550
	field  string
7551
	reason string
7552
	cause  error
7553
	key    bool
7554
}
7555
7556
// Field function returns field value.
7557
func (e AttributeReadResponseValidationError) Field() string { return e.field }
7558
7559
// Reason function returns reason value.
7560
func (e AttributeReadResponseValidationError) Reason() string { return e.reason }
7561
7562
// Cause function returns cause value.
7563
func (e AttributeReadResponseValidationError) Cause() error { return e.cause }
7564
7565
// Key function returns key value.
7566
func (e AttributeReadResponseValidationError) Key() bool { return e.key }
7567
7568
// ErrorName returns error name.
7569
func (e AttributeReadResponseValidationError) ErrorName() string {
7570
	return "AttributeReadResponseValidationError"
7571
}
7572
7573
// Error satisfies the builtin error interface
7574
func (e AttributeReadResponseValidationError) Error() string {
7575
	cause := ""
7576
	if e.cause != nil {
7577
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
7578
	}
7579
7580
	key := ""
7581
	if e.key {
7582
		key = "key for "
7583
	}
7584
7585
	return fmt.Sprintf(
7586
		"invalid %sAttributeReadResponse.%s: %s%s",
7587
		key,
7588
		e.field,
7589
		e.reason,
7590
		cause)
7591
}
7592
7593
var _ error = AttributeReadResponseValidationError{}
7594
7595
var _ interface {
7596
	Field() string
7597
	Reason() string
7598
	Key() bool
7599
	Cause() error
7600
	ErrorName() string
7601
} = AttributeReadResponseValidationError{}
7602
7603
// Validate checks the field values on DataDeleteRequest with the rules defined
7604
// in the proto definition for this message. If any rules are violated, the
7605
// first error encountered is returned, or nil if there are no violations.
7606
func (m *DataDeleteRequest) Validate() error {
7607
	return m.validate(false)
7608
}
7609
7610
// ValidateAll checks the field values on DataDeleteRequest with the rules
7611
// defined in the proto definition for this message. If any rules are
7612
// violated, the result is a list of violation errors wrapped in
7613
// DataDeleteRequestMultiError, or nil if none found.
7614
func (m *DataDeleteRequest) ValidateAll() error {
7615
	return m.validate(true)
7616
}
7617
7618
func (m *DataDeleteRequest) validate(all bool) error {
7619
	if m == nil {
7620
		return nil
7621
	}
7622
7623
	var errors []error
7624
7625
	if len(m.GetTenantId()) > 128 {
7626
		err := DataDeleteRequestValidationError{
7627
			field:  "TenantId",
7628
			reason: "value length must be at most 128 bytes",
7629
		}
7630
		if !all {
7631
			return err
7632
		}
7633
		errors = append(errors, err)
7634
	}
7635
7636
	if !_DataDeleteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
7637
		err := DataDeleteRequestValidationError{
7638
			field:  "TenantId",
7639
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
7640
		}
7641
		if !all {
7642
			return err
7643
		}
7644
		errors = append(errors, err)
7645
	}
7646
7647
	if m.GetTupleFilter() == nil {
7648
		err := DataDeleteRequestValidationError{
7649
			field:  "TupleFilter",
7650
			reason: "value is required",
7651
		}
7652
		if !all {
7653
			return err
7654
		}
7655
		errors = append(errors, err)
7656
	}
7657
7658
	if all {
7659
		switch v := interface{}(m.GetTupleFilter()).(type) {
7660
		case interface{ ValidateAll() error }:
7661
			if err := v.ValidateAll(); err != nil {
7662
				errors = append(errors, DataDeleteRequestValidationError{
7663
					field:  "TupleFilter",
7664
					reason: "embedded message failed validation",
7665
					cause:  err,
7666
				})
7667
			}
7668
		case interface{ Validate() error }:
7669
			if err := v.Validate(); err != nil {
7670
				errors = append(errors, DataDeleteRequestValidationError{
7671
					field:  "TupleFilter",
7672
					reason: "embedded message failed validation",
7673
					cause:  err,
7674
				})
7675
			}
7676
		}
7677
	} else if v, ok := interface{}(m.GetTupleFilter()).(interface{ Validate() error }); ok {
7678
		if err := v.Validate(); err != nil {
7679
			return DataDeleteRequestValidationError{
7680
				field:  "TupleFilter",
7681
				reason: "embedded message failed validation",
7682
				cause:  err,
7683
			}
7684
		}
7685
	}
7686
7687
	if m.GetAttributeFilter() == nil {
7688
		err := DataDeleteRequestValidationError{
7689
			field:  "AttributeFilter",
7690
			reason: "value is required",
7691
		}
7692
		if !all {
7693
			return err
7694
		}
7695
		errors = append(errors, err)
7696
	}
7697
7698
	if all {
7699
		switch v := interface{}(m.GetAttributeFilter()).(type) {
7700
		case interface{ ValidateAll() error }:
7701
			if err := v.ValidateAll(); err != nil {
7702
				errors = append(errors, DataDeleteRequestValidationError{
7703
					field:  "AttributeFilter",
7704
					reason: "embedded message failed validation",
7705
					cause:  err,
7706
				})
7707
			}
7708
		case interface{ Validate() error }:
7709
			if err := v.Validate(); err != nil {
7710
				errors = append(errors, DataDeleteRequestValidationError{
7711
					field:  "AttributeFilter",
7712
					reason: "embedded message failed validation",
7713
					cause:  err,
7714
				})
7715
			}
7716
		}
7717
	} else if v, ok := interface{}(m.GetAttributeFilter()).(interface{ Validate() error }); ok {
7718
		if err := v.Validate(); err != nil {
7719
			return DataDeleteRequestValidationError{
7720
				field:  "AttributeFilter",
7721
				reason: "embedded message failed validation",
7722
				cause:  err,
7723
			}
7724
		}
7725
	}
7726
7727
	if len(errors) > 0 {
7728
		return DataDeleteRequestMultiError(errors)
7729
	}
7730
7731
	return nil
7732
}
7733
7734
// DataDeleteRequestMultiError is an error wrapping multiple validation errors
7735
// returned by DataDeleteRequest.ValidateAll() if the designated constraints
7736
// aren't met.
7737
type DataDeleteRequestMultiError []error
7738
7739
// Error returns a concatenation of all the error messages it wraps.
7740
func (m DataDeleteRequestMultiError) Error() string {
7741
	msgs := make([]string, 0, len(m))
7742
	for _, err := range m {
7743
		msgs = append(msgs, err.Error())
7744
	}
7745
	return strings.Join(msgs, "; ")
7746
}
7747
7748
// AllErrors returns a list of validation violation errors.
7749
func (m DataDeleteRequestMultiError) AllErrors() []error { return m }
7750
7751
// DataDeleteRequestValidationError is the validation error returned by
7752
// DataDeleteRequest.Validate if the designated constraints aren't met.
7753
type DataDeleteRequestValidationError struct {
7754
	field  string
7755
	reason string
7756
	cause  error
7757
	key    bool
7758
}
7759
7760
// Field function returns field value.
7761
func (e DataDeleteRequestValidationError) Field() string { return e.field }
7762
7763
// Reason function returns reason value.
7764
func (e DataDeleteRequestValidationError) Reason() string { return e.reason }
7765
7766
// Cause function returns cause value.
7767
func (e DataDeleteRequestValidationError) Cause() error { return e.cause }
7768
7769
// Key function returns key value.
7770
func (e DataDeleteRequestValidationError) Key() bool { return e.key }
7771
7772
// ErrorName returns error name.
7773
func (e DataDeleteRequestValidationError) ErrorName() string {
7774
	return "DataDeleteRequestValidationError"
7775
}
7776
7777
// Error satisfies the builtin error interface
7778
func (e DataDeleteRequestValidationError) Error() string {
7779
	cause := ""
7780
	if e.cause != nil {
7781
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
7782
	}
7783
7784
	key := ""
7785
	if e.key {
7786
		key = "key for "
7787
	}
7788
7789
	return fmt.Sprintf(
7790
		"invalid %sDataDeleteRequest.%s: %s%s",
7791
		key,
7792
		e.field,
7793
		e.reason,
7794
		cause)
7795
}
7796
7797
var _ error = DataDeleteRequestValidationError{}
7798
7799
var _ interface {
7800
	Field() string
7801
	Reason() string
7802
	Key() bool
7803
	Cause() error
7804
	ErrorName() string
7805
} = DataDeleteRequestValidationError{}
7806
7807
var _DataDeleteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
7808
7809
// Validate checks the field values on DataDeleteResponse with the rules
7810
// defined in the proto definition for this message. If any rules are
7811
// violated, the first error encountered is returned, or nil if there are no violations.
7812
func (m *DataDeleteResponse) Validate() error {
7813
	return m.validate(false)
7814
}
7815
7816
// ValidateAll checks the field values on DataDeleteResponse with the rules
7817
// defined in the proto definition for this message. If any rules are
7818
// violated, the result is a list of violation errors wrapped in
7819
// DataDeleteResponseMultiError, or nil if none found.
7820
func (m *DataDeleteResponse) ValidateAll() error {
7821
	return m.validate(true)
7822
}
7823
7824
func (m *DataDeleteResponse) validate(all bool) error {
7825
	if m == nil {
7826
		return nil
7827
	}
7828
7829
	var errors []error
7830
7831
	// no validation rules for SnapToken
7832
7833
	if len(errors) > 0 {
7834
		return DataDeleteResponseMultiError(errors)
7835
	}
7836
7837
	return nil
7838
}
7839
7840
// DataDeleteResponseMultiError is an error wrapping multiple validation errors
7841
// returned by DataDeleteResponse.ValidateAll() if the designated constraints
7842
// aren't met.
7843
type DataDeleteResponseMultiError []error
7844
7845
// Error returns a concatenation of all the error messages it wraps.
7846
func (m DataDeleteResponseMultiError) Error() string {
7847
	msgs := make([]string, 0, len(m))
7848
	for _, err := range m {
7849
		msgs = append(msgs, err.Error())
7850
	}
7851
	return strings.Join(msgs, "; ")
7852
}
7853
7854
// AllErrors returns a list of validation violation errors.
7855
func (m DataDeleteResponseMultiError) AllErrors() []error { return m }
7856
7857
// DataDeleteResponseValidationError is the validation error returned by
7858
// DataDeleteResponse.Validate if the designated constraints aren't met.
7859
type DataDeleteResponseValidationError struct {
7860
	field  string
7861
	reason string
7862
	cause  error
7863
	key    bool
7864
}
7865
7866
// Field function returns field value.
7867
func (e DataDeleteResponseValidationError) Field() string { return e.field }
7868
7869
// Reason function returns reason value.
7870
func (e DataDeleteResponseValidationError) Reason() string { return e.reason }
7871
7872
// Cause function returns cause value.
7873
func (e DataDeleteResponseValidationError) Cause() error { return e.cause }
7874
7875
// Key function returns key value.
7876
func (e DataDeleteResponseValidationError) Key() bool { return e.key }
7877
7878
// ErrorName returns error name.
7879
func (e DataDeleteResponseValidationError) ErrorName() string {
7880
	return "DataDeleteResponseValidationError"
7881
}
7882
7883
// Error satisfies the builtin error interface
7884
func (e DataDeleteResponseValidationError) Error() string {
7885
	cause := ""
7886
	if e.cause != nil {
7887
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
7888
	}
7889
7890
	key := ""
7891
	if e.key {
7892
		key = "key for "
7893
	}
7894
7895
	return fmt.Sprintf(
7896
		"invalid %sDataDeleteResponse.%s: %s%s",
7897
		key,
7898
		e.field,
7899
		e.reason,
7900
		cause)
7901
}
7902
7903
var _ error = DataDeleteResponseValidationError{}
7904
7905
var _ interface {
7906
	Field() string
7907
	Reason() string
7908
	Key() bool
7909
	Cause() error
7910
	ErrorName() string
7911
} = DataDeleteResponseValidationError{}
7912
7913
// Validate checks the field values on RelationshipDeleteRequest with the rules
7914
// defined in the proto definition for this message. If any rules are
7915
// violated, the first error encountered is returned, or nil if there are no violations.
7916
func (m *RelationshipDeleteRequest) Validate() error {
7917
	return m.validate(false)
7918
}
7919
7920
// ValidateAll checks the field values on RelationshipDeleteRequest with the
7921
// rules defined in the proto definition for this message. If any rules are
7922
// violated, the result is a list of violation errors wrapped in
7923
// RelationshipDeleteRequestMultiError, or nil if none found.
7924
func (m *RelationshipDeleteRequest) ValidateAll() error {
7925
	return m.validate(true)
7926
}
7927
7928
func (m *RelationshipDeleteRequest) validate(all bool) error {
7929
	if m == nil {
7930
		return nil
7931
	}
7932
7933
	var errors []error
7934
7935
	if len(m.GetTenantId()) > 128 {
7936
		err := RelationshipDeleteRequestValidationError{
7937
			field:  "TenantId",
7938
			reason: "value length must be at most 128 bytes",
7939
		}
7940
		if !all {
7941
			return err
7942
		}
7943
		errors = append(errors, err)
7944
	}
7945
7946
	if !_RelationshipDeleteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
7947
		err := RelationshipDeleteRequestValidationError{
7948
			field:  "TenantId",
7949
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
7950
		}
7951
		if !all {
7952
			return err
7953
		}
7954
		errors = append(errors, err)
7955
	}
7956
7957
	if all {
7958
		switch v := interface{}(m.GetFilter()).(type) {
7959
		case interface{ ValidateAll() error }:
7960
			if err := v.ValidateAll(); err != nil {
7961
				errors = append(errors, RelationshipDeleteRequestValidationError{
7962
					field:  "Filter",
7963
					reason: "embedded message failed validation",
7964
					cause:  err,
7965
				})
7966
			}
7967
		case interface{ Validate() error }:
7968
			if err := v.Validate(); err != nil {
7969
				errors = append(errors, RelationshipDeleteRequestValidationError{
7970
					field:  "Filter",
7971
					reason: "embedded message failed validation",
7972
					cause:  err,
7973
				})
7974
			}
7975
		}
7976
	} else if v, ok := interface{}(m.GetFilter()).(interface{ Validate() error }); ok {
7977
		if err := v.Validate(); err != nil {
7978
			return RelationshipDeleteRequestValidationError{
7979
				field:  "Filter",
7980
				reason: "embedded message failed validation",
7981
				cause:  err,
7982
			}
7983
		}
7984
	}
7985
7986
	if len(errors) > 0 {
7987
		return RelationshipDeleteRequestMultiError(errors)
7988
	}
7989
7990
	return nil
7991
}
7992
7993
// RelationshipDeleteRequestMultiError is an error wrapping multiple validation
7994
// errors returned by RelationshipDeleteRequest.ValidateAll() if the
7995
// designated constraints aren't met.
7996
type RelationshipDeleteRequestMultiError []error
7997
7998
// Error returns a concatenation of all the error messages it wraps.
7999
func (m RelationshipDeleteRequestMultiError) Error() string {
8000
	msgs := make([]string, 0, len(m))
8001
	for _, err := range m {
8002
		msgs = append(msgs, err.Error())
8003
	}
8004
	return strings.Join(msgs, "; ")
8005
}
8006
8007
// AllErrors returns a list of validation violation errors.
8008
func (m RelationshipDeleteRequestMultiError) AllErrors() []error { return m }
8009
8010
// RelationshipDeleteRequestValidationError is the validation error returned by
8011
// RelationshipDeleteRequest.Validate if the designated constraints aren't met.
8012
type RelationshipDeleteRequestValidationError struct {
8013
	field  string
8014
	reason string
8015
	cause  error
8016
	key    bool
8017
}
8018
8019
// Field function returns field value.
8020
func (e RelationshipDeleteRequestValidationError) Field() string { return e.field }
8021
8022
// Reason function returns reason value.
8023
func (e RelationshipDeleteRequestValidationError) Reason() string { return e.reason }
8024
8025
// Cause function returns cause value.
8026
func (e RelationshipDeleteRequestValidationError) Cause() error { return e.cause }
8027
8028
// Key function returns key value.
8029
func (e RelationshipDeleteRequestValidationError) Key() bool { return e.key }
8030
8031
// ErrorName returns error name.
8032
func (e RelationshipDeleteRequestValidationError) ErrorName() string {
8033
	return "RelationshipDeleteRequestValidationError"
8034
}
8035
8036
// Error satisfies the builtin error interface
8037
func (e RelationshipDeleteRequestValidationError) Error() string {
8038
	cause := ""
8039
	if e.cause != nil {
8040
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
8041
	}
8042
8043
	key := ""
8044
	if e.key {
8045
		key = "key for "
8046
	}
8047
8048
	return fmt.Sprintf(
8049
		"invalid %sRelationshipDeleteRequest.%s: %s%s",
8050
		key,
8051
		e.field,
8052
		e.reason,
8053
		cause)
8054
}
8055
8056
var _ error = RelationshipDeleteRequestValidationError{}
8057
8058
var _ interface {
8059
	Field() string
8060
	Reason() string
8061
	Key() bool
8062
	Cause() error
8063
	ErrorName() string
8064
} = RelationshipDeleteRequestValidationError{}
8065
8066
var _RelationshipDeleteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
8067
8068
// Validate checks the field values on RelationshipDeleteResponse with the
8069
// rules defined in the proto definition for this message. If any rules are
8070
// violated, the first error encountered is returned, or nil if there are no violations.
8071
func (m *RelationshipDeleteResponse) Validate() error {
8072
	return m.validate(false)
8073
}
8074
8075
// ValidateAll checks the field values on RelationshipDeleteResponse with the
8076
// rules defined in the proto definition for this message. If any rules are
8077
// violated, the result is a list of violation errors wrapped in
8078
// RelationshipDeleteResponseMultiError, or nil if none found.
8079
func (m *RelationshipDeleteResponse) ValidateAll() error {
8080
	return m.validate(true)
8081
}
8082
8083
func (m *RelationshipDeleteResponse) validate(all bool) error {
8084
	if m == nil {
8085
		return nil
8086
	}
8087
8088
	var errors []error
8089
8090
	// no validation rules for SnapToken
8091
8092
	if len(errors) > 0 {
8093
		return RelationshipDeleteResponseMultiError(errors)
8094
	}
8095
8096
	return nil
8097
}
8098
8099
// RelationshipDeleteResponseMultiError is an error wrapping multiple
8100
// validation errors returned by RelationshipDeleteResponse.ValidateAll() if
8101
// the designated constraints aren't met.
8102
type RelationshipDeleteResponseMultiError []error
8103
8104
// Error returns a concatenation of all the error messages it wraps.
8105
func (m RelationshipDeleteResponseMultiError) Error() string {
8106
	msgs := make([]string, 0, len(m))
8107
	for _, err := range m {
8108
		msgs = append(msgs, err.Error())
8109
	}
8110
	return strings.Join(msgs, "; ")
8111
}
8112
8113
// AllErrors returns a list of validation violation errors.
8114
func (m RelationshipDeleteResponseMultiError) AllErrors() []error { return m }
8115
8116
// RelationshipDeleteResponseValidationError is the validation error returned
8117
// by RelationshipDeleteResponse.Validate if the designated constraints aren't met.
8118
type RelationshipDeleteResponseValidationError struct {
8119
	field  string
8120
	reason string
8121
	cause  error
8122
	key    bool
8123
}
8124
8125
// Field function returns field value.
8126
func (e RelationshipDeleteResponseValidationError) Field() string { return e.field }
8127
8128
// Reason function returns reason value.
8129
func (e RelationshipDeleteResponseValidationError) Reason() string { return e.reason }
8130
8131
// Cause function returns cause value.
8132
func (e RelationshipDeleteResponseValidationError) Cause() error { return e.cause }
8133
8134
// Key function returns key value.
8135
func (e RelationshipDeleteResponseValidationError) Key() bool { return e.key }
8136
8137
// ErrorName returns error name.
8138
func (e RelationshipDeleteResponseValidationError) ErrorName() string {
8139
	return "RelationshipDeleteResponseValidationError"
8140
}
8141
8142
// Error satisfies the builtin error interface
8143
func (e RelationshipDeleteResponseValidationError) Error() string {
8144
	cause := ""
8145
	if e.cause != nil {
8146
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
8147
	}
8148
8149
	key := ""
8150
	if e.key {
8151
		key = "key for "
8152
	}
8153
8154
	return fmt.Sprintf(
8155
		"invalid %sRelationshipDeleteResponse.%s: %s%s",
8156
		key,
8157
		e.field,
8158
		e.reason,
8159
		cause)
8160
}
8161
8162
var _ error = RelationshipDeleteResponseValidationError{}
8163
8164
var _ interface {
8165
	Field() string
8166
	Reason() string
8167
	Key() bool
8168
	Cause() error
8169
	ErrorName() string
8170
} = RelationshipDeleteResponseValidationError{}
8171
8172
// Validate checks the field values on BundleRunRequest with the rules defined
8173
// in the proto definition for this message. If any rules are violated, the
8174
// first error encountered is returned, or nil if there are no violations.
8175
func (m *BundleRunRequest) Validate() error {
8176
	return m.validate(false)
8177
}
8178
8179
// ValidateAll checks the field values on BundleRunRequest with the rules
8180
// defined in the proto definition for this message. If any rules are
8181
// violated, the result is a list of violation errors wrapped in
8182
// BundleRunRequestMultiError, or nil if none found.
8183
func (m *BundleRunRequest) ValidateAll() error {
8184
	return m.validate(true)
8185
}
8186
8187
func (m *BundleRunRequest) validate(all bool) error {
8188
	if m == nil {
8189
		return nil
8190
	}
8191
8192
	var errors []error
8193
8194
	if len(m.GetTenantId()) > 128 {
8195
		err := BundleRunRequestValidationError{
8196
			field:  "TenantId",
8197
			reason: "value length must be at most 128 bytes",
8198
		}
8199
		if !all {
8200
			return err
8201
		}
8202
		errors = append(errors, err)
8203
	}
8204
8205
	if !_BundleRunRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
8206
		err := BundleRunRequestValidationError{
8207
			field:  "TenantId",
8208
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
8209
		}
8210
		if !all {
8211
			return err
8212
		}
8213
		errors = append(errors, err)
8214
	}
8215
8216
	// no validation rules for Name
8217
8218
	// no validation rules for Arguments
8219
8220
	if len(errors) > 0 {
8221
		return BundleRunRequestMultiError(errors)
8222
	}
8223
8224
	return nil
8225
}
8226
8227
// BundleRunRequestMultiError is an error wrapping multiple validation errors
8228
// returned by BundleRunRequest.ValidateAll() if the designated constraints
8229
// aren't met.
8230
type BundleRunRequestMultiError []error
8231
8232
// Error returns a concatenation of all the error messages it wraps.
8233
func (m BundleRunRequestMultiError) Error() string {
8234
	msgs := make([]string, 0, len(m))
8235
	for _, err := range m {
8236
		msgs = append(msgs, err.Error())
8237
	}
8238
	return strings.Join(msgs, "; ")
8239
}
8240
8241
// AllErrors returns a list of validation violation errors.
8242
func (m BundleRunRequestMultiError) AllErrors() []error { return m }
8243
8244
// BundleRunRequestValidationError is the validation error returned by
8245
// BundleRunRequest.Validate if the designated constraints aren't met.
8246
type BundleRunRequestValidationError struct {
8247
	field  string
8248
	reason string
8249
	cause  error
8250
	key    bool
8251
}
8252
8253
// Field function returns field value.
8254
func (e BundleRunRequestValidationError) Field() string { return e.field }
8255
8256
// Reason function returns reason value.
8257
func (e BundleRunRequestValidationError) Reason() string { return e.reason }
8258
8259
// Cause function returns cause value.
8260
func (e BundleRunRequestValidationError) Cause() error { return e.cause }
8261
8262
// Key function returns key value.
8263
func (e BundleRunRequestValidationError) Key() bool { return e.key }
8264
8265
// ErrorName returns error name.
8266
func (e BundleRunRequestValidationError) ErrorName() string { return "BundleRunRequestValidationError" }
8267
8268
// Error satisfies the builtin error interface
8269
func (e BundleRunRequestValidationError) Error() string {
8270
	cause := ""
8271
	if e.cause != nil {
8272
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
8273
	}
8274
8275
	key := ""
8276
	if e.key {
8277
		key = "key for "
8278
	}
8279
8280
	return fmt.Sprintf(
8281
		"invalid %sBundleRunRequest.%s: %s%s",
8282
		key,
8283
		e.field,
8284
		e.reason,
8285
		cause)
8286
}
8287
8288
var _ error = BundleRunRequestValidationError{}
8289
8290
var _ interface {
8291
	Field() string
8292
	Reason() string
8293
	Key() bool
8294
	Cause() error
8295
	ErrorName() string
8296
} = BundleRunRequestValidationError{}
8297
8298
var _BundleRunRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
8299
8300
// Validate checks the field values on BundleRunResponse with the rules defined
8301
// in the proto definition for this message. If any rules are violated, the
8302
// first error encountered is returned, or nil if there are no violations.
8303
func (m *BundleRunResponse) Validate() error {
8304
	return m.validate(false)
8305
}
8306
8307
// ValidateAll checks the field values on BundleRunResponse with the rules
8308
// defined in the proto definition for this message. If any rules are
8309
// violated, the result is a list of violation errors wrapped in
8310
// BundleRunResponseMultiError, or nil if none found.
8311
func (m *BundleRunResponse) ValidateAll() error {
8312
	return m.validate(true)
8313
}
8314
8315
func (m *BundleRunResponse) validate(all bool) error {
8316
	if m == nil {
8317
		return nil
8318
	}
8319
8320
	var errors []error
8321
8322
	// no validation rules for SnapToken
8323
8324
	if len(errors) > 0 {
8325
		return BundleRunResponseMultiError(errors)
8326
	}
8327
8328
	return nil
8329
}
8330
8331
// BundleRunResponseMultiError is an error wrapping multiple validation errors
8332
// returned by BundleRunResponse.ValidateAll() if the designated constraints
8333
// aren't met.
8334
type BundleRunResponseMultiError []error
8335
8336
// Error returns a concatenation of all the error messages it wraps.
8337
func (m BundleRunResponseMultiError) Error() string {
8338
	msgs := make([]string, 0, len(m))
8339
	for _, err := range m {
8340
		msgs = append(msgs, err.Error())
8341
	}
8342
	return strings.Join(msgs, "; ")
8343
}
8344
8345
// AllErrors returns a list of validation violation errors.
8346
func (m BundleRunResponseMultiError) AllErrors() []error { return m }
8347
8348
// BundleRunResponseValidationError is the validation error returned by
8349
// BundleRunResponse.Validate if the designated constraints aren't met.
8350
type BundleRunResponseValidationError struct {
8351
	field  string
8352
	reason string
8353
	cause  error
8354
	key    bool
8355
}
8356
8357
// Field function returns field value.
8358
func (e BundleRunResponseValidationError) Field() string { return e.field }
8359
8360
// Reason function returns reason value.
8361
func (e BundleRunResponseValidationError) Reason() string { return e.reason }
8362
8363
// Cause function returns cause value.
8364
func (e BundleRunResponseValidationError) Cause() error { return e.cause }
8365
8366
// Key function returns key value.
8367
func (e BundleRunResponseValidationError) Key() bool { return e.key }
8368
8369
// ErrorName returns error name.
8370
func (e BundleRunResponseValidationError) ErrorName() string {
8371
	return "BundleRunResponseValidationError"
8372
}
8373
8374
// Error satisfies the builtin error interface
8375
func (e BundleRunResponseValidationError) Error() string {
8376
	cause := ""
8377
	if e.cause != nil {
8378
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
8379
	}
8380
8381
	key := ""
8382
	if e.key {
8383
		key = "key for "
8384
	}
8385
8386
	return fmt.Sprintf(
8387
		"invalid %sBundleRunResponse.%s: %s%s",
8388
		key,
8389
		e.field,
8390
		e.reason,
8391
		cause)
8392
}
8393
8394
var _ error = BundleRunResponseValidationError{}
8395
8396
var _ interface {
8397
	Field() string
8398
	Reason() string
8399
	Key() bool
8400
	Cause() error
8401
	ErrorName() string
8402
} = BundleRunResponseValidationError{}
8403
8404
// Validate checks the field values on BundleWriteRequest with the rules
8405
// defined in the proto definition for this message. If any rules are
8406
// violated, the first error encountered is returned, or nil if there are no violations.
8407
func (m *BundleWriteRequest) Validate() error {
8408
	return m.validate(false)
8409
}
8410
8411
// ValidateAll checks the field values on BundleWriteRequest with the rules
8412
// defined in the proto definition for this message. If any rules are
8413
// violated, the result is a list of violation errors wrapped in
8414
// BundleWriteRequestMultiError, or nil if none found.
8415
func (m *BundleWriteRequest) ValidateAll() error {
8416
	return m.validate(true)
8417
}
8418
8419
func (m *BundleWriteRequest) validate(all bool) error {
8420
	if m == nil {
8421
		return nil
8422
	}
8423
8424
	var errors []error
8425
8426
	if len(m.GetTenantId()) > 128 {
8427
		err := BundleWriteRequestValidationError{
8428
			field:  "TenantId",
8429
			reason: "value length must be at most 128 bytes",
8430
		}
8431
		if !all {
8432
			return err
8433
		}
8434
		errors = append(errors, err)
8435
	}
8436
8437
	if !_BundleWriteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
8438
		err := BundleWriteRequestValidationError{
8439
			field:  "TenantId",
8440
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
8441
		}
8442
		if !all {
8443
			return err
8444
		}
8445
		errors = append(errors, err)
8446
	}
8447
8448
	for idx, item := range m.GetBundles() {
8449
		_, _ = idx, item
8450
8451
		if all {
8452
			switch v := interface{}(item).(type) {
8453
			case interface{ ValidateAll() error }:
8454
				if err := v.ValidateAll(); err != nil {
8455
					errors = append(errors, BundleWriteRequestValidationError{
8456
						field:  fmt.Sprintf("Bundles[%v]", idx),
8457
						reason: "embedded message failed validation",
8458
						cause:  err,
8459
					})
8460
				}
8461
			case interface{ Validate() error }:
8462
				if err := v.Validate(); err != nil {
8463
					errors = append(errors, BundleWriteRequestValidationError{
8464
						field:  fmt.Sprintf("Bundles[%v]", idx),
8465
						reason: "embedded message failed validation",
8466
						cause:  err,
8467
					})
8468
				}
8469
			}
8470
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
8471
			if err := v.Validate(); err != nil {
8472
				return BundleWriteRequestValidationError{
8473
					field:  fmt.Sprintf("Bundles[%v]", idx),
8474
					reason: "embedded message failed validation",
8475
					cause:  err,
8476
				}
8477
			}
8478
		}
8479
8480
	}
8481
8482
	if len(errors) > 0 {
8483
		return BundleWriteRequestMultiError(errors)
8484
	}
8485
8486
	return nil
8487
}
8488
8489
// BundleWriteRequestMultiError is an error wrapping multiple validation errors
8490
// returned by BundleWriteRequest.ValidateAll() if the designated constraints
8491
// aren't met.
8492
type BundleWriteRequestMultiError []error
8493
8494
// Error returns a concatenation of all the error messages it wraps.
8495
func (m BundleWriteRequestMultiError) Error() string {
8496
	msgs := make([]string, 0, len(m))
8497
	for _, err := range m {
8498
		msgs = append(msgs, err.Error())
8499
	}
8500
	return strings.Join(msgs, "; ")
8501
}
8502
8503
// AllErrors returns a list of validation violation errors.
8504
func (m BundleWriteRequestMultiError) AllErrors() []error { return m }
8505
8506
// BundleWriteRequestValidationError is the validation error returned by
8507
// BundleWriteRequest.Validate if the designated constraints aren't met.
8508
type BundleWriteRequestValidationError struct {
8509
	field  string
8510
	reason string
8511
	cause  error
8512
	key    bool
8513
}
8514
8515
// Field function returns field value.
8516
func (e BundleWriteRequestValidationError) Field() string { return e.field }
8517
8518
// Reason function returns reason value.
8519
func (e BundleWriteRequestValidationError) Reason() string { return e.reason }
8520
8521
// Cause function returns cause value.
8522
func (e BundleWriteRequestValidationError) Cause() error { return e.cause }
8523
8524
// Key function returns key value.
8525
func (e BundleWriteRequestValidationError) Key() bool { return e.key }
8526
8527
// ErrorName returns error name.
8528
func (e BundleWriteRequestValidationError) ErrorName() string {
8529
	return "BundleWriteRequestValidationError"
8530
}
8531
8532
// Error satisfies the builtin error interface
8533
func (e BundleWriteRequestValidationError) Error() string {
8534
	cause := ""
8535
	if e.cause != nil {
8536
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
8537
	}
8538
8539
	key := ""
8540
	if e.key {
8541
		key = "key for "
8542
	}
8543
8544
	return fmt.Sprintf(
8545
		"invalid %sBundleWriteRequest.%s: %s%s",
8546
		key,
8547
		e.field,
8548
		e.reason,
8549
		cause)
8550
}
8551
8552
var _ error = BundleWriteRequestValidationError{}
8553
8554
var _ interface {
8555
	Field() string
8556
	Reason() string
8557
	Key() bool
8558
	Cause() error
8559
	ErrorName() string
8560
} = BundleWriteRequestValidationError{}
8561
8562
var _BundleWriteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
8563
8564
// Validate checks the field values on BundleWriteResponse with the rules
8565
// defined in the proto definition for this message. If any rules are
8566
// violated, the first error encountered is returned, or nil if there are no violations.
8567
func (m *BundleWriteResponse) Validate() error {
8568
	return m.validate(false)
8569
}
8570
8571
// ValidateAll checks the field values on BundleWriteResponse with the rules
8572
// defined in the proto definition for this message. If any rules are
8573
// violated, the result is a list of violation errors wrapped in
8574
// BundleWriteResponseMultiError, or nil if none found.
8575
func (m *BundleWriteResponse) ValidateAll() error {
8576
	return m.validate(true)
8577
}
8578
8579
func (m *BundleWriteResponse) validate(all bool) error {
8580
	if m == nil {
8581
		return nil
8582
	}
8583
8584
	var errors []error
8585
8586
	if len(errors) > 0 {
8587
		return BundleWriteResponseMultiError(errors)
8588
	}
8589
8590
	return nil
8591
}
8592
8593
// BundleWriteResponseMultiError is an error wrapping multiple validation
8594
// errors returned by BundleWriteResponse.ValidateAll() if the designated
8595
// constraints aren't met.
8596
type BundleWriteResponseMultiError []error
8597
8598
// Error returns a concatenation of all the error messages it wraps.
8599
func (m BundleWriteResponseMultiError) Error() string {
8600
	msgs := make([]string, 0, len(m))
8601
	for _, err := range m {
8602
		msgs = append(msgs, err.Error())
8603
	}
8604
	return strings.Join(msgs, "; ")
8605
}
8606
8607
// AllErrors returns a list of validation violation errors.
8608
func (m BundleWriteResponseMultiError) AllErrors() []error { return m }
8609
8610
// BundleWriteResponseValidationError is the validation error returned by
8611
// BundleWriteResponse.Validate if the designated constraints aren't met.
8612
type BundleWriteResponseValidationError struct {
8613
	field  string
8614
	reason string
8615
	cause  error
8616
	key    bool
8617
}
8618
8619
// Field function returns field value.
8620
func (e BundleWriteResponseValidationError) Field() string { return e.field }
8621
8622
// Reason function returns reason value.
8623
func (e BundleWriteResponseValidationError) Reason() string { return e.reason }
8624
8625
// Cause function returns cause value.
8626
func (e BundleWriteResponseValidationError) Cause() error { return e.cause }
8627
8628
// Key function returns key value.
8629
func (e BundleWriteResponseValidationError) Key() bool { return e.key }
8630
8631
// ErrorName returns error name.
8632
func (e BundleWriteResponseValidationError) ErrorName() string {
8633
	return "BundleWriteResponseValidationError"
8634
}
8635
8636
// Error satisfies the builtin error interface
8637
func (e BundleWriteResponseValidationError) Error() string {
8638
	cause := ""
8639
	if e.cause != nil {
8640
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
8641
	}
8642
8643
	key := ""
8644
	if e.key {
8645
		key = "key for "
8646
	}
8647
8648
	return fmt.Sprintf(
8649
		"invalid %sBundleWriteResponse.%s: %s%s",
8650
		key,
8651
		e.field,
8652
		e.reason,
8653
		cause)
8654
}
8655
8656
var _ error = BundleWriteResponseValidationError{}
8657
8658
var _ interface {
8659
	Field() string
8660
	Reason() string
8661
	Key() bool
8662
	Cause() error
8663
	ErrorName() string
8664
} = BundleWriteResponseValidationError{}
8665
8666
// Validate checks the field values on BundleReadRequest with the rules defined
8667
// in the proto definition for this message. If any rules are violated, the
8668
// first error encountered is returned, or nil if there are no violations.
8669
func (m *BundleReadRequest) Validate() error {
8670
	return m.validate(false)
8671
}
8672
8673
// ValidateAll checks the field values on BundleReadRequest with the rules
8674
// defined in the proto definition for this message. If any rules are
8675
// violated, the result is a list of violation errors wrapped in
8676
// BundleReadRequestMultiError, or nil if none found.
8677
func (m *BundleReadRequest) ValidateAll() error {
8678
	return m.validate(true)
8679
}
8680
8681
func (m *BundleReadRequest) validate(all bool) error {
8682
	if m == nil {
8683
		return nil
8684
	}
8685
8686
	var errors []error
8687
8688
	if len(m.GetTenantId()) > 128 {
8689
		err := BundleReadRequestValidationError{
8690
			field:  "TenantId",
8691
			reason: "value length must be at most 128 bytes",
8692
		}
8693
		if !all {
8694
			return err
8695
		}
8696
		errors = append(errors, err)
8697
	}
8698
8699
	if !_BundleReadRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
8700
		err := BundleReadRequestValidationError{
8701
			field:  "TenantId",
8702
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
8703
		}
8704
		if !all {
8705
			return err
8706
		}
8707
		errors = append(errors, err)
8708
	}
8709
8710
	// no validation rules for Name
8711
8712
	if len(errors) > 0 {
8713
		return BundleReadRequestMultiError(errors)
8714
	}
8715
8716
	return nil
8717
}
8718
8719
// BundleReadRequestMultiError is an error wrapping multiple validation errors
8720
// returned by BundleReadRequest.ValidateAll() if the designated constraints
8721
// aren't met.
8722
type BundleReadRequestMultiError []error
8723
8724
// Error returns a concatenation of all the error messages it wraps.
8725
func (m BundleReadRequestMultiError) Error() string {
8726
	msgs := make([]string, 0, len(m))
8727
	for _, err := range m {
8728
		msgs = append(msgs, err.Error())
8729
	}
8730
	return strings.Join(msgs, "; ")
8731
}
8732
8733
// AllErrors returns a list of validation violation errors.
8734
func (m BundleReadRequestMultiError) AllErrors() []error { return m }
8735
8736
// BundleReadRequestValidationError is the validation error returned by
8737
// BundleReadRequest.Validate if the designated constraints aren't met.
8738
type BundleReadRequestValidationError struct {
8739
	field  string
8740
	reason string
8741
	cause  error
8742
	key    bool
8743
}
8744
8745
// Field function returns field value.
8746
func (e BundleReadRequestValidationError) Field() string { return e.field }
8747
8748
// Reason function returns reason value.
8749
func (e BundleReadRequestValidationError) Reason() string { return e.reason }
8750
8751
// Cause function returns cause value.
8752
func (e BundleReadRequestValidationError) Cause() error { return e.cause }
8753
8754
// Key function returns key value.
8755
func (e BundleReadRequestValidationError) Key() bool { return e.key }
8756
8757
// ErrorName returns error name.
8758
func (e BundleReadRequestValidationError) ErrorName() string {
8759
	return "BundleReadRequestValidationError"
8760
}
8761
8762
// Error satisfies the builtin error interface
8763
func (e BundleReadRequestValidationError) Error() string {
8764
	cause := ""
8765
	if e.cause != nil {
8766
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
8767
	}
8768
8769
	key := ""
8770
	if e.key {
8771
		key = "key for "
8772
	}
8773
8774
	return fmt.Sprintf(
8775
		"invalid %sBundleReadRequest.%s: %s%s",
8776
		key,
8777
		e.field,
8778
		e.reason,
8779
		cause)
8780
}
8781
8782
var _ error = BundleReadRequestValidationError{}
8783
8784
var _ interface {
8785
	Field() string
8786
	Reason() string
8787
	Key() bool
8788
	Cause() error
8789
	ErrorName() string
8790
} = BundleReadRequestValidationError{}
8791
8792
var _BundleReadRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
8793
8794
// Validate checks the field values on BundleReadResponse with the rules
8795
// defined in the proto definition for this message. If any rules are
8796
// violated, the first error encountered is returned, or nil if there are no violations.
8797
func (m *BundleReadResponse) Validate() error {
8798
	return m.validate(false)
8799
}
8800
8801
// ValidateAll checks the field values on BundleReadResponse with the rules
8802
// defined in the proto definition for this message. If any rules are
8803
// violated, the result is a list of violation errors wrapped in
8804
// BundleReadResponseMultiError, or nil if none found.
8805
func (m *BundleReadResponse) ValidateAll() error {
8806
	return m.validate(true)
8807
}
8808
8809
func (m *BundleReadResponse) validate(all bool) error {
8810
	if m == nil {
8811
		return nil
8812
	}
8813
8814
	var errors []error
8815
8816
	if all {
8817
		switch v := interface{}(m.GetBundle()).(type) {
8818
		case interface{ ValidateAll() error }:
8819
			if err := v.ValidateAll(); err != nil {
8820
				errors = append(errors, BundleReadResponseValidationError{
8821
					field:  "Bundle",
8822
					reason: "embedded message failed validation",
8823
					cause:  err,
8824
				})
8825
			}
8826
		case interface{ Validate() error }:
8827
			if err := v.Validate(); err != nil {
8828
				errors = append(errors, BundleReadResponseValidationError{
8829
					field:  "Bundle",
8830
					reason: "embedded message failed validation",
8831
					cause:  err,
8832
				})
8833
			}
8834
		}
8835
	} else if v, ok := interface{}(m.GetBundle()).(interface{ Validate() error }); ok {
8836
		if err := v.Validate(); err != nil {
8837
			return BundleReadResponseValidationError{
8838
				field:  "Bundle",
8839
				reason: "embedded message failed validation",
8840
				cause:  err,
8841
			}
8842
		}
8843
	}
8844
8845
	if len(errors) > 0 {
8846
		return BundleReadResponseMultiError(errors)
8847
	}
8848
8849
	return nil
8850
}
8851
8852
// BundleReadResponseMultiError is an error wrapping multiple validation errors
8853
// returned by BundleReadResponse.ValidateAll() if the designated constraints
8854
// aren't met.
8855
type BundleReadResponseMultiError []error
8856
8857
// Error returns a concatenation of all the error messages it wraps.
8858
func (m BundleReadResponseMultiError) Error() string {
8859
	msgs := make([]string, 0, len(m))
8860
	for _, err := range m {
8861
		msgs = append(msgs, err.Error())
8862
	}
8863
	return strings.Join(msgs, "; ")
8864
}
8865
8866
// AllErrors returns a list of validation violation errors.
8867
func (m BundleReadResponseMultiError) AllErrors() []error { return m }
8868
8869
// BundleReadResponseValidationError is the validation error returned by
8870
// BundleReadResponse.Validate if the designated constraints aren't met.
8871
type BundleReadResponseValidationError struct {
8872
	field  string
8873
	reason string
8874
	cause  error
8875
	key    bool
8876
}
8877
8878
// Field function returns field value.
8879
func (e BundleReadResponseValidationError) Field() string { return e.field }
8880
8881
// Reason function returns reason value.
8882
func (e BundleReadResponseValidationError) Reason() string { return e.reason }
8883
8884
// Cause function returns cause value.
8885
func (e BundleReadResponseValidationError) Cause() error { return e.cause }
8886
8887
// Key function returns key value.
8888
func (e BundleReadResponseValidationError) Key() bool { return e.key }
8889
8890
// ErrorName returns error name.
8891
func (e BundleReadResponseValidationError) ErrorName() string {
8892
	return "BundleReadResponseValidationError"
8893
}
8894
8895
// Error satisfies the builtin error interface
8896
func (e BundleReadResponseValidationError) Error() string {
8897
	cause := ""
8898
	if e.cause != nil {
8899
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
8900
	}
8901
8902
	key := ""
8903
	if e.key {
8904
		key = "key for "
8905
	}
8906
8907
	return fmt.Sprintf(
8908
		"invalid %sBundleReadResponse.%s: %s%s",
8909
		key,
8910
		e.field,
8911
		e.reason,
8912
		cause)
8913
}
8914
8915
var _ error = BundleReadResponseValidationError{}
8916
8917
var _ interface {
8918
	Field() string
8919
	Reason() string
8920
	Key() bool
8921
	Cause() error
8922
	ErrorName() string
8923
} = BundleReadResponseValidationError{}
8924
8925
// Validate checks the field values on BundleDeleteRequest with the rules
8926
// defined in the proto definition for this message. If any rules are
8927
// violated, the first error encountered is returned, or nil if there are no violations.
8928
func (m *BundleDeleteRequest) Validate() error {
8929
	return m.validate(false)
8930
}
8931
8932
// ValidateAll checks the field values on BundleDeleteRequest with the rules
8933
// defined in the proto definition for this message. If any rules are
8934
// violated, the result is a list of violation errors wrapped in
8935
// BundleDeleteRequestMultiError, or nil if none found.
8936
func (m *BundleDeleteRequest) ValidateAll() error {
8937
	return m.validate(true)
8938
}
8939
8940
func (m *BundleDeleteRequest) validate(all bool) error {
8941
	if m == nil {
8942
		return nil
8943
	}
8944
8945
	var errors []error
8946
8947
	if len(m.GetTenantId()) > 128 {
8948
		err := BundleDeleteRequestValidationError{
8949
			field:  "TenantId",
8950
			reason: "value length must be at most 128 bytes",
8951
		}
8952
		if !all {
8953
			return err
8954
		}
8955
		errors = append(errors, err)
8956
	}
8957
8958
	if !_BundleDeleteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
8959
		err := BundleDeleteRequestValidationError{
8960
			field:  "TenantId",
8961
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
8962
		}
8963
		if !all {
8964
			return err
8965
		}
8966
		errors = append(errors, err)
8967
	}
8968
8969
	// no validation rules for Name
8970
8971
	if len(errors) > 0 {
8972
		return BundleDeleteRequestMultiError(errors)
8973
	}
8974
8975
	return nil
8976
}
8977
8978
// BundleDeleteRequestMultiError is an error wrapping multiple validation
8979
// errors returned by BundleDeleteRequest.ValidateAll() if the designated
8980
// constraints aren't met.
8981
type BundleDeleteRequestMultiError []error
8982
8983
// Error returns a concatenation of all the error messages it wraps.
8984
func (m BundleDeleteRequestMultiError) Error() string {
8985
	msgs := make([]string, 0, len(m))
8986
	for _, err := range m {
8987
		msgs = append(msgs, err.Error())
8988
	}
8989
	return strings.Join(msgs, "; ")
8990
}
8991
8992
// AllErrors returns a list of validation violation errors.
8993
func (m BundleDeleteRequestMultiError) AllErrors() []error { return m }
8994
8995
// BundleDeleteRequestValidationError is the validation error returned by
8996
// BundleDeleteRequest.Validate if the designated constraints aren't met.
8997
type BundleDeleteRequestValidationError struct {
8998
	field  string
8999
	reason string
9000
	cause  error
9001
	key    bool
9002
}
9003
9004
// Field function returns field value.
9005
func (e BundleDeleteRequestValidationError) Field() string { return e.field }
9006
9007
// Reason function returns reason value.
9008
func (e BundleDeleteRequestValidationError) Reason() string { return e.reason }
9009
9010
// Cause function returns cause value.
9011
func (e BundleDeleteRequestValidationError) Cause() error { return e.cause }
9012
9013
// Key function returns key value.
9014
func (e BundleDeleteRequestValidationError) Key() bool { return e.key }
9015
9016
// ErrorName returns error name.
9017
func (e BundleDeleteRequestValidationError) ErrorName() string {
9018
	return "BundleDeleteRequestValidationError"
9019
}
9020
9021
// Error satisfies the builtin error interface
9022
func (e BundleDeleteRequestValidationError) Error() string {
9023
	cause := ""
9024
	if e.cause != nil {
9025
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
9026
	}
9027
9028
	key := ""
9029
	if e.key {
9030
		key = "key for "
9031
	}
9032
9033
	return fmt.Sprintf(
9034
		"invalid %sBundleDeleteRequest.%s: %s%s",
9035
		key,
9036
		e.field,
9037
		e.reason,
9038
		cause)
9039
}
9040
9041
var _ error = BundleDeleteRequestValidationError{}
9042
9043
var _ interface {
9044
	Field() string
9045
	Reason() string
9046
	Key() bool
9047
	Cause() error
9048
	ErrorName() string
9049
} = BundleDeleteRequestValidationError{}
9050
9051
var _BundleDeleteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
9052
9053
// Validate checks the field values on BundleDeleteResponse with the rules
9054
// defined in the proto definition for this message. If any rules are
9055
// violated, the first error encountered is returned, or nil if there are no violations.
9056
func (m *BundleDeleteResponse) Validate() error {
9057
	return m.validate(false)
9058
}
9059
9060
// ValidateAll checks the field values on BundleDeleteResponse with the rules
9061
// defined in the proto definition for this message. If any rules are
9062
// violated, the result is a list of violation errors wrapped in
9063
// BundleDeleteResponseMultiError, or nil if none found.
9064
func (m *BundleDeleteResponse) ValidateAll() error {
9065
	return m.validate(true)
9066
}
9067
9068
func (m *BundleDeleteResponse) validate(all bool) error {
9069
	if m == nil {
9070
		return nil
9071
	}
9072
9073
	var errors []error
9074
9075
	// no validation rules for Name
9076
9077
	if len(errors) > 0 {
9078
		return BundleDeleteResponseMultiError(errors)
9079
	}
9080
9081
	return nil
9082
}
9083
9084
// BundleDeleteResponseMultiError is an error wrapping multiple validation
9085
// errors returned by BundleDeleteResponse.ValidateAll() if the designated
9086
// constraints aren't met.
9087
type BundleDeleteResponseMultiError []error
9088
9089
// Error returns a concatenation of all the error messages it wraps.
9090
func (m BundleDeleteResponseMultiError) Error() string {
9091
	msgs := make([]string, 0, len(m))
9092
	for _, err := range m {
9093
		msgs = append(msgs, err.Error())
9094
	}
9095
	return strings.Join(msgs, "; ")
9096
}
9097
9098
// AllErrors returns a list of validation violation errors.
9099
func (m BundleDeleteResponseMultiError) AllErrors() []error { return m }
9100
9101
// BundleDeleteResponseValidationError is the validation error returned by
9102
// BundleDeleteResponse.Validate if the designated constraints aren't met.
9103
type BundleDeleteResponseValidationError struct {
9104
	field  string
9105
	reason string
9106
	cause  error
9107
	key    bool
9108
}
9109
9110
// Field function returns field value.
9111
func (e BundleDeleteResponseValidationError) Field() string { return e.field }
9112
9113
// Reason function returns reason value.
9114
func (e BundleDeleteResponseValidationError) Reason() string { return e.reason }
9115
9116
// Cause function returns cause value.
9117
func (e BundleDeleteResponseValidationError) Cause() error { return e.cause }
9118
9119
// Key function returns key value.
9120
func (e BundleDeleteResponseValidationError) Key() bool { return e.key }
9121
9122
// ErrorName returns error name.
9123
func (e BundleDeleteResponseValidationError) ErrorName() string {
9124
	return "BundleDeleteResponseValidationError"
9125
}
9126
9127
// Error satisfies the builtin error interface
9128
func (e BundleDeleteResponseValidationError) Error() string {
9129
	cause := ""
9130
	if e.cause != nil {
9131
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
9132
	}
9133
9134
	key := ""
9135
	if e.key {
9136
		key = "key for "
9137
	}
9138
9139
	return fmt.Sprintf(
9140
		"invalid %sBundleDeleteResponse.%s: %s%s",
9141
		key,
9142
		e.field,
9143
		e.reason,
9144
		cause)
9145
}
9146
9147
var _ error = BundleDeleteResponseValidationError{}
9148
9149
var _ interface {
9150
	Field() string
9151
	Reason() string
9152
	Key() bool
9153
	Cause() error
9154
	ErrorName() string
9155
} = BundleDeleteResponseValidationError{}
9156
9157
// Validate checks the field values on TenantCreateRequest with the rules
9158
// defined in the proto definition for this message. If any rules are
9159
// violated, the first error encountered is returned, or nil if there are no violations.
9160
func (m *TenantCreateRequest) Validate() error {
9161
	return m.validate(false)
9162
}
9163
9164
// ValidateAll checks the field values on TenantCreateRequest with the rules
9165
// defined in the proto definition for this message. If any rules are
9166
// violated, the result is a list of violation errors wrapped in
9167
// TenantCreateRequestMultiError, or nil if none found.
9168
func (m *TenantCreateRequest) ValidateAll() error {
9169
	return m.validate(true)
9170
}
9171
9172
func (m *TenantCreateRequest) validate(all bool) error {
9173
	if m == nil {
9174
		return nil
9175
	}
9176
9177
	var errors []error
9178
9179
	if len(m.GetId()) > 64 {
9180
		err := TenantCreateRequestValidationError{
9181
			field:  "Id",
9182
			reason: "value length must be at most 64 bytes",
9183
		}
9184
		if !all {
9185
			return err
9186
		}
9187
		errors = append(errors, err)
9188
	}
9189
9190
	if !_TenantCreateRequest_Id_Pattern.MatchString(m.GetId()) {
9191
		err := TenantCreateRequestValidationError{
9192
			field:  "Id",
9193
			reason: "value does not match regex pattern \"[a-zA-Z0-9-,]+\"",
9194
		}
9195
		if !all {
9196
			return err
9197
		}
9198
		errors = append(errors, err)
9199
	}
9200
9201
	if len(m.GetName()) > 64 {
9202
		err := TenantCreateRequestValidationError{
9203
			field:  "Name",
9204
			reason: "value length must be at most 64 bytes",
9205
		}
9206
		if !all {
9207
			return err
9208
		}
9209
		errors = append(errors, err)
9210
	}
9211
9212
	if len(errors) > 0 {
9213
		return TenantCreateRequestMultiError(errors)
9214
	}
9215
9216
	return nil
9217
}
9218
9219
// TenantCreateRequestMultiError is an error wrapping multiple validation
9220
// errors returned by TenantCreateRequest.ValidateAll() if the designated
9221
// constraints aren't met.
9222
type TenantCreateRequestMultiError []error
9223
9224
// Error returns a concatenation of all the error messages it wraps.
9225
func (m TenantCreateRequestMultiError) Error() string {
9226
	msgs := make([]string, 0, len(m))
9227
	for _, err := range m {
9228
		msgs = append(msgs, err.Error())
9229
	}
9230
	return strings.Join(msgs, "; ")
9231
}
9232
9233
// AllErrors returns a list of validation violation errors.
9234
func (m TenantCreateRequestMultiError) AllErrors() []error { return m }
9235
9236
// TenantCreateRequestValidationError is the validation error returned by
9237
// TenantCreateRequest.Validate if the designated constraints aren't met.
9238
type TenantCreateRequestValidationError struct {
9239
	field  string
9240
	reason string
9241
	cause  error
9242
	key    bool
9243
}
9244
9245
// Field function returns field value.
9246
func (e TenantCreateRequestValidationError) Field() string { return e.field }
9247
9248
// Reason function returns reason value.
9249
func (e TenantCreateRequestValidationError) Reason() string { return e.reason }
9250
9251
// Cause function returns cause value.
9252
func (e TenantCreateRequestValidationError) Cause() error { return e.cause }
9253
9254
// Key function returns key value.
9255
func (e TenantCreateRequestValidationError) Key() bool { return e.key }
9256
9257
// ErrorName returns error name.
9258
func (e TenantCreateRequestValidationError) ErrorName() string {
9259
	return "TenantCreateRequestValidationError"
9260
}
9261
9262
// Error satisfies the builtin error interface
9263
func (e TenantCreateRequestValidationError) Error() string {
9264
	cause := ""
9265
	if e.cause != nil {
9266
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
9267
	}
9268
9269
	key := ""
9270
	if e.key {
9271
		key = "key for "
9272
	}
9273
9274
	return fmt.Sprintf(
9275
		"invalid %sTenantCreateRequest.%s: %s%s",
9276
		key,
9277
		e.field,
9278
		e.reason,
9279
		cause)
9280
}
9281
9282
var _ error = TenantCreateRequestValidationError{}
9283
9284
var _ interface {
9285
	Field() string
9286
	Reason() string
9287
	Key() bool
9288
	Cause() error
9289
	ErrorName() string
9290
} = TenantCreateRequestValidationError{}
9291
9292
var _TenantCreateRequest_Id_Pattern = regexp.MustCompile("[a-zA-Z0-9-,]+")
9293
9294
// Validate checks the field values on TenantCreateResponse with the rules
9295
// defined in the proto definition for this message. If any rules are
9296
// violated, the first error encountered is returned, or nil if there are no violations.
9297
func (m *TenantCreateResponse) Validate() error {
9298
	return m.validate(false)
9299
}
9300
9301
// ValidateAll checks the field values on TenantCreateResponse with the rules
9302
// defined in the proto definition for this message. If any rules are
9303
// violated, the result is a list of violation errors wrapped in
9304
// TenantCreateResponseMultiError, or nil if none found.
9305
func (m *TenantCreateResponse) ValidateAll() error {
9306
	return m.validate(true)
9307
}
9308
9309
func (m *TenantCreateResponse) validate(all bool) error {
9310
	if m == nil {
9311
		return nil
9312
	}
9313
9314
	var errors []error
9315
9316
	if all {
9317
		switch v := interface{}(m.GetTenant()).(type) {
9318
		case interface{ ValidateAll() error }:
9319
			if err := v.ValidateAll(); err != nil {
9320
				errors = append(errors, TenantCreateResponseValidationError{
9321
					field:  "Tenant",
9322
					reason: "embedded message failed validation",
9323
					cause:  err,
9324
				})
9325
			}
9326
		case interface{ Validate() error }:
9327
			if err := v.Validate(); err != nil {
9328
				errors = append(errors, TenantCreateResponseValidationError{
9329
					field:  "Tenant",
9330
					reason: "embedded message failed validation",
9331
					cause:  err,
9332
				})
9333
			}
9334
		}
9335
	} else if v, ok := interface{}(m.GetTenant()).(interface{ Validate() error }); ok {
9336
		if err := v.Validate(); err != nil {
9337
			return TenantCreateResponseValidationError{
9338
				field:  "Tenant",
9339
				reason: "embedded message failed validation",
9340
				cause:  err,
9341
			}
9342
		}
9343
	}
9344
9345
	if len(errors) > 0 {
9346
		return TenantCreateResponseMultiError(errors)
9347
	}
9348
9349
	return nil
9350
}
9351
9352
// TenantCreateResponseMultiError is an error wrapping multiple validation
9353
// errors returned by TenantCreateResponse.ValidateAll() if the designated
9354
// constraints aren't met.
9355
type TenantCreateResponseMultiError []error
9356
9357
// Error returns a concatenation of all the error messages it wraps.
9358
func (m TenantCreateResponseMultiError) Error() string {
9359
	msgs := make([]string, 0, len(m))
9360
	for _, err := range m {
9361
		msgs = append(msgs, err.Error())
9362
	}
9363
	return strings.Join(msgs, "; ")
9364
}
9365
9366
// AllErrors returns a list of validation violation errors.
9367
func (m TenantCreateResponseMultiError) AllErrors() []error { return m }
9368
9369
// TenantCreateResponseValidationError is the validation error returned by
9370
// TenantCreateResponse.Validate if the designated constraints aren't met.
9371
type TenantCreateResponseValidationError struct {
9372
	field  string
9373
	reason string
9374
	cause  error
9375
	key    bool
9376
}
9377
9378
// Field function returns field value.
9379
func (e TenantCreateResponseValidationError) Field() string { return e.field }
9380
9381
// Reason function returns reason value.
9382
func (e TenantCreateResponseValidationError) Reason() string { return e.reason }
9383
9384
// Cause function returns cause value.
9385
func (e TenantCreateResponseValidationError) Cause() error { return e.cause }
9386
9387
// Key function returns key value.
9388
func (e TenantCreateResponseValidationError) Key() bool { return e.key }
9389
9390
// ErrorName returns error name.
9391
func (e TenantCreateResponseValidationError) ErrorName() string {
9392
	return "TenantCreateResponseValidationError"
9393
}
9394
9395
// Error satisfies the builtin error interface
9396
func (e TenantCreateResponseValidationError) Error() string {
9397
	cause := ""
9398
	if e.cause != nil {
9399
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
9400
	}
9401
9402
	key := ""
9403
	if e.key {
9404
		key = "key for "
9405
	}
9406
9407
	return fmt.Sprintf(
9408
		"invalid %sTenantCreateResponse.%s: %s%s",
9409
		key,
9410
		e.field,
9411
		e.reason,
9412
		cause)
9413
}
9414
9415
var _ error = TenantCreateResponseValidationError{}
9416
9417
var _ interface {
9418
	Field() string
9419
	Reason() string
9420
	Key() bool
9421
	Cause() error
9422
	ErrorName() string
9423
} = TenantCreateResponseValidationError{}
9424
9425
// Validate checks the field values on TenantDeleteRequest with the rules
9426
// defined in the proto definition for this message. If any rules are
9427
// violated, the first error encountered is returned, or nil if there are no violations.
9428
func (m *TenantDeleteRequest) Validate() error {
9429
	return m.validate(false)
9430
}
9431
9432
// ValidateAll checks the field values on TenantDeleteRequest with the rules
9433
// defined in the proto definition for this message. If any rules are
9434
// violated, the result is a list of violation errors wrapped in
9435
// TenantDeleteRequestMultiError, or nil if none found.
9436
func (m *TenantDeleteRequest) ValidateAll() error {
9437
	return m.validate(true)
9438
}
9439
9440
func (m *TenantDeleteRequest) validate(all bool) error {
9441
	if m == nil {
9442
		return nil
9443
	}
9444
9445
	var errors []error
9446
9447
	if len(errors) > 0 {
9448
		return TenantDeleteRequestMultiError(errors)
9449
	}
9450
9451
	return nil
9452
}
9453
9454
// TenantDeleteRequestMultiError is an error wrapping multiple validation
9455
// errors returned by TenantDeleteRequest.ValidateAll() if the designated
9456
// constraints aren't met.
9457
type TenantDeleteRequestMultiError []error
9458
9459
// Error returns a concatenation of all the error messages it wraps.
9460
func (m TenantDeleteRequestMultiError) Error() string {
9461
	msgs := make([]string, 0, len(m))
9462
	for _, err := range m {
9463
		msgs = append(msgs, err.Error())
9464
	}
9465
	return strings.Join(msgs, "; ")
9466
}
9467
9468
// AllErrors returns a list of validation violation errors.
9469
func (m TenantDeleteRequestMultiError) AllErrors() []error { return m }
9470
9471
// TenantDeleteRequestValidationError is the validation error returned by
9472
// TenantDeleteRequest.Validate if the designated constraints aren't met.
9473
type TenantDeleteRequestValidationError struct {
9474
	field  string
9475
	reason string
9476
	cause  error
9477
	key    bool
9478
}
9479
9480
// Field function returns field value.
9481
func (e TenantDeleteRequestValidationError) Field() string { return e.field }
9482
9483
// Reason function returns reason value.
9484
func (e TenantDeleteRequestValidationError) Reason() string { return e.reason }
9485
9486
// Cause function returns cause value.
9487
func (e TenantDeleteRequestValidationError) Cause() error { return e.cause }
9488
9489
// Key function returns key value.
9490
func (e TenantDeleteRequestValidationError) Key() bool { return e.key }
9491
9492
// ErrorName returns error name.
9493
func (e TenantDeleteRequestValidationError) ErrorName() string {
9494
	return "TenantDeleteRequestValidationError"
9495
}
9496
9497
// Error satisfies the builtin error interface
9498
func (e TenantDeleteRequestValidationError) Error() string {
9499
	cause := ""
9500
	if e.cause != nil {
9501
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
9502
	}
9503
9504
	key := ""
9505
	if e.key {
9506
		key = "key for "
9507
	}
9508
9509
	return fmt.Sprintf(
9510
		"invalid %sTenantDeleteRequest.%s: %s%s",
9511
		key,
9512
		e.field,
9513
		e.reason,
9514
		cause)
9515
}
9516
9517
var _ error = TenantDeleteRequestValidationError{}
9518
9519
var _ interface {
9520
	Field() string
9521
	Reason() string
9522
	Key() bool
9523
	Cause() error
9524
	ErrorName() string
9525
} = TenantDeleteRequestValidationError{}
9526
9527
// Validate checks the field values on TenantDeleteResponse with the rules
9528
// defined in the proto definition for this message. If any rules are
9529
// violated, the first error encountered is returned, or nil if there are no violations.
9530
func (m *TenantDeleteResponse) Validate() error {
9531
	return m.validate(false)
9532
}
9533
9534
// ValidateAll checks the field values on TenantDeleteResponse with the rules
9535
// defined in the proto definition for this message. If any rules are
9536
// violated, the result is a list of violation errors wrapped in
9537
// TenantDeleteResponseMultiError, or nil if none found.
9538
func (m *TenantDeleteResponse) ValidateAll() error {
9539
	return m.validate(true)
9540
}
9541
9542
func (m *TenantDeleteResponse) validate(all bool) error {
9543
	if m == nil {
9544
		return nil
9545
	}
9546
9547
	var errors []error
9548
9549
	// no validation rules for TenantId
9550
9551
	if len(errors) > 0 {
9552
		return TenantDeleteResponseMultiError(errors)
9553
	}
9554
9555
	return nil
9556
}
9557
9558
// TenantDeleteResponseMultiError is an error wrapping multiple validation
9559
// errors returned by TenantDeleteResponse.ValidateAll() if the designated
9560
// constraints aren't met.
9561
type TenantDeleteResponseMultiError []error
9562
9563
// Error returns a concatenation of all the error messages it wraps.
9564
func (m TenantDeleteResponseMultiError) Error() string {
9565
	msgs := make([]string, 0, len(m))
9566
	for _, err := range m {
9567
		msgs = append(msgs, err.Error())
9568
	}
9569
	return strings.Join(msgs, "; ")
9570
}
9571
9572
// AllErrors returns a list of validation violation errors.
9573
func (m TenantDeleteResponseMultiError) AllErrors() []error { return m }
9574
9575
// TenantDeleteResponseValidationError is the validation error returned by
9576
// TenantDeleteResponse.Validate if the designated constraints aren't met.
9577
type TenantDeleteResponseValidationError struct {
9578
	field  string
9579
	reason string
9580
	cause  error
9581
	key    bool
9582
}
9583
9584
// Field function returns field value.
9585
func (e TenantDeleteResponseValidationError) Field() string { return e.field }
9586
9587
// Reason function returns reason value.
9588
func (e TenantDeleteResponseValidationError) Reason() string { return e.reason }
9589
9590
// Cause function returns cause value.
9591
func (e TenantDeleteResponseValidationError) Cause() error { return e.cause }
9592
9593
// Key function returns key value.
9594
func (e TenantDeleteResponseValidationError) Key() bool { return e.key }
9595
9596
// ErrorName returns error name.
9597
func (e TenantDeleteResponseValidationError) ErrorName() string {
9598
	return "TenantDeleteResponseValidationError"
9599
}
9600
9601
// Error satisfies the builtin error interface
9602
func (e TenantDeleteResponseValidationError) Error() string {
9603
	cause := ""
9604
	if e.cause != nil {
9605
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
9606
	}
9607
9608
	key := ""
9609
	if e.key {
9610
		key = "key for "
9611
	}
9612
9613
	return fmt.Sprintf(
9614
		"invalid %sTenantDeleteResponse.%s: %s%s",
9615
		key,
9616
		e.field,
9617
		e.reason,
9618
		cause)
9619
}
9620
9621
var _ error = TenantDeleteResponseValidationError{}
9622
9623
var _ interface {
9624
	Field() string
9625
	Reason() string
9626
	Key() bool
9627
	Cause() error
9628
	ErrorName() string
9629
} = TenantDeleteResponseValidationError{}
9630
9631
// Validate checks the field values on TenantListRequest with the rules defined
9632
// in the proto definition for this message. If any rules are violated, the
9633
// first error encountered is returned, or nil if there are no violations.
9634
func (m *TenantListRequest) Validate() error {
9635
	return m.validate(false)
9636
}
9637
9638
// ValidateAll checks the field values on TenantListRequest with the rules
9639
// defined in the proto definition for this message. If any rules are
9640
// violated, the result is a list of violation errors wrapped in
9641
// TenantListRequestMultiError, or nil if none found.
9642
func (m *TenantListRequest) ValidateAll() error {
9643
	return m.validate(true)
9644
}
9645
9646
func (m *TenantListRequest) validate(all bool) error {
9647
	if m == nil {
9648
		return nil
9649
	}
9650
9651
	var errors []error
9652
9653
	if m.GetPageSize() != 0 {
9654
9655
		if m.GetPageSize() < 1 {
9656
			err := TenantListRequestValidationError{
9657
				field:  "PageSize",
9658
				reason: "value must be greater than or equal to 1",
9659
			}
9660
			if !all {
9661
				return err
9662
			}
9663
			errors = append(errors, err)
9664
		}
9665
9666
	}
9667
9668
	if m.GetContinuousToken() != "" {
9669
9670
	}
9671
9672
	if len(errors) > 0 {
9673
		return TenantListRequestMultiError(errors)
9674
	}
9675
9676
	return nil
9677
}
9678
9679
// TenantListRequestMultiError is an error wrapping multiple validation errors
9680
// returned by TenantListRequest.ValidateAll() if the designated constraints
9681
// aren't met.
9682
type TenantListRequestMultiError []error
9683
9684
// Error returns a concatenation of all the error messages it wraps.
9685
func (m TenantListRequestMultiError) Error() string {
9686
	msgs := make([]string, 0, len(m))
9687
	for _, err := range m {
9688
		msgs = append(msgs, err.Error())
9689
	}
9690
	return strings.Join(msgs, "; ")
9691
}
9692
9693
// AllErrors returns a list of validation violation errors.
9694
func (m TenantListRequestMultiError) AllErrors() []error { return m }
9695
9696
// TenantListRequestValidationError is the validation error returned by
9697
// TenantListRequest.Validate if the designated constraints aren't met.
9698
type TenantListRequestValidationError struct {
9699
	field  string
9700
	reason string
9701
	cause  error
9702
	key    bool
9703
}
9704
9705
// Field function returns field value.
9706
func (e TenantListRequestValidationError) Field() string { return e.field }
9707
9708
// Reason function returns reason value.
9709
func (e TenantListRequestValidationError) Reason() string { return e.reason }
9710
9711
// Cause function returns cause value.
9712
func (e TenantListRequestValidationError) Cause() error { return e.cause }
9713
9714
// Key function returns key value.
9715
func (e TenantListRequestValidationError) Key() bool { return e.key }
9716
9717
// ErrorName returns error name.
9718
func (e TenantListRequestValidationError) ErrorName() string {
9719
	return "TenantListRequestValidationError"
9720
}
9721
9722
// Error satisfies the builtin error interface
9723
func (e TenantListRequestValidationError) Error() string {
9724
	cause := ""
9725
	if e.cause != nil {
9726
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
9727
	}
9728
9729
	key := ""
9730
	if e.key {
9731
		key = "key for "
9732
	}
9733
9734
	return fmt.Sprintf(
9735
		"invalid %sTenantListRequest.%s: %s%s",
9736
		key,
9737
		e.field,
9738
		e.reason,
9739
		cause)
9740
}
9741
9742
var _ error = TenantListRequestValidationError{}
9743
9744
var _ interface {
9745
	Field() string
9746
	Reason() string
9747
	Key() bool
9748
	Cause() error
9749
	ErrorName() string
9750
} = TenantListRequestValidationError{}
9751
9752
// Validate checks the field values on TenantListResponse with the rules
9753
// defined in the proto definition for this message. If any rules are
9754
// violated, the first error encountered is returned, or nil if there are no violations.
9755
func (m *TenantListResponse) Validate() error {
9756
	return m.validate(false)
9757
}
9758
9759
// ValidateAll checks the field values on TenantListResponse with the rules
9760
// defined in the proto definition for this message. If any rules are
9761
// violated, the result is a list of violation errors wrapped in
9762
// TenantListResponseMultiError, or nil if none found.
9763
func (m *TenantListResponse) ValidateAll() error {
9764
	return m.validate(true)
9765
}
9766
9767
func (m *TenantListResponse) validate(all bool) error {
9768
	if m == nil {
9769
		return nil
9770
	}
9771
9772
	var errors []error
9773
9774
	for idx, item := range m.GetTenants() {
9775
		_, _ = idx, item
9776
9777
		if all {
9778
			switch v := interface{}(item).(type) {
9779
			case interface{ ValidateAll() error }:
9780
				if err := v.ValidateAll(); err != nil {
9781
					errors = append(errors, TenantListResponseValidationError{
9782
						field:  fmt.Sprintf("Tenants[%v]", idx),
9783
						reason: "embedded message failed validation",
9784
						cause:  err,
9785
					})
9786
				}
9787
			case interface{ Validate() error }:
9788
				if err := v.Validate(); err != nil {
9789
					errors = append(errors, TenantListResponseValidationError{
9790
						field:  fmt.Sprintf("Tenants[%v]", idx),
9791
						reason: "embedded message failed validation",
9792
						cause:  err,
9793
					})
9794
				}
9795
			}
9796
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
9797
			if err := v.Validate(); err != nil {
9798
				return TenantListResponseValidationError{
9799
					field:  fmt.Sprintf("Tenants[%v]", idx),
9800
					reason: "embedded message failed validation",
9801
					cause:  err,
9802
				}
9803
			}
9804
		}
9805
9806
	}
9807
9808
	// no validation rules for ContinuousToken
9809
9810
	if len(errors) > 0 {
9811
		return TenantListResponseMultiError(errors)
9812
	}
9813
9814
	return nil
9815
}
9816
9817
// TenantListResponseMultiError is an error wrapping multiple validation errors
9818
// returned by TenantListResponse.ValidateAll() if the designated constraints
9819
// aren't met.
9820
type TenantListResponseMultiError []error
9821
9822
// Error returns a concatenation of all the error messages it wraps.
9823
func (m TenantListResponseMultiError) Error() string {
9824
	msgs := make([]string, 0, len(m))
9825
	for _, err := range m {
9826
		msgs = append(msgs, err.Error())
9827
	}
9828
	return strings.Join(msgs, "; ")
9829
}
9830
9831
// AllErrors returns a list of validation violation errors.
9832
func (m TenantListResponseMultiError) AllErrors() []error { return m }
9833
9834
// TenantListResponseValidationError is the validation error returned by
9835
// TenantListResponse.Validate if the designated constraints aren't met.
9836
type TenantListResponseValidationError struct {
9837
	field  string
9838
	reason string
9839
	cause  error
9840
	key    bool
9841
}
9842
9843
// Field function returns field value.
9844
func (e TenantListResponseValidationError) Field() string { return e.field }
9845
9846
// Reason function returns reason value.
9847
func (e TenantListResponseValidationError) Reason() string { return e.reason }
9848
9849
// Cause function returns cause value.
9850
func (e TenantListResponseValidationError) Cause() error { return e.cause }
9851
9852
// Key function returns key value.
9853
func (e TenantListResponseValidationError) Key() bool { return e.key }
9854
9855
// ErrorName returns error name.
9856
func (e TenantListResponseValidationError) ErrorName() string {
9857
	return "TenantListResponseValidationError"
9858
}
9859
9860
// Error satisfies the builtin error interface
9861
func (e TenantListResponseValidationError) Error() string {
9862
	cause := ""
9863
	if e.cause != nil {
9864
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
9865
	}
9866
9867
	key := ""
9868
	if e.key {
9869
		key = "key for "
9870
	}
9871
9872
	return fmt.Sprintf(
9873
		"invalid %sTenantListResponse.%s: %s%s",
9874
		key,
9875
		e.field,
9876
		e.reason,
9877
		cause)
9878
}
9879
9880
var _ error = TenantListResponseValidationError{}
9881
9882
var _ interface {
9883
	Field() string
9884
	Reason() string
9885
	Key() bool
9886
	Cause() error
9887
	ErrorName() string
9888
} = TenantListResponseValidationError{}
9889