1
|
|
|
// Code generated by protoc-gen-validate. DO NOT EDIT. |
2
|
|
|
// source: base/v1/service.proto |
3
|
|
|
|
4
|
|
|
package basev1 |
5
|
|
|
|
6
|
|
|
import ( |
7
|
|
|
"bytes" |
8
|
|
|
"errors" |
9
|
|
|
"fmt" |
10
|
|
|
"net" |
11
|
|
|
"net/mail" |
12
|
|
|
"net/url" |
13
|
|
|
"regexp" |
14
|
|
|
"sort" |
15
|
|
|
"strings" |
16
|
|
|
"time" |
17
|
|
|
"unicode/utf8" |
18
|
|
|
|
19
|
|
|
"google.golang.org/protobuf/types/known/anypb" |
20
|
|
|
) |
21
|
|
|
|
22
|
|
|
// ensure the imports are used |
23
|
|
|
var ( |
24
|
|
|
_ = bytes.MinRead |
25
|
|
|
_ = errors.New("") |
26
|
|
|
_ = fmt.Print |
27
|
|
|
_ = utf8.UTFMax |
28
|
|
|
_ = (*regexp.Regexp)(nil) |
29
|
|
|
_ = (*strings.Reader)(nil) |
30
|
|
|
_ = net.IPv4len |
31
|
|
|
_ = time.Duration(0) |
32
|
|
|
_ = (*url.URL)(nil) |
33
|
|
|
_ = (*mail.Address)(nil) |
34
|
|
|
_ = anypb.Any{} |
35
|
|
|
_ = sort.Sort |
36
|
|
|
) |
37
|
|
|
|
38
|
|
|
// Validate checks the field values on PermissionCheckRequest with the rules |
39
|
|
|
// defined in the proto definition for this message. If any rules are |
40
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
41
|
|
|
func (m *PermissionCheckRequest) Validate() error { |
42
|
|
|
return m.validate(false) |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
// ValidateAll checks the field values on PermissionCheckRequest with the rules |
46
|
|
|
// defined in the proto definition for this message. If any rules are |
47
|
|
|
// violated, the result is a list of violation errors wrapped in |
48
|
|
|
// PermissionCheckRequestMultiError, or nil if none found. |
49
|
|
|
func (m *PermissionCheckRequest) ValidateAll() error { |
50
|
|
|
return m.validate(true) |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
func (m *PermissionCheckRequest) validate(all bool) error { |
54
|
|
|
if m == nil { |
55
|
|
|
return nil |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
var errors []error |
59
|
|
|
|
60
|
|
|
if len(m.GetTenantId()) > 128 { |
61
|
|
|
err := PermissionCheckRequestValidationError{ |
62
|
|
|
field: "TenantId", |
63
|
|
|
reason: "value length must be at most 128 bytes", |
64
|
|
|
} |
65
|
|
|
if !all { |
66
|
|
|
return err |
67
|
|
|
} |
68
|
|
|
errors = append(errors, err) |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
if !_PermissionCheckRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
72
|
|
|
err := PermissionCheckRequestValidationError{ |
73
|
|
|
field: "TenantId", |
74
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
75
|
|
|
} |
76
|
|
|
if !all { |
77
|
|
|
return err |
78
|
|
|
} |
79
|
|
|
errors = append(errors, err) |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
if m.GetMetadata() == nil { |
83
|
|
|
err := PermissionCheckRequestValidationError{ |
84
|
|
|
field: "Metadata", |
85
|
|
|
reason: "value is required", |
86
|
|
|
} |
87
|
|
|
if !all { |
88
|
|
|
return err |
89
|
|
|
} |
90
|
|
|
errors = append(errors, err) |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
if all { |
94
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
95
|
|
|
case interface{ ValidateAll() error }: |
96
|
|
|
if err := v.ValidateAll(); err != nil { |
97
|
|
|
errors = append(errors, PermissionCheckRequestValidationError{ |
98
|
|
|
field: "Metadata", |
99
|
|
|
reason: "embedded message failed validation", |
100
|
|
|
cause: err, |
101
|
|
|
}) |
102
|
|
|
} |
103
|
|
|
case interface{ Validate() error }: |
104
|
|
|
if err := v.Validate(); err != nil { |
105
|
|
|
errors = append(errors, PermissionCheckRequestValidationError{ |
106
|
|
|
field: "Metadata", |
107
|
|
|
reason: "embedded message failed validation", |
108
|
|
|
cause: err, |
109
|
|
|
}) |
110
|
|
|
} |
111
|
|
|
} |
112
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
113
|
|
|
if err := v.Validate(); err != nil { |
114
|
|
|
return PermissionCheckRequestValidationError{ |
115
|
|
|
field: "Metadata", |
116
|
|
|
reason: "embedded message failed validation", |
117
|
|
|
cause: err, |
118
|
|
|
} |
119
|
|
|
} |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
if m.GetEntity() == nil { |
123
|
|
|
err := PermissionCheckRequestValidationError{ |
124
|
|
|
field: "Entity", |
125
|
|
|
reason: "value is required", |
126
|
|
|
} |
127
|
|
|
if !all { |
128
|
|
|
return err |
129
|
|
|
} |
130
|
|
|
errors = append(errors, err) |
131
|
|
|
} |
132
|
|
|
|
133
|
|
|
if all { |
134
|
|
|
switch v := interface{}(m.GetEntity()).(type) { |
135
|
|
|
case interface{ ValidateAll() error }: |
136
|
|
|
if err := v.ValidateAll(); err != nil { |
137
|
|
|
errors = append(errors, PermissionCheckRequestValidationError{ |
138
|
|
|
field: "Entity", |
139
|
|
|
reason: "embedded message failed validation", |
140
|
|
|
cause: err, |
141
|
|
|
}) |
142
|
|
|
} |
143
|
|
|
case interface{ Validate() error }: |
144
|
|
|
if err := v.Validate(); err != nil { |
145
|
|
|
errors = append(errors, PermissionCheckRequestValidationError{ |
146
|
|
|
field: "Entity", |
147
|
|
|
reason: "embedded message failed validation", |
148
|
|
|
cause: err, |
149
|
|
|
}) |
150
|
|
|
} |
151
|
|
|
} |
152
|
|
|
} else if v, ok := interface{}(m.GetEntity()).(interface{ Validate() error }); ok { |
153
|
|
|
if err := v.Validate(); err != nil { |
154
|
|
|
return PermissionCheckRequestValidationError{ |
155
|
|
|
field: "Entity", |
156
|
|
|
reason: "embedded message failed validation", |
157
|
|
|
cause: err, |
158
|
|
|
} |
159
|
|
|
} |
160
|
|
|
} |
161
|
|
|
|
162
|
|
|
if len(m.GetPermission()) > 64 { |
163
|
|
|
err := PermissionCheckRequestValidationError{ |
164
|
|
|
field: "Permission", |
165
|
|
|
reason: "value length must be at most 64 bytes", |
166
|
|
|
} |
167
|
|
|
if !all { |
168
|
|
|
return err |
169
|
|
|
} |
170
|
|
|
errors = append(errors, err) |
171
|
|
|
} |
172
|
|
|
|
173
|
|
|
if !_PermissionCheckRequest_Permission_Pattern.MatchString(m.GetPermission()) { |
174
|
|
|
err := PermissionCheckRequestValidationError{ |
175
|
|
|
field: "Permission", |
176
|
|
|
reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"", |
177
|
|
|
} |
178
|
|
|
if !all { |
179
|
|
|
return err |
180
|
|
|
} |
181
|
|
|
errors = append(errors, err) |
182
|
|
|
} |
183
|
|
|
|
184
|
|
|
if m.GetSubject() == nil { |
185
|
|
|
err := PermissionCheckRequestValidationError{ |
186
|
|
|
field: "Subject", |
187
|
|
|
reason: "value is required", |
188
|
|
|
} |
189
|
|
|
if !all { |
190
|
|
|
return err |
191
|
|
|
} |
192
|
|
|
errors = append(errors, err) |
193
|
|
|
} |
194
|
|
|
|
195
|
|
|
if all { |
196
|
|
|
switch v := interface{}(m.GetSubject()).(type) { |
197
|
|
|
case interface{ ValidateAll() error }: |
198
|
|
|
if err := v.ValidateAll(); err != nil { |
199
|
|
|
errors = append(errors, PermissionCheckRequestValidationError{ |
200
|
|
|
field: "Subject", |
201
|
|
|
reason: "embedded message failed validation", |
202
|
|
|
cause: err, |
203
|
|
|
}) |
204
|
|
|
} |
205
|
|
|
case interface{ Validate() error }: |
206
|
|
|
if err := v.Validate(); err != nil { |
207
|
|
|
errors = append(errors, PermissionCheckRequestValidationError{ |
208
|
|
|
field: "Subject", |
209
|
|
|
reason: "embedded message failed validation", |
210
|
|
|
cause: err, |
211
|
|
|
}) |
212
|
|
|
} |
213
|
|
|
} |
214
|
|
|
} else if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok { |
215
|
|
|
if err := v.Validate(); err != nil { |
216
|
|
|
return PermissionCheckRequestValidationError{ |
217
|
|
|
field: "Subject", |
218
|
|
|
reason: "embedded message failed validation", |
219
|
|
|
cause: err, |
220
|
|
|
} |
221
|
|
|
} |
222
|
|
|
} |
223
|
|
|
|
224
|
|
|
if all { |
225
|
|
|
switch v := interface{}(m.GetContext()).(type) { |
226
|
|
|
case interface{ ValidateAll() error }: |
227
|
|
|
if err := v.ValidateAll(); err != nil { |
228
|
|
|
errors = append(errors, PermissionCheckRequestValidationError{ |
229
|
|
|
field: "Context", |
230
|
|
|
reason: "embedded message failed validation", |
231
|
|
|
cause: err, |
232
|
|
|
}) |
233
|
|
|
} |
234
|
|
|
case interface{ Validate() error }: |
235
|
|
|
if err := v.Validate(); err != nil { |
236
|
|
|
errors = append(errors, PermissionCheckRequestValidationError{ |
237
|
|
|
field: "Context", |
238
|
|
|
reason: "embedded message failed validation", |
239
|
|
|
cause: err, |
240
|
|
|
}) |
241
|
|
|
} |
242
|
|
|
} |
243
|
|
|
} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok { |
244
|
|
|
if err := v.Validate(); err != nil { |
245
|
|
|
return PermissionCheckRequestValidationError{ |
246
|
|
|
field: "Context", |
247
|
|
|
reason: "embedded message failed validation", |
248
|
|
|
cause: err, |
249
|
|
|
} |
250
|
|
|
} |
251
|
|
|
} |
252
|
|
|
|
253
|
|
|
for idx, item := range m.GetArguments() { |
254
|
|
|
_, _ = idx, item |
255
|
|
|
|
256
|
|
|
if all { |
257
|
|
|
switch v := interface{}(item).(type) { |
258
|
|
|
case interface{ ValidateAll() error }: |
259
|
|
|
if err := v.ValidateAll(); err != nil { |
260
|
|
|
errors = append(errors, PermissionCheckRequestValidationError{ |
261
|
|
|
field: fmt.Sprintf("Arguments[%v]", idx), |
262
|
|
|
reason: "embedded message failed validation", |
263
|
|
|
cause: err, |
264
|
|
|
}) |
265
|
|
|
} |
266
|
|
|
case interface{ Validate() error }: |
267
|
|
|
if err := v.Validate(); err != nil { |
268
|
|
|
errors = append(errors, PermissionCheckRequestValidationError{ |
269
|
|
|
field: fmt.Sprintf("Arguments[%v]", idx), |
270
|
|
|
reason: "embedded message failed validation", |
271
|
|
|
cause: err, |
272
|
|
|
}) |
273
|
|
|
} |
274
|
|
|
} |
275
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
276
|
|
|
if err := v.Validate(); err != nil { |
277
|
|
|
return PermissionCheckRequestValidationError{ |
278
|
|
|
field: fmt.Sprintf("Arguments[%v]", idx), |
279
|
|
|
reason: "embedded message failed validation", |
280
|
|
|
cause: err, |
281
|
|
|
} |
282
|
|
|
} |
283
|
|
|
} |
284
|
|
|
|
285
|
|
|
} |
286
|
|
|
|
287
|
|
|
if len(errors) > 0 { |
288
|
|
|
return PermissionCheckRequestMultiError(errors) |
289
|
|
|
} |
290
|
|
|
|
291
|
|
|
return nil |
292
|
|
|
} |
293
|
|
|
|
294
|
|
|
// PermissionCheckRequestMultiError is an error wrapping multiple validation |
295
|
|
|
// errors returned by PermissionCheckRequest.ValidateAll() if the designated |
296
|
|
|
// constraints aren't met. |
297
|
|
|
type PermissionCheckRequestMultiError []error |
298
|
|
|
|
299
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
300
|
|
|
func (m PermissionCheckRequestMultiError) Error() string { |
301
|
|
|
var msgs []string |
302
|
|
|
for _, err := range m { |
303
|
|
|
msgs = append(msgs, err.Error()) |
304
|
|
|
} |
305
|
|
|
return strings.Join(msgs, "; ") |
306
|
|
|
} |
307
|
|
|
|
308
|
|
|
// AllErrors returns a list of validation violation errors. |
309
|
|
|
func (m PermissionCheckRequestMultiError) AllErrors() []error { return m } |
310
|
|
|
|
311
|
|
|
// PermissionCheckRequestValidationError is the validation error returned by |
312
|
|
|
// PermissionCheckRequest.Validate if the designated constraints aren't met. |
313
|
|
|
type PermissionCheckRequestValidationError struct { |
314
|
|
|
field string |
315
|
|
|
reason string |
316
|
|
|
cause error |
317
|
|
|
key bool |
318
|
|
|
} |
319
|
|
|
|
320
|
|
|
// Field function returns field value. |
321
|
|
|
func (e PermissionCheckRequestValidationError) Field() string { return e.field } |
322
|
|
|
|
323
|
|
|
// Reason function returns reason value. |
324
|
|
|
func (e PermissionCheckRequestValidationError) Reason() string { return e.reason } |
325
|
|
|
|
326
|
|
|
// Cause function returns cause value. |
327
|
|
|
func (e PermissionCheckRequestValidationError) Cause() error { return e.cause } |
328
|
|
|
|
329
|
|
|
// Key function returns key value. |
330
|
|
|
func (e PermissionCheckRequestValidationError) Key() bool { return e.key } |
331
|
|
|
|
332
|
|
|
// ErrorName returns error name. |
333
|
|
|
func (e PermissionCheckRequestValidationError) ErrorName() string { |
334
|
|
|
return "PermissionCheckRequestValidationError" |
335
|
|
|
} |
336
|
|
|
|
337
|
|
|
// Error satisfies the builtin error interface |
338
|
|
|
func (e PermissionCheckRequestValidationError) Error() string { |
339
|
|
|
cause := "" |
340
|
|
|
if e.cause != nil { |
341
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
342
|
|
|
} |
343
|
|
|
|
344
|
|
|
key := "" |
345
|
|
|
if e.key { |
346
|
|
|
key = "key for " |
347
|
|
|
} |
348
|
|
|
|
349
|
|
|
return fmt.Sprintf( |
350
|
|
|
"invalid %sPermissionCheckRequest.%s: %s%s", |
351
|
|
|
key, |
352
|
|
|
e.field, |
353
|
|
|
e.reason, |
354
|
|
|
cause) |
355
|
|
|
} |
356
|
|
|
|
357
|
|
|
var _ error = PermissionCheckRequestValidationError{} |
358
|
|
|
|
359
|
|
|
var _ interface { |
360
|
|
|
Field() string |
361
|
|
|
Reason() string |
362
|
|
|
Key() bool |
363
|
|
|
Cause() error |
364
|
|
|
ErrorName() string |
365
|
|
|
} = PermissionCheckRequestValidationError{} |
366
|
|
|
|
367
|
|
|
var _PermissionCheckRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
368
|
|
|
|
369
|
|
|
var _PermissionCheckRequest_Permission_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$") |
370
|
|
|
|
371
|
|
|
// Validate checks the field values on PermissionCheckRequestMetadata with the |
372
|
|
|
// rules defined in the proto definition for this message. If any rules are |
373
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
374
|
|
|
func (m *PermissionCheckRequestMetadata) Validate() error { |
375
|
|
|
return m.validate(false) |
376
|
|
|
} |
377
|
|
|
|
378
|
|
|
// ValidateAll checks the field values on PermissionCheckRequestMetadata with |
379
|
|
|
// the rules defined in the proto definition for this message. If any rules |
380
|
|
|
// are violated, the result is a list of violation errors wrapped in |
381
|
|
|
// PermissionCheckRequestMetadataMultiError, or nil if none found. |
382
|
|
|
func (m *PermissionCheckRequestMetadata) ValidateAll() error { |
383
|
|
|
return m.validate(true) |
384
|
|
|
} |
385
|
|
|
|
386
|
|
|
func (m *PermissionCheckRequestMetadata) validate(all bool) error { |
387
|
|
|
if m == nil { |
388
|
|
|
return nil |
389
|
|
|
} |
390
|
|
|
|
391
|
|
|
var errors []error |
392
|
|
|
|
393
|
|
|
// no validation rules for SchemaVersion |
394
|
|
|
|
395
|
|
|
// no validation rules for SnapToken |
396
|
|
|
|
397
|
|
|
if m.GetDepth() < 3 { |
398
|
|
|
err := PermissionCheckRequestMetadataValidationError{ |
399
|
|
|
field: "Depth", |
400
|
|
|
reason: "value must be greater than or equal to 3", |
401
|
|
|
} |
402
|
|
|
if !all { |
403
|
|
|
return err |
404
|
|
|
} |
405
|
|
|
errors = append(errors, err) |
406
|
|
|
} |
407
|
|
|
|
408
|
|
|
if len(errors) > 0 { |
409
|
|
|
return PermissionCheckRequestMetadataMultiError(errors) |
410
|
|
|
} |
411
|
|
|
|
412
|
|
|
return nil |
413
|
|
|
} |
414
|
|
|
|
415
|
|
|
// PermissionCheckRequestMetadataMultiError is an error wrapping multiple |
416
|
|
|
// validation errors returned by PermissionCheckRequestMetadata.ValidateAll() |
417
|
|
|
// if the designated constraints aren't met. |
418
|
|
|
type PermissionCheckRequestMetadataMultiError []error |
419
|
|
|
|
420
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
421
|
|
|
func (m PermissionCheckRequestMetadataMultiError) Error() string { |
422
|
|
|
var msgs []string |
423
|
|
|
for _, err := range m { |
424
|
|
|
msgs = append(msgs, err.Error()) |
425
|
|
|
} |
426
|
|
|
return strings.Join(msgs, "; ") |
427
|
|
|
} |
428
|
|
|
|
429
|
|
|
// AllErrors returns a list of validation violation errors. |
430
|
|
|
func (m PermissionCheckRequestMetadataMultiError) AllErrors() []error { return m } |
431
|
|
|
|
432
|
|
|
// PermissionCheckRequestMetadataValidationError is the validation error |
433
|
|
|
// returned by PermissionCheckRequestMetadata.Validate if the designated |
434
|
|
|
// constraints aren't met. |
435
|
|
|
type PermissionCheckRequestMetadataValidationError struct { |
436
|
|
|
field string |
437
|
|
|
reason string |
438
|
|
|
cause error |
439
|
|
|
key bool |
440
|
|
|
} |
441
|
|
|
|
442
|
|
|
// Field function returns field value. |
443
|
|
|
func (e PermissionCheckRequestMetadataValidationError) Field() string { return e.field } |
444
|
|
|
|
445
|
|
|
// Reason function returns reason value. |
446
|
|
|
func (e PermissionCheckRequestMetadataValidationError) Reason() string { return e.reason } |
447
|
|
|
|
448
|
|
|
// Cause function returns cause value. |
449
|
|
|
func (e PermissionCheckRequestMetadataValidationError) Cause() error { return e.cause } |
450
|
|
|
|
451
|
|
|
// Key function returns key value. |
452
|
|
|
func (e PermissionCheckRequestMetadataValidationError) Key() bool { return e.key } |
453
|
|
|
|
454
|
|
|
// ErrorName returns error name. |
455
|
|
|
func (e PermissionCheckRequestMetadataValidationError) ErrorName() string { |
456
|
|
|
return "PermissionCheckRequestMetadataValidationError" |
457
|
|
|
} |
458
|
|
|
|
459
|
|
|
// Error satisfies the builtin error interface |
460
|
|
|
func (e PermissionCheckRequestMetadataValidationError) Error() string { |
461
|
|
|
cause := "" |
462
|
|
|
if e.cause != nil { |
463
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
464
|
|
|
} |
465
|
|
|
|
466
|
|
|
key := "" |
467
|
|
|
if e.key { |
468
|
|
|
key = "key for " |
469
|
|
|
} |
470
|
|
|
|
471
|
|
|
return fmt.Sprintf( |
472
|
|
|
"invalid %sPermissionCheckRequestMetadata.%s: %s%s", |
473
|
|
|
key, |
474
|
|
|
e.field, |
475
|
|
|
e.reason, |
476
|
|
|
cause) |
477
|
|
|
} |
478
|
|
|
|
479
|
|
|
var _ error = PermissionCheckRequestMetadataValidationError{} |
480
|
|
|
|
481
|
|
|
var _ interface { |
482
|
|
|
Field() string |
483
|
|
|
Reason() string |
484
|
|
|
Key() bool |
485
|
|
|
Cause() error |
486
|
|
|
ErrorName() string |
487
|
|
|
} = PermissionCheckRequestMetadataValidationError{} |
488
|
|
|
|
489
|
|
|
// Validate checks the field values on PermissionCheckResponse with the rules |
490
|
|
|
// defined in the proto definition for this message. If any rules are |
491
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
492
|
|
|
func (m *PermissionCheckResponse) Validate() error { |
493
|
|
|
return m.validate(false) |
494
|
|
|
} |
495
|
|
|
|
496
|
|
|
// ValidateAll checks the field values on PermissionCheckResponse with the |
497
|
|
|
// rules defined in the proto definition for this message. If any rules are |
498
|
|
|
// violated, the result is a list of violation errors wrapped in |
499
|
|
|
// PermissionCheckResponseMultiError, or nil if none found. |
500
|
|
|
func (m *PermissionCheckResponse) ValidateAll() error { |
501
|
|
|
return m.validate(true) |
502
|
|
|
} |
503
|
|
|
|
504
|
|
|
func (m *PermissionCheckResponse) validate(all bool) error { |
505
|
|
|
if m == nil { |
506
|
|
|
return nil |
507
|
|
|
} |
508
|
|
|
|
509
|
|
|
var errors []error |
510
|
|
|
|
511
|
|
|
// no validation rules for Can |
512
|
|
|
|
513
|
|
|
if all { |
514
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
515
|
|
|
case interface{ ValidateAll() error }: |
516
|
|
|
if err := v.ValidateAll(); err != nil { |
517
|
|
|
errors = append(errors, PermissionCheckResponseValidationError{ |
518
|
|
|
field: "Metadata", |
519
|
|
|
reason: "embedded message failed validation", |
520
|
|
|
cause: err, |
521
|
|
|
}) |
522
|
|
|
} |
523
|
|
|
case interface{ Validate() error }: |
524
|
|
|
if err := v.Validate(); err != nil { |
525
|
|
|
errors = append(errors, PermissionCheckResponseValidationError{ |
526
|
|
|
field: "Metadata", |
527
|
|
|
reason: "embedded message failed validation", |
528
|
|
|
cause: err, |
529
|
|
|
}) |
530
|
|
|
} |
531
|
|
|
} |
532
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
533
|
|
|
if err := v.Validate(); err != nil { |
534
|
|
|
return PermissionCheckResponseValidationError{ |
535
|
|
|
field: "Metadata", |
536
|
|
|
reason: "embedded message failed validation", |
537
|
|
|
cause: err, |
538
|
|
|
} |
539
|
|
|
} |
540
|
|
|
} |
541
|
|
|
|
542
|
|
|
if len(errors) > 0 { |
543
|
|
|
return PermissionCheckResponseMultiError(errors) |
544
|
|
|
} |
545
|
|
|
|
546
|
|
|
return nil |
547
|
|
|
} |
548
|
|
|
|
549
|
|
|
// PermissionCheckResponseMultiError is an error wrapping multiple validation |
550
|
|
|
// errors returned by PermissionCheckResponse.ValidateAll() if the designated |
551
|
|
|
// constraints aren't met. |
552
|
|
|
type PermissionCheckResponseMultiError []error |
553
|
|
|
|
554
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
555
|
|
|
func (m PermissionCheckResponseMultiError) Error() string { |
556
|
|
|
var msgs []string |
557
|
|
|
for _, err := range m { |
558
|
|
|
msgs = append(msgs, err.Error()) |
559
|
|
|
} |
560
|
|
|
return strings.Join(msgs, "; ") |
561
|
|
|
} |
562
|
|
|
|
563
|
|
|
// AllErrors returns a list of validation violation errors. |
564
|
|
|
func (m PermissionCheckResponseMultiError) AllErrors() []error { return m } |
565
|
|
|
|
566
|
|
|
// PermissionCheckResponseValidationError is the validation error returned by |
567
|
|
|
// PermissionCheckResponse.Validate if the designated constraints aren't met. |
568
|
|
|
type PermissionCheckResponseValidationError struct { |
569
|
|
|
field string |
570
|
|
|
reason string |
571
|
|
|
cause error |
572
|
|
|
key bool |
573
|
|
|
} |
574
|
|
|
|
575
|
|
|
// Field function returns field value. |
576
|
|
|
func (e PermissionCheckResponseValidationError) Field() string { return e.field } |
577
|
|
|
|
578
|
|
|
// Reason function returns reason value. |
579
|
|
|
func (e PermissionCheckResponseValidationError) Reason() string { return e.reason } |
580
|
|
|
|
581
|
|
|
// Cause function returns cause value. |
582
|
|
|
func (e PermissionCheckResponseValidationError) Cause() error { return e.cause } |
583
|
|
|
|
584
|
|
|
// Key function returns key value. |
585
|
|
|
func (e PermissionCheckResponseValidationError) Key() bool { return e.key } |
586
|
|
|
|
587
|
|
|
// ErrorName returns error name. |
588
|
|
|
func (e PermissionCheckResponseValidationError) ErrorName() string { |
589
|
|
|
return "PermissionCheckResponseValidationError" |
590
|
|
|
} |
591
|
|
|
|
592
|
|
|
// Error satisfies the builtin error interface |
593
|
|
|
func (e PermissionCheckResponseValidationError) Error() string { |
594
|
|
|
cause := "" |
595
|
|
|
if e.cause != nil { |
596
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
597
|
|
|
} |
598
|
|
|
|
599
|
|
|
key := "" |
600
|
|
|
if e.key { |
601
|
|
|
key = "key for " |
602
|
|
|
} |
603
|
|
|
|
604
|
|
|
return fmt.Sprintf( |
605
|
|
|
"invalid %sPermissionCheckResponse.%s: %s%s", |
606
|
|
|
key, |
607
|
|
|
e.field, |
608
|
|
|
e.reason, |
609
|
|
|
cause) |
610
|
|
|
} |
611
|
|
|
|
612
|
|
|
var _ error = PermissionCheckResponseValidationError{} |
613
|
|
|
|
614
|
|
|
var _ interface { |
615
|
|
|
Field() string |
616
|
|
|
Reason() string |
617
|
|
|
Key() bool |
618
|
|
|
Cause() error |
619
|
|
|
ErrorName() string |
620
|
|
|
} = PermissionCheckResponseValidationError{} |
621
|
|
|
|
622
|
|
|
// Validate checks the field values on PermissionCheckResponseMetadata with the |
623
|
|
|
// rules defined in the proto definition for this message. If any rules are |
624
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
625
|
|
|
func (m *PermissionCheckResponseMetadata) Validate() error { |
626
|
|
|
return m.validate(false) |
627
|
|
|
} |
628
|
|
|
|
629
|
|
|
// ValidateAll checks the field values on PermissionCheckResponseMetadata with |
630
|
|
|
// the rules defined in the proto definition for this message. If any rules |
631
|
|
|
// are violated, the result is a list of violation errors wrapped in |
632
|
|
|
// PermissionCheckResponseMetadataMultiError, or nil if none found. |
633
|
|
|
func (m *PermissionCheckResponseMetadata) ValidateAll() error { |
634
|
|
|
return m.validate(true) |
635
|
|
|
} |
636
|
|
|
|
637
|
|
|
func (m *PermissionCheckResponseMetadata) validate(all bool) error { |
638
|
|
|
if m == nil { |
639
|
|
|
return nil |
640
|
|
|
} |
641
|
|
|
|
642
|
|
|
var errors []error |
643
|
|
|
|
644
|
|
|
// no validation rules for CheckCount |
645
|
|
|
|
646
|
|
|
if len(errors) > 0 { |
647
|
|
|
return PermissionCheckResponseMetadataMultiError(errors) |
648
|
|
|
} |
649
|
|
|
|
650
|
|
|
return nil |
651
|
|
|
} |
652
|
|
|
|
653
|
|
|
// PermissionCheckResponseMetadataMultiError is an error wrapping multiple |
654
|
|
|
// validation errors returned by PermissionCheckResponseMetadata.ValidateAll() |
655
|
|
|
// if the designated constraints aren't met. |
656
|
|
|
type PermissionCheckResponseMetadataMultiError []error |
657
|
|
|
|
658
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
659
|
|
|
func (m PermissionCheckResponseMetadataMultiError) Error() string { |
660
|
|
|
var msgs []string |
661
|
|
|
for _, err := range m { |
662
|
|
|
msgs = append(msgs, err.Error()) |
663
|
|
|
} |
664
|
|
|
return strings.Join(msgs, "; ") |
665
|
|
|
} |
666
|
|
|
|
667
|
|
|
// AllErrors returns a list of validation violation errors. |
668
|
|
|
func (m PermissionCheckResponseMetadataMultiError) AllErrors() []error { return m } |
669
|
|
|
|
670
|
|
|
// PermissionCheckResponseMetadataValidationError is the validation error |
671
|
|
|
// returned by PermissionCheckResponseMetadata.Validate if the designated |
672
|
|
|
// constraints aren't met. |
673
|
|
|
type PermissionCheckResponseMetadataValidationError struct { |
674
|
|
|
field string |
675
|
|
|
reason string |
676
|
|
|
cause error |
677
|
|
|
key bool |
678
|
|
|
} |
679
|
|
|
|
680
|
|
|
// Field function returns field value. |
681
|
|
|
func (e PermissionCheckResponseMetadataValidationError) Field() string { return e.field } |
682
|
|
|
|
683
|
|
|
// Reason function returns reason value. |
684
|
|
|
func (e PermissionCheckResponseMetadataValidationError) Reason() string { return e.reason } |
685
|
|
|
|
686
|
|
|
// Cause function returns cause value. |
687
|
|
|
func (e PermissionCheckResponseMetadataValidationError) Cause() error { return e.cause } |
688
|
|
|
|
689
|
|
|
// Key function returns key value. |
690
|
|
|
func (e PermissionCheckResponseMetadataValidationError) Key() bool { return e.key } |
691
|
|
|
|
692
|
|
|
// ErrorName returns error name. |
693
|
|
|
func (e PermissionCheckResponseMetadataValidationError) ErrorName() string { |
694
|
|
|
return "PermissionCheckResponseMetadataValidationError" |
695
|
|
|
} |
696
|
|
|
|
697
|
|
|
// Error satisfies the builtin error interface |
698
|
|
|
func (e PermissionCheckResponseMetadataValidationError) Error() string { |
699
|
|
|
cause := "" |
700
|
|
|
if e.cause != nil { |
701
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
702
|
|
|
} |
703
|
|
|
|
704
|
|
|
key := "" |
705
|
|
|
if e.key { |
706
|
|
|
key = "key for " |
707
|
|
|
} |
708
|
|
|
|
709
|
|
|
return fmt.Sprintf( |
710
|
|
|
"invalid %sPermissionCheckResponseMetadata.%s: %s%s", |
711
|
|
|
key, |
712
|
|
|
e.field, |
713
|
|
|
e.reason, |
714
|
|
|
cause) |
715
|
|
|
} |
716
|
|
|
|
717
|
|
|
var _ error = PermissionCheckResponseMetadataValidationError{} |
718
|
|
|
|
719
|
|
|
var _ interface { |
720
|
|
|
Field() string |
721
|
|
|
Reason() string |
722
|
|
|
Key() bool |
723
|
|
|
Cause() error |
724
|
|
|
ErrorName() string |
725
|
|
|
} = PermissionCheckResponseMetadataValidationError{} |
726
|
|
|
|
727
|
|
|
// Validate checks the field values on PermissionExpandRequest with the rules |
728
|
|
|
// defined in the proto definition for this message. If any rules are |
729
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
730
|
|
|
func (m *PermissionExpandRequest) Validate() error { |
731
|
|
|
return m.validate(false) |
732
|
|
|
} |
733
|
|
|
|
734
|
|
|
// ValidateAll checks the field values on PermissionExpandRequest with the |
735
|
|
|
// rules defined in the proto definition for this message. If any rules are |
736
|
|
|
// violated, the result is a list of violation errors wrapped in |
737
|
|
|
// PermissionExpandRequestMultiError, or nil if none found. |
738
|
|
|
func (m *PermissionExpandRequest) ValidateAll() error { |
739
|
|
|
return m.validate(true) |
740
|
|
|
} |
741
|
|
|
|
742
|
|
|
func (m *PermissionExpandRequest) validate(all bool) error { |
743
|
|
|
if m == nil { |
744
|
|
|
return nil |
745
|
|
|
} |
746
|
|
|
|
747
|
|
|
var errors []error |
748
|
|
|
|
749
|
|
|
if len(m.GetTenantId()) > 128 { |
750
|
|
|
err := PermissionExpandRequestValidationError{ |
751
|
|
|
field: "TenantId", |
752
|
|
|
reason: "value length must be at most 128 bytes", |
753
|
|
|
} |
754
|
|
|
if !all { |
755
|
|
|
return err |
756
|
|
|
} |
757
|
|
|
errors = append(errors, err) |
758
|
|
|
} |
759
|
|
|
|
760
|
|
|
if !_PermissionExpandRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
761
|
|
|
err := PermissionExpandRequestValidationError{ |
762
|
|
|
field: "TenantId", |
763
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
764
|
|
|
} |
765
|
|
|
if !all { |
766
|
|
|
return err |
767
|
|
|
} |
768
|
|
|
errors = append(errors, err) |
769
|
|
|
} |
770
|
|
|
|
771
|
|
|
if m.GetMetadata() == nil { |
772
|
|
|
err := PermissionExpandRequestValidationError{ |
773
|
|
|
field: "Metadata", |
774
|
|
|
reason: "value is required", |
775
|
|
|
} |
776
|
|
|
if !all { |
777
|
|
|
return err |
778
|
|
|
} |
779
|
|
|
errors = append(errors, err) |
780
|
|
|
} |
781
|
|
|
|
782
|
|
|
if all { |
783
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
784
|
|
|
case interface{ ValidateAll() error }: |
785
|
|
|
if err := v.ValidateAll(); err != nil { |
786
|
|
|
errors = append(errors, PermissionExpandRequestValidationError{ |
787
|
|
|
field: "Metadata", |
788
|
|
|
reason: "embedded message failed validation", |
789
|
|
|
cause: err, |
790
|
|
|
}) |
791
|
|
|
} |
792
|
|
|
case interface{ Validate() error }: |
793
|
|
|
if err := v.Validate(); err != nil { |
794
|
|
|
errors = append(errors, PermissionExpandRequestValidationError{ |
795
|
|
|
field: "Metadata", |
796
|
|
|
reason: "embedded message failed validation", |
797
|
|
|
cause: err, |
798
|
|
|
}) |
799
|
|
|
} |
800
|
|
|
} |
801
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
802
|
|
|
if err := v.Validate(); err != nil { |
803
|
|
|
return PermissionExpandRequestValidationError{ |
804
|
|
|
field: "Metadata", |
805
|
|
|
reason: "embedded message failed validation", |
806
|
|
|
cause: err, |
807
|
|
|
} |
808
|
|
|
} |
809
|
|
|
} |
810
|
|
|
|
811
|
|
|
if m.GetEntity() == nil { |
812
|
|
|
err := PermissionExpandRequestValidationError{ |
813
|
|
|
field: "Entity", |
814
|
|
|
reason: "value is required", |
815
|
|
|
} |
816
|
|
|
if !all { |
817
|
|
|
return err |
818
|
|
|
} |
819
|
|
|
errors = append(errors, err) |
820
|
|
|
} |
821
|
|
|
|
822
|
|
|
if all { |
823
|
|
|
switch v := interface{}(m.GetEntity()).(type) { |
824
|
|
|
case interface{ ValidateAll() error }: |
825
|
|
|
if err := v.ValidateAll(); err != nil { |
826
|
|
|
errors = append(errors, PermissionExpandRequestValidationError{ |
827
|
|
|
field: "Entity", |
828
|
|
|
reason: "embedded message failed validation", |
829
|
|
|
cause: err, |
830
|
|
|
}) |
831
|
|
|
} |
832
|
|
|
case interface{ Validate() error }: |
833
|
|
|
if err := v.Validate(); err != nil { |
834
|
|
|
errors = append(errors, PermissionExpandRequestValidationError{ |
835
|
|
|
field: "Entity", |
836
|
|
|
reason: "embedded message failed validation", |
837
|
|
|
cause: err, |
838
|
|
|
}) |
839
|
|
|
} |
840
|
|
|
} |
841
|
|
|
} else if v, ok := interface{}(m.GetEntity()).(interface{ Validate() error }); ok { |
842
|
|
|
if err := v.Validate(); err != nil { |
843
|
|
|
return PermissionExpandRequestValidationError{ |
844
|
|
|
field: "Entity", |
845
|
|
|
reason: "embedded message failed validation", |
846
|
|
|
cause: err, |
847
|
|
|
} |
848
|
|
|
} |
849
|
|
|
} |
850
|
|
|
|
851
|
|
|
if m.GetPermission() != "" { |
852
|
|
|
|
853
|
|
|
if len(m.GetPermission()) > 64 { |
854
|
|
|
err := PermissionExpandRequestValidationError{ |
855
|
|
|
field: "Permission", |
856
|
|
|
reason: "value length must be at most 64 bytes", |
857
|
|
|
} |
858
|
|
|
if !all { |
859
|
|
|
return err |
860
|
|
|
} |
861
|
|
|
errors = append(errors, err) |
862
|
|
|
} |
863
|
|
|
|
864
|
|
|
if !_PermissionExpandRequest_Permission_Pattern.MatchString(m.GetPermission()) { |
865
|
|
|
err := PermissionExpandRequestValidationError{ |
866
|
|
|
field: "Permission", |
867
|
|
|
reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"", |
868
|
|
|
} |
869
|
|
|
if !all { |
870
|
|
|
return err |
871
|
|
|
} |
872
|
|
|
errors = append(errors, err) |
873
|
|
|
} |
874
|
|
|
|
875
|
|
|
} |
876
|
|
|
|
877
|
|
|
if all { |
878
|
|
|
switch v := interface{}(m.GetContext()).(type) { |
879
|
|
|
case interface{ ValidateAll() error }: |
880
|
|
|
if err := v.ValidateAll(); err != nil { |
881
|
|
|
errors = append(errors, PermissionExpandRequestValidationError{ |
882
|
|
|
field: "Context", |
883
|
|
|
reason: "embedded message failed validation", |
884
|
|
|
cause: err, |
885
|
|
|
}) |
886
|
|
|
} |
887
|
|
|
case interface{ Validate() error }: |
888
|
|
|
if err := v.Validate(); err != nil { |
889
|
|
|
errors = append(errors, PermissionExpandRequestValidationError{ |
890
|
|
|
field: "Context", |
891
|
|
|
reason: "embedded message failed validation", |
892
|
|
|
cause: err, |
893
|
|
|
}) |
894
|
|
|
} |
895
|
|
|
} |
896
|
|
|
} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok { |
897
|
|
|
if err := v.Validate(); err != nil { |
898
|
|
|
return PermissionExpandRequestValidationError{ |
899
|
|
|
field: "Context", |
900
|
|
|
reason: "embedded message failed validation", |
901
|
|
|
cause: err, |
902
|
|
|
} |
903
|
|
|
} |
904
|
|
|
} |
905
|
|
|
|
906
|
|
|
for idx, item := range m.GetArguments() { |
907
|
|
|
_, _ = idx, item |
908
|
|
|
|
909
|
|
|
if all { |
910
|
|
|
switch v := interface{}(item).(type) { |
911
|
|
|
case interface{ ValidateAll() error }: |
912
|
|
|
if err := v.ValidateAll(); err != nil { |
913
|
|
|
errors = append(errors, PermissionExpandRequestValidationError{ |
914
|
|
|
field: fmt.Sprintf("Arguments[%v]", idx), |
915
|
|
|
reason: "embedded message failed validation", |
916
|
|
|
cause: err, |
917
|
|
|
}) |
918
|
|
|
} |
919
|
|
|
case interface{ Validate() error }: |
920
|
|
|
if err := v.Validate(); err != nil { |
921
|
|
|
errors = append(errors, PermissionExpandRequestValidationError{ |
922
|
|
|
field: fmt.Sprintf("Arguments[%v]", idx), |
923
|
|
|
reason: "embedded message failed validation", |
924
|
|
|
cause: err, |
925
|
|
|
}) |
926
|
|
|
} |
927
|
|
|
} |
928
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
929
|
|
|
if err := v.Validate(); err != nil { |
930
|
|
|
return PermissionExpandRequestValidationError{ |
931
|
|
|
field: fmt.Sprintf("Arguments[%v]", idx), |
932
|
|
|
reason: "embedded message failed validation", |
933
|
|
|
cause: err, |
934
|
|
|
} |
935
|
|
|
} |
936
|
|
|
} |
937
|
|
|
|
938
|
|
|
} |
939
|
|
|
|
940
|
|
|
if len(errors) > 0 { |
941
|
|
|
return PermissionExpandRequestMultiError(errors) |
942
|
|
|
} |
943
|
|
|
|
944
|
|
|
return nil |
945
|
|
|
} |
946
|
|
|
|
947
|
|
|
// PermissionExpandRequestMultiError is an error wrapping multiple validation |
948
|
|
|
// errors returned by PermissionExpandRequest.ValidateAll() if the designated |
949
|
|
|
// constraints aren't met. |
950
|
|
|
type PermissionExpandRequestMultiError []error |
951
|
|
|
|
952
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
953
|
|
|
func (m PermissionExpandRequestMultiError) Error() string { |
954
|
|
|
var msgs []string |
955
|
|
|
for _, err := range m { |
956
|
|
|
msgs = append(msgs, err.Error()) |
957
|
|
|
} |
958
|
|
|
return strings.Join(msgs, "; ") |
959
|
|
|
} |
960
|
|
|
|
961
|
|
|
// AllErrors returns a list of validation violation errors. |
962
|
|
|
func (m PermissionExpandRequestMultiError) AllErrors() []error { return m } |
963
|
|
|
|
964
|
|
|
// PermissionExpandRequestValidationError is the validation error returned by |
965
|
|
|
// PermissionExpandRequest.Validate if the designated constraints aren't met. |
966
|
|
|
type PermissionExpandRequestValidationError struct { |
967
|
|
|
field string |
968
|
|
|
reason string |
969
|
|
|
cause error |
970
|
|
|
key bool |
971
|
|
|
} |
972
|
|
|
|
973
|
|
|
// Field function returns field value. |
974
|
|
|
func (e PermissionExpandRequestValidationError) Field() string { return e.field } |
975
|
|
|
|
976
|
|
|
// Reason function returns reason value. |
977
|
|
|
func (e PermissionExpandRequestValidationError) Reason() string { return e.reason } |
978
|
|
|
|
979
|
|
|
// Cause function returns cause value. |
980
|
|
|
func (e PermissionExpandRequestValidationError) Cause() error { return e.cause } |
981
|
|
|
|
982
|
|
|
// Key function returns key value. |
983
|
|
|
func (e PermissionExpandRequestValidationError) Key() bool { return e.key } |
984
|
|
|
|
985
|
|
|
// ErrorName returns error name. |
986
|
|
|
func (e PermissionExpandRequestValidationError) ErrorName() string { |
987
|
|
|
return "PermissionExpandRequestValidationError" |
988
|
|
|
} |
989
|
|
|
|
990
|
|
|
// Error satisfies the builtin error interface |
991
|
|
|
func (e PermissionExpandRequestValidationError) Error() string { |
992
|
|
|
cause := "" |
993
|
|
|
if e.cause != nil { |
994
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
995
|
|
|
} |
996
|
|
|
|
997
|
|
|
key := "" |
998
|
|
|
if e.key { |
999
|
|
|
key = "key for " |
1000
|
|
|
} |
1001
|
|
|
|
1002
|
|
|
return fmt.Sprintf( |
1003
|
|
|
"invalid %sPermissionExpandRequest.%s: %s%s", |
1004
|
|
|
key, |
1005
|
|
|
e.field, |
1006
|
|
|
e.reason, |
1007
|
|
|
cause) |
1008
|
|
|
} |
1009
|
|
|
|
1010
|
|
|
var _ error = PermissionExpandRequestValidationError{} |
1011
|
|
|
|
1012
|
|
|
var _ interface { |
1013
|
|
|
Field() string |
1014
|
|
|
Reason() string |
1015
|
|
|
Key() bool |
1016
|
|
|
Cause() error |
1017
|
|
|
ErrorName() string |
1018
|
|
|
} = PermissionExpandRequestValidationError{} |
1019
|
|
|
|
1020
|
|
|
var _PermissionExpandRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
1021
|
|
|
|
1022
|
|
|
var _PermissionExpandRequest_Permission_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$") |
1023
|
|
|
|
1024
|
|
|
// Validate checks the field values on PermissionExpandRequestMetadata with the |
1025
|
|
|
// rules defined in the proto definition for this message. If any rules are |
1026
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
1027
|
|
|
func (m *PermissionExpandRequestMetadata) Validate() error { |
1028
|
|
|
return m.validate(false) |
1029
|
|
|
} |
1030
|
|
|
|
1031
|
|
|
// ValidateAll checks the field values on PermissionExpandRequestMetadata with |
1032
|
|
|
// the rules defined in the proto definition for this message. If any rules |
1033
|
|
|
// are violated, the result is a list of violation errors wrapped in |
1034
|
|
|
// PermissionExpandRequestMetadataMultiError, or nil if none found. |
1035
|
|
|
func (m *PermissionExpandRequestMetadata) ValidateAll() error { |
1036
|
|
|
return m.validate(true) |
1037
|
|
|
} |
1038
|
|
|
|
1039
|
|
|
func (m *PermissionExpandRequestMetadata) validate(all bool) error { |
1040
|
|
|
if m == nil { |
1041
|
|
|
return nil |
1042
|
|
|
} |
1043
|
|
|
|
1044
|
|
|
var errors []error |
1045
|
|
|
|
1046
|
|
|
// no validation rules for SchemaVersion |
1047
|
|
|
|
1048
|
|
|
// no validation rules for SnapToken |
1049
|
|
|
|
1050
|
|
|
if len(errors) > 0 { |
1051
|
|
|
return PermissionExpandRequestMetadataMultiError(errors) |
1052
|
|
|
} |
1053
|
|
|
|
1054
|
|
|
return nil |
1055
|
|
|
} |
1056
|
|
|
|
1057
|
|
|
// PermissionExpandRequestMetadataMultiError is an error wrapping multiple |
1058
|
|
|
// validation errors returned by PermissionExpandRequestMetadata.ValidateAll() |
1059
|
|
|
// if the designated constraints aren't met. |
1060
|
|
|
type PermissionExpandRequestMetadataMultiError []error |
1061
|
|
|
|
1062
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
1063
|
|
|
func (m PermissionExpandRequestMetadataMultiError) Error() string { |
1064
|
|
|
var msgs []string |
1065
|
|
|
for _, err := range m { |
1066
|
|
|
msgs = append(msgs, err.Error()) |
1067
|
|
|
} |
1068
|
|
|
return strings.Join(msgs, "; ") |
1069
|
|
|
} |
1070
|
|
|
|
1071
|
|
|
// AllErrors returns a list of validation violation errors. |
1072
|
|
|
func (m PermissionExpandRequestMetadataMultiError) AllErrors() []error { return m } |
1073
|
|
|
|
1074
|
|
|
// PermissionExpandRequestMetadataValidationError is the validation error |
1075
|
|
|
// returned by PermissionExpandRequestMetadata.Validate if the designated |
1076
|
|
|
// constraints aren't met. |
1077
|
|
|
type PermissionExpandRequestMetadataValidationError struct { |
1078
|
|
|
field string |
1079
|
|
|
reason string |
1080
|
|
|
cause error |
1081
|
|
|
key bool |
1082
|
|
|
} |
1083
|
|
|
|
1084
|
|
|
// Field function returns field value. |
1085
|
|
|
func (e PermissionExpandRequestMetadataValidationError) Field() string { return e.field } |
1086
|
|
|
|
1087
|
|
|
// Reason function returns reason value. |
1088
|
|
|
func (e PermissionExpandRequestMetadataValidationError) Reason() string { return e.reason } |
1089
|
|
|
|
1090
|
|
|
// Cause function returns cause value. |
1091
|
|
|
func (e PermissionExpandRequestMetadataValidationError) Cause() error { return e.cause } |
1092
|
|
|
|
1093
|
|
|
// Key function returns key value. |
1094
|
|
|
func (e PermissionExpandRequestMetadataValidationError) Key() bool { return e.key } |
1095
|
|
|
|
1096
|
|
|
// ErrorName returns error name. |
1097
|
|
|
func (e PermissionExpandRequestMetadataValidationError) ErrorName() string { |
1098
|
|
|
return "PermissionExpandRequestMetadataValidationError" |
1099
|
|
|
} |
1100
|
|
|
|
1101
|
|
|
// Error satisfies the builtin error interface |
1102
|
|
|
func (e PermissionExpandRequestMetadataValidationError) Error() string { |
1103
|
|
|
cause := "" |
1104
|
|
|
if e.cause != nil { |
1105
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
1106
|
|
|
} |
1107
|
|
|
|
1108
|
|
|
key := "" |
1109
|
|
|
if e.key { |
1110
|
|
|
key = "key for " |
1111
|
|
|
} |
1112
|
|
|
|
1113
|
|
|
return fmt.Sprintf( |
1114
|
|
|
"invalid %sPermissionExpandRequestMetadata.%s: %s%s", |
1115
|
|
|
key, |
1116
|
|
|
e.field, |
1117
|
|
|
e.reason, |
1118
|
|
|
cause) |
1119
|
|
|
} |
1120
|
|
|
|
1121
|
|
|
var _ error = PermissionExpandRequestMetadataValidationError{} |
1122
|
|
|
|
1123
|
|
|
var _ interface { |
1124
|
|
|
Field() string |
1125
|
|
|
Reason() string |
1126
|
|
|
Key() bool |
1127
|
|
|
Cause() error |
1128
|
|
|
ErrorName() string |
1129
|
|
|
} = PermissionExpandRequestMetadataValidationError{} |
1130
|
|
|
|
1131
|
|
|
// Validate checks the field values on PermissionExpandResponse with the rules |
1132
|
|
|
// defined in the proto definition for this message. If any rules are |
1133
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
1134
|
|
|
func (m *PermissionExpandResponse) Validate() error { |
1135
|
|
|
return m.validate(false) |
1136
|
|
|
} |
1137
|
|
|
|
1138
|
|
|
// ValidateAll checks the field values on PermissionExpandResponse with the |
1139
|
|
|
// rules defined in the proto definition for this message. If any rules are |
1140
|
|
|
// violated, the result is a list of violation errors wrapped in |
1141
|
|
|
// PermissionExpandResponseMultiError, or nil if none found. |
1142
|
|
|
func (m *PermissionExpandResponse) ValidateAll() error { |
1143
|
|
|
return m.validate(true) |
1144
|
|
|
} |
1145
|
|
|
|
1146
|
|
|
func (m *PermissionExpandResponse) validate(all bool) error { |
1147
|
|
|
if m == nil { |
1148
|
|
|
return nil |
1149
|
|
|
} |
1150
|
|
|
|
1151
|
|
|
var errors []error |
1152
|
|
|
|
1153
|
|
|
if all { |
1154
|
|
|
switch v := interface{}(m.GetTree()).(type) { |
1155
|
|
|
case interface{ ValidateAll() error }: |
1156
|
|
|
if err := v.ValidateAll(); err != nil { |
1157
|
|
|
errors = append(errors, PermissionExpandResponseValidationError{ |
1158
|
|
|
field: "Tree", |
1159
|
|
|
reason: "embedded message failed validation", |
1160
|
|
|
cause: err, |
1161
|
|
|
}) |
1162
|
|
|
} |
1163
|
|
|
case interface{ Validate() error }: |
1164
|
|
|
if err := v.Validate(); err != nil { |
1165
|
|
|
errors = append(errors, PermissionExpandResponseValidationError{ |
1166
|
|
|
field: "Tree", |
1167
|
|
|
reason: "embedded message failed validation", |
1168
|
|
|
cause: err, |
1169
|
|
|
}) |
1170
|
|
|
} |
1171
|
|
|
} |
1172
|
|
|
} else if v, ok := interface{}(m.GetTree()).(interface{ Validate() error }); ok { |
1173
|
|
|
if err := v.Validate(); err != nil { |
1174
|
|
|
return PermissionExpandResponseValidationError{ |
1175
|
|
|
field: "Tree", |
1176
|
|
|
reason: "embedded message failed validation", |
1177
|
|
|
cause: err, |
1178
|
|
|
} |
1179
|
|
|
} |
1180
|
|
|
} |
1181
|
|
|
|
1182
|
|
|
if len(errors) > 0 { |
1183
|
|
|
return PermissionExpandResponseMultiError(errors) |
1184
|
|
|
} |
1185
|
|
|
|
1186
|
|
|
return nil |
1187
|
|
|
} |
1188
|
|
|
|
1189
|
|
|
// PermissionExpandResponseMultiError is an error wrapping multiple validation |
1190
|
|
|
// errors returned by PermissionExpandResponse.ValidateAll() if the designated |
1191
|
|
|
// constraints aren't met. |
1192
|
|
|
type PermissionExpandResponseMultiError []error |
1193
|
|
|
|
1194
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
1195
|
|
|
func (m PermissionExpandResponseMultiError) Error() string { |
1196
|
|
|
var msgs []string |
1197
|
|
|
for _, err := range m { |
1198
|
|
|
msgs = append(msgs, err.Error()) |
1199
|
|
|
} |
1200
|
|
|
return strings.Join(msgs, "; ") |
1201
|
|
|
} |
1202
|
|
|
|
1203
|
|
|
// AllErrors returns a list of validation violation errors. |
1204
|
|
|
func (m PermissionExpandResponseMultiError) AllErrors() []error { return m } |
1205
|
|
|
|
1206
|
|
|
// PermissionExpandResponseValidationError is the validation error returned by |
1207
|
|
|
// PermissionExpandResponse.Validate if the designated constraints aren't met. |
1208
|
|
|
type PermissionExpandResponseValidationError struct { |
1209
|
|
|
field string |
1210
|
|
|
reason string |
1211
|
|
|
cause error |
1212
|
|
|
key bool |
1213
|
|
|
} |
1214
|
|
|
|
1215
|
|
|
// Field function returns field value. |
1216
|
|
|
func (e PermissionExpandResponseValidationError) Field() string { return e.field } |
1217
|
|
|
|
1218
|
|
|
// Reason function returns reason value. |
1219
|
|
|
func (e PermissionExpandResponseValidationError) Reason() string { return e.reason } |
1220
|
|
|
|
1221
|
|
|
// Cause function returns cause value. |
1222
|
|
|
func (e PermissionExpandResponseValidationError) Cause() error { return e.cause } |
1223
|
|
|
|
1224
|
|
|
// Key function returns key value. |
1225
|
|
|
func (e PermissionExpandResponseValidationError) Key() bool { return e.key } |
1226
|
|
|
|
1227
|
|
|
// ErrorName returns error name. |
1228
|
|
|
func (e PermissionExpandResponseValidationError) ErrorName() string { |
1229
|
|
|
return "PermissionExpandResponseValidationError" |
1230
|
|
|
} |
1231
|
|
|
|
1232
|
|
|
// Error satisfies the builtin error interface |
1233
|
|
|
func (e PermissionExpandResponseValidationError) Error() string { |
1234
|
|
|
cause := "" |
1235
|
|
|
if e.cause != nil { |
1236
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
1237
|
|
|
} |
1238
|
|
|
|
1239
|
|
|
key := "" |
1240
|
|
|
if e.key { |
1241
|
|
|
key = "key for " |
1242
|
|
|
} |
1243
|
|
|
|
1244
|
|
|
return fmt.Sprintf( |
1245
|
|
|
"invalid %sPermissionExpandResponse.%s: %s%s", |
1246
|
|
|
key, |
1247
|
|
|
e.field, |
1248
|
|
|
e.reason, |
1249
|
|
|
cause) |
1250
|
|
|
} |
1251
|
|
|
|
1252
|
|
|
var _ error = PermissionExpandResponseValidationError{} |
1253
|
|
|
|
1254
|
|
|
var _ interface { |
1255
|
|
|
Field() string |
1256
|
|
|
Reason() string |
1257
|
|
|
Key() bool |
1258
|
|
|
Cause() error |
1259
|
|
|
ErrorName() string |
1260
|
|
|
} = PermissionExpandResponseValidationError{} |
1261
|
|
|
|
1262
|
|
|
// Validate checks the field values on PermissionLookupEntityRequest with the |
1263
|
|
|
// rules defined in the proto definition for this message. If any rules are |
1264
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
1265
|
|
|
func (m *PermissionLookupEntityRequest) Validate() error { |
1266
|
|
|
return m.validate(false) |
1267
|
|
|
} |
1268
|
|
|
|
1269
|
|
|
// ValidateAll checks the field values on PermissionLookupEntityRequest with |
1270
|
|
|
// the rules defined in the proto definition for this message. If any rules |
1271
|
|
|
// are violated, the result is a list of violation errors wrapped in |
1272
|
|
|
// PermissionLookupEntityRequestMultiError, or nil if none found. |
1273
|
|
|
func (m *PermissionLookupEntityRequest) ValidateAll() error { |
1274
|
|
|
return m.validate(true) |
1275
|
|
|
} |
1276
|
|
|
|
1277
|
|
|
func (m *PermissionLookupEntityRequest) validate(all bool) error { |
1278
|
|
|
if m == nil { |
1279
|
|
|
return nil |
1280
|
|
|
} |
1281
|
|
|
|
1282
|
|
|
var errors []error |
1283
|
|
|
|
1284
|
|
|
if len(m.GetTenantId()) > 128 { |
1285
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
1286
|
|
|
field: "TenantId", |
1287
|
|
|
reason: "value length must be at most 128 bytes", |
1288
|
|
|
} |
1289
|
|
|
if !all { |
1290
|
|
|
return err |
1291
|
|
|
} |
1292
|
|
|
errors = append(errors, err) |
1293
|
|
|
} |
1294
|
|
|
|
1295
|
|
|
if !_PermissionLookupEntityRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
1296
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
1297
|
|
|
field: "TenantId", |
1298
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
1299
|
|
|
} |
1300
|
|
|
if !all { |
1301
|
|
|
return err |
1302
|
|
|
} |
1303
|
|
|
errors = append(errors, err) |
1304
|
|
|
} |
1305
|
|
|
|
1306
|
|
|
if m.GetMetadata() == nil { |
1307
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
1308
|
|
|
field: "Metadata", |
1309
|
|
|
reason: "value is required", |
1310
|
|
|
} |
1311
|
|
|
if !all { |
1312
|
|
|
return err |
1313
|
|
|
} |
1314
|
|
|
errors = append(errors, err) |
1315
|
|
|
} |
1316
|
|
|
|
1317
|
|
|
if all { |
1318
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
1319
|
|
|
case interface{ ValidateAll() error }: |
1320
|
|
|
if err := v.ValidateAll(); err != nil { |
1321
|
|
|
errors = append(errors, PermissionLookupEntityRequestValidationError{ |
1322
|
|
|
field: "Metadata", |
1323
|
|
|
reason: "embedded message failed validation", |
1324
|
|
|
cause: err, |
1325
|
|
|
}) |
1326
|
|
|
} |
1327
|
|
|
case interface{ Validate() error }: |
1328
|
|
|
if err := v.Validate(); err != nil { |
1329
|
|
|
errors = append(errors, PermissionLookupEntityRequestValidationError{ |
1330
|
|
|
field: "Metadata", |
1331
|
|
|
reason: "embedded message failed validation", |
1332
|
|
|
cause: err, |
1333
|
|
|
}) |
1334
|
|
|
} |
1335
|
|
|
} |
1336
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
1337
|
|
|
if err := v.Validate(); err != nil { |
1338
|
|
|
return PermissionLookupEntityRequestValidationError{ |
1339
|
|
|
field: "Metadata", |
1340
|
|
|
reason: "embedded message failed validation", |
1341
|
|
|
cause: err, |
1342
|
|
|
} |
1343
|
|
|
} |
1344
|
|
|
} |
1345
|
|
|
|
1346
|
|
|
if len(m.GetEntityType()) > 64 { |
1347
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
1348
|
|
|
field: "EntityType", |
1349
|
|
|
reason: "value length must be at most 64 bytes", |
1350
|
|
|
} |
1351
|
|
|
if !all { |
1352
|
|
|
return err |
1353
|
|
|
} |
1354
|
|
|
errors = append(errors, err) |
1355
|
|
|
} |
1356
|
|
|
|
1357
|
|
|
if !_PermissionLookupEntityRequest_EntityType_Pattern.MatchString(m.GetEntityType()) { |
1358
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
1359
|
|
|
field: "EntityType", |
1360
|
|
|
reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"", |
1361
|
|
|
} |
1362
|
|
|
if !all { |
1363
|
|
|
return err |
1364
|
|
|
} |
1365
|
|
|
errors = append(errors, err) |
1366
|
|
|
} |
1367
|
|
|
|
1368
|
|
|
if len(m.GetPermission()) > 64 { |
1369
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
1370
|
|
|
field: "Permission", |
1371
|
|
|
reason: "value length must be at most 64 bytes", |
1372
|
|
|
} |
1373
|
|
|
if !all { |
1374
|
|
|
return err |
1375
|
|
|
} |
1376
|
|
|
errors = append(errors, err) |
1377
|
|
|
} |
1378
|
|
|
|
1379
|
|
|
if !_PermissionLookupEntityRequest_Permission_Pattern.MatchString(m.GetPermission()) { |
1380
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
1381
|
|
|
field: "Permission", |
1382
|
|
|
reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"", |
1383
|
|
|
} |
1384
|
|
|
if !all { |
1385
|
|
|
return err |
1386
|
|
|
} |
1387
|
|
|
errors = append(errors, err) |
1388
|
|
|
} |
1389
|
|
|
|
1390
|
|
|
if m.GetSubject() == nil { |
1391
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
1392
|
|
|
field: "Subject", |
1393
|
|
|
reason: "value is required", |
1394
|
|
|
} |
1395
|
|
|
if !all { |
1396
|
|
|
return err |
1397
|
|
|
} |
1398
|
|
|
errors = append(errors, err) |
1399
|
|
|
} |
1400
|
|
|
|
1401
|
|
|
if all { |
1402
|
|
|
switch v := interface{}(m.GetSubject()).(type) { |
1403
|
|
|
case interface{ ValidateAll() error }: |
1404
|
|
|
if err := v.ValidateAll(); err != nil { |
1405
|
|
|
errors = append(errors, PermissionLookupEntityRequestValidationError{ |
1406
|
|
|
field: "Subject", |
1407
|
|
|
reason: "embedded message failed validation", |
1408
|
|
|
cause: err, |
1409
|
|
|
}) |
1410
|
|
|
} |
1411
|
|
|
case interface{ Validate() error }: |
1412
|
|
|
if err := v.Validate(); err != nil { |
1413
|
|
|
errors = append(errors, PermissionLookupEntityRequestValidationError{ |
1414
|
|
|
field: "Subject", |
1415
|
|
|
reason: "embedded message failed validation", |
1416
|
|
|
cause: err, |
1417
|
|
|
}) |
1418
|
|
|
} |
1419
|
|
|
} |
1420
|
|
|
} else if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok { |
1421
|
|
|
if err := v.Validate(); err != nil { |
1422
|
|
|
return PermissionLookupEntityRequestValidationError{ |
1423
|
|
|
field: "Subject", |
1424
|
|
|
reason: "embedded message failed validation", |
1425
|
|
|
cause: err, |
1426
|
|
|
} |
1427
|
|
|
} |
1428
|
|
|
} |
1429
|
|
|
|
1430
|
|
|
if all { |
1431
|
|
|
switch v := interface{}(m.GetContext()).(type) { |
1432
|
|
|
case interface{ ValidateAll() error }: |
1433
|
|
|
if err := v.ValidateAll(); err != nil { |
1434
|
|
|
errors = append(errors, PermissionLookupEntityRequestValidationError{ |
1435
|
|
|
field: "Context", |
1436
|
|
|
reason: "embedded message failed validation", |
1437
|
|
|
cause: err, |
1438
|
|
|
}) |
1439
|
|
|
} |
1440
|
|
|
case interface{ Validate() error }: |
1441
|
|
|
if err := v.Validate(); err != nil { |
1442
|
|
|
errors = append(errors, PermissionLookupEntityRequestValidationError{ |
1443
|
|
|
field: "Context", |
1444
|
|
|
reason: "embedded message failed validation", |
1445
|
|
|
cause: err, |
1446
|
|
|
}) |
1447
|
|
|
} |
1448
|
|
|
} |
1449
|
|
|
} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok { |
1450
|
|
|
if err := v.Validate(); err != nil { |
1451
|
|
|
return PermissionLookupEntityRequestValidationError{ |
1452
|
|
|
field: "Context", |
1453
|
|
|
reason: "embedded message failed validation", |
1454
|
|
|
cause: err, |
1455
|
|
|
} |
1456
|
|
|
} |
1457
|
|
|
} |
1458
|
|
|
|
1459
|
|
|
{ |
1460
|
|
|
sorted_keys := make([]string, len(m.GetScope())) |
1461
|
|
|
i := 0 |
1462
|
|
|
for key := range m.GetScope() { |
1463
|
|
|
sorted_keys[i] = key |
1464
|
|
|
i++ |
1465
|
|
|
} |
1466
|
|
|
sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) |
1467
|
|
|
for _, key := range sorted_keys { |
1468
|
|
|
val := m.GetScope()[key] |
1469
|
|
|
_ = val |
1470
|
|
|
|
1471
|
|
|
// no validation rules for Scope[key] |
1472
|
|
|
|
1473
|
|
|
if all { |
1474
|
|
|
switch v := interface{}(val).(type) { |
1475
|
|
|
case interface{ ValidateAll() error }: |
1476
|
|
|
if err := v.ValidateAll(); err != nil { |
1477
|
|
|
errors = append(errors, PermissionLookupEntityRequestValidationError{ |
1478
|
|
|
field: fmt.Sprintf("Scope[%v]", key), |
1479
|
|
|
reason: "embedded message failed validation", |
1480
|
|
|
cause: err, |
1481
|
|
|
}) |
1482
|
|
|
} |
1483
|
|
|
case interface{ Validate() error }: |
1484
|
|
|
if err := v.Validate(); err != nil { |
1485
|
|
|
errors = append(errors, PermissionLookupEntityRequestValidationError{ |
1486
|
|
|
field: fmt.Sprintf("Scope[%v]", key), |
1487
|
|
|
reason: "embedded message failed validation", |
1488
|
|
|
cause: err, |
1489
|
|
|
}) |
1490
|
|
|
} |
1491
|
|
|
} |
1492
|
|
|
} else if v, ok := interface{}(val).(interface{ Validate() error }); ok { |
1493
|
|
|
if err := v.Validate(); err != nil { |
1494
|
|
|
return PermissionLookupEntityRequestValidationError{ |
1495
|
|
|
field: fmt.Sprintf("Scope[%v]", key), |
1496
|
|
|
reason: "embedded message failed validation", |
1497
|
|
|
cause: err, |
1498
|
|
|
} |
1499
|
|
|
} |
1500
|
|
|
} |
1501
|
|
|
|
1502
|
|
|
} |
1503
|
|
|
} |
1504
|
|
|
|
1505
|
|
|
if m.GetPageSize() != 0 { |
1506
|
|
|
|
1507
|
|
|
if m.GetPageSize() < 1 { |
1508
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
1509
|
|
|
field: "PageSize", |
1510
|
|
|
reason: "value must be greater than or equal to 1", |
1511
|
|
|
} |
1512
|
|
|
if !all { |
1513
|
|
|
return err |
1514
|
|
|
} |
1515
|
|
|
errors = append(errors, err) |
1516
|
|
|
} |
1517
|
|
|
|
1518
|
|
|
} |
1519
|
|
|
|
1520
|
|
|
if m.GetContinuousToken() != "" { |
1521
|
|
|
|
1522
|
|
|
} |
1523
|
|
|
|
1524
|
|
|
if len(errors) > 0 { |
1525
|
|
|
return PermissionLookupEntityRequestMultiError(errors) |
1526
|
|
|
} |
1527
|
|
|
|
1528
|
|
|
return nil |
1529
|
|
|
} |
1530
|
|
|
|
1531
|
|
|
// PermissionLookupEntityRequestMultiError is an error wrapping multiple |
1532
|
|
|
// validation errors returned by PermissionLookupEntityRequest.ValidateAll() |
1533
|
|
|
// if the designated constraints aren't met. |
1534
|
|
|
type PermissionLookupEntityRequestMultiError []error |
1535
|
|
|
|
1536
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
1537
|
|
|
func (m PermissionLookupEntityRequestMultiError) Error() string { |
1538
|
|
|
var msgs []string |
1539
|
|
|
for _, err := range m { |
1540
|
|
|
msgs = append(msgs, err.Error()) |
1541
|
|
|
} |
1542
|
|
|
return strings.Join(msgs, "; ") |
1543
|
|
|
} |
1544
|
|
|
|
1545
|
|
|
// AllErrors returns a list of validation violation errors. |
1546
|
|
|
func (m PermissionLookupEntityRequestMultiError) AllErrors() []error { return m } |
1547
|
|
|
|
1548
|
|
|
// PermissionLookupEntityRequestValidationError is the validation error |
1549
|
|
|
// returned by PermissionLookupEntityRequest.Validate if the designated |
1550
|
|
|
// constraints aren't met. |
1551
|
|
|
type PermissionLookupEntityRequestValidationError struct { |
1552
|
|
|
field string |
1553
|
|
|
reason string |
1554
|
|
|
cause error |
1555
|
|
|
key bool |
1556
|
|
|
} |
1557
|
|
|
|
1558
|
|
|
// Field function returns field value. |
1559
|
|
|
func (e PermissionLookupEntityRequestValidationError) Field() string { return e.field } |
1560
|
|
|
|
1561
|
|
|
// Reason function returns reason value. |
1562
|
|
|
func (e PermissionLookupEntityRequestValidationError) Reason() string { return e.reason } |
1563
|
|
|
|
1564
|
|
|
// Cause function returns cause value. |
1565
|
|
|
func (e PermissionLookupEntityRequestValidationError) Cause() error { return e.cause } |
1566
|
|
|
|
1567
|
|
|
// Key function returns key value. |
1568
|
|
|
func (e PermissionLookupEntityRequestValidationError) Key() bool { return e.key } |
1569
|
|
|
|
1570
|
|
|
// ErrorName returns error name. |
1571
|
|
|
func (e PermissionLookupEntityRequestValidationError) ErrorName() string { |
1572
|
|
|
return "PermissionLookupEntityRequestValidationError" |
1573
|
|
|
} |
1574
|
|
|
|
1575
|
|
|
// Error satisfies the builtin error interface |
1576
|
|
|
func (e PermissionLookupEntityRequestValidationError) Error() string { |
1577
|
|
|
cause := "" |
1578
|
|
|
if e.cause != nil { |
1579
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
1580
|
|
|
} |
1581
|
|
|
|
1582
|
|
|
key := "" |
1583
|
|
|
if e.key { |
1584
|
|
|
key = "key for " |
1585
|
|
|
} |
1586
|
|
|
|
1587
|
|
|
return fmt.Sprintf( |
1588
|
|
|
"invalid %sPermissionLookupEntityRequest.%s: %s%s", |
1589
|
|
|
key, |
1590
|
|
|
e.field, |
1591
|
|
|
e.reason, |
1592
|
|
|
cause) |
1593
|
|
|
} |
1594
|
|
|
|
1595
|
|
|
var _ error = PermissionLookupEntityRequestValidationError{} |
1596
|
|
|
|
1597
|
|
|
var _ interface { |
1598
|
|
|
Field() string |
1599
|
|
|
Reason() string |
1600
|
|
|
Key() bool |
1601
|
|
|
Cause() error |
1602
|
|
|
ErrorName() string |
1603
|
|
|
} = PermissionLookupEntityRequestValidationError{} |
1604
|
|
|
|
1605
|
|
|
var _PermissionLookupEntityRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
1606
|
|
|
|
1607
|
|
|
var _PermissionLookupEntityRequest_EntityType_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$") |
1608
|
|
|
|
1609
|
|
|
var _PermissionLookupEntityRequest_Permission_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$") |
1610
|
|
|
|
1611
|
|
|
// Validate checks the field values on PermissionsLookupEntityRequest with the |
1612
|
|
|
// rules defined in the proto definition for this message. If any rules are |
1613
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
1614
|
|
|
func (m *PermissionsLookupEntityRequest) Validate() error { |
1615
|
|
|
return m.validate(false) |
1616
|
|
|
} |
1617
|
|
|
|
1618
|
|
|
// ValidateAll checks the field values on PermissionsLookupEntityRequest with |
1619
|
|
|
// the rules defined in the proto definition for this message. If any rules |
1620
|
|
|
// are violated, the result is a list of violation errors wrapped in |
1621
|
|
|
// PermissionsLookupEntityRequestMultiError, or nil if none found. |
1622
|
|
|
func (m *PermissionsLookupEntityRequest) ValidateAll() error { |
1623
|
|
|
return m.validate(true) |
1624
|
|
|
} |
1625
|
|
|
|
1626
|
|
|
func (m *PermissionsLookupEntityRequest) validate(all bool) error { |
1627
|
|
|
if m == nil { |
1628
|
|
|
return nil |
1629
|
|
|
} |
1630
|
|
|
|
1631
|
|
|
var errors []error |
1632
|
|
|
|
1633
|
|
|
if len(m.GetTenantId()) > 128 { |
1634
|
|
|
err := PermissionsLookupEntityRequestValidationError{ |
1635
|
|
|
field: "TenantId", |
1636
|
|
|
reason: "value length must be at most 128 bytes", |
1637
|
|
|
} |
1638
|
|
|
if !all { |
1639
|
|
|
return err |
1640
|
|
|
} |
1641
|
|
|
errors = append(errors, err) |
1642
|
|
|
} |
1643
|
|
|
|
1644
|
|
|
if !_PermissionsLookupEntityRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
1645
|
|
|
err := PermissionsLookupEntityRequestValidationError{ |
1646
|
|
|
field: "TenantId", |
1647
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
1648
|
|
|
} |
1649
|
|
|
if !all { |
1650
|
|
|
return err |
1651
|
|
|
} |
1652
|
|
|
errors = append(errors, err) |
1653
|
|
|
} |
1654
|
|
|
|
1655
|
|
|
if m.GetMetadata() == nil { |
1656
|
|
|
err := PermissionsLookupEntityRequestValidationError{ |
1657
|
|
|
field: "Metadata", |
1658
|
|
|
reason: "value is required", |
1659
|
|
|
} |
1660
|
|
|
if !all { |
1661
|
|
|
return err |
1662
|
|
|
} |
1663
|
|
|
errors = append(errors, err) |
1664
|
|
|
} |
1665
|
|
|
|
1666
|
|
|
if all { |
1667
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
1668
|
|
|
case interface{ ValidateAll() error }: |
1669
|
|
|
if err := v.ValidateAll(); err != nil { |
1670
|
|
|
errors = append(errors, PermissionsLookupEntityRequestValidationError{ |
1671
|
|
|
field: "Metadata", |
1672
|
|
|
reason: "embedded message failed validation", |
1673
|
|
|
cause: err, |
1674
|
|
|
}) |
1675
|
|
|
} |
1676
|
|
|
case interface{ Validate() error }: |
1677
|
|
|
if err := v.Validate(); err != nil { |
1678
|
|
|
errors = append(errors, PermissionsLookupEntityRequestValidationError{ |
1679
|
|
|
field: "Metadata", |
1680
|
|
|
reason: "embedded message failed validation", |
1681
|
|
|
cause: err, |
1682
|
|
|
}) |
1683
|
|
|
} |
1684
|
|
|
} |
1685
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
1686
|
|
|
if err := v.Validate(); err != nil { |
1687
|
|
|
return PermissionsLookupEntityRequestValidationError{ |
1688
|
|
|
field: "Metadata", |
1689
|
|
|
reason: "embedded message failed validation", |
1690
|
|
|
cause: err, |
1691
|
|
|
} |
1692
|
|
|
} |
1693
|
|
|
} |
1694
|
|
|
|
1695
|
|
|
if len(m.GetEntityType()) > 64 { |
1696
|
|
|
err := PermissionsLookupEntityRequestValidationError{ |
1697
|
|
|
field: "EntityType", |
1698
|
|
|
reason: "value length must be at most 64 bytes", |
1699
|
|
|
} |
1700
|
|
|
if !all { |
1701
|
|
|
return err |
1702
|
|
|
} |
1703
|
|
|
errors = append(errors, err) |
1704
|
|
|
} |
1705
|
|
|
|
1706
|
|
|
if !_PermissionsLookupEntityRequest_EntityType_Pattern.MatchString(m.GetEntityType()) { |
1707
|
|
|
err := PermissionsLookupEntityRequestValidationError{ |
1708
|
|
|
field: "EntityType", |
1709
|
|
|
reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"", |
1710
|
|
|
} |
1711
|
|
|
if !all { |
1712
|
|
|
return err |
1713
|
|
|
} |
1714
|
|
|
errors = append(errors, err) |
1715
|
|
|
} |
1716
|
|
|
|
1717
|
|
|
if l := len(m.GetPermissions()); l < 1 || l > 100 { |
1718
|
|
|
err := PermissionsLookupEntityRequestValidationError{ |
1719
|
|
|
field: "Permissions", |
1720
|
|
|
reason: "value must contain between 1 and 100 items, inclusive", |
1721
|
|
|
} |
1722
|
|
|
if !all { |
1723
|
|
|
return err |
1724
|
|
|
} |
1725
|
|
|
errors = append(errors, err) |
1726
|
|
|
} |
1727
|
|
|
|
1728
|
|
|
for idx, item := range m.GetPermissions() { |
1729
|
|
|
_, _ = idx, item |
1730
|
|
|
|
1731
|
|
|
if len(item) > 64 { |
1732
|
|
|
err := PermissionsLookupEntityRequestValidationError{ |
1733
|
|
|
field: fmt.Sprintf("Permissions[%v]", idx), |
1734
|
|
|
reason: "value length must be at most 64 bytes", |
1735
|
|
|
} |
1736
|
|
|
if !all { |
1737
|
|
|
return err |
1738
|
|
|
} |
1739
|
|
|
errors = append(errors, err) |
1740
|
|
|
} |
1741
|
|
|
|
1742
|
|
|
if !_PermissionsLookupEntityRequest_Permissions_Pattern.MatchString(item) { |
1743
|
|
|
err := PermissionsLookupEntityRequestValidationError{ |
1744
|
|
|
field: fmt.Sprintf("Permissions[%v]", idx), |
1745
|
|
|
reason: "value does not match regex pattern \"^[a-zA-Z_][a-zA-Z0-9_]*$\"", |
1746
|
|
|
} |
1747
|
|
|
if !all { |
1748
|
|
|
return err |
1749
|
|
|
} |
1750
|
|
|
errors = append(errors, err) |
1751
|
|
|
} |
1752
|
|
|
|
1753
|
|
|
} |
1754
|
|
|
|
1755
|
|
|
if m.GetSubject() == nil { |
1756
|
|
|
err := PermissionsLookupEntityRequestValidationError{ |
1757
|
|
|
field: "Subject", |
1758
|
|
|
reason: "value is required", |
1759
|
|
|
} |
1760
|
|
|
if !all { |
1761
|
|
|
return err |
1762
|
|
|
} |
1763
|
|
|
errors = append(errors, err) |
1764
|
|
|
} |
1765
|
|
|
|
1766
|
|
|
if all { |
1767
|
|
|
switch v := interface{}(m.GetSubject()).(type) { |
1768
|
|
|
case interface{ ValidateAll() error }: |
1769
|
|
|
if err := v.ValidateAll(); err != nil { |
1770
|
|
|
errors = append(errors, PermissionsLookupEntityRequestValidationError{ |
1771
|
|
|
field: "Subject", |
1772
|
|
|
reason: "embedded message failed validation", |
1773
|
|
|
cause: err, |
1774
|
|
|
}) |
1775
|
|
|
} |
1776
|
|
|
case interface{ Validate() error }: |
1777
|
|
|
if err := v.Validate(); err != nil { |
1778
|
|
|
errors = append(errors, PermissionsLookupEntityRequestValidationError{ |
1779
|
|
|
field: "Subject", |
1780
|
|
|
reason: "embedded message failed validation", |
1781
|
|
|
cause: err, |
1782
|
|
|
}) |
1783
|
|
|
} |
1784
|
|
|
} |
1785
|
|
|
} else if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok { |
1786
|
|
|
if err := v.Validate(); err != nil { |
1787
|
|
|
return PermissionsLookupEntityRequestValidationError{ |
1788
|
|
|
field: "Subject", |
1789
|
|
|
reason: "embedded message failed validation", |
1790
|
|
|
cause: err, |
1791
|
|
|
} |
1792
|
|
|
} |
1793
|
|
|
} |
1794
|
|
|
|
1795
|
|
|
if all { |
1796
|
|
|
switch v := interface{}(m.GetContext()).(type) { |
1797
|
|
|
case interface{ ValidateAll() error }: |
1798
|
|
|
if err := v.ValidateAll(); err != nil { |
1799
|
|
|
errors = append(errors, PermissionsLookupEntityRequestValidationError{ |
1800
|
|
|
field: "Context", |
1801
|
|
|
reason: "embedded message failed validation", |
1802
|
|
|
cause: err, |
1803
|
|
|
}) |
1804
|
|
|
} |
1805
|
|
|
case interface{ Validate() error }: |
1806
|
|
|
if err := v.Validate(); err != nil { |
1807
|
|
|
errors = append(errors, PermissionsLookupEntityRequestValidationError{ |
1808
|
|
|
field: "Context", |
1809
|
|
|
reason: "embedded message failed validation", |
1810
|
|
|
cause: err, |
1811
|
|
|
}) |
1812
|
|
|
} |
1813
|
|
|
} |
1814
|
|
|
} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok { |
1815
|
|
|
if err := v.Validate(); err != nil { |
1816
|
|
|
return PermissionsLookupEntityRequestValidationError{ |
1817
|
|
|
field: "Context", |
1818
|
|
|
reason: "embedded message failed validation", |
1819
|
|
|
cause: err, |
1820
|
|
|
} |
1821
|
|
|
} |
1822
|
|
|
} |
1823
|
|
|
|
1824
|
|
|
{ |
1825
|
|
|
sorted_keys := make([]string, len(m.GetScope())) |
1826
|
|
|
i := 0 |
1827
|
|
|
for key := range m.GetScope() { |
1828
|
|
|
sorted_keys[i] = key |
1829
|
|
|
i++ |
1830
|
|
|
} |
1831
|
|
|
sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) |
1832
|
|
|
for _, key := range sorted_keys { |
1833
|
|
|
val := m.GetScope()[key] |
1834
|
|
|
_ = val |
1835
|
|
|
|
1836
|
|
|
// no validation rules for Scope[key] |
1837
|
|
|
|
1838
|
|
|
if all { |
1839
|
|
|
switch v := interface{}(val).(type) { |
1840
|
|
|
case interface{ ValidateAll() error }: |
1841
|
|
|
if err := v.ValidateAll(); err != nil { |
1842
|
|
|
errors = append(errors, PermissionsLookupEntityRequestValidationError{ |
1843
|
|
|
field: fmt.Sprintf("Scope[%v]", key), |
1844
|
|
|
reason: "embedded message failed validation", |
1845
|
|
|
cause: err, |
1846
|
|
|
}) |
1847
|
|
|
} |
1848
|
|
|
case interface{ Validate() error }: |
1849
|
|
|
if err := v.Validate(); err != nil { |
1850
|
|
|
errors = append(errors, PermissionsLookupEntityRequestValidationError{ |
1851
|
|
|
field: fmt.Sprintf("Scope[%v]", key), |
1852
|
|
|
reason: "embedded message failed validation", |
1853
|
|
|
cause: err, |
1854
|
|
|
}) |
1855
|
|
|
} |
1856
|
|
|
} |
1857
|
|
|
} else if v, ok := interface{}(val).(interface{ Validate() error }); ok { |
1858
|
|
|
if err := v.Validate(); err != nil { |
1859
|
|
|
return PermissionsLookupEntityRequestValidationError{ |
1860
|
|
|
field: fmt.Sprintf("Scope[%v]", key), |
1861
|
|
|
reason: "embedded message failed validation", |
1862
|
|
|
cause: err, |
1863
|
|
|
} |
1864
|
|
|
} |
1865
|
|
|
} |
1866
|
|
|
|
1867
|
|
|
} |
1868
|
|
|
} |
1869
|
|
|
|
1870
|
|
|
if m.GetPageSize() != 0 { |
1871
|
|
|
|
1872
|
|
|
if m.GetPageSize() < 1 { |
1873
|
|
|
err := PermissionsLookupEntityRequestValidationError{ |
1874
|
|
|
field: "PageSize", |
1875
|
|
|
reason: "value must be greater than or equal to 1", |
1876
|
|
|
} |
1877
|
|
|
if !all { |
1878
|
|
|
return err |
1879
|
|
|
} |
1880
|
|
|
errors = append(errors, err) |
1881
|
|
|
} |
1882
|
|
|
|
1883
|
|
|
} |
1884
|
|
|
|
1885
|
|
|
if m.GetContinuousToken() != "" { |
1886
|
|
|
|
1887
|
|
|
} |
1888
|
|
|
|
1889
|
|
|
if len(errors) > 0 { |
1890
|
|
|
return PermissionsLookupEntityRequestMultiError(errors) |
1891
|
|
|
} |
1892
|
|
|
|
1893
|
|
|
return nil |
1894
|
|
|
} |
1895
|
|
|
|
1896
|
|
|
// PermissionsLookupEntityRequestMultiError is an error wrapping multiple |
1897
|
|
|
// validation errors returned by PermissionsLookupEntityRequest.ValidateAll() |
1898
|
|
|
// if the designated constraints aren't met. |
1899
|
|
|
type PermissionsLookupEntityRequestMultiError []error |
1900
|
|
|
|
1901
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
1902
|
|
|
func (m PermissionsLookupEntityRequestMultiError) Error() string { |
1903
|
|
|
var msgs []string |
1904
|
|
|
for _, err := range m { |
1905
|
|
|
msgs = append(msgs, err.Error()) |
1906
|
|
|
} |
1907
|
|
|
return strings.Join(msgs, "; ") |
1908
|
|
|
} |
1909
|
|
|
|
1910
|
|
|
// AllErrors returns a list of validation violation errors. |
1911
|
|
|
func (m PermissionsLookupEntityRequestMultiError) AllErrors() []error { return m } |
1912
|
|
|
|
1913
|
|
|
// PermissionsLookupEntityRequestValidationError is the validation error |
1914
|
|
|
// returned by PermissionsLookupEntityRequest.Validate if the designated |
1915
|
|
|
// constraints aren't met. |
1916
|
|
|
type PermissionsLookupEntityRequestValidationError struct { |
1917
|
|
|
field string |
1918
|
|
|
reason string |
1919
|
|
|
cause error |
1920
|
|
|
key bool |
1921
|
|
|
} |
1922
|
|
|
|
1923
|
|
|
// Field function returns field value. |
1924
|
|
|
func (e PermissionsLookupEntityRequestValidationError) Field() string { return e.field } |
1925
|
|
|
|
1926
|
|
|
// Reason function returns reason value. |
1927
|
|
|
func (e PermissionsLookupEntityRequestValidationError) Reason() string { return e.reason } |
1928
|
|
|
|
1929
|
|
|
// Cause function returns cause value. |
1930
|
|
|
func (e PermissionsLookupEntityRequestValidationError) Cause() error { return e.cause } |
1931
|
|
|
|
1932
|
|
|
// Key function returns key value. |
1933
|
|
|
func (e PermissionsLookupEntityRequestValidationError) Key() bool { return e.key } |
1934
|
|
|
|
1935
|
|
|
// ErrorName returns error name. |
1936
|
|
|
func (e PermissionsLookupEntityRequestValidationError) ErrorName() string { |
1937
|
|
|
return "PermissionsLookupEntityRequestValidationError" |
1938
|
|
|
} |
1939
|
|
|
|
1940
|
|
|
// Error satisfies the builtin error interface |
1941
|
|
|
func (e PermissionsLookupEntityRequestValidationError) Error() string { |
1942
|
|
|
cause := "" |
1943
|
|
|
if e.cause != nil { |
1944
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
1945
|
|
|
} |
1946
|
|
|
|
1947
|
|
|
key := "" |
1948
|
|
|
if e.key { |
1949
|
|
|
key = "key for " |
1950
|
|
|
} |
1951
|
|
|
|
1952
|
|
|
return fmt.Sprintf( |
1953
|
|
|
"invalid %sPermissionsLookupEntityRequest.%s: %s%s", |
1954
|
|
|
key, |
1955
|
|
|
e.field, |
1956
|
|
|
e.reason, |
1957
|
|
|
cause) |
1958
|
|
|
} |
1959
|
|
|
|
1960
|
|
|
var _ error = PermissionsLookupEntityRequestValidationError{} |
1961
|
|
|
|
1962
|
|
|
var _ interface { |
1963
|
|
|
Field() string |
1964
|
|
|
Reason() string |
1965
|
|
|
Key() bool |
1966
|
|
|
Cause() error |
1967
|
|
|
ErrorName() string |
1968
|
|
|
} = PermissionsLookupEntityRequestValidationError{} |
1969
|
|
|
|
1970
|
|
|
var _PermissionsLookupEntityRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
1971
|
|
|
|
1972
|
|
|
var _PermissionsLookupEntityRequest_EntityType_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$") |
1973
|
|
|
|
1974
|
|
|
var _PermissionsLookupEntityRequest_Permissions_Pattern = regexp.MustCompile("^[a-zA-Z_][a-zA-Z0-9_]*$") |
1975
|
|
|
|
1976
|
|
|
// Validate checks the field values on PermissionLookupEntityRequestMetadata |
1977
|
|
|
// with the rules defined in the proto definition for this message. If any |
1978
|
|
|
// rules are violated, the first error encountered is returned, or nil if |
1979
|
|
|
// there are no violations. |
1980
|
|
|
func (m *PermissionLookupEntityRequestMetadata) Validate() error { |
1981
|
|
|
return m.validate(false) |
1982
|
|
|
} |
1983
|
|
|
|
1984
|
|
|
// ValidateAll checks the field values on PermissionLookupEntityRequestMetadata |
1985
|
|
|
// with the rules defined in the proto definition for this message. If any |
1986
|
|
|
// rules are violated, the result is a list of violation errors wrapped in |
1987
|
|
|
// PermissionLookupEntityRequestMetadataMultiError, or nil if none found. |
1988
|
|
|
func (m *PermissionLookupEntityRequestMetadata) ValidateAll() error { |
1989
|
|
|
return m.validate(true) |
1990
|
|
|
} |
1991
|
|
|
|
1992
|
|
|
func (m *PermissionLookupEntityRequestMetadata) validate(all bool) error { |
1993
|
|
|
if m == nil { |
1994
|
|
|
return nil |
1995
|
|
|
} |
1996
|
|
|
|
1997
|
|
|
var errors []error |
1998
|
|
|
|
1999
|
|
|
// no validation rules for SchemaVersion |
2000
|
|
|
|
2001
|
|
|
// no validation rules for SnapToken |
2002
|
|
|
|
2003
|
|
|
if m.GetDepth() < 3 { |
2004
|
|
|
err := PermissionLookupEntityRequestMetadataValidationError{ |
2005
|
|
|
field: "Depth", |
2006
|
|
|
reason: "value must be greater than or equal to 3", |
2007
|
|
|
} |
2008
|
|
|
if !all { |
2009
|
|
|
return err |
2010
|
|
|
} |
2011
|
|
|
errors = append(errors, err) |
2012
|
|
|
} |
2013
|
|
|
|
2014
|
|
|
if len(errors) > 0 { |
2015
|
|
|
return PermissionLookupEntityRequestMetadataMultiError(errors) |
2016
|
|
|
} |
2017
|
|
|
|
2018
|
|
|
return nil |
2019
|
|
|
} |
2020
|
|
|
|
2021
|
|
|
// PermissionLookupEntityRequestMetadataMultiError is an error wrapping |
2022
|
|
|
// multiple validation errors returned by |
2023
|
|
|
// PermissionLookupEntityRequestMetadata.ValidateAll() if the designated |
2024
|
|
|
// constraints aren't met. |
2025
|
|
|
type PermissionLookupEntityRequestMetadataMultiError []error |
2026
|
|
|
|
2027
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
2028
|
|
|
func (m PermissionLookupEntityRequestMetadataMultiError) Error() string { |
2029
|
|
|
var msgs []string |
2030
|
|
|
for _, err := range m { |
2031
|
|
|
msgs = append(msgs, err.Error()) |
2032
|
|
|
} |
2033
|
|
|
return strings.Join(msgs, "; ") |
2034
|
|
|
} |
2035
|
|
|
|
2036
|
|
|
// AllErrors returns a list of validation violation errors. |
2037
|
|
|
func (m PermissionLookupEntityRequestMetadataMultiError) AllErrors() []error { return m } |
2038
|
|
|
|
2039
|
|
|
// PermissionLookupEntityRequestMetadataValidationError is the validation error |
2040
|
|
|
// returned by PermissionLookupEntityRequestMetadata.Validate if the |
2041
|
|
|
// designated constraints aren't met. |
2042
|
|
|
type PermissionLookupEntityRequestMetadataValidationError struct { |
2043
|
|
|
field string |
2044
|
|
|
reason string |
2045
|
|
|
cause error |
2046
|
|
|
key bool |
2047
|
|
|
} |
2048
|
|
|
|
2049
|
|
|
// Field function returns field value. |
2050
|
|
|
func (e PermissionLookupEntityRequestMetadataValidationError) Field() string { return e.field } |
2051
|
|
|
|
2052
|
|
|
// Reason function returns reason value. |
2053
|
|
|
func (e PermissionLookupEntityRequestMetadataValidationError) Reason() string { return e.reason } |
2054
|
|
|
|
2055
|
|
|
// Cause function returns cause value. |
2056
|
|
|
func (e PermissionLookupEntityRequestMetadataValidationError) Cause() error { return e.cause } |
2057
|
|
|
|
2058
|
|
|
// Key function returns key value. |
2059
|
|
|
func (e PermissionLookupEntityRequestMetadataValidationError) Key() bool { return e.key } |
2060
|
|
|
|
2061
|
|
|
// ErrorName returns error name. |
2062
|
|
|
func (e PermissionLookupEntityRequestMetadataValidationError) ErrorName() string { |
2063
|
|
|
return "PermissionLookupEntityRequestMetadataValidationError" |
2064
|
|
|
} |
2065
|
|
|
|
2066
|
|
|
// Error satisfies the builtin error interface |
2067
|
|
|
func (e PermissionLookupEntityRequestMetadataValidationError) Error() string { |
2068
|
|
|
cause := "" |
2069
|
|
|
if e.cause != nil { |
2070
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
2071
|
|
|
} |
2072
|
|
|
|
2073
|
|
|
key := "" |
2074
|
|
|
if e.key { |
2075
|
|
|
key = "key for " |
2076
|
|
|
} |
2077
|
|
|
|
2078
|
|
|
return fmt.Sprintf( |
2079
|
|
|
"invalid %sPermissionLookupEntityRequestMetadata.%s: %s%s", |
2080
|
|
|
key, |
2081
|
|
|
e.field, |
2082
|
|
|
e.reason, |
2083
|
|
|
cause) |
2084
|
|
|
} |
2085
|
|
|
|
2086
|
|
|
var _ error = PermissionLookupEntityRequestMetadataValidationError{} |
2087
|
|
|
|
2088
|
|
|
var _ interface { |
2089
|
|
|
Field() string |
2090
|
|
|
Reason() string |
2091
|
|
|
Key() bool |
2092
|
|
|
Cause() error |
2093
|
|
|
ErrorName() string |
2094
|
|
|
} = PermissionLookupEntityRequestMetadataValidationError{} |
2095
|
|
|
|
2096
|
|
|
// Validate checks the field values on PermissionLookupEntityResponse with the |
2097
|
|
|
// rules defined in the proto definition for this message. If any rules are |
2098
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
2099
|
|
|
func (m *PermissionLookupEntityResponse) Validate() error { |
2100
|
|
|
return m.validate(false) |
2101
|
|
|
} |
2102
|
|
|
|
2103
|
|
|
// ValidateAll checks the field values on PermissionLookupEntityResponse with |
2104
|
|
|
// the rules defined in the proto definition for this message. If any rules |
2105
|
|
|
// are violated, the result is a list of violation errors wrapped in |
2106
|
|
|
// PermissionLookupEntityResponseMultiError, or nil if none found. |
2107
|
|
|
func (m *PermissionLookupEntityResponse) ValidateAll() error { |
2108
|
|
|
return m.validate(true) |
2109
|
|
|
} |
2110
|
|
|
|
2111
|
|
|
func (m *PermissionLookupEntityResponse) validate(all bool) error { |
2112
|
|
|
if m == nil { |
2113
|
|
|
return nil |
2114
|
|
|
} |
2115
|
|
|
|
2116
|
|
|
var errors []error |
2117
|
|
|
|
2118
|
|
|
// no validation rules for ContinuousToken |
2119
|
|
|
|
2120
|
|
|
if len(errors) > 0 { |
2121
|
|
|
return PermissionLookupEntityResponseMultiError(errors) |
2122
|
|
|
} |
2123
|
|
|
|
2124
|
|
|
return nil |
2125
|
|
|
} |
2126
|
|
|
|
2127
|
|
|
// PermissionLookupEntityResponseMultiError is an error wrapping multiple |
2128
|
|
|
// validation errors returned by PermissionLookupEntityResponse.ValidateAll() |
2129
|
|
|
// if the designated constraints aren't met. |
2130
|
|
|
type PermissionLookupEntityResponseMultiError []error |
2131
|
|
|
|
2132
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
2133
|
|
|
func (m PermissionLookupEntityResponseMultiError) Error() string { |
2134
|
|
|
var msgs []string |
2135
|
|
|
for _, err := range m { |
2136
|
|
|
msgs = append(msgs, err.Error()) |
2137
|
|
|
} |
2138
|
|
|
return strings.Join(msgs, "; ") |
2139
|
|
|
} |
2140
|
|
|
|
2141
|
|
|
// AllErrors returns a list of validation violation errors. |
2142
|
|
|
func (m PermissionLookupEntityResponseMultiError) AllErrors() []error { return m } |
2143
|
|
|
|
2144
|
|
|
// PermissionLookupEntityResponseValidationError is the validation error |
2145
|
|
|
// returned by PermissionLookupEntityResponse.Validate if the designated |
2146
|
|
|
// constraints aren't met. |
2147
|
|
|
type PermissionLookupEntityResponseValidationError struct { |
2148
|
|
|
field string |
2149
|
|
|
reason string |
2150
|
|
|
cause error |
2151
|
|
|
key bool |
2152
|
|
|
} |
2153
|
|
|
|
2154
|
|
|
// Field function returns field value. |
2155
|
|
|
func (e PermissionLookupEntityResponseValidationError) Field() string { return e.field } |
2156
|
|
|
|
2157
|
|
|
// Reason function returns reason value. |
2158
|
|
|
func (e PermissionLookupEntityResponseValidationError) Reason() string { return e.reason } |
2159
|
|
|
|
2160
|
|
|
// Cause function returns cause value. |
2161
|
|
|
func (e PermissionLookupEntityResponseValidationError) Cause() error { return e.cause } |
2162
|
|
|
|
2163
|
|
|
// Key function returns key value. |
2164
|
|
|
func (e PermissionLookupEntityResponseValidationError) Key() bool { return e.key } |
2165
|
|
|
|
2166
|
|
|
// ErrorName returns error name. |
2167
|
|
|
func (e PermissionLookupEntityResponseValidationError) ErrorName() string { |
2168
|
|
|
return "PermissionLookupEntityResponseValidationError" |
2169
|
|
|
} |
2170
|
|
|
|
2171
|
|
|
// Error satisfies the builtin error interface |
2172
|
|
|
func (e PermissionLookupEntityResponseValidationError) Error() string { |
2173
|
|
|
cause := "" |
2174
|
|
|
if e.cause != nil { |
2175
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
2176
|
|
|
} |
2177
|
|
|
|
2178
|
|
|
key := "" |
2179
|
|
|
if e.key { |
2180
|
|
|
key = "key for " |
2181
|
|
|
} |
2182
|
|
|
|
2183
|
|
|
return fmt.Sprintf( |
2184
|
|
|
"invalid %sPermissionLookupEntityResponse.%s: %s%s", |
2185
|
|
|
key, |
2186
|
|
|
e.field, |
2187
|
|
|
e.reason, |
2188
|
|
|
cause) |
2189
|
|
|
} |
2190
|
|
|
|
2191
|
|
|
var _ error = PermissionLookupEntityResponseValidationError{} |
2192
|
|
|
|
2193
|
|
|
var _ interface { |
2194
|
|
|
Field() string |
2195
|
|
|
Reason() string |
2196
|
|
|
Key() bool |
2197
|
|
|
Cause() error |
2198
|
|
|
ErrorName() string |
2199
|
|
|
} = PermissionLookupEntityResponseValidationError{} |
2200
|
|
|
|
2201
|
|
|
// Validate checks the field values on PermissionsLookupEntityResponse with the |
2202
|
|
|
// rules defined in the proto definition for this message. If any rules are |
2203
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
2204
|
|
|
func (m *PermissionsLookupEntityResponse) Validate() error { |
2205
|
|
|
return m.validate(false) |
2206
|
|
|
} |
2207
|
|
|
|
2208
|
|
|
// ValidateAll checks the field values on PermissionsLookupEntityResponse with |
2209
|
|
|
// the rules defined in the proto definition for this message. If any rules |
2210
|
|
|
// are violated, the result is a list of violation errors wrapped in |
2211
|
|
|
// PermissionsLookupEntityResponseMultiError, or nil if none found. |
2212
|
|
|
func (m *PermissionsLookupEntityResponse) ValidateAll() error { |
2213
|
|
|
return m.validate(true) |
2214
|
|
|
} |
2215
|
|
|
|
2216
|
|
|
func (m *PermissionsLookupEntityResponse) validate(all bool) error { |
2217
|
|
|
if m == nil { |
2218
|
|
|
return nil |
2219
|
|
|
} |
2220
|
|
|
|
2221
|
|
|
var errors []error |
2222
|
|
|
|
2223
|
|
|
{ |
2224
|
|
|
sorted_keys := make([]string, len(m.GetEntityIds())) |
2225
|
|
|
i := 0 |
2226
|
|
|
for key := range m.GetEntityIds() { |
2227
|
|
|
sorted_keys[i] = key |
2228
|
|
|
i++ |
2229
|
|
|
} |
2230
|
|
|
sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) |
2231
|
|
|
for _, key := range sorted_keys { |
2232
|
|
|
val := m.GetEntityIds()[key] |
2233
|
|
|
_ = val |
2234
|
|
|
|
2235
|
|
|
// no validation rules for EntityIds[key] |
2236
|
|
|
|
2237
|
|
|
if all { |
2238
|
|
|
switch v := interface{}(val).(type) { |
2239
|
|
|
case interface{ ValidateAll() error }: |
2240
|
|
|
if err := v.ValidateAll(); err != nil { |
2241
|
|
|
errors = append(errors, PermissionsLookupEntityResponseValidationError{ |
2242
|
|
|
field: fmt.Sprintf("EntityIds[%v]", key), |
2243
|
|
|
reason: "embedded message failed validation", |
2244
|
|
|
cause: err, |
2245
|
|
|
}) |
2246
|
|
|
} |
2247
|
|
|
case interface{ Validate() error }: |
2248
|
|
|
if err := v.Validate(); err != nil { |
2249
|
|
|
errors = append(errors, PermissionsLookupEntityResponseValidationError{ |
2250
|
|
|
field: fmt.Sprintf("EntityIds[%v]", key), |
2251
|
|
|
reason: "embedded message failed validation", |
2252
|
|
|
cause: err, |
2253
|
|
|
}) |
2254
|
|
|
} |
2255
|
|
|
} |
2256
|
|
|
} else if v, ok := interface{}(val).(interface{ Validate() error }); ok { |
2257
|
|
|
if err := v.Validate(); err != nil { |
2258
|
|
|
return PermissionsLookupEntityResponseValidationError{ |
2259
|
|
|
field: fmt.Sprintf("EntityIds[%v]", key), |
2260
|
|
|
reason: "embedded message failed validation", |
2261
|
|
|
cause: err, |
2262
|
|
|
} |
2263
|
|
|
} |
2264
|
|
|
} |
2265
|
|
|
|
2266
|
|
|
} |
2267
|
|
|
} |
2268
|
|
|
|
2269
|
|
|
// no validation rules for ContinuousToken |
2270
|
|
|
|
2271
|
|
|
if len(errors) > 0 { |
2272
|
|
|
return PermissionsLookupEntityResponseMultiError(errors) |
2273
|
|
|
} |
2274
|
|
|
|
2275
|
|
|
return nil |
2276
|
|
|
} |
2277
|
|
|
|
2278
|
|
|
// PermissionsLookupEntityResponseMultiError is an error wrapping multiple |
2279
|
|
|
// validation errors returned by PermissionsLookupEntityResponse.ValidateAll() |
2280
|
|
|
// if the designated constraints aren't met. |
2281
|
|
|
type PermissionsLookupEntityResponseMultiError []error |
2282
|
|
|
|
2283
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
2284
|
|
|
func (m PermissionsLookupEntityResponseMultiError) Error() string { |
2285
|
|
|
var msgs []string |
2286
|
|
|
for _, err := range m { |
2287
|
|
|
msgs = append(msgs, err.Error()) |
2288
|
|
|
} |
2289
|
|
|
return strings.Join(msgs, "; ") |
2290
|
|
|
} |
2291
|
|
|
|
2292
|
|
|
// AllErrors returns a list of validation violation errors. |
2293
|
|
|
func (m PermissionsLookupEntityResponseMultiError) AllErrors() []error { return m } |
2294
|
|
|
|
2295
|
|
|
// PermissionsLookupEntityResponseValidationError is the validation error |
2296
|
|
|
// returned by PermissionsLookupEntityResponse.Validate if the designated |
2297
|
|
|
// constraints aren't met. |
2298
|
|
|
type PermissionsLookupEntityResponseValidationError struct { |
2299
|
|
|
field string |
2300
|
|
|
reason string |
2301
|
|
|
cause error |
2302
|
|
|
key bool |
2303
|
|
|
} |
2304
|
|
|
|
2305
|
|
|
// Field function returns field value. |
2306
|
|
|
func (e PermissionsLookupEntityResponseValidationError) Field() string { return e.field } |
2307
|
|
|
|
2308
|
|
|
// Reason function returns reason value. |
2309
|
|
|
func (e PermissionsLookupEntityResponseValidationError) Reason() string { return e.reason } |
2310
|
|
|
|
2311
|
|
|
// Cause function returns cause value. |
2312
|
|
|
func (e PermissionsLookupEntityResponseValidationError) Cause() error { return e.cause } |
2313
|
|
|
|
2314
|
|
|
// Key function returns key value. |
2315
|
|
|
func (e PermissionsLookupEntityResponseValidationError) Key() bool { return e.key } |
2316
|
|
|
|
2317
|
|
|
// ErrorName returns error name. |
2318
|
|
|
func (e PermissionsLookupEntityResponseValidationError) ErrorName() string { |
2319
|
|
|
return "PermissionsLookupEntityResponseValidationError" |
2320
|
|
|
} |
2321
|
|
|
|
2322
|
|
|
// Error satisfies the builtin error interface |
2323
|
|
|
func (e PermissionsLookupEntityResponseValidationError) Error() string { |
2324
|
|
|
cause := "" |
2325
|
|
|
if e.cause != nil { |
2326
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
2327
|
|
|
} |
2328
|
|
|
|
2329
|
|
|
key := "" |
2330
|
|
|
if e.key { |
2331
|
|
|
key = "key for " |
2332
|
|
|
} |
2333
|
|
|
|
2334
|
|
|
return fmt.Sprintf( |
2335
|
|
|
"invalid %sPermissionsLookupEntityResponse.%s: %s%s", |
2336
|
|
|
key, |
2337
|
|
|
e.field, |
2338
|
|
|
e.reason, |
2339
|
|
|
cause) |
2340
|
|
|
} |
2341
|
|
|
|
2342
|
|
|
var _ error = PermissionsLookupEntityResponseValidationError{} |
2343
|
|
|
|
2344
|
|
|
var _ interface { |
2345
|
|
|
Field() string |
2346
|
|
|
Reason() string |
2347
|
|
|
Key() bool |
2348
|
|
|
Cause() error |
2349
|
|
|
ErrorName() string |
2350
|
|
|
} = PermissionsLookupEntityResponseValidationError{} |
2351
|
|
|
|
2352
|
|
|
// Validate checks the field values on EntityIds with the rules defined in the |
2353
|
|
|
// proto definition for this message. If any rules are violated, the first |
2354
|
|
|
// error encountered is returned, or nil if there are no violations. |
2355
|
|
|
func (m *EntityIds) Validate() error { |
2356
|
|
|
return m.validate(false) |
2357
|
|
|
} |
2358
|
|
|
|
2359
|
|
|
// ValidateAll checks the field values on EntityIds with the rules defined in |
2360
|
|
|
// the proto definition for this message. If any rules are violated, the |
2361
|
|
|
// result is a list of violation errors wrapped in EntityIdsMultiError, or nil |
2362
|
|
|
// if none found. |
2363
|
|
|
func (m *EntityIds) ValidateAll() error { |
2364
|
|
|
return m.validate(true) |
2365
|
|
|
} |
2366
|
|
|
|
2367
|
|
|
func (m *EntityIds) validate(all bool) error { |
2368
|
|
|
if m == nil { |
2369
|
|
|
return nil |
2370
|
|
|
} |
2371
|
|
|
|
2372
|
|
|
var errors []error |
2373
|
|
|
|
2374
|
|
|
if len(errors) > 0 { |
2375
|
|
|
return EntityIdsMultiError(errors) |
2376
|
|
|
} |
2377
|
|
|
|
2378
|
|
|
return nil |
2379
|
|
|
} |
2380
|
|
|
|
2381
|
|
|
// EntityIdsMultiError is an error wrapping multiple validation errors returned |
2382
|
|
|
// by EntityIds.ValidateAll() if the designated constraints aren't met. |
2383
|
|
|
type EntityIdsMultiError []error |
2384
|
|
|
|
2385
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
2386
|
|
|
func (m EntityIdsMultiError) Error() string { |
2387
|
|
|
var msgs []string |
2388
|
|
|
for _, err := range m { |
2389
|
|
|
msgs = append(msgs, err.Error()) |
2390
|
|
|
} |
2391
|
|
|
return strings.Join(msgs, "; ") |
2392
|
|
|
} |
2393
|
|
|
|
2394
|
|
|
// AllErrors returns a list of validation violation errors. |
2395
|
|
|
func (m EntityIdsMultiError) AllErrors() []error { return m } |
2396
|
|
|
|
2397
|
|
|
// EntityIdsValidationError is the validation error returned by |
2398
|
|
|
// EntityIds.Validate if the designated constraints aren't met. |
2399
|
|
|
type EntityIdsValidationError struct { |
2400
|
|
|
field string |
2401
|
|
|
reason string |
2402
|
|
|
cause error |
2403
|
|
|
key bool |
2404
|
|
|
} |
2405
|
|
|
|
2406
|
|
|
// Field function returns field value. |
2407
|
|
|
func (e EntityIdsValidationError) Field() string { return e.field } |
2408
|
|
|
|
2409
|
|
|
// Reason function returns reason value. |
2410
|
|
|
func (e EntityIdsValidationError) Reason() string { return e.reason } |
2411
|
|
|
|
2412
|
|
|
// Cause function returns cause value. |
2413
|
|
|
func (e EntityIdsValidationError) Cause() error { return e.cause } |
2414
|
|
|
|
2415
|
|
|
// Key function returns key value. |
2416
|
|
|
func (e EntityIdsValidationError) Key() bool { return e.key } |
2417
|
|
|
|
2418
|
|
|
// ErrorName returns error name. |
2419
|
|
|
func (e EntityIdsValidationError) ErrorName() string { return "EntityIdsValidationError" } |
2420
|
|
|
|
2421
|
|
|
// Error satisfies the builtin error interface |
2422
|
|
|
func (e EntityIdsValidationError) Error() string { |
2423
|
|
|
cause := "" |
2424
|
|
|
if e.cause != nil { |
2425
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
2426
|
|
|
} |
2427
|
|
|
|
2428
|
|
|
key := "" |
2429
|
|
|
if e.key { |
2430
|
|
|
key = "key for " |
2431
|
|
|
} |
2432
|
|
|
|
2433
|
|
|
return fmt.Sprintf( |
2434
|
|
|
"invalid %sEntityIds.%s: %s%s", |
2435
|
|
|
key, |
2436
|
|
|
e.field, |
2437
|
|
|
e.reason, |
2438
|
|
|
cause) |
2439
|
|
|
} |
2440
|
|
|
|
2441
|
|
|
var _ error = EntityIdsValidationError{} |
2442
|
|
|
|
2443
|
|
|
var _ interface { |
2444
|
|
|
Field() string |
2445
|
|
|
Reason() string |
2446
|
|
|
Key() bool |
2447
|
|
|
Cause() error |
2448
|
|
|
ErrorName() string |
2449
|
|
|
} = EntityIdsValidationError{} |
2450
|
|
|
|
2451
|
|
|
// Validate checks the field values on PermissionLookupEntityStreamResponse |
2452
|
|
|
// with the rules defined in the proto definition for this message. If any |
2453
|
|
|
// rules are violated, the first error encountered is returned, or nil if |
2454
|
|
|
// there are no violations. |
2455
|
|
|
func (m *PermissionLookupEntityStreamResponse) Validate() error { |
2456
|
|
|
return m.validate(false) |
2457
|
|
|
} |
2458
|
|
|
|
2459
|
|
|
// ValidateAll checks the field values on PermissionLookupEntityStreamResponse |
2460
|
|
|
// with the rules defined in the proto definition for this message. If any |
2461
|
|
|
// rules are violated, the result is a list of violation errors wrapped in |
2462
|
|
|
// PermissionLookupEntityStreamResponseMultiError, or nil if none found. |
2463
|
|
|
func (m *PermissionLookupEntityStreamResponse) ValidateAll() error { |
2464
|
|
|
return m.validate(true) |
2465
|
|
|
} |
2466
|
|
|
|
2467
|
|
|
func (m *PermissionLookupEntityStreamResponse) validate(all bool) error { |
2468
|
|
|
if m == nil { |
2469
|
|
|
return nil |
2470
|
|
|
} |
2471
|
|
|
|
2472
|
|
|
var errors []error |
2473
|
|
|
|
2474
|
|
|
// no validation rules for EntityId |
2475
|
|
|
|
2476
|
|
|
// no validation rules for ContinuousToken |
2477
|
|
|
|
2478
|
|
|
if len(errors) > 0 { |
2479
|
|
|
return PermissionLookupEntityStreamResponseMultiError(errors) |
2480
|
|
|
} |
2481
|
|
|
|
2482
|
|
|
return nil |
2483
|
|
|
} |
2484
|
|
|
|
2485
|
|
|
// PermissionLookupEntityStreamResponseMultiError is an error wrapping multiple |
2486
|
|
|
// validation errors returned by |
2487
|
|
|
// PermissionLookupEntityStreamResponse.ValidateAll() if the designated |
2488
|
|
|
// constraints aren't met. |
2489
|
|
|
type PermissionLookupEntityStreamResponseMultiError []error |
2490
|
|
|
|
2491
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
2492
|
|
|
func (m PermissionLookupEntityStreamResponseMultiError) Error() string { |
2493
|
|
|
var msgs []string |
2494
|
|
|
for _, err := range m { |
2495
|
|
|
msgs = append(msgs, err.Error()) |
2496
|
|
|
} |
2497
|
|
|
return strings.Join(msgs, "; ") |
2498
|
|
|
} |
2499
|
|
|
|
2500
|
|
|
// AllErrors returns a list of validation violation errors. |
2501
|
|
|
func (m PermissionLookupEntityStreamResponseMultiError) AllErrors() []error { return m } |
2502
|
|
|
|
2503
|
|
|
// PermissionLookupEntityStreamResponseValidationError is the validation error |
2504
|
|
|
// returned by PermissionLookupEntityStreamResponse.Validate if the designated |
2505
|
|
|
// constraints aren't met. |
2506
|
|
|
type PermissionLookupEntityStreamResponseValidationError struct { |
2507
|
|
|
field string |
2508
|
|
|
reason string |
2509
|
|
|
cause error |
2510
|
|
|
key bool |
2511
|
|
|
} |
2512
|
|
|
|
2513
|
|
|
// Field function returns field value. |
2514
|
|
|
func (e PermissionLookupEntityStreamResponseValidationError) Field() string { return e.field } |
2515
|
|
|
|
2516
|
|
|
// Reason function returns reason value. |
2517
|
|
|
func (e PermissionLookupEntityStreamResponseValidationError) Reason() string { return e.reason } |
2518
|
|
|
|
2519
|
|
|
// Cause function returns cause value. |
2520
|
|
|
func (e PermissionLookupEntityStreamResponseValidationError) Cause() error { return e.cause } |
2521
|
|
|
|
2522
|
|
|
// Key function returns key value. |
2523
|
|
|
func (e PermissionLookupEntityStreamResponseValidationError) Key() bool { return e.key } |
2524
|
|
|
|
2525
|
|
|
// ErrorName returns error name. |
2526
|
|
|
func (e PermissionLookupEntityStreamResponseValidationError) ErrorName() string { |
2527
|
|
|
return "PermissionLookupEntityStreamResponseValidationError" |
2528
|
|
|
} |
2529
|
|
|
|
2530
|
|
|
// Error satisfies the builtin error interface |
2531
|
|
|
func (e PermissionLookupEntityStreamResponseValidationError) Error() string { |
2532
|
|
|
cause := "" |
2533
|
|
|
if e.cause != nil { |
2534
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
2535
|
|
|
} |
2536
|
|
|
|
2537
|
|
|
key := "" |
2538
|
|
|
if e.key { |
2539
|
|
|
key = "key for " |
2540
|
|
|
} |
2541
|
|
|
|
2542
|
|
|
return fmt.Sprintf( |
2543
|
|
|
"invalid %sPermissionLookupEntityStreamResponse.%s: %s%s", |
2544
|
|
|
key, |
2545
|
|
|
e.field, |
2546
|
|
|
e.reason, |
2547
|
|
|
cause) |
2548
|
|
|
} |
2549
|
|
|
|
2550
|
|
|
var _ error = PermissionLookupEntityStreamResponseValidationError{} |
2551
|
|
|
|
2552
|
|
|
var _ interface { |
2553
|
|
|
Field() string |
2554
|
|
|
Reason() string |
2555
|
|
|
Key() bool |
2556
|
|
|
Cause() error |
2557
|
|
|
ErrorName() string |
2558
|
|
|
} = PermissionLookupEntityStreamResponseValidationError{} |
2559
|
|
|
|
2560
|
|
|
// Validate checks the field values on PermissionsLookupEntityStreamResponse |
2561
|
|
|
// with the rules defined in the proto definition for this message. If any |
2562
|
|
|
// rules are violated, the first error encountered is returned, or nil if |
2563
|
|
|
// there are no violations. |
2564
|
|
|
func (m *PermissionsLookupEntityStreamResponse) Validate() error { |
2565
|
|
|
return m.validate(false) |
2566
|
|
|
} |
2567
|
|
|
|
2568
|
|
|
// ValidateAll checks the field values on PermissionsLookupEntityStreamResponse |
2569
|
|
|
// with the rules defined in the proto definition for this message. If any |
2570
|
|
|
// rules are violated, the result is a list of violation errors wrapped in |
2571
|
|
|
// PermissionsLookupEntityStreamResponseMultiError, or nil if none found. |
2572
|
|
|
func (m *PermissionsLookupEntityStreamResponse) ValidateAll() error { |
2573
|
|
|
return m.validate(true) |
2574
|
|
|
} |
2575
|
|
|
|
2576
|
|
|
func (m *PermissionsLookupEntityStreamResponse) validate(all bool) error { |
2577
|
|
|
if m == nil { |
2578
|
|
|
return nil |
2579
|
|
|
} |
2580
|
|
|
|
2581
|
|
|
var errors []error |
2582
|
|
|
|
2583
|
|
|
// no validation rules for EntityId |
2584
|
|
|
|
2585
|
|
|
// no validation rules for Permission |
2586
|
|
|
|
2587
|
|
|
// no validation rules for ContinuousToken |
2588
|
|
|
|
2589
|
|
|
if len(errors) > 0 { |
2590
|
|
|
return PermissionsLookupEntityStreamResponseMultiError(errors) |
2591
|
|
|
} |
2592
|
|
|
|
2593
|
|
|
return nil |
2594
|
|
|
} |
2595
|
|
|
|
2596
|
|
|
// PermissionsLookupEntityStreamResponseMultiError is an error wrapping |
2597
|
|
|
// multiple validation errors returned by |
2598
|
|
|
// PermissionsLookupEntityStreamResponse.ValidateAll() if the designated |
2599
|
|
|
// constraints aren't met. |
2600
|
|
|
type PermissionsLookupEntityStreamResponseMultiError []error |
2601
|
|
|
|
2602
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
2603
|
|
|
func (m PermissionsLookupEntityStreamResponseMultiError) Error() string { |
2604
|
|
|
var msgs []string |
2605
|
|
|
for _, err := range m { |
2606
|
|
|
msgs = append(msgs, err.Error()) |
2607
|
|
|
} |
2608
|
|
|
return strings.Join(msgs, "; ") |
2609
|
|
|
} |
2610
|
|
|
|
2611
|
|
|
// AllErrors returns a list of validation violation errors. |
2612
|
|
|
func (m PermissionsLookupEntityStreamResponseMultiError) AllErrors() []error { return m } |
2613
|
|
|
|
2614
|
|
|
// PermissionsLookupEntityStreamResponseValidationError is the validation error |
2615
|
|
|
// returned by PermissionsLookupEntityStreamResponse.Validate if the |
2616
|
|
|
// designated constraints aren't met. |
2617
|
|
|
type PermissionsLookupEntityStreamResponseValidationError struct { |
2618
|
|
|
field string |
2619
|
|
|
reason string |
2620
|
|
|
cause error |
2621
|
|
|
key bool |
2622
|
|
|
} |
2623
|
|
|
|
2624
|
|
|
// Field function returns field value. |
2625
|
|
|
func (e PermissionsLookupEntityStreamResponseValidationError) Field() string { return e.field } |
2626
|
|
|
|
2627
|
|
|
// Reason function returns reason value. |
2628
|
|
|
func (e PermissionsLookupEntityStreamResponseValidationError) Reason() string { return e.reason } |
2629
|
|
|
|
2630
|
|
|
// Cause function returns cause value. |
2631
|
|
|
func (e PermissionsLookupEntityStreamResponseValidationError) Cause() error { return e.cause } |
2632
|
|
|
|
2633
|
|
|
// Key function returns key value. |
2634
|
|
|
func (e PermissionsLookupEntityStreamResponseValidationError) Key() bool { return e.key } |
2635
|
|
|
|
2636
|
|
|
// ErrorName returns error name. |
2637
|
|
|
func (e PermissionsLookupEntityStreamResponseValidationError) ErrorName() string { |
2638
|
|
|
return "PermissionsLookupEntityStreamResponseValidationError" |
2639
|
|
|
} |
2640
|
|
|
|
2641
|
|
|
// Error satisfies the builtin error interface |
2642
|
|
|
func (e PermissionsLookupEntityStreamResponseValidationError) Error() string { |
2643
|
|
|
cause := "" |
2644
|
|
|
if e.cause != nil { |
2645
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
2646
|
|
|
} |
2647
|
|
|
|
2648
|
|
|
key := "" |
2649
|
|
|
if e.key { |
2650
|
|
|
key = "key for " |
2651
|
|
|
} |
2652
|
|
|
|
2653
|
|
|
return fmt.Sprintf( |
2654
|
|
|
"invalid %sPermissionsLookupEntityStreamResponse.%s: %s%s", |
2655
|
|
|
key, |
2656
|
|
|
e.field, |
2657
|
|
|
e.reason, |
2658
|
|
|
cause) |
2659
|
|
|
} |
2660
|
|
|
|
2661
|
|
|
var _ error = PermissionsLookupEntityStreamResponseValidationError{} |
2662
|
|
|
|
2663
|
|
|
var _ interface { |
2664
|
|
|
Field() string |
2665
|
|
|
Reason() string |
2666
|
|
|
Key() bool |
2667
|
|
|
Cause() error |
2668
|
|
|
ErrorName() string |
2669
|
|
|
} = PermissionsLookupEntityStreamResponseValidationError{} |
2670
|
|
|
|
2671
|
|
|
// Validate checks the field values on PermissionEntityFilterRequest with the |
2672
|
|
|
// rules defined in the proto definition for this message. If any rules are |
2673
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
2674
|
|
|
func (m *PermissionEntityFilterRequest) Validate() error { |
2675
|
|
|
return m.validate(false) |
2676
|
|
|
} |
2677
|
|
|
|
2678
|
|
|
// ValidateAll checks the field values on PermissionEntityFilterRequest with |
2679
|
|
|
// the rules defined in the proto definition for this message. If any rules |
2680
|
|
|
// are violated, the result is a list of violation errors wrapped in |
2681
|
|
|
// PermissionEntityFilterRequestMultiError, or nil if none found. |
2682
|
|
|
func (m *PermissionEntityFilterRequest) ValidateAll() error { |
2683
|
|
|
return m.validate(true) |
2684
|
|
|
} |
2685
|
|
|
|
2686
|
|
|
func (m *PermissionEntityFilterRequest) validate(all bool) error { |
2687
|
|
|
if m == nil { |
2688
|
|
|
return nil |
2689
|
|
|
} |
2690
|
|
|
|
2691
|
|
|
var errors []error |
2692
|
|
|
|
2693
|
|
|
if len(m.GetTenantId()) > 128 { |
2694
|
|
|
err := PermissionEntityFilterRequestValidationError{ |
2695
|
|
|
field: "TenantId", |
2696
|
|
|
reason: "value length must be at most 128 bytes", |
2697
|
|
|
} |
2698
|
|
|
if !all { |
2699
|
|
|
return err |
2700
|
|
|
} |
2701
|
|
|
errors = append(errors, err) |
2702
|
|
|
} |
2703
|
|
|
|
2704
|
|
|
if !_PermissionEntityFilterRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
2705
|
|
|
err := PermissionEntityFilterRequestValidationError{ |
2706
|
|
|
field: "TenantId", |
2707
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
2708
|
|
|
} |
2709
|
|
|
if !all { |
2710
|
|
|
return err |
2711
|
|
|
} |
2712
|
|
|
errors = append(errors, err) |
2713
|
|
|
} |
2714
|
|
|
|
2715
|
|
|
if m.GetMetadata() == nil { |
2716
|
|
|
err := PermissionEntityFilterRequestValidationError{ |
2717
|
|
|
field: "Metadata", |
2718
|
|
|
reason: "value is required", |
2719
|
|
|
} |
2720
|
|
|
if !all { |
2721
|
|
|
return err |
2722
|
|
|
} |
2723
|
|
|
errors = append(errors, err) |
2724
|
|
|
} |
2725
|
|
|
|
2726
|
|
|
if all { |
2727
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
2728
|
|
|
case interface{ ValidateAll() error }: |
2729
|
|
|
if err := v.ValidateAll(); err != nil { |
2730
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2731
|
|
|
field: "Metadata", |
2732
|
|
|
reason: "embedded message failed validation", |
2733
|
|
|
cause: err, |
2734
|
|
|
}) |
2735
|
|
|
} |
2736
|
|
|
case interface{ Validate() error }: |
2737
|
|
|
if err := v.Validate(); err != nil { |
2738
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2739
|
|
|
field: "Metadata", |
2740
|
|
|
reason: "embedded message failed validation", |
2741
|
|
|
cause: err, |
2742
|
|
|
}) |
2743
|
|
|
} |
2744
|
|
|
} |
2745
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
2746
|
|
|
if err := v.Validate(); err != nil { |
2747
|
|
|
return PermissionEntityFilterRequestValidationError{ |
2748
|
|
|
field: "Metadata", |
2749
|
|
|
reason: "embedded message failed validation", |
2750
|
|
|
cause: err, |
2751
|
|
|
} |
2752
|
|
|
} |
2753
|
|
|
} |
2754
|
|
|
|
2755
|
|
|
for idx, item := range m.GetEntrances() { |
2756
|
|
|
_, _ = idx, item |
2757
|
|
|
|
2758
|
|
|
if all { |
2759
|
|
|
switch v := interface{}(item).(type) { |
2760
|
|
|
case interface{ ValidateAll() error }: |
2761
|
|
|
if err := v.ValidateAll(); err != nil { |
2762
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2763
|
|
|
field: fmt.Sprintf("Entrances[%v]", idx), |
2764
|
|
|
reason: "embedded message failed validation", |
2765
|
|
|
cause: err, |
2766
|
|
|
}) |
2767
|
|
|
} |
2768
|
|
|
case interface{ Validate() error }: |
2769
|
|
|
if err := v.Validate(); err != nil { |
2770
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2771
|
|
|
field: fmt.Sprintf("Entrances[%v]", idx), |
2772
|
|
|
reason: "embedded message failed validation", |
2773
|
|
|
cause: err, |
2774
|
|
|
}) |
2775
|
|
|
} |
2776
|
|
|
} |
2777
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
2778
|
|
|
if err := v.Validate(); err != nil { |
2779
|
|
|
return PermissionEntityFilterRequestValidationError{ |
2780
|
|
|
field: fmt.Sprintf("Entrances[%v]", idx), |
2781
|
|
|
reason: "embedded message failed validation", |
2782
|
|
|
cause: err, |
2783
|
|
|
} |
2784
|
|
|
} |
2785
|
|
|
} |
2786
|
|
|
|
2787
|
|
|
} |
2788
|
|
|
|
2789
|
|
|
if all { |
2790
|
|
|
switch v := interface{}(m.GetSubject()).(type) { |
2791
|
|
|
case interface{ ValidateAll() error }: |
2792
|
|
|
if err := v.ValidateAll(); err != nil { |
2793
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2794
|
|
|
field: "Subject", |
2795
|
|
|
reason: "embedded message failed validation", |
2796
|
|
|
cause: err, |
2797
|
|
|
}) |
2798
|
|
|
} |
2799
|
|
|
case interface{ Validate() error }: |
2800
|
|
|
if err := v.Validate(); err != nil { |
2801
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2802
|
|
|
field: "Subject", |
2803
|
|
|
reason: "embedded message failed validation", |
2804
|
|
|
cause: err, |
2805
|
|
|
}) |
2806
|
|
|
} |
2807
|
|
|
} |
2808
|
|
|
} else if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok { |
2809
|
|
|
if err := v.Validate(); err != nil { |
2810
|
|
|
return PermissionEntityFilterRequestValidationError{ |
2811
|
|
|
field: "Subject", |
2812
|
|
|
reason: "embedded message failed validation", |
2813
|
|
|
cause: err, |
2814
|
|
|
} |
2815
|
|
|
} |
2816
|
|
|
} |
2817
|
|
|
|
2818
|
|
|
if all { |
2819
|
|
|
switch v := interface{}(m.GetContext()).(type) { |
2820
|
|
|
case interface{ ValidateAll() error }: |
2821
|
|
|
if err := v.ValidateAll(); err != nil { |
2822
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2823
|
|
|
field: "Context", |
2824
|
|
|
reason: "embedded message failed validation", |
2825
|
|
|
cause: err, |
2826
|
|
|
}) |
2827
|
|
|
} |
2828
|
|
|
case interface{ Validate() error }: |
2829
|
|
|
if err := v.Validate(); err != nil { |
2830
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2831
|
|
|
field: "Context", |
2832
|
|
|
reason: "embedded message failed validation", |
2833
|
|
|
cause: err, |
2834
|
|
|
}) |
2835
|
|
|
} |
2836
|
|
|
} |
2837
|
|
|
} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok { |
2838
|
|
|
if err := v.Validate(); err != nil { |
2839
|
|
|
return PermissionEntityFilterRequestValidationError{ |
2840
|
|
|
field: "Context", |
2841
|
|
|
reason: "embedded message failed validation", |
2842
|
|
|
cause: err, |
2843
|
|
|
} |
2844
|
|
|
} |
2845
|
|
|
} |
2846
|
|
|
|
2847
|
|
|
{ |
2848
|
|
|
sorted_keys := make([]string, len(m.GetScope())) |
2849
|
|
|
i := 0 |
2850
|
|
|
for key := range m.GetScope() { |
2851
|
|
|
sorted_keys[i] = key |
2852
|
|
|
i++ |
2853
|
|
|
} |
2854
|
|
|
sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) |
2855
|
|
|
for _, key := range sorted_keys { |
2856
|
|
|
val := m.GetScope()[key] |
2857
|
|
|
_ = val |
2858
|
|
|
|
2859
|
|
|
// no validation rules for Scope[key] |
2860
|
|
|
|
2861
|
|
|
if all { |
2862
|
|
|
switch v := interface{}(val).(type) { |
2863
|
|
|
case interface{ ValidateAll() error }: |
2864
|
|
|
if err := v.ValidateAll(); err != nil { |
2865
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2866
|
|
|
field: fmt.Sprintf("Scope[%v]", key), |
2867
|
|
|
reason: "embedded message failed validation", |
2868
|
|
|
cause: err, |
2869
|
|
|
}) |
2870
|
|
|
} |
2871
|
|
|
case interface{ Validate() error }: |
2872
|
|
|
if err := v.Validate(); err != nil { |
2873
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2874
|
|
|
field: fmt.Sprintf("Scope[%v]", key), |
2875
|
|
|
reason: "embedded message failed validation", |
2876
|
|
|
cause: err, |
2877
|
|
|
}) |
2878
|
|
|
} |
2879
|
|
|
} |
2880
|
|
|
} else if v, ok := interface{}(val).(interface{ Validate() error }); ok { |
2881
|
|
|
if err := v.Validate(); err != nil { |
2882
|
|
|
return PermissionEntityFilterRequestValidationError{ |
2883
|
|
|
field: fmt.Sprintf("Scope[%v]", key), |
2884
|
|
|
reason: "embedded message failed validation", |
2885
|
|
|
cause: err, |
2886
|
|
|
} |
2887
|
|
|
} |
2888
|
|
|
} |
2889
|
|
|
|
2890
|
|
|
} |
2891
|
|
|
} |
2892
|
|
|
|
2893
|
|
|
if m.GetCursor() != "" { |
2894
|
|
|
|
2895
|
|
|
} |
2896
|
|
|
|
2897
|
|
|
if len(errors) > 0 { |
2898
|
|
|
return PermissionEntityFilterRequestMultiError(errors) |
2899
|
|
|
} |
2900
|
|
|
|
2901
|
|
|
return nil |
2902
|
|
|
} |
2903
|
|
|
|
2904
|
|
|
// PermissionEntityFilterRequestMultiError is an error wrapping multiple |
2905
|
|
|
// validation errors returned by PermissionEntityFilterRequest.ValidateAll() |
2906
|
|
|
// if the designated constraints aren't met. |
2907
|
|
|
type PermissionEntityFilterRequestMultiError []error |
2908
|
|
|
|
2909
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
2910
|
|
|
func (m PermissionEntityFilterRequestMultiError) Error() string { |
2911
|
|
|
var msgs []string |
2912
|
|
|
for _, err := range m { |
2913
|
|
|
msgs = append(msgs, err.Error()) |
2914
|
|
|
} |
2915
|
|
|
return strings.Join(msgs, "; ") |
2916
|
|
|
} |
2917
|
|
|
|
2918
|
|
|
// AllErrors returns a list of validation violation errors. |
2919
|
|
|
func (m PermissionEntityFilterRequestMultiError) AllErrors() []error { return m } |
2920
|
|
|
|
2921
|
|
|
// PermissionEntityFilterRequestValidationError is the validation error |
2922
|
|
|
// returned by PermissionEntityFilterRequest.Validate if the designated |
2923
|
|
|
// constraints aren't met. |
2924
|
|
|
type PermissionEntityFilterRequestValidationError struct { |
2925
|
|
|
field string |
2926
|
|
|
reason string |
2927
|
|
|
cause error |
2928
|
|
|
key bool |
2929
|
|
|
} |
2930
|
|
|
|
2931
|
|
|
// Field function returns field value. |
2932
|
|
|
func (e PermissionEntityFilterRequestValidationError) Field() string { return e.field } |
2933
|
|
|
|
2934
|
|
|
// Reason function returns reason value. |
2935
|
|
|
func (e PermissionEntityFilterRequestValidationError) Reason() string { return e.reason } |
2936
|
|
|
|
2937
|
|
|
// Cause function returns cause value. |
2938
|
|
|
func (e PermissionEntityFilterRequestValidationError) Cause() error { return e.cause } |
2939
|
|
|
|
2940
|
|
|
// Key function returns key value. |
2941
|
|
|
func (e PermissionEntityFilterRequestValidationError) Key() bool { return e.key } |
2942
|
|
|
|
2943
|
|
|
// ErrorName returns error name. |
2944
|
|
|
func (e PermissionEntityFilterRequestValidationError) ErrorName() string { |
2945
|
|
|
return "PermissionEntityFilterRequestValidationError" |
2946
|
|
|
} |
2947
|
|
|
|
2948
|
|
|
// Error satisfies the builtin error interface |
2949
|
|
|
func (e PermissionEntityFilterRequestValidationError) Error() string { |
2950
|
|
|
cause := "" |
2951
|
|
|
if e.cause != nil { |
2952
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
2953
|
|
|
} |
2954
|
|
|
|
2955
|
|
|
key := "" |
2956
|
|
|
if e.key { |
2957
|
|
|
key = "key for " |
2958
|
|
|
} |
2959
|
|
|
|
2960
|
|
|
return fmt.Sprintf( |
2961
|
|
|
"invalid %sPermissionEntityFilterRequest.%s: %s%s", |
2962
|
|
|
key, |
2963
|
|
|
e.field, |
2964
|
|
|
e.reason, |
2965
|
|
|
cause) |
2966
|
|
|
} |
2967
|
|
|
|
2968
|
|
|
var _ error = PermissionEntityFilterRequestValidationError{} |
2969
|
|
|
|
2970
|
|
|
var _ interface { |
2971
|
|
|
Field() string |
2972
|
|
|
Reason() string |
2973
|
|
|
Key() bool |
2974
|
|
|
Cause() error |
2975
|
|
|
ErrorName() string |
2976
|
|
|
} = PermissionEntityFilterRequestValidationError{} |
2977
|
|
|
|
2978
|
|
|
var _PermissionEntityFilterRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
2979
|
|
|
|
2980
|
|
|
// Validate checks the field values on PermissionEntityFilterRequestMetadata |
2981
|
|
|
// with the rules defined in the proto definition for this message. If any |
2982
|
|
|
// rules are violated, the first error encountered is returned, or nil if |
2983
|
|
|
// there are no violations. |
2984
|
|
|
func (m *PermissionEntityFilterRequestMetadata) Validate() error { |
2985
|
|
|
return m.validate(false) |
2986
|
|
|
} |
2987
|
|
|
|
2988
|
|
|
// ValidateAll checks the field values on PermissionEntityFilterRequestMetadata |
2989
|
|
|
// with the rules defined in the proto definition for this message. If any |
2990
|
|
|
// rules are violated, the result is a list of violation errors wrapped in |
2991
|
|
|
// PermissionEntityFilterRequestMetadataMultiError, or nil if none found. |
2992
|
|
|
func (m *PermissionEntityFilterRequestMetadata) ValidateAll() error { |
2993
|
|
|
return m.validate(true) |
2994
|
|
|
} |
2995
|
|
|
|
2996
|
|
|
func (m *PermissionEntityFilterRequestMetadata) validate(all bool) error { |
2997
|
|
|
if m == nil { |
2998
|
|
|
return nil |
2999
|
|
|
} |
3000
|
|
|
|
3001
|
|
|
var errors []error |
3002
|
|
|
|
3003
|
|
|
// no validation rules for SchemaVersion |
3004
|
|
|
|
3005
|
|
|
// no validation rules for SnapToken |
3006
|
|
|
|
3007
|
|
|
if m.GetDepth() < 3 { |
3008
|
|
|
err := PermissionEntityFilterRequestMetadataValidationError{ |
3009
|
|
|
field: "Depth", |
3010
|
|
|
reason: "value must be greater than or equal to 3", |
3011
|
|
|
} |
3012
|
|
|
if !all { |
3013
|
|
|
return err |
3014
|
|
|
} |
3015
|
|
|
errors = append(errors, err) |
3016
|
|
|
} |
3017
|
|
|
|
3018
|
|
|
if len(errors) > 0 { |
3019
|
|
|
return PermissionEntityFilterRequestMetadataMultiError(errors) |
3020
|
|
|
} |
3021
|
|
|
|
3022
|
|
|
return nil |
3023
|
|
|
} |
3024
|
|
|
|
3025
|
|
|
// PermissionEntityFilterRequestMetadataMultiError is an error wrapping |
3026
|
|
|
// multiple validation errors returned by |
3027
|
|
|
// PermissionEntityFilterRequestMetadata.ValidateAll() if the designated |
3028
|
|
|
// constraints aren't met. |
3029
|
|
|
type PermissionEntityFilterRequestMetadataMultiError []error |
3030
|
|
|
|
3031
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
3032
|
|
|
func (m PermissionEntityFilterRequestMetadataMultiError) Error() string { |
3033
|
|
|
var msgs []string |
3034
|
|
|
for _, err := range m { |
3035
|
|
|
msgs = append(msgs, err.Error()) |
3036
|
|
|
} |
3037
|
|
|
return strings.Join(msgs, "; ") |
3038
|
|
|
} |
3039
|
|
|
|
3040
|
|
|
// AllErrors returns a list of validation violation errors. |
3041
|
|
|
func (m PermissionEntityFilterRequestMetadataMultiError) AllErrors() []error { return m } |
3042
|
|
|
|
3043
|
|
|
// PermissionEntityFilterRequestMetadataValidationError is the validation error |
3044
|
|
|
// returned by PermissionEntityFilterRequestMetadata.Validate if the |
3045
|
|
|
// designated constraints aren't met. |
3046
|
|
|
type PermissionEntityFilterRequestMetadataValidationError struct { |
3047
|
|
|
field string |
3048
|
|
|
reason string |
3049
|
|
|
cause error |
3050
|
|
|
key bool |
3051
|
|
|
} |
3052
|
|
|
|
3053
|
|
|
// Field function returns field value. |
3054
|
|
|
func (e PermissionEntityFilterRequestMetadataValidationError) Field() string { return e.field } |
3055
|
|
|
|
3056
|
|
|
// Reason function returns reason value. |
3057
|
|
|
func (e PermissionEntityFilterRequestMetadataValidationError) Reason() string { return e.reason } |
3058
|
|
|
|
3059
|
|
|
// Cause function returns cause value. |
3060
|
|
|
func (e PermissionEntityFilterRequestMetadataValidationError) Cause() error { return e.cause } |
3061
|
|
|
|
3062
|
|
|
// Key function returns key value. |
3063
|
|
|
func (e PermissionEntityFilterRequestMetadataValidationError) Key() bool { return e.key } |
3064
|
|
|
|
3065
|
|
|
// ErrorName returns error name. |
3066
|
|
|
func (e PermissionEntityFilterRequestMetadataValidationError) ErrorName() string { |
3067
|
|
|
return "PermissionEntityFilterRequestMetadataValidationError" |
3068
|
|
|
} |
3069
|
|
|
|
3070
|
|
|
// Error satisfies the builtin error interface |
3071
|
|
|
func (e PermissionEntityFilterRequestMetadataValidationError) Error() string { |
3072
|
|
|
cause := "" |
3073
|
|
|
if e.cause != nil { |
3074
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
3075
|
|
|
} |
3076
|
|
|
|
3077
|
|
|
key := "" |
3078
|
|
|
if e.key { |
3079
|
|
|
key = "key for " |
3080
|
|
|
} |
3081
|
|
|
|
3082
|
|
|
return fmt.Sprintf( |
3083
|
|
|
"invalid %sPermissionEntityFilterRequestMetadata.%s: %s%s", |
3084
|
|
|
key, |
3085
|
|
|
e.field, |
3086
|
|
|
e.reason, |
3087
|
|
|
cause) |
3088
|
|
|
} |
3089
|
|
|
|
3090
|
|
|
var _ error = PermissionEntityFilterRequestMetadataValidationError{} |
3091
|
|
|
|
3092
|
|
|
var _ interface { |
3093
|
|
|
Field() string |
3094
|
|
|
Reason() string |
3095
|
|
|
Key() bool |
3096
|
|
|
Cause() error |
3097
|
|
|
ErrorName() string |
3098
|
|
|
} = PermissionEntityFilterRequestMetadataValidationError{} |
3099
|
|
|
|
3100
|
|
|
// Validate checks the field values on PermissionLookupSubjectRequest with the |
3101
|
|
|
// rules defined in the proto definition for this message. If any rules are |
3102
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
3103
|
|
|
func (m *PermissionLookupSubjectRequest) Validate() error { |
3104
|
|
|
return m.validate(false) |
3105
|
|
|
} |
3106
|
|
|
|
3107
|
|
|
// ValidateAll checks the field values on PermissionLookupSubjectRequest with |
3108
|
|
|
// the rules defined in the proto definition for this message. If any rules |
3109
|
|
|
// are violated, the result is a list of violation errors wrapped in |
3110
|
|
|
// PermissionLookupSubjectRequestMultiError, or nil if none found. |
3111
|
|
|
func (m *PermissionLookupSubjectRequest) ValidateAll() error { |
3112
|
|
|
return m.validate(true) |
3113
|
|
|
} |
3114
|
|
|
|
3115
|
|
|
func (m *PermissionLookupSubjectRequest) validate(all bool) error { |
3116
|
|
|
if m == nil { |
3117
|
|
|
return nil |
3118
|
|
|
} |
3119
|
|
|
|
3120
|
|
|
var errors []error |
3121
|
|
|
|
3122
|
|
|
if len(m.GetTenantId()) > 128 { |
3123
|
|
|
err := PermissionLookupSubjectRequestValidationError{ |
3124
|
|
|
field: "TenantId", |
3125
|
|
|
reason: "value length must be at most 128 bytes", |
3126
|
|
|
} |
3127
|
|
|
if !all { |
3128
|
|
|
return err |
3129
|
|
|
} |
3130
|
|
|
errors = append(errors, err) |
3131
|
|
|
} |
3132
|
|
|
|
3133
|
|
|
if !_PermissionLookupSubjectRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
3134
|
|
|
err := PermissionLookupSubjectRequestValidationError{ |
3135
|
|
|
field: "TenantId", |
3136
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
3137
|
|
|
} |
3138
|
|
|
if !all { |
3139
|
|
|
return err |
3140
|
|
|
} |
3141
|
|
|
errors = append(errors, err) |
3142
|
|
|
} |
3143
|
|
|
|
3144
|
|
|
if m.GetMetadata() == nil { |
3145
|
|
|
err := PermissionLookupSubjectRequestValidationError{ |
3146
|
|
|
field: "Metadata", |
3147
|
|
|
reason: "value is required", |
3148
|
|
|
} |
3149
|
|
|
if !all { |
3150
|
|
|
return err |
3151
|
|
|
} |
3152
|
|
|
errors = append(errors, err) |
3153
|
|
|
} |
3154
|
|
|
|
3155
|
|
|
if all { |
3156
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
3157
|
|
|
case interface{ ValidateAll() error }: |
3158
|
|
|
if err := v.ValidateAll(); err != nil { |
3159
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
3160
|
|
|
field: "Metadata", |
3161
|
|
|
reason: "embedded message failed validation", |
3162
|
|
|
cause: err, |
3163
|
|
|
}) |
3164
|
|
|
} |
3165
|
|
|
case interface{ Validate() error }: |
3166
|
|
|
if err := v.Validate(); err != nil { |
3167
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
3168
|
|
|
field: "Metadata", |
3169
|
|
|
reason: "embedded message failed validation", |
3170
|
|
|
cause: err, |
3171
|
|
|
}) |
3172
|
|
|
} |
3173
|
|
|
} |
3174
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
3175
|
|
|
if err := v.Validate(); err != nil { |
3176
|
|
|
return PermissionLookupSubjectRequestValidationError{ |
3177
|
|
|
field: "Metadata", |
3178
|
|
|
reason: "embedded message failed validation", |
3179
|
|
|
cause: err, |
3180
|
|
|
} |
3181
|
|
|
} |
3182
|
|
|
} |
3183
|
|
|
|
3184
|
|
|
if m.GetEntity() == nil { |
3185
|
|
|
err := PermissionLookupSubjectRequestValidationError{ |
3186
|
|
|
field: "Entity", |
3187
|
|
|
reason: "value is required", |
3188
|
|
|
} |
3189
|
|
|
if !all { |
3190
|
|
|
return err |
3191
|
|
|
} |
3192
|
|
|
errors = append(errors, err) |
3193
|
|
|
} |
3194
|
|
|
|
3195
|
|
|
if all { |
3196
|
|
|
switch v := interface{}(m.GetEntity()).(type) { |
3197
|
|
|
case interface{ ValidateAll() error }: |
3198
|
|
|
if err := v.ValidateAll(); err != nil { |
3199
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
3200
|
|
|
field: "Entity", |
3201
|
|
|
reason: "embedded message failed validation", |
3202
|
|
|
cause: err, |
3203
|
|
|
}) |
3204
|
|
|
} |
3205
|
|
|
case interface{ Validate() error }: |
3206
|
|
|
if err := v.Validate(); err != nil { |
3207
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
3208
|
|
|
field: "Entity", |
3209
|
|
|
reason: "embedded message failed validation", |
3210
|
|
|
cause: err, |
3211
|
|
|
}) |
3212
|
|
|
} |
3213
|
|
|
} |
3214
|
|
|
} else if v, ok := interface{}(m.GetEntity()).(interface{ Validate() error }); ok { |
3215
|
|
|
if err := v.Validate(); err != nil { |
3216
|
|
|
return PermissionLookupSubjectRequestValidationError{ |
3217
|
|
|
field: "Entity", |
3218
|
|
|
reason: "embedded message failed validation", |
3219
|
|
|
cause: err, |
3220
|
|
|
} |
3221
|
|
|
} |
3222
|
|
|
} |
3223
|
|
|
|
3224
|
|
|
if len(m.GetPermission()) > 64 { |
3225
|
|
|
err := PermissionLookupSubjectRequestValidationError{ |
3226
|
|
|
field: "Permission", |
3227
|
|
|
reason: "value length must be at most 64 bytes", |
3228
|
|
|
} |
3229
|
|
|
if !all { |
3230
|
|
|
return err |
3231
|
|
|
} |
3232
|
|
|
errors = append(errors, err) |
3233
|
|
|
} |
3234
|
|
|
|
3235
|
|
|
if !_PermissionLookupSubjectRequest_Permission_Pattern.MatchString(m.GetPermission()) { |
3236
|
|
|
err := PermissionLookupSubjectRequestValidationError{ |
3237
|
|
|
field: "Permission", |
3238
|
|
|
reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"", |
3239
|
|
|
} |
3240
|
|
|
if !all { |
3241
|
|
|
return err |
3242
|
|
|
} |
3243
|
|
|
errors = append(errors, err) |
3244
|
|
|
} |
3245
|
|
|
|
3246
|
|
|
if m.GetSubjectReference() == nil { |
3247
|
|
|
err := PermissionLookupSubjectRequestValidationError{ |
3248
|
|
|
field: "SubjectReference", |
3249
|
|
|
reason: "value is required", |
3250
|
|
|
} |
3251
|
|
|
if !all { |
3252
|
|
|
return err |
3253
|
|
|
} |
3254
|
|
|
errors = append(errors, err) |
3255
|
|
|
} |
3256
|
|
|
|
3257
|
|
|
if all { |
3258
|
|
|
switch v := interface{}(m.GetSubjectReference()).(type) { |
3259
|
|
|
case interface{ ValidateAll() error }: |
3260
|
|
|
if err := v.ValidateAll(); err != nil { |
3261
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
3262
|
|
|
field: "SubjectReference", |
3263
|
|
|
reason: "embedded message failed validation", |
3264
|
|
|
cause: err, |
3265
|
|
|
}) |
3266
|
|
|
} |
3267
|
|
|
case interface{ Validate() error }: |
3268
|
|
|
if err := v.Validate(); err != nil { |
3269
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
3270
|
|
|
field: "SubjectReference", |
3271
|
|
|
reason: "embedded message failed validation", |
3272
|
|
|
cause: err, |
3273
|
|
|
}) |
3274
|
|
|
} |
3275
|
|
|
} |
3276
|
|
|
} else if v, ok := interface{}(m.GetSubjectReference()).(interface{ Validate() error }); ok { |
3277
|
|
|
if err := v.Validate(); err != nil { |
3278
|
|
|
return PermissionLookupSubjectRequestValidationError{ |
3279
|
|
|
field: "SubjectReference", |
3280
|
|
|
reason: "embedded message failed validation", |
3281
|
|
|
cause: err, |
3282
|
|
|
} |
3283
|
|
|
} |
3284
|
|
|
} |
3285
|
|
|
|
3286
|
|
|
if all { |
3287
|
|
|
switch v := interface{}(m.GetContext()).(type) { |
3288
|
|
|
case interface{ ValidateAll() error }: |
3289
|
|
|
if err := v.ValidateAll(); err != nil { |
3290
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
3291
|
|
|
field: "Context", |
3292
|
|
|
reason: "embedded message failed validation", |
3293
|
|
|
cause: err, |
3294
|
|
|
}) |
3295
|
|
|
} |
3296
|
|
|
case interface{ Validate() error }: |
3297
|
|
|
if err := v.Validate(); err != nil { |
3298
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
3299
|
|
|
field: "Context", |
3300
|
|
|
reason: "embedded message failed validation", |
3301
|
|
|
cause: err, |
3302
|
|
|
}) |
3303
|
|
|
} |
3304
|
|
|
} |
3305
|
|
|
} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok { |
3306
|
|
|
if err := v.Validate(); err != nil { |
3307
|
|
|
return PermissionLookupSubjectRequestValidationError{ |
3308
|
|
|
field: "Context", |
3309
|
|
|
reason: "embedded message failed validation", |
3310
|
|
|
cause: err, |
3311
|
|
|
} |
3312
|
|
|
} |
3313
|
|
|
} |
3314
|
|
|
|
3315
|
|
|
if m.GetPageSize() != 0 { |
3316
|
|
|
|
3317
|
|
|
if m.GetPageSize() < 1 { |
3318
|
|
|
err := PermissionLookupSubjectRequestValidationError{ |
3319
|
|
|
field: "PageSize", |
3320
|
|
|
reason: "value must be greater than or equal to 1", |
3321
|
|
|
} |
3322
|
|
|
if !all { |
3323
|
|
|
return err |
3324
|
|
|
} |
3325
|
|
|
errors = append(errors, err) |
3326
|
|
|
} |
3327
|
|
|
|
3328
|
|
|
} |
3329
|
|
|
|
3330
|
|
|
if m.GetContinuousToken() != "" { |
3331
|
|
|
|
3332
|
|
|
} |
3333
|
|
|
|
3334
|
|
|
if len(errors) > 0 { |
3335
|
|
|
return PermissionLookupSubjectRequestMultiError(errors) |
3336
|
|
|
} |
3337
|
|
|
|
3338
|
|
|
return nil |
3339
|
|
|
} |
3340
|
|
|
|
3341
|
|
|
// PermissionLookupSubjectRequestMultiError is an error wrapping multiple |
3342
|
|
|
// validation errors returned by PermissionLookupSubjectRequest.ValidateAll() |
3343
|
|
|
// if the designated constraints aren't met. |
3344
|
|
|
type PermissionLookupSubjectRequestMultiError []error |
3345
|
|
|
|
3346
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
3347
|
|
|
func (m PermissionLookupSubjectRequestMultiError) Error() string { |
3348
|
|
|
var msgs []string |
3349
|
|
|
for _, err := range m { |
3350
|
|
|
msgs = append(msgs, err.Error()) |
3351
|
|
|
} |
3352
|
|
|
return strings.Join(msgs, "; ") |
3353
|
|
|
} |
3354
|
|
|
|
3355
|
|
|
// AllErrors returns a list of validation violation errors. |
3356
|
|
|
func (m PermissionLookupSubjectRequestMultiError) AllErrors() []error { return m } |
3357
|
|
|
|
3358
|
|
|
// PermissionLookupSubjectRequestValidationError is the validation error |
3359
|
|
|
// returned by PermissionLookupSubjectRequest.Validate if the designated |
3360
|
|
|
// constraints aren't met. |
3361
|
|
|
type PermissionLookupSubjectRequestValidationError struct { |
3362
|
|
|
field string |
3363
|
|
|
reason string |
3364
|
|
|
cause error |
3365
|
|
|
key bool |
3366
|
|
|
} |
3367
|
|
|
|
3368
|
|
|
// Field function returns field value. |
3369
|
|
|
func (e PermissionLookupSubjectRequestValidationError) Field() string { return e.field } |
3370
|
|
|
|
3371
|
|
|
// Reason function returns reason value. |
3372
|
|
|
func (e PermissionLookupSubjectRequestValidationError) Reason() string { return e.reason } |
3373
|
|
|
|
3374
|
|
|
// Cause function returns cause value. |
3375
|
|
|
func (e PermissionLookupSubjectRequestValidationError) Cause() error { return e.cause } |
3376
|
|
|
|
3377
|
|
|
// Key function returns key value. |
3378
|
|
|
func (e PermissionLookupSubjectRequestValidationError) Key() bool { return e.key } |
3379
|
|
|
|
3380
|
|
|
// ErrorName returns error name. |
3381
|
|
|
func (e PermissionLookupSubjectRequestValidationError) ErrorName() string { |
3382
|
|
|
return "PermissionLookupSubjectRequestValidationError" |
3383
|
|
|
} |
3384
|
|
|
|
3385
|
|
|
// Error satisfies the builtin error interface |
3386
|
|
|
func (e PermissionLookupSubjectRequestValidationError) Error() string { |
3387
|
|
|
cause := "" |
3388
|
|
|
if e.cause != nil { |
3389
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
3390
|
|
|
} |
3391
|
|
|
|
3392
|
|
|
key := "" |
3393
|
|
|
if e.key { |
3394
|
|
|
key = "key for " |
3395
|
|
|
} |
3396
|
|
|
|
3397
|
|
|
return fmt.Sprintf( |
3398
|
|
|
"invalid %sPermissionLookupSubjectRequest.%s: %s%s", |
3399
|
|
|
key, |
3400
|
|
|
e.field, |
3401
|
|
|
e.reason, |
3402
|
|
|
cause) |
3403
|
|
|
} |
3404
|
|
|
|
3405
|
|
|
var _ error = PermissionLookupSubjectRequestValidationError{} |
3406
|
|
|
|
3407
|
|
|
var _ interface { |
3408
|
|
|
Field() string |
3409
|
|
|
Reason() string |
3410
|
|
|
Key() bool |
3411
|
|
|
Cause() error |
3412
|
|
|
ErrorName() string |
3413
|
|
|
} = PermissionLookupSubjectRequestValidationError{} |
3414
|
|
|
|
3415
|
|
|
var _PermissionLookupSubjectRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
3416
|
|
|
|
3417
|
|
|
var _PermissionLookupSubjectRequest_Permission_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$") |
3418
|
|
|
|
3419
|
|
|
// Validate checks the field values on PermissionLookupSubjectRequestMetadata |
3420
|
|
|
// with the rules defined in the proto definition for this message. If any |
3421
|
|
|
// rules are violated, the first error encountered is returned, or nil if |
3422
|
|
|
// there are no violations. |
3423
|
|
|
func (m *PermissionLookupSubjectRequestMetadata) Validate() error { |
3424
|
|
|
return m.validate(false) |
3425
|
|
|
} |
3426
|
|
|
|
3427
|
|
|
// ValidateAll checks the field values on |
3428
|
|
|
// PermissionLookupSubjectRequestMetadata with the rules defined in the proto |
3429
|
|
|
// definition for this message. If any rules are violated, the result is a |
3430
|
|
|
// list of violation errors wrapped in |
3431
|
|
|
// PermissionLookupSubjectRequestMetadataMultiError, or nil if none found. |
3432
|
|
|
func (m *PermissionLookupSubjectRequestMetadata) ValidateAll() error { |
3433
|
|
|
return m.validate(true) |
3434
|
|
|
} |
3435
|
|
|
|
3436
|
|
|
func (m *PermissionLookupSubjectRequestMetadata) validate(all bool) error { |
3437
|
|
|
if m == nil { |
3438
|
|
|
return nil |
3439
|
|
|
} |
3440
|
|
|
|
3441
|
|
|
var errors []error |
3442
|
|
|
|
3443
|
|
|
// no validation rules for SchemaVersion |
3444
|
|
|
|
3445
|
|
|
// no validation rules for SnapToken |
3446
|
|
|
|
3447
|
|
|
if m.GetDepth() < 3 { |
3448
|
|
|
err := PermissionLookupSubjectRequestMetadataValidationError{ |
3449
|
|
|
field: "Depth", |
3450
|
|
|
reason: "value must be greater than or equal to 3", |
3451
|
|
|
} |
3452
|
|
|
if !all { |
3453
|
|
|
return err |
3454
|
|
|
} |
3455
|
|
|
errors = append(errors, err) |
3456
|
|
|
} |
3457
|
|
|
|
3458
|
|
|
if len(errors) > 0 { |
3459
|
|
|
return PermissionLookupSubjectRequestMetadataMultiError(errors) |
3460
|
|
|
} |
3461
|
|
|
|
3462
|
|
|
return nil |
3463
|
|
|
} |
3464
|
|
|
|
3465
|
|
|
// PermissionLookupSubjectRequestMetadataMultiError is an error wrapping |
3466
|
|
|
// multiple validation errors returned by |
3467
|
|
|
// PermissionLookupSubjectRequestMetadata.ValidateAll() if the designated |
3468
|
|
|
// constraints aren't met. |
3469
|
|
|
type PermissionLookupSubjectRequestMetadataMultiError []error |
3470
|
|
|
|
3471
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
3472
|
|
|
func (m PermissionLookupSubjectRequestMetadataMultiError) Error() string { |
3473
|
|
|
var msgs []string |
3474
|
|
|
for _, err := range m { |
3475
|
|
|
msgs = append(msgs, err.Error()) |
3476
|
|
|
} |
3477
|
|
|
return strings.Join(msgs, "; ") |
3478
|
|
|
} |
3479
|
|
|
|
3480
|
|
|
// AllErrors returns a list of validation violation errors. |
3481
|
|
|
func (m PermissionLookupSubjectRequestMetadataMultiError) AllErrors() []error { return m } |
3482
|
|
|
|
3483
|
|
|
// PermissionLookupSubjectRequestMetadataValidationError is the validation |
3484
|
|
|
// error returned by PermissionLookupSubjectRequestMetadata.Validate if the |
3485
|
|
|
// designated constraints aren't met. |
3486
|
|
|
type PermissionLookupSubjectRequestMetadataValidationError struct { |
3487
|
|
|
field string |
3488
|
|
|
reason string |
3489
|
|
|
cause error |
3490
|
|
|
key bool |
3491
|
|
|
} |
3492
|
|
|
|
3493
|
|
|
// Field function returns field value. |
3494
|
|
|
func (e PermissionLookupSubjectRequestMetadataValidationError) Field() string { return e.field } |
3495
|
|
|
|
3496
|
|
|
// Reason function returns reason value. |
3497
|
|
|
func (e PermissionLookupSubjectRequestMetadataValidationError) Reason() string { return e.reason } |
3498
|
|
|
|
3499
|
|
|
// Cause function returns cause value. |
3500
|
|
|
func (e PermissionLookupSubjectRequestMetadataValidationError) Cause() error { return e.cause } |
3501
|
|
|
|
3502
|
|
|
// Key function returns key value. |
3503
|
|
|
func (e PermissionLookupSubjectRequestMetadataValidationError) Key() bool { return e.key } |
3504
|
|
|
|
3505
|
|
|
// ErrorName returns error name. |
3506
|
|
|
func (e PermissionLookupSubjectRequestMetadataValidationError) ErrorName() string { |
3507
|
|
|
return "PermissionLookupSubjectRequestMetadataValidationError" |
3508
|
|
|
} |
3509
|
|
|
|
3510
|
|
|
// Error satisfies the builtin error interface |
3511
|
|
|
func (e PermissionLookupSubjectRequestMetadataValidationError) Error() string { |
3512
|
|
|
cause := "" |
3513
|
|
|
if e.cause != nil { |
3514
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
3515
|
|
|
} |
3516
|
|
|
|
3517
|
|
|
key := "" |
3518
|
|
|
if e.key { |
3519
|
|
|
key = "key for " |
3520
|
|
|
} |
3521
|
|
|
|
3522
|
|
|
return fmt.Sprintf( |
3523
|
|
|
"invalid %sPermissionLookupSubjectRequestMetadata.%s: %s%s", |
3524
|
|
|
key, |
3525
|
|
|
e.field, |
3526
|
|
|
e.reason, |
3527
|
|
|
cause) |
3528
|
|
|
} |
3529
|
|
|
|
3530
|
|
|
var _ error = PermissionLookupSubjectRequestMetadataValidationError{} |
3531
|
|
|
|
3532
|
|
|
var _ interface { |
3533
|
|
|
Field() string |
3534
|
|
|
Reason() string |
3535
|
|
|
Key() bool |
3536
|
|
|
Cause() error |
3537
|
|
|
ErrorName() string |
3538
|
|
|
} = PermissionLookupSubjectRequestMetadataValidationError{} |
3539
|
|
|
|
3540
|
|
|
// Validate checks the field values on PermissionLookupSubjectResponse with the |
3541
|
|
|
// rules defined in the proto definition for this message. If any rules are |
3542
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
3543
|
|
|
func (m *PermissionLookupSubjectResponse) Validate() error { |
3544
|
|
|
return m.validate(false) |
3545
|
|
|
} |
3546
|
|
|
|
3547
|
|
|
// ValidateAll checks the field values on PermissionLookupSubjectResponse with |
3548
|
|
|
// the rules defined in the proto definition for this message. If any rules |
3549
|
|
|
// are violated, the result is a list of violation errors wrapped in |
3550
|
|
|
// PermissionLookupSubjectResponseMultiError, or nil if none found. |
3551
|
|
|
func (m *PermissionLookupSubjectResponse) ValidateAll() error { |
3552
|
|
|
return m.validate(true) |
3553
|
|
|
} |
3554
|
|
|
|
3555
|
|
|
func (m *PermissionLookupSubjectResponse) validate(all bool) error { |
3556
|
|
|
if m == nil { |
3557
|
|
|
return nil |
3558
|
|
|
} |
3559
|
|
|
|
3560
|
|
|
var errors []error |
3561
|
|
|
|
3562
|
|
|
// no validation rules for ContinuousToken |
3563
|
|
|
|
3564
|
|
|
if len(errors) > 0 { |
3565
|
|
|
return PermissionLookupSubjectResponseMultiError(errors) |
3566
|
|
|
} |
3567
|
|
|
|
3568
|
|
|
return nil |
3569
|
|
|
} |
3570
|
|
|
|
3571
|
|
|
// PermissionLookupSubjectResponseMultiError is an error wrapping multiple |
3572
|
|
|
// validation errors returned by PermissionLookupSubjectResponse.ValidateAll() |
3573
|
|
|
// if the designated constraints aren't met. |
3574
|
|
|
type PermissionLookupSubjectResponseMultiError []error |
3575
|
|
|
|
3576
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
3577
|
|
|
func (m PermissionLookupSubjectResponseMultiError) Error() string { |
3578
|
|
|
var msgs []string |
3579
|
|
|
for _, err := range m { |
3580
|
|
|
msgs = append(msgs, err.Error()) |
3581
|
|
|
} |
3582
|
|
|
return strings.Join(msgs, "; ") |
3583
|
|
|
} |
3584
|
|
|
|
3585
|
|
|
// AllErrors returns a list of validation violation errors. |
3586
|
|
|
func (m PermissionLookupSubjectResponseMultiError) AllErrors() []error { return m } |
3587
|
|
|
|
3588
|
|
|
// PermissionLookupSubjectResponseValidationError is the validation error |
3589
|
|
|
// returned by PermissionLookupSubjectResponse.Validate if the designated |
3590
|
|
|
// constraints aren't met. |
3591
|
|
|
type PermissionLookupSubjectResponseValidationError struct { |
3592
|
|
|
field string |
3593
|
|
|
reason string |
3594
|
|
|
cause error |
3595
|
|
|
key bool |
3596
|
|
|
} |
3597
|
|
|
|
3598
|
|
|
// Field function returns field value. |
3599
|
|
|
func (e PermissionLookupSubjectResponseValidationError) Field() string { return e.field } |
3600
|
|
|
|
3601
|
|
|
// Reason function returns reason value. |
3602
|
|
|
func (e PermissionLookupSubjectResponseValidationError) Reason() string { return e.reason } |
3603
|
|
|
|
3604
|
|
|
// Cause function returns cause value. |
3605
|
|
|
func (e PermissionLookupSubjectResponseValidationError) Cause() error { return e.cause } |
3606
|
|
|
|
3607
|
|
|
// Key function returns key value. |
3608
|
|
|
func (e PermissionLookupSubjectResponseValidationError) Key() bool { return e.key } |
3609
|
|
|
|
3610
|
|
|
// ErrorName returns error name. |
3611
|
|
|
func (e PermissionLookupSubjectResponseValidationError) ErrorName() string { |
3612
|
|
|
return "PermissionLookupSubjectResponseValidationError" |
3613
|
|
|
} |
3614
|
|
|
|
3615
|
|
|
// Error satisfies the builtin error interface |
3616
|
|
|
func (e PermissionLookupSubjectResponseValidationError) Error() string { |
3617
|
|
|
cause := "" |
3618
|
|
|
if e.cause != nil { |
3619
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
3620
|
|
|
} |
3621
|
|
|
|
3622
|
|
|
key := "" |
3623
|
|
|
if e.key { |
3624
|
|
|
key = "key for " |
3625
|
|
|
} |
3626
|
|
|
|
3627
|
|
|
return fmt.Sprintf( |
3628
|
|
|
"invalid %sPermissionLookupSubjectResponse.%s: %s%s", |
3629
|
|
|
key, |
3630
|
|
|
e.field, |
3631
|
|
|
e.reason, |
3632
|
|
|
cause) |
3633
|
|
|
} |
3634
|
|
|
|
3635
|
|
|
var _ error = PermissionLookupSubjectResponseValidationError{} |
3636
|
|
|
|
3637
|
|
|
var _ interface { |
3638
|
|
|
Field() string |
3639
|
|
|
Reason() string |
3640
|
|
|
Key() bool |
3641
|
|
|
Cause() error |
3642
|
|
|
ErrorName() string |
3643
|
|
|
} = PermissionLookupSubjectResponseValidationError{} |
3644
|
|
|
|
3645
|
|
|
// Validate checks the field values on PermissionSubjectPermissionRequest with |
3646
|
|
|
// the rules defined in the proto definition for this message. If any rules |
3647
|
|
|
// are violated, the first error encountered is returned, or nil if there are |
3648
|
|
|
// no violations. |
3649
|
|
|
func (m *PermissionSubjectPermissionRequest) Validate() error { |
3650
|
|
|
return m.validate(false) |
3651
|
|
|
} |
3652
|
|
|
|
3653
|
|
|
// ValidateAll checks the field values on PermissionSubjectPermissionRequest |
3654
|
|
|
// with the rules defined in the proto definition for this message. If any |
3655
|
|
|
// rules are violated, the result is a list of violation errors wrapped in |
3656
|
|
|
// PermissionSubjectPermissionRequestMultiError, or nil if none found. |
3657
|
|
|
func (m *PermissionSubjectPermissionRequest) ValidateAll() error { |
3658
|
|
|
return m.validate(true) |
3659
|
|
|
} |
3660
|
|
|
|
3661
|
|
|
func (m *PermissionSubjectPermissionRequest) validate(all bool) error { |
3662
|
|
|
if m == nil { |
3663
|
|
|
return nil |
3664
|
|
|
} |
3665
|
|
|
|
3666
|
|
|
var errors []error |
3667
|
|
|
|
3668
|
|
|
if len(m.GetTenantId()) > 128 { |
3669
|
|
|
err := PermissionSubjectPermissionRequestValidationError{ |
3670
|
|
|
field: "TenantId", |
3671
|
|
|
reason: "value length must be at most 128 bytes", |
3672
|
|
|
} |
3673
|
|
|
if !all { |
3674
|
|
|
return err |
3675
|
|
|
} |
3676
|
|
|
errors = append(errors, err) |
3677
|
|
|
} |
3678
|
|
|
|
3679
|
|
|
if !_PermissionSubjectPermissionRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
3680
|
|
|
err := PermissionSubjectPermissionRequestValidationError{ |
3681
|
|
|
field: "TenantId", |
3682
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
3683
|
|
|
} |
3684
|
|
|
if !all { |
3685
|
|
|
return err |
3686
|
|
|
} |
3687
|
|
|
errors = append(errors, err) |
3688
|
|
|
} |
3689
|
|
|
|
3690
|
|
|
if m.GetMetadata() == nil { |
3691
|
|
|
err := PermissionSubjectPermissionRequestValidationError{ |
3692
|
|
|
field: "Metadata", |
3693
|
|
|
reason: "value is required", |
3694
|
|
|
} |
3695
|
|
|
if !all { |
3696
|
|
|
return err |
3697
|
|
|
} |
3698
|
|
|
errors = append(errors, err) |
3699
|
|
|
} |
3700
|
|
|
|
3701
|
|
|
if all { |
3702
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
3703
|
|
|
case interface{ ValidateAll() error }: |
3704
|
|
|
if err := v.ValidateAll(); err != nil { |
3705
|
|
|
errors = append(errors, PermissionSubjectPermissionRequestValidationError{ |
3706
|
|
|
field: "Metadata", |
3707
|
|
|
reason: "embedded message failed validation", |
3708
|
|
|
cause: err, |
3709
|
|
|
}) |
3710
|
|
|
} |
3711
|
|
|
case interface{ Validate() error }: |
3712
|
|
|
if err := v.Validate(); err != nil { |
3713
|
|
|
errors = append(errors, PermissionSubjectPermissionRequestValidationError{ |
3714
|
|
|
field: "Metadata", |
3715
|
|
|
reason: "embedded message failed validation", |
3716
|
|
|
cause: err, |
3717
|
|
|
}) |
3718
|
|
|
} |
3719
|
|
|
} |
3720
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
3721
|
|
|
if err := v.Validate(); err != nil { |
3722
|
|
|
return PermissionSubjectPermissionRequestValidationError{ |
3723
|
|
|
field: "Metadata", |
3724
|
|
|
reason: "embedded message failed validation", |
3725
|
|
|
cause: err, |
3726
|
|
|
} |
3727
|
|
|
} |
3728
|
|
|
} |
3729
|
|
|
|
3730
|
|
|
if m.GetEntity() == nil { |
3731
|
|
|
err := PermissionSubjectPermissionRequestValidationError{ |
3732
|
|
|
field: "Entity", |
3733
|
|
|
reason: "value is required", |
3734
|
|
|
} |
3735
|
|
|
if !all { |
3736
|
|
|
return err |
3737
|
|
|
} |
3738
|
|
|
errors = append(errors, err) |
3739
|
|
|
} |
3740
|
|
|
|
3741
|
|
|
if all { |
3742
|
|
|
switch v := interface{}(m.GetEntity()).(type) { |
3743
|
|
|
case interface{ ValidateAll() error }: |
3744
|
|
|
if err := v.ValidateAll(); err != nil { |
3745
|
|
|
errors = append(errors, PermissionSubjectPermissionRequestValidationError{ |
3746
|
|
|
field: "Entity", |
3747
|
|
|
reason: "embedded message failed validation", |
3748
|
|
|
cause: err, |
3749
|
|
|
}) |
3750
|
|
|
} |
3751
|
|
|
case interface{ Validate() error }: |
3752
|
|
|
if err := v.Validate(); err != nil { |
3753
|
|
|
errors = append(errors, PermissionSubjectPermissionRequestValidationError{ |
3754
|
|
|
field: "Entity", |
3755
|
|
|
reason: "embedded message failed validation", |
3756
|
|
|
cause: err, |
3757
|
|
|
}) |
3758
|
|
|
} |
3759
|
|
|
} |
3760
|
|
|
} else if v, ok := interface{}(m.GetEntity()).(interface{ Validate() error }); ok { |
3761
|
|
|
if err := v.Validate(); err != nil { |
3762
|
|
|
return PermissionSubjectPermissionRequestValidationError{ |
3763
|
|
|
field: "Entity", |
3764
|
|
|
reason: "embedded message failed validation", |
3765
|
|
|
cause: err, |
3766
|
|
|
} |
3767
|
|
|
} |
3768
|
|
|
} |
3769
|
|
|
|
3770
|
|
|
if m.GetSubject() == nil { |
3771
|
|
|
err := PermissionSubjectPermissionRequestValidationError{ |
3772
|
|
|
field: "Subject", |
3773
|
|
|
reason: "value is required", |
3774
|
|
|
} |
3775
|
|
|
if !all { |
3776
|
|
|
return err |
3777
|
|
|
} |
3778
|
|
|
errors = append(errors, err) |
3779
|
|
|
} |
3780
|
|
|
|
3781
|
|
|
if all { |
3782
|
|
|
switch v := interface{}(m.GetSubject()).(type) { |
3783
|
|
|
case interface{ ValidateAll() error }: |
3784
|
|
|
if err := v.ValidateAll(); err != nil { |
3785
|
|
|
errors = append(errors, PermissionSubjectPermissionRequestValidationError{ |
3786
|
|
|
field: "Subject", |
3787
|
|
|
reason: "embedded message failed validation", |
3788
|
|
|
cause: err, |
3789
|
|
|
}) |
3790
|
|
|
} |
3791
|
|
|
case interface{ Validate() error }: |
3792
|
|
|
if err := v.Validate(); err != nil { |
3793
|
|
|
errors = append(errors, PermissionSubjectPermissionRequestValidationError{ |
3794
|
|
|
field: "Subject", |
3795
|
|
|
reason: "embedded message failed validation", |
3796
|
|
|
cause: err, |
3797
|
|
|
}) |
3798
|
|
|
} |
3799
|
|
|
} |
3800
|
|
|
} else if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok { |
3801
|
|
|
if err := v.Validate(); err != nil { |
3802
|
|
|
return PermissionSubjectPermissionRequestValidationError{ |
3803
|
|
|
field: "Subject", |
3804
|
|
|
reason: "embedded message failed validation", |
3805
|
|
|
cause: err, |
3806
|
|
|
} |
3807
|
|
|
} |
3808
|
|
|
} |
3809
|
|
|
|
3810
|
|
|
if all { |
3811
|
|
|
switch v := interface{}(m.GetContext()).(type) { |
3812
|
|
|
case interface{ ValidateAll() error }: |
3813
|
|
|
if err := v.ValidateAll(); err != nil { |
3814
|
|
|
errors = append(errors, PermissionSubjectPermissionRequestValidationError{ |
3815
|
|
|
field: "Context", |
3816
|
|
|
reason: "embedded message failed validation", |
3817
|
|
|
cause: err, |
3818
|
|
|
}) |
3819
|
|
|
} |
3820
|
|
|
case interface{ Validate() error }: |
3821
|
|
|
if err := v.Validate(); err != nil { |
3822
|
|
|
errors = append(errors, PermissionSubjectPermissionRequestValidationError{ |
3823
|
|
|
field: "Context", |
3824
|
|
|
reason: "embedded message failed validation", |
3825
|
|
|
cause: err, |
3826
|
|
|
}) |
3827
|
|
|
} |
3828
|
|
|
} |
3829
|
|
|
} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok { |
3830
|
|
|
if err := v.Validate(); err != nil { |
3831
|
|
|
return PermissionSubjectPermissionRequestValidationError{ |
3832
|
|
|
field: "Context", |
3833
|
|
|
reason: "embedded message failed validation", |
3834
|
|
|
cause: err, |
3835
|
|
|
} |
3836
|
|
|
} |
3837
|
|
|
} |
3838
|
|
|
|
3839
|
|
|
if len(errors) > 0 { |
3840
|
|
|
return PermissionSubjectPermissionRequestMultiError(errors) |
3841
|
|
|
} |
3842
|
|
|
|
3843
|
|
|
return nil |
3844
|
|
|
} |
3845
|
|
|
|
3846
|
|
|
// PermissionSubjectPermissionRequestMultiError is an error wrapping multiple |
3847
|
|
|
// validation errors returned by |
3848
|
|
|
// PermissionSubjectPermissionRequest.ValidateAll() if the designated |
3849
|
|
|
// constraints aren't met. |
3850
|
|
|
type PermissionSubjectPermissionRequestMultiError []error |
3851
|
|
|
|
3852
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
3853
|
|
|
func (m PermissionSubjectPermissionRequestMultiError) Error() string { |
3854
|
|
|
var msgs []string |
3855
|
|
|
for _, err := range m { |
3856
|
|
|
msgs = append(msgs, err.Error()) |
3857
|
|
|
} |
3858
|
|
|
return strings.Join(msgs, "; ") |
3859
|
|
|
} |
3860
|
|
|
|
3861
|
|
|
// AllErrors returns a list of validation violation errors. |
3862
|
|
|
func (m PermissionSubjectPermissionRequestMultiError) AllErrors() []error { return m } |
3863
|
|
|
|
3864
|
|
|
// PermissionSubjectPermissionRequestValidationError is the validation error |
3865
|
|
|
// returned by PermissionSubjectPermissionRequest.Validate if the designated |
3866
|
|
|
// constraints aren't met. |
3867
|
|
|
type PermissionSubjectPermissionRequestValidationError struct { |
3868
|
|
|
field string |
3869
|
|
|
reason string |
3870
|
|
|
cause error |
3871
|
|
|
key bool |
3872
|
|
|
} |
3873
|
|
|
|
3874
|
|
|
// Field function returns field value. |
3875
|
|
|
func (e PermissionSubjectPermissionRequestValidationError) Field() string { return e.field } |
3876
|
|
|
|
3877
|
|
|
// Reason function returns reason value. |
3878
|
|
|
func (e PermissionSubjectPermissionRequestValidationError) Reason() string { return e.reason } |
3879
|
|
|
|
3880
|
|
|
// Cause function returns cause value. |
3881
|
|
|
func (e PermissionSubjectPermissionRequestValidationError) Cause() error { return e.cause } |
3882
|
|
|
|
3883
|
|
|
// Key function returns key value. |
3884
|
|
|
func (e PermissionSubjectPermissionRequestValidationError) Key() bool { return e.key } |
3885
|
|
|
|
3886
|
|
|
// ErrorName returns error name. |
3887
|
|
|
func (e PermissionSubjectPermissionRequestValidationError) ErrorName() string { |
3888
|
|
|
return "PermissionSubjectPermissionRequestValidationError" |
3889
|
|
|
} |
3890
|
|
|
|
3891
|
|
|
// Error satisfies the builtin error interface |
3892
|
|
|
func (e PermissionSubjectPermissionRequestValidationError) 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 %sPermissionSubjectPermissionRequest.%s: %s%s", |
3905
|
|
|
key, |
3906
|
|
|
e.field, |
3907
|
|
|
e.reason, |
3908
|
|
|
cause) |
3909
|
|
|
} |
3910
|
|
|
|
3911
|
|
|
var _ error = PermissionSubjectPermissionRequestValidationError{} |
3912
|
|
|
|
3913
|
|
|
var _ interface { |
3914
|
|
|
Field() string |
3915
|
|
|
Reason() string |
3916
|
|
|
Key() bool |
3917
|
|
|
Cause() error |
3918
|
|
|
ErrorName() string |
3919
|
|
|
} = PermissionSubjectPermissionRequestValidationError{} |
3920
|
|
|
|
3921
|
|
|
var _PermissionSubjectPermissionRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
3922
|
|
|
|
3923
|
|
|
// Validate checks the field values on |
3924
|
|
|
// PermissionSubjectPermissionRequestMetadata with the rules defined in the |
3925
|
|
|
// proto definition for this message. If any rules are violated, the first |
3926
|
|
|
// error encountered is returned, or nil if there are no violations. |
3927
|
|
|
func (m *PermissionSubjectPermissionRequestMetadata) Validate() error { |
3928
|
|
|
return m.validate(false) |
3929
|
|
|
} |
3930
|
|
|
|
3931
|
|
|
// ValidateAll checks the field values on |
3932
|
|
|
// PermissionSubjectPermissionRequestMetadata with the rules defined in the |
3933
|
|
|
// proto definition for this message. If any rules are violated, the result is |
3934
|
|
|
// a list of violation errors wrapped in |
3935
|
|
|
// PermissionSubjectPermissionRequestMetadataMultiError, or nil if none found. |
3936
|
|
|
func (m *PermissionSubjectPermissionRequestMetadata) ValidateAll() error { |
3937
|
|
|
return m.validate(true) |
3938
|
|
|
} |
3939
|
|
|
|
3940
|
|
|
func (m *PermissionSubjectPermissionRequestMetadata) validate(all bool) error { |
3941
|
|
|
if m == nil { |
3942
|
|
|
return nil |
3943
|
|
|
} |
3944
|
|
|
|
3945
|
|
|
var errors []error |
3946
|
|
|
|
3947
|
|
|
// no validation rules for SchemaVersion |
3948
|
|
|
|
3949
|
|
|
// no validation rules for SnapToken |
3950
|
|
|
|
3951
|
|
|
// no validation rules for OnlyPermission |
3952
|
|
|
|
3953
|
|
|
if m.GetDepth() < 3 { |
3954
|
|
|
err := PermissionSubjectPermissionRequestMetadataValidationError{ |
3955
|
|
|
field: "Depth", |
3956
|
|
|
reason: "value must be greater than or equal to 3", |
3957
|
|
|
} |
3958
|
|
|
if !all { |
3959
|
|
|
return err |
3960
|
|
|
} |
3961
|
|
|
errors = append(errors, err) |
3962
|
|
|
} |
3963
|
|
|
|
3964
|
|
|
if len(errors) > 0 { |
3965
|
|
|
return PermissionSubjectPermissionRequestMetadataMultiError(errors) |
3966
|
|
|
} |
3967
|
|
|
|
3968
|
|
|
return nil |
3969
|
|
|
} |
3970
|
|
|
|
3971
|
|
|
// PermissionSubjectPermissionRequestMetadataMultiError is an error wrapping |
3972
|
|
|
// multiple validation errors returned by |
3973
|
|
|
// PermissionSubjectPermissionRequestMetadata.ValidateAll() if the designated |
3974
|
|
|
// constraints aren't met. |
3975
|
|
|
type PermissionSubjectPermissionRequestMetadataMultiError []error |
3976
|
|
|
|
3977
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
3978
|
|
|
func (m PermissionSubjectPermissionRequestMetadataMultiError) Error() string { |
3979
|
|
|
var msgs []string |
3980
|
|
|
for _, err := range m { |
3981
|
|
|
msgs = append(msgs, err.Error()) |
3982
|
|
|
} |
3983
|
|
|
return strings.Join(msgs, "; ") |
3984
|
|
|
} |
3985
|
|
|
|
3986
|
|
|
// AllErrors returns a list of validation violation errors. |
3987
|
|
|
func (m PermissionSubjectPermissionRequestMetadataMultiError) AllErrors() []error { return m } |
3988
|
|
|
|
3989
|
|
|
// PermissionSubjectPermissionRequestMetadataValidationError is the validation |
3990
|
|
|
// error returned by PermissionSubjectPermissionRequestMetadata.Validate if |
3991
|
|
|
// the designated constraints aren't met. |
3992
|
|
|
type PermissionSubjectPermissionRequestMetadataValidationError struct { |
3993
|
|
|
field string |
3994
|
|
|
reason string |
3995
|
|
|
cause error |
3996
|
|
|
key bool |
3997
|
|
|
} |
3998
|
|
|
|
3999
|
|
|
// Field function returns field value. |
4000
|
|
|
func (e PermissionSubjectPermissionRequestMetadataValidationError) Field() string { return e.field } |
4001
|
|
|
|
4002
|
|
|
// Reason function returns reason value. |
4003
|
|
|
func (e PermissionSubjectPermissionRequestMetadataValidationError) Reason() string { return e.reason } |
4004
|
|
|
|
4005
|
|
|
// Cause function returns cause value. |
4006
|
|
|
func (e PermissionSubjectPermissionRequestMetadataValidationError) Cause() error { return e.cause } |
4007
|
|
|
|
4008
|
|
|
// Key function returns key value. |
4009
|
|
|
func (e PermissionSubjectPermissionRequestMetadataValidationError) Key() bool { return e.key } |
4010
|
|
|
|
4011
|
|
|
// ErrorName returns error name. |
4012
|
|
|
func (e PermissionSubjectPermissionRequestMetadataValidationError) ErrorName() string { |
4013
|
|
|
return "PermissionSubjectPermissionRequestMetadataValidationError" |
4014
|
|
|
} |
4015
|
|
|
|
4016
|
|
|
// Error satisfies the builtin error interface |
4017
|
|
|
func (e PermissionSubjectPermissionRequestMetadataValidationError) Error() string { |
4018
|
|
|
cause := "" |
4019
|
|
|
if e.cause != nil { |
4020
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
4021
|
|
|
} |
4022
|
|
|
|
4023
|
|
|
key := "" |
4024
|
|
|
if e.key { |
4025
|
|
|
key = "key for " |
4026
|
|
|
} |
4027
|
|
|
|
4028
|
|
|
return fmt.Sprintf( |
4029
|
|
|
"invalid %sPermissionSubjectPermissionRequestMetadata.%s: %s%s", |
4030
|
|
|
key, |
4031
|
|
|
e.field, |
4032
|
|
|
e.reason, |
4033
|
|
|
cause) |
4034
|
|
|
} |
4035
|
|
|
|
4036
|
|
|
var _ error = PermissionSubjectPermissionRequestMetadataValidationError{} |
4037
|
|
|
|
4038
|
|
|
var _ interface { |
4039
|
|
|
Field() string |
4040
|
|
|
Reason() string |
4041
|
|
|
Key() bool |
4042
|
|
|
Cause() error |
4043
|
|
|
ErrorName() string |
4044
|
|
|
} = PermissionSubjectPermissionRequestMetadataValidationError{} |
4045
|
|
|
|
4046
|
|
|
// Validate checks the field values on PermissionSubjectPermissionResponse with |
4047
|
|
|
// the rules defined in the proto definition for this message. If any rules |
4048
|
|
|
// are violated, the first error encountered is returned, or nil if there are |
4049
|
|
|
// no violations. |
4050
|
|
|
func (m *PermissionSubjectPermissionResponse) Validate() error { |
4051
|
|
|
return m.validate(false) |
4052
|
|
|
} |
4053
|
|
|
|
4054
|
|
|
// ValidateAll checks the field values on PermissionSubjectPermissionResponse |
4055
|
|
|
// with the rules defined in the proto definition for this message. If any |
4056
|
|
|
// rules are violated, the result is a list of violation errors wrapped in |
4057
|
|
|
// PermissionSubjectPermissionResponseMultiError, or nil if none found. |
4058
|
|
|
func (m *PermissionSubjectPermissionResponse) ValidateAll() error { |
4059
|
|
|
return m.validate(true) |
4060
|
|
|
} |
4061
|
|
|
|
4062
|
|
|
func (m *PermissionSubjectPermissionResponse) validate(all bool) error { |
4063
|
|
|
if m == nil { |
4064
|
|
|
return nil |
4065
|
|
|
} |
4066
|
|
|
|
4067
|
|
|
var errors []error |
4068
|
|
|
|
4069
|
|
|
// no validation rules for Results |
4070
|
|
|
|
4071
|
|
|
if len(errors) > 0 { |
4072
|
|
|
return PermissionSubjectPermissionResponseMultiError(errors) |
4073
|
|
|
} |
4074
|
|
|
|
4075
|
|
|
return nil |
4076
|
|
|
} |
4077
|
|
|
|
4078
|
|
|
// PermissionSubjectPermissionResponseMultiError is an error wrapping multiple |
4079
|
|
|
// validation errors returned by |
4080
|
|
|
// PermissionSubjectPermissionResponse.ValidateAll() if the designated |
4081
|
|
|
// constraints aren't met. |
4082
|
|
|
type PermissionSubjectPermissionResponseMultiError []error |
4083
|
|
|
|
4084
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
4085
|
|
|
func (m PermissionSubjectPermissionResponseMultiError) Error() string { |
4086
|
|
|
var msgs []string |
4087
|
|
|
for _, err := range m { |
4088
|
|
|
msgs = append(msgs, err.Error()) |
4089
|
|
|
} |
4090
|
|
|
return strings.Join(msgs, "; ") |
4091
|
|
|
} |
4092
|
|
|
|
4093
|
|
|
// AllErrors returns a list of validation violation errors. |
4094
|
|
|
func (m PermissionSubjectPermissionResponseMultiError) AllErrors() []error { return m } |
4095
|
|
|
|
4096
|
|
|
// PermissionSubjectPermissionResponseValidationError is the validation error |
4097
|
|
|
// returned by PermissionSubjectPermissionResponse.Validate if the designated |
4098
|
|
|
// constraints aren't met. |
4099
|
|
|
type PermissionSubjectPermissionResponseValidationError struct { |
4100
|
|
|
field string |
4101
|
|
|
reason string |
4102
|
|
|
cause error |
4103
|
|
|
key bool |
4104
|
|
|
} |
4105
|
|
|
|
4106
|
|
|
// Field function returns field value. |
4107
|
|
|
func (e PermissionSubjectPermissionResponseValidationError) Field() string { return e.field } |
4108
|
|
|
|
4109
|
|
|
// Reason function returns reason value. |
4110
|
|
|
func (e PermissionSubjectPermissionResponseValidationError) Reason() string { return e.reason } |
4111
|
|
|
|
4112
|
|
|
// Cause function returns cause value. |
4113
|
|
|
func (e PermissionSubjectPermissionResponseValidationError) Cause() error { return e.cause } |
4114
|
|
|
|
4115
|
|
|
// Key function returns key value. |
4116
|
|
|
func (e PermissionSubjectPermissionResponseValidationError) Key() bool { return e.key } |
4117
|
|
|
|
4118
|
|
|
// ErrorName returns error name. |
4119
|
|
|
func (e PermissionSubjectPermissionResponseValidationError) ErrorName() string { |
4120
|
|
|
return "PermissionSubjectPermissionResponseValidationError" |
4121
|
|
|
} |
4122
|
|
|
|
4123
|
|
|
// Error satisfies the builtin error interface |
4124
|
|
|
func (e PermissionSubjectPermissionResponseValidationError) Error() string { |
4125
|
|
|
cause := "" |
4126
|
|
|
if e.cause != nil { |
4127
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
4128
|
|
|
} |
4129
|
|
|
|
4130
|
|
|
key := "" |
4131
|
|
|
if e.key { |
4132
|
|
|
key = "key for " |
4133
|
|
|
} |
4134
|
|
|
|
4135
|
|
|
return fmt.Sprintf( |
4136
|
|
|
"invalid %sPermissionSubjectPermissionResponse.%s: %s%s", |
4137
|
|
|
key, |
4138
|
|
|
e.field, |
4139
|
|
|
e.reason, |
4140
|
|
|
cause) |
4141
|
|
|
} |
4142
|
|
|
|
4143
|
|
|
var _ error = PermissionSubjectPermissionResponseValidationError{} |
4144
|
|
|
|
4145
|
|
|
var _ interface { |
4146
|
|
|
Field() string |
4147
|
|
|
Reason() string |
4148
|
|
|
Key() bool |
4149
|
|
|
Cause() error |
4150
|
|
|
ErrorName() string |
4151
|
|
|
} = PermissionSubjectPermissionResponseValidationError{} |
4152
|
|
|
|
4153
|
|
|
// Validate checks the field values on WatchRequest with the rules defined in |
4154
|
|
|
// the proto definition for this message. If any rules are violated, the first |
4155
|
|
|
// error encountered is returned, or nil if there are no violations. |
4156
|
|
|
func (m *WatchRequest) Validate() error { |
4157
|
|
|
return m.validate(false) |
4158
|
|
|
} |
4159
|
|
|
|
4160
|
|
|
// ValidateAll checks the field values on WatchRequest with the rules defined |
4161
|
|
|
// in the proto definition for this message. If any rules are violated, the |
4162
|
|
|
// result is a list of violation errors wrapped in WatchRequestMultiError, or |
4163
|
|
|
// nil if none found. |
4164
|
|
|
func (m *WatchRequest) ValidateAll() error { |
4165
|
|
|
return m.validate(true) |
4166
|
|
|
} |
4167
|
|
|
|
4168
|
|
|
func (m *WatchRequest) validate(all bool) error { |
4169
|
|
|
if m == nil { |
4170
|
|
|
return nil |
4171
|
|
|
} |
4172
|
|
|
|
4173
|
|
|
var errors []error |
4174
|
|
|
|
4175
|
|
|
if len(m.GetTenantId()) > 128 { |
4176
|
|
|
err := WatchRequestValidationError{ |
4177
|
|
|
field: "TenantId", |
4178
|
|
|
reason: "value length must be at most 128 bytes", |
4179
|
|
|
} |
4180
|
|
|
if !all { |
4181
|
|
|
return err |
4182
|
|
|
} |
4183
|
|
|
errors = append(errors, err) |
4184
|
|
|
} |
4185
|
|
|
|
4186
|
|
|
if !_WatchRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
4187
|
|
|
err := WatchRequestValidationError{ |
4188
|
|
|
field: "TenantId", |
4189
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
4190
|
|
|
} |
4191
|
|
|
if !all { |
4192
|
|
|
return err |
4193
|
|
|
} |
4194
|
|
|
errors = append(errors, err) |
4195
|
|
|
} |
4196
|
|
|
|
4197
|
|
|
// no validation rules for SnapToken |
4198
|
|
|
|
4199
|
|
|
if len(errors) > 0 { |
4200
|
|
|
return WatchRequestMultiError(errors) |
4201
|
|
|
} |
4202
|
|
|
|
4203
|
|
|
return nil |
4204
|
|
|
} |
4205
|
|
|
|
4206
|
|
|
// WatchRequestMultiError is an error wrapping multiple validation errors |
4207
|
|
|
// returned by WatchRequest.ValidateAll() if the designated constraints aren't met. |
4208
|
|
|
type WatchRequestMultiError []error |
4209
|
|
|
|
4210
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
4211
|
|
|
func (m WatchRequestMultiError) Error() string { |
4212
|
|
|
var msgs []string |
4213
|
|
|
for _, err := range m { |
4214
|
|
|
msgs = append(msgs, err.Error()) |
4215
|
|
|
} |
4216
|
|
|
return strings.Join(msgs, "; ") |
4217
|
|
|
} |
4218
|
|
|
|
4219
|
|
|
// AllErrors returns a list of validation violation errors. |
4220
|
|
|
func (m WatchRequestMultiError) AllErrors() []error { return m } |
4221
|
|
|
|
4222
|
|
|
// WatchRequestValidationError is the validation error returned by |
4223
|
|
|
// WatchRequest.Validate if the designated constraints aren't met. |
4224
|
|
|
type WatchRequestValidationError struct { |
4225
|
|
|
field string |
4226
|
|
|
reason string |
4227
|
|
|
cause error |
4228
|
|
|
key bool |
4229
|
|
|
} |
4230
|
|
|
|
4231
|
|
|
// Field function returns field value. |
4232
|
|
|
func (e WatchRequestValidationError) Field() string { return e.field } |
4233
|
|
|
|
4234
|
|
|
// Reason function returns reason value. |
4235
|
|
|
func (e WatchRequestValidationError) Reason() string { return e.reason } |
4236
|
|
|
|
4237
|
|
|
// Cause function returns cause value. |
4238
|
|
|
func (e WatchRequestValidationError) Cause() error { return e.cause } |
4239
|
|
|
|
4240
|
|
|
// Key function returns key value. |
4241
|
|
|
func (e WatchRequestValidationError) Key() bool { return e.key } |
4242
|
|
|
|
4243
|
|
|
// ErrorName returns error name. |
4244
|
|
|
func (e WatchRequestValidationError) ErrorName() string { return "WatchRequestValidationError" } |
4245
|
|
|
|
4246
|
|
|
// Error satisfies the builtin error interface |
4247
|
|
|
func (e WatchRequestValidationError) Error() string { |
4248
|
|
|
cause := "" |
4249
|
|
|
if e.cause != nil { |
4250
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
4251
|
|
|
} |
4252
|
|
|
|
4253
|
|
|
key := "" |
4254
|
|
|
if e.key { |
4255
|
|
|
key = "key for " |
4256
|
|
|
} |
4257
|
|
|
|
4258
|
|
|
return fmt.Sprintf( |
4259
|
|
|
"invalid %sWatchRequest.%s: %s%s", |
4260
|
|
|
key, |
4261
|
|
|
e.field, |
4262
|
|
|
e.reason, |
4263
|
|
|
cause) |
4264
|
|
|
} |
4265
|
|
|
|
4266
|
|
|
var _ error = WatchRequestValidationError{} |
4267
|
|
|
|
4268
|
|
|
var _ interface { |
4269
|
|
|
Field() string |
4270
|
|
|
Reason() string |
4271
|
|
|
Key() bool |
4272
|
|
|
Cause() error |
4273
|
|
|
ErrorName() string |
4274
|
|
|
} = WatchRequestValidationError{} |
4275
|
|
|
|
4276
|
|
|
var _WatchRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
4277
|
|
|
|
4278
|
|
|
// Validate checks the field values on WatchResponse with the rules defined in |
4279
|
|
|
// the proto definition for this message. If any rules are violated, the first |
4280
|
|
|
// error encountered is returned, or nil if there are no violations. |
4281
|
|
|
func (m *WatchResponse) Validate() error { |
4282
|
|
|
return m.validate(false) |
4283
|
|
|
} |
4284
|
|
|
|
4285
|
|
|
// ValidateAll checks the field values on WatchResponse with the rules defined |
4286
|
|
|
// in the proto definition for this message. If any rules are violated, the |
4287
|
|
|
// result is a list of violation errors wrapped in WatchResponseMultiError, or |
4288
|
|
|
// nil if none found. |
4289
|
|
|
func (m *WatchResponse) ValidateAll() error { |
4290
|
|
|
return m.validate(true) |
4291
|
|
|
} |
4292
|
|
|
|
4293
|
|
|
func (m *WatchResponse) validate(all bool) error { |
4294
|
|
|
if m == nil { |
4295
|
|
|
return nil |
4296
|
|
|
} |
4297
|
|
|
|
4298
|
|
|
var errors []error |
4299
|
|
|
|
4300
|
|
|
if all { |
4301
|
|
|
switch v := interface{}(m.GetChanges()).(type) { |
4302
|
|
|
case interface{ ValidateAll() error }: |
4303
|
|
|
if err := v.ValidateAll(); err != nil { |
4304
|
|
|
errors = append(errors, WatchResponseValidationError{ |
4305
|
|
|
field: "Changes", |
4306
|
|
|
reason: "embedded message failed validation", |
4307
|
|
|
cause: err, |
4308
|
|
|
}) |
4309
|
|
|
} |
4310
|
|
|
case interface{ Validate() error }: |
4311
|
|
|
if err := v.Validate(); err != nil { |
4312
|
|
|
errors = append(errors, WatchResponseValidationError{ |
4313
|
|
|
field: "Changes", |
4314
|
|
|
reason: "embedded message failed validation", |
4315
|
|
|
cause: err, |
4316
|
|
|
}) |
4317
|
|
|
} |
4318
|
|
|
} |
4319
|
|
|
} else if v, ok := interface{}(m.GetChanges()).(interface{ Validate() error }); ok { |
4320
|
|
|
if err := v.Validate(); err != nil { |
4321
|
|
|
return WatchResponseValidationError{ |
4322
|
|
|
field: "Changes", |
4323
|
|
|
reason: "embedded message failed validation", |
4324
|
|
|
cause: err, |
4325
|
|
|
} |
4326
|
|
|
} |
4327
|
|
|
} |
4328
|
|
|
|
4329
|
|
|
if len(errors) > 0 { |
4330
|
|
|
return WatchResponseMultiError(errors) |
4331
|
|
|
} |
4332
|
|
|
|
4333
|
|
|
return nil |
4334
|
|
|
} |
4335
|
|
|
|
4336
|
|
|
// WatchResponseMultiError is an error wrapping multiple validation errors |
4337
|
|
|
// returned by WatchResponse.ValidateAll() if the designated constraints |
4338
|
|
|
// aren't met. |
4339
|
|
|
type WatchResponseMultiError []error |
4340
|
|
|
|
4341
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
4342
|
|
|
func (m WatchResponseMultiError) Error() string { |
4343
|
|
|
var msgs []string |
4344
|
|
|
for _, err := range m { |
4345
|
|
|
msgs = append(msgs, err.Error()) |
4346
|
|
|
} |
4347
|
|
|
return strings.Join(msgs, "; ") |
4348
|
|
|
} |
4349
|
|
|
|
4350
|
|
|
// AllErrors returns a list of validation violation errors. |
4351
|
|
|
func (m WatchResponseMultiError) AllErrors() []error { return m } |
4352
|
|
|
|
4353
|
|
|
// WatchResponseValidationError is the validation error returned by |
4354
|
|
|
// WatchResponse.Validate if the designated constraints aren't met. |
4355
|
|
|
type WatchResponseValidationError struct { |
4356
|
|
|
field string |
4357
|
|
|
reason string |
4358
|
|
|
cause error |
4359
|
|
|
key bool |
4360
|
|
|
} |
4361
|
|
|
|
4362
|
|
|
// Field function returns field value. |
4363
|
|
|
func (e WatchResponseValidationError) Field() string { return e.field } |
4364
|
|
|
|
4365
|
|
|
// Reason function returns reason value. |
4366
|
|
|
func (e WatchResponseValidationError) Reason() string { return e.reason } |
4367
|
|
|
|
4368
|
|
|
// Cause function returns cause value. |
4369
|
|
|
func (e WatchResponseValidationError) Cause() error { return e.cause } |
4370
|
|
|
|
4371
|
|
|
// Key function returns key value. |
4372
|
|
|
func (e WatchResponseValidationError) Key() bool { return e.key } |
4373
|
|
|
|
4374
|
|
|
// ErrorName returns error name. |
4375
|
|
|
func (e WatchResponseValidationError) ErrorName() string { return "WatchResponseValidationError" } |
4376
|
|
|
|
4377
|
|
|
// Error satisfies the builtin error interface |
4378
|
|
|
func (e WatchResponseValidationError) Error() string { |
4379
|
|
|
cause := "" |
4380
|
|
|
if e.cause != nil { |
4381
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
4382
|
|
|
} |
4383
|
|
|
|
4384
|
|
|
key := "" |
4385
|
|
|
if e.key { |
4386
|
|
|
key = "key for " |
4387
|
|
|
} |
4388
|
|
|
|
4389
|
|
|
return fmt.Sprintf( |
4390
|
|
|
"invalid %sWatchResponse.%s: %s%s", |
4391
|
|
|
key, |
4392
|
|
|
e.field, |
4393
|
|
|
e.reason, |
4394
|
|
|
cause) |
4395
|
|
|
} |
4396
|
|
|
|
4397
|
|
|
var _ error = WatchResponseValidationError{} |
4398
|
|
|
|
4399
|
|
|
var _ interface { |
4400
|
|
|
Field() string |
4401
|
|
|
Reason() string |
4402
|
|
|
Key() bool |
4403
|
|
|
Cause() error |
4404
|
|
|
ErrorName() string |
4405
|
|
|
} = WatchResponseValidationError{} |
4406
|
|
|
|
4407
|
|
|
// Validate checks the field values on SchemaWriteRequest with the rules |
4408
|
|
|
// defined in the proto definition for this message. If any rules are |
4409
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
4410
|
|
|
func (m *SchemaWriteRequest) Validate() error { |
4411
|
|
|
return m.validate(false) |
4412
|
|
|
} |
4413
|
|
|
|
4414
|
|
|
// ValidateAll checks the field values on SchemaWriteRequest with the rules |
4415
|
|
|
// defined in the proto definition for this message. If any rules are |
4416
|
|
|
// violated, the result is a list of violation errors wrapped in |
4417
|
|
|
// SchemaWriteRequestMultiError, or nil if none found. |
4418
|
|
|
func (m *SchemaWriteRequest) ValidateAll() error { |
4419
|
|
|
return m.validate(true) |
4420
|
|
|
} |
4421
|
|
|
|
4422
|
|
|
func (m *SchemaWriteRequest) validate(all bool) error { |
4423
|
|
|
if m == nil { |
4424
|
|
|
return nil |
4425
|
|
|
} |
4426
|
|
|
|
4427
|
|
|
var errors []error |
4428
|
|
|
|
4429
|
|
|
if len(m.GetTenantId()) > 128 { |
4430
|
|
|
err := SchemaWriteRequestValidationError{ |
4431
|
|
|
field: "TenantId", |
4432
|
|
|
reason: "value length must be at most 128 bytes", |
4433
|
|
|
} |
4434
|
|
|
if !all { |
4435
|
|
|
return err |
4436
|
|
|
} |
4437
|
|
|
errors = append(errors, err) |
4438
|
|
|
} |
4439
|
|
|
|
4440
|
|
|
if !_SchemaWriteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
4441
|
|
|
err := SchemaWriteRequestValidationError{ |
4442
|
|
|
field: "TenantId", |
4443
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
4444
|
|
|
} |
4445
|
|
|
if !all { |
4446
|
|
|
return err |
4447
|
|
|
} |
4448
|
|
|
errors = append(errors, err) |
4449
|
|
|
} |
4450
|
|
|
|
4451
|
|
|
// no validation rules for Schema |
4452
|
|
|
|
4453
|
|
|
if len(errors) > 0 { |
4454
|
|
|
return SchemaWriteRequestMultiError(errors) |
4455
|
|
|
} |
4456
|
|
|
|
4457
|
|
|
return nil |
4458
|
|
|
} |
4459
|
|
|
|
4460
|
|
|
// SchemaWriteRequestMultiError is an error wrapping multiple validation errors |
4461
|
|
|
// returned by SchemaWriteRequest.ValidateAll() if the designated constraints |
4462
|
|
|
// aren't met. |
4463
|
|
|
type SchemaWriteRequestMultiError []error |
4464
|
|
|
|
4465
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
4466
|
|
|
func (m SchemaWriteRequestMultiError) Error() string { |
4467
|
|
|
var msgs []string |
4468
|
|
|
for _, err := range m { |
4469
|
|
|
msgs = append(msgs, err.Error()) |
4470
|
|
|
} |
4471
|
|
|
return strings.Join(msgs, "; ") |
4472
|
|
|
} |
4473
|
|
|
|
4474
|
|
|
// AllErrors returns a list of validation violation errors. |
4475
|
|
|
func (m SchemaWriteRequestMultiError) AllErrors() []error { return m } |
4476
|
|
|
|
4477
|
|
|
// SchemaWriteRequestValidationError is the validation error returned by |
4478
|
|
|
// SchemaWriteRequest.Validate if the designated constraints aren't met. |
4479
|
|
|
type SchemaWriteRequestValidationError struct { |
4480
|
|
|
field string |
4481
|
|
|
reason string |
4482
|
|
|
cause error |
4483
|
|
|
key bool |
4484
|
|
|
} |
4485
|
|
|
|
4486
|
|
|
// Field function returns field value. |
4487
|
|
|
func (e SchemaWriteRequestValidationError) Field() string { return e.field } |
4488
|
|
|
|
4489
|
|
|
// Reason function returns reason value. |
4490
|
|
|
func (e SchemaWriteRequestValidationError) Reason() string { return e.reason } |
4491
|
|
|
|
4492
|
|
|
// Cause function returns cause value. |
4493
|
|
|
func (e SchemaWriteRequestValidationError) Cause() error { return e.cause } |
4494
|
|
|
|
4495
|
|
|
// Key function returns key value. |
4496
|
|
|
func (e SchemaWriteRequestValidationError) Key() bool { return e.key } |
4497
|
|
|
|
4498
|
|
|
// ErrorName returns error name. |
4499
|
|
|
func (e SchemaWriteRequestValidationError) ErrorName() string { |
4500
|
|
|
return "SchemaWriteRequestValidationError" |
4501
|
|
|
} |
4502
|
|
|
|
4503
|
|
|
// Error satisfies the builtin error interface |
4504
|
|
|
func (e SchemaWriteRequestValidationError) Error() string { |
4505
|
|
|
cause := "" |
4506
|
|
|
if e.cause != nil { |
4507
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
4508
|
|
|
} |
4509
|
|
|
|
4510
|
|
|
key := "" |
4511
|
|
|
if e.key { |
4512
|
|
|
key = "key for " |
4513
|
|
|
} |
4514
|
|
|
|
4515
|
|
|
return fmt.Sprintf( |
4516
|
|
|
"invalid %sSchemaWriteRequest.%s: %s%s", |
4517
|
|
|
key, |
4518
|
|
|
e.field, |
4519
|
|
|
e.reason, |
4520
|
|
|
cause) |
4521
|
|
|
} |
4522
|
|
|
|
4523
|
|
|
var _ error = SchemaWriteRequestValidationError{} |
4524
|
|
|
|
4525
|
|
|
var _ interface { |
4526
|
|
|
Field() string |
4527
|
|
|
Reason() string |
4528
|
|
|
Key() bool |
4529
|
|
|
Cause() error |
4530
|
|
|
ErrorName() string |
4531
|
|
|
} = SchemaWriteRequestValidationError{} |
4532
|
|
|
|
4533
|
|
|
var _SchemaWriteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
4534
|
|
|
|
4535
|
|
|
// Validate checks the field values on SchemaWriteResponse with the rules |
4536
|
|
|
// defined in the proto definition for this message. If any rules are |
4537
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
4538
|
|
|
func (m *SchemaWriteResponse) Validate() error { |
4539
|
|
|
return m.validate(false) |
4540
|
|
|
} |
4541
|
|
|
|
4542
|
|
|
// ValidateAll checks the field values on SchemaWriteResponse with the rules |
4543
|
|
|
// defined in the proto definition for this message. If any rules are |
4544
|
|
|
// violated, the result is a list of violation errors wrapped in |
4545
|
|
|
// SchemaWriteResponseMultiError, or nil if none found. |
4546
|
|
|
func (m *SchemaWriteResponse) ValidateAll() error { |
4547
|
|
|
return m.validate(true) |
4548
|
|
|
} |
4549
|
|
|
|
4550
|
|
|
func (m *SchemaWriteResponse) validate(all bool) error { |
4551
|
|
|
if m == nil { |
4552
|
|
|
return nil |
4553
|
|
|
} |
4554
|
|
|
|
4555
|
|
|
var errors []error |
4556
|
|
|
|
4557
|
|
|
// no validation rules for SchemaVersion |
4558
|
|
|
|
4559
|
|
|
if len(errors) > 0 { |
4560
|
|
|
return SchemaWriteResponseMultiError(errors) |
4561
|
|
|
} |
4562
|
|
|
|
4563
|
|
|
return nil |
4564
|
|
|
} |
4565
|
|
|
|
4566
|
|
|
// SchemaWriteResponseMultiError is an error wrapping multiple validation |
4567
|
|
|
// errors returned by SchemaWriteResponse.ValidateAll() if the designated |
4568
|
|
|
// constraints aren't met. |
4569
|
|
|
type SchemaWriteResponseMultiError []error |
4570
|
|
|
|
4571
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
4572
|
|
|
func (m SchemaWriteResponseMultiError) Error() string { |
4573
|
|
|
var msgs []string |
4574
|
|
|
for _, err := range m { |
4575
|
|
|
msgs = append(msgs, err.Error()) |
4576
|
|
|
} |
4577
|
|
|
return strings.Join(msgs, "; ") |
4578
|
|
|
} |
4579
|
|
|
|
4580
|
|
|
// AllErrors returns a list of validation violation errors. |
4581
|
|
|
func (m SchemaWriteResponseMultiError) AllErrors() []error { return m } |
4582
|
|
|
|
4583
|
|
|
// SchemaWriteResponseValidationError is the validation error returned by |
4584
|
|
|
// SchemaWriteResponse.Validate if the designated constraints aren't met. |
4585
|
|
|
type SchemaWriteResponseValidationError struct { |
4586
|
|
|
field string |
4587
|
|
|
reason string |
4588
|
|
|
cause error |
4589
|
|
|
key bool |
4590
|
|
|
} |
4591
|
|
|
|
4592
|
|
|
// Field function returns field value. |
4593
|
|
|
func (e SchemaWriteResponseValidationError) Field() string { return e.field } |
4594
|
|
|
|
4595
|
|
|
// Reason function returns reason value. |
4596
|
|
|
func (e SchemaWriteResponseValidationError) Reason() string { return e.reason } |
4597
|
|
|
|
4598
|
|
|
// Cause function returns cause value. |
4599
|
|
|
func (e SchemaWriteResponseValidationError) Cause() error { return e.cause } |
4600
|
|
|
|
4601
|
|
|
// Key function returns key value. |
4602
|
|
|
func (e SchemaWriteResponseValidationError) Key() bool { return e.key } |
4603
|
|
|
|
4604
|
|
|
// ErrorName returns error name. |
4605
|
|
|
func (e SchemaWriteResponseValidationError) ErrorName() string { |
4606
|
|
|
return "SchemaWriteResponseValidationError" |
4607
|
|
|
} |
4608
|
|
|
|
4609
|
|
|
// Error satisfies the builtin error interface |
4610
|
|
|
func (e SchemaWriteResponseValidationError) Error() string { |
4611
|
|
|
cause := "" |
4612
|
|
|
if e.cause != nil { |
4613
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
4614
|
|
|
} |
4615
|
|
|
|
4616
|
|
|
key := "" |
4617
|
|
|
if e.key { |
4618
|
|
|
key = "key for " |
4619
|
|
|
} |
4620
|
|
|
|
4621
|
|
|
return fmt.Sprintf( |
4622
|
|
|
"invalid %sSchemaWriteResponse.%s: %s%s", |
4623
|
|
|
key, |
4624
|
|
|
e.field, |
4625
|
|
|
e.reason, |
4626
|
|
|
cause) |
4627
|
|
|
} |
4628
|
|
|
|
4629
|
|
|
var _ error = SchemaWriteResponseValidationError{} |
4630
|
|
|
|
4631
|
|
|
var _ interface { |
4632
|
|
|
Field() string |
4633
|
|
|
Reason() string |
4634
|
|
|
Key() bool |
4635
|
|
|
Cause() error |
4636
|
|
|
ErrorName() string |
4637
|
|
|
} = SchemaWriteResponseValidationError{} |
4638
|
|
|
|
4639
|
|
|
// Validate checks the field values on SchemaPartialWriteRequest with the rules |
4640
|
|
|
// defined in the proto definition for this message. If any rules are |
4641
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
4642
|
|
|
func (m *SchemaPartialWriteRequest) Validate() error { |
4643
|
|
|
return m.validate(false) |
4644
|
|
|
} |
4645
|
|
|
|
4646
|
|
|
// ValidateAll checks the field values on SchemaPartialWriteRequest with the |
4647
|
|
|
// rules defined in the proto definition for this message. If any rules are |
4648
|
|
|
// violated, the result is a list of violation errors wrapped in |
4649
|
|
|
// SchemaPartialWriteRequestMultiError, or nil if none found. |
4650
|
|
|
func (m *SchemaPartialWriteRequest) ValidateAll() error { |
4651
|
|
|
return m.validate(true) |
4652
|
|
|
} |
4653
|
|
|
|
4654
|
|
|
func (m *SchemaPartialWriteRequest) validate(all bool) error { |
4655
|
|
|
if m == nil { |
4656
|
|
|
return nil |
4657
|
|
|
} |
4658
|
|
|
|
4659
|
|
|
var errors []error |
4660
|
|
|
|
4661
|
|
|
if len(m.GetTenantId()) > 128 { |
4662
|
|
|
err := SchemaPartialWriteRequestValidationError{ |
4663
|
|
|
field: "TenantId", |
4664
|
|
|
reason: "value length must be at most 128 bytes", |
4665
|
|
|
} |
4666
|
|
|
if !all { |
4667
|
|
|
return err |
4668
|
|
|
} |
4669
|
|
|
errors = append(errors, err) |
4670
|
|
|
} |
4671
|
|
|
|
4672
|
|
|
if !_SchemaPartialWriteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
4673
|
|
|
err := SchemaPartialWriteRequestValidationError{ |
4674
|
|
|
field: "TenantId", |
4675
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
4676
|
|
|
} |
4677
|
|
|
if !all { |
4678
|
|
|
return err |
4679
|
|
|
} |
4680
|
|
|
errors = append(errors, err) |
4681
|
|
|
} |
4682
|
|
|
|
4683
|
|
|
if m.GetMetadata() == nil { |
4684
|
|
|
err := SchemaPartialWriteRequestValidationError{ |
4685
|
|
|
field: "Metadata", |
4686
|
|
|
reason: "value is required", |
4687
|
|
|
} |
4688
|
|
|
if !all { |
4689
|
|
|
return err |
4690
|
|
|
} |
4691
|
|
|
errors = append(errors, err) |
4692
|
|
|
} |
4693
|
|
|
|
4694
|
|
|
if all { |
4695
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
4696
|
|
|
case interface{ ValidateAll() error }: |
4697
|
|
|
if err := v.ValidateAll(); err != nil { |
4698
|
|
|
errors = append(errors, SchemaPartialWriteRequestValidationError{ |
4699
|
|
|
field: "Metadata", |
4700
|
|
|
reason: "embedded message failed validation", |
4701
|
|
|
cause: err, |
4702
|
|
|
}) |
4703
|
|
|
} |
4704
|
|
|
case interface{ Validate() error }: |
4705
|
|
|
if err := v.Validate(); err != nil { |
4706
|
|
|
errors = append(errors, SchemaPartialWriteRequestValidationError{ |
4707
|
|
|
field: "Metadata", |
4708
|
|
|
reason: "embedded message failed validation", |
4709
|
|
|
cause: err, |
4710
|
|
|
}) |
4711
|
|
|
} |
4712
|
|
|
} |
4713
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
4714
|
|
|
if err := v.Validate(); err != nil { |
4715
|
|
|
return SchemaPartialWriteRequestValidationError{ |
4716
|
|
|
field: "Metadata", |
4717
|
|
|
reason: "embedded message failed validation", |
4718
|
|
|
cause: err, |
4719
|
|
|
} |
4720
|
|
|
} |
4721
|
|
|
} |
4722
|
|
|
|
4723
|
|
|
{ |
4724
|
|
|
sorted_keys := make([]string, len(m.GetPartials())) |
4725
|
|
|
i := 0 |
4726
|
|
|
for key := range m.GetPartials() { |
4727
|
|
|
sorted_keys[i] = key |
4728
|
|
|
i++ |
4729
|
|
|
} |
4730
|
|
|
sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) |
4731
|
|
|
for _, key := range sorted_keys { |
4732
|
|
|
val := m.GetPartials()[key] |
4733
|
|
|
_ = val |
4734
|
|
|
|
4735
|
|
|
// no validation rules for Partials[key] |
4736
|
|
|
|
4737
|
|
|
if all { |
4738
|
|
|
switch v := interface{}(val).(type) { |
4739
|
|
|
case interface{ ValidateAll() error }: |
4740
|
|
|
if err := v.ValidateAll(); err != nil { |
4741
|
|
|
errors = append(errors, SchemaPartialWriteRequestValidationError{ |
4742
|
|
|
field: fmt.Sprintf("Partials[%v]", key), |
4743
|
|
|
reason: "embedded message failed validation", |
4744
|
|
|
cause: err, |
4745
|
|
|
}) |
4746
|
|
|
} |
4747
|
|
|
case interface{ Validate() error }: |
4748
|
|
|
if err := v.Validate(); err != nil { |
4749
|
|
|
errors = append(errors, SchemaPartialWriteRequestValidationError{ |
4750
|
|
|
field: fmt.Sprintf("Partials[%v]", key), |
4751
|
|
|
reason: "embedded message failed validation", |
4752
|
|
|
cause: err, |
4753
|
|
|
}) |
4754
|
|
|
} |
4755
|
|
|
} |
4756
|
|
|
} else if v, ok := interface{}(val).(interface{ Validate() error }); ok { |
4757
|
|
|
if err := v.Validate(); err != nil { |
4758
|
|
|
return SchemaPartialWriteRequestValidationError{ |
4759
|
|
|
field: fmt.Sprintf("Partials[%v]", key), |
4760
|
|
|
reason: "embedded message failed validation", |
4761
|
|
|
cause: err, |
4762
|
|
|
} |
4763
|
|
|
} |
4764
|
|
|
} |
4765
|
|
|
|
4766
|
|
|
} |
4767
|
|
|
} |
4768
|
|
|
|
4769
|
|
|
if len(errors) > 0 { |
4770
|
|
|
return SchemaPartialWriteRequestMultiError(errors) |
4771
|
|
|
} |
4772
|
|
|
|
4773
|
|
|
return nil |
4774
|
|
|
} |
4775
|
|
|
|
4776
|
|
|
// SchemaPartialWriteRequestMultiError is an error wrapping multiple validation |
4777
|
|
|
// errors returned by SchemaPartialWriteRequest.ValidateAll() if the |
4778
|
|
|
// designated constraints aren't met. |
4779
|
|
|
type SchemaPartialWriteRequestMultiError []error |
4780
|
|
|
|
4781
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
4782
|
|
|
func (m SchemaPartialWriteRequestMultiError) Error() string { |
4783
|
|
|
var msgs []string |
4784
|
|
|
for _, err := range m { |
4785
|
|
|
msgs = append(msgs, err.Error()) |
4786
|
|
|
} |
4787
|
|
|
return strings.Join(msgs, "; ") |
4788
|
|
|
} |
4789
|
|
|
|
4790
|
|
|
// AllErrors returns a list of validation violation errors. |
4791
|
|
|
func (m SchemaPartialWriteRequestMultiError) AllErrors() []error { return m } |
4792
|
|
|
|
4793
|
|
|
// SchemaPartialWriteRequestValidationError is the validation error returned by |
4794
|
|
|
// SchemaPartialWriteRequest.Validate if the designated constraints aren't met. |
4795
|
|
|
type SchemaPartialWriteRequestValidationError struct { |
4796
|
|
|
field string |
4797
|
|
|
reason string |
4798
|
|
|
cause error |
4799
|
|
|
key bool |
4800
|
|
|
} |
4801
|
|
|
|
4802
|
|
|
// Field function returns field value. |
4803
|
|
|
func (e SchemaPartialWriteRequestValidationError) Field() string { return e.field } |
4804
|
|
|
|
4805
|
|
|
// Reason function returns reason value. |
4806
|
|
|
func (e SchemaPartialWriteRequestValidationError) Reason() string { return e.reason } |
4807
|
|
|
|
4808
|
|
|
// Cause function returns cause value. |
4809
|
|
|
func (e SchemaPartialWriteRequestValidationError) Cause() error { return e.cause } |
4810
|
|
|
|
4811
|
|
|
// Key function returns key value. |
4812
|
|
|
func (e SchemaPartialWriteRequestValidationError) Key() bool { return e.key } |
4813
|
|
|
|
4814
|
|
|
// ErrorName returns error name. |
4815
|
|
|
func (e SchemaPartialWriteRequestValidationError) ErrorName() string { |
4816
|
|
|
return "SchemaPartialWriteRequestValidationError" |
4817
|
|
|
} |
4818
|
|
|
|
4819
|
|
|
// Error satisfies the builtin error interface |
4820
|
|
|
func (e SchemaPartialWriteRequestValidationError) Error() string { |
4821
|
|
|
cause := "" |
4822
|
|
|
if e.cause != nil { |
4823
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
4824
|
|
|
} |
4825
|
|
|
|
4826
|
|
|
key := "" |
4827
|
|
|
if e.key { |
4828
|
|
|
key = "key for " |
4829
|
|
|
} |
4830
|
|
|
|
4831
|
|
|
return fmt.Sprintf( |
4832
|
|
|
"invalid %sSchemaPartialWriteRequest.%s: %s%s", |
4833
|
|
|
key, |
4834
|
|
|
e.field, |
4835
|
|
|
e.reason, |
4836
|
|
|
cause) |
4837
|
|
|
} |
4838
|
|
|
|
4839
|
|
|
var _ error = SchemaPartialWriteRequestValidationError{} |
4840
|
|
|
|
4841
|
|
|
var _ interface { |
4842
|
|
|
Field() string |
4843
|
|
|
Reason() string |
4844
|
|
|
Key() bool |
4845
|
|
|
Cause() error |
4846
|
|
|
ErrorName() string |
4847
|
|
|
} = SchemaPartialWriteRequestValidationError{} |
4848
|
|
|
|
4849
|
|
|
var _SchemaPartialWriteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
4850
|
|
|
|
4851
|
|
|
// Validate checks the field values on SchemaPartialWriteRequestMetadata with |
4852
|
|
|
// the rules defined in the proto definition for this message. If any rules |
4853
|
|
|
// are violated, the first error encountered is returned, or nil if there are |
4854
|
|
|
// no violations. |
4855
|
|
|
func (m *SchemaPartialWriteRequestMetadata) Validate() error { |
4856
|
|
|
return m.validate(false) |
4857
|
|
|
} |
4858
|
|
|
|
4859
|
|
|
// ValidateAll checks the field values on SchemaPartialWriteRequestMetadata |
4860
|
|
|
// with the rules defined in the proto definition for this message. If any |
4861
|
|
|
// rules are violated, the result is a list of violation errors wrapped in |
4862
|
|
|
// SchemaPartialWriteRequestMetadataMultiError, or nil if none found. |
4863
|
|
|
func (m *SchemaPartialWriteRequestMetadata) ValidateAll() error { |
4864
|
|
|
return m.validate(true) |
4865
|
|
|
} |
4866
|
|
|
|
4867
|
|
|
func (m *SchemaPartialWriteRequestMetadata) validate(all bool) error { |
4868
|
|
|
if m == nil { |
4869
|
|
|
return nil |
4870
|
|
|
} |
4871
|
|
|
|
4872
|
|
|
var errors []error |
4873
|
|
|
|
4874
|
|
|
// no validation rules for SchemaVersion |
4875
|
|
|
|
4876
|
|
|
if len(errors) > 0 { |
4877
|
|
|
return SchemaPartialWriteRequestMetadataMultiError(errors) |
4878
|
|
|
} |
4879
|
|
|
|
4880
|
|
|
return nil |
4881
|
|
|
} |
4882
|
|
|
|
4883
|
|
|
// SchemaPartialWriteRequestMetadataMultiError is an error wrapping multiple |
4884
|
|
|
// validation errors returned by |
4885
|
|
|
// SchemaPartialWriteRequestMetadata.ValidateAll() if the designated |
4886
|
|
|
// constraints aren't met. |
4887
|
|
|
type SchemaPartialWriteRequestMetadataMultiError []error |
4888
|
|
|
|
4889
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
4890
|
|
|
func (m SchemaPartialWriteRequestMetadataMultiError) Error() string { |
4891
|
|
|
var msgs []string |
4892
|
|
|
for _, err := range m { |
4893
|
|
|
msgs = append(msgs, err.Error()) |
4894
|
|
|
} |
4895
|
|
|
return strings.Join(msgs, "; ") |
4896
|
|
|
} |
4897
|
|
|
|
4898
|
|
|
// AllErrors returns a list of validation violation errors. |
4899
|
|
|
func (m SchemaPartialWriteRequestMetadataMultiError) AllErrors() []error { return m } |
4900
|
|
|
|
4901
|
|
|
// SchemaPartialWriteRequestMetadataValidationError is the validation error |
4902
|
|
|
// returned by SchemaPartialWriteRequestMetadata.Validate if the designated |
4903
|
|
|
// constraints aren't met. |
4904
|
|
|
type SchemaPartialWriteRequestMetadataValidationError struct { |
4905
|
|
|
field string |
4906
|
|
|
reason string |
4907
|
|
|
cause error |
4908
|
|
|
key bool |
4909
|
|
|
} |
4910
|
|
|
|
4911
|
|
|
// Field function returns field value. |
4912
|
|
|
func (e SchemaPartialWriteRequestMetadataValidationError) Field() string { return e.field } |
4913
|
|
|
|
4914
|
|
|
// Reason function returns reason value. |
4915
|
|
|
func (e SchemaPartialWriteRequestMetadataValidationError) Reason() string { return e.reason } |
4916
|
|
|
|
4917
|
|
|
// Cause function returns cause value. |
4918
|
|
|
func (e SchemaPartialWriteRequestMetadataValidationError) Cause() error { return e.cause } |
4919
|
|
|
|
4920
|
|
|
// Key function returns key value. |
4921
|
|
|
func (e SchemaPartialWriteRequestMetadataValidationError) Key() bool { return e.key } |
4922
|
|
|
|
4923
|
|
|
// ErrorName returns error name. |
4924
|
|
|
func (e SchemaPartialWriteRequestMetadataValidationError) ErrorName() string { |
4925
|
|
|
return "SchemaPartialWriteRequestMetadataValidationError" |
4926
|
|
|
} |
4927
|
|
|
|
4928
|
|
|
// Error satisfies the builtin error interface |
4929
|
|
|
func (e SchemaPartialWriteRequestMetadataValidationError) Error() string { |
4930
|
|
|
cause := "" |
4931
|
|
|
if e.cause != nil { |
4932
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
4933
|
|
|
} |
4934
|
|
|
|
4935
|
|
|
key := "" |
4936
|
|
|
if e.key { |
4937
|
|
|
key = "key for " |
4938
|
|
|
} |
4939
|
|
|
|
4940
|
|
|
return fmt.Sprintf( |
4941
|
|
|
"invalid %sSchemaPartialWriteRequestMetadata.%s: %s%s", |
4942
|
|
|
key, |
4943
|
|
|
e.field, |
4944
|
|
|
e.reason, |
4945
|
|
|
cause) |
4946
|
|
|
} |
4947
|
|
|
|
4948
|
|
|
var _ error = SchemaPartialWriteRequestMetadataValidationError{} |
4949
|
|
|
|
4950
|
|
|
var _ interface { |
4951
|
|
|
Field() string |
4952
|
|
|
Reason() string |
4953
|
|
|
Key() bool |
4954
|
|
|
Cause() error |
4955
|
|
|
ErrorName() string |
4956
|
|
|
} = SchemaPartialWriteRequestMetadataValidationError{} |
4957
|
|
|
|
4958
|
|
|
// Validate checks the field values on SchemaPartialWriteResponse with the |
4959
|
|
|
// rules defined in the proto definition for this message. If any rules are |
4960
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
4961
|
|
|
func (m *SchemaPartialWriteResponse) Validate() error { |
4962
|
|
|
return m.validate(false) |
4963
|
|
|
} |
4964
|
|
|
|
4965
|
|
|
// ValidateAll checks the field values on SchemaPartialWriteResponse with the |
4966
|
|
|
// rules defined in the proto definition for this message. If any rules are |
4967
|
|
|
// violated, the result is a list of violation errors wrapped in |
4968
|
|
|
// SchemaPartialWriteResponseMultiError, or nil if none found. |
4969
|
|
|
func (m *SchemaPartialWriteResponse) ValidateAll() error { |
4970
|
|
|
return m.validate(true) |
4971
|
|
|
} |
4972
|
|
|
|
4973
|
|
|
func (m *SchemaPartialWriteResponse) validate(all bool) error { |
4974
|
|
|
if m == nil { |
4975
|
|
|
return nil |
4976
|
|
|
} |
4977
|
|
|
|
4978
|
|
|
var errors []error |
4979
|
|
|
|
4980
|
|
|
// no validation rules for SchemaVersion |
4981
|
|
|
|
4982
|
|
|
if len(errors) > 0 { |
4983
|
|
|
return SchemaPartialWriteResponseMultiError(errors) |
4984
|
|
|
} |
4985
|
|
|
|
4986
|
|
|
return nil |
4987
|
|
|
} |
4988
|
|
|
|
4989
|
|
|
// SchemaPartialWriteResponseMultiError is an error wrapping multiple |
4990
|
|
|
// validation errors returned by SchemaPartialWriteResponse.ValidateAll() if |
4991
|
|
|
// the designated constraints aren't met. |
4992
|
|
|
type SchemaPartialWriteResponseMultiError []error |
4993
|
|
|
|
4994
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
4995
|
|
|
func (m SchemaPartialWriteResponseMultiError) Error() string { |
4996
|
|
|
var msgs []string |
4997
|
|
|
for _, err := range m { |
4998
|
|
|
msgs = append(msgs, err.Error()) |
4999
|
|
|
} |
5000
|
|
|
return strings.Join(msgs, "; ") |
5001
|
|
|
} |
5002
|
|
|
|
5003
|
|
|
// AllErrors returns a list of validation violation errors. |
5004
|
|
|
func (m SchemaPartialWriteResponseMultiError) AllErrors() []error { return m } |
5005
|
|
|
|
5006
|
|
|
// SchemaPartialWriteResponseValidationError is the validation error returned |
5007
|
|
|
// by SchemaPartialWriteResponse.Validate if the designated constraints aren't met. |
5008
|
|
|
type SchemaPartialWriteResponseValidationError struct { |
5009
|
|
|
field string |
5010
|
|
|
reason string |
5011
|
|
|
cause error |
5012
|
|
|
key bool |
5013
|
|
|
} |
5014
|
|
|
|
5015
|
|
|
// Field function returns field value. |
5016
|
|
|
func (e SchemaPartialWriteResponseValidationError) Field() string { return e.field } |
5017
|
|
|
|
5018
|
|
|
// Reason function returns reason value. |
5019
|
|
|
func (e SchemaPartialWriteResponseValidationError) Reason() string { return e.reason } |
5020
|
|
|
|
5021
|
|
|
// Cause function returns cause value. |
5022
|
|
|
func (e SchemaPartialWriteResponseValidationError) Cause() error { return e.cause } |
5023
|
|
|
|
5024
|
|
|
// Key function returns key value. |
5025
|
|
|
func (e SchemaPartialWriteResponseValidationError) Key() bool { return e.key } |
5026
|
|
|
|
5027
|
|
|
// ErrorName returns error name. |
5028
|
|
|
func (e SchemaPartialWriteResponseValidationError) ErrorName() string { |
5029
|
|
|
return "SchemaPartialWriteResponseValidationError" |
5030
|
|
|
} |
5031
|
|
|
|
5032
|
|
|
// Error satisfies the builtin error interface |
5033
|
|
|
func (e SchemaPartialWriteResponseValidationError) Error() string { |
5034
|
|
|
cause := "" |
5035
|
|
|
if e.cause != nil { |
5036
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
5037
|
|
|
} |
5038
|
|
|
|
5039
|
|
|
key := "" |
5040
|
|
|
if e.key { |
5041
|
|
|
key = "key for " |
5042
|
|
|
} |
5043
|
|
|
|
5044
|
|
|
return fmt.Sprintf( |
5045
|
|
|
"invalid %sSchemaPartialWriteResponse.%s: %s%s", |
5046
|
|
|
key, |
5047
|
|
|
e.field, |
5048
|
|
|
e.reason, |
5049
|
|
|
cause) |
5050
|
|
|
} |
5051
|
|
|
|
5052
|
|
|
var _ error = SchemaPartialWriteResponseValidationError{} |
5053
|
|
|
|
5054
|
|
|
var _ interface { |
5055
|
|
|
Field() string |
5056
|
|
|
Reason() string |
5057
|
|
|
Key() bool |
5058
|
|
|
Cause() error |
5059
|
|
|
ErrorName() string |
5060
|
|
|
} = SchemaPartialWriteResponseValidationError{} |
5061
|
|
|
|
5062
|
|
|
// Validate checks the field values on SchemaReadRequest with the rules defined |
5063
|
|
|
// in the proto definition for this message. If any rules are violated, the |
5064
|
|
|
// first error encountered is returned, or nil if there are no violations. |
5065
|
|
|
func (m *SchemaReadRequest) Validate() error { |
5066
|
|
|
return m.validate(false) |
5067
|
|
|
} |
5068
|
|
|
|
5069
|
|
|
// ValidateAll checks the field values on SchemaReadRequest with the rules |
5070
|
|
|
// defined in the proto definition for this message. If any rules are |
5071
|
|
|
// violated, the result is a list of violation errors wrapped in |
5072
|
|
|
// SchemaReadRequestMultiError, or nil if none found. |
5073
|
|
|
func (m *SchemaReadRequest) ValidateAll() error { |
5074
|
|
|
return m.validate(true) |
5075
|
|
|
} |
5076
|
|
|
|
5077
|
|
|
func (m *SchemaReadRequest) validate(all bool) error { |
5078
|
|
|
if m == nil { |
5079
|
|
|
return nil |
5080
|
|
|
} |
5081
|
|
|
|
5082
|
|
|
var errors []error |
5083
|
|
|
|
5084
|
|
|
if len(m.GetTenantId()) > 128 { |
5085
|
|
|
err := SchemaReadRequestValidationError{ |
5086
|
|
|
field: "TenantId", |
5087
|
|
|
reason: "value length must be at most 128 bytes", |
5088
|
|
|
} |
5089
|
|
|
if !all { |
5090
|
|
|
return err |
5091
|
|
|
} |
5092
|
|
|
errors = append(errors, err) |
5093
|
|
|
} |
5094
|
|
|
|
5095
|
|
|
if !_SchemaReadRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
5096
|
|
|
err := SchemaReadRequestValidationError{ |
5097
|
|
|
field: "TenantId", |
5098
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
5099
|
|
|
} |
5100
|
|
|
if !all { |
5101
|
|
|
return err |
5102
|
|
|
} |
5103
|
|
|
errors = append(errors, err) |
5104
|
|
|
} |
5105
|
|
|
|
5106
|
|
|
if m.GetMetadata() == nil { |
5107
|
|
|
err := SchemaReadRequestValidationError{ |
5108
|
|
|
field: "Metadata", |
5109
|
|
|
reason: "value is required", |
5110
|
|
|
} |
5111
|
|
|
if !all { |
5112
|
|
|
return err |
5113
|
|
|
} |
5114
|
|
|
errors = append(errors, err) |
5115
|
|
|
} |
5116
|
|
|
|
5117
|
|
|
if all { |
5118
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
5119
|
|
|
case interface{ ValidateAll() error }: |
5120
|
|
|
if err := v.ValidateAll(); err != nil { |
5121
|
|
|
errors = append(errors, SchemaReadRequestValidationError{ |
5122
|
|
|
field: "Metadata", |
5123
|
|
|
reason: "embedded message failed validation", |
5124
|
|
|
cause: err, |
5125
|
|
|
}) |
5126
|
|
|
} |
5127
|
|
|
case interface{ Validate() error }: |
5128
|
|
|
if err := v.Validate(); err != nil { |
5129
|
|
|
errors = append(errors, SchemaReadRequestValidationError{ |
5130
|
|
|
field: "Metadata", |
5131
|
|
|
reason: "embedded message failed validation", |
5132
|
|
|
cause: err, |
5133
|
|
|
}) |
5134
|
|
|
} |
5135
|
|
|
} |
5136
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
5137
|
|
|
if err := v.Validate(); err != nil { |
5138
|
|
|
return SchemaReadRequestValidationError{ |
5139
|
|
|
field: "Metadata", |
5140
|
|
|
reason: "embedded message failed validation", |
5141
|
|
|
cause: err, |
5142
|
|
|
} |
5143
|
|
|
} |
5144
|
|
|
} |
5145
|
|
|
|
5146
|
|
|
if len(errors) > 0 { |
5147
|
|
|
return SchemaReadRequestMultiError(errors) |
5148
|
|
|
} |
5149
|
|
|
|
5150
|
|
|
return nil |
5151
|
|
|
} |
5152
|
|
|
|
5153
|
|
|
// SchemaReadRequestMultiError is an error wrapping multiple validation errors |
5154
|
|
|
// returned by SchemaReadRequest.ValidateAll() if the designated constraints |
5155
|
|
|
// aren't met. |
5156
|
|
|
type SchemaReadRequestMultiError []error |
5157
|
|
|
|
5158
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
5159
|
|
|
func (m SchemaReadRequestMultiError) Error() string { |
5160
|
|
|
var msgs []string |
5161
|
|
|
for _, err := range m { |
5162
|
|
|
msgs = append(msgs, err.Error()) |
5163
|
|
|
} |
5164
|
|
|
return strings.Join(msgs, "; ") |
5165
|
|
|
} |
5166
|
|
|
|
5167
|
|
|
// AllErrors returns a list of validation violation errors. |
5168
|
|
|
func (m SchemaReadRequestMultiError) AllErrors() []error { return m } |
5169
|
|
|
|
5170
|
|
|
// SchemaReadRequestValidationError is the validation error returned by |
5171
|
|
|
// SchemaReadRequest.Validate if the designated constraints aren't met. |
5172
|
|
|
type SchemaReadRequestValidationError struct { |
5173
|
|
|
field string |
5174
|
|
|
reason string |
5175
|
|
|
cause error |
5176
|
|
|
key bool |
5177
|
|
|
} |
5178
|
|
|
|
5179
|
|
|
// Field function returns field value. |
5180
|
|
|
func (e SchemaReadRequestValidationError) Field() string { return e.field } |
5181
|
|
|
|
5182
|
|
|
// Reason function returns reason value. |
5183
|
|
|
func (e SchemaReadRequestValidationError) Reason() string { return e.reason } |
5184
|
|
|
|
5185
|
|
|
// Cause function returns cause value. |
5186
|
|
|
func (e SchemaReadRequestValidationError) Cause() error { return e.cause } |
5187
|
|
|
|
5188
|
|
|
// Key function returns key value. |
5189
|
|
|
func (e SchemaReadRequestValidationError) Key() bool { return e.key } |
5190
|
|
|
|
5191
|
|
|
// ErrorName returns error name. |
5192
|
|
|
func (e SchemaReadRequestValidationError) ErrorName() string { |
5193
|
|
|
return "SchemaReadRequestValidationError" |
5194
|
|
|
} |
5195
|
|
|
|
5196
|
|
|
// Error satisfies the builtin error interface |
5197
|
|
|
func (e SchemaReadRequestValidationError) Error() string { |
5198
|
|
|
cause := "" |
5199
|
|
|
if e.cause != nil { |
5200
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
5201
|
|
|
} |
5202
|
|
|
|
5203
|
|
|
key := "" |
5204
|
|
|
if e.key { |
5205
|
|
|
key = "key for " |
5206
|
|
|
} |
5207
|
|
|
|
5208
|
|
|
return fmt.Sprintf( |
5209
|
|
|
"invalid %sSchemaReadRequest.%s: %s%s", |
5210
|
|
|
key, |
5211
|
|
|
e.field, |
5212
|
|
|
e.reason, |
5213
|
|
|
cause) |
5214
|
|
|
} |
5215
|
|
|
|
5216
|
|
|
var _ error = SchemaReadRequestValidationError{} |
5217
|
|
|
|
5218
|
|
|
var _ interface { |
5219
|
|
|
Field() string |
5220
|
|
|
Reason() string |
5221
|
|
|
Key() bool |
5222
|
|
|
Cause() error |
5223
|
|
|
ErrorName() string |
5224
|
|
|
} = SchemaReadRequestValidationError{} |
5225
|
|
|
|
5226
|
|
|
var _SchemaReadRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
5227
|
|
|
|
5228
|
|
|
// Validate checks the field values on SchemaReadRequestMetadata with the rules |
5229
|
|
|
// defined in the proto definition for this message. If any rules are |
5230
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
5231
|
|
|
func (m *SchemaReadRequestMetadata) Validate() error { |
5232
|
|
|
return m.validate(false) |
5233
|
|
|
} |
5234
|
|
|
|
5235
|
|
|
// ValidateAll checks the field values on SchemaReadRequestMetadata with the |
5236
|
|
|
// rules defined in the proto definition for this message. If any rules are |
5237
|
|
|
// violated, the result is a list of violation errors wrapped in |
5238
|
|
|
// SchemaReadRequestMetadataMultiError, or nil if none found. |
5239
|
|
|
func (m *SchemaReadRequestMetadata) ValidateAll() error { |
5240
|
|
|
return m.validate(true) |
5241
|
|
|
} |
5242
|
|
|
|
5243
|
|
|
func (m *SchemaReadRequestMetadata) validate(all bool) error { |
5244
|
|
|
if m == nil { |
5245
|
|
|
return nil |
5246
|
|
|
} |
5247
|
|
|
|
5248
|
|
|
var errors []error |
5249
|
|
|
|
5250
|
|
|
// no validation rules for SchemaVersion |
5251
|
|
|
|
5252
|
|
|
if len(errors) > 0 { |
5253
|
|
|
return SchemaReadRequestMetadataMultiError(errors) |
5254
|
|
|
} |
5255
|
|
|
|
5256
|
|
|
return nil |
5257
|
|
|
} |
5258
|
|
|
|
5259
|
|
|
// SchemaReadRequestMetadataMultiError is an error wrapping multiple validation |
5260
|
|
|
// errors returned by SchemaReadRequestMetadata.ValidateAll() if the |
5261
|
|
|
// designated constraints aren't met. |
5262
|
|
|
type SchemaReadRequestMetadataMultiError []error |
5263
|
|
|
|
5264
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
5265
|
|
|
func (m SchemaReadRequestMetadataMultiError) Error() string { |
5266
|
|
|
var msgs []string |
5267
|
|
|
for _, err := range m { |
5268
|
|
|
msgs = append(msgs, err.Error()) |
5269
|
|
|
} |
5270
|
|
|
return strings.Join(msgs, "; ") |
5271
|
|
|
} |
5272
|
|
|
|
5273
|
|
|
// AllErrors returns a list of validation violation errors. |
5274
|
|
|
func (m SchemaReadRequestMetadataMultiError) AllErrors() []error { return m } |
5275
|
|
|
|
5276
|
|
|
// SchemaReadRequestMetadataValidationError is the validation error returned by |
5277
|
|
|
// SchemaReadRequestMetadata.Validate if the designated constraints aren't met. |
5278
|
|
|
type SchemaReadRequestMetadataValidationError struct { |
5279
|
|
|
field string |
5280
|
|
|
reason string |
5281
|
|
|
cause error |
5282
|
|
|
key bool |
5283
|
|
|
} |
5284
|
|
|
|
5285
|
|
|
// Field function returns field value. |
5286
|
|
|
func (e SchemaReadRequestMetadataValidationError) Field() string { return e.field } |
5287
|
|
|
|
5288
|
|
|
// Reason function returns reason value. |
5289
|
|
|
func (e SchemaReadRequestMetadataValidationError) Reason() string { return e.reason } |
5290
|
|
|
|
5291
|
|
|
// Cause function returns cause value. |
5292
|
|
|
func (e SchemaReadRequestMetadataValidationError) Cause() error { return e.cause } |
5293
|
|
|
|
5294
|
|
|
// Key function returns key value. |
5295
|
|
|
func (e SchemaReadRequestMetadataValidationError) Key() bool { return e.key } |
5296
|
|
|
|
5297
|
|
|
// ErrorName returns error name. |
5298
|
|
|
func (e SchemaReadRequestMetadataValidationError) ErrorName() string { |
5299
|
|
|
return "SchemaReadRequestMetadataValidationError" |
5300
|
|
|
} |
5301
|
|
|
|
5302
|
|
|
// Error satisfies the builtin error interface |
5303
|
|
|
func (e SchemaReadRequestMetadataValidationError) Error() string { |
5304
|
|
|
cause := "" |
5305
|
|
|
if e.cause != nil { |
5306
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
5307
|
|
|
} |
5308
|
|
|
|
5309
|
|
|
key := "" |
5310
|
|
|
if e.key { |
5311
|
|
|
key = "key for " |
5312
|
|
|
} |
5313
|
|
|
|
5314
|
|
|
return fmt.Sprintf( |
5315
|
|
|
"invalid %sSchemaReadRequestMetadata.%s: %s%s", |
5316
|
|
|
key, |
5317
|
|
|
e.field, |
5318
|
|
|
e.reason, |
5319
|
|
|
cause) |
5320
|
|
|
} |
5321
|
|
|
|
5322
|
|
|
var _ error = SchemaReadRequestMetadataValidationError{} |
5323
|
|
|
|
5324
|
|
|
var _ interface { |
5325
|
|
|
Field() string |
5326
|
|
|
Reason() string |
5327
|
|
|
Key() bool |
5328
|
|
|
Cause() error |
5329
|
|
|
ErrorName() string |
5330
|
|
|
} = SchemaReadRequestMetadataValidationError{} |
5331
|
|
|
|
5332
|
|
|
// Validate checks the field values on SchemaReadResponse with the rules |
5333
|
|
|
// defined in the proto definition for this message. If any rules are |
5334
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
5335
|
|
|
func (m *SchemaReadResponse) Validate() error { |
5336
|
|
|
return m.validate(false) |
5337
|
|
|
} |
5338
|
|
|
|
5339
|
|
|
// ValidateAll checks the field values on SchemaReadResponse with the rules |
5340
|
|
|
// defined in the proto definition for this message. If any rules are |
5341
|
|
|
// violated, the result is a list of violation errors wrapped in |
5342
|
|
|
// SchemaReadResponseMultiError, or nil if none found. |
5343
|
|
|
func (m *SchemaReadResponse) ValidateAll() error { |
5344
|
|
|
return m.validate(true) |
5345
|
|
|
} |
5346
|
|
|
|
5347
|
|
|
func (m *SchemaReadResponse) validate(all bool) error { |
5348
|
|
|
if m == nil { |
5349
|
|
|
return nil |
5350
|
|
|
} |
5351
|
|
|
|
5352
|
|
|
var errors []error |
5353
|
|
|
|
5354
|
|
|
if all { |
5355
|
|
|
switch v := interface{}(m.GetSchema()).(type) { |
5356
|
|
|
case interface{ ValidateAll() error }: |
5357
|
|
|
if err := v.ValidateAll(); err != nil { |
5358
|
|
|
errors = append(errors, SchemaReadResponseValidationError{ |
5359
|
|
|
field: "Schema", |
5360
|
|
|
reason: "embedded message failed validation", |
5361
|
|
|
cause: err, |
5362
|
|
|
}) |
5363
|
|
|
} |
5364
|
|
|
case interface{ Validate() error }: |
5365
|
|
|
if err := v.Validate(); err != nil { |
5366
|
|
|
errors = append(errors, SchemaReadResponseValidationError{ |
5367
|
|
|
field: "Schema", |
5368
|
|
|
reason: "embedded message failed validation", |
5369
|
|
|
cause: err, |
5370
|
|
|
}) |
5371
|
|
|
} |
5372
|
|
|
} |
5373
|
|
|
} else if v, ok := interface{}(m.GetSchema()).(interface{ Validate() error }); ok { |
5374
|
|
|
if err := v.Validate(); err != nil { |
5375
|
|
|
return SchemaReadResponseValidationError{ |
5376
|
|
|
field: "Schema", |
5377
|
|
|
reason: "embedded message failed validation", |
5378
|
|
|
cause: err, |
5379
|
|
|
} |
5380
|
|
|
} |
5381
|
|
|
} |
5382
|
|
|
|
5383
|
|
|
if len(errors) > 0 { |
5384
|
|
|
return SchemaReadResponseMultiError(errors) |
5385
|
|
|
} |
5386
|
|
|
|
5387
|
|
|
return nil |
5388
|
|
|
} |
5389
|
|
|
|
5390
|
|
|
// SchemaReadResponseMultiError is an error wrapping multiple validation errors |
5391
|
|
|
// returned by SchemaReadResponse.ValidateAll() if the designated constraints |
5392
|
|
|
// aren't met. |
5393
|
|
|
type SchemaReadResponseMultiError []error |
5394
|
|
|
|
5395
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
5396
|
|
|
func (m SchemaReadResponseMultiError) Error() string { |
5397
|
|
|
var msgs []string |
5398
|
|
|
for _, err := range m { |
5399
|
|
|
msgs = append(msgs, err.Error()) |
5400
|
|
|
} |
5401
|
|
|
return strings.Join(msgs, "; ") |
5402
|
|
|
} |
5403
|
|
|
|
5404
|
|
|
// AllErrors returns a list of validation violation errors. |
5405
|
|
|
func (m SchemaReadResponseMultiError) AllErrors() []error { return m } |
5406
|
|
|
|
5407
|
|
|
// SchemaReadResponseValidationError is the validation error returned by |
5408
|
|
|
// SchemaReadResponse.Validate if the designated constraints aren't met. |
5409
|
|
|
type SchemaReadResponseValidationError struct { |
5410
|
|
|
field string |
5411
|
|
|
reason string |
5412
|
|
|
cause error |
5413
|
|
|
key bool |
5414
|
|
|
} |
5415
|
|
|
|
5416
|
|
|
// Field function returns field value. |
5417
|
|
|
func (e SchemaReadResponseValidationError) Field() string { return e.field } |
5418
|
|
|
|
5419
|
|
|
// Reason function returns reason value. |
5420
|
|
|
func (e SchemaReadResponseValidationError) Reason() string { return e.reason } |
5421
|
|
|
|
5422
|
|
|
// Cause function returns cause value. |
5423
|
|
|
func (e SchemaReadResponseValidationError) Cause() error { return e.cause } |
5424
|
|
|
|
5425
|
|
|
// Key function returns key value. |
5426
|
|
|
func (e SchemaReadResponseValidationError) Key() bool { return e.key } |
5427
|
|
|
|
5428
|
|
|
// ErrorName returns error name. |
5429
|
|
|
func (e SchemaReadResponseValidationError) ErrorName() string { |
5430
|
|
|
return "SchemaReadResponseValidationError" |
5431
|
|
|
} |
5432
|
|
|
|
5433
|
|
|
// Error satisfies the builtin error interface |
5434
|
|
|
func (e SchemaReadResponseValidationError) Error() string { |
5435
|
|
|
cause := "" |
5436
|
|
|
if e.cause != nil { |
5437
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
5438
|
|
|
} |
5439
|
|
|
|
5440
|
|
|
key := "" |
5441
|
|
|
if e.key { |
5442
|
|
|
key = "key for " |
5443
|
|
|
} |
5444
|
|
|
|
5445
|
|
|
return fmt.Sprintf( |
5446
|
|
|
"invalid %sSchemaReadResponse.%s: %s%s", |
5447
|
|
|
key, |
5448
|
|
|
e.field, |
5449
|
|
|
e.reason, |
5450
|
|
|
cause) |
5451
|
|
|
} |
5452
|
|
|
|
5453
|
|
|
var _ error = SchemaReadResponseValidationError{} |
5454
|
|
|
|
5455
|
|
|
var _ interface { |
5456
|
|
|
Field() string |
5457
|
|
|
Reason() string |
5458
|
|
|
Key() bool |
5459
|
|
|
Cause() error |
5460
|
|
|
ErrorName() string |
5461
|
|
|
} = SchemaReadResponseValidationError{} |
5462
|
|
|
|
5463
|
|
|
// Validate checks the field values on SchemaListRequest with the rules defined |
5464
|
|
|
// in the proto definition for this message. If any rules are violated, the |
5465
|
|
|
// first error encountered is returned, or nil if there are no violations. |
5466
|
|
|
func (m *SchemaListRequest) Validate() error { |
5467
|
|
|
return m.validate(false) |
5468
|
|
|
} |
5469
|
|
|
|
5470
|
|
|
// ValidateAll checks the field values on SchemaListRequest with the rules |
5471
|
|
|
// defined in the proto definition for this message. If any rules are |
5472
|
|
|
// violated, the result is a list of violation errors wrapped in |
5473
|
|
|
// SchemaListRequestMultiError, or nil if none found. |
5474
|
|
|
func (m *SchemaListRequest) ValidateAll() error { |
5475
|
|
|
return m.validate(true) |
5476
|
|
|
} |
5477
|
|
|
|
5478
|
|
|
func (m *SchemaListRequest) validate(all bool) error { |
5479
|
|
|
if m == nil { |
5480
|
|
|
return nil |
5481
|
|
|
} |
5482
|
|
|
|
5483
|
|
|
var errors []error |
5484
|
|
|
|
5485
|
|
|
if len(m.GetTenantId()) > 128 { |
5486
|
|
|
err := SchemaListRequestValidationError{ |
5487
|
|
|
field: "TenantId", |
5488
|
|
|
reason: "value length must be at most 128 bytes", |
5489
|
|
|
} |
5490
|
|
|
if !all { |
5491
|
|
|
return err |
5492
|
|
|
} |
5493
|
|
|
errors = append(errors, err) |
5494
|
|
|
} |
5495
|
|
|
|
5496
|
|
|
if !_SchemaListRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
5497
|
|
|
err := SchemaListRequestValidationError{ |
5498
|
|
|
field: "TenantId", |
5499
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
5500
|
|
|
} |
5501
|
|
|
if !all { |
5502
|
|
|
return err |
5503
|
|
|
} |
5504
|
|
|
errors = append(errors, err) |
5505
|
|
|
} |
5506
|
|
|
|
5507
|
|
|
if m.GetPageSize() != 0 { |
5508
|
|
|
|
5509
|
|
|
if m.GetPageSize() < 1 { |
5510
|
|
|
err := SchemaListRequestValidationError{ |
5511
|
|
|
field: "PageSize", |
5512
|
|
|
reason: "value must be greater than or equal to 1", |
5513
|
|
|
} |
5514
|
|
|
if !all { |
5515
|
|
|
return err |
5516
|
|
|
} |
5517
|
|
|
errors = append(errors, err) |
5518
|
|
|
} |
5519
|
|
|
|
5520
|
|
|
} |
5521
|
|
|
|
5522
|
|
|
if m.GetContinuousToken() != "" { |
5523
|
|
|
|
5524
|
|
|
} |
5525
|
|
|
|
5526
|
|
|
if len(errors) > 0 { |
5527
|
|
|
return SchemaListRequestMultiError(errors) |
5528
|
|
|
} |
5529
|
|
|
|
5530
|
|
|
return nil |
5531
|
|
|
} |
5532
|
|
|
|
5533
|
|
|
// SchemaListRequestMultiError is an error wrapping multiple validation errors |
5534
|
|
|
// returned by SchemaListRequest.ValidateAll() if the designated constraints |
5535
|
|
|
// aren't met. |
5536
|
|
|
type SchemaListRequestMultiError []error |
5537
|
|
|
|
5538
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
5539
|
|
|
func (m SchemaListRequestMultiError) Error() string { |
5540
|
|
|
var msgs []string |
5541
|
|
|
for _, err := range m { |
5542
|
|
|
msgs = append(msgs, err.Error()) |
5543
|
|
|
} |
5544
|
|
|
return strings.Join(msgs, "; ") |
5545
|
|
|
} |
5546
|
|
|
|
5547
|
|
|
// AllErrors returns a list of validation violation errors. |
5548
|
|
|
func (m SchemaListRequestMultiError) AllErrors() []error { return m } |
5549
|
|
|
|
5550
|
|
|
// SchemaListRequestValidationError is the validation error returned by |
5551
|
|
|
// SchemaListRequest.Validate if the designated constraints aren't met. |
5552
|
|
|
type SchemaListRequestValidationError struct { |
5553
|
|
|
field string |
5554
|
|
|
reason string |
5555
|
|
|
cause error |
5556
|
|
|
key bool |
5557
|
|
|
} |
5558
|
|
|
|
5559
|
|
|
// Field function returns field value. |
5560
|
|
|
func (e SchemaListRequestValidationError) Field() string { return e.field } |
5561
|
|
|
|
5562
|
|
|
// Reason function returns reason value. |
5563
|
|
|
func (e SchemaListRequestValidationError) Reason() string { return e.reason } |
5564
|
|
|
|
5565
|
|
|
// Cause function returns cause value. |
5566
|
|
|
func (e SchemaListRequestValidationError) Cause() error { return e.cause } |
5567
|
|
|
|
5568
|
|
|
// Key function returns key value. |
5569
|
|
|
func (e SchemaListRequestValidationError) Key() bool { return e.key } |
5570
|
|
|
|
5571
|
|
|
// ErrorName returns error name. |
5572
|
|
|
func (e SchemaListRequestValidationError) ErrorName() string { |
5573
|
|
|
return "SchemaListRequestValidationError" |
5574
|
|
|
} |
5575
|
|
|
|
5576
|
|
|
// Error satisfies the builtin error interface |
5577
|
|
|
func (e SchemaListRequestValidationError) Error() string { |
5578
|
|
|
cause := "" |
5579
|
|
|
if e.cause != nil { |
5580
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
5581
|
|
|
} |
5582
|
|
|
|
5583
|
|
|
key := "" |
5584
|
|
|
if e.key { |
5585
|
|
|
key = "key for " |
5586
|
|
|
} |
5587
|
|
|
|
5588
|
|
|
return fmt.Sprintf( |
5589
|
|
|
"invalid %sSchemaListRequest.%s: %s%s", |
5590
|
|
|
key, |
5591
|
|
|
e.field, |
5592
|
|
|
e.reason, |
5593
|
|
|
cause) |
5594
|
|
|
} |
5595
|
|
|
|
5596
|
|
|
var _ error = SchemaListRequestValidationError{} |
5597
|
|
|
|
5598
|
|
|
var _ interface { |
5599
|
|
|
Field() string |
5600
|
|
|
Reason() string |
5601
|
|
|
Key() bool |
5602
|
|
|
Cause() error |
5603
|
|
|
ErrorName() string |
5604
|
|
|
} = SchemaListRequestValidationError{} |
5605
|
|
|
|
5606
|
|
|
var _SchemaListRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
5607
|
|
|
|
5608
|
|
|
// Validate checks the field values on SchemaListResponse with the rules |
5609
|
|
|
// defined in the proto definition for this message. If any rules are |
5610
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
5611
|
|
|
func (m *SchemaListResponse) Validate() error { |
5612
|
|
|
return m.validate(false) |
5613
|
|
|
} |
5614
|
|
|
|
5615
|
|
|
// ValidateAll checks the field values on SchemaListResponse with the rules |
5616
|
|
|
// defined in the proto definition for this message. If any rules are |
5617
|
|
|
// violated, the result is a list of violation errors wrapped in |
5618
|
|
|
// SchemaListResponseMultiError, or nil if none found. |
5619
|
|
|
func (m *SchemaListResponse) ValidateAll() error { |
5620
|
|
|
return m.validate(true) |
5621
|
|
|
} |
5622
|
|
|
|
5623
|
|
|
func (m *SchemaListResponse) validate(all bool) error { |
5624
|
|
|
if m == nil { |
5625
|
|
|
return nil |
5626
|
|
|
} |
5627
|
|
|
|
5628
|
|
|
var errors []error |
5629
|
|
|
|
5630
|
|
|
// no validation rules for Head |
5631
|
|
|
|
5632
|
|
|
for idx, item := range m.GetSchemas() { |
5633
|
|
|
_, _ = idx, item |
5634
|
|
|
|
5635
|
|
|
if all { |
5636
|
|
|
switch v := interface{}(item).(type) { |
5637
|
|
|
case interface{ ValidateAll() error }: |
5638
|
|
|
if err := v.ValidateAll(); err != nil { |
5639
|
|
|
errors = append(errors, SchemaListResponseValidationError{ |
5640
|
|
|
field: fmt.Sprintf("Schemas[%v]", idx), |
5641
|
|
|
reason: "embedded message failed validation", |
5642
|
|
|
cause: err, |
5643
|
|
|
}) |
5644
|
|
|
} |
5645
|
|
|
case interface{ Validate() error }: |
5646
|
|
|
if err := v.Validate(); err != nil { |
5647
|
|
|
errors = append(errors, SchemaListResponseValidationError{ |
5648
|
|
|
field: fmt.Sprintf("Schemas[%v]", idx), |
5649
|
|
|
reason: "embedded message failed validation", |
5650
|
|
|
cause: err, |
5651
|
|
|
}) |
5652
|
|
|
} |
5653
|
|
|
} |
5654
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
5655
|
|
|
if err := v.Validate(); err != nil { |
5656
|
|
|
return SchemaListResponseValidationError{ |
5657
|
|
|
field: fmt.Sprintf("Schemas[%v]", idx), |
5658
|
|
|
reason: "embedded message failed validation", |
5659
|
|
|
cause: err, |
5660
|
|
|
} |
5661
|
|
|
} |
5662
|
|
|
} |
5663
|
|
|
|
5664
|
|
|
} |
5665
|
|
|
|
5666
|
|
|
// no validation rules for ContinuousToken |
5667
|
|
|
|
5668
|
|
|
if len(errors) > 0 { |
5669
|
|
|
return SchemaListResponseMultiError(errors) |
5670
|
|
|
} |
5671
|
|
|
|
5672
|
|
|
return nil |
5673
|
|
|
} |
5674
|
|
|
|
5675
|
|
|
// SchemaListResponseMultiError is an error wrapping multiple validation errors |
5676
|
|
|
// returned by SchemaListResponse.ValidateAll() if the designated constraints |
5677
|
|
|
// aren't met. |
5678
|
|
|
type SchemaListResponseMultiError []error |
5679
|
|
|
|
5680
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
5681
|
|
|
func (m SchemaListResponseMultiError) Error() string { |
5682
|
|
|
var msgs []string |
5683
|
|
|
for _, err := range m { |
5684
|
|
|
msgs = append(msgs, err.Error()) |
5685
|
|
|
} |
5686
|
|
|
return strings.Join(msgs, "; ") |
5687
|
|
|
} |
5688
|
|
|
|
5689
|
|
|
// AllErrors returns a list of validation violation errors. |
5690
|
|
|
func (m SchemaListResponseMultiError) AllErrors() []error { return m } |
5691
|
|
|
|
5692
|
|
|
// SchemaListResponseValidationError is the validation error returned by |
5693
|
|
|
// SchemaListResponse.Validate if the designated constraints aren't met. |
5694
|
|
|
type SchemaListResponseValidationError struct { |
5695
|
|
|
field string |
5696
|
|
|
reason string |
5697
|
|
|
cause error |
5698
|
|
|
key bool |
5699
|
|
|
} |
5700
|
|
|
|
5701
|
|
|
// Field function returns field value. |
5702
|
|
|
func (e SchemaListResponseValidationError) Field() string { return e.field } |
5703
|
|
|
|
5704
|
|
|
// Reason function returns reason value. |
5705
|
|
|
func (e SchemaListResponseValidationError) Reason() string { return e.reason } |
5706
|
|
|
|
5707
|
|
|
// Cause function returns cause value. |
5708
|
|
|
func (e SchemaListResponseValidationError) Cause() error { return e.cause } |
5709
|
|
|
|
5710
|
|
|
// Key function returns key value. |
5711
|
|
|
func (e SchemaListResponseValidationError) Key() bool { return e.key } |
5712
|
|
|
|
5713
|
|
|
// ErrorName returns error name. |
5714
|
|
|
func (e SchemaListResponseValidationError) ErrorName() string { |
5715
|
|
|
return "SchemaListResponseValidationError" |
5716
|
|
|
} |
5717
|
|
|
|
5718
|
|
|
// Error satisfies the builtin error interface |
5719
|
|
|
func (e SchemaListResponseValidationError) Error() string { |
5720
|
|
|
cause := "" |
5721
|
|
|
if e.cause != nil { |
5722
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
5723
|
|
|
} |
5724
|
|
|
|
5725
|
|
|
key := "" |
5726
|
|
|
if e.key { |
5727
|
|
|
key = "key for " |
5728
|
|
|
} |
5729
|
|
|
|
5730
|
|
|
return fmt.Sprintf( |
5731
|
|
|
"invalid %sSchemaListResponse.%s: %s%s", |
5732
|
|
|
key, |
5733
|
|
|
e.field, |
5734
|
|
|
e.reason, |
5735
|
|
|
cause) |
5736
|
|
|
} |
5737
|
|
|
|
5738
|
|
|
var _ error = SchemaListResponseValidationError{} |
5739
|
|
|
|
5740
|
|
|
var _ interface { |
5741
|
|
|
Field() string |
5742
|
|
|
Reason() string |
5743
|
|
|
Key() bool |
5744
|
|
|
Cause() error |
5745
|
|
|
ErrorName() string |
5746
|
|
|
} = SchemaListResponseValidationError{} |
5747
|
|
|
|
5748
|
|
|
// Validate checks the field values on SchemaList with the rules defined in the |
5749
|
|
|
// proto definition for this message. If any rules are violated, the first |
5750
|
|
|
// error encountered is returned, or nil if there are no violations. |
5751
|
|
|
func (m *SchemaList) Validate() error { |
5752
|
|
|
return m.validate(false) |
5753
|
|
|
} |
5754
|
|
|
|
5755
|
|
|
// ValidateAll checks the field values on SchemaList with the rules defined in |
5756
|
|
|
// the proto definition for this message. If any rules are violated, the |
5757
|
|
|
// result is a list of violation errors wrapped in SchemaListMultiError, or |
5758
|
|
|
// nil if none found. |
5759
|
|
|
func (m *SchemaList) ValidateAll() error { |
5760
|
|
|
return m.validate(true) |
5761
|
|
|
} |
5762
|
|
|
|
5763
|
|
|
func (m *SchemaList) validate(all bool) error { |
5764
|
|
|
if m == nil { |
5765
|
|
|
return nil |
5766
|
|
|
} |
5767
|
|
|
|
5768
|
|
|
var errors []error |
5769
|
|
|
|
5770
|
|
|
// no validation rules for Version |
5771
|
|
|
|
5772
|
|
|
// no validation rules for CreatedAt |
5773
|
|
|
|
5774
|
|
|
if len(errors) > 0 { |
5775
|
|
|
return SchemaListMultiError(errors) |
5776
|
|
|
} |
5777
|
|
|
|
5778
|
|
|
return nil |
5779
|
|
|
} |
5780
|
|
|
|
5781
|
|
|
// SchemaListMultiError is an error wrapping multiple validation errors |
5782
|
|
|
// returned by SchemaList.ValidateAll() if the designated constraints aren't met. |
5783
|
|
|
type SchemaListMultiError []error |
5784
|
|
|
|
5785
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
5786
|
|
|
func (m SchemaListMultiError) Error() string { |
5787
|
|
|
var msgs []string |
5788
|
|
|
for _, err := range m { |
5789
|
|
|
msgs = append(msgs, err.Error()) |
5790
|
|
|
} |
5791
|
|
|
return strings.Join(msgs, "; ") |
5792
|
|
|
} |
5793
|
|
|
|
5794
|
|
|
// AllErrors returns a list of validation violation errors. |
5795
|
|
|
func (m SchemaListMultiError) AllErrors() []error { return m } |
5796
|
|
|
|
5797
|
|
|
// SchemaListValidationError is the validation error returned by |
5798
|
|
|
// SchemaList.Validate if the designated constraints aren't met. |
5799
|
|
|
type SchemaListValidationError struct { |
5800
|
|
|
field string |
5801
|
|
|
reason string |
5802
|
|
|
cause error |
5803
|
|
|
key bool |
5804
|
|
|
} |
5805
|
|
|
|
5806
|
|
|
// Field function returns field value. |
5807
|
|
|
func (e SchemaListValidationError) Field() string { return e.field } |
5808
|
|
|
|
5809
|
|
|
// Reason function returns reason value. |
5810
|
|
|
func (e SchemaListValidationError) Reason() string { return e.reason } |
5811
|
|
|
|
5812
|
|
|
// Cause function returns cause value. |
5813
|
|
|
func (e SchemaListValidationError) Cause() error { return e.cause } |
5814
|
|
|
|
5815
|
|
|
// Key function returns key value. |
5816
|
|
|
func (e SchemaListValidationError) Key() bool { return e.key } |
5817
|
|
|
|
5818
|
|
|
// ErrorName returns error name. |
5819
|
|
|
func (e SchemaListValidationError) ErrorName() string { return "SchemaListValidationError" } |
5820
|
|
|
|
5821
|
|
|
// Error satisfies the builtin error interface |
5822
|
|
|
func (e SchemaListValidationError) Error() string { |
5823
|
|
|
cause := "" |
5824
|
|
|
if e.cause != nil { |
5825
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
5826
|
|
|
} |
5827
|
|
|
|
5828
|
|
|
key := "" |
5829
|
|
|
if e.key { |
5830
|
|
|
key = "key for " |
5831
|
|
|
} |
5832
|
|
|
|
5833
|
|
|
return fmt.Sprintf( |
5834
|
|
|
"invalid %sSchemaList.%s: %s%s", |
5835
|
|
|
key, |
5836
|
|
|
e.field, |
5837
|
|
|
e.reason, |
5838
|
|
|
cause) |
5839
|
|
|
} |
5840
|
|
|
|
5841
|
|
|
var _ error = SchemaListValidationError{} |
5842
|
|
|
|
5843
|
|
|
var _ interface { |
5844
|
|
|
Field() string |
5845
|
|
|
Reason() string |
5846
|
|
|
Key() bool |
5847
|
|
|
Cause() error |
5848
|
|
|
ErrorName() string |
5849
|
|
|
} = SchemaListValidationError{} |
5850
|
|
|
|
5851
|
|
|
// Validate checks the field values on DataWriteRequest with the rules defined |
5852
|
|
|
// in the proto definition for this message. If any rules are violated, the |
5853
|
|
|
// first error encountered is returned, or nil if there are no violations. |
5854
|
|
|
func (m *DataWriteRequest) Validate() error { |
5855
|
|
|
return m.validate(false) |
5856
|
|
|
} |
5857
|
|
|
|
5858
|
|
|
// ValidateAll checks the field values on DataWriteRequest with the rules |
5859
|
|
|
// defined in the proto definition for this message. If any rules are |
5860
|
|
|
// violated, the result is a list of violation errors wrapped in |
5861
|
|
|
// DataWriteRequestMultiError, or nil if none found. |
5862
|
|
|
func (m *DataWriteRequest) ValidateAll() error { |
5863
|
|
|
return m.validate(true) |
5864
|
|
|
} |
5865
|
|
|
|
5866
|
|
|
func (m *DataWriteRequest) validate(all bool) error { |
5867
|
|
|
if m == nil { |
5868
|
|
|
return nil |
5869
|
|
|
} |
5870
|
|
|
|
5871
|
|
|
var errors []error |
5872
|
|
|
|
5873
|
|
|
if len(m.GetTenantId()) > 128 { |
5874
|
|
|
err := DataWriteRequestValidationError{ |
5875
|
|
|
field: "TenantId", |
5876
|
|
|
reason: "value length must be at most 128 bytes", |
5877
|
|
|
} |
5878
|
|
|
if !all { |
5879
|
|
|
return err |
5880
|
|
|
} |
5881
|
|
|
errors = append(errors, err) |
5882
|
|
|
} |
5883
|
|
|
|
5884
|
|
|
if !_DataWriteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
5885
|
|
|
err := DataWriteRequestValidationError{ |
5886
|
|
|
field: "TenantId", |
5887
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
5888
|
|
|
} |
5889
|
|
|
if !all { |
5890
|
|
|
return err |
5891
|
|
|
} |
5892
|
|
|
errors = append(errors, err) |
5893
|
|
|
} |
5894
|
|
|
|
5895
|
|
|
if m.GetMetadata() == nil { |
5896
|
|
|
err := DataWriteRequestValidationError{ |
5897
|
|
|
field: "Metadata", |
5898
|
|
|
reason: "value is required", |
5899
|
|
|
} |
5900
|
|
|
if !all { |
5901
|
|
|
return err |
5902
|
|
|
} |
5903
|
|
|
errors = append(errors, err) |
5904
|
|
|
} |
5905
|
|
|
|
5906
|
|
|
if all { |
5907
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
5908
|
|
|
case interface{ ValidateAll() error }: |
5909
|
|
|
if err := v.ValidateAll(); err != nil { |
5910
|
|
|
errors = append(errors, DataWriteRequestValidationError{ |
5911
|
|
|
field: "Metadata", |
5912
|
|
|
reason: "embedded message failed validation", |
5913
|
|
|
cause: err, |
5914
|
|
|
}) |
5915
|
|
|
} |
5916
|
|
|
case interface{ Validate() error }: |
5917
|
|
|
if err := v.Validate(); err != nil { |
5918
|
|
|
errors = append(errors, DataWriteRequestValidationError{ |
5919
|
|
|
field: "Metadata", |
5920
|
|
|
reason: "embedded message failed validation", |
5921
|
|
|
cause: err, |
5922
|
|
|
}) |
5923
|
|
|
} |
5924
|
|
|
} |
5925
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
5926
|
|
|
if err := v.Validate(); err != nil { |
5927
|
|
|
return DataWriteRequestValidationError{ |
5928
|
|
|
field: "Metadata", |
5929
|
|
|
reason: "embedded message failed validation", |
5930
|
|
|
cause: err, |
5931
|
|
|
} |
5932
|
|
|
} |
5933
|
|
|
} |
5934
|
|
|
|
5935
|
|
|
if len(m.GetTuples()) > 100 { |
5936
|
|
|
err := DataWriteRequestValidationError{ |
5937
|
|
|
field: "Tuples", |
5938
|
|
|
reason: "value must contain no more than 100 item(s)", |
5939
|
|
|
} |
5940
|
|
|
if !all { |
5941
|
|
|
return err |
5942
|
|
|
} |
5943
|
|
|
errors = append(errors, err) |
5944
|
|
|
} |
5945
|
|
|
|
5946
|
|
|
for idx, item := range m.GetTuples() { |
5947
|
|
|
_, _ = idx, item |
5948
|
|
|
|
5949
|
|
|
if item == nil { |
5950
|
|
|
err := DataWriteRequestValidationError{ |
5951
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
5952
|
|
|
reason: "value is required", |
5953
|
|
|
} |
5954
|
|
|
if !all { |
5955
|
|
|
return err |
5956
|
|
|
} |
5957
|
|
|
errors = append(errors, err) |
5958
|
|
|
} |
5959
|
|
|
|
5960
|
|
|
if all { |
5961
|
|
|
switch v := interface{}(item).(type) { |
5962
|
|
|
case interface{ ValidateAll() error }: |
5963
|
|
|
if err := v.ValidateAll(); err != nil { |
5964
|
|
|
errors = append(errors, DataWriteRequestValidationError{ |
5965
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
5966
|
|
|
reason: "embedded message failed validation", |
5967
|
|
|
cause: err, |
5968
|
|
|
}) |
5969
|
|
|
} |
5970
|
|
|
case interface{ Validate() error }: |
5971
|
|
|
if err := v.Validate(); err != nil { |
5972
|
|
|
errors = append(errors, DataWriteRequestValidationError{ |
5973
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
5974
|
|
|
reason: "embedded message failed validation", |
5975
|
|
|
cause: err, |
5976
|
|
|
}) |
5977
|
|
|
} |
5978
|
|
|
} |
5979
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
5980
|
|
|
if err := v.Validate(); err != nil { |
5981
|
|
|
return DataWriteRequestValidationError{ |
5982
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
5983
|
|
|
reason: "embedded message failed validation", |
5984
|
|
|
cause: err, |
5985
|
|
|
} |
5986
|
|
|
} |
5987
|
|
|
} |
5988
|
|
|
|
5989
|
|
|
} |
5990
|
|
|
|
5991
|
|
|
if len(m.GetAttributes()) > 100 { |
5992
|
|
|
err := DataWriteRequestValidationError{ |
5993
|
|
|
field: "Attributes", |
5994
|
|
|
reason: "value must contain no more than 100 item(s)", |
5995
|
|
|
} |
5996
|
|
|
if !all { |
5997
|
|
|
return err |
5998
|
|
|
} |
5999
|
|
|
errors = append(errors, err) |
6000
|
|
|
} |
6001
|
|
|
|
6002
|
|
|
for idx, item := range m.GetAttributes() { |
6003
|
|
|
_, _ = idx, item |
6004
|
|
|
|
6005
|
|
|
if item == nil { |
6006
|
|
|
err := DataWriteRequestValidationError{ |
6007
|
|
|
field: fmt.Sprintf("Attributes[%v]", idx), |
6008
|
|
|
reason: "value is required", |
6009
|
|
|
} |
6010
|
|
|
if !all { |
6011
|
|
|
return err |
6012
|
|
|
} |
6013
|
|
|
errors = append(errors, err) |
6014
|
|
|
} |
6015
|
|
|
|
6016
|
|
|
if all { |
6017
|
|
|
switch v := interface{}(item).(type) { |
6018
|
|
|
case interface{ ValidateAll() error }: |
6019
|
|
|
if err := v.ValidateAll(); err != nil { |
6020
|
|
|
errors = append(errors, DataWriteRequestValidationError{ |
6021
|
|
|
field: fmt.Sprintf("Attributes[%v]", idx), |
6022
|
|
|
reason: "embedded message failed validation", |
6023
|
|
|
cause: err, |
6024
|
|
|
}) |
6025
|
|
|
} |
6026
|
|
|
case interface{ Validate() error }: |
6027
|
|
|
if err := v.Validate(); err != nil { |
6028
|
|
|
errors = append(errors, DataWriteRequestValidationError{ |
6029
|
|
|
field: fmt.Sprintf("Attributes[%v]", idx), |
6030
|
|
|
reason: "embedded message failed validation", |
6031
|
|
|
cause: err, |
6032
|
|
|
}) |
6033
|
|
|
} |
6034
|
|
|
} |
6035
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
6036
|
|
|
if err := v.Validate(); err != nil { |
6037
|
|
|
return DataWriteRequestValidationError{ |
6038
|
|
|
field: fmt.Sprintf("Attributes[%v]", idx), |
6039
|
|
|
reason: "embedded message failed validation", |
6040
|
|
|
cause: err, |
6041
|
|
|
} |
6042
|
|
|
} |
6043
|
|
|
} |
6044
|
|
|
|
6045
|
|
|
} |
6046
|
|
|
|
6047
|
|
|
if len(errors) > 0 { |
6048
|
|
|
return DataWriteRequestMultiError(errors) |
6049
|
|
|
} |
6050
|
|
|
|
6051
|
|
|
return nil |
6052
|
|
|
} |
6053
|
|
|
|
6054
|
|
|
// DataWriteRequestMultiError is an error wrapping multiple validation errors |
6055
|
|
|
// returned by DataWriteRequest.ValidateAll() if the designated constraints |
6056
|
|
|
// aren't met. |
6057
|
|
|
type DataWriteRequestMultiError []error |
6058
|
|
|
|
6059
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
6060
|
|
|
func (m DataWriteRequestMultiError) Error() string { |
6061
|
|
|
var msgs []string |
6062
|
|
|
for _, err := range m { |
6063
|
|
|
msgs = append(msgs, err.Error()) |
6064
|
|
|
} |
6065
|
|
|
return strings.Join(msgs, "; ") |
6066
|
|
|
} |
6067
|
|
|
|
6068
|
|
|
// AllErrors returns a list of validation violation errors. |
6069
|
|
|
func (m DataWriteRequestMultiError) AllErrors() []error { return m } |
6070
|
|
|
|
6071
|
|
|
// DataWriteRequestValidationError is the validation error returned by |
6072
|
|
|
// DataWriteRequest.Validate if the designated constraints aren't met. |
6073
|
|
|
type DataWriteRequestValidationError struct { |
6074
|
|
|
field string |
6075
|
|
|
reason string |
6076
|
|
|
cause error |
6077
|
|
|
key bool |
6078
|
|
|
} |
6079
|
|
|
|
6080
|
|
|
// Field function returns field value. |
6081
|
|
|
func (e DataWriteRequestValidationError) Field() string { return e.field } |
6082
|
|
|
|
6083
|
|
|
// Reason function returns reason value. |
6084
|
|
|
func (e DataWriteRequestValidationError) Reason() string { return e.reason } |
6085
|
|
|
|
6086
|
|
|
// Cause function returns cause value. |
6087
|
|
|
func (e DataWriteRequestValidationError) Cause() error { return e.cause } |
6088
|
|
|
|
6089
|
|
|
// Key function returns key value. |
6090
|
|
|
func (e DataWriteRequestValidationError) Key() bool { return e.key } |
6091
|
|
|
|
6092
|
|
|
// ErrorName returns error name. |
6093
|
|
|
func (e DataWriteRequestValidationError) ErrorName() string { return "DataWriteRequestValidationError" } |
6094
|
|
|
|
6095
|
|
|
// Error satisfies the builtin error interface |
6096
|
|
|
func (e DataWriteRequestValidationError) Error() string { |
6097
|
|
|
cause := "" |
6098
|
|
|
if e.cause != nil { |
6099
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
6100
|
|
|
} |
6101
|
|
|
|
6102
|
|
|
key := "" |
6103
|
|
|
if e.key { |
6104
|
|
|
key = "key for " |
6105
|
|
|
} |
6106
|
|
|
|
6107
|
|
|
return fmt.Sprintf( |
6108
|
|
|
"invalid %sDataWriteRequest.%s: %s%s", |
6109
|
|
|
key, |
6110
|
|
|
e.field, |
6111
|
|
|
e.reason, |
6112
|
|
|
cause) |
6113
|
|
|
} |
6114
|
|
|
|
6115
|
|
|
var _ error = DataWriteRequestValidationError{} |
6116
|
|
|
|
6117
|
|
|
var _ interface { |
6118
|
|
|
Field() string |
6119
|
|
|
Reason() string |
6120
|
|
|
Key() bool |
6121
|
|
|
Cause() error |
6122
|
|
|
ErrorName() string |
6123
|
|
|
} = DataWriteRequestValidationError{} |
6124
|
|
|
|
6125
|
|
|
var _DataWriteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
6126
|
|
|
|
6127
|
|
|
// Validate checks the field values on DataWriteRequestMetadata with the rules |
6128
|
|
|
// defined in the proto definition for this message. If any rules are |
6129
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
6130
|
|
|
func (m *DataWriteRequestMetadata) Validate() error { |
6131
|
|
|
return m.validate(false) |
6132
|
|
|
} |
6133
|
|
|
|
6134
|
|
|
// ValidateAll checks the field values on DataWriteRequestMetadata with the |
6135
|
|
|
// rules defined in the proto definition for this message. If any rules are |
6136
|
|
|
// violated, the result is a list of violation errors wrapped in |
6137
|
|
|
// DataWriteRequestMetadataMultiError, or nil if none found. |
6138
|
|
|
func (m *DataWriteRequestMetadata) ValidateAll() error { |
6139
|
|
|
return m.validate(true) |
6140
|
|
|
} |
6141
|
|
|
|
6142
|
|
|
func (m *DataWriteRequestMetadata) validate(all bool) error { |
6143
|
|
|
if m == nil { |
6144
|
|
|
return nil |
6145
|
|
|
} |
6146
|
|
|
|
6147
|
|
|
var errors []error |
6148
|
|
|
|
6149
|
|
|
// no validation rules for SchemaVersion |
6150
|
|
|
|
6151
|
|
|
if len(errors) > 0 { |
6152
|
|
|
return DataWriteRequestMetadataMultiError(errors) |
6153
|
|
|
} |
6154
|
|
|
|
6155
|
|
|
return nil |
6156
|
|
|
} |
6157
|
|
|
|
6158
|
|
|
// DataWriteRequestMetadataMultiError is an error wrapping multiple validation |
6159
|
|
|
// errors returned by DataWriteRequestMetadata.ValidateAll() if the designated |
6160
|
|
|
// constraints aren't met. |
6161
|
|
|
type DataWriteRequestMetadataMultiError []error |
6162
|
|
|
|
6163
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
6164
|
|
|
func (m DataWriteRequestMetadataMultiError) Error() string { |
6165
|
|
|
var msgs []string |
6166
|
|
|
for _, err := range m { |
6167
|
|
|
msgs = append(msgs, err.Error()) |
6168
|
|
|
} |
6169
|
|
|
return strings.Join(msgs, "; ") |
6170
|
|
|
} |
6171
|
|
|
|
6172
|
|
|
// AllErrors returns a list of validation violation errors. |
6173
|
|
|
func (m DataWriteRequestMetadataMultiError) AllErrors() []error { return m } |
6174
|
|
|
|
6175
|
|
|
// DataWriteRequestMetadataValidationError is the validation error returned by |
6176
|
|
|
// DataWriteRequestMetadata.Validate if the designated constraints aren't met. |
6177
|
|
|
type DataWriteRequestMetadataValidationError struct { |
6178
|
|
|
field string |
6179
|
|
|
reason string |
6180
|
|
|
cause error |
6181
|
|
|
key bool |
6182
|
|
|
} |
6183
|
|
|
|
6184
|
|
|
// Field function returns field value. |
6185
|
|
|
func (e DataWriteRequestMetadataValidationError) Field() string { return e.field } |
6186
|
|
|
|
6187
|
|
|
// Reason function returns reason value. |
6188
|
|
|
func (e DataWriteRequestMetadataValidationError) Reason() string { return e.reason } |
6189
|
|
|
|
6190
|
|
|
// Cause function returns cause value. |
6191
|
|
|
func (e DataWriteRequestMetadataValidationError) Cause() error { return e.cause } |
6192
|
|
|
|
6193
|
|
|
// Key function returns key value. |
6194
|
|
|
func (e DataWriteRequestMetadataValidationError) Key() bool { return e.key } |
6195
|
|
|
|
6196
|
|
|
// ErrorName returns error name. |
6197
|
|
|
func (e DataWriteRequestMetadataValidationError) ErrorName() string { |
6198
|
|
|
return "DataWriteRequestMetadataValidationError" |
6199
|
|
|
} |
6200
|
|
|
|
6201
|
|
|
// Error satisfies the builtin error interface |
6202
|
|
|
func (e DataWriteRequestMetadataValidationError) Error() string { |
6203
|
|
|
cause := "" |
6204
|
|
|
if e.cause != nil { |
6205
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
6206
|
|
|
} |
6207
|
|
|
|
6208
|
|
|
key := "" |
6209
|
|
|
if e.key { |
6210
|
|
|
key = "key for " |
6211
|
|
|
} |
6212
|
|
|
|
6213
|
|
|
return fmt.Sprintf( |
6214
|
|
|
"invalid %sDataWriteRequestMetadata.%s: %s%s", |
6215
|
|
|
key, |
6216
|
|
|
e.field, |
6217
|
|
|
e.reason, |
6218
|
|
|
cause) |
6219
|
|
|
} |
6220
|
|
|
|
6221
|
|
|
var _ error = DataWriteRequestMetadataValidationError{} |
6222
|
|
|
|
6223
|
|
|
var _ interface { |
6224
|
|
|
Field() string |
6225
|
|
|
Reason() string |
6226
|
|
|
Key() bool |
6227
|
|
|
Cause() error |
6228
|
|
|
ErrorName() string |
6229
|
|
|
} = DataWriteRequestMetadataValidationError{} |
6230
|
|
|
|
6231
|
|
|
// Validate checks the field values on DataWriteResponse with the rules defined |
6232
|
|
|
// in the proto definition for this message. If any rules are violated, the |
6233
|
|
|
// first error encountered is returned, or nil if there are no violations. |
6234
|
|
|
func (m *DataWriteResponse) Validate() error { |
6235
|
|
|
return m.validate(false) |
6236
|
|
|
} |
6237
|
|
|
|
6238
|
|
|
// ValidateAll checks the field values on DataWriteResponse with the rules |
6239
|
|
|
// defined in the proto definition for this message. If any rules are |
6240
|
|
|
// violated, the result is a list of violation errors wrapped in |
6241
|
|
|
// DataWriteResponseMultiError, or nil if none found. |
6242
|
|
|
func (m *DataWriteResponse) ValidateAll() error { |
6243
|
|
|
return m.validate(true) |
6244
|
|
|
} |
6245
|
|
|
|
6246
|
|
|
func (m *DataWriteResponse) validate(all bool) error { |
6247
|
|
|
if m == nil { |
6248
|
|
|
return nil |
6249
|
|
|
} |
6250
|
|
|
|
6251
|
|
|
var errors []error |
6252
|
|
|
|
6253
|
|
|
// no validation rules for SnapToken |
6254
|
|
|
|
6255
|
|
|
if len(errors) > 0 { |
6256
|
|
|
return DataWriteResponseMultiError(errors) |
6257
|
|
|
} |
6258
|
|
|
|
6259
|
|
|
return nil |
6260
|
|
|
} |
6261
|
|
|
|
6262
|
|
|
// DataWriteResponseMultiError is an error wrapping multiple validation errors |
6263
|
|
|
// returned by DataWriteResponse.ValidateAll() if the designated constraints |
6264
|
|
|
// aren't met. |
6265
|
|
|
type DataWriteResponseMultiError []error |
6266
|
|
|
|
6267
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
6268
|
|
|
func (m DataWriteResponseMultiError) Error() string { |
6269
|
|
|
var msgs []string |
6270
|
|
|
for _, err := range m { |
6271
|
|
|
msgs = append(msgs, err.Error()) |
6272
|
|
|
} |
6273
|
|
|
return strings.Join(msgs, "; ") |
6274
|
|
|
} |
6275
|
|
|
|
6276
|
|
|
// AllErrors returns a list of validation violation errors. |
6277
|
|
|
func (m DataWriteResponseMultiError) AllErrors() []error { return m } |
6278
|
|
|
|
6279
|
|
|
// DataWriteResponseValidationError is the validation error returned by |
6280
|
|
|
// DataWriteResponse.Validate if the designated constraints aren't met. |
6281
|
|
|
type DataWriteResponseValidationError struct { |
6282
|
|
|
field string |
6283
|
|
|
reason string |
6284
|
|
|
cause error |
6285
|
|
|
key bool |
6286
|
|
|
} |
6287
|
|
|
|
6288
|
|
|
// Field function returns field value. |
6289
|
|
|
func (e DataWriteResponseValidationError) Field() string { return e.field } |
6290
|
|
|
|
6291
|
|
|
// Reason function returns reason value. |
6292
|
|
|
func (e DataWriteResponseValidationError) Reason() string { return e.reason } |
6293
|
|
|
|
6294
|
|
|
// Cause function returns cause value. |
6295
|
|
|
func (e DataWriteResponseValidationError) Cause() error { return e.cause } |
6296
|
|
|
|
6297
|
|
|
// Key function returns key value. |
6298
|
|
|
func (e DataWriteResponseValidationError) Key() bool { return e.key } |
6299
|
|
|
|
6300
|
|
|
// ErrorName returns error name. |
6301
|
|
|
func (e DataWriteResponseValidationError) ErrorName() string { |
6302
|
|
|
return "DataWriteResponseValidationError" |
6303
|
|
|
} |
6304
|
|
|
|
6305
|
|
|
// Error satisfies the builtin error interface |
6306
|
|
|
func (e DataWriteResponseValidationError) Error() string { |
6307
|
|
|
cause := "" |
6308
|
|
|
if e.cause != nil { |
6309
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
6310
|
|
|
} |
6311
|
|
|
|
6312
|
|
|
key := "" |
6313
|
|
|
if e.key { |
6314
|
|
|
key = "key for " |
6315
|
|
|
} |
6316
|
|
|
|
6317
|
|
|
return fmt.Sprintf( |
6318
|
|
|
"invalid %sDataWriteResponse.%s: %s%s", |
6319
|
|
|
key, |
6320
|
|
|
e.field, |
6321
|
|
|
e.reason, |
6322
|
|
|
cause) |
6323
|
|
|
} |
6324
|
|
|
|
6325
|
|
|
var _ error = DataWriteResponseValidationError{} |
6326
|
|
|
|
6327
|
|
|
var _ interface { |
6328
|
|
|
Field() string |
6329
|
|
|
Reason() string |
6330
|
|
|
Key() bool |
6331
|
|
|
Cause() error |
6332
|
|
|
ErrorName() string |
6333
|
|
|
} = DataWriteResponseValidationError{} |
6334
|
|
|
|
6335
|
|
|
// Validate checks the field values on RelationshipWriteRequest with the rules |
6336
|
|
|
// defined in the proto definition for this message. If any rules are |
6337
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
6338
|
|
|
func (m *RelationshipWriteRequest) Validate() error { |
6339
|
|
|
return m.validate(false) |
6340
|
|
|
} |
6341
|
|
|
|
6342
|
|
|
// ValidateAll checks the field values on RelationshipWriteRequest with the |
6343
|
|
|
// rules defined in the proto definition for this message. If any rules are |
6344
|
|
|
// violated, the result is a list of violation errors wrapped in |
6345
|
|
|
// RelationshipWriteRequestMultiError, or nil if none found. |
6346
|
|
|
func (m *RelationshipWriteRequest) ValidateAll() error { |
6347
|
|
|
return m.validate(true) |
6348
|
|
|
} |
6349
|
|
|
|
6350
|
|
|
func (m *RelationshipWriteRequest) validate(all bool) error { |
6351
|
|
|
if m == nil { |
6352
|
|
|
return nil |
6353
|
|
|
} |
6354
|
|
|
|
6355
|
|
|
var errors []error |
6356
|
|
|
|
6357
|
|
|
if len(m.GetTenantId()) > 128 { |
6358
|
|
|
err := RelationshipWriteRequestValidationError{ |
6359
|
|
|
field: "TenantId", |
6360
|
|
|
reason: "value length must be at most 128 bytes", |
6361
|
|
|
} |
6362
|
|
|
if !all { |
6363
|
|
|
return err |
6364
|
|
|
} |
6365
|
|
|
errors = append(errors, err) |
6366
|
|
|
} |
6367
|
|
|
|
6368
|
|
|
if !_RelationshipWriteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
6369
|
|
|
err := RelationshipWriteRequestValidationError{ |
6370
|
|
|
field: "TenantId", |
6371
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
6372
|
|
|
} |
6373
|
|
|
if !all { |
6374
|
|
|
return err |
6375
|
|
|
} |
6376
|
|
|
errors = append(errors, err) |
6377
|
|
|
} |
6378
|
|
|
|
6379
|
|
|
if m.GetMetadata() == nil { |
6380
|
|
|
err := RelationshipWriteRequestValidationError{ |
6381
|
|
|
field: "Metadata", |
6382
|
|
|
reason: "value is required", |
6383
|
|
|
} |
6384
|
|
|
if !all { |
6385
|
|
|
return err |
6386
|
|
|
} |
6387
|
|
|
errors = append(errors, err) |
6388
|
|
|
} |
6389
|
|
|
|
6390
|
|
|
if all { |
6391
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
6392
|
|
|
case interface{ ValidateAll() error }: |
6393
|
|
|
if err := v.ValidateAll(); err != nil { |
6394
|
|
|
errors = append(errors, RelationshipWriteRequestValidationError{ |
6395
|
|
|
field: "Metadata", |
6396
|
|
|
reason: "embedded message failed validation", |
6397
|
|
|
cause: err, |
6398
|
|
|
}) |
6399
|
|
|
} |
6400
|
|
|
case interface{ Validate() error }: |
6401
|
|
|
if err := v.Validate(); err != nil { |
6402
|
|
|
errors = append(errors, RelationshipWriteRequestValidationError{ |
6403
|
|
|
field: "Metadata", |
6404
|
|
|
reason: "embedded message failed validation", |
6405
|
|
|
cause: err, |
6406
|
|
|
}) |
6407
|
|
|
} |
6408
|
|
|
} |
6409
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
6410
|
|
|
if err := v.Validate(); err != nil { |
6411
|
|
|
return RelationshipWriteRequestValidationError{ |
6412
|
|
|
field: "Metadata", |
6413
|
|
|
reason: "embedded message failed validation", |
6414
|
|
|
cause: err, |
6415
|
|
|
} |
6416
|
|
|
} |
6417
|
|
|
} |
6418
|
|
|
|
6419
|
|
|
if l := len(m.GetTuples()); l < 1 || l > 100 { |
6420
|
|
|
err := RelationshipWriteRequestValidationError{ |
6421
|
|
|
field: "Tuples", |
6422
|
|
|
reason: "value must contain between 1 and 100 items, inclusive", |
6423
|
|
|
} |
6424
|
|
|
if !all { |
6425
|
|
|
return err |
6426
|
|
|
} |
6427
|
|
|
errors = append(errors, err) |
6428
|
|
|
} |
6429
|
|
|
|
6430
|
|
|
for idx, item := range m.GetTuples() { |
6431
|
|
|
_, _ = idx, item |
6432
|
|
|
|
6433
|
|
|
if item == nil { |
6434
|
|
|
err := RelationshipWriteRequestValidationError{ |
6435
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
6436
|
|
|
reason: "value is required", |
6437
|
|
|
} |
6438
|
|
|
if !all { |
6439
|
|
|
return err |
6440
|
|
|
} |
6441
|
|
|
errors = append(errors, err) |
6442
|
|
|
} |
6443
|
|
|
|
6444
|
|
|
if all { |
6445
|
|
|
switch v := interface{}(item).(type) { |
6446
|
|
|
case interface{ ValidateAll() error }: |
6447
|
|
|
if err := v.ValidateAll(); err != nil { |
6448
|
|
|
errors = append(errors, RelationshipWriteRequestValidationError{ |
6449
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
6450
|
|
|
reason: "embedded message failed validation", |
6451
|
|
|
cause: err, |
6452
|
|
|
}) |
6453
|
|
|
} |
6454
|
|
|
case interface{ Validate() error }: |
6455
|
|
|
if err := v.Validate(); err != nil { |
6456
|
|
|
errors = append(errors, RelationshipWriteRequestValidationError{ |
6457
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
6458
|
|
|
reason: "embedded message failed validation", |
6459
|
|
|
cause: err, |
6460
|
|
|
}) |
6461
|
|
|
} |
6462
|
|
|
} |
6463
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
6464
|
|
|
if err := v.Validate(); err != nil { |
6465
|
|
|
return RelationshipWriteRequestValidationError{ |
6466
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
6467
|
|
|
reason: "embedded message failed validation", |
6468
|
|
|
cause: err, |
6469
|
|
|
} |
6470
|
|
|
} |
6471
|
|
|
} |
6472
|
|
|
|
6473
|
|
|
} |
6474
|
|
|
|
6475
|
|
|
if len(errors) > 0 { |
6476
|
|
|
return RelationshipWriteRequestMultiError(errors) |
6477
|
|
|
} |
6478
|
|
|
|
6479
|
|
|
return nil |
6480
|
|
|
} |
6481
|
|
|
|
6482
|
|
|
// RelationshipWriteRequestMultiError is an error wrapping multiple validation |
6483
|
|
|
// errors returned by RelationshipWriteRequest.ValidateAll() if the designated |
6484
|
|
|
// constraints aren't met. |
6485
|
|
|
type RelationshipWriteRequestMultiError []error |
6486
|
|
|
|
6487
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
6488
|
|
|
func (m RelationshipWriteRequestMultiError) Error() string { |
6489
|
|
|
var msgs []string |
6490
|
|
|
for _, err := range m { |
6491
|
|
|
msgs = append(msgs, err.Error()) |
6492
|
|
|
} |
6493
|
|
|
return strings.Join(msgs, "; ") |
6494
|
|
|
} |
6495
|
|
|
|
6496
|
|
|
// AllErrors returns a list of validation violation errors. |
6497
|
|
|
func (m RelationshipWriteRequestMultiError) AllErrors() []error { return m } |
6498
|
|
|
|
6499
|
|
|
// RelationshipWriteRequestValidationError is the validation error returned by |
6500
|
|
|
// RelationshipWriteRequest.Validate if the designated constraints aren't met. |
6501
|
|
|
type RelationshipWriteRequestValidationError struct { |
6502
|
|
|
field string |
6503
|
|
|
reason string |
6504
|
|
|
cause error |
6505
|
|
|
key bool |
6506
|
|
|
} |
6507
|
|
|
|
6508
|
|
|
// Field function returns field value. |
6509
|
|
|
func (e RelationshipWriteRequestValidationError) Field() string { return e.field } |
6510
|
|
|
|
6511
|
|
|
// Reason function returns reason value. |
6512
|
|
|
func (e RelationshipWriteRequestValidationError) Reason() string { return e.reason } |
6513
|
|
|
|
6514
|
|
|
// Cause function returns cause value. |
6515
|
|
|
func (e RelationshipWriteRequestValidationError) Cause() error { return e.cause } |
6516
|
|
|
|
6517
|
|
|
// Key function returns key value. |
6518
|
|
|
func (e RelationshipWriteRequestValidationError) Key() bool { return e.key } |
6519
|
|
|
|
6520
|
|
|
// ErrorName returns error name. |
6521
|
|
|
func (e RelationshipWriteRequestValidationError) ErrorName() string { |
6522
|
|
|
return "RelationshipWriteRequestValidationError" |
6523
|
|
|
} |
6524
|
|
|
|
6525
|
|
|
// Error satisfies the builtin error interface |
6526
|
|
|
func (e RelationshipWriteRequestValidationError) Error() string { |
6527
|
|
|
cause := "" |
6528
|
|
|
if e.cause != nil { |
6529
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
6530
|
|
|
} |
6531
|
|
|
|
6532
|
|
|
key := "" |
6533
|
|
|
if e.key { |
6534
|
|
|
key = "key for " |
6535
|
|
|
} |
6536
|
|
|
|
6537
|
|
|
return fmt.Sprintf( |
6538
|
|
|
"invalid %sRelationshipWriteRequest.%s: %s%s", |
6539
|
|
|
key, |
6540
|
|
|
e.field, |
6541
|
|
|
e.reason, |
6542
|
|
|
cause) |
6543
|
|
|
} |
6544
|
|
|
|
6545
|
|
|
var _ error = RelationshipWriteRequestValidationError{} |
6546
|
|
|
|
6547
|
|
|
var _ interface { |
6548
|
|
|
Field() string |
6549
|
|
|
Reason() string |
6550
|
|
|
Key() bool |
6551
|
|
|
Cause() error |
6552
|
|
|
ErrorName() string |
6553
|
|
|
} = RelationshipWriteRequestValidationError{} |
6554
|
|
|
|
6555
|
|
|
var _RelationshipWriteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
6556
|
|
|
|
6557
|
|
|
// Validate checks the field values on RelationshipWriteRequestMetadata with |
6558
|
|
|
// the rules defined in the proto definition for this message. If any rules |
6559
|
|
|
// are violated, the first error encountered is returned, or nil if there are |
6560
|
|
|
// no violations. |
6561
|
|
|
func (m *RelationshipWriteRequestMetadata) Validate() error { |
6562
|
|
|
return m.validate(false) |
6563
|
|
|
} |
6564
|
|
|
|
6565
|
|
|
// ValidateAll checks the field values on RelationshipWriteRequestMetadata with |
6566
|
|
|
// the rules defined in the proto definition for this message. If any rules |
6567
|
|
|
// are violated, the result is a list of violation errors wrapped in |
6568
|
|
|
// RelationshipWriteRequestMetadataMultiError, or nil if none found. |
6569
|
|
|
func (m *RelationshipWriteRequestMetadata) ValidateAll() error { |
6570
|
|
|
return m.validate(true) |
6571
|
|
|
} |
6572
|
|
|
|
6573
|
|
|
func (m *RelationshipWriteRequestMetadata) validate(all bool) error { |
6574
|
|
|
if m == nil { |
6575
|
|
|
return nil |
6576
|
|
|
} |
6577
|
|
|
|
6578
|
|
|
var errors []error |
6579
|
|
|
|
6580
|
|
|
// no validation rules for SchemaVersion |
6581
|
|
|
|
6582
|
|
|
if len(errors) > 0 { |
6583
|
|
|
return RelationshipWriteRequestMetadataMultiError(errors) |
6584
|
|
|
} |
6585
|
|
|
|
6586
|
|
|
return nil |
6587
|
|
|
} |
6588
|
|
|
|
6589
|
|
|
// RelationshipWriteRequestMetadataMultiError is an error wrapping multiple |
6590
|
|
|
// validation errors returned by |
6591
|
|
|
// RelationshipWriteRequestMetadata.ValidateAll() if the designated |
6592
|
|
|
// constraints aren't met. |
6593
|
|
|
type RelationshipWriteRequestMetadataMultiError []error |
6594
|
|
|
|
6595
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
6596
|
|
|
func (m RelationshipWriteRequestMetadataMultiError) Error() string { |
6597
|
|
|
var msgs []string |
6598
|
|
|
for _, err := range m { |
6599
|
|
|
msgs = append(msgs, err.Error()) |
6600
|
|
|
} |
6601
|
|
|
return strings.Join(msgs, "; ") |
6602
|
|
|
} |
6603
|
|
|
|
6604
|
|
|
// AllErrors returns a list of validation violation errors. |
6605
|
|
|
func (m RelationshipWriteRequestMetadataMultiError) AllErrors() []error { return m } |
6606
|
|
|
|
6607
|
|
|
// RelationshipWriteRequestMetadataValidationError is the validation error |
6608
|
|
|
// returned by RelationshipWriteRequestMetadata.Validate if the designated |
6609
|
|
|
// constraints aren't met. |
6610
|
|
|
type RelationshipWriteRequestMetadataValidationError struct { |
6611
|
|
|
field string |
6612
|
|
|
reason string |
6613
|
|
|
cause error |
6614
|
|
|
key bool |
6615
|
|
|
} |
6616
|
|
|
|
6617
|
|
|
// Field function returns field value. |
6618
|
|
|
func (e RelationshipWriteRequestMetadataValidationError) Field() string { return e.field } |
6619
|
|
|
|
6620
|
|
|
// Reason function returns reason value. |
6621
|
|
|
func (e RelationshipWriteRequestMetadataValidationError) Reason() string { return e.reason } |
6622
|
|
|
|
6623
|
|
|
// Cause function returns cause value. |
6624
|
|
|
func (e RelationshipWriteRequestMetadataValidationError) Cause() error { return e.cause } |
6625
|
|
|
|
6626
|
|
|
// Key function returns key value. |
6627
|
|
|
func (e RelationshipWriteRequestMetadataValidationError) Key() bool { return e.key } |
6628
|
|
|
|
6629
|
|
|
// ErrorName returns error name. |
6630
|
|
|
func (e RelationshipWriteRequestMetadataValidationError) ErrorName() string { |
6631
|
|
|
return "RelationshipWriteRequestMetadataValidationError" |
6632
|
|
|
} |
6633
|
|
|
|
6634
|
|
|
// Error satisfies the builtin error interface |
6635
|
|
|
func (e RelationshipWriteRequestMetadataValidationError) Error() string { |
6636
|
|
|
cause := "" |
6637
|
|
|
if e.cause != nil { |
6638
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
6639
|
|
|
} |
6640
|
|
|
|
6641
|
|
|
key := "" |
6642
|
|
|
if e.key { |
6643
|
|
|
key = "key for " |
6644
|
|
|
} |
6645
|
|
|
|
6646
|
|
|
return fmt.Sprintf( |
6647
|
|
|
"invalid %sRelationshipWriteRequestMetadata.%s: %s%s", |
6648
|
|
|
key, |
6649
|
|
|
e.field, |
6650
|
|
|
e.reason, |
6651
|
|
|
cause) |
6652
|
|
|
} |
6653
|
|
|
|
6654
|
|
|
var _ error = RelationshipWriteRequestMetadataValidationError{} |
6655
|
|
|
|
6656
|
|
|
var _ interface { |
6657
|
|
|
Field() string |
6658
|
|
|
Reason() string |
6659
|
|
|
Key() bool |
6660
|
|
|
Cause() error |
6661
|
|
|
ErrorName() string |
6662
|
|
|
} = RelationshipWriteRequestMetadataValidationError{} |
6663
|
|
|
|
6664
|
|
|
// Validate checks the field values on RelationshipWriteResponse with the rules |
6665
|
|
|
// defined in the proto definition for this message. If any rules are |
6666
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
6667
|
|
|
func (m *RelationshipWriteResponse) Validate() error { |
6668
|
|
|
return m.validate(false) |
6669
|
|
|
} |
6670
|
|
|
|
6671
|
|
|
// ValidateAll checks the field values on RelationshipWriteResponse with the |
6672
|
|
|
// rules defined in the proto definition for this message. If any rules are |
6673
|
|
|
// violated, the result is a list of violation errors wrapped in |
6674
|
|
|
// RelationshipWriteResponseMultiError, or nil if none found. |
6675
|
|
|
func (m *RelationshipWriteResponse) ValidateAll() error { |
6676
|
|
|
return m.validate(true) |
6677
|
|
|
} |
6678
|
|
|
|
6679
|
|
|
func (m *RelationshipWriteResponse) validate(all bool) error { |
6680
|
|
|
if m == nil { |
6681
|
|
|
return nil |
6682
|
|
|
} |
6683
|
|
|
|
6684
|
|
|
var errors []error |
6685
|
|
|
|
6686
|
|
|
// no validation rules for SnapToken |
6687
|
|
|
|
6688
|
|
|
if len(errors) > 0 { |
6689
|
|
|
return RelationshipWriteResponseMultiError(errors) |
6690
|
|
|
} |
6691
|
|
|
|
6692
|
|
|
return nil |
6693
|
|
|
} |
6694
|
|
|
|
6695
|
|
|
// RelationshipWriteResponseMultiError is an error wrapping multiple validation |
6696
|
|
|
// errors returned by RelationshipWriteResponse.ValidateAll() if the |
6697
|
|
|
// designated constraints aren't met. |
6698
|
|
|
type RelationshipWriteResponseMultiError []error |
6699
|
|
|
|
6700
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
6701
|
|
|
func (m RelationshipWriteResponseMultiError) Error() string { |
6702
|
|
|
var msgs []string |
6703
|
|
|
for _, err := range m { |
6704
|
|
|
msgs = append(msgs, err.Error()) |
6705
|
|
|
} |
6706
|
|
|
return strings.Join(msgs, "; ") |
6707
|
|
|
} |
6708
|
|
|
|
6709
|
|
|
// AllErrors returns a list of validation violation errors. |
6710
|
|
|
func (m RelationshipWriteResponseMultiError) AllErrors() []error { return m } |
6711
|
|
|
|
6712
|
|
|
// RelationshipWriteResponseValidationError is the validation error returned by |
6713
|
|
|
// RelationshipWriteResponse.Validate if the designated constraints aren't met. |
6714
|
|
|
type RelationshipWriteResponseValidationError struct { |
6715
|
|
|
field string |
6716
|
|
|
reason string |
6717
|
|
|
cause error |
6718
|
|
|
key bool |
6719
|
|
|
} |
6720
|
|
|
|
6721
|
|
|
// Field function returns field value. |
6722
|
|
|
func (e RelationshipWriteResponseValidationError) Field() string { return e.field } |
6723
|
|
|
|
6724
|
|
|
// Reason function returns reason value. |
6725
|
|
|
func (e RelationshipWriteResponseValidationError) Reason() string { return e.reason } |
6726
|
|
|
|
6727
|
|
|
// Cause function returns cause value. |
6728
|
|
|
func (e RelationshipWriteResponseValidationError) Cause() error { return e.cause } |
6729
|
|
|
|
6730
|
|
|
// Key function returns key value. |
6731
|
|
|
func (e RelationshipWriteResponseValidationError) Key() bool { return e.key } |
6732
|
|
|
|
6733
|
|
|
// ErrorName returns error name. |
6734
|
|
|
func (e RelationshipWriteResponseValidationError) ErrorName() string { |
6735
|
|
|
return "RelationshipWriteResponseValidationError" |
6736
|
|
|
} |
6737
|
|
|
|
6738
|
|
|
// Error satisfies the builtin error interface |
6739
|
|
|
func (e RelationshipWriteResponseValidationError) Error() string { |
6740
|
|
|
cause := "" |
6741
|
|
|
if e.cause != nil { |
6742
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
6743
|
|
|
} |
6744
|
|
|
|
6745
|
|
|
key := "" |
6746
|
|
|
if e.key { |
6747
|
|
|
key = "key for " |
6748
|
|
|
} |
6749
|
|
|
|
6750
|
|
|
return fmt.Sprintf( |
6751
|
|
|
"invalid %sRelationshipWriteResponse.%s: %s%s", |
6752
|
|
|
key, |
6753
|
|
|
e.field, |
6754
|
|
|
e.reason, |
6755
|
|
|
cause) |
6756
|
|
|
} |
6757
|
|
|
|
6758
|
|
|
var _ error = RelationshipWriteResponseValidationError{} |
6759
|
|
|
|
6760
|
|
|
var _ interface { |
6761
|
|
|
Field() string |
6762
|
|
|
Reason() string |
6763
|
|
|
Key() bool |
6764
|
|
|
Cause() error |
6765
|
|
|
ErrorName() string |
6766
|
|
|
} = RelationshipWriteResponseValidationError{} |
6767
|
|
|
|
6768
|
|
|
// Validate checks the field values on RelationshipReadRequest with the rules |
6769
|
|
|
// defined in the proto definition for this message. If any rules are |
6770
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
6771
|
|
|
func (m *RelationshipReadRequest) Validate() error { |
6772
|
|
|
return m.validate(false) |
6773
|
|
|
} |
6774
|
|
|
|
6775
|
|
|
// ValidateAll checks the field values on RelationshipReadRequest with the |
6776
|
|
|
// rules defined in the proto definition for this message. If any rules are |
6777
|
|
|
// violated, the result is a list of violation errors wrapped in |
6778
|
|
|
// RelationshipReadRequestMultiError, or nil if none found. |
6779
|
|
|
func (m *RelationshipReadRequest) ValidateAll() error { |
6780
|
|
|
return m.validate(true) |
6781
|
|
|
} |
6782
|
|
|
|
6783
|
|
|
func (m *RelationshipReadRequest) validate(all bool) error { |
6784
|
|
|
if m == nil { |
6785
|
|
|
return nil |
6786
|
|
|
} |
6787
|
|
|
|
6788
|
|
|
var errors []error |
6789
|
|
|
|
6790
|
|
|
if len(m.GetTenantId()) > 128 { |
6791
|
|
|
err := RelationshipReadRequestValidationError{ |
6792
|
|
|
field: "TenantId", |
6793
|
|
|
reason: "value length must be at most 128 bytes", |
6794
|
|
|
} |
6795
|
|
|
if !all { |
6796
|
|
|
return err |
6797
|
|
|
} |
6798
|
|
|
errors = append(errors, err) |
6799
|
|
|
} |
6800
|
|
|
|
6801
|
|
|
if !_RelationshipReadRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
6802
|
|
|
err := RelationshipReadRequestValidationError{ |
6803
|
|
|
field: "TenantId", |
6804
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
6805
|
|
|
} |
6806
|
|
|
if !all { |
6807
|
|
|
return err |
6808
|
|
|
} |
6809
|
|
|
errors = append(errors, err) |
6810
|
|
|
} |
6811
|
|
|
|
6812
|
|
|
if m.GetMetadata() == nil { |
6813
|
|
|
err := RelationshipReadRequestValidationError{ |
6814
|
|
|
field: "Metadata", |
6815
|
|
|
reason: "value is required", |
6816
|
|
|
} |
6817
|
|
|
if !all { |
6818
|
|
|
return err |
6819
|
|
|
} |
6820
|
|
|
errors = append(errors, err) |
6821
|
|
|
} |
6822
|
|
|
|
6823
|
|
|
if all { |
6824
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
6825
|
|
|
case interface{ ValidateAll() error }: |
6826
|
|
|
if err := v.ValidateAll(); err != nil { |
6827
|
|
|
errors = append(errors, RelationshipReadRequestValidationError{ |
6828
|
|
|
field: "Metadata", |
6829
|
|
|
reason: "embedded message failed validation", |
6830
|
|
|
cause: err, |
6831
|
|
|
}) |
6832
|
|
|
} |
6833
|
|
|
case interface{ Validate() error }: |
6834
|
|
|
if err := v.Validate(); err != nil { |
6835
|
|
|
errors = append(errors, RelationshipReadRequestValidationError{ |
6836
|
|
|
field: "Metadata", |
6837
|
|
|
reason: "embedded message failed validation", |
6838
|
|
|
cause: err, |
6839
|
|
|
}) |
6840
|
|
|
} |
6841
|
|
|
} |
6842
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
6843
|
|
|
if err := v.Validate(); err != nil { |
6844
|
|
|
return RelationshipReadRequestValidationError{ |
6845
|
|
|
field: "Metadata", |
6846
|
|
|
reason: "embedded message failed validation", |
6847
|
|
|
cause: err, |
6848
|
|
|
} |
6849
|
|
|
} |
6850
|
|
|
} |
6851
|
|
|
|
6852
|
|
|
if m.GetFilter() == nil { |
6853
|
|
|
err := RelationshipReadRequestValidationError{ |
6854
|
|
|
field: "Filter", |
6855
|
|
|
reason: "value is required", |
6856
|
|
|
} |
6857
|
|
|
if !all { |
6858
|
|
|
return err |
6859
|
|
|
} |
6860
|
|
|
errors = append(errors, err) |
6861
|
|
|
} |
6862
|
|
|
|
6863
|
|
|
if all { |
6864
|
|
|
switch v := interface{}(m.GetFilter()).(type) { |
6865
|
|
|
case interface{ ValidateAll() error }: |
6866
|
|
|
if err := v.ValidateAll(); err != nil { |
6867
|
|
|
errors = append(errors, RelationshipReadRequestValidationError{ |
6868
|
|
|
field: "Filter", |
6869
|
|
|
reason: "embedded message failed validation", |
6870
|
|
|
cause: err, |
6871
|
|
|
}) |
6872
|
|
|
} |
6873
|
|
|
case interface{ Validate() error }: |
6874
|
|
|
if err := v.Validate(); err != nil { |
6875
|
|
|
errors = append(errors, RelationshipReadRequestValidationError{ |
6876
|
|
|
field: "Filter", |
6877
|
|
|
reason: "embedded message failed validation", |
6878
|
|
|
cause: err, |
6879
|
|
|
}) |
6880
|
|
|
} |
6881
|
|
|
} |
6882
|
|
|
} else if v, ok := interface{}(m.GetFilter()).(interface{ Validate() error }); ok { |
6883
|
|
|
if err := v.Validate(); err != nil { |
6884
|
|
|
return RelationshipReadRequestValidationError{ |
6885
|
|
|
field: "Filter", |
6886
|
|
|
reason: "embedded message failed validation", |
6887
|
|
|
cause: err, |
6888
|
|
|
} |
6889
|
|
|
} |
6890
|
|
|
} |
6891
|
|
|
|
6892
|
|
|
if m.GetPageSize() != 0 { |
6893
|
|
|
|
6894
|
|
|
if m.GetPageSize() < 1 { |
6895
|
|
|
err := RelationshipReadRequestValidationError{ |
6896
|
|
|
field: "PageSize", |
6897
|
|
|
reason: "value must be greater than or equal to 1", |
6898
|
|
|
} |
6899
|
|
|
if !all { |
6900
|
|
|
return err |
6901
|
|
|
} |
6902
|
|
|
errors = append(errors, err) |
6903
|
|
|
} |
6904
|
|
|
|
6905
|
|
|
} |
6906
|
|
|
|
6907
|
|
|
if m.GetContinuousToken() != "" { |
6908
|
|
|
|
6909
|
|
|
} |
6910
|
|
|
|
6911
|
|
|
if len(errors) > 0 { |
6912
|
|
|
return RelationshipReadRequestMultiError(errors) |
6913
|
|
|
} |
6914
|
|
|
|
6915
|
|
|
return nil |
6916
|
|
|
} |
6917
|
|
|
|
6918
|
|
|
// RelationshipReadRequestMultiError is an error wrapping multiple validation |
6919
|
|
|
// errors returned by RelationshipReadRequest.ValidateAll() if the designated |
6920
|
|
|
// constraints aren't met. |
6921
|
|
|
type RelationshipReadRequestMultiError []error |
6922
|
|
|
|
6923
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
6924
|
|
|
func (m RelationshipReadRequestMultiError) Error() string { |
6925
|
|
|
var msgs []string |
6926
|
|
|
for _, err := range m { |
6927
|
|
|
msgs = append(msgs, err.Error()) |
6928
|
|
|
} |
6929
|
|
|
return strings.Join(msgs, "; ") |
6930
|
|
|
} |
6931
|
|
|
|
6932
|
|
|
// AllErrors returns a list of validation violation errors. |
6933
|
|
|
func (m RelationshipReadRequestMultiError) AllErrors() []error { return m } |
6934
|
|
|
|
6935
|
|
|
// RelationshipReadRequestValidationError is the validation error returned by |
6936
|
|
|
// RelationshipReadRequest.Validate if the designated constraints aren't met. |
6937
|
|
|
type RelationshipReadRequestValidationError struct { |
6938
|
|
|
field string |
6939
|
|
|
reason string |
6940
|
|
|
cause error |
6941
|
|
|
key bool |
6942
|
|
|
} |
6943
|
|
|
|
6944
|
|
|
// Field function returns field value. |
6945
|
|
|
func (e RelationshipReadRequestValidationError) Field() string { return e.field } |
6946
|
|
|
|
6947
|
|
|
// Reason function returns reason value. |
6948
|
|
|
func (e RelationshipReadRequestValidationError) Reason() string { return e.reason } |
6949
|
|
|
|
6950
|
|
|
// Cause function returns cause value. |
6951
|
|
|
func (e RelationshipReadRequestValidationError) Cause() error { return e.cause } |
6952
|
|
|
|
6953
|
|
|
// Key function returns key value. |
6954
|
|
|
func (e RelationshipReadRequestValidationError) Key() bool { return e.key } |
6955
|
|
|
|
6956
|
|
|
// ErrorName returns error name. |
6957
|
|
|
func (e RelationshipReadRequestValidationError) ErrorName() string { |
6958
|
|
|
return "RelationshipReadRequestValidationError" |
6959
|
|
|
} |
6960
|
|
|
|
6961
|
|
|
// Error satisfies the builtin error interface |
6962
|
|
|
func (e RelationshipReadRequestValidationError) Error() string { |
6963
|
|
|
cause := "" |
6964
|
|
|
if e.cause != nil { |
6965
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
6966
|
|
|
} |
6967
|
|
|
|
6968
|
|
|
key := "" |
6969
|
|
|
if e.key { |
6970
|
|
|
key = "key for " |
6971
|
|
|
} |
6972
|
|
|
|
6973
|
|
|
return fmt.Sprintf( |
6974
|
|
|
"invalid %sRelationshipReadRequest.%s: %s%s", |
6975
|
|
|
key, |
6976
|
|
|
e.field, |
6977
|
|
|
e.reason, |
6978
|
|
|
cause) |
6979
|
|
|
} |
6980
|
|
|
|
6981
|
|
|
var _ error = RelationshipReadRequestValidationError{} |
6982
|
|
|
|
6983
|
|
|
var _ interface { |
6984
|
|
|
Field() string |
6985
|
|
|
Reason() string |
6986
|
|
|
Key() bool |
6987
|
|
|
Cause() error |
6988
|
|
|
ErrorName() string |
6989
|
|
|
} = RelationshipReadRequestValidationError{} |
6990
|
|
|
|
6991
|
|
|
var _RelationshipReadRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
6992
|
|
|
|
6993
|
|
|
// Validate checks the field values on RelationshipReadRequestMetadata with the |
6994
|
|
|
// rules defined in the proto definition for this message. If any rules are |
6995
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
6996
|
|
|
func (m *RelationshipReadRequestMetadata) Validate() error { |
6997
|
|
|
return m.validate(false) |
6998
|
|
|
} |
6999
|
|
|
|
7000
|
|
|
// ValidateAll checks the field values on RelationshipReadRequestMetadata with |
7001
|
|
|
// the rules defined in the proto definition for this message. If any rules |
7002
|
|
|
// are violated, the result is a list of violation errors wrapped in |
7003
|
|
|
// RelationshipReadRequestMetadataMultiError, or nil if none found. |
7004
|
|
|
func (m *RelationshipReadRequestMetadata) ValidateAll() error { |
7005
|
|
|
return m.validate(true) |
7006
|
|
|
} |
7007
|
|
|
|
7008
|
|
|
func (m *RelationshipReadRequestMetadata) validate(all bool) error { |
7009
|
|
|
if m == nil { |
7010
|
|
|
return nil |
7011
|
|
|
} |
7012
|
|
|
|
7013
|
|
|
var errors []error |
7014
|
|
|
|
7015
|
|
|
// no validation rules for SnapToken |
7016
|
|
|
|
7017
|
|
|
if len(errors) > 0 { |
7018
|
|
|
return RelationshipReadRequestMetadataMultiError(errors) |
7019
|
|
|
} |
7020
|
|
|
|
7021
|
|
|
return nil |
7022
|
|
|
} |
7023
|
|
|
|
7024
|
|
|
// RelationshipReadRequestMetadataMultiError is an error wrapping multiple |
7025
|
|
|
// validation errors returned by RelationshipReadRequestMetadata.ValidateAll() |
7026
|
|
|
// if the designated constraints aren't met. |
7027
|
|
|
type RelationshipReadRequestMetadataMultiError []error |
7028
|
|
|
|
7029
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
7030
|
|
|
func (m RelationshipReadRequestMetadataMultiError) Error() string { |
7031
|
|
|
var msgs []string |
7032
|
|
|
for _, err := range m { |
7033
|
|
|
msgs = append(msgs, err.Error()) |
7034
|
|
|
} |
7035
|
|
|
return strings.Join(msgs, "; ") |
7036
|
|
|
} |
7037
|
|
|
|
7038
|
|
|
// AllErrors returns a list of validation violation errors. |
7039
|
|
|
func (m RelationshipReadRequestMetadataMultiError) AllErrors() []error { return m } |
7040
|
|
|
|
7041
|
|
|
// RelationshipReadRequestMetadataValidationError is the validation error |
7042
|
|
|
// returned by RelationshipReadRequestMetadata.Validate if the designated |
7043
|
|
|
// constraints aren't met. |
7044
|
|
|
type RelationshipReadRequestMetadataValidationError struct { |
7045
|
|
|
field string |
7046
|
|
|
reason string |
7047
|
|
|
cause error |
7048
|
|
|
key bool |
7049
|
|
|
} |
7050
|
|
|
|
7051
|
|
|
// Field function returns field value. |
7052
|
|
|
func (e RelationshipReadRequestMetadataValidationError) Field() string { return e.field } |
7053
|
|
|
|
7054
|
|
|
// Reason function returns reason value. |
7055
|
|
|
func (e RelationshipReadRequestMetadataValidationError) Reason() string { return e.reason } |
7056
|
|
|
|
7057
|
|
|
// Cause function returns cause value. |
7058
|
|
|
func (e RelationshipReadRequestMetadataValidationError) Cause() error { return e.cause } |
7059
|
|
|
|
7060
|
|
|
// Key function returns key value. |
7061
|
|
|
func (e RelationshipReadRequestMetadataValidationError) Key() bool { return e.key } |
7062
|
|
|
|
7063
|
|
|
// ErrorName returns error name. |
7064
|
|
|
func (e RelationshipReadRequestMetadataValidationError) ErrorName() string { |
7065
|
|
|
return "RelationshipReadRequestMetadataValidationError" |
7066
|
|
|
} |
7067
|
|
|
|
7068
|
|
|
// Error satisfies the builtin error interface |
7069
|
|
|
func (e RelationshipReadRequestMetadataValidationError) Error() string { |
7070
|
|
|
cause := "" |
7071
|
|
|
if e.cause != nil { |
7072
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
7073
|
|
|
} |
7074
|
|
|
|
7075
|
|
|
key := "" |
7076
|
|
|
if e.key { |
7077
|
|
|
key = "key for " |
7078
|
|
|
} |
7079
|
|
|
|
7080
|
|
|
return fmt.Sprintf( |
7081
|
|
|
"invalid %sRelationshipReadRequestMetadata.%s: %s%s", |
7082
|
|
|
key, |
7083
|
|
|
e.field, |
7084
|
|
|
e.reason, |
7085
|
|
|
cause) |
7086
|
|
|
} |
7087
|
|
|
|
7088
|
|
|
var _ error = RelationshipReadRequestMetadataValidationError{} |
7089
|
|
|
|
7090
|
|
|
var _ interface { |
7091
|
|
|
Field() string |
7092
|
|
|
Reason() string |
7093
|
|
|
Key() bool |
7094
|
|
|
Cause() error |
7095
|
|
|
ErrorName() string |
7096
|
|
|
} = RelationshipReadRequestMetadataValidationError{} |
7097
|
|
|
|
7098
|
|
|
// Validate checks the field values on RelationshipReadResponse with the rules |
7099
|
|
|
// defined in the proto definition for this message. If any rules are |
7100
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
7101
|
|
|
func (m *RelationshipReadResponse) Validate() error { |
7102
|
|
|
return m.validate(false) |
7103
|
|
|
} |
7104
|
|
|
|
7105
|
|
|
// ValidateAll checks the field values on RelationshipReadResponse with the |
7106
|
|
|
// rules defined in the proto definition for this message. If any rules are |
7107
|
|
|
// violated, the result is a list of violation errors wrapped in |
7108
|
|
|
// RelationshipReadResponseMultiError, or nil if none found. |
7109
|
|
|
func (m *RelationshipReadResponse) ValidateAll() error { |
7110
|
|
|
return m.validate(true) |
7111
|
|
|
} |
7112
|
|
|
|
7113
|
|
|
func (m *RelationshipReadResponse) validate(all bool) error { |
7114
|
|
|
if m == nil { |
7115
|
|
|
return nil |
7116
|
|
|
} |
7117
|
|
|
|
7118
|
|
|
var errors []error |
7119
|
|
|
|
7120
|
|
|
for idx, item := range m.GetTuples() { |
7121
|
|
|
_, _ = idx, item |
7122
|
|
|
|
7123
|
|
|
if all { |
7124
|
|
|
switch v := interface{}(item).(type) { |
7125
|
|
|
case interface{ ValidateAll() error }: |
7126
|
|
|
if err := v.ValidateAll(); err != nil { |
7127
|
|
|
errors = append(errors, RelationshipReadResponseValidationError{ |
7128
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
7129
|
|
|
reason: "embedded message failed validation", |
7130
|
|
|
cause: err, |
7131
|
|
|
}) |
7132
|
|
|
} |
7133
|
|
|
case interface{ Validate() error }: |
7134
|
|
|
if err := v.Validate(); err != nil { |
7135
|
|
|
errors = append(errors, RelationshipReadResponseValidationError{ |
7136
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
7137
|
|
|
reason: "embedded message failed validation", |
7138
|
|
|
cause: err, |
7139
|
|
|
}) |
7140
|
|
|
} |
7141
|
|
|
} |
7142
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
7143
|
|
|
if err := v.Validate(); err != nil { |
7144
|
|
|
return RelationshipReadResponseValidationError{ |
7145
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
7146
|
|
|
reason: "embedded message failed validation", |
7147
|
|
|
cause: err, |
7148
|
|
|
} |
7149
|
|
|
} |
7150
|
|
|
} |
7151
|
|
|
|
7152
|
|
|
} |
7153
|
|
|
|
7154
|
|
|
// no validation rules for ContinuousToken |
7155
|
|
|
|
7156
|
|
|
if len(errors) > 0 { |
7157
|
|
|
return RelationshipReadResponseMultiError(errors) |
7158
|
|
|
} |
7159
|
|
|
|
7160
|
|
|
return nil |
7161
|
|
|
} |
7162
|
|
|
|
7163
|
|
|
// RelationshipReadResponseMultiError is an error wrapping multiple validation |
7164
|
|
|
// errors returned by RelationshipReadResponse.ValidateAll() if the designated |
7165
|
|
|
// constraints aren't met. |
7166
|
|
|
type RelationshipReadResponseMultiError []error |
7167
|
|
|
|
7168
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
7169
|
|
|
func (m RelationshipReadResponseMultiError) Error() string { |
7170
|
|
|
var msgs []string |
7171
|
|
|
for _, err := range m { |
7172
|
|
|
msgs = append(msgs, err.Error()) |
7173
|
|
|
} |
7174
|
|
|
return strings.Join(msgs, "; ") |
7175
|
|
|
} |
7176
|
|
|
|
7177
|
|
|
// AllErrors returns a list of validation violation errors. |
7178
|
|
|
func (m RelationshipReadResponseMultiError) AllErrors() []error { return m } |
7179
|
|
|
|
7180
|
|
|
// RelationshipReadResponseValidationError is the validation error returned by |
7181
|
|
|
// RelationshipReadResponse.Validate if the designated constraints aren't met. |
7182
|
|
|
type RelationshipReadResponseValidationError struct { |
7183
|
|
|
field string |
7184
|
|
|
reason string |
7185
|
|
|
cause error |
7186
|
|
|
key bool |
7187
|
|
|
} |
7188
|
|
|
|
7189
|
|
|
// Field function returns field value. |
7190
|
|
|
func (e RelationshipReadResponseValidationError) Field() string { return e.field } |
7191
|
|
|
|
7192
|
|
|
// Reason function returns reason value. |
7193
|
|
|
func (e RelationshipReadResponseValidationError) Reason() string { return e.reason } |
7194
|
|
|
|
7195
|
|
|
// Cause function returns cause value. |
7196
|
|
|
func (e RelationshipReadResponseValidationError) Cause() error { return e.cause } |
7197
|
|
|
|
7198
|
|
|
// Key function returns key value. |
7199
|
|
|
func (e RelationshipReadResponseValidationError) Key() bool { return e.key } |
7200
|
|
|
|
7201
|
|
|
// ErrorName returns error name. |
7202
|
|
|
func (e RelationshipReadResponseValidationError) ErrorName() string { |
7203
|
|
|
return "RelationshipReadResponseValidationError" |
7204
|
|
|
} |
7205
|
|
|
|
7206
|
|
|
// Error satisfies the builtin error interface |
7207
|
|
|
func (e RelationshipReadResponseValidationError) Error() string { |
7208
|
|
|
cause := "" |
7209
|
|
|
if e.cause != nil { |
7210
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
7211
|
|
|
} |
7212
|
|
|
|
7213
|
|
|
key := "" |
7214
|
|
|
if e.key { |
7215
|
|
|
key = "key for " |
7216
|
|
|
} |
7217
|
|
|
|
7218
|
|
|
return fmt.Sprintf( |
7219
|
|
|
"invalid %sRelationshipReadResponse.%s: %s%s", |
7220
|
|
|
key, |
7221
|
|
|
e.field, |
7222
|
|
|
e.reason, |
7223
|
|
|
cause) |
7224
|
|
|
} |
7225
|
|
|
|
7226
|
|
|
var _ error = RelationshipReadResponseValidationError{} |
7227
|
|
|
|
7228
|
|
|
var _ interface { |
7229
|
|
|
Field() string |
7230
|
|
|
Reason() string |
7231
|
|
|
Key() bool |
7232
|
|
|
Cause() error |
7233
|
|
|
ErrorName() string |
7234
|
|
|
} = RelationshipReadResponseValidationError{} |
7235
|
|
|
|
7236
|
|
|
// Validate checks the field values on AttributeReadRequest with the rules |
7237
|
|
|
// defined in the proto definition for this message. If any rules are |
7238
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
7239
|
|
|
func (m *AttributeReadRequest) Validate() error { |
7240
|
|
|
return m.validate(false) |
7241
|
|
|
} |
7242
|
|
|
|
7243
|
|
|
// ValidateAll checks the field values on AttributeReadRequest with the rules |
7244
|
|
|
// defined in the proto definition for this message. If any rules are |
7245
|
|
|
// violated, the result is a list of violation errors wrapped in |
7246
|
|
|
// AttributeReadRequestMultiError, or nil if none found. |
7247
|
|
|
func (m *AttributeReadRequest) ValidateAll() error { |
7248
|
|
|
return m.validate(true) |
7249
|
|
|
} |
7250
|
|
|
|
7251
|
|
|
func (m *AttributeReadRequest) validate(all bool) error { |
7252
|
|
|
if m == nil { |
7253
|
|
|
return nil |
7254
|
|
|
} |
7255
|
|
|
|
7256
|
|
|
var errors []error |
7257
|
|
|
|
7258
|
|
|
if len(m.GetTenantId()) > 128 { |
7259
|
|
|
err := AttributeReadRequestValidationError{ |
7260
|
|
|
field: "TenantId", |
7261
|
|
|
reason: "value length must be at most 128 bytes", |
7262
|
|
|
} |
7263
|
|
|
if !all { |
7264
|
|
|
return err |
7265
|
|
|
} |
7266
|
|
|
errors = append(errors, err) |
7267
|
|
|
} |
7268
|
|
|
|
7269
|
|
|
if !_AttributeReadRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
7270
|
|
|
err := AttributeReadRequestValidationError{ |
7271
|
|
|
field: "TenantId", |
7272
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
7273
|
|
|
} |
7274
|
|
|
if !all { |
7275
|
|
|
return err |
7276
|
|
|
} |
7277
|
|
|
errors = append(errors, err) |
7278
|
|
|
} |
7279
|
|
|
|
7280
|
|
|
if m.GetMetadata() == nil { |
7281
|
|
|
err := AttributeReadRequestValidationError{ |
7282
|
|
|
field: "Metadata", |
7283
|
|
|
reason: "value is required", |
7284
|
|
|
} |
7285
|
|
|
if !all { |
7286
|
|
|
return err |
7287
|
|
|
} |
7288
|
|
|
errors = append(errors, err) |
7289
|
|
|
} |
7290
|
|
|
|
7291
|
|
|
if all { |
7292
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
7293
|
|
|
case interface{ ValidateAll() error }: |
7294
|
|
|
if err := v.ValidateAll(); err != nil { |
7295
|
|
|
errors = append(errors, AttributeReadRequestValidationError{ |
7296
|
|
|
field: "Metadata", |
7297
|
|
|
reason: "embedded message failed validation", |
7298
|
|
|
cause: err, |
7299
|
|
|
}) |
7300
|
|
|
} |
7301
|
|
|
case interface{ Validate() error }: |
7302
|
|
|
if err := v.Validate(); err != nil { |
7303
|
|
|
errors = append(errors, AttributeReadRequestValidationError{ |
7304
|
|
|
field: "Metadata", |
7305
|
|
|
reason: "embedded message failed validation", |
7306
|
|
|
cause: err, |
7307
|
|
|
}) |
7308
|
|
|
} |
7309
|
|
|
} |
7310
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
7311
|
|
|
if err := v.Validate(); err != nil { |
7312
|
|
|
return AttributeReadRequestValidationError{ |
7313
|
|
|
field: "Metadata", |
7314
|
|
|
reason: "embedded message failed validation", |
7315
|
|
|
cause: err, |
7316
|
|
|
} |
7317
|
|
|
} |
7318
|
|
|
} |
7319
|
|
|
|
7320
|
|
|
if m.GetFilter() == nil { |
7321
|
|
|
err := AttributeReadRequestValidationError{ |
7322
|
|
|
field: "Filter", |
7323
|
|
|
reason: "value is required", |
7324
|
|
|
} |
7325
|
|
|
if !all { |
7326
|
|
|
return err |
7327
|
|
|
} |
7328
|
|
|
errors = append(errors, err) |
7329
|
|
|
} |
7330
|
|
|
|
7331
|
|
|
if all { |
7332
|
|
|
switch v := interface{}(m.GetFilter()).(type) { |
7333
|
|
|
case interface{ ValidateAll() error }: |
7334
|
|
|
if err := v.ValidateAll(); err != nil { |
7335
|
|
|
errors = append(errors, AttributeReadRequestValidationError{ |
7336
|
|
|
field: "Filter", |
7337
|
|
|
reason: "embedded message failed validation", |
7338
|
|
|
cause: err, |
7339
|
|
|
}) |
7340
|
|
|
} |
7341
|
|
|
case interface{ Validate() error }: |
7342
|
|
|
if err := v.Validate(); err != nil { |
7343
|
|
|
errors = append(errors, AttributeReadRequestValidationError{ |
7344
|
|
|
field: "Filter", |
7345
|
|
|
reason: "embedded message failed validation", |
7346
|
|
|
cause: err, |
7347
|
|
|
}) |
7348
|
|
|
} |
7349
|
|
|
} |
7350
|
|
|
} else if v, ok := interface{}(m.GetFilter()).(interface{ Validate() error }); ok { |
7351
|
|
|
if err := v.Validate(); err != nil { |
7352
|
|
|
return AttributeReadRequestValidationError{ |
7353
|
|
|
field: "Filter", |
7354
|
|
|
reason: "embedded message failed validation", |
7355
|
|
|
cause: err, |
7356
|
|
|
} |
7357
|
|
|
} |
7358
|
|
|
} |
7359
|
|
|
|
7360
|
|
|
if m.GetPageSize() != 0 { |
7361
|
|
|
|
7362
|
|
|
if m.GetPageSize() < 1 { |
7363
|
|
|
err := AttributeReadRequestValidationError{ |
7364
|
|
|
field: "PageSize", |
7365
|
|
|
reason: "value must be greater than or equal to 1", |
7366
|
|
|
} |
7367
|
|
|
if !all { |
7368
|
|
|
return err |
7369
|
|
|
} |
7370
|
|
|
errors = append(errors, err) |
7371
|
|
|
} |
7372
|
|
|
|
7373
|
|
|
} |
7374
|
|
|
|
7375
|
|
|
if m.GetContinuousToken() != "" { |
7376
|
|
|
|
7377
|
|
|
} |
7378
|
|
|
|
7379
|
|
|
if len(errors) > 0 { |
7380
|
|
|
return AttributeReadRequestMultiError(errors) |
7381
|
|
|
} |
7382
|
|
|
|
7383
|
|
|
return nil |
7384
|
|
|
} |
7385
|
|
|
|
7386
|
|
|
// AttributeReadRequestMultiError is an error wrapping multiple validation |
7387
|
|
|
// errors returned by AttributeReadRequest.ValidateAll() if the designated |
7388
|
|
|
// constraints aren't met. |
7389
|
|
|
type AttributeReadRequestMultiError []error |
7390
|
|
|
|
7391
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
7392
|
|
|
func (m AttributeReadRequestMultiError) 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 AttributeReadRequestMultiError) AllErrors() []error { return m } |
7402
|
|
|
|
7403
|
|
|
// AttributeReadRequestValidationError is the validation error returned by |
7404
|
|
|
// AttributeReadRequest.Validate if the designated constraints aren't met. |
7405
|
|
|
type AttributeReadRequestValidationError struct { |
7406
|
|
|
field string |
7407
|
|
|
reason string |
7408
|
|
|
cause error |
7409
|
|
|
key bool |
7410
|
|
|
} |
7411
|
|
|
|
7412
|
|
|
// Field function returns field value. |
7413
|
|
|
func (e AttributeReadRequestValidationError) Field() string { return e.field } |
7414
|
|
|
|
7415
|
|
|
// Reason function returns reason value. |
7416
|
|
|
func (e AttributeReadRequestValidationError) Reason() string { return e.reason } |
7417
|
|
|
|
7418
|
|
|
// Cause function returns cause value. |
7419
|
|
|
func (e AttributeReadRequestValidationError) Cause() error { return e.cause } |
7420
|
|
|
|
7421
|
|
|
// Key function returns key value. |
7422
|
|
|
func (e AttributeReadRequestValidationError) Key() bool { return e.key } |
7423
|
|
|
|
7424
|
|
|
// ErrorName returns error name. |
7425
|
|
|
func (e AttributeReadRequestValidationError) ErrorName() string { |
7426
|
|
|
return "AttributeReadRequestValidationError" |
7427
|
|
|
} |
7428
|
|
|
|
7429
|
|
|
// Error satisfies the builtin error interface |
7430
|
|
|
func (e AttributeReadRequestValidationError) 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 %sAttributeReadRequest.%s: %s%s", |
7443
|
|
|
key, |
7444
|
|
|
e.field, |
7445
|
|
|
e.reason, |
7446
|
|
|
cause) |
7447
|
|
|
} |
7448
|
|
|
|
7449
|
|
|
var _ error = AttributeReadRequestValidationError{} |
7450
|
|
|
|
7451
|
|
|
var _ interface { |
7452
|
|
|
Field() string |
7453
|
|
|
Reason() string |
7454
|
|
|
Key() bool |
7455
|
|
|
Cause() error |
7456
|
|
|
ErrorName() string |
7457
|
|
|
} = AttributeReadRequestValidationError{} |
7458
|
|
|
|
7459
|
|
|
var _AttributeReadRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
7460
|
|
|
|
7461
|
|
|
// Validate checks the field values on AttributeReadRequestMetadata with the |
7462
|
|
|
// rules 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 *AttributeReadRequestMetadata) Validate() error { |
7465
|
|
|
return m.validate(false) |
7466
|
|
|
} |
7467
|
|
|
|
7468
|
|
|
// ValidateAll checks the field values on AttributeReadRequestMetadata with the |
7469
|
|
|
// rules 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
|
|
|
// AttributeReadRequestMetadataMultiError, or nil if none found. |
7472
|
|
|
func (m *AttributeReadRequestMetadata) ValidateAll() error { |
7473
|
|
|
return m.validate(true) |
7474
|
|
|
} |
7475
|
|
|
|
7476
|
|
|
func (m *AttributeReadRequestMetadata) validate(all bool) error { |
7477
|
|
|
if m == nil { |
7478
|
|
|
return nil |
7479
|
|
|
} |
7480
|
|
|
|
7481
|
|
|
var errors []error |
7482
|
|
|
|
7483
|
|
|
// no validation rules for SnapToken |
7484
|
|
|
|
7485
|
|
|
if len(errors) > 0 { |
7486
|
|
|
return AttributeReadRequestMetadataMultiError(errors) |
7487
|
|
|
} |
7488
|
|
|
|
7489
|
|
|
return nil |
7490
|
|
|
} |
7491
|
|
|
|
7492
|
|
|
// AttributeReadRequestMetadataMultiError is an error wrapping multiple |
7493
|
|
|
// validation errors returned by AttributeReadRequestMetadata.ValidateAll() if |
7494
|
|
|
// the designated constraints aren't met. |
7495
|
|
|
type AttributeReadRequestMetadataMultiError []error |
7496
|
|
|
|
7497
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
7498
|
|
|
func (m AttributeReadRequestMetadataMultiError) 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 AttributeReadRequestMetadataMultiError) AllErrors() []error { return m } |
7508
|
|
|
|
7509
|
|
|
// AttributeReadRequestMetadataValidationError is the validation error returned |
7510
|
|
|
// by AttributeReadRequestMetadata.Validate if the designated constraints |
7511
|
|
|
// aren't met. |
7512
|
|
|
type AttributeReadRequestMetadataValidationError struct { |
7513
|
|
|
field string |
7514
|
|
|
reason string |
7515
|
|
|
cause error |
7516
|
|
|
key bool |
7517
|
|
|
} |
7518
|
|
|
|
7519
|
|
|
// Field function returns field value. |
7520
|
|
|
func (e AttributeReadRequestMetadataValidationError) Field() string { return e.field } |
7521
|
|
|
|
7522
|
|
|
// Reason function returns reason value. |
7523
|
|
|
func (e AttributeReadRequestMetadataValidationError) Reason() string { return e.reason } |
7524
|
|
|
|
7525
|
|
|
// Cause function returns cause value. |
7526
|
|
|
func (e AttributeReadRequestMetadataValidationError) Cause() error { return e.cause } |
7527
|
|
|
|
7528
|
|
|
// Key function returns key value. |
7529
|
|
|
func (e AttributeReadRequestMetadataValidationError) Key() bool { return e.key } |
7530
|
|
|
|
7531
|
|
|
// ErrorName returns error name. |
7532
|
|
|
func (e AttributeReadRequestMetadataValidationError) ErrorName() string { |
7533
|
|
|
return "AttributeReadRequestMetadataValidationError" |
7534
|
|
|
} |
7535
|
|
|
|
7536
|
|
|
// Error satisfies the builtin error interface |
7537
|
|
|
func (e AttributeReadRequestMetadataValidationError) Error() string { |
7538
|
|
|
cause := "" |
7539
|
|
|
if e.cause != nil { |
7540
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
7541
|
|
|
} |
7542
|
|
|
|
7543
|
|
|
key := "" |
7544
|
|
|
if e.key { |
7545
|
|
|
key = "key for " |
7546
|
|
|
} |
7547
|
|
|
|
7548
|
|
|
return fmt.Sprintf( |
7549
|
|
|
"invalid %sAttributeReadRequestMetadata.%s: %s%s", |
7550
|
|
|
key, |
7551
|
|
|
e.field, |
7552
|
|
|
e.reason, |
7553
|
|
|
cause) |
7554
|
|
|
} |
7555
|
|
|
|
7556
|
|
|
var _ error = AttributeReadRequestMetadataValidationError{} |
7557
|
|
|
|
7558
|
|
|
var _ interface { |
7559
|
|
|
Field() string |
7560
|
|
|
Reason() string |
7561
|
|
|
Key() bool |
7562
|
|
|
Cause() error |
7563
|
|
|
ErrorName() string |
7564
|
|
|
} = AttributeReadRequestMetadataValidationError{} |
7565
|
|
|
|
7566
|
|
|
// Validate checks the field values on AttributeReadResponse with the rules |
7567
|
|
|
// defined in the proto definition for this message. If any rules are |
7568
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
7569
|
|
|
func (m *AttributeReadResponse) Validate() error { |
7570
|
|
|
return m.validate(false) |
7571
|
|
|
} |
7572
|
|
|
|
7573
|
|
|
// ValidateAll checks the field values on AttributeReadResponse with the rules |
7574
|
|
|
// defined in the proto definition for this message. If any rules are |
7575
|
|
|
// violated, the result is a list of violation errors wrapped in |
7576
|
|
|
// AttributeReadResponseMultiError, or nil if none found. |
7577
|
|
|
func (m *AttributeReadResponse) ValidateAll() error { |
7578
|
|
|
return m.validate(true) |
7579
|
|
|
} |
7580
|
|
|
|
7581
|
|
|
func (m *AttributeReadResponse) validate(all bool) error { |
7582
|
|
|
if m == nil { |
7583
|
|
|
return nil |
7584
|
|
|
} |
7585
|
|
|
|
7586
|
|
|
var errors []error |
7587
|
|
|
|
7588
|
|
|
for idx, item := range m.GetAttributes() { |
7589
|
|
|
_, _ = idx, item |
7590
|
|
|
|
7591
|
|
|
if all { |
7592
|
|
|
switch v := interface{}(item).(type) { |
7593
|
|
|
case interface{ ValidateAll() error }: |
7594
|
|
|
if err := v.ValidateAll(); err != nil { |
7595
|
|
|
errors = append(errors, AttributeReadResponseValidationError{ |
7596
|
|
|
field: fmt.Sprintf("Attributes[%v]", idx), |
7597
|
|
|
reason: "embedded message failed validation", |
7598
|
|
|
cause: err, |
7599
|
|
|
}) |
7600
|
|
|
} |
7601
|
|
|
case interface{ Validate() error }: |
7602
|
|
|
if err := v.Validate(); err != nil { |
7603
|
|
|
errors = append(errors, AttributeReadResponseValidationError{ |
7604
|
|
|
field: fmt.Sprintf("Attributes[%v]", idx), |
7605
|
|
|
reason: "embedded message failed validation", |
7606
|
|
|
cause: err, |
7607
|
|
|
}) |
7608
|
|
|
} |
7609
|
|
|
} |
7610
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
7611
|
|
|
if err := v.Validate(); err != nil { |
7612
|
|
|
return AttributeReadResponseValidationError{ |
7613
|
|
|
field: fmt.Sprintf("Attributes[%v]", idx), |
7614
|
|
|
reason: "embedded message failed validation", |
7615
|
|
|
cause: err, |
7616
|
|
|
} |
7617
|
|
|
} |
7618
|
|
|
} |
7619
|
|
|
|
7620
|
|
|
} |
7621
|
|
|
|
7622
|
|
|
// no validation rules for ContinuousToken |
7623
|
|
|
|
7624
|
|
|
if len(errors) > 0 { |
7625
|
|
|
return AttributeReadResponseMultiError(errors) |
7626
|
|
|
} |
7627
|
|
|
|
7628
|
|
|
return nil |
7629
|
|
|
} |
7630
|
|
|
|
7631
|
|
|
// AttributeReadResponseMultiError is an error wrapping multiple validation |
7632
|
|
|
// errors returned by AttributeReadResponse.ValidateAll() if the designated |
7633
|
|
|
// constraints aren't met. |
7634
|
|
|
type AttributeReadResponseMultiError []error |
7635
|
|
|
|
7636
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
7637
|
|
|
func (m AttributeReadResponseMultiError) Error() string { |
7638
|
|
|
var msgs []string |
7639
|
|
|
for _, err := range m { |
7640
|
|
|
msgs = append(msgs, err.Error()) |
7641
|
|
|
} |
7642
|
|
|
return strings.Join(msgs, "; ") |
7643
|
|
|
} |
7644
|
|
|
|
7645
|
|
|
// AllErrors returns a list of validation violation errors. |
7646
|
|
|
func (m AttributeReadResponseMultiError) AllErrors() []error { return m } |
7647
|
|
|
|
7648
|
|
|
// AttributeReadResponseValidationError is the validation error returned by |
7649
|
|
|
// AttributeReadResponse.Validate if the designated constraints aren't met. |
7650
|
|
|
type AttributeReadResponseValidationError struct { |
7651
|
|
|
field string |
7652
|
|
|
reason string |
7653
|
|
|
cause error |
7654
|
|
|
key bool |
7655
|
|
|
} |
7656
|
|
|
|
7657
|
|
|
// Field function returns field value. |
7658
|
|
|
func (e AttributeReadResponseValidationError) Field() string { return e.field } |
7659
|
|
|
|
7660
|
|
|
// Reason function returns reason value. |
7661
|
|
|
func (e AttributeReadResponseValidationError) Reason() string { return e.reason } |
7662
|
|
|
|
7663
|
|
|
// Cause function returns cause value. |
7664
|
|
|
func (e AttributeReadResponseValidationError) Cause() error { return e.cause } |
7665
|
|
|
|
7666
|
|
|
// Key function returns key value. |
7667
|
|
|
func (e AttributeReadResponseValidationError) Key() bool { return e.key } |
7668
|
|
|
|
7669
|
|
|
// ErrorName returns error name. |
7670
|
|
|
func (e AttributeReadResponseValidationError) ErrorName() string { |
7671
|
|
|
return "AttributeReadResponseValidationError" |
7672
|
|
|
} |
7673
|
|
|
|
7674
|
|
|
// Error satisfies the builtin error interface |
7675
|
|
|
func (e AttributeReadResponseValidationError) Error() string { |
7676
|
|
|
cause := "" |
7677
|
|
|
if e.cause != nil { |
7678
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
7679
|
|
|
} |
7680
|
|
|
|
7681
|
|
|
key := "" |
7682
|
|
|
if e.key { |
7683
|
|
|
key = "key for " |
7684
|
|
|
} |
7685
|
|
|
|
7686
|
|
|
return fmt.Sprintf( |
7687
|
|
|
"invalid %sAttributeReadResponse.%s: %s%s", |
7688
|
|
|
key, |
7689
|
|
|
e.field, |
7690
|
|
|
e.reason, |
7691
|
|
|
cause) |
7692
|
|
|
} |
7693
|
|
|
|
7694
|
|
|
var _ error = AttributeReadResponseValidationError{} |
7695
|
|
|
|
7696
|
|
|
var _ interface { |
7697
|
|
|
Field() string |
7698
|
|
|
Reason() string |
7699
|
|
|
Key() bool |
7700
|
|
|
Cause() error |
7701
|
|
|
ErrorName() string |
7702
|
|
|
} = AttributeReadResponseValidationError{} |
7703
|
|
|
|
7704
|
|
|
// Validate checks the field values on DataDeleteRequest with the rules defined |
7705
|
|
|
// in the proto definition for this message. If any rules are violated, the |
7706
|
|
|
// first error encountered is returned, or nil if there are no violations. |
7707
|
|
|
func (m *DataDeleteRequest) Validate() error { |
7708
|
|
|
return m.validate(false) |
7709
|
|
|
} |
7710
|
|
|
|
7711
|
|
|
// ValidateAll checks the field values on DataDeleteRequest with the rules |
7712
|
|
|
// defined in the proto definition for this message. If any rules are |
7713
|
|
|
// violated, the result is a list of violation errors wrapped in |
7714
|
|
|
// DataDeleteRequestMultiError, or nil if none found. |
7715
|
|
|
func (m *DataDeleteRequest) ValidateAll() error { |
7716
|
|
|
return m.validate(true) |
7717
|
|
|
} |
7718
|
|
|
|
7719
|
|
|
func (m *DataDeleteRequest) validate(all bool) error { |
7720
|
|
|
if m == nil { |
7721
|
|
|
return nil |
7722
|
|
|
} |
7723
|
|
|
|
7724
|
|
|
var errors []error |
7725
|
|
|
|
7726
|
|
|
if len(m.GetTenantId()) > 128 { |
7727
|
|
|
err := DataDeleteRequestValidationError{ |
7728
|
|
|
field: "TenantId", |
7729
|
|
|
reason: "value length must be at most 128 bytes", |
7730
|
|
|
} |
7731
|
|
|
if !all { |
7732
|
|
|
return err |
7733
|
|
|
} |
7734
|
|
|
errors = append(errors, err) |
7735
|
|
|
} |
7736
|
|
|
|
7737
|
|
|
if !_DataDeleteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
7738
|
|
|
err := DataDeleteRequestValidationError{ |
7739
|
|
|
field: "TenantId", |
7740
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
7741
|
|
|
} |
7742
|
|
|
if !all { |
7743
|
|
|
return err |
7744
|
|
|
} |
7745
|
|
|
errors = append(errors, err) |
7746
|
|
|
} |
7747
|
|
|
|
7748
|
|
|
if m.GetTupleFilter() == nil { |
7749
|
|
|
err := DataDeleteRequestValidationError{ |
7750
|
|
|
field: "TupleFilter", |
7751
|
|
|
reason: "value is required", |
7752
|
|
|
} |
7753
|
|
|
if !all { |
7754
|
|
|
return err |
7755
|
|
|
} |
7756
|
|
|
errors = append(errors, err) |
7757
|
|
|
} |
7758
|
|
|
|
7759
|
|
|
if all { |
7760
|
|
|
switch v := interface{}(m.GetTupleFilter()).(type) { |
7761
|
|
|
case interface{ ValidateAll() error }: |
7762
|
|
|
if err := v.ValidateAll(); err != nil { |
7763
|
|
|
errors = append(errors, DataDeleteRequestValidationError{ |
7764
|
|
|
field: "TupleFilter", |
7765
|
|
|
reason: "embedded message failed validation", |
7766
|
|
|
cause: err, |
7767
|
|
|
}) |
7768
|
|
|
} |
7769
|
|
|
case interface{ Validate() error }: |
7770
|
|
|
if err := v.Validate(); err != nil { |
7771
|
|
|
errors = append(errors, DataDeleteRequestValidationError{ |
7772
|
|
|
field: "TupleFilter", |
7773
|
|
|
reason: "embedded message failed validation", |
7774
|
|
|
cause: err, |
7775
|
|
|
}) |
7776
|
|
|
} |
7777
|
|
|
} |
7778
|
|
|
} else if v, ok := interface{}(m.GetTupleFilter()).(interface{ Validate() error }); ok { |
7779
|
|
|
if err := v.Validate(); err != nil { |
7780
|
|
|
return DataDeleteRequestValidationError{ |
7781
|
|
|
field: "TupleFilter", |
7782
|
|
|
reason: "embedded message failed validation", |
7783
|
|
|
cause: err, |
7784
|
|
|
} |
7785
|
|
|
} |
7786
|
|
|
} |
7787
|
|
|
|
7788
|
|
|
if m.GetAttributeFilter() == nil { |
7789
|
|
|
err := DataDeleteRequestValidationError{ |
7790
|
|
|
field: "AttributeFilter", |
7791
|
|
|
reason: "value is required", |
7792
|
|
|
} |
7793
|
|
|
if !all { |
7794
|
|
|
return err |
7795
|
|
|
} |
7796
|
|
|
errors = append(errors, err) |
7797
|
|
|
} |
7798
|
|
|
|
7799
|
|
|
if all { |
7800
|
|
|
switch v := interface{}(m.GetAttributeFilter()).(type) { |
7801
|
|
|
case interface{ ValidateAll() error }: |
7802
|
|
|
if err := v.ValidateAll(); err != nil { |
7803
|
|
|
errors = append(errors, DataDeleteRequestValidationError{ |
7804
|
|
|
field: "AttributeFilter", |
7805
|
|
|
reason: "embedded message failed validation", |
7806
|
|
|
cause: err, |
7807
|
|
|
}) |
7808
|
|
|
} |
7809
|
|
|
case interface{ Validate() error }: |
7810
|
|
|
if err := v.Validate(); err != nil { |
7811
|
|
|
errors = append(errors, DataDeleteRequestValidationError{ |
7812
|
|
|
field: "AttributeFilter", |
7813
|
|
|
reason: "embedded message failed validation", |
7814
|
|
|
cause: err, |
7815
|
|
|
}) |
7816
|
|
|
} |
7817
|
|
|
} |
7818
|
|
|
} else if v, ok := interface{}(m.GetAttributeFilter()).(interface{ Validate() error }); ok { |
7819
|
|
|
if err := v.Validate(); err != nil { |
7820
|
|
|
return DataDeleteRequestValidationError{ |
7821
|
|
|
field: "AttributeFilter", |
7822
|
|
|
reason: "embedded message failed validation", |
7823
|
|
|
cause: err, |
7824
|
|
|
} |
7825
|
|
|
} |
7826
|
|
|
} |
7827
|
|
|
|
7828
|
|
|
if len(errors) > 0 { |
7829
|
|
|
return DataDeleteRequestMultiError(errors) |
7830
|
|
|
} |
7831
|
|
|
|
7832
|
|
|
return nil |
7833
|
|
|
} |
7834
|
|
|
|
7835
|
|
|
// DataDeleteRequestMultiError is an error wrapping multiple validation errors |
7836
|
|
|
// returned by DataDeleteRequest.ValidateAll() if the designated constraints |
7837
|
|
|
// aren't met. |
7838
|
|
|
type DataDeleteRequestMultiError []error |
7839
|
|
|
|
7840
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
7841
|
|
|
func (m DataDeleteRequestMultiError) Error() string { |
7842
|
|
|
var msgs []string |
7843
|
|
|
for _, err := range m { |
7844
|
|
|
msgs = append(msgs, err.Error()) |
7845
|
|
|
} |
7846
|
|
|
return strings.Join(msgs, "; ") |
7847
|
|
|
} |
7848
|
|
|
|
7849
|
|
|
// AllErrors returns a list of validation violation errors. |
7850
|
|
|
func (m DataDeleteRequestMultiError) AllErrors() []error { return m } |
7851
|
|
|
|
7852
|
|
|
// DataDeleteRequestValidationError is the validation error returned by |
7853
|
|
|
// DataDeleteRequest.Validate if the designated constraints aren't met. |
7854
|
|
|
type DataDeleteRequestValidationError struct { |
7855
|
|
|
field string |
7856
|
|
|
reason string |
7857
|
|
|
cause error |
7858
|
|
|
key bool |
7859
|
|
|
} |
7860
|
|
|
|
7861
|
|
|
// Field function returns field value. |
7862
|
|
|
func (e DataDeleteRequestValidationError) Field() string { return e.field } |
7863
|
|
|
|
7864
|
|
|
// Reason function returns reason value. |
7865
|
|
|
func (e DataDeleteRequestValidationError) Reason() string { return e.reason } |
7866
|
|
|
|
7867
|
|
|
// Cause function returns cause value. |
7868
|
|
|
func (e DataDeleteRequestValidationError) Cause() error { return e.cause } |
7869
|
|
|
|
7870
|
|
|
// Key function returns key value. |
7871
|
|
|
func (e DataDeleteRequestValidationError) Key() bool { return e.key } |
7872
|
|
|
|
7873
|
|
|
// ErrorName returns error name. |
7874
|
|
|
func (e DataDeleteRequestValidationError) ErrorName() string { |
7875
|
|
|
return "DataDeleteRequestValidationError" |
7876
|
|
|
} |
7877
|
|
|
|
7878
|
|
|
// Error satisfies the builtin error interface |
7879
|
|
|
func (e DataDeleteRequestValidationError) Error() string { |
7880
|
|
|
cause := "" |
7881
|
|
|
if e.cause != nil { |
7882
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
7883
|
|
|
} |
7884
|
|
|
|
7885
|
|
|
key := "" |
7886
|
|
|
if e.key { |
7887
|
|
|
key = "key for " |
7888
|
|
|
} |
7889
|
|
|
|
7890
|
|
|
return fmt.Sprintf( |
7891
|
|
|
"invalid %sDataDeleteRequest.%s: %s%s", |
7892
|
|
|
key, |
7893
|
|
|
e.field, |
7894
|
|
|
e.reason, |
7895
|
|
|
cause) |
7896
|
|
|
} |
7897
|
|
|
|
7898
|
|
|
var _ error = DataDeleteRequestValidationError{} |
7899
|
|
|
|
7900
|
|
|
var _ interface { |
7901
|
|
|
Field() string |
7902
|
|
|
Reason() string |
7903
|
|
|
Key() bool |
7904
|
|
|
Cause() error |
7905
|
|
|
ErrorName() string |
7906
|
|
|
} = DataDeleteRequestValidationError{} |
7907
|
|
|
|
7908
|
|
|
var _DataDeleteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
7909
|
|
|
|
7910
|
|
|
// Validate checks the field values on DataDeleteResponse with the rules |
7911
|
|
|
// defined in the proto definition for this message. If any rules are |
7912
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
7913
|
|
|
func (m *DataDeleteResponse) Validate() error { |
7914
|
|
|
return m.validate(false) |
7915
|
|
|
} |
7916
|
|
|
|
7917
|
|
|
// ValidateAll checks the field values on DataDeleteResponse with the rules |
7918
|
|
|
// defined in the proto definition for this message. If any rules are |
7919
|
|
|
// violated, the result is a list of violation errors wrapped in |
7920
|
|
|
// DataDeleteResponseMultiError, or nil if none found. |
7921
|
|
|
func (m *DataDeleteResponse) ValidateAll() error { |
7922
|
|
|
return m.validate(true) |
7923
|
|
|
} |
7924
|
|
|
|
7925
|
|
|
func (m *DataDeleteResponse) validate(all bool) error { |
7926
|
|
|
if m == nil { |
7927
|
|
|
return nil |
7928
|
|
|
} |
7929
|
|
|
|
7930
|
|
|
var errors []error |
7931
|
|
|
|
7932
|
|
|
// no validation rules for SnapToken |
7933
|
|
|
|
7934
|
|
|
if len(errors) > 0 { |
7935
|
|
|
return DataDeleteResponseMultiError(errors) |
7936
|
|
|
} |
7937
|
|
|
|
7938
|
|
|
return nil |
7939
|
|
|
} |
7940
|
|
|
|
7941
|
|
|
// DataDeleteResponseMultiError is an error wrapping multiple validation errors |
7942
|
|
|
// returned by DataDeleteResponse.ValidateAll() if the designated constraints |
7943
|
|
|
// aren't met. |
7944
|
|
|
type DataDeleteResponseMultiError []error |
7945
|
|
|
|
7946
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
7947
|
|
|
func (m DataDeleteResponseMultiError) Error() string { |
7948
|
|
|
var msgs []string |
7949
|
|
|
for _, err := range m { |
7950
|
|
|
msgs = append(msgs, err.Error()) |
7951
|
|
|
} |
7952
|
|
|
return strings.Join(msgs, "; ") |
7953
|
|
|
} |
7954
|
|
|
|
7955
|
|
|
// AllErrors returns a list of validation violation errors. |
7956
|
|
|
func (m DataDeleteResponseMultiError) AllErrors() []error { return m } |
7957
|
|
|
|
7958
|
|
|
// DataDeleteResponseValidationError is the validation error returned by |
7959
|
|
|
// DataDeleteResponse.Validate if the designated constraints aren't met. |
7960
|
|
|
type DataDeleteResponseValidationError struct { |
7961
|
|
|
field string |
7962
|
|
|
reason string |
7963
|
|
|
cause error |
7964
|
|
|
key bool |
7965
|
|
|
} |
7966
|
|
|
|
7967
|
|
|
// Field function returns field value. |
7968
|
|
|
func (e DataDeleteResponseValidationError) Field() string { return e.field } |
7969
|
|
|
|
7970
|
|
|
// Reason function returns reason value. |
7971
|
|
|
func (e DataDeleteResponseValidationError) Reason() string { return e.reason } |
7972
|
|
|
|
7973
|
|
|
// Cause function returns cause value. |
7974
|
|
|
func (e DataDeleteResponseValidationError) Cause() error { return e.cause } |
7975
|
|
|
|
7976
|
|
|
// Key function returns key value. |
7977
|
|
|
func (e DataDeleteResponseValidationError) Key() bool { return e.key } |
7978
|
|
|
|
7979
|
|
|
// ErrorName returns error name. |
7980
|
|
|
func (e DataDeleteResponseValidationError) ErrorName() string { |
7981
|
|
|
return "DataDeleteResponseValidationError" |
7982
|
|
|
} |
7983
|
|
|
|
7984
|
|
|
// Error satisfies the builtin error interface |
7985
|
|
|
func (e DataDeleteResponseValidationError) Error() string { |
7986
|
|
|
cause := "" |
7987
|
|
|
if e.cause != nil { |
7988
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
7989
|
|
|
} |
7990
|
|
|
|
7991
|
|
|
key := "" |
7992
|
|
|
if e.key { |
7993
|
|
|
key = "key for " |
7994
|
|
|
} |
7995
|
|
|
|
7996
|
|
|
return fmt.Sprintf( |
7997
|
|
|
"invalid %sDataDeleteResponse.%s: %s%s", |
7998
|
|
|
key, |
7999
|
|
|
e.field, |
8000
|
|
|
e.reason, |
8001
|
|
|
cause) |
8002
|
|
|
} |
8003
|
|
|
|
8004
|
|
|
var _ error = DataDeleteResponseValidationError{} |
8005
|
|
|
|
8006
|
|
|
var _ interface { |
8007
|
|
|
Field() string |
8008
|
|
|
Reason() string |
8009
|
|
|
Key() bool |
8010
|
|
|
Cause() error |
8011
|
|
|
ErrorName() string |
8012
|
|
|
} = DataDeleteResponseValidationError{} |
8013
|
|
|
|
8014
|
|
|
// Validate checks the field values on RelationshipDeleteRequest with the rules |
8015
|
|
|
// defined in the proto definition for this message. If any rules are |
8016
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
8017
|
|
|
func (m *RelationshipDeleteRequest) Validate() error { |
8018
|
|
|
return m.validate(false) |
8019
|
|
|
} |
8020
|
|
|
|
8021
|
|
|
// ValidateAll checks the field values on RelationshipDeleteRequest with the |
8022
|
|
|
// rules defined in the proto definition for this message. If any rules are |
8023
|
|
|
// violated, the result is a list of violation errors wrapped in |
8024
|
|
|
// RelationshipDeleteRequestMultiError, or nil if none found. |
8025
|
|
|
func (m *RelationshipDeleteRequest) ValidateAll() error { |
8026
|
|
|
return m.validate(true) |
8027
|
|
|
} |
8028
|
|
|
|
8029
|
|
|
func (m *RelationshipDeleteRequest) validate(all bool) error { |
8030
|
|
|
if m == nil { |
8031
|
|
|
return nil |
8032
|
|
|
} |
8033
|
|
|
|
8034
|
|
|
var errors []error |
8035
|
|
|
|
8036
|
|
|
if len(m.GetTenantId()) > 128 { |
8037
|
|
|
err := RelationshipDeleteRequestValidationError{ |
8038
|
|
|
field: "TenantId", |
8039
|
|
|
reason: "value length must be at most 128 bytes", |
8040
|
|
|
} |
8041
|
|
|
if !all { |
8042
|
|
|
return err |
8043
|
|
|
} |
8044
|
|
|
errors = append(errors, err) |
8045
|
|
|
} |
8046
|
|
|
|
8047
|
|
|
if !_RelationshipDeleteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
8048
|
|
|
err := RelationshipDeleteRequestValidationError{ |
8049
|
|
|
field: "TenantId", |
8050
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
8051
|
|
|
} |
8052
|
|
|
if !all { |
8053
|
|
|
return err |
8054
|
|
|
} |
8055
|
|
|
errors = append(errors, err) |
8056
|
|
|
} |
8057
|
|
|
|
8058
|
|
|
if all { |
8059
|
|
|
switch v := interface{}(m.GetFilter()).(type) { |
8060
|
|
|
case interface{ ValidateAll() error }: |
8061
|
|
|
if err := v.ValidateAll(); err != nil { |
8062
|
|
|
errors = append(errors, RelationshipDeleteRequestValidationError{ |
8063
|
|
|
field: "Filter", |
8064
|
|
|
reason: "embedded message failed validation", |
8065
|
|
|
cause: err, |
8066
|
|
|
}) |
8067
|
|
|
} |
8068
|
|
|
case interface{ Validate() error }: |
8069
|
|
|
if err := v.Validate(); err != nil { |
8070
|
|
|
errors = append(errors, RelationshipDeleteRequestValidationError{ |
8071
|
|
|
field: "Filter", |
8072
|
|
|
reason: "embedded message failed validation", |
8073
|
|
|
cause: err, |
8074
|
|
|
}) |
8075
|
|
|
} |
8076
|
|
|
} |
8077
|
|
|
} else if v, ok := interface{}(m.GetFilter()).(interface{ Validate() error }); ok { |
8078
|
|
|
if err := v.Validate(); err != nil { |
8079
|
|
|
return RelationshipDeleteRequestValidationError{ |
8080
|
|
|
field: "Filter", |
8081
|
|
|
reason: "embedded message failed validation", |
8082
|
|
|
cause: err, |
8083
|
|
|
} |
8084
|
|
|
} |
8085
|
|
|
} |
8086
|
|
|
|
8087
|
|
|
if len(errors) > 0 { |
8088
|
|
|
return RelationshipDeleteRequestMultiError(errors) |
8089
|
|
|
} |
8090
|
|
|
|
8091
|
|
|
return nil |
8092
|
|
|
} |
8093
|
|
|
|
8094
|
|
|
// RelationshipDeleteRequestMultiError is an error wrapping multiple validation |
8095
|
|
|
// errors returned by RelationshipDeleteRequest.ValidateAll() if the |
8096
|
|
|
// designated constraints aren't met. |
8097
|
|
|
type RelationshipDeleteRequestMultiError []error |
8098
|
|
|
|
8099
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
8100
|
|
|
func (m RelationshipDeleteRequestMultiError) Error() string { |
8101
|
|
|
var msgs []string |
8102
|
|
|
for _, err := range m { |
8103
|
|
|
msgs = append(msgs, err.Error()) |
8104
|
|
|
} |
8105
|
|
|
return strings.Join(msgs, "; ") |
8106
|
|
|
} |
8107
|
|
|
|
8108
|
|
|
// AllErrors returns a list of validation violation errors. |
8109
|
|
|
func (m RelationshipDeleteRequestMultiError) AllErrors() []error { return m } |
8110
|
|
|
|
8111
|
|
|
// RelationshipDeleteRequestValidationError is the validation error returned by |
8112
|
|
|
// RelationshipDeleteRequest.Validate if the designated constraints aren't met. |
8113
|
|
|
type RelationshipDeleteRequestValidationError struct { |
8114
|
|
|
field string |
8115
|
|
|
reason string |
8116
|
|
|
cause error |
8117
|
|
|
key bool |
8118
|
|
|
} |
8119
|
|
|
|
8120
|
|
|
// Field function returns field value. |
8121
|
|
|
func (e RelationshipDeleteRequestValidationError) Field() string { return e.field } |
8122
|
|
|
|
8123
|
|
|
// Reason function returns reason value. |
8124
|
|
|
func (e RelationshipDeleteRequestValidationError) Reason() string { return e.reason } |
8125
|
|
|
|
8126
|
|
|
// Cause function returns cause value. |
8127
|
|
|
func (e RelationshipDeleteRequestValidationError) Cause() error { return e.cause } |
8128
|
|
|
|
8129
|
|
|
// Key function returns key value. |
8130
|
|
|
func (e RelationshipDeleteRequestValidationError) Key() bool { return e.key } |
8131
|
|
|
|
8132
|
|
|
// ErrorName returns error name. |
8133
|
|
|
func (e RelationshipDeleteRequestValidationError) ErrorName() string { |
8134
|
|
|
return "RelationshipDeleteRequestValidationError" |
8135
|
|
|
} |
8136
|
|
|
|
8137
|
|
|
// Error satisfies the builtin error interface |
8138
|
|
|
func (e RelationshipDeleteRequestValidationError) Error() string { |
8139
|
|
|
cause := "" |
8140
|
|
|
if e.cause != nil { |
8141
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
8142
|
|
|
} |
8143
|
|
|
|
8144
|
|
|
key := "" |
8145
|
|
|
if e.key { |
8146
|
|
|
key = "key for " |
8147
|
|
|
} |
8148
|
|
|
|
8149
|
|
|
return fmt.Sprintf( |
8150
|
|
|
"invalid %sRelationshipDeleteRequest.%s: %s%s", |
8151
|
|
|
key, |
8152
|
|
|
e.field, |
8153
|
|
|
e.reason, |
8154
|
|
|
cause) |
8155
|
|
|
} |
8156
|
|
|
|
8157
|
|
|
var _ error = RelationshipDeleteRequestValidationError{} |
8158
|
|
|
|
8159
|
|
|
var _ interface { |
8160
|
|
|
Field() string |
8161
|
|
|
Reason() string |
8162
|
|
|
Key() bool |
8163
|
|
|
Cause() error |
8164
|
|
|
ErrorName() string |
8165
|
|
|
} = RelationshipDeleteRequestValidationError{} |
8166
|
|
|
|
8167
|
|
|
var _RelationshipDeleteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
8168
|
|
|
|
8169
|
|
|
// Validate checks the field values on RelationshipDeleteResponse with the |
8170
|
|
|
// rules defined in the proto definition for this message. If any rules are |
8171
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
8172
|
|
|
func (m *RelationshipDeleteResponse) Validate() error { |
8173
|
|
|
return m.validate(false) |
8174
|
|
|
} |
8175
|
|
|
|
8176
|
|
|
// ValidateAll checks the field values on RelationshipDeleteResponse with the |
8177
|
|
|
// rules defined in the proto definition for this message. If any rules are |
8178
|
|
|
// violated, the result is a list of violation errors wrapped in |
8179
|
|
|
// RelationshipDeleteResponseMultiError, or nil if none found. |
8180
|
|
|
func (m *RelationshipDeleteResponse) ValidateAll() error { |
8181
|
|
|
return m.validate(true) |
8182
|
|
|
} |
8183
|
|
|
|
8184
|
|
|
func (m *RelationshipDeleteResponse) validate(all bool) error { |
8185
|
|
|
if m == nil { |
8186
|
|
|
return nil |
8187
|
|
|
} |
8188
|
|
|
|
8189
|
|
|
var errors []error |
8190
|
|
|
|
8191
|
|
|
// no validation rules for SnapToken |
8192
|
|
|
|
8193
|
|
|
if len(errors) > 0 { |
8194
|
|
|
return RelationshipDeleteResponseMultiError(errors) |
8195
|
|
|
} |
8196
|
|
|
|
8197
|
|
|
return nil |
8198
|
|
|
} |
8199
|
|
|
|
8200
|
|
|
// RelationshipDeleteResponseMultiError is an error wrapping multiple |
8201
|
|
|
// validation errors returned by RelationshipDeleteResponse.ValidateAll() if |
8202
|
|
|
// the designated constraints aren't met. |
8203
|
|
|
type RelationshipDeleteResponseMultiError []error |
8204
|
|
|
|
8205
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
8206
|
|
|
func (m RelationshipDeleteResponseMultiError) Error() string { |
8207
|
|
|
var msgs []string |
8208
|
|
|
for _, err := range m { |
8209
|
|
|
msgs = append(msgs, err.Error()) |
8210
|
|
|
} |
8211
|
|
|
return strings.Join(msgs, "; ") |
8212
|
|
|
} |
8213
|
|
|
|
8214
|
|
|
// AllErrors returns a list of validation violation errors. |
8215
|
|
|
func (m RelationshipDeleteResponseMultiError) AllErrors() []error { return m } |
8216
|
|
|
|
8217
|
|
|
// RelationshipDeleteResponseValidationError is the validation error returned |
8218
|
|
|
// by RelationshipDeleteResponse.Validate if the designated constraints aren't met. |
8219
|
|
|
type RelationshipDeleteResponseValidationError struct { |
8220
|
|
|
field string |
8221
|
|
|
reason string |
8222
|
|
|
cause error |
8223
|
|
|
key bool |
8224
|
|
|
} |
8225
|
|
|
|
8226
|
|
|
// Field function returns field value. |
8227
|
|
|
func (e RelationshipDeleteResponseValidationError) Field() string { return e.field } |
8228
|
|
|
|
8229
|
|
|
// Reason function returns reason value. |
8230
|
|
|
func (e RelationshipDeleteResponseValidationError) Reason() string { return e.reason } |
8231
|
|
|
|
8232
|
|
|
// Cause function returns cause value. |
8233
|
|
|
func (e RelationshipDeleteResponseValidationError) Cause() error { return e.cause } |
8234
|
|
|
|
8235
|
|
|
// Key function returns key value. |
8236
|
|
|
func (e RelationshipDeleteResponseValidationError) Key() bool { return e.key } |
8237
|
|
|
|
8238
|
|
|
// ErrorName returns error name. |
8239
|
|
|
func (e RelationshipDeleteResponseValidationError) ErrorName() string { |
8240
|
|
|
return "RelationshipDeleteResponseValidationError" |
8241
|
|
|
} |
8242
|
|
|
|
8243
|
|
|
// Error satisfies the builtin error interface |
8244
|
|
|
func (e RelationshipDeleteResponseValidationError) Error() string { |
8245
|
|
|
cause := "" |
8246
|
|
|
if e.cause != nil { |
8247
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
8248
|
|
|
} |
8249
|
|
|
|
8250
|
|
|
key := "" |
8251
|
|
|
if e.key { |
8252
|
|
|
key = "key for " |
8253
|
|
|
} |
8254
|
|
|
|
8255
|
|
|
return fmt.Sprintf( |
8256
|
|
|
"invalid %sRelationshipDeleteResponse.%s: %s%s", |
8257
|
|
|
key, |
8258
|
|
|
e.field, |
8259
|
|
|
e.reason, |
8260
|
|
|
cause) |
8261
|
|
|
} |
8262
|
|
|
|
8263
|
|
|
var _ error = RelationshipDeleteResponseValidationError{} |
8264
|
|
|
|
8265
|
|
|
var _ interface { |
8266
|
|
|
Field() string |
8267
|
|
|
Reason() string |
8268
|
|
|
Key() bool |
8269
|
|
|
Cause() error |
8270
|
|
|
ErrorName() string |
8271
|
|
|
} = RelationshipDeleteResponseValidationError{} |
8272
|
|
|
|
8273
|
|
|
// Validate checks the field values on BundleRunRequest with the rules defined |
8274
|
|
|
// in the proto definition for this message. If any rules are violated, the |
8275
|
|
|
// first error encountered is returned, or nil if there are no violations. |
8276
|
|
|
func (m *BundleRunRequest) Validate() error { |
8277
|
|
|
return m.validate(false) |
8278
|
|
|
} |
8279
|
|
|
|
8280
|
|
|
// ValidateAll checks the field values on BundleRunRequest with the rules |
8281
|
|
|
// defined in the proto definition for this message. If any rules are |
8282
|
|
|
// violated, the result is a list of violation errors wrapped in |
8283
|
|
|
// BundleRunRequestMultiError, or nil if none found. |
8284
|
|
|
func (m *BundleRunRequest) ValidateAll() error { |
8285
|
|
|
return m.validate(true) |
8286
|
|
|
} |
8287
|
|
|
|
8288
|
|
|
func (m *BundleRunRequest) validate(all bool) error { |
8289
|
|
|
if m == nil { |
8290
|
|
|
return nil |
8291
|
|
|
} |
8292
|
|
|
|
8293
|
|
|
var errors []error |
8294
|
|
|
|
8295
|
|
|
if len(m.GetTenantId()) > 128 { |
8296
|
|
|
err := BundleRunRequestValidationError{ |
8297
|
|
|
field: "TenantId", |
8298
|
|
|
reason: "value length must be at most 128 bytes", |
8299
|
|
|
} |
8300
|
|
|
if !all { |
8301
|
|
|
return err |
8302
|
|
|
} |
8303
|
|
|
errors = append(errors, err) |
8304
|
|
|
} |
8305
|
|
|
|
8306
|
|
|
if !_BundleRunRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
8307
|
|
|
err := BundleRunRequestValidationError{ |
8308
|
|
|
field: "TenantId", |
8309
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
8310
|
|
|
} |
8311
|
|
|
if !all { |
8312
|
|
|
return err |
8313
|
|
|
} |
8314
|
|
|
errors = append(errors, err) |
8315
|
|
|
} |
8316
|
|
|
|
8317
|
|
|
// no validation rules for Name |
8318
|
|
|
|
8319
|
|
|
// no validation rules for Arguments |
8320
|
|
|
|
8321
|
|
|
if len(errors) > 0 { |
8322
|
|
|
return BundleRunRequestMultiError(errors) |
8323
|
|
|
} |
8324
|
|
|
|
8325
|
|
|
return nil |
8326
|
|
|
} |
8327
|
|
|
|
8328
|
|
|
// BundleRunRequestMultiError is an error wrapping multiple validation errors |
8329
|
|
|
// returned by BundleRunRequest.ValidateAll() if the designated constraints |
8330
|
|
|
// aren't met. |
8331
|
|
|
type BundleRunRequestMultiError []error |
8332
|
|
|
|
8333
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
8334
|
|
|
func (m BundleRunRequestMultiError) Error() string { |
8335
|
|
|
var msgs []string |
8336
|
|
|
for _, err := range m { |
8337
|
|
|
msgs = append(msgs, err.Error()) |
8338
|
|
|
} |
8339
|
|
|
return strings.Join(msgs, "; ") |
8340
|
|
|
} |
8341
|
|
|
|
8342
|
|
|
// AllErrors returns a list of validation violation errors. |
8343
|
|
|
func (m BundleRunRequestMultiError) AllErrors() []error { return m } |
8344
|
|
|
|
8345
|
|
|
// BundleRunRequestValidationError is the validation error returned by |
8346
|
|
|
// BundleRunRequest.Validate if the designated constraints aren't met. |
8347
|
|
|
type BundleRunRequestValidationError struct { |
8348
|
|
|
field string |
8349
|
|
|
reason string |
8350
|
|
|
cause error |
8351
|
|
|
key bool |
8352
|
|
|
} |
8353
|
|
|
|
8354
|
|
|
// Field function returns field value. |
8355
|
|
|
func (e BundleRunRequestValidationError) Field() string { return e.field } |
8356
|
|
|
|
8357
|
|
|
// Reason function returns reason value. |
8358
|
|
|
func (e BundleRunRequestValidationError) Reason() string { return e.reason } |
8359
|
|
|
|
8360
|
|
|
// Cause function returns cause value. |
8361
|
|
|
func (e BundleRunRequestValidationError) Cause() error { return e.cause } |
8362
|
|
|
|
8363
|
|
|
// Key function returns key value. |
8364
|
|
|
func (e BundleRunRequestValidationError) Key() bool { return e.key } |
8365
|
|
|
|
8366
|
|
|
// ErrorName returns error name. |
8367
|
|
|
func (e BundleRunRequestValidationError) ErrorName() string { return "BundleRunRequestValidationError" } |
8368
|
|
|
|
8369
|
|
|
// Error satisfies the builtin error interface |
8370
|
|
|
func (e BundleRunRequestValidationError) Error() string { |
8371
|
|
|
cause := "" |
8372
|
|
|
if e.cause != nil { |
8373
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
8374
|
|
|
} |
8375
|
|
|
|
8376
|
|
|
key := "" |
8377
|
|
|
if e.key { |
8378
|
|
|
key = "key for " |
8379
|
|
|
} |
8380
|
|
|
|
8381
|
|
|
return fmt.Sprintf( |
8382
|
|
|
"invalid %sBundleRunRequest.%s: %s%s", |
8383
|
|
|
key, |
8384
|
|
|
e.field, |
8385
|
|
|
e.reason, |
8386
|
|
|
cause) |
8387
|
|
|
} |
8388
|
|
|
|
8389
|
|
|
var _ error = BundleRunRequestValidationError{} |
8390
|
|
|
|
8391
|
|
|
var _ interface { |
8392
|
|
|
Field() string |
8393
|
|
|
Reason() string |
8394
|
|
|
Key() bool |
8395
|
|
|
Cause() error |
8396
|
|
|
ErrorName() string |
8397
|
|
|
} = BundleRunRequestValidationError{} |
8398
|
|
|
|
8399
|
|
|
var _BundleRunRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
8400
|
|
|
|
8401
|
|
|
// Validate checks the field values on BundleRunResponse with the rules defined |
8402
|
|
|
// in the proto definition for this message. If any rules are violated, the |
8403
|
|
|
// first error encountered is returned, or nil if there are no violations. |
8404
|
|
|
func (m *BundleRunResponse) Validate() error { |
8405
|
|
|
return m.validate(false) |
8406
|
|
|
} |
8407
|
|
|
|
8408
|
|
|
// ValidateAll checks the field values on BundleRunResponse with the rules |
8409
|
|
|
// defined in the proto definition for this message. If any rules are |
8410
|
|
|
// violated, the result is a list of violation errors wrapped in |
8411
|
|
|
// BundleRunResponseMultiError, or nil if none found. |
8412
|
|
|
func (m *BundleRunResponse) ValidateAll() error { |
8413
|
|
|
return m.validate(true) |
8414
|
|
|
} |
8415
|
|
|
|
8416
|
|
|
func (m *BundleRunResponse) validate(all bool) error { |
8417
|
|
|
if m == nil { |
8418
|
|
|
return nil |
8419
|
|
|
} |
8420
|
|
|
|
8421
|
|
|
var errors []error |
8422
|
|
|
|
8423
|
|
|
// no validation rules for SnapToken |
8424
|
|
|
|
8425
|
|
|
if len(errors) > 0 { |
8426
|
|
|
return BundleRunResponseMultiError(errors) |
8427
|
|
|
} |
8428
|
|
|
|
8429
|
|
|
return nil |
8430
|
|
|
} |
8431
|
|
|
|
8432
|
|
|
// BundleRunResponseMultiError is an error wrapping multiple validation errors |
8433
|
|
|
// returned by BundleRunResponse.ValidateAll() if the designated constraints |
8434
|
|
|
// aren't met. |
8435
|
|
|
type BundleRunResponseMultiError []error |
8436
|
|
|
|
8437
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
8438
|
|
|
func (m BundleRunResponseMultiError) Error() string { |
8439
|
|
|
var msgs []string |
8440
|
|
|
for _, err := range m { |
8441
|
|
|
msgs = append(msgs, err.Error()) |
8442
|
|
|
} |
8443
|
|
|
return strings.Join(msgs, "; ") |
8444
|
|
|
} |
8445
|
|
|
|
8446
|
|
|
// AllErrors returns a list of validation violation errors. |
8447
|
|
|
func (m BundleRunResponseMultiError) AllErrors() []error { return m } |
8448
|
|
|
|
8449
|
|
|
// BundleRunResponseValidationError is the validation error returned by |
8450
|
|
|
// BundleRunResponse.Validate if the designated constraints aren't met. |
8451
|
|
|
type BundleRunResponseValidationError struct { |
8452
|
|
|
field string |
8453
|
|
|
reason string |
8454
|
|
|
cause error |
8455
|
|
|
key bool |
8456
|
|
|
} |
8457
|
|
|
|
8458
|
|
|
// Field function returns field value. |
8459
|
|
|
func (e BundleRunResponseValidationError) Field() string { return e.field } |
8460
|
|
|
|
8461
|
|
|
// Reason function returns reason value. |
8462
|
|
|
func (e BundleRunResponseValidationError) Reason() string { return e.reason } |
8463
|
|
|
|
8464
|
|
|
// Cause function returns cause value. |
8465
|
|
|
func (e BundleRunResponseValidationError) Cause() error { return e.cause } |
8466
|
|
|
|
8467
|
|
|
// Key function returns key value. |
8468
|
|
|
func (e BundleRunResponseValidationError) Key() bool { return e.key } |
8469
|
|
|
|
8470
|
|
|
// ErrorName returns error name. |
8471
|
|
|
func (e BundleRunResponseValidationError) ErrorName() string { |
8472
|
|
|
return "BundleRunResponseValidationError" |
8473
|
|
|
} |
8474
|
|
|
|
8475
|
|
|
// Error satisfies the builtin error interface |
8476
|
|
|
func (e BundleRunResponseValidationError) Error() string { |
8477
|
|
|
cause := "" |
8478
|
|
|
if e.cause != nil { |
8479
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
8480
|
|
|
} |
8481
|
|
|
|
8482
|
|
|
key := "" |
8483
|
|
|
if e.key { |
8484
|
|
|
key = "key for " |
8485
|
|
|
} |
8486
|
|
|
|
8487
|
|
|
return fmt.Sprintf( |
8488
|
|
|
"invalid %sBundleRunResponse.%s: %s%s", |
8489
|
|
|
key, |
8490
|
|
|
e.field, |
8491
|
|
|
e.reason, |
8492
|
|
|
cause) |
8493
|
|
|
} |
8494
|
|
|
|
8495
|
|
|
var _ error = BundleRunResponseValidationError{} |
8496
|
|
|
|
8497
|
|
|
var _ interface { |
8498
|
|
|
Field() string |
8499
|
|
|
Reason() string |
8500
|
|
|
Key() bool |
8501
|
|
|
Cause() error |
8502
|
|
|
ErrorName() string |
8503
|
|
|
} = BundleRunResponseValidationError{} |
8504
|
|
|
|
8505
|
|
|
// Validate checks the field values on BundleWriteRequest with the rules |
8506
|
|
|
// defined in the proto definition for this message. If any rules are |
8507
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
8508
|
|
|
func (m *BundleWriteRequest) Validate() error { |
8509
|
|
|
return m.validate(false) |
8510
|
|
|
} |
8511
|
|
|
|
8512
|
|
|
// ValidateAll checks the field values on BundleWriteRequest with the rules |
8513
|
|
|
// defined in the proto definition for this message. If any rules are |
8514
|
|
|
// violated, the result is a list of violation errors wrapped in |
8515
|
|
|
// BundleWriteRequestMultiError, or nil if none found. |
8516
|
|
|
func (m *BundleWriteRequest) ValidateAll() error { |
8517
|
|
|
return m.validate(true) |
8518
|
|
|
} |
8519
|
|
|
|
8520
|
|
|
func (m *BundleWriteRequest) validate(all bool) error { |
8521
|
|
|
if m == nil { |
8522
|
|
|
return nil |
8523
|
|
|
} |
8524
|
|
|
|
8525
|
|
|
var errors []error |
8526
|
|
|
|
8527
|
|
|
if len(m.GetTenantId()) > 128 { |
8528
|
|
|
err := BundleWriteRequestValidationError{ |
8529
|
|
|
field: "TenantId", |
8530
|
|
|
reason: "value length must be at most 128 bytes", |
8531
|
|
|
} |
8532
|
|
|
if !all { |
8533
|
|
|
return err |
8534
|
|
|
} |
8535
|
|
|
errors = append(errors, err) |
8536
|
|
|
} |
8537
|
|
|
|
8538
|
|
|
if !_BundleWriteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
8539
|
|
|
err := BundleWriteRequestValidationError{ |
8540
|
|
|
field: "TenantId", |
8541
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
8542
|
|
|
} |
8543
|
|
|
if !all { |
8544
|
|
|
return err |
8545
|
|
|
} |
8546
|
|
|
errors = append(errors, err) |
8547
|
|
|
} |
8548
|
|
|
|
8549
|
|
|
for idx, item := range m.GetBundles() { |
8550
|
|
|
_, _ = idx, item |
8551
|
|
|
|
8552
|
|
|
if all { |
8553
|
|
|
switch v := interface{}(item).(type) { |
8554
|
|
|
case interface{ ValidateAll() error }: |
8555
|
|
|
if err := v.ValidateAll(); err != nil { |
8556
|
|
|
errors = append(errors, BundleWriteRequestValidationError{ |
8557
|
|
|
field: fmt.Sprintf("Bundles[%v]", idx), |
8558
|
|
|
reason: "embedded message failed validation", |
8559
|
|
|
cause: err, |
8560
|
|
|
}) |
8561
|
|
|
} |
8562
|
|
|
case interface{ Validate() error }: |
8563
|
|
|
if err := v.Validate(); err != nil { |
8564
|
|
|
errors = append(errors, BundleWriteRequestValidationError{ |
8565
|
|
|
field: fmt.Sprintf("Bundles[%v]", idx), |
8566
|
|
|
reason: "embedded message failed validation", |
8567
|
|
|
cause: err, |
8568
|
|
|
}) |
8569
|
|
|
} |
8570
|
|
|
} |
8571
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
8572
|
|
|
if err := v.Validate(); err != nil { |
8573
|
|
|
return BundleWriteRequestValidationError{ |
8574
|
|
|
field: fmt.Sprintf("Bundles[%v]", idx), |
8575
|
|
|
reason: "embedded message failed validation", |
8576
|
|
|
cause: err, |
8577
|
|
|
} |
8578
|
|
|
} |
8579
|
|
|
} |
8580
|
|
|
|
8581
|
|
|
} |
8582
|
|
|
|
8583
|
|
|
if len(errors) > 0 { |
8584
|
|
|
return BundleWriteRequestMultiError(errors) |
8585
|
|
|
} |
8586
|
|
|
|
8587
|
|
|
return nil |
8588
|
|
|
} |
8589
|
|
|
|
8590
|
|
|
// BundleWriteRequestMultiError is an error wrapping multiple validation errors |
8591
|
|
|
// returned by BundleWriteRequest.ValidateAll() if the designated constraints |
8592
|
|
|
// aren't met. |
8593
|
|
|
type BundleWriteRequestMultiError []error |
8594
|
|
|
|
8595
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
8596
|
|
|
func (m BundleWriteRequestMultiError) Error() string { |
8597
|
|
|
var msgs []string |
8598
|
|
|
for _, err := range m { |
8599
|
|
|
msgs = append(msgs, err.Error()) |
8600
|
|
|
} |
8601
|
|
|
return strings.Join(msgs, "; ") |
8602
|
|
|
} |
8603
|
|
|
|
8604
|
|
|
// AllErrors returns a list of validation violation errors. |
8605
|
|
|
func (m BundleWriteRequestMultiError) AllErrors() []error { return m } |
8606
|
|
|
|
8607
|
|
|
// BundleWriteRequestValidationError is the validation error returned by |
8608
|
|
|
// BundleWriteRequest.Validate if the designated constraints aren't met. |
8609
|
|
|
type BundleWriteRequestValidationError struct { |
8610
|
|
|
field string |
8611
|
|
|
reason string |
8612
|
|
|
cause error |
8613
|
|
|
key bool |
8614
|
|
|
} |
8615
|
|
|
|
8616
|
|
|
// Field function returns field value. |
8617
|
|
|
func (e BundleWriteRequestValidationError) Field() string { return e.field } |
8618
|
|
|
|
8619
|
|
|
// Reason function returns reason value. |
8620
|
|
|
func (e BundleWriteRequestValidationError) Reason() string { return e.reason } |
8621
|
|
|
|
8622
|
|
|
// Cause function returns cause value. |
8623
|
|
|
func (e BundleWriteRequestValidationError) Cause() error { return e.cause } |
8624
|
|
|
|
8625
|
|
|
// Key function returns key value. |
8626
|
|
|
func (e BundleWriteRequestValidationError) Key() bool { return e.key } |
8627
|
|
|
|
8628
|
|
|
// ErrorName returns error name. |
8629
|
|
|
func (e BundleWriteRequestValidationError) ErrorName() string { |
8630
|
|
|
return "BundleWriteRequestValidationError" |
8631
|
|
|
} |
8632
|
|
|
|
8633
|
|
|
// Error satisfies the builtin error interface |
8634
|
|
|
func (e BundleWriteRequestValidationError) Error() string { |
8635
|
|
|
cause := "" |
8636
|
|
|
if e.cause != nil { |
8637
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
8638
|
|
|
} |
8639
|
|
|
|
8640
|
|
|
key := "" |
8641
|
|
|
if e.key { |
8642
|
|
|
key = "key for " |
8643
|
|
|
} |
8644
|
|
|
|
8645
|
|
|
return fmt.Sprintf( |
8646
|
|
|
"invalid %sBundleWriteRequest.%s: %s%s", |
8647
|
|
|
key, |
8648
|
|
|
e.field, |
8649
|
|
|
e.reason, |
8650
|
|
|
cause) |
8651
|
|
|
} |
8652
|
|
|
|
8653
|
|
|
var _ error = BundleWriteRequestValidationError{} |
8654
|
|
|
|
8655
|
|
|
var _ interface { |
8656
|
|
|
Field() string |
8657
|
|
|
Reason() string |
8658
|
|
|
Key() bool |
8659
|
|
|
Cause() error |
8660
|
|
|
ErrorName() string |
8661
|
|
|
} = BundleWriteRequestValidationError{} |
8662
|
|
|
|
8663
|
|
|
var _BundleWriteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
8664
|
|
|
|
8665
|
|
|
// Validate checks the field values on BundleWriteResponse with the rules |
8666
|
|
|
// defined in the proto definition for this message. If any rules are |
8667
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
8668
|
|
|
func (m *BundleWriteResponse) Validate() error { |
8669
|
|
|
return m.validate(false) |
8670
|
|
|
} |
8671
|
|
|
|
8672
|
|
|
// ValidateAll checks the field values on BundleWriteResponse with the rules |
8673
|
|
|
// defined in the proto definition for this message. If any rules are |
8674
|
|
|
// violated, the result is a list of violation errors wrapped in |
8675
|
|
|
// BundleWriteResponseMultiError, or nil if none found. |
8676
|
|
|
func (m *BundleWriteResponse) ValidateAll() error { |
8677
|
|
|
return m.validate(true) |
8678
|
|
|
} |
8679
|
|
|
|
8680
|
|
|
func (m *BundleWriteResponse) validate(all bool) error { |
8681
|
|
|
if m == nil { |
8682
|
|
|
return nil |
8683
|
|
|
} |
8684
|
|
|
|
8685
|
|
|
var errors []error |
8686
|
|
|
|
8687
|
|
|
if len(errors) > 0 { |
8688
|
|
|
return BundleWriteResponseMultiError(errors) |
8689
|
|
|
} |
8690
|
|
|
|
8691
|
|
|
return nil |
8692
|
|
|
} |
8693
|
|
|
|
8694
|
|
|
// BundleWriteResponseMultiError is an error wrapping multiple validation |
8695
|
|
|
// errors returned by BundleWriteResponse.ValidateAll() if the designated |
8696
|
|
|
// constraints aren't met. |
8697
|
|
|
type BundleWriteResponseMultiError []error |
8698
|
|
|
|
8699
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
8700
|
|
|
func (m BundleWriteResponseMultiError) Error() string { |
8701
|
|
|
var msgs []string |
8702
|
|
|
for _, err := range m { |
8703
|
|
|
msgs = append(msgs, err.Error()) |
8704
|
|
|
} |
8705
|
|
|
return strings.Join(msgs, "; ") |
8706
|
|
|
} |
8707
|
|
|
|
8708
|
|
|
// AllErrors returns a list of validation violation errors. |
8709
|
|
|
func (m BundleWriteResponseMultiError) AllErrors() []error { return m } |
8710
|
|
|
|
8711
|
|
|
// BundleWriteResponseValidationError is the validation error returned by |
8712
|
|
|
// BundleWriteResponse.Validate if the designated constraints aren't met. |
8713
|
|
|
type BundleWriteResponseValidationError struct { |
8714
|
|
|
field string |
8715
|
|
|
reason string |
8716
|
|
|
cause error |
8717
|
|
|
key bool |
8718
|
|
|
} |
8719
|
|
|
|
8720
|
|
|
// Field function returns field value. |
8721
|
|
|
func (e BundleWriteResponseValidationError) Field() string { return e.field } |
8722
|
|
|
|
8723
|
|
|
// Reason function returns reason value. |
8724
|
|
|
func (e BundleWriteResponseValidationError) Reason() string { return e.reason } |
8725
|
|
|
|
8726
|
|
|
// Cause function returns cause value. |
8727
|
|
|
func (e BundleWriteResponseValidationError) Cause() error { return e.cause } |
8728
|
|
|
|
8729
|
|
|
// Key function returns key value. |
8730
|
|
|
func (e BundleWriteResponseValidationError) Key() bool { return e.key } |
8731
|
|
|
|
8732
|
|
|
// ErrorName returns error name. |
8733
|
|
|
func (e BundleWriteResponseValidationError) ErrorName() string { |
8734
|
|
|
return "BundleWriteResponseValidationError" |
8735
|
|
|
} |
8736
|
|
|
|
8737
|
|
|
// Error satisfies the builtin error interface |
8738
|
|
|
func (e BundleWriteResponseValidationError) Error() string { |
8739
|
|
|
cause := "" |
8740
|
|
|
if e.cause != nil { |
8741
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
8742
|
|
|
} |
8743
|
|
|
|
8744
|
|
|
key := "" |
8745
|
|
|
if e.key { |
8746
|
|
|
key = "key for " |
8747
|
|
|
} |
8748
|
|
|
|
8749
|
|
|
return fmt.Sprintf( |
8750
|
|
|
"invalid %sBundleWriteResponse.%s: %s%s", |
8751
|
|
|
key, |
8752
|
|
|
e.field, |
8753
|
|
|
e.reason, |
8754
|
|
|
cause) |
8755
|
|
|
} |
8756
|
|
|
|
8757
|
|
|
var _ error = BundleWriteResponseValidationError{} |
8758
|
|
|
|
8759
|
|
|
var _ interface { |
8760
|
|
|
Field() string |
8761
|
|
|
Reason() string |
8762
|
|
|
Key() bool |
8763
|
|
|
Cause() error |
8764
|
|
|
ErrorName() string |
8765
|
|
|
} = BundleWriteResponseValidationError{} |
8766
|
|
|
|
8767
|
|
|
// Validate checks the field values on BundleReadRequest with the rules defined |
8768
|
|
|
// in the proto definition for this message. If any rules are violated, the |
8769
|
|
|
// first error encountered is returned, or nil if there are no violations. |
8770
|
|
|
func (m *BundleReadRequest) Validate() error { |
8771
|
|
|
return m.validate(false) |
8772
|
|
|
} |
8773
|
|
|
|
8774
|
|
|
// ValidateAll checks the field values on BundleReadRequest with the rules |
8775
|
|
|
// defined in the proto definition for this message. If any rules are |
8776
|
|
|
// violated, the result is a list of violation errors wrapped in |
8777
|
|
|
// BundleReadRequestMultiError, or nil if none found. |
8778
|
|
|
func (m *BundleReadRequest) ValidateAll() error { |
8779
|
|
|
return m.validate(true) |
8780
|
|
|
} |
8781
|
|
|
|
8782
|
|
|
func (m *BundleReadRequest) validate(all bool) error { |
8783
|
|
|
if m == nil { |
8784
|
|
|
return nil |
8785
|
|
|
} |
8786
|
|
|
|
8787
|
|
|
var errors []error |
8788
|
|
|
|
8789
|
|
|
if len(m.GetTenantId()) > 128 { |
8790
|
|
|
err := BundleReadRequestValidationError{ |
8791
|
|
|
field: "TenantId", |
8792
|
|
|
reason: "value length must be at most 128 bytes", |
8793
|
|
|
} |
8794
|
|
|
if !all { |
8795
|
|
|
return err |
8796
|
|
|
} |
8797
|
|
|
errors = append(errors, err) |
8798
|
|
|
} |
8799
|
|
|
|
8800
|
|
|
if !_BundleReadRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
8801
|
|
|
err := BundleReadRequestValidationError{ |
8802
|
|
|
field: "TenantId", |
8803
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
8804
|
|
|
} |
8805
|
|
|
if !all { |
8806
|
|
|
return err |
8807
|
|
|
} |
8808
|
|
|
errors = append(errors, err) |
8809
|
|
|
} |
8810
|
|
|
|
8811
|
|
|
// no validation rules for Name |
8812
|
|
|
|
8813
|
|
|
if len(errors) > 0 { |
8814
|
|
|
return BundleReadRequestMultiError(errors) |
8815
|
|
|
} |
8816
|
|
|
|
8817
|
|
|
return nil |
8818
|
|
|
} |
8819
|
|
|
|
8820
|
|
|
// BundleReadRequestMultiError is an error wrapping multiple validation errors |
8821
|
|
|
// returned by BundleReadRequest.ValidateAll() if the designated constraints |
8822
|
|
|
// aren't met. |
8823
|
|
|
type BundleReadRequestMultiError []error |
8824
|
|
|
|
8825
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
8826
|
|
|
func (m BundleReadRequestMultiError) Error() string { |
8827
|
|
|
var msgs []string |
8828
|
|
|
for _, err := range m { |
8829
|
|
|
msgs = append(msgs, err.Error()) |
8830
|
|
|
} |
8831
|
|
|
return strings.Join(msgs, "; ") |
8832
|
|
|
} |
8833
|
|
|
|
8834
|
|
|
// AllErrors returns a list of validation violation errors. |
8835
|
|
|
func (m BundleReadRequestMultiError) AllErrors() []error { return m } |
8836
|
|
|
|
8837
|
|
|
// BundleReadRequestValidationError is the validation error returned by |
8838
|
|
|
// BundleReadRequest.Validate if the designated constraints aren't met. |
8839
|
|
|
type BundleReadRequestValidationError struct { |
8840
|
|
|
field string |
8841
|
|
|
reason string |
8842
|
|
|
cause error |
8843
|
|
|
key bool |
8844
|
|
|
} |
8845
|
|
|
|
8846
|
|
|
// Field function returns field value. |
8847
|
|
|
func (e BundleReadRequestValidationError) Field() string { return e.field } |
8848
|
|
|
|
8849
|
|
|
// Reason function returns reason value. |
8850
|
|
|
func (e BundleReadRequestValidationError) Reason() string { return e.reason } |
8851
|
|
|
|
8852
|
|
|
// Cause function returns cause value. |
8853
|
|
|
func (e BundleReadRequestValidationError) Cause() error { return e.cause } |
8854
|
|
|
|
8855
|
|
|
// Key function returns key value. |
8856
|
|
|
func (e BundleReadRequestValidationError) Key() bool { return e.key } |
8857
|
|
|
|
8858
|
|
|
// ErrorName returns error name. |
8859
|
|
|
func (e BundleReadRequestValidationError) ErrorName() string { |
8860
|
|
|
return "BundleReadRequestValidationError" |
8861
|
|
|
} |
8862
|
|
|
|
8863
|
|
|
// Error satisfies the builtin error interface |
8864
|
|
|
func (e BundleReadRequestValidationError) Error() string { |
8865
|
|
|
cause := "" |
8866
|
|
|
if e.cause != nil { |
8867
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
8868
|
|
|
} |
8869
|
|
|
|
8870
|
|
|
key := "" |
8871
|
|
|
if e.key { |
8872
|
|
|
key = "key for " |
8873
|
|
|
} |
8874
|
|
|
|
8875
|
|
|
return fmt.Sprintf( |
8876
|
|
|
"invalid %sBundleReadRequest.%s: %s%s", |
8877
|
|
|
key, |
8878
|
|
|
e.field, |
8879
|
|
|
e.reason, |
8880
|
|
|
cause) |
8881
|
|
|
} |
8882
|
|
|
|
8883
|
|
|
var _ error = BundleReadRequestValidationError{} |
8884
|
|
|
|
8885
|
|
|
var _ interface { |
8886
|
|
|
Field() string |
8887
|
|
|
Reason() string |
8888
|
|
|
Key() bool |
8889
|
|
|
Cause() error |
8890
|
|
|
ErrorName() string |
8891
|
|
|
} = BundleReadRequestValidationError{} |
8892
|
|
|
|
8893
|
|
|
var _BundleReadRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
8894
|
|
|
|
8895
|
|
|
// Validate checks the field values on BundleReadResponse with the rules |
8896
|
|
|
// defined in the proto definition for this message. If any rules are |
8897
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
8898
|
|
|
func (m *BundleReadResponse) Validate() error { |
8899
|
|
|
return m.validate(false) |
8900
|
|
|
} |
8901
|
|
|
|
8902
|
|
|
// ValidateAll checks the field values on BundleReadResponse with the rules |
8903
|
|
|
// defined in the proto definition for this message. If any rules are |
8904
|
|
|
// violated, the result is a list of violation errors wrapped in |
8905
|
|
|
// BundleReadResponseMultiError, or nil if none found. |
8906
|
|
|
func (m *BundleReadResponse) ValidateAll() error { |
8907
|
|
|
return m.validate(true) |
8908
|
|
|
} |
8909
|
|
|
|
8910
|
|
|
func (m *BundleReadResponse) validate(all bool) error { |
8911
|
|
|
if m == nil { |
8912
|
|
|
return nil |
8913
|
|
|
} |
8914
|
|
|
|
8915
|
|
|
var errors []error |
8916
|
|
|
|
8917
|
|
|
if all { |
8918
|
|
|
switch v := interface{}(m.GetBundle()).(type) { |
8919
|
|
|
case interface{ ValidateAll() error }: |
8920
|
|
|
if err := v.ValidateAll(); err != nil { |
8921
|
|
|
errors = append(errors, BundleReadResponseValidationError{ |
8922
|
|
|
field: "Bundle", |
8923
|
|
|
reason: "embedded message failed validation", |
8924
|
|
|
cause: err, |
8925
|
|
|
}) |
8926
|
|
|
} |
8927
|
|
|
case interface{ Validate() error }: |
8928
|
|
|
if err := v.Validate(); err != nil { |
8929
|
|
|
errors = append(errors, BundleReadResponseValidationError{ |
8930
|
|
|
field: "Bundle", |
8931
|
|
|
reason: "embedded message failed validation", |
8932
|
|
|
cause: err, |
8933
|
|
|
}) |
8934
|
|
|
} |
8935
|
|
|
} |
8936
|
|
|
} else if v, ok := interface{}(m.GetBundle()).(interface{ Validate() error }); ok { |
8937
|
|
|
if err := v.Validate(); err != nil { |
8938
|
|
|
return BundleReadResponseValidationError{ |
8939
|
|
|
field: "Bundle", |
8940
|
|
|
reason: "embedded message failed validation", |
8941
|
|
|
cause: err, |
8942
|
|
|
} |
8943
|
|
|
} |
8944
|
|
|
} |
8945
|
|
|
|
8946
|
|
|
if len(errors) > 0 { |
8947
|
|
|
return BundleReadResponseMultiError(errors) |
8948
|
|
|
} |
8949
|
|
|
|
8950
|
|
|
return nil |
8951
|
|
|
} |
8952
|
|
|
|
8953
|
|
|
// BundleReadResponseMultiError is an error wrapping multiple validation errors |
8954
|
|
|
// returned by BundleReadResponse.ValidateAll() if the designated constraints |
8955
|
|
|
// aren't met. |
8956
|
|
|
type BundleReadResponseMultiError []error |
8957
|
|
|
|
8958
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
8959
|
|
|
func (m BundleReadResponseMultiError) Error() string { |
8960
|
|
|
var msgs []string |
8961
|
|
|
for _, err := range m { |
8962
|
|
|
msgs = append(msgs, err.Error()) |
8963
|
|
|
} |
8964
|
|
|
return strings.Join(msgs, "; ") |
8965
|
|
|
} |
8966
|
|
|
|
8967
|
|
|
// AllErrors returns a list of validation violation errors. |
8968
|
|
|
func (m BundleReadResponseMultiError) AllErrors() []error { return m } |
8969
|
|
|
|
8970
|
|
|
// BundleReadResponseValidationError is the validation error returned by |
8971
|
|
|
// BundleReadResponse.Validate if the designated constraints aren't met. |
8972
|
|
|
type BundleReadResponseValidationError struct { |
8973
|
|
|
field string |
8974
|
|
|
reason string |
8975
|
|
|
cause error |
8976
|
|
|
key bool |
8977
|
|
|
} |
8978
|
|
|
|
8979
|
|
|
// Field function returns field value. |
8980
|
|
|
func (e BundleReadResponseValidationError) Field() string { return e.field } |
8981
|
|
|
|
8982
|
|
|
// Reason function returns reason value. |
8983
|
|
|
func (e BundleReadResponseValidationError) Reason() string { return e.reason } |
8984
|
|
|
|
8985
|
|
|
// Cause function returns cause value. |
8986
|
|
|
func (e BundleReadResponseValidationError) Cause() error { return e.cause } |
8987
|
|
|
|
8988
|
|
|
// Key function returns key value. |
8989
|
|
|
func (e BundleReadResponseValidationError) Key() bool { return e.key } |
8990
|
|
|
|
8991
|
|
|
// ErrorName returns error name. |
8992
|
|
|
func (e BundleReadResponseValidationError) ErrorName() string { |
8993
|
|
|
return "BundleReadResponseValidationError" |
8994
|
|
|
} |
8995
|
|
|
|
8996
|
|
|
// Error satisfies the builtin error interface |
8997
|
|
|
func (e BundleReadResponseValidationError) Error() string { |
8998
|
|
|
cause := "" |
8999
|
|
|
if e.cause != nil { |
9000
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
9001
|
|
|
} |
9002
|
|
|
|
9003
|
|
|
key := "" |
9004
|
|
|
if e.key { |
9005
|
|
|
key = "key for " |
9006
|
|
|
} |
9007
|
|
|
|
9008
|
|
|
return fmt.Sprintf( |
9009
|
|
|
"invalid %sBundleReadResponse.%s: %s%s", |
9010
|
|
|
key, |
9011
|
|
|
e.field, |
9012
|
|
|
e.reason, |
9013
|
|
|
cause) |
9014
|
|
|
} |
9015
|
|
|
|
9016
|
|
|
var _ error = BundleReadResponseValidationError{} |
9017
|
|
|
|
9018
|
|
|
var _ interface { |
9019
|
|
|
Field() string |
9020
|
|
|
Reason() string |
9021
|
|
|
Key() bool |
9022
|
|
|
Cause() error |
9023
|
|
|
ErrorName() string |
9024
|
|
|
} = BundleReadResponseValidationError{} |
9025
|
|
|
|
9026
|
|
|
// Validate checks the field values on BundleDeleteRequest with the rules |
9027
|
|
|
// defined in the proto definition for this message. If any rules are |
9028
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
9029
|
|
|
func (m *BundleDeleteRequest) Validate() error { |
9030
|
|
|
return m.validate(false) |
9031
|
|
|
} |
9032
|
|
|
|
9033
|
|
|
// ValidateAll checks the field values on BundleDeleteRequest with the rules |
9034
|
|
|
// defined in the proto definition for this message. If any rules are |
9035
|
|
|
// violated, the result is a list of violation errors wrapped in |
9036
|
|
|
// BundleDeleteRequestMultiError, or nil if none found. |
9037
|
|
|
func (m *BundleDeleteRequest) ValidateAll() error { |
9038
|
|
|
return m.validate(true) |
9039
|
|
|
} |
9040
|
|
|
|
9041
|
|
|
func (m *BundleDeleteRequest) validate(all bool) error { |
9042
|
|
|
if m == nil { |
9043
|
|
|
return nil |
9044
|
|
|
} |
9045
|
|
|
|
9046
|
|
|
var errors []error |
9047
|
|
|
|
9048
|
|
|
if len(m.GetTenantId()) > 128 { |
9049
|
|
|
err := BundleDeleteRequestValidationError{ |
9050
|
|
|
field: "TenantId", |
9051
|
|
|
reason: "value length must be at most 128 bytes", |
9052
|
|
|
} |
9053
|
|
|
if !all { |
9054
|
|
|
return err |
9055
|
|
|
} |
9056
|
|
|
errors = append(errors, err) |
9057
|
|
|
} |
9058
|
|
|
|
9059
|
|
|
if !_BundleDeleteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
9060
|
|
|
err := BundleDeleteRequestValidationError{ |
9061
|
|
|
field: "TenantId", |
9062
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
9063
|
|
|
} |
9064
|
|
|
if !all { |
9065
|
|
|
return err |
9066
|
|
|
} |
9067
|
|
|
errors = append(errors, err) |
9068
|
|
|
} |
9069
|
|
|
|
9070
|
|
|
// no validation rules for Name |
9071
|
|
|
|
9072
|
|
|
if len(errors) > 0 { |
9073
|
|
|
return BundleDeleteRequestMultiError(errors) |
9074
|
|
|
} |
9075
|
|
|
|
9076
|
|
|
return nil |
9077
|
|
|
} |
9078
|
|
|
|
9079
|
|
|
// BundleDeleteRequestMultiError is an error wrapping multiple validation |
9080
|
|
|
// errors returned by BundleDeleteRequest.ValidateAll() if the designated |
9081
|
|
|
// constraints aren't met. |
9082
|
|
|
type BundleDeleteRequestMultiError []error |
9083
|
|
|
|
9084
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
9085
|
|
|
func (m BundleDeleteRequestMultiError) Error() string { |
9086
|
|
|
var msgs []string |
9087
|
|
|
for _, err := range m { |
9088
|
|
|
msgs = append(msgs, err.Error()) |
9089
|
|
|
} |
9090
|
|
|
return strings.Join(msgs, "; ") |
9091
|
|
|
} |
9092
|
|
|
|
9093
|
|
|
// AllErrors returns a list of validation violation errors. |
9094
|
|
|
func (m BundleDeleteRequestMultiError) AllErrors() []error { return m } |
9095
|
|
|
|
9096
|
|
|
// BundleDeleteRequestValidationError is the validation error returned by |
9097
|
|
|
// BundleDeleteRequest.Validate if the designated constraints aren't met. |
9098
|
|
|
type BundleDeleteRequestValidationError struct { |
9099
|
|
|
field string |
9100
|
|
|
reason string |
9101
|
|
|
cause error |
9102
|
|
|
key bool |
9103
|
|
|
} |
9104
|
|
|
|
9105
|
|
|
// Field function returns field value. |
9106
|
|
|
func (e BundleDeleteRequestValidationError) Field() string { return e.field } |
9107
|
|
|
|
9108
|
|
|
// Reason function returns reason value. |
9109
|
|
|
func (e BundleDeleteRequestValidationError) Reason() string { return e.reason } |
9110
|
|
|
|
9111
|
|
|
// Cause function returns cause value. |
9112
|
|
|
func (e BundleDeleteRequestValidationError) Cause() error { return e.cause } |
9113
|
|
|
|
9114
|
|
|
// Key function returns key value. |
9115
|
|
|
func (e BundleDeleteRequestValidationError) Key() bool { return e.key } |
9116
|
|
|
|
9117
|
|
|
// ErrorName returns error name. |
9118
|
|
|
func (e BundleDeleteRequestValidationError) ErrorName() string { |
9119
|
|
|
return "BundleDeleteRequestValidationError" |
9120
|
|
|
} |
9121
|
|
|
|
9122
|
|
|
// Error satisfies the builtin error interface |
9123
|
|
|
func (e BundleDeleteRequestValidationError) Error() string { |
9124
|
|
|
cause := "" |
9125
|
|
|
if e.cause != nil { |
9126
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
9127
|
|
|
} |
9128
|
|
|
|
9129
|
|
|
key := "" |
9130
|
|
|
if e.key { |
9131
|
|
|
key = "key for " |
9132
|
|
|
} |
9133
|
|
|
|
9134
|
|
|
return fmt.Sprintf( |
9135
|
|
|
"invalid %sBundleDeleteRequest.%s: %s%s", |
9136
|
|
|
key, |
9137
|
|
|
e.field, |
9138
|
|
|
e.reason, |
9139
|
|
|
cause) |
9140
|
|
|
} |
9141
|
|
|
|
9142
|
|
|
var _ error = BundleDeleteRequestValidationError{} |
9143
|
|
|
|
9144
|
|
|
var _ interface { |
9145
|
|
|
Field() string |
9146
|
|
|
Reason() string |
9147
|
|
|
Key() bool |
9148
|
|
|
Cause() error |
9149
|
|
|
ErrorName() string |
9150
|
|
|
} = BundleDeleteRequestValidationError{} |
9151
|
|
|
|
9152
|
|
|
var _BundleDeleteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
9153
|
|
|
|
9154
|
|
|
// Validate checks the field values on BundleDeleteResponse with the rules |
9155
|
|
|
// defined in the proto definition for this message. If any rules are |
9156
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
9157
|
|
|
func (m *BundleDeleteResponse) Validate() error { |
9158
|
|
|
return m.validate(false) |
9159
|
|
|
} |
9160
|
|
|
|
9161
|
|
|
// ValidateAll checks the field values on BundleDeleteResponse with the rules |
9162
|
|
|
// defined in the proto definition for this message. If any rules are |
9163
|
|
|
// violated, the result is a list of violation errors wrapped in |
9164
|
|
|
// BundleDeleteResponseMultiError, or nil if none found. |
9165
|
|
|
func (m *BundleDeleteResponse) ValidateAll() error { |
9166
|
|
|
return m.validate(true) |
9167
|
|
|
} |
9168
|
|
|
|
9169
|
|
|
func (m *BundleDeleteResponse) validate(all bool) error { |
9170
|
|
|
if m == nil { |
9171
|
|
|
return nil |
9172
|
|
|
} |
9173
|
|
|
|
9174
|
|
|
var errors []error |
9175
|
|
|
|
9176
|
|
|
// no validation rules for Name |
9177
|
|
|
|
9178
|
|
|
if len(errors) > 0 { |
9179
|
|
|
return BundleDeleteResponseMultiError(errors) |
9180
|
|
|
} |
9181
|
|
|
|
9182
|
|
|
return nil |
9183
|
|
|
} |
9184
|
|
|
|
9185
|
|
|
// BundleDeleteResponseMultiError is an error wrapping multiple validation |
9186
|
|
|
// errors returned by BundleDeleteResponse.ValidateAll() if the designated |
9187
|
|
|
// constraints aren't met. |
9188
|
|
|
type BundleDeleteResponseMultiError []error |
9189
|
|
|
|
9190
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
9191
|
|
|
func (m BundleDeleteResponseMultiError) Error() string { |
9192
|
|
|
var msgs []string |
9193
|
|
|
for _, err := range m { |
9194
|
|
|
msgs = append(msgs, err.Error()) |
9195
|
|
|
} |
9196
|
|
|
return strings.Join(msgs, "; ") |
9197
|
|
|
} |
9198
|
|
|
|
9199
|
|
|
// AllErrors returns a list of validation violation errors. |
9200
|
|
|
func (m BundleDeleteResponseMultiError) AllErrors() []error { return m } |
9201
|
|
|
|
9202
|
|
|
// BundleDeleteResponseValidationError is the validation error returned by |
9203
|
|
|
// BundleDeleteResponse.Validate if the designated constraints aren't met. |
9204
|
|
|
type BundleDeleteResponseValidationError struct { |
9205
|
|
|
field string |
9206
|
|
|
reason string |
9207
|
|
|
cause error |
9208
|
|
|
key bool |
9209
|
|
|
} |
9210
|
|
|
|
9211
|
|
|
// Field function returns field value. |
9212
|
|
|
func (e BundleDeleteResponseValidationError) Field() string { return e.field } |
9213
|
|
|
|
9214
|
|
|
// Reason function returns reason value. |
9215
|
|
|
func (e BundleDeleteResponseValidationError) Reason() string { return e.reason } |
9216
|
|
|
|
9217
|
|
|
// Cause function returns cause value. |
9218
|
|
|
func (e BundleDeleteResponseValidationError) Cause() error { return e.cause } |
9219
|
|
|
|
9220
|
|
|
// Key function returns key value. |
9221
|
|
|
func (e BundleDeleteResponseValidationError) Key() bool { return e.key } |
9222
|
|
|
|
9223
|
|
|
// ErrorName returns error name. |
9224
|
|
|
func (e BundleDeleteResponseValidationError) ErrorName() string { |
9225
|
|
|
return "BundleDeleteResponseValidationError" |
9226
|
|
|
} |
9227
|
|
|
|
9228
|
|
|
// Error satisfies the builtin error interface |
9229
|
|
|
func (e BundleDeleteResponseValidationError) Error() string { |
9230
|
|
|
cause := "" |
9231
|
|
|
if e.cause != nil { |
9232
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
9233
|
|
|
} |
9234
|
|
|
|
9235
|
|
|
key := "" |
9236
|
|
|
if e.key { |
9237
|
|
|
key = "key for " |
9238
|
|
|
} |
9239
|
|
|
|
9240
|
|
|
return fmt.Sprintf( |
9241
|
|
|
"invalid %sBundleDeleteResponse.%s: %s%s", |
9242
|
|
|
key, |
9243
|
|
|
e.field, |
9244
|
|
|
e.reason, |
9245
|
|
|
cause) |
9246
|
|
|
} |
9247
|
|
|
|
9248
|
|
|
var _ error = BundleDeleteResponseValidationError{} |
9249
|
|
|
|
9250
|
|
|
var _ interface { |
9251
|
|
|
Field() string |
9252
|
|
|
Reason() string |
9253
|
|
|
Key() bool |
9254
|
|
|
Cause() error |
9255
|
|
|
ErrorName() string |
9256
|
|
|
} = BundleDeleteResponseValidationError{} |
9257
|
|
|
|
9258
|
|
|
// Validate checks the field values on TenantCreateRequest with the rules |
9259
|
|
|
// defined in the proto definition for this message. If any rules are |
9260
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
9261
|
|
|
func (m *TenantCreateRequest) Validate() error { |
9262
|
|
|
return m.validate(false) |
9263
|
|
|
} |
9264
|
|
|
|
9265
|
|
|
// ValidateAll checks the field values on TenantCreateRequest with the rules |
9266
|
|
|
// defined in the proto definition for this message. If any rules are |
9267
|
|
|
// violated, the result is a list of violation errors wrapped in |
9268
|
|
|
// TenantCreateRequestMultiError, or nil if none found. |
9269
|
|
|
func (m *TenantCreateRequest) ValidateAll() error { |
9270
|
|
|
return m.validate(true) |
9271
|
|
|
} |
9272
|
|
|
|
9273
|
|
|
func (m *TenantCreateRequest) validate(all bool) error { |
9274
|
|
|
if m == nil { |
9275
|
|
|
return nil |
9276
|
|
|
} |
9277
|
|
|
|
9278
|
|
|
var errors []error |
9279
|
|
|
|
9280
|
|
|
if len(m.GetId()) > 64 { |
9281
|
|
|
err := TenantCreateRequestValidationError{ |
9282
|
|
|
field: "Id", |
9283
|
|
|
reason: "value length must be at most 64 bytes", |
9284
|
|
|
} |
9285
|
|
|
if !all { |
9286
|
|
|
return err |
9287
|
|
|
} |
9288
|
|
|
errors = append(errors, err) |
9289
|
|
|
} |
9290
|
|
|
|
9291
|
|
|
if !_TenantCreateRequest_Id_Pattern.MatchString(m.GetId()) { |
9292
|
|
|
err := TenantCreateRequestValidationError{ |
9293
|
|
|
field: "Id", |
9294
|
|
|
reason: "value does not match regex pattern \"[a-zA-Z0-9-,]+\"", |
9295
|
|
|
} |
9296
|
|
|
if !all { |
9297
|
|
|
return err |
9298
|
|
|
} |
9299
|
|
|
errors = append(errors, err) |
9300
|
|
|
} |
9301
|
|
|
|
9302
|
|
|
if len(m.GetName()) > 64 { |
9303
|
|
|
err := TenantCreateRequestValidationError{ |
9304
|
|
|
field: "Name", |
9305
|
|
|
reason: "value length must be at most 64 bytes", |
9306
|
|
|
} |
9307
|
|
|
if !all { |
9308
|
|
|
return err |
9309
|
|
|
} |
9310
|
|
|
errors = append(errors, err) |
9311
|
|
|
} |
9312
|
|
|
|
9313
|
|
|
if len(errors) > 0 { |
9314
|
|
|
return TenantCreateRequestMultiError(errors) |
9315
|
|
|
} |
9316
|
|
|
|
9317
|
|
|
return nil |
9318
|
|
|
} |
9319
|
|
|
|
9320
|
|
|
// TenantCreateRequestMultiError is an error wrapping multiple validation |
9321
|
|
|
// errors returned by TenantCreateRequest.ValidateAll() if the designated |
9322
|
|
|
// constraints aren't met. |
9323
|
|
|
type TenantCreateRequestMultiError []error |
9324
|
|
|
|
9325
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
9326
|
|
|
func (m TenantCreateRequestMultiError) Error() string { |
9327
|
|
|
var msgs []string |
9328
|
|
|
for _, err := range m { |
9329
|
|
|
msgs = append(msgs, err.Error()) |
9330
|
|
|
} |
9331
|
|
|
return strings.Join(msgs, "; ") |
9332
|
|
|
} |
9333
|
|
|
|
9334
|
|
|
// AllErrors returns a list of validation violation errors. |
9335
|
|
|
func (m TenantCreateRequestMultiError) AllErrors() []error { return m } |
9336
|
|
|
|
9337
|
|
|
// TenantCreateRequestValidationError is the validation error returned by |
9338
|
|
|
// TenantCreateRequest.Validate if the designated constraints aren't met. |
9339
|
|
|
type TenantCreateRequestValidationError struct { |
9340
|
|
|
field string |
9341
|
|
|
reason string |
9342
|
|
|
cause error |
9343
|
|
|
key bool |
9344
|
|
|
} |
9345
|
|
|
|
9346
|
|
|
// Field function returns field value. |
9347
|
|
|
func (e TenantCreateRequestValidationError) Field() string { return e.field } |
9348
|
|
|
|
9349
|
|
|
// Reason function returns reason value. |
9350
|
|
|
func (e TenantCreateRequestValidationError) Reason() string { return e.reason } |
9351
|
|
|
|
9352
|
|
|
// Cause function returns cause value. |
9353
|
|
|
func (e TenantCreateRequestValidationError) Cause() error { return e.cause } |
9354
|
|
|
|
9355
|
|
|
// Key function returns key value. |
9356
|
|
|
func (e TenantCreateRequestValidationError) Key() bool { return e.key } |
9357
|
|
|
|
9358
|
|
|
// ErrorName returns error name. |
9359
|
|
|
func (e TenantCreateRequestValidationError) ErrorName() string { |
9360
|
|
|
return "TenantCreateRequestValidationError" |
9361
|
|
|
} |
9362
|
|
|
|
9363
|
|
|
// Error satisfies the builtin error interface |
9364
|
|
|
func (e TenantCreateRequestValidationError) Error() string { |
9365
|
|
|
cause := "" |
9366
|
|
|
if e.cause != nil { |
9367
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
9368
|
|
|
} |
9369
|
|
|
|
9370
|
|
|
key := "" |
9371
|
|
|
if e.key { |
9372
|
|
|
key = "key for " |
9373
|
|
|
} |
9374
|
|
|
|
9375
|
|
|
return fmt.Sprintf( |
9376
|
|
|
"invalid %sTenantCreateRequest.%s: %s%s", |
9377
|
|
|
key, |
9378
|
|
|
e.field, |
9379
|
|
|
e.reason, |
9380
|
|
|
cause) |
9381
|
|
|
} |
9382
|
|
|
|
9383
|
|
|
var _ error = TenantCreateRequestValidationError{} |
9384
|
|
|
|
9385
|
|
|
var _ interface { |
9386
|
|
|
Field() string |
9387
|
|
|
Reason() string |
9388
|
|
|
Key() bool |
9389
|
|
|
Cause() error |
9390
|
|
|
ErrorName() string |
9391
|
|
|
} = TenantCreateRequestValidationError{} |
9392
|
|
|
|
9393
|
|
|
var _TenantCreateRequest_Id_Pattern = regexp.MustCompile("[a-zA-Z0-9-,]+") |
9394
|
|
|
|
9395
|
|
|
// Validate checks the field values on TenantCreateResponse with the rules |
9396
|
|
|
// defined in the proto definition for this message. If any rules are |
9397
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
9398
|
|
|
func (m *TenantCreateResponse) Validate() error { |
9399
|
|
|
return m.validate(false) |
9400
|
|
|
} |
9401
|
|
|
|
9402
|
|
|
// ValidateAll checks the field values on TenantCreateResponse with the rules |
9403
|
|
|
// defined in the proto definition for this message. If any rules are |
9404
|
|
|
// violated, the result is a list of violation errors wrapped in |
9405
|
|
|
// TenantCreateResponseMultiError, or nil if none found. |
9406
|
|
|
func (m *TenantCreateResponse) ValidateAll() error { |
9407
|
|
|
return m.validate(true) |
9408
|
|
|
} |
9409
|
|
|
|
9410
|
|
|
func (m *TenantCreateResponse) validate(all bool) error { |
9411
|
|
|
if m == nil { |
9412
|
|
|
return nil |
9413
|
|
|
} |
9414
|
|
|
|
9415
|
|
|
var errors []error |
9416
|
|
|
|
9417
|
|
|
if all { |
9418
|
|
|
switch v := interface{}(m.GetTenant()).(type) { |
9419
|
|
|
case interface{ ValidateAll() error }: |
9420
|
|
|
if err := v.ValidateAll(); err != nil { |
9421
|
|
|
errors = append(errors, TenantCreateResponseValidationError{ |
9422
|
|
|
field: "Tenant", |
9423
|
|
|
reason: "embedded message failed validation", |
9424
|
|
|
cause: err, |
9425
|
|
|
}) |
9426
|
|
|
} |
9427
|
|
|
case interface{ Validate() error }: |
9428
|
|
|
if err := v.Validate(); err != nil { |
9429
|
|
|
errors = append(errors, TenantCreateResponseValidationError{ |
9430
|
|
|
field: "Tenant", |
9431
|
|
|
reason: "embedded message failed validation", |
9432
|
|
|
cause: err, |
9433
|
|
|
}) |
9434
|
|
|
} |
9435
|
|
|
} |
9436
|
|
|
} else if v, ok := interface{}(m.GetTenant()).(interface{ Validate() error }); ok { |
9437
|
|
|
if err := v.Validate(); err != nil { |
9438
|
|
|
return TenantCreateResponseValidationError{ |
9439
|
|
|
field: "Tenant", |
9440
|
|
|
reason: "embedded message failed validation", |
9441
|
|
|
cause: err, |
9442
|
|
|
} |
9443
|
|
|
} |
9444
|
|
|
} |
9445
|
|
|
|
9446
|
|
|
if len(errors) > 0 { |
9447
|
|
|
return TenantCreateResponseMultiError(errors) |
9448
|
|
|
} |
9449
|
|
|
|
9450
|
|
|
return nil |
9451
|
|
|
} |
9452
|
|
|
|
9453
|
|
|
// TenantCreateResponseMultiError is an error wrapping multiple validation |
9454
|
|
|
// errors returned by TenantCreateResponse.ValidateAll() if the designated |
9455
|
|
|
// constraints aren't met. |
9456
|
|
|
type TenantCreateResponseMultiError []error |
9457
|
|
|
|
9458
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
9459
|
|
|
func (m TenantCreateResponseMultiError) Error() string { |
9460
|
|
|
var msgs []string |
9461
|
|
|
for _, err := range m { |
9462
|
|
|
msgs = append(msgs, err.Error()) |
9463
|
|
|
} |
9464
|
|
|
return strings.Join(msgs, "; ") |
9465
|
|
|
} |
9466
|
|
|
|
9467
|
|
|
// AllErrors returns a list of validation violation errors. |
9468
|
|
|
func (m TenantCreateResponseMultiError) AllErrors() []error { return m } |
9469
|
|
|
|
9470
|
|
|
// TenantCreateResponseValidationError is the validation error returned by |
9471
|
|
|
// TenantCreateResponse.Validate if the designated constraints aren't met. |
9472
|
|
|
type TenantCreateResponseValidationError struct { |
9473
|
|
|
field string |
9474
|
|
|
reason string |
9475
|
|
|
cause error |
9476
|
|
|
key bool |
9477
|
|
|
} |
9478
|
|
|
|
9479
|
|
|
// Field function returns field value. |
9480
|
|
|
func (e TenantCreateResponseValidationError) Field() string { return e.field } |
9481
|
|
|
|
9482
|
|
|
// Reason function returns reason value. |
9483
|
|
|
func (e TenantCreateResponseValidationError) Reason() string { return e.reason } |
9484
|
|
|
|
9485
|
|
|
// Cause function returns cause value. |
9486
|
|
|
func (e TenantCreateResponseValidationError) Cause() error { return e.cause } |
9487
|
|
|
|
9488
|
|
|
// Key function returns key value. |
9489
|
|
|
func (e TenantCreateResponseValidationError) Key() bool { return e.key } |
9490
|
|
|
|
9491
|
|
|
// ErrorName returns error name. |
9492
|
|
|
func (e TenantCreateResponseValidationError) ErrorName() string { |
9493
|
|
|
return "TenantCreateResponseValidationError" |
9494
|
|
|
} |
9495
|
|
|
|
9496
|
|
|
// Error satisfies the builtin error interface |
9497
|
|
|
func (e TenantCreateResponseValidationError) Error() string { |
9498
|
|
|
cause := "" |
9499
|
|
|
if e.cause != nil { |
9500
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
9501
|
|
|
} |
9502
|
|
|
|
9503
|
|
|
key := "" |
9504
|
|
|
if e.key { |
9505
|
|
|
key = "key for " |
9506
|
|
|
} |
9507
|
|
|
|
9508
|
|
|
return fmt.Sprintf( |
9509
|
|
|
"invalid %sTenantCreateResponse.%s: %s%s", |
9510
|
|
|
key, |
9511
|
|
|
e.field, |
9512
|
|
|
e.reason, |
9513
|
|
|
cause) |
9514
|
|
|
} |
9515
|
|
|
|
9516
|
|
|
var _ error = TenantCreateResponseValidationError{} |
9517
|
|
|
|
9518
|
|
|
var _ interface { |
9519
|
|
|
Field() string |
9520
|
|
|
Reason() string |
9521
|
|
|
Key() bool |
9522
|
|
|
Cause() error |
9523
|
|
|
ErrorName() string |
9524
|
|
|
} = TenantCreateResponseValidationError{} |
9525
|
|
|
|
9526
|
|
|
// Validate checks the field values on TenantDeleteRequest with the rules |
9527
|
|
|
// defined in the proto definition for this message. If any rules are |
9528
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
9529
|
|
|
func (m *TenantDeleteRequest) Validate() error { |
9530
|
|
|
return m.validate(false) |
9531
|
|
|
} |
9532
|
|
|
|
9533
|
|
|
// ValidateAll checks the field values on TenantDeleteRequest with the rules |
9534
|
|
|
// defined in the proto definition for this message. If any rules are |
9535
|
|
|
// violated, the result is a list of violation errors wrapped in |
9536
|
|
|
// TenantDeleteRequestMultiError, or nil if none found. |
9537
|
|
|
func (m *TenantDeleteRequest) ValidateAll() error { |
9538
|
|
|
return m.validate(true) |
9539
|
|
|
} |
9540
|
|
|
|
9541
|
|
|
func (m *TenantDeleteRequest) validate(all bool) error { |
9542
|
|
|
if m == nil { |
9543
|
|
|
return nil |
9544
|
|
|
} |
9545
|
|
|
|
9546
|
|
|
var errors []error |
9547
|
|
|
|
9548
|
|
|
if len(errors) > 0 { |
9549
|
|
|
return TenantDeleteRequestMultiError(errors) |
9550
|
|
|
} |
9551
|
|
|
|
9552
|
|
|
return nil |
9553
|
|
|
} |
9554
|
|
|
|
9555
|
|
|
// TenantDeleteRequestMultiError is an error wrapping multiple validation |
9556
|
|
|
// errors returned by TenantDeleteRequest.ValidateAll() if the designated |
9557
|
|
|
// constraints aren't met. |
9558
|
|
|
type TenantDeleteRequestMultiError []error |
9559
|
|
|
|
9560
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
9561
|
|
|
func (m TenantDeleteRequestMultiError) Error() string { |
9562
|
|
|
var msgs []string |
9563
|
|
|
for _, err := range m { |
9564
|
|
|
msgs = append(msgs, err.Error()) |
9565
|
|
|
} |
9566
|
|
|
return strings.Join(msgs, "; ") |
9567
|
|
|
} |
9568
|
|
|
|
9569
|
|
|
// AllErrors returns a list of validation violation errors. |
9570
|
|
|
func (m TenantDeleteRequestMultiError) AllErrors() []error { return m } |
9571
|
|
|
|
9572
|
|
|
// TenantDeleteRequestValidationError is the validation error returned by |
9573
|
|
|
// TenantDeleteRequest.Validate if the designated constraints aren't met. |
9574
|
|
|
type TenantDeleteRequestValidationError struct { |
9575
|
|
|
field string |
9576
|
|
|
reason string |
9577
|
|
|
cause error |
9578
|
|
|
key bool |
9579
|
|
|
} |
9580
|
|
|
|
9581
|
|
|
// Field function returns field value. |
9582
|
|
|
func (e TenantDeleteRequestValidationError) Field() string { return e.field } |
9583
|
|
|
|
9584
|
|
|
// Reason function returns reason value. |
9585
|
|
|
func (e TenantDeleteRequestValidationError) Reason() string { return e.reason } |
9586
|
|
|
|
9587
|
|
|
// Cause function returns cause value. |
9588
|
|
|
func (e TenantDeleteRequestValidationError) Cause() error { return e.cause } |
9589
|
|
|
|
9590
|
|
|
// Key function returns key value. |
9591
|
|
|
func (e TenantDeleteRequestValidationError) Key() bool { return e.key } |
9592
|
|
|
|
9593
|
|
|
// ErrorName returns error name. |
9594
|
|
|
func (e TenantDeleteRequestValidationError) ErrorName() string { |
9595
|
|
|
return "TenantDeleteRequestValidationError" |
9596
|
|
|
} |
9597
|
|
|
|
9598
|
|
|
// Error satisfies the builtin error interface |
9599
|
|
|
func (e TenantDeleteRequestValidationError) Error() string { |
9600
|
|
|
cause := "" |
9601
|
|
|
if e.cause != nil { |
9602
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
9603
|
|
|
} |
9604
|
|
|
|
9605
|
|
|
key := "" |
9606
|
|
|
if e.key { |
9607
|
|
|
key = "key for " |
9608
|
|
|
} |
9609
|
|
|
|
9610
|
|
|
return fmt.Sprintf( |
9611
|
|
|
"invalid %sTenantDeleteRequest.%s: %s%s", |
9612
|
|
|
key, |
9613
|
|
|
e.field, |
9614
|
|
|
e.reason, |
9615
|
|
|
cause) |
9616
|
|
|
} |
9617
|
|
|
|
9618
|
|
|
var _ error = TenantDeleteRequestValidationError{} |
9619
|
|
|
|
9620
|
|
|
var _ interface { |
9621
|
|
|
Field() string |
9622
|
|
|
Reason() string |
9623
|
|
|
Key() bool |
9624
|
|
|
Cause() error |
9625
|
|
|
ErrorName() string |
9626
|
|
|
} = TenantDeleteRequestValidationError{} |
9627
|
|
|
|
9628
|
|
|
// Validate checks the field values on TenantDeleteResponse with the rules |
9629
|
|
|
// defined in the proto definition for this message. If any rules are |
9630
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
9631
|
|
|
func (m *TenantDeleteResponse) Validate() error { |
9632
|
|
|
return m.validate(false) |
9633
|
|
|
} |
9634
|
|
|
|
9635
|
|
|
// ValidateAll checks the field values on TenantDeleteResponse with the rules |
9636
|
|
|
// defined in the proto definition for this message. If any rules are |
9637
|
|
|
// violated, the result is a list of violation errors wrapped in |
9638
|
|
|
// TenantDeleteResponseMultiError, or nil if none found. |
9639
|
|
|
func (m *TenantDeleteResponse) ValidateAll() error { |
9640
|
|
|
return m.validate(true) |
9641
|
|
|
} |
9642
|
|
|
|
9643
|
|
|
func (m *TenantDeleteResponse) validate(all bool) error { |
9644
|
|
|
if m == nil { |
9645
|
|
|
return nil |
9646
|
|
|
} |
9647
|
|
|
|
9648
|
|
|
var errors []error |
9649
|
|
|
|
9650
|
|
|
if all { |
9651
|
|
|
switch v := interface{}(m.GetTenant()).(type) { |
9652
|
|
|
case interface{ ValidateAll() error }: |
9653
|
|
|
if err := v.ValidateAll(); err != nil { |
9654
|
|
|
errors = append(errors, TenantDeleteResponseValidationError{ |
9655
|
|
|
field: "Tenant", |
9656
|
|
|
reason: "embedded message failed validation", |
9657
|
|
|
cause: err, |
9658
|
|
|
}) |
9659
|
|
|
} |
9660
|
|
|
case interface{ Validate() error }: |
9661
|
|
|
if err := v.Validate(); err != nil { |
9662
|
|
|
errors = append(errors, TenantDeleteResponseValidationError{ |
9663
|
|
|
field: "Tenant", |
9664
|
|
|
reason: "embedded message failed validation", |
9665
|
|
|
cause: err, |
9666
|
|
|
}) |
9667
|
|
|
} |
9668
|
|
|
} |
9669
|
|
|
} else if v, ok := interface{}(m.GetTenant()).(interface{ Validate() error }); ok { |
9670
|
|
|
if err := v.Validate(); err != nil { |
9671
|
|
|
return TenantDeleteResponseValidationError{ |
9672
|
|
|
field: "Tenant", |
9673
|
|
|
reason: "embedded message failed validation", |
9674
|
|
|
cause: err, |
9675
|
|
|
} |
9676
|
|
|
} |
9677
|
|
|
} |
9678
|
|
|
|
9679
|
|
|
if len(errors) > 0 { |
9680
|
|
|
return TenantDeleteResponseMultiError(errors) |
9681
|
|
|
} |
9682
|
|
|
|
9683
|
|
|
return nil |
9684
|
|
|
} |
9685
|
|
|
|
9686
|
|
|
// TenantDeleteResponseMultiError is an error wrapping multiple validation |
9687
|
|
|
// errors returned by TenantDeleteResponse.ValidateAll() if the designated |
9688
|
|
|
// constraints aren't met. |
9689
|
|
|
type TenantDeleteResponseMultiError []error |
9690
|
|
|
|
9691
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
9692
|
|
|
func (m TenantDeleteResponseMultiError) Error() string { |
9693
|
|
|
var msgs []string |
9694
|
|
|
for _, err := range m { |
9695
|
|
|
msgs = append(msgs, err.Error()) |
9696
|
|
|
} |
9697
|
|
|
return strings.Join(msgs, "; ") |
9698
|
|
|
} |
9699
|
|
|
|
9700
|
|
|
// AllErrors returns a list of validation violation errors. |
9701
|
|
|
func (m TenantDeleteResponseMultiError) AllErrors() []error { return m } |
9702
|
|
|
|
9703
|
|
|
// TenantDeleteResponseValidationError is the validation error returned by |
9704
|
|
|
// TenantDeleteResponse.Validate if the designated constraints aren't met. |
9705
|
|
|
type TenantDeleteResponseValidationError struct { |
9706
|
|
|
field string |
9707
|
|
|
reason string |
9708
|
|
|
cause error |
9709
|
|
|
key bool |
9710
|
|
|
} |
9711
|
|
|
|
9712
|
|
|
// Field function returns field value. |
9713
|
|
|
func (e TenantDeleteResponseValidationError) Field() string { return e.field } |
9714
|
|
|
|
9715
|
|
|
// Reason function returns reason value. |
9716
|
|
|
func (e TenantDeleteResponseValidationError) Reason() string { return e.reason } |
9717
|
|
|
|
9718
|
|
|
// Cause function returns cause value. |
9719
|
|
|
func (e TenantDeleteResponseValidationError) Cause() error { return e.cause } |
9720
|
|
|
|
9721
|
|
|
// Key function returns key value. |
9722
|
|
|
func (e TenantDeleteResponseValidationError) Key() bool { return e.key } |
9723
|
|
|
|
9724
|
|
|
// ErrorName returns error name. |
9725
|
|
|
func (e TenantDeleteResponseValidationError) ErrorName() string { |
9726
|
|
|
return "TenantDeleteResponseValidationError" |
9727
|
|
|
} |
9728
|
|
|
|
9729
|
|
|
// Error satisfies the builtin error interface |
9730
|
|
|
func (e TenantDeleteResponseValidationError) Error() string { |
9731
|
|
|
cause := "" |
9732
|
|
|
if e.cause != nil { |
9733
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
9734
|
|
|
} |
9735
|
|
|
|
9736
|
|
|
key := "" |
9737
|
|
|
if e.key { |
9738
|
|
|
key = "key for " |
9739
|
|
|
} |
9740
|
|
|
|
9741
|
|
|
return fmt.Sprintf( |
9742
|
|
|
"invalid %sTenantDeleteResponse.%s: %s%s", |
9743
|
|
|
key, |
9744
|
|
|
e.field, |
9745
|
|
|
e.reason, |
9746
|
|
|
cause) |
9747
|
|
|
} |
9748
|
|
|
|
9749
|
|
|
var _ error = TenantDeleteResponseValidationError{} |
9750
|
|
|
|
9751
|
|
|
var _ interface { |
9752
|
|
|
Field() string |
9753
|
|
|
Reason() string |
9754
|
|
|
Key() bool |
9755
|
|
|
Cause() error |
9756
|
|
|
ErrorName() string |
9757
|
|
|
} = TenantDeleteResponseValidationError{} |
9758
|
|
|
|
9759
|
|
|
// Validate checks the field values on TenantListRequest with the rules defined |
9760
|
|
|
// in the proto definition for this message. If any rules are violated, the |
9761
|
|
|
// first error encountered is returned, or nil if there are no violations. |
9762
|
|
|
func (m *TenantListRequest) Validate() error { |
9763
|
|
|
return m.validate(false) |
9764
|
|
|
} |
9765
|
|
|
|
9766
|
|
|
// ValidateAll checks the field values on TenantListRequest with the rules |
9767
|
|
|
// defined in the proto definition for this message. If any rules are |
9768
|
|
|
// violated, the result is a list of violation errors wrapped in |
9769
|
|
|
// TenantListRequestMultiError, or nil if none found. |
9770
|
|
|
func (m *TenantListRequest) ValidateAll() error { |
9771
|
|
|
return m.validate(true) |
9772
|
|
|
} |
9773
|
|
|
|
9774
|
|
|
func (m *TenantListRequest) validate(all bool) error { |
9775
|
|
|
if m == nil { |
9776
|
|
|
return nil |
9777
|
|
|
} |
9778
|
|
|
|
9779
|
|
|
var errors []error |
9780
|
|
|
|
9781
|
|
|
if m.GetPageSize() != 0 { |
9782
|
|
|
|
9783
|
|
|
if m.GetPageSize() < 1 { |
9784
|
|
|
err := TenantListRequestValidationError{ |
9785
|
|
|
field: "PageSize", |
9786
|
|
|
reason: "value must be greater than or equal to 1", |
9787
|
|
|
} |
9788
|
|
|
if !all { |
9789
|
|
|
return err |
9790
|
|
|
} |
9791
|
|
|
errors = append(errors, err) |
9792
|
|
|
} |
9793
|
|
|
|
9794
|
|
|
} |
9795
|
|
|
|
9796
|
|
|
if m.GetContinuousToken() != "" { |
9797
|
|
|
|
9798
|
|
|
} |
9799
|
|
|
|
9800
|
|
|
if len(errors) > 0 { |
9801
|
|
|
return TenantListRequestMultiError(errors) |
9802
|
|
|
} |
9803
|
|
|
|
9804
|
|
|
return nil |
9805
|
|
|
} |
9806
|
|
|
|
9807
|
|
|
// TenantListRequestMultiError is an error wrapping multiple validation errors |
9808
|
|
|
// returned by TenantListRequest.ValidateAll() if the designated constraints |
9809
|
|
|
// aren't met. |
9810
|
|
|
type TenantListRequestMultiError []error |
9811
|
|
|
|
9812
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
9813
|
|
|
func (m TenantListRequestMultiError) Error() string { |
9814
|
|
|
var msgs []string |
9815
|
|
|
for _, err := range m { |
9816
|
|
|
msgs = append(msgs, err.Error()) |
9817
|
|
|
} |
9818
|
|
|
return strings.Join(msgs, "; ") |
9819
|
|
|
} |
9820
|
|
|
|
9821
|
|
|
// AllErrors returns a list of validation violation errors. |
9822
|
|
|
func (m TenantListRequestMultiError) AllErrors() []error { return m } |
9823
|
|
|
|
9824
|
|
|
// TenantListRequestValidationError is the validation error returned by |
9825
|
|
|
// TenantListRequest.Validate if the designated constraints aren't met. |
9826
|
|
|
type TenantListRequestValidationError struct { |
9827
|
|
|
field string |
9828
|
|
|
reason string |
9829
|
|
|
cause error |
9830
|
|
|
key bool |
9831
|
|
|
} |
9832
|
|
|
|
9833
|
|
|
// Field function returns field value. |
9834
|
|
|
func (e TenantListRequestValidationError) Field() string { return e.field } |
9835
|
|
|
|
9836
|
|
|
// Reason function returns reason value. |
9837
|
|
|
func (e TenantListRequestValidationError) Reason() string { return e.reason } |
9838
|
|
|
|
9839
|
|
|
// Cause function returns cause value. |
9840
|
|
|
func (e TenantListRequestValidationError) Cause() error { return e.cause } |
9841
|
|
|
|
9842
|
|
|
// Key function returns key value. |
9843
|
|
|
func (e TenantListRequestValidationError) Key() bool { return e.key } |
9844
|
|
|
|
9845
|
|
|
// ErrorName returns error name. |
9846
|
|
|
func (e TenantListRequestValidationError) ErrorName() string { |
9847
|
|
|
return "TenantListRequestValidationError" |
9848
|
|
|
} |
9849
|
|
|
|
9850
|
|
|
// Error satisfies the builtin error interface |
9851
|
|
|
func (e TenantListRequestValidationError) Error() string { |
9852
|
|
|
cause := "" |
9853
|
|
|
if e.cause != nil { |
9854
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
9855
|
|
|
} |
9856
|
|
|
|
9857
|
|
|
key := "" |
9858
|
|
|
if e.key { |
9859
|
|
|
key = "key for " |
9860
|
|
|
} |
9861
|
|
|
|
9862
|
|
|
return fmt.Sprintf( |
9863
|
|
|
"invalid %sTenantListRequest.%s: %s%s", |
9864
|
|
|
key, |
9865
|
|
|
e.field, |
9866
|
|
|
e.reason, |
9867
|
|
|
cause) |
9868
|
|
|
} |
9869
|
|
|
|
9870
|
|
|
var _ error = TenantListRequestValidationError{} |
9871
|
|
|
|
9872
|
|
|
var _ interface { |
9873
|
|
|
Field() string |
9874
|
|
|
Reason() string |
9875
|
|
|
Key() bool |
9876
|
|
|
Cause() error |
9877
|
|
|
ErrorName() string |
9878
|
|
|
} = TenantListRequestValidationError{} |
9879
|
|
|
|
9880
|
|
|
// Validate checks the field values on TenantListResponse with the rules |
9881
|
|
|
// defined in the proto definition for this message. If any rules are |
9882
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
9883
|
|
|
func (m *TenantListResponse) Validate() error { |
9884
|
|
|
return m.validate(false) |
9885
|
|
|
} |
9886
|
|
|
|
9887
|
|
|
// ValidateAll checks the field values on TenantListResponse with the rules |
9888
|
|
|
// defined in the proto definition for this message. If any rules are |
9889
|
|
|
// violated, the result is a list of violation errors wrapped in |
9890
|
|
|
// TenantListResponseMultiError, or nil if none found. |
9891
|
|
|
func (m *TenantListResponse) ValidateAll() error { |
9892
|
|
|
return m.validate(true) |
9893
|
|
|
} |
9894
|
|
|
|
9895
|
|
|
func (m *TenantListResponse) validate(all bool) error { |
9896
|
|
|
if m == nil { |
9897
|
|
|
return nil |
9898
|
|
|
} |
9899
|
|
|
|
9900
|
|
|
var errors []error |
9901
|
|
|
|
9902
|
|
|
for idx, item := range m.GetTenants() { |
9903
|
|
|
_, _ = idx, item |
9904
|
|
|
|
9905
|
|
|
if all { |
9906
|
|
|
switch v := interface{}(item).(type) { |
9907
|
|
|
case interface{ ValidateAll() error }: |
9908
|
|
|
if err := v.ValidateAll(); err != nil { |
9909
|
|
|
errors = append(errors, TenantListResponseValidationError{ |
9910
|
|
|
field: fmt.Sprintf("Tenants[%v]", idx), |
9911
|
|
|
reason: "embedded message failed validation", |
9912
|
|
|
cause: err, |
9913
|
|
|
}) |
9914
|
|
|
} |
9915
|
|
|
case interface{ Validate() error }: |
9916
|
|
|
if err := v.Validate(); err != nil { |
9917
|
|
|
errors = append(errors, TenantListResponseValidationError{ |
9918
|
|
|
field: fmt.Sprintf("Tenants[%v]", idx), |
9919
|
|
|
reason: "embedded message failed validation", |
9920
|
|
|
cause: err, |
9921
|
|
|
}) |
9922
|
|
|
} |
9923
|
|
|
} |
9924
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
9925
|
|
|
if err := v.Validate(); err != nil { |
9926
|
|
|
return TenantListResponseValidationError{ |
9927
|
|
|
field: fmt.Sprintf("Tenants[%v]", idx), |
9928
|
|
|
reason: "embedded message failed validation", |
9929
|
|
|
cause: err, |
9930
|
|
|
} |
9931
|
|
|
} |
9932
|
|
|
} |
9933
|
|
|
|
9934
|
|
|
} |
9935
|
|
|
|
9936
|
|
|
// no validation rules for ContinuousToken |
9937
|
|
|
|
9938
|
|
|
if len(errors) > 0 { |
9939
|
|
|
return TenantListResponseMultiError(errors) |
9940
|
|
|
} |
9941
|
|
|
|
9942
|
|
|
return nil |
9943
|
|
|
} |
9944
|
|
|
|
9945
|
|
|
// TenantListResponseMultiError is an error wrapping multiple validation errors |
9946
|
|
|
// returned by TenantListResponse.ValidateAll() if the designated constraints |
9947
|
|
|
// aren't met. |
9948
|
|
|
type TenantListResponseMultiError []error |
9949
|
|
|
|
9950
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
9951
|
|
|
func (m TenantListResponseMultiError) Error() string { |
9952
|
|
|
var msgs []string |
9953
|
|
|
for _, err := range m { |
9954
|
|
|
msgs = append(msgs, err.Error()) |
9955
|
|
|
} |
9956
|
|
|
return strings.Join(msgs, "; ") |
9957
|
|
|
} |
9958
|
|
|
|
9959
|
|
|
// AllErrors returns a list of validation violation errors. |
9960
|
|
|
func (m TenantListResponseMultiError) AllErrors() []error { return m } |
9961
|
|
|
|
9962
|
|
|
// TenantListResponseValidationError is the validation error returned by |
9963
|
|
|
// TenantListResponse.Validate if the designated constraints aren't met. |
9964
|
|
|
type TenantListResponseValidationError struct { |
9965
|
|
|
field string |
9966
|
|
|
reason string |
9967
|
|
|
cause error |
9968
|
|
|
key bool |
9969
|
|
|
} |
9970
|
|
|
|
9971
|
|
|
// Field function returns field value. |
9972
|
|
|
func (e TenantListResponseValidationError) Field() string { return e.field } |
9973
|
|
|
|
9974
|
|
|
// Reason function returns reason value. |
9975
|
|
|
func (e TenantListResponseValidationError) Reason() string { return e.reason } |
9976
|
|
|
|
9977
|
|
|
// Cause function returns cause value. |
9978
|
|
|
func (e TenantListResponseValidationError) Cause() error { return e.cause } |
9979
|
|
|
|
9980
|
|
|
// Key function returns key value. |
9981
|
|
|
func (e TenantListResponseValidationError) Key() bool { return e.key } |
9982
|
|
|
|
9983
|
|
|
// ErrorName returns error name. |
9984
|
|
|
func (e TenantListResponseValidationError) ErrorName() string { |
9985
|
|
|
return "TenantListResponseValidationError" |
9986
|
|
|
} |
9987
|
|
|
|
9988
|
|
|
// Error satisfies the builtin error interface |
9989
|
|
|
func (e TenantListResponseValidationError) Error() string { |
9990
|
|
|
cause := "" |
9991
|
|
|
if e.cause != nil { |
9992
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
9993
|
|
|
} |
9994
|
|
|
|
9995
|
|
|
key := "" |
9996
|
|
|
if e.key { |
9997
|
|
|
key = "key for " |
9998
|
|
|
} |
9999
|
|
|
|
10000
|
|
|
return fmt.Sprintf( |
10001
|
|
|
"invalid %sTenantListResponse.%s: %s%s", |
10002
|
|
|
key, |
10003
|
|
|
e.field, |
10004
|
|
|
e.reason, |
10005
|
|
|
cause) |
10006
|
|
|
} |
10007
|
|
|
|
10008
|
|
|
var _ error = TenantListResponseValidationError{} |
10009
|
|
|
|
10010
|
|
|
var _ interface { |
10011
|
|
|
Field() string |
10012
|
|
|
Reason() string |
10013
|
|
|
Key() bool |
10014
|
|
|
Cause() error |
10015
|
|
|
ErrorName() string |
10016
|
|
|
} = TenantListResponseValidationError{} |
10017
|
|
|
|