Passed
Push — master ( 136f25...d79624 )
by Tolga
01:26 queued 27s
created

basev1.*SchemaListResponse.validate   C

Complexity

Conditions 11

Size

Total Lines 50
Code Lines 29

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 11
eloc 29
nop 1
dl 0
loc 50
rs 5.4
c 0
b 0
f 0

How to fix   Complexity   

Complexity

Complex classes like basev1.*SchemaListResponse.validate often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

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()) > 64 {
750
		err := PermissionExpandRequestValidationError{
751
			field:  "TenantId",
752
			reason: "value length must be at most 64 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-,]+\"",
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-,]+")
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()) > 64 {
3294
		err := WatchRequestValidationError{
3295
			field:  "TenantId",
3296
			reason: "value length must be at most 64 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-,]+\"",
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-,]+")
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 SchemaReadRequest with the rules defined
3758
// in the proto definition for this message. If any rules are violated, the
3759
// first error encountered is returned, or nil if there are no violations.
3760
func (m *SchemaReadRequest) Validate() error {
3761
	return m.validate(false)
3762
}
3763
3764
// ValidateAll checks the field values on SchemaReadRequest with the rules
3765
// 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
// SchemaReadRequestMultiError, or nil if none found.
3768
func (m *SchemaReadRequest) ValidateAll() error {
3769
	return m.validate(true)
3770
}
3771
3772
func (m *SchemaReadRequest) 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 := SchemaReadRequestValidationError{
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 !_SchemaReadRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
3791
		err := SchemaReadRequestValidationError{
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 := SchemaReadRequestValidationError{
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, SchemaReadRequestValidationError{
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, SchemaReadRequestValidationError{
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 SchemaReadRequestValidationError{
3834
				field:  "Metadata",
3835
				reason: "embedded message failed validation",
3836
				cause:  err,
3837
			}
3838
		}
3839
	}
3840
3841
	if len(errors) > 0 {
3842
		return SchemaReadRequestMultiError(errors)
3843
	}
3844
3845
	return nil
3846
}
3847
3848
// SchemaReadRequestMultiError is an error wrapping multiple validation errors
3849
// returned by SchemaReadRequest.ValidateAll() if the designated constraints
3850
// aren't met.
3851
type SchemaReadRequestMultiError []error
3852
3853
// Error returns a concatenation of all the error messages it wraps.
3854
func (m SchemaReadRequestMultiError) Error() string {
3855
	var msgs []string
3856
	for _, err := range m {
3857
		msgs = append(msgs, err.Error())
3858
	}
3859
	return strings.Join(msgs, "; ")
3860
}
3861
3862
// AllErrors returns a list of validation violation errors.
3863
func (m SchemaReadRequestMultiError) AllErrors() []error { return m }
3864
3865
// SchemaReadRequestValidationError is the validation error returned by
3866
// SchemaReadRequest.Validate if the designated constraints aren't met.
3867
type SchemaReadRequestValidationError struct {
3868
	field  string
3869
	reason string
3870
	cause  error
3871
	key    bool
3872
}
3873
3874
// Field function returns field value.
3875
func (e SchemaReadRequestValidationError) Field() string { return e.field }
3876
3877
// Reason function returns reason value.
3878
func (e SchemaReadRequestValidationError) Reason() string { return e.reason }
3879
3880
// Cause function returns cause value.
3881
func (e SchemaReadRequestValidationError) Cause() error { return e.cause }
3882
3883
// Key function returns key value.
3884
func (e SchemaReadRequestValidationError) Key() bool { return e.key }
3885
3886
// ErrorName returns error name.
3887
func (e SchemaReadRequestValidationError) ErrorName() string {
3888
	return "SchemaReadRequestValidationError"
3889
}
3890
3891
// Error satisfies the builtin error interface
3892
func (e SchemaReadRequestValidationError) Error() string {
3893
	cause := ""
3894
	if e.cause != nil {
3895
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
3896
	}
3897
3898
	key := ""
3899
	if e.key {
3900
		key = "key for "
3901
	}
3902
3903
	return fmt.Sprintf(
3904
		"invalid %sSchemaReadRequest.%s: %s%s",
3905
		key,
3906
		e.field,
3907
		e.reason,
3908
		cause)
3909
}
3910
3911
var _ error = SchemaReadRequestValidationError{}
3912
3913
var _ interface {
3914
	Field() string
3915
	Reason() string
3916
	Key() bool
3917
	Cause() error
3918
	ErrorName() string
3919
} = SchemaReadRequestValidationError{}
3920
3921
var _SchemaReadRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
3922
3923
// Validate checks the field values on SchemaReadRequestMetadata with the rules
3924
// defined in the proto definition for this message. If any rules are
3925
// violated, the first error encountered is returned, or nil if there are no violations.
3926
func (m *SchemaReadRequestMetadata) Validate() error {
3927
	return m.validate(false)
3928
}
3929
3930
// ValidateAll checks the field values on SchemaReadRequestMetadata with the
3931
// rules defined in the proto definition for this message. If any rules are
3932
// violated, the result is a list of violation errors wrapped in
3933
// SchemaReadRequestMetadataMultiError, or nil if none found.
3934
func (m *SchemaReadRequestMetadata) ValidateAll() error {
3935
	return m.validate(true)
3936
}
3937
3938
func (m *SchemaReadRequestMetadata) validate(all bool) error {
3939
	if m == nil {
3940
		return nil
3941
	}
3942
3943
	var errors []error
3944
3945
	// no validation rules for SchemaVersion
3946
3947
	if len(errors) > 0 {
3948
		return SchemaReadRequestMetadataMultiError(errors)
3949
	}
3950
3951
	return nil
3952
}
3953
3954
// SchemaReadRequestMetadataMultiError is an error wrapping multiple validation
3955
// errors returned by SchemaReadRequestMetadata.ValidateAll() if the
3956
// designated constraints aren't met.
3957
type SchemaReadRequestMetadataMultiError []error
3958
3959
// Error returns a concatenation of all the error messages it wraps.
3960
func (m SchemaReadRequestMetadataMultiError) Error() string {
3961
	var msgs []string
3962
	for _, err := range m {
3963
		msgs = append(msgs, err.Error())
3964
	}
3965
	return strings.Join(msgs, "; ")
3966
}
3967
3968
// AllErrors returns a list of validation violation errors.
3969
func (m SchemaReadRequestMetadataMultiError) AllErrors() []error { return m }
3970
3971
// SchemaReadRequestMetadataValidationError is the validation error returned by
3972
// SchemaReadRequestMetadata.Validate if the designated constraints aren't met.
3973
type SchemaReadRequestMetadataValidationError struct {
3974
	field  string
3975
	reason string
3976
	cause  error
3977
	key    bool
3978
}
3979
3980
// Field function returns field value.
3981
func (e SchemaReadRequestMetadataValidationError) Field() string { return e.field }
3982
3983
// Reason function returns reason value.
3984
func (e SchemaReadRequestMetadataValidationError) Reason() string { return e.reason }
3985
3986
// Cause function returns cause value.
3987
func (e SchemaReadRequestMetadataValidationError) Cause() error { return e.cause }
3988
3989
// Key function returns key value.
3990
func (e SchemaReadRequestMetadataValidationError) Key() bool { return e.key }
3991
3992
// ErrorName returns error name.
3993
func (e SchemaReadRequestMetadataValidationError) ErrorName() string {
3994
	return "SchemaReadRequestMetadataValidationError"
3995
}
3996
3997
// Error satisfies the builtin error interface
3998
func (e SchemaReadRequestMetadataValidationError) Error() string {
3999
	cause := ""
4000
	if e.cause != nil {
4001
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
4002
	}
4003
4004
	key := ""
4005
	if e.key {
4006
		key = "key for "
4007
	}
4008
4009
	return fmt.Sprintf(
4010
		"invalid %sSchemaReadRequestMetadata.%s: %s%s",
4011
		key,
4012
		e.field,
4013
		e.reason,
4014
		cause)
4015
}
4016
4017
var _ error = SchemaReadRequestMetadataValidationError{}
4018
4019
var _ interface {
4020
	Field() string
4021
	Reason() string
4022
	Key() bool
4023
	Cause() error
4024
	ErrorName() string
4025
} = SchemaReadRequestMetadataValidationError{}
4026
4027
// Validate checks the field values on SchemaReadResponse with the rules
4028
// defined in the proto definition for this message. If any rules are
4029
// violated, the first error encountered is returned, or nil if there are no violations.
4030
func (m *SchemaReadResponse) Validate() error {
4031
	return m.validate(false)
4032
}
4033
4034
// ValidateAll checks the field values on SchemaReadResponse with the rules
4035
// defined in the proto definition for this message. If any rules are
4036
// violated, the result is a list of violation errors wrapped in
4037
// SchemaReadResponseMultiError, or nil if none found.
4038
func (m *SchemaReadResponse) ValidateAll() error {
4039
	return m.validate(true)
4040
}
4041
4042
func (m *SchemaReadResponse) validate(all bool) error {
4043
	if m == nil {
4044
		return nil
4045
	}
4046
4047
	var errors []error
4048
4049
	if all {
4050
		switch v := interface{}(m.GetSchema()).(type) {
4051
		case interface{ ValidateAll() error }:
4052
			if err := v.ValidateAll(); err != nil {
4053
				errors = append(errors, SchemaReadResponseValidationError{
4054
					field:  "Schema",
4055
					reason: "embedded message failed validation",
4056
					cause:  err,
4057
				})
4058
			}
4059
		case interface{ Validate() error }:
4060
			if err := v.Validate(); err != nil {
4061
				errors = append(errors, SchemaReadResponseValidationError{
4062
					field:  "Schema",
4063
					reason: "embedded message failed validation",
4064
					cause:  err,
4065
				})
4066
			}
4067
		}
4068
	} else if v, ok := interface{}(m.GetSchema()).(interface{ Validate() error }); ok {
4069
		if err := v.Validate(); err != nil {
4070
			return SchemaReadResponseValidationError{
4071
				field:  "Schema",
4072
				reason: "embedded message failed validation",
4073
				cause:  err,
4074
			}
4075
		}
4076
	}
4077
4078
	if len(errors) > 0 {
4079
		return SchemaReadResponseMultiError(errors)
4080
	}
4081
4082
	return nil
4083
}
4084
4085
// SchemaReadResponseMultiError is an error wrapping multiple validation errors
4086
// returned by SchemaReadResponse.ValidateAll() if the designated constraints
4087
// aren't met.
4088
type SchemaReadResponseMultiError []error
4089
4090
// Error returns a concatenation of all the error messages it wraps.
4091
func (m SchemaReadResponseMultiError) Error() string {
4092
	var msgs []string
4093
	for _, err := range m {
4094
		msgs = append(msgs, err.Error())
4095
	}
4096
	return strings.Join(msgs, "; ")
4097
}
4098
4099
// AllErrors returns a list of validation violation errors.
4100
func (m SchemaReadResponseMultiError) AllErrors() []error { return m }
4101
4102
// SchemaReadResponseValidationError is the validation error returned by
4103
// SchemaReadResponse.Validate if the designated constraints aren't met.
4104
type SchemaReadResponseValidationError struct {
4105
	field  string
4106
	reason string
4107
	cause  error
4108
	key    bool
4109
}
4110
4111
// Field function returns field value.
4112
func (e SchemaReadResponseValidationError) Field() string { return e.field }
4113
4114
// Reason function returns reason value.
4115
func (e SchemaReadResponseValidationError) Reason() string { return e.reason }
4116
4117
// Cause function returns cause value.
4118
func (e SchemaReadResponseValidationError) Cause() error { return e.cause }
4119
4120
// Key function returns key value.
4121
func (e SchemaReadResponseValidationError) Key() bool { return e.key }
4122
4123
// ErrorName returns error name.
4124
func (e SchemaReadResponseValidationError) ErrorName() string {
4125
	return "SchemaReadResponseValidationError"
4126
}
4127
4128
// Error satisfies the builtin error interface
4129
func (e SchemaReadResponseValidationError) Error() string {
4130
	cause := ""
4131
	if e.cause != nil {
4132
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
4133
	}
4134
4135
	key := ""
4136
	if e.key {
4137
		key = "key for "
4138
	}
4139
4140
	return fmt.Sprintf(
4141
		"invalid %sSchemaReadResponse.%s: %s%s",
4142
		key,
4143
		e.field,
4144
		e.reason,
4145
		cause)
4146
}
4147
4148
var _ error = SchemaReadResponseValidationError{}
4149
4150
var _ interface {
4151
	Field() string
4152
	Reason() string
4153
	Key() bool
4154
	Cause() error
4155
	ErrorName() string
4156
} = SchemaReadResponseValidationError{}
4157
4158
// Validate checks the field values on SchemaListRequest with the rules defined
4159
// in the proto definition for this message. If any rules are violated, the
4160
// first error encountered is returned, or nil if there are no violations.
4161
func (m *SchemaListRequest) Validate() error {
4162
	return m.validate(false)
4163
}
4164
4165
// ValidateAll checks the field values on SchemaListRequest with the rules
4166
// defined in the proto definition for this message. If any rules are
4167
// violated, the result is a list of violation errors wrapped in
4168
// SchemaListRequestMultiError, or nil if none found.
4169
func (m *SchemaListRequest) ValidateAll() error {
4170
	return m.validate(true)
4171
}
4172
4173
func (m *SchemaListRequest) validate(all bool) error {
4174
	if m == nil {
4175
		return nil
4176
	}
4177
4178
	var errors []error
4179
4180
	if len(m.GetTenantId()) > 128 {
4181
		err := SchemaListRequestValidationError{
4182
			field:  "TenantId",
4183
			reason: "value length must be at most 128 bytes",
4184
		}
4185
		if !all {
4186
			return err
4187
		}
4188
		errors = append(errors, err)
4189
	}
4190
4191
	if !_SchemaListRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
4192
		err := SchemaListRequestValidationError{
4193
			field:  "TenantId",
4194
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
4195
		}
4196
		if !all {
4197
			return err
4198
		}
4199
		errors = append(errors, err)
4200
	}
4201
4202
	if m.GetPageSize() != 0 {
4203
4204
		if val := m.GetPageSize(); val < 1 || val > 100 {
4205
			err := SchemaListRequestValidationError{
4206
				field:  "PageSize",
4207
				reason: "value must be inside range [1, 100]",
4208
			}
4209
			if !all {
4210
				return err
4211
			}
4212
			errors = append(errors, err)
4213
		}
4214
4215
	}
4216
4217
	if m.GetContinuousToken() != "" {
4218
4219
	}
4220
4221
	if len(errors) > 0 {
4222
		return SchemaListRequestMultiError(errors)
4223
	}
4224
4225
	return nil
4226
}
4227
4228
// SchemaListRequestMultiError is an error wrapping multiple validation errors
4229
// returned by SchemaListRequest.ValidateAll() if the designated constraints
4230
// aren't met.
4231
type SchemaListRequestMultiError []error
4232
4233
// Error returns a concatenation of all the error messages it wraps.
4234
func (m SchemaListRequestMultiError) Error() string {
4235
	var msgs []string
4236
	for _, err := range m {
4237
		msgs = append(msgs, err.Error())
4238
	}
4239
	return strings.Join(msgs, "; ")
4240
}
4241
4242
// AllErrors returns a list of validation violation errors.
4243
func (m SchemaListRequestMultiError) AllErrors() []error { return m }
4244
4245
// SchemaListRequestValidationError is the validation error returned by
4246
// SchemaListRequest.Validate if the designated constraints aren't met.
4247
type SchemaListRequestValidationError struct {
4248
	field  string
4249
	reason string
4250
	cause  error
4251
	key    bool
4252
}
4253
4254
// Field function returns field value.
4255
func (e SchemaListRequestValidationError) Field() string { return e.field }
4256
4257
// Reason function returns reason value.
4258
func (e SchemaListRequestValidationError) Reason() string { return e.reason }
4259
4260
// Cause function returns cause value.
4261
func (e SchemaListRequestValidationError) Cause() error { return e.cause }
4262
4263
// Key function returns key value.
4264
func (e SchemaListRequestValidationError) Key() bool { return e.key }
4265
4266
// ErrorName returns error name.
4267
func (e SchemaListRequestValidationError) ErrorName() string {
4268
	return "SchemaListRequestValidationError"
4269
}
4270
4271
// Error satisfies the builtin error interface
4272
func (e SchemaListRequestValidationError) Error() string {
4273
	cause := ""
4274
	if e.cause != nil {
4275
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
4276
	}
4277
4278
	key := ""
4279
	if e.key {
4280
		key = "key for "
4281
	}
4282
4283
	return fmt.Sprintf(
4284
		"invalid %sSchemaListRequest.%s: %s%s",
4285
		key,
4286
		e.field,
4287
		e.reason,
4288
		cause)
4289
}
4290
4291
var _ error = SchemaListRequestValidationError{}
4292
4293
var _ interface {
4294
	Field() string
4295
	Reason() string
4296
	Key() bool
4297
	Cause() error
4298
	ErrorName() string
4299
} = SchemaListRequestValidationError{}
4300
4301
var _SchemaListRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
4302
4303
// Validate checks the field values on SchemaListResponse with the rules
4304
// defined in the proto definition for this message. If any rules are
4305
// violated, the first error encountered is returned, or nil if there are no violations.
4306
func (m *SchemaListResponse) Validate() error {
4307
	return m.validate(false)
4308
}
4309
4310
// ValidateAll checks the field values on SchemaListResponse with the rules
4311
// defined in the proto definition for this message. If any rules are
4312
// violated, the result is a list of violation errors wrapped in
4313
// SchemaListResponseMultiError, or nil if none found.
4314
func (m *SchemaListResponse) ValidateAll() error {
4315
	return m.validate(true)
4316
}
4317
4318
func (m *SchemaListResponse) validate(all bool) error {
4319
	if m == nil {
4320
		return nil
4321
	}
4322
4323
	var errors []error
4324
4325
	// no validation rules for Head
4326
4327
	for idx, item := range m.GetSchemas() {
4328
		_, _ = idx, item
4329
4330
		if all {
4331
			switch v := interface{}(item).(type) {
4332
			case interface{ ValidateAll() error }:
4333
				if err := v.ValidateAll(); err != nil {
4334
					errors = append(errors, SchemaListResponseValidationError{
4335
						field:  fmt.Sprintf("Schemas[%v]", idx),
4336
						reason: "embedded message failed validation",
4337
						cause:  err,
4338
					})
4339
				}
4340
			case interface{ Validate() error }:
4341
				if err := v.Validate(); err != nil {
4342
					errors = append(errors, SchemaListResponseValidationError{
4343
						field:  fmt.Sprintf("Schemas[%v]", idx),
4344
						reason: "embedded message failed validation",
4345
						cause:  err,
4346
					})
4347
				}
4348
			}
4349
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
4350
			if err := v.Validate(); err != nil {
4351
				return SchemaListResponseValidationError{
4352
					field:  fmt.Sprintf("Schemas[%v]", idx),
4353
					reason: "embedded message failed validation",
4354
					cause:  err,
4355
				}
4356
			}
4357
		}
4358
4359
	}
4360
4361
	// no validation rules for ContinuousToken
4362
4363
	if len(errors) > 0 {
4364
		return SchemaListResponseMultiError(errors)
4365
	}
4366
4367
	return nil
4368
}
4369
4370
// SchemaListResponseMultiError is an error wrapping multiple validation errors
4371
// returned by SchemaListResponse.ValidateAll() if the designated constraints
4372
// aren't met.
4373
type SchemaListResponseMultiError []error
4374
4375
// Error returns a concatenation of all the error messages it wraps.
4376
func (m SchemaListResponseMultiError) Error() string {
4377
	var msgs []string
4378
	for _, err := range m {
4379
		msgs = append(msgs, err.Error())
4380
	}
4381
	return strings.Join(msgs, "; ")
4382
}
4383
4384
// AllErrors returns a list of validation violation errors.
4385
func (m SchemaListResponseMultiError) AllErrors() []error { return m }
4386
4387
// SchemaListResponseValidationError is the validation error returned by
4388
// SchemaListResponse.Validate if the designated constraints aren't met.
4389
type SchemaListResponseValidationError struct {
4390
	field  string
4391
	reason string
4392
	cause  error
4393
	key    bool
4394
}
4395
4396
// Field function returns field value.
4397
func (e SchemaListResponseValidationError) Field() string { return e.field }
4398
4399
// Reason function returns reason value.
4400
func (e SchemaListResponseValidationError) Reason() string { return e.reason }
4401
4402
// Cause function returns cause value.
4403
func (e SchemaListResponseValidationError) Cause() error { return e.cause }
4404
4405
// Key function returns key value.
4406
func (e SchemaListResponseValidationError) Key() bool { return e.key }
4407
4408
// ErrorName returns error name.
4409
func (e SchemaListResponseValidationError) ErrorName() string {
4410
	return "SchemaListResponseValidationError"
4411
}
4412
4413
// Error satisfies the builtin error interface
4414
func (e SchemaListResponseValidationError) Error() string {
4415
	cause := ""
4416
	if e.cause != nil {
4417
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
4418
	}
4419
4420
	key := ""
4421
	if e.key {
4422
		key = "key for "
4423
	}
4424
4425
	return fmt.Sprintf(
4426
		"invalid %sSchemaListResponse.%s: %s%s",
4427
		key,
4428
		e.field,
4429
		e.reason,
4430
		cause)
4431
}
4432
4433
var _ error = SchemaListResponseValidationError{}
4434
4435
var _ interface {
4436
	Field() string
4437
	Reason() string
4438
	Key() bool
4439
	Cause() error
4440
	ErrorName() string
4441
} = SchemaListResponseValidationError{}
4442
4443
// Validate checks the field values on SchemaList with the rules defined in the
4444
// proto definition for this message. If any rules are violated, the first
4445
// error encountered is returned, or nil if there are no violations.
4446
func (m *SchemaList) Validate() error {
4447
	return m.validate(false)
4448
}
4449
4450
// ValidateAll checks the field values on SchemaList with the rules defined in
4451
// the proto definition for this message. If any rules are violated, the
4452
// result is a list of violation errors wrapped in SchemaListMultiError, or
4453
// nil if none found.
4454
func (m *SchemaList) ValidateAll() error {
4455
	return m.validate(true)
4456
}
4457
4458
func (m *SchemaList) validate(all bool) error {
4459
	if m == nil {
4460
		return nil
4461
	}
4462
4463
	var errors []error
4464
4465
	// no validation rules for Version
4466
4467
	// no validation rules for CreatedAt
4468
4469
	if len(errors) > 0 {
4470
		return SchemaListMultiError(errors)
4471
	}
4472
4473
	return nil
4474
}
4475
4476
// SchemaListMultiError is an error wrapping multiple validation errors
4477
// returned by SchemaList.ValidateAll() if the designated constraints aren't met.
4478
type SchemaListMultiError []error
4479
4480
// Error returns a concatenation of all the error messages it wraps.
4481
func (m SchemaListMultiError) Error() string {
4482
	var msgs []string
4483
	for _, err := range m {
4484
		msgs = append(msgs, err.Error())
4485
	}
4486
	return strings.Join(msgs, "; ")
4487
}
4488
4489
// AllErrors returns a list of validation violation errors.
4490
func (m SchemaListMultiError) AllErrors() []error { return m }
4491
4492
// SchemaListValidationError is the validation error returned by
4493
// SchemaList.Validate if the designated constraints aren't met.
4494
type SchemaListValidationError struct {
4495
	field  string
4496
	reason string
4497
	cause  error
4498
	key    bool
4499
}
4500
4501
// Field function returns field value.
4502
func (e SchemaListValidationError) Field() string { return e.field }
4503
4504
// Reason function returns reason value.
4505
func (e SchemaListValidationError) Reason() string { return e.reason }
4506
4507
// Cause function returns cause value.
4508
func (e SchemaListValidationError) Cause() error { return e.cause }
4509
4510
// Key function returns key value.
4511
func (e SchemaListValidationError) Key() bool { return e.key }
4512
4513
// ErrorName returns error name.
4514
func (e SchemaListValidationError) ErrorName() string { return "SchemaListValidationError" }
4515
4516
// Error satisfies the builtin error interface
4517
func (e SchemaListValidationError) Error() string {
4518
	cause := ""
4519
	if e.cause != nil {
4520
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
4521
	}
4522
4523
	key := ""
4524
	if e.key {
4525
		key = "key for "
4526
	}
4527
4528
	return fmt.Sprintf(
4529
		"invalid %sSchemaList.%s: %s%s",
4530
		key,
4531
		e.field,
4532
		e.reason,
4533
		cause)
4534
}
4535
4536
var _ error = SchemaListValidationError{}
4537
4538
var _ interface {
4539
	Field() string
4540
	Reason() string
4541
	Key() bool
4542
	Cause() error
4543
	ErrorName() string
4544
} = SchemaListValidationError{}
4545
4546
// Validate checks the field values on DataWriteRequest with the rules defined
4547
// in the proto definition for this message. If any rules are violated, the
4548
// first error encountered is returned, or nil if there are no violations.
4549
func (m *DataWriteRequest) Validate() error {
4550
	return m.validate(false)
4551
}
4552
4553
// ValidateAll checks the field values on DataWriteRequest with the rules
4554
// defined in the proto definition for this message. If any rules are
4555
// violated, the result is a list of violation errors wrapped in
4556
// DataWriteRequestMultiError, or nil if none found.
4557
func (m *DataWriteRequest) ValidateAll() error {
4558
	return m.validate(true)
4559
}
4560
4561
func (m *DataWriteRequest) validate(all bool) error {
4562
	if m == nil {
4563
		return nil
4564
	}
4565
4566
	var errors []error
4567
4568
	if len(m.GetTenantId()) > 128 {
4569
		err := DataWriteRequestValidationError{
4570
			field:  "TenantId",
4571
			reason: "value length must be at most 128 bytes",
4572
		}
4573
		if !all {
4574
			return err
4575
		}
4576
		errors = append(errors, err)
4577
	}
4578
4579
	if !_DataWriteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
4580
		err := DataWriteRequestValidationError{
4581
			field:  "TenantId",
4582
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
4583
		}
4584
		if !all {
4585
			return err
4586
		}
4587
		errors = append(errors, err)
4588
	}
4589
4590
	if m.GetMetadata() == nil {
4591
		err := DataWriteRequestValidationError{
4592
			field:  "Metadata",
4593
			reason: "value is required",
4594
		}
4595
		if !all {
4596
			return err
4597
		}
4598
		errors = append(errors, err)
4599
	}
4600
4601
	if all {
4602
		switch v := interface{}(m.GetMetadata()).(type) {
4603
		case interface{ ValidateAll() error }:
4604
			if err := v.ValidateAll(); err != nil {
4605
				errors = append(errors, DataWriteRequestValidationError{
4606
					field:  "Metadata",
4607
					reason: "embedded message failed validation",
4608
					cause:  err,
4609
				})
4610
			}
4611
		case interface{ Validate() error }:
4612
			if err := v.Validate(); err != nil {
4613
				errors = append(errors, DataWriteRequestValidationError{
4614
					field:  "Metadata",
4615
					reason: "embedded message failed validation",
4616
					cause:  err,
4617
				})
4618
			}
4619
		}
4620
	} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
4621
		if err := v.Validate(); err != nil {
4622
			return DataWriteRequestValidationError{
4623
				field:  "Metadata",
4624
				reason: "embedded message failed validation",
4625
				cause:  err,
4626
			}
4627
		}
4628
	}
4629
4630
	if len(m.GetTuples()) > 100 {
4631
		err := DataWriteRequestValidationError{
4632
			field:  "Tuples",
4633
			reason: "value must contain no more than 100 item(s)",
4634
		}
4635
		if !all {
4636
			return err
4637
		}
4638
		errors = append(errors, err)
4639
	}
4640
4641
	for idx, item := range m.GetTuples() {
4642
		_, _ = idx, item
4643
4644
		if item == nil {
4645
			err := DataWriteRequestValidationError{
4646
				field:  fmt.Sprintf("Tuples[%v]", idx),
4647
				reason: "value is required",
4648
			}
4649
			if !all {
4650
				return err
4651
			}
4652
			errors = append(errors, err)
4653
		}
4654
4655
		if all {
4656
			switch v := interface{}(item).(type) {
4657
			case interface{ ValidateAll() error }:
4658
				if err := v.ValidateAll(); err != nil {
4659
					errors = append(errors, DataWriteRequestValidationError{
4660
						field:  fmt.Sprintf("Tuples[%v]", idx),
4661
						reason: "embedded message failed validation",
4662
						cause:  err,
4663
					})
4664
				}
4665
			case interface{ Validate() error }:
4666
				if err := v.Validate(); err != nil {
4667
					errors = append(errors, DataWriteRequestValidationError{
4668
						field:  fmt.Sprintf("Tuples[%v]", idx),
4669
						reason: "embedded message failed validation",
4670
						cause:  err,
4671
					})
4672
				}
4673
			}
4674
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
4675
			if err := v.Validate(); err != nil {
4676
				return DataWriteRequestValidationError{
4677
					field:  fmt.Sprintf("Tuples[%v]", idx),
4678
					reason: "embedded message failed validation",
4679
					cause:  err,
4680
				}
4681
			}
4682
		}
4683
4684
	}
4685
4686
	if len(m.GetAttributes()) > 100 {
4687
		err := DataWriteRequestValidationError{
4688
			field:  "Attributes",
4689
			reason: "value must contain no more than 100 item(s)",
4690
		}
4691
		if !all {
4692
			return err
4693
		}
4694
		errors = append(errors, err)
4695
	}
4696
4697
	for idx, item := range m.GetAttributes() {
4698
		_, _ = idx, item
4699
4700
		if item == nil {
4701
			err := DataWriteRequestValidationError{
4702
				field:  fmt.Sprintf("Attributes[%v]", idx),
4703
				reason: "value is required",
4704
			}
4705
			if !all {
4706
				return err
4707
			}
4708
			errors = append(errors, err)
4709
		}
4710
4711
		if all {
4712
			switch v := interface{}(item).(type) {
4713
			case interface{ ValidateAll() error }:
4714
				if err := v.ValidateAll(); err != nil {
4715
					errors = append(errors, DataWriteRequestValidationError{
4716
						field:  fmt.Sprintf("Attributes[%v]", idx),
4717
						reason: "embedded message failed validation",
4718
						cause:  err,
4719
					})
4720
				}
4721
			case interface{ Validate() error }:
4722
				if err := v.Validate(); err != nil {
4723
					errors = append(errors, DataWriteRequestValidationError{
4724
						field:  fmt.Sprintf("Attributes[%v]", idx),
4725
						reason: "embedded message failed validation",
4726
						cause:  err,
4727
					})
4728
				}
4729
			}
4730
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
4731
			if err := v.Validate(); err != nil {
4732
				return DataWriteRequestValidationError{
4733
					field:  fmt.Sprintf("Attributes[%v]", idx),
4734
					reason: "embedded message failed validation",
4735
					cause:  err,
4736
				}
4737
			}
4738
		}
4739
4740
	}
4741
4742
	if len(errors) > 0 {
4743
		return DataWriteRequestMultiError(errors)
4744
	}
4745
4746
	return nil
4747
}
4748
4749
// DataWriteRequestMultiError is an error wrapping multiple validation errors
4750
// returned by DataWriteRequest.ValidateAll() if the designated constraints
4751
// aren't met.
4752
type DataWriteRequestMultiError []error
4753
4754
// Error returns a concatenation of all the error messages it wraps.
4755
func (m DataWriteRequestMultiError) Error() string {
4756
	var msgs []string
4757
	for _, err := range m {
4758
		msgs = append(msgs, err.Error())
4759
	}
4760
	return strings.Join(msgs, "; ")
4761
}
4762
4763
// AllErrors returns a list of validation violation errors.
4764
func (m DataWriteRequestMultiError) AllErrors() []error { return m }
4765
4766
// DataWriteRequestValidationError is the validation error returned by
4767
// DataWriteRequest.Validate if the designated constraints aren't met.
4768
type DataWriteRequestValidationError struct {
4769
	field  string
4770
	reason string
4771
	cause  error
4772
	key    bool
4773
}
4774
4775
// Field function returns field value.
4776
func (e DataWriteRequestValidationError) Field() string { return e.field }
4777
4778
// Reason function returns reason value.
4779
func (e DataWriteRequestValidationError) Reason() string { return e.reason }
4780
4781
// Cause function returns cause value.
4782
func (e DataWriteRequestValidationError) Cause() error { return e.cause }
4783
4784
// Key function returns key value.
4785
func (e DataWriteRequestValidationError) Key() bool { return e.key }
4786
4787
// ErrorName returns error name.
4788
func (e DataWriteRequestValidationError) ErrorName() string { return "DataWriteRequestValidationError" }
4789
4790
// Error satisfies the builtin error interface
4791
func (e DataWriteRequestValidationError) Error() string {
4792
	cause := ""
4793
	if e.cause != nil {
4794
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
4795
	}
4796
4797
	key := ""
4798
	if e.key {
4799
		key = "key for "
4800
	}
4801
4802
	return fmt.Sprintf(
4803
		"invalid %sDataWriteRequest.%s: %s%s",
4804
		key,
4805
		e.field,
4806
		e.reason,
4807
		cause)
4808
}
4809
4810
var _ error = DataWriteRequestValidationError{}
4811
4812
var _ interface {
4813
	Field() string
4814
	Reason() string
4815
	Key() bool
4816
	Cause() error
4817
	ErrorName() string
4818
} = DataWriteRequestValidationError{}
4819
4820
var _DataWriteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
4821
4822
// Validate checks the field values on DataWriteRequestMetadata with the rules
4823
// defined in the proto definition for this message. If any rules are
4824
// violated, the first error encountered is returned, or nil if there are no violations.
4825
func (m *DataWriteRequestMetadata) Validate() error {
4826
	return m.validate(false)
4827
}
4828
4829
// ValidateAll checks the field values on DataWriteRequestMetadata with the
4830
// rules defined in the proto definition for this message. If any rules are
4831
// violated, the result is a list of violation errors wrapped in
4832
// DataWriteRequestMetadataMultiError, or nil if none found.
4833
func (m *DataWriteRequestMetadata) ValidateAll() error {
4834
	return m.validate(true)
4835
}
4836
4837
func (m *DataWriteRequestMetadata) validate(all bool) error {
4838
	if m == nil {
4839
		return nil
4840
	}
4841
4842
	var errors []error
4843
4844
	// no validation rules for SchemaVersion
4845
4846
	if len(errors) > 0 {
4847
		return DataWriteRequestMetadataMultiError(errors)
4848
	}
4849
4850
	return nil
4851
}
4852
4853
// DataWriteRequestMetadataMultiError is an error wrapping multiple validation
4854
// errors returned by DataWriteRequestMetadata.ValidateAll() if the designated
4855
// constraints aren't met.
4856
type DataWriteRequestMetadataMultiError []error
4857
4858
// Error returns a concatenation of all the error messages it wraps.
4859
func (m DataWriteRequestMetadataMultiError) Error() string {
4860
	var msgs []string
4861
	for _, err := range m {
4862
		msgs = append(msgs, err.Error())
4863
	}
4864
	return strings.Join(msgs, "; ")
4865
}
4866
4867
// AllErrors returns a list of validation violation errors.
4868
func (m DataWriteRequestMetadataMultiError) AllErrors() []error { return m }
4869
4870
// DataWriteRequestMetadataValidationError is the validation error returned by
4871
// DataWriteRequestMetadata.Validate if the designated constraints aren't met.
4872
type DataWriteRequestMetadataValidationError struct {
4873
	field  string
4874
	reason string
4875
	cause  error
4876
	key    bool
4877
}
4878
4879
// Field function returns field value.
4880
func (e DataWriteRequestMetadataValidationError) Field() string { return e.field }
4881
4882
// Reason function returns reason value.
4883
func (e DataWriteRequestMetadataValidationError) Reason() string { return e.reason }
4884
4885
// Cause function returns cause value.
4886
func (e DataWriteRequestMetadataValidationError) Cause() error { return e.cause }
4887
4888
// Key function returns key value.
4889
func (e DataWriteRequestMetadataValidationError) Key() bool { return e.key }
4890
4891
// ErrorName returns error name.
4892
func (e DataWriteRequestMetadataValidationError) ErrorName() string {
4893
	return "DataWriteRequestMetadataValidationError"
4894
}
4895
4896
// Error satisfies the builtin error interface
4897
func (e DataWriteRequestMetadataValidationError) Error() string {
4898
	cause := ""
4899
	if e.cause != nil {
4900
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
4901
	}
4902
4903
	key := ""
4904
	if e.key {
4905
		key = "key for "
4906
	}
4907
4908
	return fmt.Sprintf(
4909
		"invalid %sDataWriteRequestMetadata.%s: %s%s",
4910
		key,
4911
		e.field,
4912
		e.reason,
4913
		cause)
4914
}
4915
4916
var _ error = DataWriteRequestMetadataValidationError{}
4917
4918
var _ interface {
4919
	Field() string
4920
	Reason() string
4921
	Key() bool
4922
	Cause() error
4923
	ErrorName() string
4924
} = DataWriteRequestMetadataValidationError{}
4925
4926
// Validate checks the field values on DataWriteResponse with the rules defined
4927
// in the proto definition for this message. If any rules are violated, the
4928
// first error encountered is returned, or nil if there are no violations.
4929
func (m *DataWriteResponse) Validate() error {
4930
	return m.validate(false)
4931
}
4932
4933
// ValidateAll checks the field values on DataWriteResponse with the rules
4934
// defined in the proto definition for this message. If any rules are
4935
// violated, the result is a list of violation errors wrapped in
4936
// DataWriteResponseMultiError, or nil if none found.
4937
func (m *DataWriteResponse) ValidateAll() error {
4938
	return m.validate(true)
4939
}
4940
4941
func (m *DataWriteResponse) validate(all bool) error {
4942
	if m == nil {
4943
		return nil
4944
	}
4945
4946
	var errors []error
4947
4948
	// no validation rules for SnapToken
4949
4950
	if len(errors) > 0 {
4951
		return DataWriteResponseMultiError(errors)
4952
	}
4953
4954
	return nil
4955
}
4956
4957
// DataWriteResponseMultiError is an error wrapping multiple validation errors
4958
// returned by DataWriteResponse.ValidateAll() if the designated constraints
4959
// aren't met.
4960
type DataWriteResponseMultiError []error
4961
4962
// Error returns a concatenation of all the error messages it wraps.
4963
func (m DataWriteResponseMultiError) Error() string {
4964
	var msgs []string
4965
	for _, err := range m {
4966
		msgs = append(msgs, err.Error())
4967
	}
4968
	return strings.Join(msgs, "; ")
4969
}
4970
4971
// AllErrors returns a list of validation violation errors.
4972
func (m DataWriteResponseMultiError) AllErrors() []error { return m }
4973
4974
// DataWriteResponseValidationError is the validation error returned by
4975
// DataWriteResponse.Validate if the designated constraints aren't met.
4976
type DataWriteResponseValidationError struct {
4977
	field  string
4978
	reason string
4979
	cause  error
4980
	key    bool
4981
}
4982
4983
// Field function returns field value.
4984
func (e DataWriteResponseValidationError) Field() string { return e.field }
4985
4986
// Reason function returns reason value.
4987
func (e DataWriteResponseValidationError) Reason() string { return e.reason }
4988
4989
// Cause function returns cause value.
4990
func (e DataWriteResponseValidationError) Cause() error { return e.cause }
4991
4992
// Key function returns key value.
4993
func (e DataWriteResponseValidationError) Key() bool { return e.key }
4994
4995
// ErrorName returns error name.
4996
func (e DataWriteResponseValidationError) ErrorName() string {
4997
	return "DataWriteResponseValidationError"
4998
}
4999
5000
// Error satisfies the builtin error interface
5001
func (e DataWriteResponseValidationError) Error() string {
5002
	cause := ""
5003
	if e.cause != nil {
5004
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
5005
	}
5006
5007
	key := ""
5008
	if e.key {
5009
		key = "key for "
5010
	}
5011
5012
	return fmt.Sprintf(
5013
		"invalid %sDataWriteResponse.%s: %s%s",
5014
		key,
5015
		e.field,
5016
		e.reason,
5017
		cause)
5018
}
5019
5020
var _ error = DataWriteResponseValidationError{}
5021
5022
var _ interface {
5023
	Field() string
5024
	Reason() string
5025
	Key() bool
5026
	Cause() error
5027
	ErrorName() string
5028
} = DataWriteResponseValidationError{}
5029
5030
// Validate checks the field values on RelationshipWriteRequest with the rules
5031
// defined in the proto definition for this message. If any rules are
5032
// violated, the first error encountered is returned, or nil if there are no violations.
5033
func (m *RelationshipWriteRequest) Validate() error {
5034
	return m.validate(false)
5035
}
5036
5037
// ValidateAll checks the field values on RelationshipWriteRequest with the
5038
// rules defined in the proto definition for this message. If any rules are
5039
// violated, the result is a list of violation errors wrapped in
5040
// RelationshipWriteRequestMultiError, or nil if none found.
5041
func (m *RelationshipWriteRequest) ValidateAll() error {
5042
	return m.validate(true)
5043
}
5044
5045
func (m *RelationshipWriteRequest) validate(all bool) error {
5046
	if m == nil {
5047
		return nil
5048
	}
5049
5050
	var errors []error
5051
5052
	if len(m.GetTenantId()) > 128 {
5053
		err := RelationshipWriteRequestValidationError{
5054
			field:  "TenantId",
5055
			reason: "value length must be at most 128 bytes",
5056
		}
5057
		if !all {
5058
			return err
5059
		}
5060
		errors = append(errors, err)
5061
	}
5062
5063
	if !_RelationshipWriteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
5064
		err := RelationshipWriteRequestValidationError{
5065
			field:  "TenantId",
5066
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
5067
		}
5068
		if !all {
5069
			return err
5070
		}
5071
		errors = append(errors, err)
5072
	}
