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