Passed
Pull Request — master (#1153)
by Tolga
02:32
created

basev1.*RelationshipWriteRequestMetadata.validate   A

Complexity

Conditions 3

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

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