5073
5074
	if m.GetMetadata() == nil {
5075
		err := RelationshipWriteRequestValidationError{
5076
			field:  "Metadata",
5077
			reason: "value is required",
5078
		}
5079
		if !all {
5080
			return err
5081
		}
5082
		errors = append(errors, err)
5083
	}
5084
5085
	if all {
5086
		switch v := interface{}(m.GetMetadata()).(type) {
5087
		case interface{ ValidateAll() error }:
5088
			if err := v.ValidateAll(); err != nil {
5089
				errors = append(errors, RelationshipWriteRequestValidationError{
5090
					field:  "Metadata",
5091
					reason: "embedded message failed validation",
5092
					cause:  err,
5093
				})
5094
			}
5095
		case interface{ Validate() error }:
5096
			if err := v.Validate(); err != nil {
5097
				errors = append(errors, RelationshipWriteRequestValidationError{
5098
					field:  "Metadata",
5099
					reason: "embedded message failed validation",
5100
					cause:  err,
5101
				})
5102
			}
5103
		}
5104
	} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
5105
		if err := v.Validate(); err != nil {
5106
			return RelationshipWriteRequestValidationError{
5107
				field:  "Metadata",
5108
				reason: "embedded message failed validation",
5109
				cause:  err,
5110
			}
5111
		}
