Passed
Pull Request — master (#1465)
by
unknown
02:36
created

basev1.*PermissionLookupEntityResponse.validate   D

Complexity

Conditions 13

Size

Total Lines 60
Code Lines 37

Duplication

Lines 0
Ratio 0 %

Importance

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