Passed
Push — master ( 2d3f7e...154da4 )
by Tolga
01:14 queued 13s
created

basev1.*BundleReadResponse.validate   C

Complexity

Conditions 10

Size

Total Lines 41
Code Lines 27

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 10
eloc 27
nop 1
dl 0
loc 41
rs 5.9999
c 0
b 0
f 0

How to fix   Complexity   

Complexity

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

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

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