5112
	}
5113
5114
	if l := len(m.GetTuples()); l < 1 || l > 100 {
5115
		err := RelationshipWriteRequestValidationError{
5116
			field:  "Tuples",
5117
			reason: "value must contain between 1 and 100 items, inclusive",
5118
		}
5119
		if !all {
5120
			return err
5121
		}
5122
		errors = append(errors, err)
5123
	}
5124
5125
	for idx, item := range m.GetTuples() {
5126
		_, _ = idx, item
5127
5128
		if item == nil {
5129
			err := RelationshipWriteRequestValidationError{
5130
				field:  fmt.Sprintf("Tuples[%v]", idx),
5131
				reason: "value is required",
5132
			}
5133
			if !all {
5134
				return err
5135
			}
5136
			errors = append(errors, err)
5137
		}
5138
5139
		if all {
5140
			switch v := interface{}(item).(type) {
5141
			case interface{ ValidateAll() error }:
5142
				if err := v.ValidateAll(); err != nil {
5143
					errors = append(errors, RelationshipWriteRequestValidationError{
5144
						field:  fmt.Sprintf("Tuples[%v]", idx),
5145
						reason: "embedded message failed validation",
5146
						cause:  err,
5147
					})
5148
				}
5149
			case interface{ Validate() error }:
5150
				if err := v.Validate(); err != nil {
5151
					errors = append(errors, RelationshipWriteRequestValidationError{
5152
						field:  fmt.Sprintf("Tuples[%v]", idx),
5153
						reason: "embedded message failed validation",
5154
						cause:  err,
5155
					})
5156
				}
5157
			}
5158
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
5159
			if err := v.Validate(); err != nil {
5160
				return RelationshipWriteRequestValidationError{
5161
					field:  fmt.Sprintf("Tuples[%v]", idx),
5162
					reason: "embedded message failed validation",
5163
					cause:  err,
5164
				}
5165
			}
5166
		}
5167
5168
	}
5169
5170
	if len(errors) > 0 {
5171
		return RelationshipWriteRequestMultiError(errors)
5172
	}
5173
5174
	return nil
5175
}
5176
5177
// RelationshipWriteRequestMultiError is an error wrapping multiple validation
5178
// errors returned by RelationshipWriteRequest.ValidateAll() if the designated
5179
// constraints aren't met.
5180
type RelationshipWriteRequestMultiError []error
5181
5182
// Error returns a concatenation of all the error messages it wraps.
5183
func (m RelationshipWriteRequestMultiError) Error() string {
5184
	var msgs []string
5185
	for _, err := range m {
5186
		msgs = append(msgs, err.Error())
5187
	}
5188
	return strings.Join(msgs, "; ")
5189
}
5190
5191
// AllErrors returns a list of validation violation errors.
5192
func (m RelationshipWriteRequestMultiError) AllErrors() []error { return m }
5193
5194
// RelationshipWriteRequestValidationError is the validation error returned by
5195
// RelationshipWriteRequest.Validate if the designated constraints aren't met.
5196
type RelationshipWriteRequestValidationError struct {
5197
	field  string
5198
	reason string
5199
	cause  error
5200
	key    bool
5201
}
5202
5203
// Field function returns field value.
5204
func (e RelationshipWriteRequestValidationError) Field() string { return e.field }
5205
5206
// Reason function returns reason value.
5207
func (e RelationshipWriteRequestValidationError) Reason() string { return e.reason }
5208
5209
// Cause function returns cause value.
5210
func (e RelationshipWriteRequestValidationError) Cause() error { return e.cause }
5211
5212
// Key function returns key value.
5213
func (e RelationshipWriteRequestValidationError) Key() bool { return e.key }
5214
5215
// ErrorName returns error name.
5216
func (e RelationshipWriteRequestValidationError) ErrorName() string {
5217
	return "RelationshipWriteRequestValidationError"
5218
}
5219
5220
// Error satisfies the builtin error interface
5221
func (e RelationshipWriteRequestValidationError) Error() string {
5222
	cause := ""
5223
	if e.cause != nil {
5224
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
5225
	}
5226
5227
	key := ""
5228
	if e.key {
5229
		key = "key for "
5230
	}
5231
5232
	return fmt.Sprintf(
5233
		"invalid %sRelationshipWriteRequest.%s: %s%s",
5234
		key,
5235
		e.field,
5236
		e.reason,
5237
		cause)
5238
}
5239
5240
var _ error = RelationshipWriteRequestValidationError{}
5241
5242
var _ interface {
5243
	Field() string
5244
	Reason() string
5245
	Key() bool
5246
	Cause() error
5247
	ErrorName() string
5248
} = RelationshipWriteRequestValidationError{}
5249
5250
var _RelationshipWriteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
5251
5252
// Validate checks the field values on RelationshipWriteRequestMetadata with
5253
// the rules defined in the proto definition for this message. If any rules
5254
// are violated, the first error encountered is returned, or nil if there are
5255
// no violations.
5256
func (m *RelationshipWriteRequestMetadata) Validate() error {
5257
	return m.validate(false)
5258
}
5259
5260
// ValidateAll checks the field values on RelationshipWriteRequestMetadata with
5261
// the rules defined in the proto definition for this message. If any rules
5262
// are violated, the result is a list of violation errors wrapped in
5263
// RelationshipWriteRequestMetadataMultiError, or nil if none found.
5264
func (m *RelationshipWriteRequestMetadata) ValidateAll() error {
5265
	return m.validate(true)
5266
}
5267
5268
func (m *RelationshipWriteRequestMetadata) validate(all bool) error {
5269
	if m == nil {
5270
		return nil
5271
	}
5272
5273
	var errors []error
5274
5275
	// no validation rules for SchemaVersion
5276
5277
	if len(errors) > 0 {
5278
		return RelationshipWriteRequestMetadataMultiError(errors)
5279
	}
5280
5281
	return nil
5282
}
5283
5284
// RelationshipWriteRequestMetadataMultiError is an error wrapping multiple
5285
// validation errors returned by
5286
// RelationshipWriteRequestMetadata.ValidateAll() if the designated
5287
// constraints aren't met.
5288
type RelationshipWriteRequestMetadataMultiError []error
5289
5290
// Error returns a concatenation of all the error messages it wraps.
5291
func (m RelationshipWriteRequestMetadataMultiError) Error() string {
5292
	var msgs []string
5293
	for _, err := range m {
5294
		msgs = append(msgs, err.Error())
5295
	}
5296
	return strings.Join(msgs, "; ")
5297
}
5298
5299
// AllErrors returns a list of validation violation errors.
5300
func (m RelationshipWriteRequestMetadataMultiError) AllErrors() []error { return m }
5301
5302
// RelationshipWriteRequestMetadataValidationError is the validation error
5303
// returned by RelationshipWriteRequestMetadata.Validate if the designated
5304
// constraints aren't met.
5305
type RelationshipWriteRequestMetadataValidationError struct {
5306
	field  string
5307
	reason string
5308
	cause  error
5309
	key    bool
5310
}
5311
5312
// Field function returns field value.
5313
func (e RelationshipWriteRequestMetadataValidationError) Field() string { return e.field }
5314
5315
// Reason function returns reason value.
5316
func (e RelationshipWriteRequestMetadataValidationError) Reason() string { return e.reason }
5317
5318
// Cause function returns cause value.
5319
func (e RelationshipWriteRequestMetadataValidationError) Cause() error { return e.cause }
5320
5321
// Key function returns key value.
5322
func (e RelationshipWriteRequestMetadataValidationError) Key() bool { return e.key }
5323
5324
// ErrorName returns error name.
5325
func (e RelationshipWriteRequestMetadataValidationError) ErrorName() string {
5326
	return "RelationshipWriteRequestMetadataValidationError"
5327
}
5328
5329
// Error satisfies the builtin error interface
5330
func (e RelationshipWriteRequestMetadataValidationError) Error() string {
5331
	cause := ""
5332
	if e.cause != nil {
5333
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
5334
	}
5335
5336
	key := ""
5337
	if e.key {
5338
		key = "key for "
5339
	}
5340
5341
	return fmt.Sprintf(
5342
		"invalid %sRelationshipWriteRequestMetadata.%s: %s%s",
5343
		key,
5344
		e.field,
5345
		e.reason,
5346
		cause)
5347
}
5348
5349
var _ error = RelationshipWriteRequestMetadataValidationError{}
5350
5351
var _ interface {
5352
	Field() string
5353
	Reason() string
5354
	Key() bool
5355
	Cause() error
5356
	ErrorName() string
5357
} = RelationshipWriteRequestMetadataValidationError{}
5358
5359
// Validate checks the field values on RelationshipWriteResponse with the rules
5360
// defined in the proto definition for this message. If any rules are
5361
// violated, the first error encountered is returned, or nil if there are no violations.
5362
func (m *RelationshipWriteResponse) Validate() error {
5363
	return m.validate(false)
5364
}
5365
5366
// ValidateAll checks the field values on RelationshipWriteResponse with the
5367
// rules defined in the proto definition for this message. If any rules are
5368
// violated, the result is a list of violation errors wrapped in
5369
// RelationshipWriteResponseMultiError, or nil if none found.
5370
func (m *RelationshipWriteResponse) ValidateAll() error {
5371
	return m.validate(true)
5372
}
5373
5374
func (m *RelationshipWriteResponse) validate(all bool) error {
5375
	if m == nil {
5376
		return nil
5377
	}
5378
5379
	var errors []error
5380
5381
	// no validation rules for SnapToken
5382
5383
	if len(errors) > 0 {
5384
		return RelationshipWriteResponseMultiError(errors)
5385
	}
5386
5387
	return nil
5388
}
5389
5390
// RelationshipWriteResponseMultiError is an error wrapping multiple validation
5391
// errors returned by RelationshipWriteResponse.ValidateAll() if the
5392
// designated constraints aren't met.
5393
type RelationshipWriteResponseMultiError []error
5394
5395
// Error returns a concatenation of all the error messages it wraps.
5396
func (m RelationshipWriteResponseMultiError) Error() string {
5397
	var msgs []string
5398
	for _, err := range m {
5399
		msgs = append(msgs, err.Error())
5400
	}
5401
	return strings.Join(msgs, "; ")
5402
}
5403
5404
// AllErrors returns a list of validation violation errors.
5405
func (m RelationshipWriteResponseMultiError) AllErrors() []error { return m }
5406
5407
// RelationshipWriteResponseValidationError is the validation error returned by
5408
// RelationshipWriteResponse.Validate if the designated constraints aren't met.
5409
type RelationshipWriteResponseValidationError struct {
5410
	field  string
5411
	reason string
5412
	cause  error
5413
	key    bool
5414
}
5415
5416
// Field function returns field value.
5417
func (e RelationshipWriteResponseValidationError) Field() string { return e.field }
5418
5419
// Reason function returns reason value.
5420
func (e RelationshipWriteResponseValidationError) Reason() string { return e.reason }
5421
5422
// Cause function returns cause value.
5423
func (e RelationshipWriteResponseValidationError) Cause() error { return e.cause }
5424
5425
// Key function returns key value.
5426
func (e RelationshipWriteResponseValidationError) Key() bool { return e.key }
5427
5428
// ErrorName returns error name.
5429
func (e RelationshipWriteResponseValidationError) ErrorName() string {
5430
	return "RelationshipWriteResponseValidationError"
5431
}
5432
5433
// Error satisfies the builtin error interface
5434
func (e RelationshipWriteResponseValidationError) Error() string {
5435
	cause := ""
5436
	if e.cause != nil {
5437
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
5438
	}
5439
5440
	key := ""
5441
	if e.key {
5442
		key = "key for "
5443
	}
5444
5445
	return fmt.Sprintf(
5446
		"invalid %sRelationshipWriteResponse.%s: %s%s",
5447
		key,
5448
		e.field,
5449
		e.reason,
5450
		cause)
5451
}
5452
5453
var _ error = RelationshipWriteResponseValidationError{}
5454
5455
var _ interface {
5456
	Field() string
5457
	Reason() string
5458
	Key() bool
5459
	Cause() error
5460
	ErrorName() string
5461
} = RelationshipWriteResponseValidationError{}
5462
5463
// Validate checks the field values on RelationshipReadRequest with the rules
5464
// defined in the proto definition for this message. If any rules are
5465
// violated, the first error encountered is returned, or nil if there are no violations.
5466
func (m *RelationshipReadRequest) Validate() error {
5467
	return m.validate(false)
5468
}
5469
5470
// ValidateAll checks the field values on RelationshipReadRequest with the
5471
// rules defined in the proto definition for this message. If any rules are
5472
// violated, the result is a list of violation errors wrapped in
5473
// RelationshipReadRequestMultiError, or nil if none found.
5474
func (m *RelationshipReadRequest) ValidateAll() error {
5475
	return m.validate(true)
5476
}
5477
5478
func (m *RelationshipReadRequest) validate(all bool) error {
5479
	if m == nil {
5480
		return nil
5481
	}
5482
5483
	var errors []error
5484
5485
	if len(m.GetTenantId()) > 128 {
5486
		err := RelationshipReadRequestValidationError{
5487
			field:  "TenantId",
5488
			reason: "value length must be at most 128 bytes",
5489
		}
5490
		if !all {
5491
			return err
5492
		}
5493
		errors = append(errors, err)
5494
	}
5495
5496
	if !_RelationshipReadRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
5497
		err := RelationshipReadRequestValidationError{
5498
			field:  "TenantId",
5499
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
5500
		}
5501
		if !all {
5502
			return err
5503
		}
5504
		errors = append(errors, err)
5505
	}
5506
5507
	if m.GetMetadata() == nil {
5508
		err := RelationshipReadRequestValidationError{
5509
			field:  "Metadata",
5510
			reason: "value is required",
5511
		}
5512
		if !all {
5513
			return err
5514
		}
5515
		errors = append(errors, err)
5516
	}
5517
5518
	if all {
5519
		switch v := interface{}(m.GetMetadata()).(type) {
5520
		case interface{ ValidateAll() error }:
5521
			if err := v.ValidateAll(); err != nil {
5522
				errors = append(errors, RelationshipReadRequestValidationError{
5523
					field:  "Metadata",
5524
					reason: "embedded message failed validation",
5525
					cause:  err,
5526
				})
5527
			}
5528
		case interface{ Validate() error }:
5529
			if err := v.Validate(); err != nil {
5530
				errors = append(errors, RelationshipReadRequestValidationError{
5531
					field:  "Metadata",
5532
					reason: "embedded message failed validation",
5533
					cause:  err,
5534
				})
5535
			}
5536
		}
5537
	} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
5538
		if err := v.Validate(); err != nil {
5539
			return RelationshipReadRequestValidationError{
5540
				field:  "Metadata",
5541
				reason: "embedded message failed validation",
5542
				cause:  err,
5543
			}
5544
		}
5545
	}
5546
5547
	if m.GetFilter() == nil {
5548
		err := RelationshipReadRequestValidationError{
5549
			field:  "Filter",
5550
			reason: "value is required",
5551
		}
5552
		if !all {
5553
			return err
5554
		}
5555
		errors = append(errors, err)
5556
	}
5557
5558
	if all {
5559
		switch v := interface{}(m.GetFilter()).(type) {
5560
		case interface{ ValidateAll() error }:
5561
			if err := v.ValidateAll(); err != nil {
5562
				errors = append(errors, RelationshipReadRequestValidationError{
5563
					field:  "Filter",
5564
					reason: "embedded message failed validation",
5565
					cause:  err,
5566
				})
5567
			}
5568
		case interface{ Validate() error }:
5569
			if err := v.Validate(); err != nil {
5570
				errors = append(errors, RelationshipReadRequestValidationError{
5571
					field:  "Filter",
5572
					reason: "embedded message failed validation",
5573
					cause:  err,
5574
				})
5575
			}
5576
		}
5577
	} else if v, ok := interface{}(m.GetFilter()).(interface{ Validate() error }); ok {
5578
		if err := v.Validate(); err != nil {
5579
			return RelationshipReadRequestValidationError{
5580
				field:  "Filter",
5581
				reason: "embedded message failed validation",
5582
				cause:  err,
5583
			}
5584
		}
5585
	}
5586
5587
	if m.GetPageSize() != 0 {
5588
5589
		if val := m.GetPageSize(); val < 1 || val > 100 {
5590
			err := RelationshipReadRequestValidationError{
5591
				field:  "PageSize",
5592
				reason: "value must be inside range [1, 100]",
5593
			}
5594
			if !all {
5595
				return err
5596
			}
5597
			errors = append(errors, err)
5598
		}
5599
5600
	}
5601
5602
	if m.GetContinuousToken() != "" {
5603
5604
	}
5605
5606
	if len(errors) > 0 {
5607
		return RelationshipReadRequestMultiError(errors)
5608
	}
5609
5610
	return nil
