Passed
Pull Request — master (#1608)
by Tolga
03:58
created

basev1.*SchemaListRequest.validate   C

Complexity

Conditions 11

Size

Total Lines 53
Code Lines 30

Duplication

Lines 0
Ratio 0 %

Importance

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

How to fix   Long Method    Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

Complexity

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