5611
}
5612
5613
// RelationshipReadRequestMultiError is an error wrapping multiple validation
5614
// errors returned by RelationshipReadRequest.ValidateAll() if the designated
5615
// constraints aren't met.
5616
type RelationshipReadRequestMultiError []error
5617
5618
// Error returns a concatenation of all the error messages it wraps.
5619
func (m RelationshipReadRequestMultiError) Error() string {
5620
	var msgs []string
5621
	for _, err := range m {
5622
		msgs = append(msgs, err.Error())
5623
	}
5624
	return strings.Join(msgs, "; ")
5625
}
5626
5627
// AllErrors returns a list of validation violation errors.
5628
func (m RelationshipReadRequestMultiError) AllErrors() []error { return m }
5629
5630
// RelationshipReadRequestValidationError is the validation error returned by
5631
// RelationshipReadRequest.Validate if the designated constraints aren't met.
5632
type RelationshipReadRequestValidationError struct {
5633
	field  string
5634
	reason string
5635
	cause  error
5636
	key    bool
5637
}
5638
5639
// Field function returns field value.
5640
func (e RelationshipReadRequestValidationError) Field() string { return e.field }
5641
5642
// Reason function returns reason value.
5643
func (e RelationshipReadRequestValidationError) Reason() string { return e.reason }
5644
5645
// Cause function returns cause value.
5646
func (e RelationshipReadRequestValidationError) Cause() error { return e.cause }
5647
5648
// Key function returns key value.
5649
func (e RelationshipReadRequestValidationError) Key() bool { return e.key }
5650
5651
// ErrorName returns error name.
5652
func (e RelationshipReadRequestValidationError) ErrorName() string {
5653
	return "RelationshipReadRequestValidationError"
5654
}
5655
5656
// Error satisfies the builtin error interface
5657
func (e RelationshipReadRequestValidationError) Error() string {
5658
	cause := ""
5659
	if e.cause != nil {
5660
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
5661
	}
5662
5663
	key := ""
5664
	if e.key {
5665
		key = "key for "
5666
	}
5667
5668
	return fmt.Sprintf(
5669
		"invalid %sRelationshipReadRequest.%s: %s%s",
5670
		key,
5671
		e.field,
5672
		e.reason,
5673
		cause)
5674
}
5675
5676
var _ error = RelationshipReadRequestValidationError{}
5677
5678
var _ interface {
5679
	Field() string
5680
	Reason() string
5681
	Key() bool
5682
	Cause() error
5683
	ErrorName() string
5684
} = RelationshipReadRequestValidationError{}
5685
5686
var _RelationshipReadRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
5687
5688
// Validate checks the field values on RelationshipReadRequestMetadata with the
5689
// rules defined in the proto definition for this message. If any rules are
5690
// violated, the first error encountered is returned, or nil if there are no violations.
5691
func (m *RelationshipReadRequestMetadata) Validate() error {
5692
	return m.validate(false)
5693
}
5694
5695
// ValidateAll checks the field values on RelationshipReadRequestMetadata with
5696
// the rules defined in the proto definition for this message. If any rules
5697
// are violated, the result is a list of violation errors wrapped in
5698
// RelationshipReadRequestMetadataMultiError, or nil if none found.
5699
func (m *RelationshipReadRequestMetadata) ValidateAll() error {
5700
	return m.validate(true)
5701
}
5702
5703
func (m *RelationshipReadRequestMetadata) validate(all bool) error {
5704
	if m == nil {
5705
		return nil
5706
	}
5707
5708
	var errors []error
5709
5710
	// no validation rules for SnapToken
5711
5712
	if len(errors) > 0 {
5713
		return RelationshipReadRequestMetadataMultiError(errors)
5714
	}
5715
5716
	return nil
5717
}
5718
5719
// RelationshipReadRequestMetadataMultiError is an error wrapping multiple
5720
// validation errors returned by RelationshipReadRequestMetadata.ValidateAll()
5721
// if the designated constraints aren't met.
5722
type RelationshipReadRequestMetadataMultiError []error
5723
5724
// Error returns a concatenation of all the error messages it wraps.
5725
func (m RelationshipReadRequestMetadataMultiError) Error() string {
5726
	var msgs []string
5727
	for _, err := range m {
5728
		msgs = append(msgs, err.Error())
5729
	}
5730
	return strings.Join(msgs, "; ")
5731
}
5732
5733
// AllErrors returns a list of validation violation errors.
5734
func (m RelationshipReadRequestMetadataMultiError) AllErrors() []error { return m }
5735
5736
// RelationshipReadRequestMetadataValidationError is the validation error
5737
// returned by RelationshipReadRequestMetadata.Validate if the designated
5738
// constraints aren't met.
5739
type RelationshipReadRequestMetadataValidationError struct {
5740
	field  string
5741
	reason string
5742
	cause  error
5743
	key    bool
5744
}
5745
5746
// Field function returns field value.
5747
func (e RelationshipReadRequestMetadataValidationError) Field() string { return e.field }
5748
5749
// Reason function returns reason value.
5750
func (e RelationshipReadRequestMetadataValidationError) Reason() string { return e.reason }
5751
5752
// Cause function returns cause value.
5753
func (e RelationshipReadRequestMetadataValidationError) Cause() error { return e.cause }
5754
5755
// Key function returns key value.
5756
func (e RelationshipReadRequestMetadataValidationError) Key() bool { return e.key }
5757
5758
// ErrorName returns error name.
5759
func (e RelationshipReadRequestMetadataValidationError) ErrorName() string {
5760
	return "RelationshipReadRequestMetadataValidationError"
5761
}
5762
5763
// Error satisfies the builtin error interface
5764
func (e RelationshipReadRequestMetadataValidationError) Error() string {
5765
	cause := ""
5766
	if e.cause != nil {
5767
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
5768
	}
5769
5770
	key := ""
5771
	if e.key {
5772
		key = "key for "
5773
	}
5774
5775
	return fmt.Sprintf(
5776
		"invalid %sRelationshipReadRequestMetadata.%s: %s%s",
5777
		key,
5778
		e.field,
5779
		e.reason,
5780
		cause)
5781
}
5782
5783
var _ error = RelationshipReadRequestMetadataValidationError{}
5784
5785
var _ interface {
5786
	Field() string
5787
	Reason() string
5788
	Key() bool
5789
	Cause() error
5790
	ErrorName() string
5791
} = RelationshipReadRequestMetadataValidationError{}
5792
5793
// Validate checks the field values on RelationshipReadResponse with the rules
5794
// defined in the proto definition for this message. If any rules are
5795
// violated, the first error encountered is returned, or nil if there are no violations.
5796
func (m *RelationshipReadResponse) Validate() error {
5797
	return m.validate(false)
5798
}
5799
5800
// ValidateAll checks the field values on RelationshipReadResponse with the
5801
// rules defined in the proto definition for this message. If any rules are
5802
// violated, the result is a list of violation errors wrapped in
5803
// RelationshipReadResponseMultiError, or nil if none found.
5804
func (m *RelationshipReadResponse) ValidateAll() error {
5805
	return m.validate(true)
5806
}
5807
5808
func (m *RelationshipReadResponse) validate(all bool) error {
5809
	if m == nil {
5810
		return nil
5811
	}
5812
5813
	var errors []error
5814
5815
	for idx, item := range m.GetTuples() {
5816
		_, _ = idx, item
5817
5818
		if all {
5819
			switch v := interface{}(item).(type) {
5820
			case interface{ ValidateAll() error }:
5821
				if err := v.ValidateAll(); err != nil {
5822
					errors = append(errors, RelationshipReadResponseValidationError{
5823
						field:  fmt.Sprintf("Tuples[%v]", idx),
5824
						reason: "embedded message failed validation",
5825
						cause:  err,
5826
					})
5827
				}
5828
			case interface{ Validate() error }:
5829
				if err := v.Validate(); err != nil {
5830
					errors = append(errors, RelationshipReadResponseValidationError{
5831
						field:  fmt.Sprintf("Tuples[%v]", idx),
5832
						reason: "embedded message failed validation",
5833
						cause:  err,
5834
					})
5835
				}
5836
			}
5837
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
5838
			if err := v.Validate(); err != nil {
5839
				return RelationshipReadResponseValidationError{
5840
					field:  fmt.Sprintf("Tuples[%v]", idx),
5841
					reason: "embedded message failed validation",
5842
					cause:  err,
5843
				}
5844
			}
5845
		}
5846
5847
	}
5848
5849
	// no validation rules for ContinuousToken
5850
5851
	if len(errors) > 0 {
5852
		return RelationshipReadResponseMultiError(errors)
5853
	}
5854
5855
	return nil
5856
}
5857
5858
// RelationshipReadResponseMultiError is an error wrapping multiple validation
5859
// errors returned by RelationshipReadResponse.ValidateAll() if the designated
5860
// constraints aren't met.
5861
type RelationshipReadResponseMultiError []error
5862
5863
// Error returns a concatenation of all the error messages it wraps.
5864
func (m RelationshipReadResponseMultiError) Error() string {
5865
	var msgs []string
5866
	for _, err := range m {
5867
		msgs = append(msgs, err.Error())
5868
	}
5869
	return strings.Join(msgs, "; ")
5870
}
5871
5872
// AllErrors returns a list of validation violation errors.
5873
func (m RelationshipReadResponseMultiError) AllErrors() []error { return m }
5874
5875
// RelationshipReadResponseValidationError is the validation error returned by
5876
// RelationshipReadResponse.Validate if the designated constraints aren't met.
5877
type RelationshipReadResponseValidationError struct {
5878
	field  string
5879
	reason string
5880
	cause  error
5881
	key    bool
5882
}
5883
5884
// Field function returns field value.
5885
func (e RelationshipReadResponseValidationError) Field() string { return e.field }
5886
5887
// Reason function returns reason value.
5888
func (e RelationshipReadResponseValidationError) Reason() string { return e.reason }
5889
5890
// Cause function returns cause value.
5891
func (e RelationshipReadResponseValidationError) Cause() error { return e.cause }
5892
5893
// Key function returns key value.
5894
func (e RelationshipReadResponseValidationError) Key() bool { return e.key }
5895
5896
// ErrorName returns error name.
5897
func (e RelationshipReadResponseValidationError) ErrorName() string {
5898
	return "RelationshipReadResponseValidationError"
5899
}
5900
5901
// Error satisfies the builtin error interface
5902
func (e RelationshipReadResponseValidationError) Error() string {
5903
	cause := ""
5904
	if e.cause != nil {
5905
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
5906
	}
5907
5908
	key := ""
5909
	if e.key {
5910
		key = "key for "
5911
	}
5912
5913
	return fmt.Sprintf(
5914
		"invalid %sRelationshipReadResponse.%s: %s%s",
5915
		key,
5916
		e.field,
5917
		e.reason,
5918
		cause)
5919
}
5920
5921
var _ error = RelationshipReadResponseValidationError{}
5922
5923
var _ interface {
5924
	Field() string
5925
	Reason() string
5926
	Key() bool
5927
	Cause() error
5928
	ErrorName() string
5929
} = RelationshipReadResponseValidationError{}
5930
5931
// Validate checks the field values on AttributeReadRequest with the rules
5932
// defined in the proto definition for this message. If any rules are
5933
// violated, the first error encountered is returned, or nil if there are no violations.
5934
func (m *AttributeReadRequest) Validate() error {
5935
	return m.validate(false)
5936
}
5937
5938
// ValidateAll checks the field values on AttributeReadRequest with the rules
5939
// defined in the proto definition for this message. If any rules are
5940
// violated, the result is a list of violation errors wrapped in
5941
// AttributeReadRequestMultiError, or nil if none found.
5942
func (m *AttributeReadRequest) ValidateAll() error {
5943
	return m.validate(true)
5944
}
5945
5946
func (m *AttributeReadRequest) validate(all bool) error {
5947
	if m == nil {
5948
		return nil
5949
	}
5950
5951
	var errors []error
5952
5953
	if len(m.GetTenantId()) > 128 {
5954
		err := AttributeReadRequestValidationError{
5955
			field:  "TenantId",
5956
			reason: "value length must be at most 128 bytes",
5957
		}
5958
		if !all {
5959
			return err
5960
		}
5961
		errors = append(errors, err)
5962
	}
5963
5964
	if !_AttributeReadRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
5965
		err := AttributeReadRequestValidationError{
5966
			field:  "TenantId",
5967
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
5968
		}
5969
		if !all {
5970
			return err
5971
		}
5972
		errors = append(errors, err)
5973
	}
5974
5975
	if m.GetMetadata() == nil {
5976
		err := AttributeReadRequestValidationError{
5977
			field:  "Metadata",
5978
			reason: "value is required",
5979
		}
5980
		if !all {
5981
			return err
5982
		}
5983
		errors = append(errors, err)
5984
	}
5985
5986
	if all {
5987
		switch v := interface{}(m.GetMetadata()).(type) {
5988
		case interface{ ValidateAll() error }:
5989
			if err := v.ValidateAll(); err != nil {
5990
				errors = append(errors, AttributeReadRequestValidationError{
5991
					field:  "Metadata",
5992
					reason: "embedded message failed validation",
5993
					cause:  err,
5994
				})
5995
			}
5996
		case interface{ Validate() error }:
5997
			if err := v.Validate(); err != nil {
5998
				errors = append(errors, AttributeReadRequestValidationError{
5999
					field:  "Metadata",
6000
					reason: "embedded message failed validation",
6001
					cause:  err,
6002
				})
6003
			}
6004
		}
6005
	} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
6006
		if err := v.Validate(); err != nil {
6007
			return AttributeReadRequestValidationError{
6008
				field:  "Metadata",
6009
				reason: "embedded message failed validation",
6010
				cause:  err,
6011
			}
6012
		}
6013
	}
6014
6015
	if m.GetFilter() == nil {
6016
		err := AttributeReadRequestValidationError{
6017
			field:  "Filter",
6018
			reason: "value is required",
6019
		}
6020
		if !all {
6021
			return err
6022
		}
6023
		errors = append(errors, err)
6024
	}
6025
6026
	if all {
6027
		switch v := interface{}(m.GetFilter()).(type) {
6028
		case interface{ ValidateAll() error }:
6029
			if err := v.ValidateAll(); err != nil {
6030
				errors = append(errors, AttributeReadRequestValidationError{
6031
					field:  "Filter",
6032
					reason: "embedded message failed validation",
6033
					cause:  err,
6034
				})
6035
			}
6036
		case interface{ Validate() error }:
6037
			if err := v.Validate(); err != nil {
6038
				errors = append(errors, AttributeReadRequestValidationError{
6039
					field:  "Filter",
6040
					reason: "embedded message failed validation",
6041
					cause:  err,
6042
				})
6043
			}
6044
		}
6045
	} else if v, ok := interface{}(m.GetFilter()).(interface{ Validate() error }); ok {
6046
		if err := v.Validate(); err != nil {
6047
			return AttributeReadRequestValidationError{
6048
				field:  "Filter",
6049
				reason: "embedded message failed validation",
6050
				cause:  err,
6051
			}
6052
		}
6053
	}
6054
6055
	if m.GetPageSize() != 0 {
6056
6057
		if val := m.GetPageSize(); val < 1 || val > 100 {
6058
			err := AttributeReadRequestValidationError{
6059
				field:  "PageSize",
6060
				reason: "value must be inside range [1, 100]",
6061
			}
6062
			if !all {
6063
				return err
6064
			}
6065
			errors = append(errors, err)
6066
		}
6067
6068
	}
6069
6070
	if m.GetContinuousToken() != "" {
6071
6072
	}
6073
6074
	if len(errors) > 0 {
6075
		return AttributeReadRequestMultiError(errors)
6076
	}
6077
6078
	return nil
6079
}
6080
6081
// AttributeReadRequestMultiError is an error wrapping multiple validation
6082
// errors returned by AttributeReadRequest.ValidateAll() if the designated
6083
// constraints aren't met.
6084
type AttributeReadRequestMultiError []error
6085
6086
// Error returns a concatenation of all the error messages it wraps.
6087
func (m AttributeReadRequestMultiError) Error() string {
6088
	var msgs []string
6089
	for _, err := range m {
6090
		msgs = append(msgs, err.Error())
6091
	}
6092
	return strings.Join(msgs, "; ")
6093
}
6094
6095
// AllErrors returns a list of validation violation errors.
6096
func (m AttributeReadRequestMultiError) AllErrors() []error { return m }
6097
6098
// AttributeReadRequestValidationError is the validation error returned by
6099
// AttributeReadRequest.Validate if the designated constraints aren't met.
6100
type AttributeReadRequestValidationError struct {
6101
	field  string
6102
	reason string
6103
	cause  error
6104
	key    bool
6105
}
6106
6107
// Field function returns field value.
6108
func (e AttributeReadRequestValidationError) Field() string { return e.field }
6109
6110
// Reason function returns reason value.
6111
func (e AttributeReadRequestValidationError) Reason() string { return e.reason }
6112
6113
// Cause function returns cause value.
6114
func (e AttributeReadRequestValidationError) Cause() error { return e.cause }
6115
6116
// Key function returns key value.
6117
func (e AttributeReadRequestValidationError) Key() bool { return e.key }
6118
6119
// ErrorName returns error name.
6120
func (e AttributeReadRequestValidationError) ErrorName() string {
6121
	return "AttributeReadRequestValidationError"
6122
}
6123
6124
// Error satisfies the builtin error interface
6125
func (e AttributeReadRequestValidationError) Error() string {
6126
	cause := ""
6127
	if e.cause != nil {
6128
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
6129
	}
6130
6131
	key := ""
6132
	if e.key {
6133
		key = "key for "
6134
	}
6135
6136
	return fmt.Sprintf(
6137
		"invalid %sAttributeReadRequest.%s: %s%s",
6138
		key,
6139
		e.field,
6140
		e.reason,
6141
		cause)
6142
}
6143
6144
var _ error = AttributeReadRequestValidationError{}
6145
6146
var _ interface {
6147
	Field() string
6148
	Reason() string
6149
	Key() bool
6150
	Cause() error
6151
	ErrorName() string
6152
} = AttributeReadRequestValidationError{}
6153
6154
var _AttributeReadRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
6155
6156
// Validate checks the field values on AttributeReadRequestMetadata with the
6157
// rules defined in the proto definition for this message. If any rules are
6158
// violated, the first error encountered is returned, or nil if there are no violations.
6159
func (m *AttributeReadRequestMetadata) Validate() error {
6160
	return m.validate(false)
6161
}
6162
6163
// ValidateAll checks the field values on AttributeReadRequestMetadata with the
6164
// rules defined in the proto definition for this message. If any rules are
6165
// violated, the result is a list of violation errors wrapped in
6166
// AttributeReadRequestMetadataMultiError, or nil if none found.
6167
func (m *AttributeReadRequestMetadata) ValidateAll() error {
6168
	return m.validate(true)
6169
}
6170
6171
func (m *AttributeReadRequestMetadata) validate(all bool) error {
6172
	if m == nil {
6173
		return nil
6174
	}
6175
6176
	var errors []error
6177
6178
	// no validation rules for SnapToken
6179
6180
	if len(errors) > 0 {
6181
		return AttributeReadRequestMetadataMultiError(errors)
6182
	}
6183
6184
	return nil
6185
}
6186
6187
// AttributeReadRequestMetadataMultiError is an error wrapping multiple
6188
// validation errors returned by AttributeReadRequestMetadata.ValidateAll() if
6189
// the designated constraints aren't met.
6190
type AttributeReadRequestMetadataMultiError []error
6191
6192
// Error returns a concatenation of all the error messages it wraps.
6193
func (m AttributeReadRequestMetadataMultiError) Error() string {
6194
	var msgs []string
6195
	for _, err := range m {
6196
		msgs = append(msgs, err.Error())
6197
	}
6198
	return strings.Join(msgs, "; ")
6199
}
6200
6201
// AllErrors returns a list of validation violation errors.
6202
func (m AttributeReadRequestMetadataMultiError) AllErrors() []error { return m }
6203
6204
// AttributeReadRequestMetadataValidationError is the validation error returned
6205
// by AttributeReadRequestMetadata.Validate if the designated constraints
6206
// aren't met.
6207
type AttributeReadRequestMetadataValidationError struct {
6208
	field  string
6209
	reason string
6210
	cause  error
6211
	key    bool
6212
}
6213
6214
// Field function returns field value.
6215
func (e AttributeReadRequestMetadataValidationError) Field() string { return e.field }
6216
6217
// Reason function returns reason value.
6218
func (e AttributeReadRequestMetadataValidationError) Reason() string { return e.reason }
6219
6220
// Cause function returns cause value.
6221
func (e AttributeReadRequestMetadataValidationError) Cause() error { return e.cause }
6222
6223
// Key function returns key value.
6224
func (e AttributeReadRequestMetadataValidationError) Key() bool { return e.key }
6225
6226
// ErrorName returns error name.
6227
func (e AttributeReadRequestMetadataValidationError) ErrorName() string {
6228
	return "AttributeReadRequestMetadataValidationError"
6229
}
6230
6231
// Error satisfies the builtin error interface
6232
func (e AttributeReadRequestMetadataValidationError) Error() string {
6233
	cause := ""
6234
	if e.cause != nil {
6235
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
6236
	}
6237
6238
	key := ""
6239
	if e.key {
6240
		key = "key for "
6241
	}
6242
6243
	return fmt.Sprintf(
6244
		"invalid %sAttributeReadRequestMetadata.%s: %s%s",
6245
		key,
6246
		e.field,
6247
		e.reason,
6248
		cause)
6249
}
6250
6251
var _ error = AttributeReadRequestMetadataValidationError{}
6252
6253
var _ interface {
6254
	Field() string
6255
	Reason() string
6256
	Key() bool
6257
	Cause() error
6258
	ErrorName() string
6259
} = AttributeReadRequestMetadataValidationError{}
6260
6261
// Validate checks the field values on AttributeReadResponse with the rules
6262
// defined in the proto definition for this message. If any rules are
6263
// violated, the first error encountered is returned, or nil if there are no violations.
6264
func (m *AttributeReadResponse) Validate() error {
6265
	return m.validate(false)
6266
}
6267
6268
// ValidateAll checks the field values on AttributeReadResponse with the rules
6269
// defined in the proto definition for this message. If any rules are
6270
// violated, the result is a list of violation errors wrapped in
6271
// AttributeReadResponseMultiError, or nil if none found.
6272
func (m *AttributeReadResponse) ValidateAll() error {
6273
	return m.validate(true)
6274
}
6275
6276
func (m *AttributeReadResponse) validate(all bool) error {
6277
	if m == nil {
6278
		return nil
6279
	}
6280
6281
	var errors []error
6282
6283
	for idx, item := range m.GetAttributes() {
6284
		_, _ = idx, item
6285
6286
		if all {
6287
			switch v := interface{}(item).(type) {
6288
			case interface{ ValidateAll() error }:
6289
				if err := v.ValidateAll(); err != nil {
6290
					errors = append(errors, AttributeReadResponseValidationError{
6291
						field:  fmt.Sprintf("Attributes[%v]", idx),
6292
						reason: "embedded message failed validation",
6293
						cause:  err,
6294
					})
6295
				}
6296
			case interface{ Validate() error }:
6297
				if err := v.Validate(); err != nil {
6298
					errors = append(errors, AttributeReadResponseValidationError{
6299
						field:  fmt.Sprintf("Attributes[%v]", idx),
6300
						reason: "embedded message failed validation",
6301
						cause:  err,
6302
					})
6303
				}
6304
			}
6305
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
6306
			if err := v.Validate(); err != nil {
6307
				return AttributeReadResponseValidationError{
6308
					field:  fmt.Sprintf("Attributes[%v]", idx),
6309
					reason: "embedded message failed validation",
6310
					cause:  err,
6311
				}
6312
			}
6313
		}
6314
6315
	}
6316
6317
	// no validation rules for ContinuousToken
6318
6319
	if len(errors) > 0 {
6320
		return AttributeReadResponseMultiError(errors)
6321
	}
6322
6323
	return nil
6324
}
6325
6326
// AttributeReadResponseMultiError is an error wrapping multiple validation
6327
// errors returned by AttributeReadResponse.ValidateAll() if the designated
6328
// constraints aren't met.
6329
type AttributeReadResponseMultiError []error
6330
6331
// Error returns a concatenation of all the error messages it wraps.
6332
func (m AttributeReadResponseMultiError) Error() string {
6333
	var msgs []string
6334
	for _, err := range m {
6335
		msgs = append(msgs, err.Error())
6336
	}
6337
	return strings.Join(msgs, "; ")
6338
}
6339
6340
// AllErrors returns a list of validation violation errors.
6341
func (m AttributeReadResponseMultiError) AllErrors() []error { return m }
6342
6343
// AttributeReadResponseValidationError is the validation error returned by
6344
// AttributeReadResponse.Validate if the designated constraints aren't met.
6345
type AttributeReadResponseValidationError struct {
6346
	field  string
6347
	reason string
6348
	cause  error
6349
	key    bool
6350
}
6351
6352
// Field function returns field value.
6353
func (e AttributeReadResponseValidationError) Field() string { return e.field }
6354
6355
// Reason function returns reason value.
6356
func (e AttributeReadResponseValidationError) Reason() string { return e.reason }
6357
6358
// Cause function returns cause value.
6359
func (e AttributeReadResponseValidationError) Cause() error { return e.cause }
6360
6361
// Key function returns key value.
6362
func (e AttributeReadResponseValidationError) Key() bool { return e.key }
6363
6364
// ErrorName returns error name.
6365
func (e AttributeReadResponseValidationError) ErrorName() string {
6366
	return "AttributeReadResponseValidationError"
6367
}
6368
6369
// Error satisfies the builtin error interface
6370
func (e AttributeReadResponseValidationError) Error() string {
6371
	cause := ""
6372
	if e.cause != nil {
6373
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
6374
	}
6375
6376
	key := ""
6377
	if e.key {
6378
		key = "key for "
6379
	}
6380
6381
	return fmt.Sprintf(
6382
		"invalid %sAttributeReadResponse.%s: %s%s",
6383
		key,
6384
		e.field,
6385
		e.reason,
6386
		cause)
6387
}
6388
6389
var _ error = AttributeReadResponseValidationError{}
6390
6391
var _ interface {
6392
	Field() string
6393
	Reason() string
6394
	Key() bool
6395
	Cause() error
6396
	ErrorName() string
6397
} = AttributeReadResponseValidationError{}
6398
6399
// Validate checks the field values on DataDeleteRequest with the rules defined
6400
// in the proto definition for this message. If any rules are violated, the
6401
// first error encountered is returned, or nil if there are no violations.
6402
func (m *DataDeleteRequest) Validate() error {
6403
	return m.validate(false)
6404
}
6405
6406
// ValidateAll checks the field values on DataDeleteRequest with the rules
6407
// defined in the proto definition for this message. If any rules are
6408
// violated, the result is a list of violation errors wrapped in
6409
// DataDeleteRequestMultiError, or nil if none found.
6410
func (m *DataDeleteRequest) ValidateAll() error {
6411
	return m.validate(true)
6412
}
6413
6414
func (m *DataDeleteRequest) validate(all bool) error {
6415
	if m == nil {
6416
		return nil
6417
	}
6418
6419
	var errors []error
6420
6421
	if len(m.GetTenantId()) > 128 {
6422
		err := DataDeleteRequestValidationError{
6423
			field:  "TenantId",
6424
			reason: "value length must be at most 128 bytes",
6425
		}
6426
		if !all {
6427
			return err
6428
		}
6429
		errors = append(errors, err)
6430
	}
6431
6432
	if !_DataDeleteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
6433
		err := DataDeleteRequestValidationError{
6434
			field:  "TenantId",
6435
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
6436
		}
6437
		if !all {
6438
			return err
6439
		}
6440
		errors = append(errors, err)
6441
	}
6442
6443
	if m.GetTupleFilter() == nil {
6444
		err := DataDeleteRequestValidationError{
6445
			field:  "TupleFilter",
6446
			reason: "value is required",
6447
		}
6448
		if !all {
6449
			return err
6450
		}
6451
		errors = append(errors, err)
6452
	}
6453
6454
	if all {
6455
		switch v := interface{}(m.GetTupleFilter()).(type) {
6456
		case interface{ ValidateAll() error }:
6457
			if err := v.ValidateAll(); err != nil {
6458
				errors = append(errors, DataDeleteRequestValidationError{
6459
					field:  "TupleFilter",
6460
					reason: "embedded message failed validation",
6461
					cause:  err,
6462
				})
6463
			}
6464
		case interface{ Validate() error }:
6465
			if err := v.Validate(); err != nil {
6466
				errors = append(errors, DataDeleteRequestValidationError{
6467
					field:  "TupleFilter",
6468
					reason: "embedded message failed validation",
6469
					cause:  err,
6470
				})
6471
			}
6472
		}
6473
	} else if v, ok := interface{}(m.GetTupleFilter()).(interface{ Validate() error }); ok {
6474
		if err := v.Validate(); err != nil {
6475
			return DataDeleteRequestValidationError{
6476
				field:  "TupleFilter",
6477
				reason: "embedded message failed validation",
6478
				cause:  err,
6479
			}
6480
		}
6481
	}
6482
6483
	if m.GetAttributeFilter() == nil {
6484
		err := DataDeleteRequestValidationError{
6485
			field:  "AttributeFilter",
6486
			reason: "value is required",
6487
		}
6488
		if !all {
6489
			return err
6490
		}
6491
		errors = append(errors, err)
6492
	}
6493
6494
	if all {
6495
		switch v := interface{}(m.GetAttributeFilter()).(type) {
6496
		case interface{ ValidateAll() error }:
6497
			if err := v.ValidateAll(); err != nil {
6498
				errors = append(errors, DataDeleteRequestValidationError{
6499
					field:  "AttributeFilter",
6500
					reason: "embedded message failed validation",
6501
					cause:  err,
6502
				})
6503
			}
6504
		case interface{ Validate() error }:
6505
			if err := v.Validate(); err != nil {
6506
				errors = append(errors, DataDeleteRequestValidationError{
6507
					field:  "AttributeFilter",
6508
					reason: "embedded message failed validation",
6509
					cause:  err,
6510
				})
6511
			}
6512
		}
6513
	} else if v, ok := interface{}(m.GetAttributeFilter()).(interface{ Validate() error }); ok {
6514
		if err := v.Validate(); err != nil {
6515
			return DataDeleteRequestValidationError{
6516
				field:  "AttributeFilter",
6517
				reason: "embedded message failed validation",
6518
				cause:  err,
6519
			}
6520
		}
6521
	}
6522
6523
	if len(errors) > 0 {
6524
		return DataDeleteRequestMultiError(errors)
6525
	}
6526
6527
	return nil
6528
}
6529
6530
// DataDeleteRequestMultiError is an error wrapping multiple validation errors
6531
// returned by DataDeleteRequest.ValidateAll() if the designated constraints
6532
// aren't met.
6533
type DataDeleteRequestMultiError []error
6534
6535
// Error returns a concatenation of all the error messages it wraps.
6536
func (m DataDeleteRequestMultiError) Error() string {
6537
	var msgs []string
6538
	for _, err := range m {
6539
		msgs = append(msgs, err.Error())
6540
	}
6541
	return strings.Join(msgs, "; ")
6542
}
6543
6544
// AllErrors returns a list of validation violation errors.
6545
func (m DataDeleteRequestMultiError) AllErrors() []error { return m }
6546
6547
// DataDeleteRequestValidationError is the validation error returned by
6548
// DataDeleteRequest.Validate if the designated constraints aren't met.
6549
type DataDeleteRequestValidationError struct {
6550
	field  string
6551
	reason string
6552
	cause  error
6553
	key    bool
6554
}
6555
6556
// Field function returns field value.
6557
func (e DataDeleteRequestValidationError) Field() string { return e.field }
6558
6559
// Reason function returns reason value.
6560
func (e DataDeleteRequestValidationError) Reason() string { return e.reason }
6561
6562
// Cause function returns cause value.
6563
func (e DataDeleteRequestValidationError) Cause() error { return e.cause }
6564
6565
// Key function returns key value.
6566
func (e DataDeleteRequestValidationError) Key() bool { return e.key }
6567
6568
// ErrorName returns error name.
6569
func (e DataDeleteRequestValidationError) ErrorName() string {
6570
	return "DataDeleteRequestValidationError"
6571
}
6572
6573
// Error satisfies the builtin error interface
6574
func (e DataDeleteRequestValidationError) Error() string {
6575
	cause := ""
6576
	if e.cause != nil {
6577
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
6578
	}
6579
6580
	key := ""
6581
	if e.key {
6582
		key = "key for "
6583
	}
6584
6585
	return fmt.Sprintf(
6586
		"invalid %sDataDeleteRequest.%s: %s%s",
6587
		key,
6588
		e.field,
6589
		e.reason,
6590
		cause)
6591
}
6592
6593
var _ error = DataDeleteRequestValidationError{}
6594
6595
var _ interface {
6596
	Field() string
6597
	Reason() string
6598
	Key() bool
6599
	Cause() error
6600
	ErrorName() string
6601
} = DataDeleteRequestValidationError{}
6602
6603
var _DataDeleteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
6604
6605
// Validate checks the field values on DataDeleteResponse with the rules
6606
// defined in the proto definition for this message. If any rules are
6607
// violated, the first error encountered is returned, or nil if there are no violations.
6608
func (m *DataDeleteResponse) Validate() error {
6609
	return m.validate(false)
6610
}
6611
6612
// ValidateAll checks the field values on DataDeleteResponse with the rules
6613
// defined in the proto definition for this message. If any rules are
6614
// violated, the result is a list of violation errors wrapped in
6615
// DataDeleteResponseMultiError, or nil if none found.
6616
func (m *DataDeleteResponse) ValidateAll() error {
6617
	return m.validate(true)
6618
}
6619
6620
func (m *DataDeleteResponse) validate(all bool) error {
6621
	if m == nil {
6622
		return nil
6623
	}
6624
6625
	var errors []error
6626
6627
	// no validation rules for SnapToken
6628
6629
	if len(errors) > 0 {
6630
		return DataDeleteResponseMultiError(errors)
6631
	}
6632
6633
	return nil
6634
}
6635
6636
// DataDeleteResponseMultiError is an error wrapping multiple validation errors
6637
// returned by DataDeleteResponse.ValidateAll() if the designated constraints
6638
// aren't met.
6639
type DataDeleteResponseMultiError []error
6640
6641
// Error returns a concatenation of all the error messages it wraps.
6642
func (m DataDeleteResponseMultiError) Error() string {
6643
	var msgs []string
6644
	for _, err := range m {
6645
		msgs = append(msgs, err.Error())
6646
	}
6647
	return strings.Join(msgs, "; ")
6648
}
6649
6650
// AllErrors returns a list of validation violation errors.
6651
func (m DataDeleteResponseMultiError) AllErrors() []error { return m }
6652
6653
// DataDeleteResponseValidationError is the validation error returned by
6654
// DataDeleteResponse.Validate if the designated constraints aren't met.
6655
type DataDeleteResponseValidationError struct {
6656
	field  string
6657
	reason string
6658
	cause  error
6659
	key    bool
6660
}
6661
6662
// Field function returns field value.
6663
func (e DataDeleteResponseValidationError) Field() string { return e.field }
6664
6665
// Reason function returns reason value.
6666
func (e DataDeleteResponseValidationError) Reason() string { return e.reason }
6667
6668
// Cause function returns cause value.
6669
func (e DataDeleteResponseValidationError) Cause() error { return e.cause }
6670
6671
// Key function returns key value.
6672
func (e DataDeleteResponseValidationError) Key() bool { return e.key }
6673
6674
// ErrorName returns error name.
6675
func (e DataDeleteResponseValidationError) ErrorName() string {
6676
	return "DataDeleteResponseValidationError"
6677
}
6678
6679
// Error satisfies the builtin error interface
6680
func (e DataDeleteResponseValidationError) Error() string {
6681
	cause := ""
6682
	if e.cause != nil {
6683
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
6684
	}
6685
6686
	key := ""
6687
	if e.key {
6688
		key = "key for "
6689
	}
6690
6691
	return fmt.Sprintf(
6692
		"invalid %sDataDeleteResponse.%s: %s%s",
6693
		key,
6694
		e.field,
6695
		e.reason,
6696
		cause)
6697
}
6698
6699
var _ error = DataDeleteResponseValidationError{}
6700
6701
var _ interface {
6702
	Field() string
6703
	Reason() string
6704
	Key() bool
6705
	Cause() error
6706
	ErrorName() string
6707
} = DataDeleteResponseValidationError{}
6708
6709
// Validate checks the field values on RelationshipDeleteRequest with the rules
6710
// defined in the proto definition for this message. If any rules are
6711
// violated, the first error encountered is returned, or nil if there are no violations.
6712
func (m *RelationshipDeleteRequest) Validate() error {
6713
	return m.validate(false)
6714
}
6715
6716
// ValidateAll checks the field values on RelationshipDeleteRequest with the
6717
// rules defined in the proto definition for this message. If any rules are
6718
// violated, the result is a list of violation errors wrapped in
6719
// RelationshipDeleteRequestMultiError, or nil if none found.
6720
func (m *RelationshipDeleteRequest) ValidateAll() error {
6721
	return m.validate(true)
6722
}
6723
6724
func (m *RelationshipDeleteRequest) validate(all bool) error {
6725
	if m == nil {
6726
		return nil
6727
	}
6728
6729
	var errors []error
6730
6731
	if len(m.GetTenantId()) > 128 {
6732
		err := RelationshipDeleteRequestValidationError{
6733
			field:  "TenantId",
6734
			reason: "value length must be at most 128 bytes",
6735
		}
6736
		if !all {
6737
			return err
6738
		}
6739
		errors = append(errors, err)
6740
	}
6741
6742
	if !_RelationshipDeleteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
6743
		err := RelationshipDeleteRequestValidationError{
6744
			field:  "TenantId",
6745
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
6746
		}
6747
		if !all {
6748
			return err
6749
		}
6750
		errors = append(errors, err)
6751
	}
6752
6753
	if all {
6754
		switch v := interface{}(m.GetFilter()).(type) {
6755
		case interface{ ValidateAll() error }:
6756
			if err := v.ValidateAll(); err != nil {
6757
				errors = append(errors, RelationshipDeleteRequestValidationError{
6758
					field:  "Filter",
6759
					reason: "embedded message failed validation",
6760
					cause:  err,
6761
				})
6762
			}
6763
		case interface{ Validate() error }:
6764
			if err := v.Validate(); err != nil {
6765
				errors = append(errors, RelationshipDeleteRequestValidationError{
6766
					field:  "Filter",
6767
					reason: "embedded message failed validation",
6768
					cause:  err,
6769
				})
6770
			}
6771
		}
6772
	} else if v, ok := interface{}(m.GetFilter()).(interface{ Validate() error }); ok {
6773
		if err := v.Validate(); err != nil {
6774
			return RelationshipDeleteRequestValidationError{
6775
				field:  "Filter",
6776
				reason: "embedded message failed validation",
6777
				cause:  err,
6778
			}
6779
		}
6780
	}
6781
6782
	if len(errors) > 0 {
6783
		return RelationshipDeleteRequestMultiError(errors)
6784
	}
6785
6786
	return nil
6787
}
6788
6789
// RelationshipDeleteRequestMultiError is an error wrapping multiple validation
6790
// errors returned by RelationshipDeleteRequest.ValidateAll() if the
6791
// designated constraints aren't met.
6792
type RelationshipDeleteRequestMultiError []error
6793
6794
// Error returns a concatenation of all the error messages it wraps.
6795
func (m RelationshipDeleteRequestMultiError) Error() string {
6796
	var msgs []string
6797
	for _, err := range m {
6798
		msgs = append(msgs, err.Error())
6799
	}
6800
	return strings.Join(msgs, "; ")
6801
}
6802
6803
// AllErrors returns a list of validation violation errors.
6804
func (m RelationshipDeleteRequestMultiError) AllErrors() []error { return m }
6805
6806
// RelationshipDeleteRequestValidationError is the validation error returned by
6807
// RelationshipDeleteRequest.Validate if the designated constraints aren't met.
6808
type RelationshipDeleteRequestValidationError struct {
6809
	field  string
6810
	reason string
6811
	cause  error
6812
	key    bool
6813
}
6814
6815
// Field function returns field value.
6816
func (e RelationshipDeleteRequestValidationError) Field() string { return e.field }
6817
6818
// Reason function returns reason value.
6819
func (e RelationshipDeleteRequestValidationError) Reason() string { return e.reason }
6820
6821
// Cause function returns cause value.
6822
func (e RelationshipDeleteRequestValidationError) Cause() error { return e.cause }
6823
6824
// Key function returns key value.
6825
func (e RelationshipDeleteRequestValidationError) Key() bool { return e.key }
6826
6827
// ErrorName returns error name.
6828
func (e RelationshipDeleteRequestValidationError) ErrorName() string {
6829
	return "RelationshipDeleteRequestValidationError"
6830
}
6831
6832
// Error satisfies the builtin error interface
6833
func (e RelationshipDeleteRequestValidationError) Error() string {
6834
	cause := ""
6835
	if e.cause != nil {
6836
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
6837
	}
6838
6839
	key := ""
6840
	if e.key {
6841
		key = "key for "
6842
	}
6843
6844
	return fmt.Sprintf(
6845
		"invalid %sRelationshipDeleteRequest.%s: %s%s",
6846
		key,
6847
		e.field,
6848
		e.reason,
6849
		cause)
6850
}
6851
6852
var _ error = RelationshipDeleteRequestValidationError{}
6853
6854
var _ interface {
6855
	Field() string
6856
	Reason() string
6857
	Key() bool
6858
	Cause() error
6859
	ErrorName() string
6860
} = RelationshipDeleteRequestValidationError{}
6861
6862
var _RelationshipDeleteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
6863
6864
// Validate checks the field values on RelationshipDeleteResponse with the
6865
// rules defined in the proto definition for this message. If any rules are
6866
// violated, the first error encountered is returned, or nil if there are no violations.
6867
func (m *RelationshipDeleteResponse) Validate() error {
6868
	return m.validate(false)
6869
}
6870
6871
// ValidateAll checks the field values on RelationshipDeleteResponse with the
6872
// rules defined in the proto definition for this message. If any rules are
6873
// violated, the result is a list of violation errors wrapped in
6874
// RelationshipDeleteResponseMultiError, or nil if none found.
6875
func (m *RelationshipDeleteResponse) ValidateAll() error {
6876
	return m.validate(true)
6877
}
6878
6879
func (m *RelationshipDeleteResponse) validate(all bool) error {
6880
	if m == nil {
6881
		return nil
6882
	}
6883
6884
	var errors []error
6885
6886
	// no validation rules for SnapToken
6887
6888
	if len(errors) > 0 {
6889
		return RelationshipDeleteResponseMultiError(errors)
6890
	}
6891
6892
	return nil
6893
}
6894
6895
// RelationshipDeleteResponseMultiError is an error wrapping multiple
6896
// validation errors returned by RelationshipDeleteResponse.ValidateAll() if
6897
// the designated constraints aren't met.
6898
type RelationshipDeleteResponseMultiError []error
6899
6900
// Error returns a concatenation of all the error messages it wraps.
6901
func (m RelationshipDeleteResponseMultiError) Error() string {
6902
	var msgs []string
6903
	for _, err := range m {
6904
		msgs = append(msgs, err.Error())
6905
	}
6906
	return strings.Join(msgs, "; ")
6907
}
6908
6909
// AllErrors returns a list of validation violation errors.
6910
func (m RelationshipDeleteResponseMultiError) AllErrors() []error { return m }
6911
6912
// RelationshipDeleteResponseValidationError is the validation error returned
6913
// by RelationshipDeleteResponse.Validate if the designated constraints aren't met.
6914
type RelationshipDeleteResponseValidationError struct {
6915
	field  string
6916
	reason string
6917
	cause  error
6918
	key    bool
6919
}
6920
6921
// Field function returns field value.
6922
func (e RelationshipDeleteResponseValidationError) Field() string { return e.field }
6923
6924
// Reason function returns reason value.
6925
func (e RelationshipDeleteResponseValidationError) Reason() string { return e.reason }
6926
6927
// Cause function returns cause value.
6928
func (e RelationshipDeleteResponseValidationError) Cause() error { return e.cause }
6929
6930
// Key function returns key value.
6931
func (e RelationshipDeleteResponseValidationError) Key() bool { return e.key }
6932
6933
// ErrorName returns error name.
6934
func (e RelationshipDeleteResponseValidationError) ErrorName() string {
6935
	return "RelationshipDeleteResponseValidationError"
6936
}
6937
6938
// Error satisfies the builtin error interface
6939
func (e RelationshipDeleteResponseValidationError) Error() string {
6940
	cause := ""
6941
	if e.cause != nil {
6942
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
6943
	}
6944
6945
	key := ""
6946
	if e.key {
6947
		key = "key for "
6948
	}
6949
6950
	return fmt.Sprintf(
6951
		"invalid %sRelationshipDeleteResponse.%s: %s%s",
6952
		key,
6953
		e.field,
6954
		e.reason,
6955
		cause)
6956
}
6957
6958
var _ error = RelationshipDeleteResponseValidationError{}
6959
6960
var _ interface {
6961
	Field() string
6962
	Reason() string
6963
	Key() bool
6964
	Cause() error
6965
	ErrorName() string
6966
} = RelationshipDeleteResponseValidationError{}
6967
6968
// Validate checks the field values on BundleRunRequest with the rules defined
6969
// in the proto definition for this message. If any rules are violated, the
6970
// first error encountered is returned, or nil if there are no violations.
6971
func (m *BundleRunRequest) Validate() error {
6972
	return m.validate(false)
6973
}
6974
6975
// ValidateAll checks the field values on BundleRunRequest with the rules
6976
// defined in the proto definition for this message. If any rules are
6977
// violated, the result is a list of violation errors wrapped in
6978
// BundleRunRequestMultiError, or nil if none found.
6979
func (m *BundleRunRequest) ValidateAll() error {
6980
	return m.validate(true)
6981
}
6982
6983
func (m *BundleRunRequest) validate(all bool) error {
6984
	if m == nil {
6985
		return nil
6986
	}
6987
6988
	var errors []error
6989
6990
	if len(m.GetTenantId()) > 128 {
6991
		err := BundleRunRequestValidationError{
6992
			field:  "TenantId",
6993
			reason: "value length must be at most 128 bytes",
6994
		}
6995
		if !all {
6996
			return err
6997
		}
6998
		errors = append(errors, err)
6999
	}
7000
7001
	if !_BundleRunRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
7002
		err := BundleRunRequestValidationError{
7003
			field:  "TenantId",
7004
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
7005
		}
7006
		if !all {
7007
			return err
7008
		}
7009
		errors = append(errors, err)
7010
	}
7011
7012
	// no validation rules for Name
7013
7014
	// no validation rules for Arguments
7015
7016
	if len(errors) > 0 {
7017
		return BundleRunRequestMultiError(errors)
7018
	}
7019
7020
	return nil
7021
}
7022
7023
// BundleRunRequestMultiError is an error wrapping multiple validation errors
7024
// returned by BundleRunRequest.ValidateAll() if the designated constraints
7025
// aren't met.
7026
type BundleRunRequestMultiError []error
7027
7028
// Error returns a concatenation of all the error messages it wraps.
7029
func (m BundleRunRequestMultiError) Error() string {
7030
	var msgs []string
7031
	for _, err := range m {
7032
		msgs = append(msgs, err.Error())
7033
	}
7034
	return strings.Join(msgs, "; ")
7035
}
7036
7037
// AllErrors returns a list of validation violation errors.
7038
func (m BundleRunRequestMultiError) AllErrors() []error { return m }
7039
7040
// BundleRunRequestValidationError is the validation error returned by
7041
// BundleRunRequest.Validate if the designated constraints aren't met.
7042
type BundleRunRequestValidationError struct {
7043
	field  string
7044
	reason string
7045
	cause  error
7046
	key    bool
7047
}
7048
7049
// Field function returns field value.
7050
func (e BundleRunRequestValidationError) Field() string { return e.field }
7051
7052
// Reason function returns reason value.
7053
func (e BundleRunRequestValidationError) Reason() string { return e.reason }
7054
7055
// Cause function returns cause value.
7056
func (e BundleRunRequestValidationError) Cause() error { return e.cause }
7057
7058
// Key function returns key value.
7059
func (e BundleRunRequestValidationError) Key() bool { return e.key }
7060
7061
// ErrorName returns error name.
7062
func (e BundleRunRequestValidationError) ErrorName() string { return "BundleRunRequestValidationError" }
7063
7064
// Error satisfies the builtin error interface
7065
func (e BundleRunRequestValidationError) Error() string {
7066
	cause := ""
7067
	if e.cause != nil {
7068
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
7069
	}
7070
7071
	key := ""
7072
	if e.key {
7073
		key = "key for "
7074
	}
7075
7076
	return fmt.Sprintf(
7077
		"invalid %sBundleRunRequest.%s: %s%s",
7078
		key,
7079
		e.field,
7080
		e.reason,
7081
		cause)
7082
}
7083
7084
var _ error = BundleRunRequestValidationError{}
7085
7086
var _ interface {
7087
	Field() string
7088
	Reason() string
7089
	Key() bool
7090
	Cause() error
7091
	ErrorName() string
7092
} = BundleRunRequestValidationError{}
7093
7094
var _BundleRunRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
7095
7096
// Validate checks the field values on BundleRunResponse with the rules defined
7097
// in the proto definition for this message. If any rules are violated, the
7098
// first error encountered is returned, or nil if there are no violations.
7099
func (m *BundleRunResponse) Validate() error {
7100
	return m.validate(false)
7101
}
7102
7103
// ValidateAll checks the field values on BundleRunResponse with the rules
7104
// defined in the proto definition for this message. If any rules are
7105
// violated, the result is a list of violation errors wrapped in
7106
// BundleRunResponseMultiError, or nil if none found.
7107
func (m *BundleRunResponse) ValidateAll() error {
7108
	return m.validate(true)
7109
}
7110
7111
func (m *BundleRunResponse) validate(all bool) error {
7112
	if m == nil {
7113
		return nil
7114
	}
7115
7116
	var errors []error
7117
7118
	// no validation rules for SnapToken
7119
7120
	if len(errors) > 0 {
7121
		return BundleRunResponseMultiError(errors)
7122
	}
7123
7124
	return nil
7125
}
7126
7127
// BundleRunResponseMultiError is an error wrapping multiple validation errors
7128
// returned by BundleRunResponse.ValidateAll() if the designated constraints
7129
// aren't met.
7130
type BundleRunResponseMultiError []error
7131
7132
// Error returns a concatenation of all the error messages it wraps.
7133
func (m BundleRunResponseMultiError) Error() string {
7134
	var msgs []string
7135
	for _, err := range m {
7136
		msgs = append(msgs, err.Error())
7137
	}
7138
	return strings.Join(msgs, "; ")
7139
}
7140
7141
// AllErrors returns a list of validation violation errors.
7142
func (m BundleRunResponseMultiError) AllErrors() []error { return m }
7143
7144
// BundleRunResponseValidationError is the validation error returned by
7145
// BundleRunResponse.Validate if the designated constraints aren't met.
7146
type BundleRunResponseValidationError struct {
7147
	field  string
7148
	reason string
7149
	cause  error
7150
	key    bool
7151
}
7152
7153
// Field function returns field value.
7154
func (e BundleRunResponseValidationError) Field() string { return e.field }
7155
7156
// Reason function returns reason value.
7157
func (e BundleRunResponseValidationError) Reason() string { return e.reason }
7158
7159
// Cause function returns cause value.
7160
func (e BundleRunResponseValidationError) Cause() error { return e.cause }
7161
7162
// Key function returns key value.
7163
func (e BundleRunResponseValidationError) Key() bool { return e.key }
7164
7165
// ErrorName returns error name.
7166
func (e BundleRunResponseValidationError) ErrorName() string {
7167
	return "BundleRunResponseValidationError"
7168
}
7169
7170
// Error satisfies the builtin error interface
7171
func (e BundleRunResponseValidationError) Error() string {
7172
	cause := ""
7173
	if e.cause != nil {
7174
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
7175
	}
7176
7177
	key := ""
7178
	if e.key {
7179
		key = "key for "
7180
	}
7181
7182
	return fmt.Sprintf(
7183
		"invalid %sBundleRunResponse.%s: %s%s",
7184
		key,
7185
		e.field,
7186
		e.reason,
7187
		cause)
7188
}
7189
7190
var _ error = BundleRunResponseValidationError{}
7191
7192
var _ interface {
7193
	Field() string
7194
	Reason() string
7195
	Key() bool
7196
	Cause() error
7197
	ErrorName() string
7198
} = BundleRunResponseValidationError{}
7199
7200
// Validate checks the field values on BundleWriteRequest with the rules
7201
// defined in the proto definition for this message. If any rules are
7202
// violated, the first error encountered is returned, or nil if there are no violations.
7203
func (m *BundleWriteRequest) Validate() error {
7204
	return m.validate(false)
7205
}
7206
7207
// ValidateAll checks the field values on BundleWriteRequest with the rules
7208
// defined in the proto definition for this message. If any rules are
7209
// violated, the result is a list of violation errors wrapped in
7210
// BundleWriteRequestMultiError, or nil if none found.
7211
func (m *BundleWriteRequest) ValidateAll() error {
7212
	return m.validate(true)
7213
}
7214
7215
func (m *BundleWriteRequest) validate(all bool) error {
7216
	if m == nil {
7217
		return nil
7218
	}
7219
7220
	var errors []error
7221
7222
	if len(m.GetTenantId()) > 128 {
7223
		err := BundleWriteRequestValidationError{
7224
			field:  "TenantId",
7225
			reason: "value length must be at most 128 bytes",
7226
		}
7227
		if !all {
7228
			return err
7229
		}
7230
		errors = append(errors, err)
7231
	}
7232
7233
	if !_BundleWriteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
7234
		err := BundleWriteRequestValidationError{
7235
			field:  "TenantId",
7236
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
7237
		}
7238
		if !all {
7239
			return err
7240
		}
7241
		errors = append(errors, err)
7242
	}
7243
7244
	for idx, item := range m.GetBundles() {
7245
		_, _ = idx, item
7246
7247
		if all {
7248
			switch v := interface{}(item).(type) {
7249
			case interface{ ValidateAll() error }:
7250
				if err := v.ValidateAll(); err != nil {
7251
					errors = append(errors, BundleWriteRequestValidationError{
7252
						field:  fmt.Sprintf("Bundles[%v]", idx),
7253
						reason: "embedded message failed validation",
7254
						cause:  err,
7255
					})
7256
				}
7257
			case interface{ Validate() error }:
7258
				if err := v.Validate(); err != nil {
7259
					errors = append(errors, BundleWriteRequestValidationError{
7260
						field:  fmt.Sprintf("Bundles[%v]", idx),
7261
						reason: "embedded message failed validation",
7262
						cause:  err,
7263
					})
7264
				}
7265
			}
7266
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
7267
			if err := v.Validate(); err != nil {
7268
				return BundleWriteRequestValidationError{
7269
					field:  fmt.Sprintf("Bundles[%v]", idx),
7270
					reason: "embedded message failed validation",
7271
					cause:  err,
7272
				}
7273
			}
7274
		}
7275
7276
	}
7277
7278
	if len(errors) > 0 {
7279
		return BundleWriteRequestMultiError(errors)
7280
	}
7281
7282
	return nil
7283
}
7284
7285
// BundleWriteRequestMultiError is an error wrapping multiple validation errors
7286
// returned by BundleWriteRequest.ValidateAll() if the designated constraints
7287
// aren't met.
7288
type BundleWriteRequestMultiError []error
7289
7290
// Error returns a concatenation of all the error messages it wraps.
7291
func (m BundleWriteRequestMultiError) Error() string {
7292
	var msgs []string
7293
	for _, err := range m {
7294
		msgs = append(msgs, err.Error())
7295
	}
7296
	return strings.Join(msgs, "; ")
7297
}
7298
7299
// AllErrors returns a list of validation violation errors.
7300
func (m BundleWriteRequestMultiError) AllErrors() []error { return m }
7301
7302
// BundleWriteRequestValidationError is the validation error returned by
7303
// BundleWriteRequest.Validate if the designated constraints aren't met.
7304
type BundleWriteRequestValidationError struct {
7305
	field  string
7306
	reason string
7307
	cause  error
7308
	key    bool
7309
}
7310
7311
// Field function returns field value.
7312
func (e BundleWriteRequestValidationError) Field() string { return e.field }
7313
7314
// Reason function returns reason value.
7315
func (e BundleWriteRequestValidationError) Reason() string { return e.reason }
7316
7317
// Cause function returns cause value.
7318
func (e BundleWriteRequestValidationError) Cause() error { return e.cause }
7319
7320
// Key function returns key value.
7321
func (e BundleWriteRequestValidationError) Key() bool { return e.key }
7322
7323
// ErrorName returns error name.
7324
func (e BundleWriteRequestValidationError) ErrorName() string {
7325
	return "BundleWriteRequestValidationError"
7326
}
7327
7328
// Error satisfies the builtin error interface
7329
func (e BundleWriteRequestValidationError) Error() string {
7330
	cause := ""
7331
	if e.cause != nil {
7332
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
7333
	}
7334
7335
	key := ""
7336
	if e.key {
7337
		key = "key for "
7338
	}
7339
7340
	return fmt.Sprintf(
7341
		"invalid %sBundleWriteRequest.%s: %s%s",
7342
		key,
7343
		e.field,
7344
		e.reason,
7345
		cause)
7346
}
7347
7348
var _ error = BundleWriteRequestValidationError{}
7349
7350
var _ interface {
7351
	Field() string
7352
	Reason() string
7353
	Key() bool
7354
	Cause() error
7355
	ErrorName() string
7356
} = BundleWriteRequestValidationError{}
7357
7358
var _BundleWriteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
7359
7360
// Validate checks the field values on BundleWriteResponse with the rules
7361
// defined in the proto definition for this message. If any rules are
7362
// violated, the first error encountered is returned, or nil if there are no violations.
7363
func (m *BundleWriteResponse) Validate() error {
7364
	return m.validate(false)
7365
}
7366
7367
// ValidateAll checks the field values on BundleWriteResponse with the rules
7368
// defined in the proto definition for this message. If any rules are
7369
// violated, the result is a list of violation errors wrapped in
7370
// BundleWriteResponseMultiError, or nil if none found.
7371
func (m *BundleWriteResponse) ValidateAll() error {
7372
	return m.validate(true)
7373
}
7374
7375
func (m *BundleWriteResponse) validate(all bool) error {
7376
	if m == nil {
7377
		return nil
7378
	}
7379
7380
	var errors []error
7381
7382
	if len(errors) > 0 {
7383
		return BundleWriteResponseMultiError(errors)
7384
	}
7385
7386
	return nil
7387
}
7388
7389
// BundleWriteResponseMultiError is an error wrapping multiple validation
7390
// errors returned by BundleWriteResponse.ValidateAll() if the designated
7391
// constraints aren't met.
7392
type BundleWriteResponseMultiError []error
7393
7394
// Error returns a concatenation of all the error messages it wraps.
7395
func (m BundleWriteResponseMultiError) Error() string {
7396
	var msgs []string
7397
	for _, err := range m {
7398
		msgs = append(msgs, err.Error())
7399
	}
7400
	return strings.Join(msgs, "; ")
7401
}
7402
7403
// AllErrors returns a list of validation violation errors.
7404
func (m BundleWriteResponseMultiError) AllErrors() []error { return m }
7405
7406
// BundleWriteResponseValidationError is the validation error returned by
7407
// BundleWriteResponse.Validate if the designated constraints aren't met.
7408
type BundleWriteResponseValidationError struct {
7409
	field  string
7410
	reason string
7411
	cause  error
7412
	key    bool
7413
}
7414
7415
// Field function returns field value.
7416
func (e BundleWriteResponseValidationError) Field() string { return e.field }
7417
7418
// Reason function returns reason value.
7419
func (e BundleWriteResponseValidationError) Reason() string { return e.reason }
7420
7421
// Cause function returns cause value.
7422
func (e BundleWriteResponseValidationError) Cause() error { return e.cause }
7423
7424
// Key function returns key value.
7425
func (e BundleWriteResponseValidationError) Key() bool { return e.key }
7426
7427
// ErrorName returns error name.
7428
func (e BundleWriteResponseValidationError) ErrorName() string {
7429
	return "BundleWriteResponseValidationError"
7430
}
7431
7432
// Error satisfies the builtin error interface
7433
func (e BundleWriteResponseValidationError) Error() string {
7434
	cause := ""
7435
	if e.cause != nil {
7436
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
7437
	}
7438
7439
	key := ""
7440
	if e.key {
7441
		key = "key for "
7442
	}
7443
7444
	return fmt.Sprintf(
7445
		"invalid %sBundleWriteResponse.%s: %s%s",
7446
		key,
7447
		e.field,
7448
		e.reason,
7449
		cause)
7450
}
7451
7452
var _ error = BundleWriteResponseValidationError{}
7453
7454
var _ interface {
7455
	Field() string
7456
	Reason() string
7457
	Key() bool
7458
	Cause() error
7459
	ErrorName() string
7460
} = BundleWriteResponseValidationError{}
7461
7462
// Validate checks the field values on BundleReadRequest with the rules defined
7463
// in the proto definition for this message. If any rules are violated, the
7464
// first error encountered is returned, or nil if there are no violations.
7465
func (m *BundleReadRequest) Validate() error {
7466
	return m.validate(false)
7467
}
7468
7469
// ValidateAll checks the field values on BundleReadRequest with the rules
7470
// defined in the proto definition for this message. If any rules are
7471
// violated, the result is a list of violation errors wrapped in
7472
// BundleReadRequestMultiError, or nil if none found.
7473
func (m *BundleReadRequest) ValidateAll() error {
7474
	return m.validate(true)
7475
}
7476
7477
func (m *BundleReadRequest) validate(all bool) error {
7478
	if m == nil {
7479
		return nil
7480
	}
7481
7482
	var errors []error
7483
7484
	if len(m.GetTenantId()) > 128 {
7485
		err := BundleReadRequestValidationError{
7486
			field:  "TenantId",
7487
			reason: "value length must be at most 128 bytes",
7488
		}
7489
		if !all {
7490
			return err
7491
		}
7492
		errors = append(errors, err)
7493
	}
7494
7495
	if !_BundleReadRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
7496
		err := BundleReadRequestValidationError{
7497
			field:  "TenantId",
7498
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
7499
		}
7500
		if !all {
7501
			return err
7502
		}
7503
		errors = append(errors, err)
7504
	}
7505
7506
	// no validation rules for Name
7507
7508
	if len(errors) > 0 {
7509
		return BundleReadRequestMultiError(errors)
7510
	}
7511
7512
	return nil
7513
}
7514
7515
// BundleReadRequestMultiError is an error wrapping multiple validation errors
7516
// returned by BundleReadRequest.ValidateAll() if the designated constraints
7517
// aren't met.
7518
type BundleReadRequestMultiError []error
7519
7520
// Error returns a concatenation of all the error messages it wraps.
7521
func (m BundleReadRequestMultiError) Error() string {
7522
	var msgs []string
7523
	for _, err := range m {
7524
		msgs = append(msgs, err.Error())
7525
	}
7526
	return strings.Join(msgs, "; ")
7527
}
7528
7529
// AllErrors returns a list of validation violation errors.
7530
func (m BundleReadRequestMultiError) AllErrors() []error { return m }
7531
7532
// BundleReadRequestValidationError is the validation error returned by
7533
// BundleReadRequest.Validate if the designated constraints aren't met.
7534
type BundleReadRequestValidationError struct {
7535
	field  string
7536
	reason string
7537
	cause  error
7538
	key    bool
7539
}
7540
7541
// Field function returns field value.
7542
func (e BundleReadRequestValidationError) Field() string { return e.field }
7543
7544
// Reason function returns reason value.
7545
func (e BundleReadRequestValidationError) Reason() string { return e.reason }
7546
7547
// Cause function returns cause value.
7548
func (e BundleReadRequestValidationError) Cause() error { return e.cause }
7549
7550
// Key function returns key value.
7551
func (e BundleReadRequestValidationError) Key() bool { return e.key }
7552
7553
// ErrorName returns error name.
7554
func (e BundleReadRequestValidationError) ErrorName() string {
7555
	return "BundleReadRequestValidationError"
7556
}
7557
7558
// Error satisfies the builtin error interface
7559
func (e BundleReadRequestValidationError) Error() string {
7560
	cause := ""
7561
	if e.cause != nil {
7562
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
7563
	}
7564
7565
	key := ""
7566
	if e.key {
7567
		key = "key for "
7568
	}
7569
7570
	return fmt.Sprintf(
7571
		"invalid %sBundleReadRequest.%s: %s%s",
7572
		key,
7573
		e.field,
7574
		e.reason,
7575
		cause)
7576
}
7577
7578
var _ error = BundleReadRequestValidationError{}
7579
7580
var _ interface {
7581
	Field() string
7582
	Reason() string
7583
	Key() bool
7584
	Cause() error
7585
	ErrorName() string
7586
} = BundleReadRequestValidationError{}
7587
7588
var _BundleReadRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
7589
7590
// Validate checks the field values on BundleReadResponse with the rules
7591
// defined in the proto definition for this message. If any rules are
7592
// violated, the first error encountered is returned, or nil if there are no violations.
7593
func (m *BundleReadResponse) Validate() error {
7594
	return m.validate(false)
7595
}
7596
7597
// ValidateAll checks the field values on BundleReadResponse with the rules
7598
// defined in the proto definition for this message. If any rules are
7599
// violated, the result is a list of violation errors wrapped in
7600
// BundleReadResponseMultiError, or nil if none found.
7601
func (m *BundleReadResponse) ValidateAll() error {
7602
	return m.validate(true)
7603
}
7604
7605
func (m *BundleReadResponse) validate(all bool) error {
7606
	if m == nil {
7607
		return nil
7608
	}
7609
7610
	var errors []error
7611
7612
	if all {
7613
		switch v := interface{}(m.GetBundle()).(type) {
7614
		case interface{ ValidateAll() error }:
7615
			if err := v.ValidateAll(); err != nil {
7616
				errors = append(errors, BundleReadResponseValidationError{
7617
					field:  "Bundle",
7618
					reason: "embedded message failed validation",
7619
					cause:  err,
7620
				})
7621
			}
7622
		case interface{ Validate() error }:
7623
			if err := v.Validate(); err != nil {
7624
				errors = append(errors, BundleReadResponseValidationError{
7625
					field:  "Bundle",
7626
					reason: "embedded message failed validation",
7627
					cause:  err,
7628
				})
7629
			}
7630
		}
7631
	} else if v, ok := interface{}(m.GetBundle()).(interface{ Validate() error }); ok {
7632
		if err := v.Validate(); err != nil {
7633
			return BundleReadResponseValidationError{
7634
				field:  "Bundle",
7635
				reason: "embedded message failed validation",
7636
				cause:  err,
7637
			}
7638
		}
7639
	}
7640
7641
	if len(errors) > 0 {
7642
		return BundleReadResponseMultiError(errors)
7643
	}
7644
7645
	return nil
7646
}
7647
7648
// BundleReadResponseMultiError is an error wrapping multiple validation errors
7649
// returned by BundleReadResponse.ValidateAll() if the designated constraints
7650
// aren't met.
7651
type BundleReadResponseMultiError []error
7652
7653
// Error returns a concatenation of all the error messages it wraps.
7654
func (m BundleReadResponseMultiError) Error() string {
7655
	var msgs []string
7656
	for _, err := range m {
7657
		msgs = append(msgs, err.Error())
7658
	}
7659
	return strings.Join(msgs, "; ")
7660
}
7661
7662
// AllErrors returns a list of validation violation errors.
7663
func (m BundleReadResponseMultiError) AllErrors() []error { return m }
7664
7665
// BundleReadResponseValidationError is the validation error returned by
7666
// BundleReadResponse.Validate if the designated constraints aren't met.
7667
type BundleReadResponseValidationError struct {
7668
	field  string
7669
	reason string
7670
	cause  error
7671
	key    bool
7672
}
7673
7674
// Field function returns field value.
7675
func (e BundleReadResponseValidationError) Field() string { return e.field }
7676
7677
// Reason function returns reason value.
7678
func (e BundleReadResponseValidationError) Reason() string { return e.reason }
7679
7680
// Cause function returns cause value.
7681
func (e BundleReadResponseValidationError) Cause() error { return e.cause }
7682
7683
// Key function returns key value.
7684
func (e BundleReadResponseValidationError) Key() bool { return e.key }
7685
7686
// ErrorName returns error name.
7687
func (e BundleReadResponseValidationError) ErrorName() string {
7688
	return "BundleReadResponseValidationError"
7689
}
7690
7691
// Error satisfies the builtin error interface
7692
func (e BundleReadResponseValidationError) Error() string {
7693
	cause := ""
7694
	if e.cause != nil {
7695
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
7696
	}
7697
7698
	key := ""
7699
	if e.key {
7700
		key = "key for "
7701
	}
7702
7703
	return fmt.Sprintf(
7704
		"invalid %sBundleReadResponse.%s: %s%s",
7705
		key,
7706
		e.field,
7707
		e.reason,
7708
		cause)
7709
}
7710
7711
var _ error = BundleReadResponseValidationError{}
7712
7713
var _ interface {
7714
	Field() string
7715
	Reason() string
7716
	Key() bool
7717
	Cause() error
7718
	ErrorName() string
7719
} = BundleReadResponseValidationError{}
7720
7721
// Validate checks the field values on BundleDeleteRequest with the rules
7722
// defined in the proto definition for this message. If any rules are
7723
// violated, the first error encountered is returned, or nil if there are no violations.
7724
func (m *BundleDeleteRequest) Validate() error {
7725
	return m.validate(false)
7726
}
7727
7728
// ValidateAll checks the field values on BundleDeleteRequest with the rules
7729
// defined in the proto definition for this message. If any rules are
7730
// violated, the result is a list of violation errors wrapped in
7731
// BundleDeleteRequestMultiError, or nil if none found.
7732
func (m *BundleDeleteRequest) ValidateAll() error {
7733
	return m.validate(true)
7734
}
7735
7736
func (m *BundleDeleteRequest) validate(all bool) error {
7737
	if m == nil {
7738
		return nil
7739
	}
7740
7741
	var errors []error
7742
7743
	if len(m.GetTenantId()) > 128 {
7744
		err := BundleDeleteRequestValidationError{
7745
			field:  "TenantId",
7746
			reason: "value length must be at most 128 bytes",
7747
		}
7748
		if !all {
7749
			return err
7750
		}
7751
		errors = append(errors, err)
7752
	}
7753
7754
	if !_BundleDeleteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) {
7755
		err := BundleDeleteRequestValidationError{
7756
			field:  "TenantId",
7757
			reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"",
7758
		}
7759
		if !all {
7760
			return err
7761
		}
7762
		errors = append(errors, err)
7763
	}
7764
7765
	// no validation rules for Name
7766
7767
	if len(errors) > 0 {
7768
		return BundleDeleteRequestMultiError(errors)
7769
	}
7770
7771
	return nil
7772
}
7773
7774
// BundleDeleteRequestMultiError is an error wrapping multiple validation
7775
// errors returned by BundleDeleteRequest.ValidateAll() if the designated
7776
// constraints aren't met.
7777
type BundleDeleteRequestMultiError []error
7778
7779
// Error returns a concatenation of all the error messages it wraps.
7780
func (m BundleDeleteRequestMultiError) Error() string {
7781
	var msgs []string
7782
	for _, err := range m {
7783
		msgs = append(msgs, err.Error())
7784
	}
7785
	return strings.Join(msgs, "; ")
7786
}
7787
7788
// AllErrors returns a list of validation violation errors.
7789
func (m BundleDeleteRequestMultiError) AllErrors() []error { return m }
7790
7791
// BundleDeleteRequestValidationError is the validation error returned by
7792
// BundleDeleteRequest.Validate if the designated constraints aren't met.
7793
type BundleDeleteRequestValidationError struct {
7794
	field  string
7795
	reason string
7796
	cause  error
7797
	key    bool
7798
}
7799
7800
// Field function returns field value.
7801
func (e BundleDeleteRequestValidationError) Field() string { return e.field }
7802
7803
// Reason function returns reason value.
7804
func (e BundleDeleteRequestValidationError) Reason() string { return e.reason }
7805
7806
// Cause function returns cause value.
7807
func (e BundleDeleteRequestValidationError) Cause() error { return e.cause }
7808
7809
// Key function returns key value.
7810
func (e BundleDeleteRequestValidationError) Key() bool { return e.key }
7811
7812
// ErrorName returns error name.
7813
func (e BundleDeleteRequestValidationError) ErrorName() string {
7814
	return "BundleDeleteRequestValidationError"
7815
}
7816
7817
// Error satisfies the builtin error interface
7818
func (e BundleDeleteRequestValidationError) Error() string {
7819
	cause := ""
7820
	if e.cause != nil {
7821
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
7822
	}
7823
7824
	key := ""
7825
	if e.key {
7826
		key = "key for "
7827
	}
7828
7829
	return fmt.Sprintf(
7830
		"invalid %sBundleDeleteRequest.%s: %s%s",
7831
		key,
7832
		e.field,
7833
		e.reason,
7834
		cause)
7835
}
7836
7837
var _ error = BundleDeleteRequestValidationError{}
7838
7839
var _ interface {
7840
	Field() string
7841
	Reason() string
7842
	Key() bool
7843
	Cause() error
7844
	ErrorName() string
7845
} = BundleDeleteRequestValidationError{}
7846
7847
var _BundleDeleteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$")
7848
7849
// Validate checks the field values on BundleDeleteResponse with the rules
7850
// defined in the proto definition for this message. If any rules are
7851
// violated, the first error encountered is returned, or nil if there are no violations.
7852
func (m *BundleDeleteResponse) Validate() error {
7853
	return m.validate(false)
7854
}
7855
7856
// ValidateAll checks the field values on BundleDeleteResponse with the rules
7857
// defined in the proto definition for this message. If any rules are
7858
// violated, the result is a list of violation errors wrapped in
7859
// BundleDeleteResponseMultiError, or nil if none found.
7860
func (m *BundleDeleteResponse) ValidateAll() error {
7861
	return m.validate(true)
7862
}
7863
7864
func (m *BundleDeleteResponse) validate(all bool) error {
7865
	if m == nil {
7866
		return nil
7867
	}
7868
7869
	var errors []error
7870
7871
	// no validation rules for Name
7872
7873
	if len(errors) > 0 {
7874
		return BundleDeleteResponseMultiError(errors)
7875
	}
7876
7877
	return nil
7878
}
7879
7880
// BundleDeleteResponseMultiError is an error wrapping multiple validation
7881
// errors returned by BundleDeleteResponse.ValidateAll() if the designated
7882
// constraints aren't met.
7883
type BundleDeleteResponseMultiError []error
7884
7885
// Error returns a concatenation of all the error messages it wraps.
7886
func (m BundleDeleteResponseMultiError) Error() string {
7887
	var msgs []string
7888
	for _, err := range m {
7889
		msgs = append(msgs, err.Error())
7890
	}
7891
	return strings.Join(msgs, "; ")
7892
}
7893
7894
// AllErrors returns a list of validation violation errors.
7895
func (m BundleDeleteResponseMultiError) AllErrors() []error { return m }
7896
7897
// BundleDeleteResponseValidationError is the validation error returned by
7898
// BundleDeleteResponse.Validate if the designated constraints aren't met.
7899
type BundleDeleteResponseValidationError struct {
7900
	field  string
7901
	reason string
7902
	cause  error
7903
	key    bool
7904
}
7905
7906
// Field function returns field value.
7907
func (e BundleDeleteResponseValidationError) Field() string { return e.field }
7908
7909
// Reason function returns reason value.
7910
func (e BundleDeleteResponseValidationError) Reason() string { return e.reason }
7911
7912
// Cause function returns cause value.
7913
func (e BundleDeleteResponseValidationError) Cause() error { return e.cause }
7914
7915
// Key function returns key value.
7916
func (e BundleDeleteResponseValidationError) Key() bool { return e.key }
7917
7918
// ErrorName returns error name.
7919
func (e BundleDeleteResponseValidationError) ErrorName() string {
7920
	return "BundleDeleteResponseValidationError"
7921
}
7922
7923
// Error satisfies the builtin error interface
7924
func (e BundleDeleteResponseValidationError) Error() string {
7925
	cause := ""
7926
	if e.cause != nil {
7927
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
7928
	}
7929
7930
	key := ""
7931
	if e.key {
7932
		key = "key for "
7933
	}
7934
7935
	return fmt.Sprintf(
7936
		"invalid %sBundleDeleteResponse.%s: %s%s",
7937
		key,
7938
		e.field,
7939
		e.reason,
7940
		cause)
7941
}
7942
7943
var _ error = BundleDeleteResponseValidationError{}
7944
7945
var _ interface {
7946
	Field() string
7947
	Reason() string
7948
	Key() bool
7949
	Cause() error
7950
	ErrorName() string
7951
} = BundleDeleteResponseValidationError{}
7952
7953
// Validate checks the field values on TenantCreateRequest with the rules
7954
// defined in the proto definition for this message. If any rules are
7955
// violated, the first error encountered is returned, or nil if there are no violations.
7956
func (m *TenantCreateRequest) Validate() error {
7957
	return m.validate(false)
7958
}
7959
7960
// ValidateAll checks the field values on TenantCreateRequest with the rules
7961
// defined in the proto definition for this message. If any rules are
7962
// violated, the result is a list of violation errors wrapped in
7963
// TenantCreateRequestMultiError, or nil if none found.
7964
func (m *TenantCreateRequest) ValidateAll() error {
7965
	return m.validate(true)
7966
}
7967
7968
func (m *TenantCreateRequest) validate(all bool) error {
7969
	if m == nil {
7970
		return nil
7971
	}
7972
7973
	var errors []error
7974
7975
	if len(m.GetId()) > 64 {
7976
		err := TenantCreateRequestValidationError{
7977
			field:  "Id",
7978
			reason: "value length must be at most 64 bytes",
7979
		}
7980
		if !all {
7981
			return err
7982
		}
7983
		errors = append(errors, err)
7984
	}
7985
7986
	if !_TenantCreateRequest_Id_Pattern.MatchString(m.GetId()) {
7987
		err := TenantCreateRequestValidationError{
7988
			field:  "Id",
7989
			reason: "value does not match regex pattern \"[a-zA-Z0-9-,]+\"",
7990
		}
7991
		if !all {
7992
			return err
7993
		}
7994
		errors = append(errors, err)
7995
	}
7996
7997
	if len(m.GetName()) > 64 {
7998
		err := TenantCreateRequestValidationError{
7999
			field:  "Name",
8000
			reason: "value length must be at most 64 bytes",
8001
		}
8002
		if !all {
8003
			return err
8004
		}
8005
		errors = append(errors, err)
8006
	}
8007
8008
	if len(errors) > 0 {
8009
		return TenantCreateRequestMultiError(errors)
8010
	}
8011
8012
	return nil
8013
}
8014
8015
// TenantCreateRequestMultiError is an error wrapping multiple validation
8016
// errors returned by TenantCreateRequest.ValidateAll() if the designated
8017
// constraints aren't met.
8018
type TenantCreateRequestMultiError []error
8019
8020
// Error returns a concatenation of all the error messages it wraps.
8021
func (m TenantCreateRequestMultiError) Error() string {
8022
	var msgs []string
8023
	for _, err := range m {
8024
		msgs = append(msgs, err.Error())
8025
	}
8026
	return strings.Join(msgs, "; ")
8027
}
8028
8029
// AllErrors returns a list of validation violation errors.
8030
func (m TenantCreateRequestMultiError) AllErrors() []error { return m }
8031
8032
// TenantCreateRequestValidationError is the validation error returned by
8033
// TenantCreateRequest.Validate if the designated constraints aren't met.
8034
type TenantCreateRequestValidationError struct {
8035
	field  string
8036
	reason string
8037
	cause  error
8038
	key    bool
8039
}
8040
8041
// Field function returns field value.
8042
func (e TenantCreateRequestValidationError) Field() string { return e.field }
8043
8044
// Reason function returns reason value.
8045
func (e TenantCreateRequestValidationError) Reason() string { return e.reason }
8046
8047
// Cause function returns cause value.
8048
func (e TenantCreateRequestValidationError) Cause() error { return e.cause }
8049
8050
// Key function returns key value.
8051
func (e TenantCreateRequestValidationError) Key() bool { return e.key }
8052
8053
// ErrorName returns error name.
8054
func (e TenantCreateRequestValidationError) ErrorName() string {
8055
	return "TenantCreateRequestValidationError"
8056
}
8057
8058
// Error satisfies the builtin error interface
8059
func (e TenantCreateRequestValidationError) Error() string {
8060
	cause := ""
8061
	if e.cause != nil {
8062
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
8063
	}
8064
8065
	key := ""
8066
	if e.key {
8067
		key = "key for "
8068
	}
8069
8070
	return fmt.Sprintf(
8071
		"invalid %sTenantCreateRequest.%s: %s%s",
8072
		key,
8073
		e.field,
8074
		e.reason,
8075
		cause)
8076
}
8077
8078
var _ error = TenantCreateRequestValidationError{}
8079
8080
var _ interface {
8081
	Field() string
8082
	Reason() string
8083
	Key() bool
8084
	Cause() error
8085
	ErrorName() string
8086
} = TenantCreateRequestValidationError{}
8087
8088
var _TenantCreateRequest_Id_Pattern = regexp.MustCompile("[a-zA-Z0-9-,]+")
8089
8090
// Validate checks the field values on TenantCreateResponse with the rules
8091
// defined in the proto definition for this message. If any rules are
8092
// violated, the first error encountered is returned, or nil if there are no violations.
8093
func (m *TenantCreateResponse) Validate() error {
8094
	return m.validate(false)
8095
}
8096
8097
// ValidateAll checks the field values on TenantCreateResponse with the rules
8098
// defined in the proto definition for this message. If any rules are
8099
// violated, the result is a list of violation errors wrapped in
8100
// TenantCreateResponseMultiError, or nil if none found.
8101
func (m *TenantCreateResponse) ValidateAll() error {
8102
	return m.validate(true)
8103
}
8104
8105
func (m *TenantCreateResponse) validate(all bool) error {
8106
	if m == nil {
8107
		return nil
8108
	}
8109
8110
	var errors []error
8111
8112
	if all {
8113
		switch v := interface{}(m.GetTenant()).(type) {
8114
		case interface{ ValidateAll() error }:
8115
			if err := v.ValidateAll(); err != nil {
8116
				errors = append(errors, TenantCreateResponseValidationError{
8117
					field:  "Tenant",
8118
					reason: "embedded message failed validation",
8119
					cause:  err,
8120
				})
8121
			}
8122
		case interface{ Validate() error }:
8123
			if err := v.Validate(); err != nil {
8124
				errors = append(errors, TenantCreateResponseValidationError{
8125
					field:  "Tenant",
8126
					reason: "embedded message failed validation",
8127
					cause:  err,
8128
				})
8129
			}
8130
		}
8131
	} else if v, ok := interface{}(m.GetTenant()).(interface{ Validate() error }); ok {
8132
		if err := v.Validate(); err != nil {
8133
			return TenantCreateResponseValidationError{
8134
				field:  "Tenant",
8135
				reason: "embedded message failed validation",
8136
				cause:  err,
8137
			}
8138
		}
8139
	}
8140
8141
	if len(errors) > 0 {
8142
		return TenantCreateResponseMultiError(errors)
8143
	}
8144
8145
	return nil
8146
}
8147
8148
// TenantCreateResponseMultiError is an error wrapping multiple validation
8149
// errors returned by TenantCreateResponse.ValidateAll() if the designated
8150
// constraints aren't met.
8151
type TenantCreateResponseMultiError []error
8152
8153
// Error returns a concatenation of all the error messages it wraps.
8154
func (m TenantCreateResponseMultiError) Error() string {
8155
	var msgs []string
8156
	for _, err := range m {
8157
		msgs = append(msgs, err.Error())
8158
	}
8159
	return strings.Join(msgs, "; ")
8160
}
8161
8162
// AllErrors returns a list of validation violation errors.
8163
func (m TenantCreateResponseMultiError) AllErrors() []error { return m }
8164
8165
// TenantCreateResponseValidationError is the validation error returned by
8166
// TenantCreateResponse.Validate if the designated constraints aren't met.
8167
type TenantCreateResponseValidationError struct {
8168
	field  string
8169
	reason string
8170
	cause  error
8171
	key    bool
8172
}
8173
8174
// Field function returns field value.
8175
func (e TenantCreateResponseValidationError) Field() string { return e.field }
8176
8177
// Reason function returns reason value.
8178
func (e TenantCreateResponseValidationError) Reason() string { return e.reason }
8179
8180
// Cause function returns cause value.
8181
func (e TenantCreateResponseValidationError) Cause() error { return e.cause }
8182
8183
// Key function returns key value.
8184
func (e TenantCreateResponseValidationError) Key() bool { return e.key }
8185
8186
// ErrorName returns error name.
8187
func (e TenantCreateResponseValidationError) ErrorName() string {
8188
	return "TenantCreateResponseValidationError"
8189
}
8190
8191
// Error satisfies the builtin error interface
8192
func (e TenantCreateResponseValidationError) Error() string {
8193
	cause := ""
8194
	if e.cause != nil {
8195
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
8196
	}
8197
8198
	key := ""
8199
	if e.key {
8200
		key = "key for "
8201
	}
8202
8203
	return fmt.Sprintf(
8204
		"invalid %sTenantCreateResponse.%s: %s%s",
8205
		key,
8206
		e.field,
8207
		e.reason,
8208
		cause)
8209
}
8210
8211
var _ error = TenantCreateResponseValidationError{}
8212
8213
var _ interface {
8214
	Field() string
8215
	Reason() string
8216
	Key() bool
8217
	Cause() error
8218
	ErrorName() string
8219
} = TenantCreateResponseValidationError{}
8220
8221
// Validate checks the field values on TenantDeleteRequest with the rules
8222
// defined in the proto definition for this message. If any rules are
8223
// violated, the first error encountered is returned, or nil if there are no violations.
8224
func (m *TenantDeleteRequest) Validate() error {
8225
	return m.validate(false)
8226
}
8227
8228
// ValidateAll checks the field values on TenantDeleteRequest with the rules
8229
// defined in the proto definition for this message. If any rules are
8230
// violated, the result is a list of violation errors wrapped in
8231
// TenantDeleteRequestMultiError, or nil if none found.
8232
func (m *TenantDeleteRequest) ValidateAll() error {
8233
	return m.validate(true)
8234
}
8235
8236
func (m *TenantDeleteRequest) validate(all bool) error {
8237
	if m == nil {
8238
		return nil
8239
	}
8240
8241
	var errors []error
8242
8243
	if len(errors) > 0 {
8244
		return TenantDeleteRequestMultiError(errors)
8245
	}
8246
8247
	return nil
8248
}
8249
8250
// TenantDeleteRequestMultiError is an error wrapping multiple validation
8251
// errors returned by TenantDeleteRequest.ValidateAll() if the designated
8252
// constraints aren't met.
8253
type TenantDeleteRequestMultiError []error
8254
8255
// Error returns a concatenation of all the error messages it wraps.
8256
func (m TenantDeleteRequestMultiError) Error() string {
8257
	var msgs []string
8258
	for _, err := range m {
8259
		msgs = append(msgs, err.Error())
8260
	}
8261
	return strings.Join(msgs, "; ")
8262
}
8263
8264
// AllErrors returns a list of validation violation errors.
8265
func (m TenantDeleteRequestMultiError) AllErrors() []error { return m }
8266
8267
// TenantDeleteRequestValidationError is the validation error returned by
8268
// TenantDeleteRequest.Validate if the designated constraints aren't met.
8269
type TenantDeleteRequestValidationError struct {
8270
	field  string
8271
	reason string
8272
	cause  error
8273
	key    bool
8274
}
8275
8276
// Field function returns field value.
8277
func (e TenantDeleteRequestValidationError) Field() string { return e.field }
8278
8279
// Reason function returns reason value.
8280
func (e TenantDeleteRequestValidationError) Reason() string { return e.reason }
8281
8282
// Cause function returns cause value.
8283
func (e TenantDeleteRequestValidationError) Cause() error { return e.cause }
8284
8285
// Key function returns key value.
8286
func (e TenantDeleteRequestValidationError) Key() bool { return e.key }
8287
8288
// ErrorName returns error name.
8289
func (e TenantDeleteRequestValidationError) ErrorName() string {
8290
	return "TenantDeleteRequestValidationError"
8291
}
8292
8293
// Error satisfies the builtin error interface
8294
func (e TenantDeleteRequestValidationError) Error() string {
8295
	cause := ""
8296
	if e.cause != nil {
8297
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
8298
	}
8299
8300
	key := ""
8301
	if e.key {
8302
		key = "key for "
8303
	}
8304
8305
	return fmt.Sprintf(
8306
		"invalid %sTenantDeleteRequest.%s: %s%s",
8307
		key,
8308
		e.field,
8309
		e.reason,
8310
		cause)
8311
}
8312
8313
var _ error = TenantDeleteRequestValidationError{}
8314
8315
var _ interface {
8316
	Field() string
8317
	Reason() string
8318
	Key() bool
8319
	Cause() error
8320
	ErrorName() string
8321
} = TenantDeleteRequestValidationError{}
8322
8323
// Validate checks the field values on TenantDeleteResponse with the rules
8324
// defined in the proto definition for this message. If any rules are
8325
// violated, the first error encountered is returned, or nil if there are no violations.
8326
func (m *TenantDeleteResponse) Validate() error {
8327
	return m.validate(false)
8328
}
8329
8330
// ValidateAll checks the field values on TenantDeleteResponse with the rules
8331
// defined in the proto definition for this message. If any rules are
8332
// violated, the result is a list of violation errors wrapped in
8333
// TenantDeleteResponseMultiError, or nil if none found.
8334
func (m *TenantDeleteResponse) ValidateAll() error {
8335
	return m.validate(true)
8336
}
8337
8338
func (m *TenantDeleteResponse) validate(all bool) error {
8339
	if m == nil {
8340
		return nil
8341
	}
8342
8343
	var errors []error
8344
8345
	if all {
8346
		switch v := interface{}(m.GetTenant()).(type) {
8347
		case interface{ ValidateAll() error }:
8348
			if err := v.ValidateAll(); err != nil {
8349
				errors = append(errors, TenantDeleteResponseValidationError{
8350
					field:  "Tenant",
8351
					reason: "embedded message failed validation",
8352
					cause:  err,
8353
				})
8354
			}
8355
		case interface{ Validate() error }:
8356
			if err := v.Validate(); err != nil {
8357
				errors = append(errors, TenantDeleteResponseValidationError{
8358
					field:  "Tenant",
8359
					reason: "embedded message failed validation",
8360
					cause:  err,
8361
				})
8362
			}
8363
		}
8364
	} else if v, ok := interface{}(m.GetTenant()).(interface{ Validate() error }); ok {
8365
		if err := v.Validate(); err != nil {
8366
			return TenantDeleteResponseValidationError{
8367
				field:  "Tenant",
8368
				reason: "embedded message failed validation",
8369
				cause:  err,
8370
			}
8371
		}
8372
	}
8373
8374
	if len(errors) > 0 {
8375
		return TenantDeleteResponseMultiError(errors)
8376
	}
8377
8378
	return nil
8379
}
8380
8381
// TenantDeleteResponseMultiError is an error wrapping multiple validation
8382
// errors returned by TenantDeleteResponse.ValidateAll() if the designated
8383
// constraints aren't met.
8384
type TenantDeleteResponseMultiError []error
8385
8386
// Error returns a concatenation of all the error messages it wraps.
8387
func (m TenantDeleteResponseMultiError) Error() string {
8388
	var msgs []string
8389
	for _, err := range m {
8390
		msgs = append(msgs, err.Error())
8391
	}
8392
	return strings.Join(msgs, "; ")
8393
}
8394
8395
// AllErrors returns a list of validation violation errors.
8396
func (m TenantDeleteResponseMultiError) AllErrors() []error { return m }
8397
8398
// TenantDeleteResponseValidationError is the validation error returned by
8399
// TenantDeleteResponse.Validate if the designated constraints aren't met.
8400
type TenantDeleteResponseValidationError struct {
8401
	field  string
8402
	reason string
8403
	cause  error
8404
	key    bool
8405
}
8406
8407
// Field function returns field value.
8408
func (e TenantDeleteResponseValidationError) Field() string { return e.field }
8409
8410
// Reason function returns reason value.
8411
func (e TenantDeleteResponseValidationError) Reason() string { return e.reason }
8412
8413
// Cause function returns cause value.
8414
func (e TenantDeleteResponseValidationError) Cause() error { return e.cause }
8415
8416
// Key function returns key value.
8417
func (e TenantDeleteResponseValidationError) Key() bool { return e.key }
8418
8419
// ErrorName returns error name.
8420
func (e TenantDeleteResponseValidationError) ErrorName() string {
8421
	return "TenantDeleteResponseValidationError"
8422
}
8423
8424
// Error satisfies the builtin error interface
8425
func (e TenantDeleteResponseValidationError) Error() string {
8426
	cause := ""
8427
	if e.cause != nil {
8428
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
8429
	}
8430
8431
	key := ""
8432
	if e.key {
8433
		key = "key for "
8434
	}
8435
8436
	return fmt.Sprintf(
8437
		"invalid %sTenantDeleteResponse.%s: %s%s",
8438
		key,
8439
		e.field,
8440
		e.reason,
8441
		cause)
8442
}
8443
8444
var _ error = TenantDeleteResponseValidationError{}
8445
8446
var _ interface {
8447
	Field() string
8448
	Reason() string
8449
	Key() bool
8450
	Cause() error
8451
	ErrorName() string
8452
} = TenantDeleteResponseValidationError{}
8453
8454
// Validate checks the field values on TenantListRequest with the rules defined
8455
// in the proto definition for this message. If any rules are violated, the
8456
// first error encountered is returned, or nil if there are no violations.
8457
func (m *TenantListRequest) Validate() error {
8458
	return m.validate(false)
8459
}
8460
8461
// ValidateAll checks the field values on TenantListRequest with the rules
8462
// defined in the proto definition for this message. If any rules are
8463
// violated, the result is a list of violation errors wrapped in
8464
// TenantListRequestMultiError, or nil if none found.
8465
func (m *TenantListRequest) ValidateAll() error {
8466
	return m.validate(true)
8467
}
8468
8469
func (m *TenantListRequest) validate(all bool) error {
8470
	if m == nil {
8471
		return nil
8472
	}
8473
8474
	var errors []error
8475
8476
	if m.GetPageSize() != 0 {
8477
8478
		if val := m.GetPageSize(); val < 1 || val > 100 {
8479
			err := TenantListRequestValidationError{
8480
				field:  "PageSize",
8481
				reason: "value must be inside range [1, 100]",
8482
			}
8483
			if !all {
8484
				return err
8485
			}
8486
			errors = append(errors, err)
8487
		}
8488
8489
	}
8490
8491
	if m.GetContinuousToken() != "" {
8492
8493
	}
8494
8495
	if len(errors) > 0 {
8496
		return TenantListRequestMultiError(errors)
8497
	}
8498
8499
	return nil
8500
}
8501
8502
// TenantListRequestMultiError is an error wrapping multiple validation errors
8503
// returned by TenantListRequest.ValidateAll() if the designated constraints
8504
// aren't met.
8505
type TenantListRequestMultiError []error
8506
8507
// Error returns a concatenation of all the error messages it wraps.
8508
func (m TenantListRequestMultiError) Error() string {
8509
	var msgs []string
8510
	for _, err := range m {
8511
		msgs = append(msgs, err.Error())
8512
	}
8513
	return strings.Join(msgs, "; ")
8514
}
8515
8516
// AllErrors returns a list of validation violation errors.
8517
func (m TenantListRequestMultiError) AllErrors() []error { return m }
8518
8519
// TenantListRequestValidationError is the validation error returned by
8520
// TenantListRequest.Validate if the designated constraints aren't met.
8521
type TenantListRequestValidationError struct {
8522
	field  string
8523
	reason string
8524
	cause  error
8525
	key    bool
8526
}
8527
8528
// Field function returns field value.
8529
func (e TenantListRequestValidationError) Field() string { return e.field }
8530
8531
// Reason function returns reason value.
8532
func (e TenantListRequestValidationError) Reason() string { return e.reason }
8533
8534
// Cause function returns cause value.
8535
func (e TenantListRequestValidationError) Cause() error { return e.cause }
8536
8537
// Key function returns key value.
8538
func (e TenantListRequestValidationError) Key() bool { return e.key }
8539
8540
// ErrorName returns error name.
8541
func (e TenantListRequestValidationError) ErrorName() string {
8542
	return "TenantListRequestValidationError"
8543
}
8544
8545
// Error satisfies the builtin error interface
8546
func (e TenantListRequestValidationError) Error() string {
8547
	cause := ""
8548
	if e.cause != nil {
8549
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
8550
	}
8551
8552
	key := ""
8553
	if e.key {
8554
		key = "key for "
8555
	}
8556
8557
	return fmt.Sprintf(
8558
		"invalid %sTenantListRequest.%s: %s%s",
8559
		key,
8560
		e.field,
8561
		e.reason,
8562
		cause)
8563
}
8564
8565
var _ error = TenantListRequestValidationError{}
8566
8567
var _ interface {
8568
	Field() string
8569
	Reason() string
8570
	Key() bool
8571
	Cause() error
8572
	ErrorName() string
8573
} = TenantListRequestValidationError{}
8574
8575
// Validate checks the field values on TenantListResponse with the rules
8576
// defined in the proto definition for this message. If any rules are
8577
// violated, the first error encountered is returned, or nil if there are no violations.
8578
func (m *TenantListResponse) Validate() error {
8579
	return m.validate(false)
8580
}
8581
8582
// ValidateAll checks the field values on TenantListResponse with the rules
8583
// defined in the proto definition for this message. If any rules are
8584
// violated, the result is a list of violation errors wrapped in
8585
// TenantListResponseMultiError, or nil if none found.
8586
func (m *TenantListResponse) ValidateAll() error {
8587
	return m.validate(true)
8588
}
8589
8590
func (m *TenantListResponse) validate(all bool) error {
8591
	if m == nil {
8592
		return nil
8593
	}
8594
8595
	var errors []error
8596
8597
	for idx, item := range m.GetTenants() {
8598
		_, _ = idx, item
8599
8600
		if all {
8601
			switch v := interface{}(item).(type) {
8602
			case interface{ ValidateAll() error }:
8603
				if err := v.ValidateAll(); err != nil {
8604
					errors = append(errors, TenantListResponseValidationError{
8605
						field:  fmt.Sprintf("Tenants[%v]", idx),
8606
						reason: "embedded message failed validation",
8607
						cause:  err,
8608
					})
8609
				}
8610
			case interface{ Validate() error }:
8611
				if err := v.Validate(); err != nil {
8612
					errors = append(errors, TenantListResponseValidationError{
8613
						field:  fmt.Sprintf("Tenants[%v]", idx),
8614
						reason: "embedded message failed validation",
8615
						cause:  err,
8616
					})
8617
				}
8618
			}
8619
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
8620
			if err := v.Validate(); err != nil {
8621
				return TenantListResponseValidationError{
8622
					field:  fmt.Sprintf("Tenants[%v]", idx),
8623
					reason: "embedded message failed validation",
8624
					cause:  err,
8625
				}
8626
			}
8627
		}
8628
8629
	}
8630
8631
	// no validation rules for ContinuousToken
8632
8633
	if len(errors) > 0 {
8634
		return TenantListResponseMultiError(errors)
8635
	}
8636
8637
	return nil
8638
}
8639
8640
// TenantListResponseMultiError is an error wrapping multiple validation errors
8641
// returned by TenantListResponse.ValidateAll() if the designated constraints
8642
// aren't met.
8643
type TenantListResponseMultiError []error
8644
8645
// Error returns a concatenation of all the error messages it wraps.
8646
func (m TenantListResponseMultiError) Error() string {
8647
	var msgs []string
8648
	for _, err := range m {
8649
		msgs = append(msgs, err.Error())
8650
	}
8651
	return strings.Join(msgs, "; ")
8652
}
8653
8654
// AllErrors returns a list of validation violation errors.
8655
func (m TenantListResponseMultiError) AllErrors() []error { return m }
8656
8657
// TenantListResponseValidationError is the validation error returned by
8658
// TenantListResponse.Validate if the designated constraints aren't met.
8659
type TenantListResponseValidationError struct {
8660
	field  string
8661
	reason string
8662
	cause  error
8663
	key    bool
8664
}
8665
8666
// Field function returns field value.
8667
func (e TenantListResponseValidationError) Field() string { return e.field }
8668
8669
// Reason function returns reason value.
8670
func (e TenantListResponseValidationError) Reason() string { return e.reason }
8671
8672
// Cause function returns cause value.
8673
func (e TenantListResponseValidationError) Cause() error { return e.cause }
8674
8675
// Key function returns key value.
8676
func (e TenantListResponseValidationError) Key() bool { return e.key }
8677
8678
// ErrorName returns error name.
8679
func (e TenantListResponseValidationError) ErrorName() string {
8680
	return "TenantListResponseValidationError"
8681
}
8682
8683
// Error satisfies the builtin error interface
8684
func (e TenantListResponseValidationError) Error() string {
8685
	cause := ""
8686
	if e.cause != nil {
8687
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
8688
	}
8689
8690
	key := ""
8691
	if e.key {
8692
		key = "key for "
8693
	}
8694
8695
	return fmt.Sprintf(
8696
		"invalid %sTenantListResponse.%s: %s%s",
8697
		key,
8698
		e.field,
8699
		e.reason,
8700
		cause)
8701
}
8702
8703
var _ error = TenantListResponseValidationError{}
8704
8705
var _ interface {
8706
	Field() string
8707
	Reason() string
8708
	Key() bool
8709
	Cause() error
8710
	ErrorName() string
8711
} = TenantListResponseValidationError{}
8712